I have written an app that creates a downloadable report, I was hoping to use the pagedown package to create a pdf from a html which is better formatted and more presentable. It tested fine locally on my machine. After deployment, the document failed to download with the following error from the logs:
Warning: Error in find_chrome: Cannot find Chromium or Google Chrome
[No stack trace available]
I am using Google Chrome to view the app but I am guessing there's more to it than this?
It seems that pagedown cannot find chrome or chromium on the server that runs the Shiny app.
First, check that Chrome or Chromium is installed on this server.
The Chrome or Chromium must also be available through the PATH environment variable.
Last thing: when using pagedown::chrome_print() in Shiny, you have to use async = TRUE.
Thanks for taking the time to reply. I've only been coding for a few months, so forgive me if some things seem obvious to others. The server I've uploaded to is just the shinyapps server, would this cause problem with pagedown? Please can you explain what you mean by "through the PATH environment variable"?
Now, we have to wait for this pull request to be merged. It may take a few weeks.
I am sorry for the use of technical terms. An environment variable is a special variable that characterize the context of your R session. You can print the current environment variables with Sys.getenv(). The PATH is a special one that contains all the directories where programs can be found. This is essential to lookup for specific programs. But if you use shinyapps.io, you haven't to worry about these technical details. When the previously mentioned pull request will be merged, the pagedown::chrome_print() function should work.
Wonderful. So I only need to sit and wait then. Will there be some way of getting notified about this? I have only started learning R for a few months, initially for data analysis, and saw the potential use for an app in relation to my work. I am very grateful for any education there is to learn more about this.
@rlesur I had a look at this page https://github.com/rstudio/shinyapps-package-dependencies/pull/220 as you suggested but it seems that the issue is meant to have been resolved. However I've encountered exactly the same issue as above. Has it been totally resolved or is it still in progress? Thanks
Hi, that was what I started using with R Markdown before exploring chrome_print. chrome_print seemed a more elegant solution allowing pdf for what I need from an html output that is more flexible in formatting. But I have not ried again to see if the issue is resolved.