Server-side PDF printing
Please contribute! This document is a stub. If you have recently implemented a PDF generator that works well with modern WordPress in Seravo’s environment, please contribute to this page via the Github link in top right corner.
Traditionally developers have generated PDF files on the server side using one of the tools below. Unfortunately, none of them meet modern standards anymore.
- PHP-DOMPDF: Works only with PHP 5. Is not maintained anymore.
- PHP-FPDF: Works only with PHP 5 and is not maintained anymore. Anyway needed Apache and suexec to run, so was never a good option.
- wkhtmltopdf: Uses webkit for rendering and thus does not render correctly all modern websites. Needs X virtual framebuffer which is inconvenient server-side.
For modern WordPress sites there are three recommended options:
- Render PDF files server-side using the headless Chrome available in Seravo’s environments
- Use an custom WordPress plugins for the purpose (e.g. Waterwoo for watermarks) or external service via API requests