PhpSpreadsheet/samples/Basic
Owen Leibman edc411e6dd Add ability to save edited Html/Pdf
We give users the ability to edit Html/Pdf, but it's a little cumbersome
to use the edited Html for an Html file, and difficult to use it
for a Pdf. I believe we could make it fairly painless in both cases
by allowing the user to set a callback to edit the generated Html.
This can be accomplished with fewer than a dozen lines of very simple code.
I think this would be easier than grabbing the Html in pieces,
editing it, and reassembling it. I think it would also be simpler
than an alternative I considered, namely the addition of a new method
(e.g. saveEditedHtml) to each of the Html and Pdf writers.

One edit that users might like to make when editing html is to add
fallback fonts, something that is not currently available in
PhpSpreadsheet, and might be difficult to add. A natural extension to
that idea would be the use of webfonts, something which is guaranteed
difficult to add. See samples/Basic/17b_Html for an example of this.

None of the PDF writers support webfonts yet. That doesn't mean they
won't do so in future, but, for now, samples/Pdf/21a_Pdf is a prosaic
example of something you could do with this callback. In fact, this
opens the door to letting the user replace the entire body with data
of their choosing, effectively allowing PhpSpreadsheet (where you can
set things like paper size and orientation) to be used as a front-end to
the Pdf processor without the user having to be be overly familiar with
the vagaries of the PDF processor. I think this is actually a pretty
nice idea. YMMV. See samples/Basic/21b_Pdf for an example.
2020-05-30 21:27:35 -07:00
..
data/continents Merge all examples together 2017-10-01 17:48:59 +09:00
01_Simple.php Removed unnecessary object creation. (#1430) 2020-04-27 12:02:49 +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 Update to PHP-CS-Fixer 2.10 2018-01-28 15:59:38 +09: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 Merge all examples together 2017-10-01 17:48:59 +09:00
06_Largescale.php Merge all examples together 2017-10-01 17:48:59 +09:00
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 Rename classes to keep them in their related namespaces 2017-10-29 17:39:42 +09:00
13_CalculationCyclicFormulae.php Improve Coverage for CSV (#1475) 2020-05-17 18:15:18 +09:00
14_Xls.php Merge all examples together 2017-10-01 17:48:59 +09:00
15_Datavalidation.php Update to PHP-CS-Fixer 2.10 2018-01-28 15:59:38 +09:00
16_Csv.php Testing - Delete Temp Files When No Longer Needed (#1488) 2020-05-24 20:03:07 +09:00
17_Html.php Merge all examples together 2017-10-01 17:48:59 +09:00
17a_Html.php Improve HTML Writer (#1464) 2020-05-18 12:43:18 +09:00
17b_Html.php Add ability to save edited Html/Pdf 2020-05-30 21:27:35 -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 Update to PHP-CS-Fixer 2.10 2018-01-28 15:59:38 +09:00
20_Read_Excel2003XML.php Merge all examples together 2017-10-01 17:48:59 +09:00
20_Read_Gnumeric.php Merge all examples together 2017-10-01 17:48:59 +09:00
20_Read_Ods.php Merge all examples together 2017-10-01 17:48:59 +09:00
20_Read_Sylk.php Merge all examples together 2017-10-01 17:48:59 +09:00
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 Testing - Delete Temp Files When No Longer Needed (#1488) 2020-05-24 20:03:07 +09:00
25_In_memory_image.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
26_Utf8.php Allow nullable theme for Xlsx Style Reader class (#1044) 2019-07-01 20:59:34 +02:00
27_Images_Xls.php Merge all examples together 2017-10-01 17:48:59 +09:00
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
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 Update to PHP-CS-Fixer 2.10 2018-01-28 15:59:38 +09:00
40_Duplicate_style.php Minor improvements (#1028) 2019-06-22 21:24:51 +02:00
41_Password.php Merge all examples together 2017-10-01 17:48:59 +09:00
42_RichText.php Update to PHP-CS-Fixer 2.10 2018-01-28 15:59:38 +09:00
43_Merge_workbooks.php Merge all examples together 2017-10-01 17:48:59 +09:00
44_Worksheet_info.php Testing - Delete Temp Files When No Longer Needed (#1488) 2020-05-24 20:03:07 +09:00
45_Quadratic_equation_solver.php Rename classes to keep them in their related namespaces 2017-10-29 17:39:42 +09:00
46_ReadHtml.php Merge all examples together 2017-10-01 17:48:59 +09:00