Skip to content

Commit bb072d1

Browse files
authored
Upgrade Dev TCPDF to 6.5 (#3006)
* Upgrade Dev TCPDF to 6.5 Implementation of tecnickcom/TCPDF#467, which is available in just-released Tcpdf 6.5, will improve look of Tcpdf rendering for PhpSpreadsheet. Fix #1164. One test had been suppressed for Tcpdf, ostensibly because it was not compatible with Php8. As it turns out, the PhpSpreadsheet code which invokes Tcpdf was (harmlessly) incorrect, so the Php8 issue was actually with PhpSpreadsheet, not Tcpdf. That code is corrected, and the test is no longer suppressed. * Update Change Log Pick up some earlier changes as well as this one, and deprecations which had been omitted from the 1.24 change log.
1 parent fadfb72 commit bb072d1

File tree

5 files changed

+29
-17
lines changed

5 files changed

+29
-17
lines changed

CHANGELOG.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,20 @@ and this project adheres to [Semantic Versioning](https://semver.org).
1313
- Implementation of the `ARRAYTOTEXT()` Excel Function
1414
- Support for [mitoteam/jpgraph](https://packagist.org/packages/mitoteam/jpgraph) implementation of
1515
JpGraph library to render charts added.
16+
- Charts: Add Gradients, Transparency, Hidden Axes, Rounded Corners, Trendlines.
1617

1718
### Changed
1819

1920
- Nothing
2021

2122
### Deprecated
2223

23-
- Nothing
24+
- Axis getLineProperty deprecated in favor of getLineColorProperty.
25+
- Moved majorGridlines and minorGridlines from Chart to Axis. Setting either in Chart constructor or through Chart methods, or getting either using Chart methods is deprecated.
26+
- Chart::EXCEL_COLOR_TYPE_* copied from Properties to ChartColor; use in Properties is deprecated.
27+
- ChartColor::EXCEL_COLOR_TYPE_ARGB deprecated in favor of EXCEL_COLOR_TYPE_RGB ("A" component was never allowed).
28+
- Misspelled Properties::LINE_STYLE_DASH_SQUERE_DOT deprecated in favor of LINE_STYLE_DASH_SQUARE_DOT.
29+
- Clone not permitted for Spreadsheet. Spreadsheet->copy() can be used instead.
2430

2531
### Removed
2632

@@ -30,6 +36,14 @@ and this project adheres to [Semantic Versioning](https://semver.org).
3036

3137
- Fully flatten an array [Issue #2955](https://github.com/PHPOffice/PhpSpreadsheet/issues/2955) [PR #2956](https://github.com/PHPOffice/PhpSpreadsheet/pull/2956)
3238
- cellExists() and getCell() methods should support UTF-8 named cells [Issue #2987](https://github.com/PHPOffice/PhpSpreadsheet/issues/2987) [PR #2988](https://github.com/PHPOffice/PhpSpreadsheet/pull/2988)
39+
- Spreadsheet copy fixed, clone disabled. [PR #2951](https://github.com/PHPOffice/PhpSpreadsheet/pull/2951)
40+
- Fix PDF problems with text rotation and paper size. [Issue #1747](https://github.com/PHPOffice/PhpSpreadsheet/issues/1747) [Issue #1713](https://github.com/PHPOffice/PhpSpreadsheet/issues/1713) [PR #2960](https://github.com/PHPOffice/PhpSpreadsheet/pull/2960)
41+
- Limited support for chart titles as formulas [Issue #2965](https://github.com/PHPOffice/PhpSpreadsheet/issues/2965) [Issue #749](https://github.com/PHPOffice/PhpSpreadsheet/issues/749) [PR #2971](https://github.com/PHPOffice/PhpSpreadsheet/pull/2971)
42+
- Add Gradients, Transparency, and Hidden Axes to Chart [Issue #2257](https://github.com/PHPOffice/PhpSpreadsheet/issues/2257) [Issue #2229](https://github.com/PHPOffice/PhpSpreadsheet/issues/2929) [Issue #2935](https://github.com/PHPOffice/PhpSpreadsheet/issues/2935) [PR #2950](https://github.com/PHPOffice/PhpSpreadsheet/pull/2950)
43+
- Chart Support for Rounded Corners and Trendlines [Issue #2968](https://github.com/PHPOffice/PhpSpreadsheet/issues/2968) [Issue #2815](https://github.com/PHPOffice/PhpSpreadsheet/issues/2815) [PR #2976](https://github.com/PHPOffice/PhpSpreadsheet/pull/2976)
44+
- Add setName Method for Chart [Issue #2991](https://github.com/PHPOffice/PhpSpreadsheet/issues/2991) [PR #3001](https://github.com/PHPOffice/PhpSpreadsheet/pull/3001)
45+
- Eliminate partial dependency on php-intl in StringHelper [Issue #2982](https://github.com/PHPOffice/PhpSpreadsheet/issues/2982) [PR #2994](https://github.com/PHPOffice/PhpSpreadsheet/pull/2994)
46+
- Minor changes for Pdf [Issue #2999](https://github.com/PHPOffice/PhpSpreadsheet/issues/2999) [PR #3002](https://github.com/PHPOffice/PhpSpreadsheet/pull/3002) [PR #3006](https://github.com/PHPOffice/PhpSpreadsheet/pull/3006)
3347

3448
## 1.24.1 - 2022-07-18
3549

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@
8888
"phpstan/phpstan-phpunit": "^1.0",
8989
"phpunit/phpunit": "^8.5 || ^9.0",
9090
"squizlabs/php_codesniffer": "^3.7",
91-
"tecnickcom/tcpdf": "^6.4"
91+
"tecnickcom/tcpdf": "6.5"
9292
},
9393
"suggest": {
9494
"ext-intl": "PHP Internationalization Functions",
9595
"mpdf/mpdf": "Option for rendering PDF with PDF Writer",
9696
"dompdf/dompdf": "Option for rendering PDF with PDF Writer",
97-
"tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer (doesn't yet fully support PHP8)",
97+
"tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer",
9898
"mitoteam/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers"
9999
},
100100
"autoload": {

composer.lock

Lines changed: 10 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/PhpSpreadsheet/Writer/Pdf/Tcpdf.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function save($filename, int $flags = 0): void
7777
$pdf->SetCreator($this->spreadsheet->getProperties()->getCreator());
7878

7979
// Write to file
80-
fwrite($fileHandle, $pdf->output($filename, 'S'));
80+
fwrite($fileHandle, $pdf->output('', 'S'));
8181

8282
parent::restoreStateAfterSave();
8383
}

tests/PhpSpreadsheetTests/Functional/StreamTest.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,9 @@ public function providerFormats(): array
1818
['Html'],
1919
['Mpdf'],
2020
['Dompdf'],
21+
['Tcpdf'],
2122
];
2223

23-
if (\PHP_VERSION_ID < 80000) {
24-
$providerFormats = array_merge(
25-
$providerFormats,
26-
[['Tcpdf']]
27-
);
28-
}
29-
3024
return $providerFormats;
3125
}
3226

0 commit comments

Comments
 (0)