Furthermore, can you loop the print out based on a specific variable?
Say for example I have one view for a vendor. How can I print out a PDF view iteratively based on this vendor? Basically, it would be a unique view for each vendor
Furthermore, can you loop the print out based on a specific variable?
Say for example I have one view for a vendor. How can I print out a PDF view iteratively based on this vendor? Basically, it would be a unique view for each vendor
I wanted to do the same thing! I understand people saying it's not what it's intended for but sometimes you just need to use a workaround! Your options are...
#make a PNG
webshot::webshot("your_flexdashboard.html", "your_new_file.png")
#convert PNG to PDF
magick::image_write(
image = magick::image_read("your_new_file.png"),
format = "pdf",
path = "your_new_file.pdf"
)
Or... (works best if one page)
psycModel::html_to_pdf("your_flexdashboard.html")
Let me know if more explanation is needed. The first option works for plotly hthml widgets but for me didn't work for DT tables.
To loop this simply use a for loop and list of your dashboards.
FILES<-list.files("flexfolder")
for (FILE in FILES){
psycModel::html_to_pdf(FILE)
}