I read this useful article
https://rviews.rstudio.com/2017/06/28/printing-from-flex-dashboard/
and have tried to implement this in a flexdashboard so a download button renders a second RMD file and creates a png file. In my flexdashboard, I used the commands below and this works when I run it in RStudio but when I publish to shinyapps.io the file does not download.
I tried removing the webshot command and the download button happily creates the intermediate Summary.html file for download but this rather defeats the object. This suggests the problem is that webshot cannot 'see' the html file being rendered.
output$downloadFile <- downloadHandler(
filename = "Summary.png",
content = function(f){
webshot::webshot(rmarkdown::render("Summary.Rmd"), file = f)
})