PhpSpreadsheet/tests/PhpSpreadsheetTests/Writer
oleibman a32861a0a0
Copy from Xls(x) to Html/Pdf Loses Drawings (#2788)
Drawings in an Xlsx file are stored in such a way that Php can read their contents using the `zip:` protocol. This does not, however, work when the file is read by PhpSpreadsheet and then saved as Html or Pdf, since the browser will not recognize that protocol even if the file is available. Such drawings need to be saved in the html as embedded images in order for the copy to display them properly. This is true even when the writer is set to not embed images (default).

An additional problem arises when an Html file with an embedded image is read, because `Worksheet\Drawing::setPath` attempts to validate the path, which it cannot do for the `data:image` Url which embedded images use.

And yet another problem. Writer/Html writes out a MemoryDrawing as a png using the imagepng function; but then declares it as jpeg in the Html. This is now corrected.

And a fourth problem. Writer/Html ignores the last row if it contains nothing but a Memory Drawing, which can be true when copying an Xls file.

These changes are testable (it's how I discovered the second part of this parlay). I think it is also useful to add a sample to see the results of this type of copy.
2022-05-07 08:10:24 -07:00
..
Csv Csv Handling of Booleans (and an 8.1 Deprecation) (#2232) 2021-08-04 07:00:17 -07:00
Html Copy from Xls(x) to Html/Pdf Loses Drawings (#2788) 2022-05-07 08:10:24 -07:00
Mpdf Copy from Xls(x) to Html/Pdf Loses Drawings (#2788) 2022-05-07 08:10:24 -07:00
Ods Unit tests for merge ranges for Ods Reader/Writer 2022-02-26 22:51:15 +01:00
Xls Merge branch 'master' into PHP8-Sane-Property-Names 2021-10-31 15:25:01 +09:00
Xlsx Add editAs Property for 2-cell Anchor Drawings (#2674) 2022-03-16 16:12:38 -07:00
PreCalcTest.php Ods Writer support for setting column width/row height (including Autosizing) 2022-04-17 11:34:39 +02:00
RetainSelectedCellsTest.php Reduce PHPStan error in tests 2021-04-12 11:10:23 +09:00