Open captn3m0 opened 3 years ago
Notes from PDF rendering research in Python:
pandoc
, but that comes with latex dependencies, which we want to avoid.Did some experiments with all of the above to get close-to-pandoc typography. Will add some more details here.
I tried out Weasyprint and the results look promising to me, but it does have a couple of external dependencies, including Pango. However there do seem to be plans to minimize the external dependencies
My recommended options are (not in any order):
I filed a PR to xhtml2pdf
for PyPDF3 support: https://github.com/xhtml2pdf/xhtml2pdf/pull/582.
xhtml2pdf moved back to pypdf2: https://github.com/xhtml2pdf/xhtml2pdf/pull/656/files which is now merged back to the pypdf project. PyPDF3 is unmaintained.
xhtml2pdf is getting regular updates now. There might even be scope to just let people pick between reportlab, xhtml2pdf, rinohtype, or borb as different "renderers".
Convert the HTML to PDFs and merge accordingly.