News for hackers. Stuff that matters.
Re:BreezyPDF Lite: HTML to PDF generation as a Service by jim-a-1020401 on Friday June 29, 2018 @12:41PM (#17425613)
I've been working on a documentation process with Markdown -> HTML + CSS -> PDF for a while and I found that Weasyprint works best. It supports everything I need except CSS target-counter for auto-generation of page numbers in a TOC but otherwise really good.

I really don't like that this uses something non-standard for header/footer and stuff in the margins since that's already covered by standardized CSS @page stuff; https://www.w3.org/TR/css-gcpm-3/. I'm using that with Weasyprint for automatic header/footers with auto page-numbering, including setting strings from the html to use for heading names, document title, author, etc... example CSS: `h1 { string-set: h1-title content(), h2-title ""; }` + `@page { @bottom-left {content: string(h1-title) string(h2-title);}`.

Weasyprint seems closest to princexml and is free.

Re:BreezyPDF Lite: HTML to PDF generation as a Service by deedubaya on Friday June 29, 2018 @01:02PM (#17425808)
You can use CSS page sizing as well, passing it via meta isn't required.

https://docs.breezypdf.com/metadata#use-css-for-page-size

Headers/and footers are just HTML strings and can be super rich with images etc and customized with CSS. Page numbering is free as well in headers/footers.

Of course you could just use properly positioned <header> and <footer> tags and do whatever you need to with JS for page numbering.

Re:BreezyPDF Lite: HTML to PDF generation as a Service by jim-a-1020401 on Friday June 29, 2018 @01:07PM (#17425843)
That's good for page sizing but as other comments on this thread noted, no browsers seem to have proper support for CSS paged media including Chrome. When I tested it, none of the @bottom type stuff or other print/page related CSS worked at all which is why I ended up with Weasyprint since it has it's own engine (and is really great). Example of some more paged media stuff not supported by Chrome; https://www.smashingmagazine.com/2015/01/designing-for-print.... Another thing Weasyprint does really well which surprised me is automatically carrying over table headers onto subsequent pages when a table is split across pages, which is really nice.
Re:BreezyPDF Lite: HTML to PDF generation as a Service by oliwarner on Friday June 29, 2018 @02:56PM (#17426781)
Speaking as somebody who also puts a lot of stuff through WeasyPrint, I love it but it's bloody slow.

Tasked with solving the same problems again, I'd probably look at headless Chromium or Firefox. Their JS PDF renderers are fast and if you're doing enough to keep an instance loaded all the time there's no start up time.