jgm / pandoc

Universal markup converter
https://pandoc.org
Other
34.28k stars 3.36k forks source link

WeasyPrint for PDF generation? #3906

Closed mb21 closed 7 years ago

mb21 commented 7 years ago

Should we support WeasyPrint in addition to wkhtmltopdf?

This would require a --html-engine option. More correctly, it would have to be called --html-to-pdf-engine, but that's quite long and --latex-engine set some kind of precedent. Other options include --html2pdf-engine and --html-pdf-engine.

jgm commented 7 years ago

I am open to supporting it.

One possibility would be to have a general

--pdf-engine

or

--pdf-via

option which could be used for pdflatex, xelatex, context, html2pdf, etc. We could make --latex-engine a deprecated synonym of this.

iandol commented 7 years ago

There is also PrinceXML which offers very professional publishing output (and free for non-commercial use), so having a general --pdf-via that could accommodate this in addition to the other tools would be nice. I'm not sure how best to configure the general command-line for each tool, it is currently hard-coded right?

jgm commented 7 years ago

+++ Ian [Sep 09 17 23:59 ]:

There is also [1]PrinceXML which offers very professional publishing output (and free for non-commercial use), so having a general --pdf-via that could accommodate this in addition to the other tools would be nice. I'm not sure how best to configure the general command-line for each tool, it is currently hard-coded right?

There's a --latex-engine-opt flag, but otherwise, yes, it's hard coded. Moreover, each kind of engine has to be specially handled (e.g. they have different needs for where they expect to find image files, and so on). But it should be possible to add support for both these tools.