Save handlers
Manipulate your PDF documents after they have been rendered.
Save handlers are powerful tools that allow you to make additional changes to a PDF document after the layout process is complete, but before it is saved. Save handlers are simple callable functions that can be easily implemented, they require the following signature:
To use a save handler, it must be registered at Typesetsh\HtmlToPdf::$saveHandler
with an arbitrary key, along with the save handler.
When the document is being saved, each registered handler will be called in the order in which they were registered, passing in the PDF document as a parameter. The following example demonstrates how to initialize an HTML to PDF service and register two save handlers.
Typeset.sh comes with a variety of predefined save handlers that offer additional functionality for manipulating your PDF documents. These save handlers are thoroughly described in their corresponding documentation pages, providing detailed explanations on how to use them and their specific capabilities.
Last updated