-
Snappy
PHP library allowing thumbnail, snapshot or PDF generation from a url or a html page. Wrapper for wkhtmltopdf/wkhtmltoimage (by KnpLabs)
When I first looked for solutions to generate a PDF document in a Symfony application, I was amazed to find that a SymfonyCast was made about this. It features the PHP library Snappy, which is essentially a wrapper around wkhtmltopdf.
-
JetBrains
Tell us how you use coding tools. You may win a prize! Are you a developer or a data analyst? Share your thoughts about your coding tools in our short survey and get a chance to win prizes!
-
wkhtmltopdf
-
The advantage of this approach is that it can be used as a command-line tool with other languages, just like the bundle for Symfony that I will present in this article!
-
The first step before generating the PDF is writing the HTML. To generate the HTML string, we will use the Twig template engine, which is the default one in Symfony. It comes with tons of features such as inheritance, blocks, filters, functions, and more.
-
Performance is not the strength of WeasyPrint, meaning that heavy HTML files will increase generation time. You should always compress images before attaching them, as they are not compressed by default. Generating a 50-page-long PDF may take up to a minute in extreme cases, although multi-page documents generated on my project take fewer than 2 seconds to generate.
-
gotenberg
A developer-friendly API for converting numerous document formats into PDF files, and more!
If you also want to convert Markdown or LibreOffice formats, the self-hosted API Gotenberg is worth checking out
Related posts
-
Show HN: PlutoPrint – Convert HTML to Beautiful PDFs and PNGs with Python
-
Lyon Drops Microsoft to Boost Digital Sovereignty
-
Show HN: PlutoBook – Fast, lightweight C++ library for generating PDF from HTML
-
Dompdf VS plutoprint - a user suggested alternative
2 projects | 19 Jun 2025 -
pagedjs VS plutoprint - a user suggested alternative
2 projects | 19 Jun 2025