Taking screenshots within a shiny app?

One of the ways I'd like to make my production shiny applications more robust is to allow the user to take a screenshot of what they are seeing in the user interface within the application. I've been spoiled by how awesome the combination of shinytest and webshot is for taking screenshots, but that uses phantomjs and a separate R process running the shiny app.

After some research I found a javascript widget called html2canvas, and perhaps that could be wrapped as an html widget. Before going down that rather intimidating route, I wanted to check if others in the community have found a way to take screenshots of the application within a shiny app itself? While I currently tell the users to use their computer OS's native way of taking screenshots, I think it would be handy to take these screenshots programmatically and do useful things with them, such as including them in automated reports.

1 Like

Hi @rpodcast,

I am in this exact situation and looking for a way to take a screenshot of the app upon a click.
So far, I haven't found any satisfactory solution. Did you have any luck with this?

Thanks!

Unfortunately not yet, so this might be a great project for wrapping it with htmlwidgets if I can get some time to learn