I've found wkhtmltopdf, which looks good on the surface and works fine in very small cases, but it doesn't provide any real css control over the rendering.
By that I mean it doesn't use the print media type and page breaks are not respected, as well, on windows you can't control the names of some header/footer variables, or generate a TOC off of teh h1 tags.
Are there any real open source alternatives, I've tried xhtml2pdf which is a python library actually called pisa, but it requires reportlab which doesn't play nice windows.
I'm actually programming in .net but if its good and open source, the language isn't a huge issue.
This is an old stackoverflow question, but because google took me here, it could be helpful for somebody else.
Weasyprint should support what the author was looking for.
It supports print css features like page break.
Try weasyprint
It turns out there was no open source alternative that was simpler, but on windows wkhtmltopdf is just not the best thing, so we paid for a better solution.
Winnovative's PDF library is what we used
While it is not open-source, I use ABCPDF. I have a template page in .NET that I use for a wrapper to set up a custom stylesheet for generating PDFs only.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With