PhpSpreadsheet/samples/Basic
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
..
data/continents
01_Simple.php Document Properties - Coverage and 32-bit-safe Timestamps (#2113) 2021-05-30 13:55:58 +02:00
01_Simple_download_ods.php Keep sample bootstrap purely in samples 2020-05-17 18:51:13 +09:00
01_Simple_download_pdf.php Keep sample bootstrap purely in samples 2020-05-17 18:51:13 +09:00
01_Simple_download_xls.php Keep sample bootstrap purely in samples 2020-05-17 18:51:13 +09:00
01_Simple_download_xlsx.php Keep sample bootstrap purely in samples 2020-05-17 18:51:13 +09:00
02_Types.php Fixed handling of inline strings in XLSX (#2569) 2022-02-12 06:55:48 -08:00
03_Formulas.php Update to PHP-CS-Fixer 2.10 2018-01-28 15:59:38 +09:00
04_Printing.php Update to PHP-CS-Fixer 2.10 2018-01-28 15:59:38 +09:00
05_Feature_demo.php
05_UnexpectedCharacters.php Special Characters in Image File Name (#2416) 2021-12-06 06:50:09 -08:00
06_Largescale.php
07_Reader.php Testing - Delete Temp Files When No Longer Needed (#1488) 2020-05-24 20:03:07 +09:00
08_Conditional_formatting.php Upgrade to latest PHP_CodeSniffer 2018-08-06 11:02:16 +09:00
08_Conditional_formatting_2.php Upgrade to latest PHP_CodeSniffer 2018-08-06 11:02:16 +09:00
09_Pagebreaks.php Update to PHP-CS-Fixer 2.10 2018-01-28 15:59:38 +09:00
11_Documentsecurity.php Update to PHP-CS-Fixer 2.10 2018-01-28 15:59:38 +09:00
12_CellProtection.php Update to PHP-CS-Fixer 2.10 2018-01-28 15:59:38 +09:00
13_Calculation.php PSR12 code style 2020-07-26 14:13:11 +09:00
13_CalculationCyclicFormulae.php PSR12 code style 2020-07-26 14:13:11 +09:00
14_Xls.php
15_Datavalidation.php Update to PHP-CS-Fixer 2.10 2018-01-28 15:59:38 +09:00
16_Csv.php Fix for Issue 2042 (SUM Partially Broken) (#2045) 2021-05-03 18:31:01 +02:00
17_Html.php
17a_Html.php Improve HTML Writer (#1464) 2020-05-18 12:43:18 +09:00
17b_Html.php Different Example for Callback 2020-06-09 00:22:22 -07:00
18_Extendedcalculation.php Rename classes to keep them in their related namespaces 2017-10-29 17:39:42 +09:00
19_Namedrange.php Two Problems with Sample19 2021-05-09 15:41:36 -07:00
20_Read_Excel2003XML.php Improving Coverage for Excel2003 XML Reader (#1557) 2020-10-11 13:26:56 +02:00
20_Read_Gnumeric.php
20_Read_Ods.php
20_Read_Sylk.php
20_Read_Xls.php Testing - Delete Temp Files When No Longer Needed (#1488) 2020-05-24 20:03:07 +09:00
22_Heavily_formatted.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
23_Sharedstyles.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
24_Readfilter.php Work on renaming method arguments for the Readers and Writers 2020-11-19 16:41:52 +01:00
25_In_memory_image.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
26_Utf8.php Remove tests that include tcPDF and DomPDF libraries when running against PHP8, because neither library is yet PHP8-ready 2020-10-09 14:31:16 +02:00
27_Images_Html_Pdf.php Copy from Xls(x) to Html/Pdf Loses Drawings (#2788) 2022-05-07 08:10:24 -07:00
27_Images_Xls.php
28_Iterator.php Testing - Delete Temp Files When No Longer Needed (#1488) 2020-05-24 20:03:07 +09:00
29_Advanced_value_binder.php Update to PHP-CS-Fixer 2.10 2018-01-28 15:59:38 +09:00
30_Template.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
30_Templatebiff5.php Stacked Alignment - Use Class Constant Rather than Literal (#1716) 2021-02-03 23:53:04 +01:00
31_Document_properties_write.php Minor improvements (#1028) 2019-06-22 21:24:51 +02:00
31_Document_properties_write_xls.php Minor improvements (#1028) 2019-06-22 21:24:51 +02:00
37_Page_layout_view.php Update to PHP-CS-Fixer 2.10 2018-01-28 15:59:38 +09:00
38_Clone_worksheet.php Update to PHP-CS-Fixer 2.10 2018-01-28 15:59:38 +09:00
39_Dropdown.php Fix Sample39 (#2664) 2022-03-09 18:55:31 -08:00
40_Duplicate_style.php Additional conditionals from math trig (#1885) 2021-02-28 10:24:33 +01:00
41_Password.php
42_RichText.php Improve Coverage for HTML Reader 2020-06-25 22:42:38 -07:00
43_Merge_workbooks.php Initial Formula Translation tests (#1886) 2021-02-28 13:18:51 +01:00
44_Worksheet_info.php Resolve Scrutinizer Reports for Samples (#2691) 2022-03-21 13:17:25 -07:00
45_Quadratic_equation_solver.php Changes to the default arguments for `htmlspecialchars()` and `html_entity_decode()` requires setting of the argument value explicitly to prevent changes in behaviour. (#2176) 2021-06-21 12:56:03 +02:00
46_ReadHtml.php
47_xlsfill.php Fill Pattern Start and End Colors (#2444) 2021-12-18 08:53:23 -08:00
47_xlsxfill.php Fill Pattern Start and End Colors (#2444) 2021-12-18 08:53:23 -08:00
48_Image_move_size_with_cells.php Add editAs Property for 2-cell Anchor Drawings (#2674) 2022-03-16 16:12:38 -07:00