2 ms·
You're not the first person to show interest in the PDF rendering use case. I think we'd probably need better support for some of the print-orientated CSS prope
by nicoburns 2y ago
You're not the first person to show interest in the PDF rendering use case. I think we'd probably need better support for some of the print-orientated CSS properties and page-based layout (for splitting layout across multiple discrete pages and controlling where page breaks occur), but it's definitely something that we ought to be able to support at some point.
- RamblingCTO 2y agoYou'd be a hero to a lot of people for supporting that. Current options for basic PDF reports suck. You essentially have to run Chrome (at scale possibly) for such a basic use case.
- nicoburns 2y agoIt's kinda early, but we're looking at collaborating with https://typst.app/ https://typst.app/ (a modern LaTeX alternative) on this. They already have some of the low-level PDF writing infrastructure in place, and are working on something higher-level that we're hoping to use. (you could also look at using Typst directly if you're not tied to HTML)
- nine_k 2y agoBTW why not render things in SVG and convert to.PDF then? It would certainly require you to compute your own layout, but you.normally want that in a tabular report anyway. The rendering would not involve invoking a web browser though.
- rescbr 2y agoI second this suggestion. For one use-case that it’s just a single page, I’m using SVG + rsvg-convert.
- Semaphor 2y agoWeasyprint [0] works pretty well for us. Especially for basic things, it does everything. It’s only lacking some very advanced CSS Print features. [0]: https://doc.courtbouillon.org/weasyprint/stable/ https://doc.courtbouillon.org/weasyprint/stable/
- Fire-Dragon-DoL 2y agoYeah I'm not in hurry, but having to write a layout with css 2 was very painful. I had to resort to floats, clearfix and similar things, so I'm looking forward this