Closed FrankD closed 5 years ago
Thanks! I'm glad you're finding this package useful.
I was planning to implement an HTML to PDF option in one of the package maintenance Makefiles, but couldn't get headless Chrome to work properly. I hadn't realized it would be possible to modify the template to directly create a PDF, which would also streamline poster generation (instead of manually refreshing the Chrome tab then checking the print preview, which was the admittedly inefficient approach in my previous three posters).
That's awesome that pandoc can now directly work with various HTML to PDF engines. I'll try to play around with it sometime this week, unless you beat me to it. Let's keep this issue open until then.
Unfortunately, it looks like pandoc's PDF feature won't be a good option for this project. The wkhtmltopdf engine in pandoc looked promising initially, but it does not support CSS grid and I can't figure out the options for printing in color.
On the bright side, I was able to get the --print-to-pdf
flag mostly working in headless Chrome. Once I work out a few bugs, there's a possibility of adding an optional post-processing hook to the drposter renderer, which would call Chrome and automate the HTML to PDF conversion. It might be a few weeks until I get around to it, but I'll keep you posted.
Hi. Thanks for your awesome work. I wanted to check and see if there are any updates regarding the addition of the post-processing hook to facilitate generating a PDF.
Thanks for your interest! The short answer is not yet. I had started doing some work on the pdf-export branch--that version of the Makefile calls Google Chrome from the command line to convert from html to pdf. I still need to integrate that step into the RMarkdown post-processing hook (and add the option to drposter). Part of the challenge will figuring out the best way to call chrome (utils::browseURL
? system2
? Something built into RMarkdown?).
Thanks for the great package! I can get printing to PDF via Chrome to work, but it would be much more convenient to generate the PDF directly via pandoc. Given that most posters will (at least currently) be destined to get exported to PDF for printing, are you considering adding this feature?