Closed aaelony closed 4 months ago
We have experimented with pagedown (https://github.com/rstudio/pagedown) which leverages Paged.js technology (https://pagedjs.org/). It allows to use HTML / CSS and JS to produce paginated HTML which then can be printed more easily.
Some users have been able to create nice template with it: https://pagedreport.rfortherestofus.com/
Ended up using Puppeteer via it's Docker container (https://pptr.dev/guides/docker) which works well. This or something like it could be wrapped into an R package as desired.
If you are looking for just HTML printing to PDF, R ecosystem has several tooling using same tech layer than puppeteer to interact with chrome
pagedown::chrome_print()
: https://pagedown.rbind.io/#print-to-pdfIf you want to stay in R only, they can help. But otherwise, Puppeteer is a really good option for this.
Is there any consideration towards functionality that outputs PDF in a manner that supports CSS/HTML look and feel in a manner that uses headless websites (that could work in a docker container) and not LaTeX? Seeking an R package that supports programmatic Rmd to PDF file format that honors CSS directives with the same look and feel that the browser would render. Any thoughts or pointers to existing packages welcome. Thank-you.