Open
Description
Configuration option
plugins:
- to-pdf:
engine: [weasyprint|chromium|pandoc|etc| # default weasyprint
Background
When I try to check mkdocs-material
sample.
Update samples/mkdocs-material/mkdocs-material/mkdocs.yml
.
plugins:
- to-pdf:
debug_html: true
Create an HTML debug output.
$ cd samples/mkdocs-material/mkdocs-material
$ mkdocs build > debug.html
Then convert this HTML to PDF with Google Chrome(macOS)
$ /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \
--headless \
--no-pdf-header-footer \
--print-to-pdf=debug.pdf \
debug.html
The PDF output seems almost acceptable to me.
Generated PDF is 14 pages but should be several hundred.
The PDF was 449 pages.
Implementation
Sequence
- Generate an HTML file in the tmp directory
- Convert the HTML to PDF using Chrome/Chromium
Class
- Create an abstract base class for the PDF engine
- Implement the current WeasyPrint PDF engine
- Then implement a Chromium PDF engine
May I try this? (if I have a free time...)