-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for weasyprint
and prince
#3909
Conversation
weasyprint
and prince
, in addition to wkhtmltopdf
weasyprint
and prince
Re 1) I'm in favor of using stdin when possible (and also stdout, if we can get the PDF to stdout -- then we wouldn't need any temp files at all). Re 2) I agree. defaultWriterName for ".pdf" should be sensitive to the pdf-engine selected. Perhaps we should also emit an INFO level log message saying which format had been auto-selected. |
and add support for `weasyprint` and `prince`, in addition to `wkhtmltopdf` closes jgm#3906
finally done. that was somewhat more elaborate than expected, but hopefully it will be a lot easier to add pdf-engines in the future. |
You also changed |
@iandol jep, arguments specified with |
Can confirm that latest nightly:
Worked as expected. Thank you so much @mb21 for your contribution! |
jep, probably the way to do it for now is through generating SVGs... e.g. from print-css.rocks:
|
Is latex still the default? |
@linquize yes, pdflatex is (for better or worse) still default... (see the updated MANUAL.md) |
Rename
--latex-engine
to--pdf-engine
and add support forweasyprint
andprince
, in addition towkhtmltopdf
closes #3906
Three remarks/TODOs.
In
PDF.hs#html2pdf
: could we use "program - html2pdf.pdf" to read from stdin instead of using a tempFile? All three HTML-to-PDF-engines support it.It's still a bit counter-intuitive that you have to specify a writer when not using LaTeX, e.g. see:
I guess we could change the
App.hs#defaultWriterName
function to depend on the pdf-engine. Then the only question is: why can't I also usecontext
andpdfroff
with--pdf-engine
?TODO: research and implement best approach to math-handling for
weasyprint
andprince