3 ms·
I'm with you.. We ended up writing a similar wrapper around https://github.com/jung-kurt/gofpdf https://github.com/jung-kurt/gofpdf library. We haven't open so
by Crowberry 3y ago
I'm with you..
We ended up writing a similar wrapper around https://github.com/jung-kurt/gofpdf https://github.com/jung-kurt/gofpdf library. We haven't open sourced it yet. But it's made it a lot easier to deal with rendering a PDF, especially over pagebreaks ect.
- Leoko 3y agoYes, page breaks are probably the most significant difference between the layout of a web page and a PDF document, and thereby a major drawback when using HTML-to-PDF. There is little to no tooling for this in the web. If you want granular control over how your PDF will look with content that is more than one page long, you will have a hard time using html.
- Titou325 3y agoWe actually provide helpers to do that in our React library https://react.onedoclabs.com/components/shell#pagebreak https://react.onedoclabs.com/components/shell#pagebreak CSS actually implements the break-before property to control this https://developer.mozilla.org/en-US/docs/Web/CSS/break-before https://developer.mozilla.org/en-US/docs/Web/CSS/break-befor... which is also supported by the Print to PDF dialog in modern browsers.
- Titou325 3y agoWe actually provide helpers to do that in our React library https://react.onedoclabs.com/components/shell#pagebreak https://react.onedoclabs.com/components/shell#pagebreak CSS actually implements the break-before property to control this https://developer.mozilla.org/en-US/docs/Web/CSS/break-before https://developer.mozilla.org/en-US/docs/Web/CSS/break-befor... which is also supported by the Print to PDF dialog in modern browsers.
- pedro120 3y agoThat's what we are trying to solve at Onedoc, we want developers to be able to have full control over the PDF layout as they write content. react-print is built with the intention of creating the illusion that React was meant for PDFs.
- aforwardslash 3y agoA while ago I created a pdf report generation engine for Python, supporting Jinja2 template syntax, and server and client-side generation of content. Page formatting is handled by https://pagedjs.org/ https://pagedjs.org/, and PDF generation is performed via a separate api daemon based on chrome-headless: https://zipreport.github.io/zipreport/ https://zipreport.github.io/zipreport/ It is not fast, but it works quite well.