PhpSpreadsheet/docs/topics
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
..
images Update documentation with composer instructions 2017-03-13 12:30:26 +09:00
accessing-cells.md Fix Documentation type 2019-07-09 19:39:12 +02:00
architecture.md Quote class names in docs 2017-12-30 19:44:32 +09:00
autofilters.md HTML entities should not be escaped in Markdown 2018-07-24 10:13:58 +09:00
calculation-engine.md Document Improvements … (#899) 2019-02-23 10:22:18 +01:00
creating-spreadsheet.md Improve doc formatting with backticks 2017-03-13 14:57:37 +09:00
file-formats.md Prefer https:// URLs when available in docs & comments 2018-10-28 13:55:00 +11:00
memory_saving.md Prefer https:// URLs when available in docs & comments 2018-10-28 13:55:00 +11:00
migration-from-PHPExcel.md Replace migration tool with RectorPHP 2020-05-02 12:34:50 +09:00
reading-and-writing-to-file.md Add ability to save edited Html/Pdf 2020-05-30 21:27:35 -07:00
reading-files.md array short syntax in documentaiton (#373) 2018-02-25 13:16:04 +01:00
recipes.md Replace Sami with phpDocumentor 3 2020-04-05 17:47:25 +09:00
settings.md Refactor CachedObjectStorage to PSR-16 2017-04-14 16:56:27 +09:00
worksheets.md HTML entities should not be escaped in Markdown 2018-07-24 10:13:58 +09:00