Getting the RStudio Connect shiny app's downloadHandler to save plotly figures

Hi,
I have a shiny app that I'm publishing to an RStudio Connect server and I would like to have the option to download as PDFs the plotly figures that the app generates (in a reactive called out.plot())

This is the downloadHandler code I'm using:

  output$savePDF <- downloadHandler(
    filename = function() {
      paste0("figure_", Sys.Date(),".pdf")
    },
    content = function(file) {
       plotly::orca(out.plot(),file=file)
    }
  )

But on the Connect Server clicking the save button results with the error:
Error in : The orca command-line utility is required for this functionality.

I do have the orca-1.3.1.AppImage executable in the app code directory, which I'm including in the list of files I'm publishing, but I guess I need to point to it somehow so that it will be found on the Connect server.

Any idea?

Hi,

Have you tried putting the orca executable on the Connect server?

I was thinking that including the orca executable with the content I'm publishing achieves that, but I guess I'm wrong. How would I put the orca executable on the Connect server like you're suggesting?

You will have to move this file to an appropriate location on the Connect server. You will need ssh access to the server or work with your organization's system administrator to make it work.

Thanks!

Ah, the bureaucratic way .. :slight_smile:

Thanks!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.