PhpSpreadsheet/samples
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
..
Autofilter Autofilter Part 2 2021-06-24 10:09:21 +02:00
Basic Copy from Xls(x) to Html/Pdf Loses Drawings (#2788) 2022-05-07 08:10:24 -07:00
Calculations Additional unit tests for HLOOKUP() and VLOOKUP() and Examples for VLOOKUP() 2021-05-29 13:35:42 +02:00
Chart Scrutinizer Complains Some Samples Class Name Conflict with Jpgraph (#2684) 2022-03-16 15:59:53 -07:00
ConditionalFormatting Handle the case of an invalid formula by defaulting to ptgInt + 0, which will avoid breaking the file 2022-03-13 10:53:07 +01:00
DefinedNames Make DefinedNames Samples Consistent With Other Samples (#1707) 2020-11-11 11:02:04 +01:00
Pdf Mpdf With Very Many Styles (#2434) 2021-12-07 10:46:21 -08:00
Reader Resolve Scrutinizer Reports for Samples (#2691) 2022-03-21 13:17:25 -07:00
Reading_workbook_data Document Properties - Coverage and 32-bit-safe Timestamps (#2113) 2021-05-30 13:55:58 +02:00
Table Table name as an constructor argument 2022-04-17 17:48:38 +05:30
bootstrap Update Jquery to V3.6 2021-11-24 09:12:46 +09:00
images Special Characters in Image File Name (#2416) 2021-12-06 06:50:09 -08:00
templates Scrutinizer Complains Some Samples Class Name Conflict with Jpgraph (#2684) 2022-03-16 15:59:53 -07:00
Bootstrap.php Keep sample bootstrap purely in samples 2020-05-17 18:51:13 +09:00
Header.php Keep sample bootstrap purely in samples 2020-05-17 18:51:13 +09:00
favicon.ico Update Jquery to V3.6 2021-11-24 09:12:46 +09:00
index.php Drop PHP 7.2 2021-11-01 12:01:54 +09:00