captn3m0 / pystitcher

pystitcher stitches your PDF files together, generating nice customizable bookmarks for you using a declarative markdown file as input
https://pypi.org/project/pystitcher/
MIT License
390 stars 10 forks source link

Local HTML -> PDF rendering #4

Open captn3m0 opened 3 years ago

captn3m0 commented 3 years ago
# Title

- [chapter 1](chapter1.html)
- [chapter 2](chapter2.html)

Convert the HTML to PDFs and merge accordingly.

captn3m0 commented 3 years ago

Notes from PDF rendering research in Python:

Did some experiments with all of the above to get close-to-pandoc typography. Will add some more details here.

Vonter commented 2 years ago

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

captn3m0 commented 2 years ago

My recommended options are (not in any order):

captn3m0 commented 2 years ago

I filed a PR to xhtml2pdf for PyPDF3 support: https://github.com/xhtml2pdf/xhtml2pdf/pull/582.

captn3m0 commented 1 month ago

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".