PDF/X-4
Create print ready documents
When working with printers, they typically require PDFs to be PDF/X-4 compliant. This can be achieved using the save-handler \Typesetsh\HtmlToPdf\X4
.
However, there are certain considerations to keep in mind when creating documents for print. All colors must be defined in CMYK, and Typeset.sh does not automatically convert colors. Therefore, it is important to ensure that colors are defined correctly in your document and CSS.
In PHP you can then simply use the save-handler to create X4 conform PDF documents.
Advanced configuration
When generating a PDF, Typeset.sh keeps track of the images included in the document and their dimensions. The images are saved into the PDF only at the final step of saving the document. This allows a save-handler to alter the images before they are embedded in the PDF.
The X4 save-handler uses the \Typesetsh\HtmlToPdf\ImagePreflight
save-handler, which allows for resizing images based on DPI configuration and converting RGB images to CMYK. However, this process requires the Imagick PHP extension. Additionally, a cache path can be provided to ensure that image resizing and conversion only occurs once.
Last updated