I don't understand why find_chrome() gives me Error in find_chrome() : Cannot find Google Chrome or Edge automatically from the Windows Registry Hive. Please pass the full path of chrome.exe or msedge.exe to the 'browser' argument or to the environment variable 'PAGEDOWN_CHROME'.
The variable 'PAGEDOWN_CHROME' was created on Windows PowerShell and I get: Sys.getenv('PAGEDOWN_CHROME') [1] "C:/Windows/SystemApps/Microsoft.MicrosoftEdge_8wekyb3d8bbwe/MicrosoftEdge.exe"
I also tried to remove the "MicrosoftEdge.exe" and with Chrome ('C:/Users/j_doe/AppData/Local/Google/Chrome/Application/chrome.exe`).
But it's still not working !
I am on Windows 10 and Rstudio and I want to convert an html file (or .Rmd file) to pdf.
I've also tried to use Rmarkdown::render with weasydoc but it seems I was unable to install it on my computer without the admin rights.
Hello @FloBlue ,
do I understand correctly that you do the Sys.getenv call in the same session where the find_chrome fails?
If so then I don't understand why it would fail.
Otherwise start that (the pagedown) session with the Sys.setenv call.
Good luck!
Thanks for your answer.
The Sys.getenvreturns the path to chrom but find_chrome fails in the same session.
I was wondering if the PATH to Chrome or Edge was correct for Rstudio or if there is a special way to enter this path?
find_chrome() would use the ENV VAR, it is used to guess / detect Edge or Chrome on the system if possible.
If it does succeed, other solution to use chrome_print() is to use the browser= argument or set the env var.
So if you are setting the ENV VAR, then chrome_print() should work. But find_chrome() result won't change
What are you trying to do ?
If you think, find_chrome() should have worked in the first place. You could open an issue in the pagedown Github repo so that we have a look
When I use chrome_print instead and enter the browser=argument, I ge the folowing error: Error in is_remote_protocol_ok(debug_port, verbose = verbose) : Cannot find headless Chrome after 20 attempts with path to Microsof Edge or Error in force(expr) : Failed to generate output in 30 seconds (timeout).with path to Chrome.exe
Then there is something wrong with this browser or the path maybe.
Did you check the version of microsoft edge you want to use is a recent enough one to be built around chromium ?
Maybe this version of Microsoft Edge does not support the Chrome Devtool Protocol.
I don't know the version number but it went out the 15 janvier 2020 I believe.
Following your advice, I downloaded the last version of Miscrosof Edge but I still get the same error Error in force(expr) : Failed to generate output in 30 seconds (timeout).
I've also updated Chrome and I get the following error: Error in force(expr) : Failed to generate output in 30 seconds (timeout). [2021-09-01 18:25:47] [error] handle_read_frame error: asio.system:10054 (An existing connection had to be closed by the remote host.
I've now the same error for Edge and Chrome. This time I'd this additional precision handle_read_frame error: asio.system:10054 (An existing connection had to be closed by the remote host)
When I open my document on Chrome and I do CTRL + P, the document prints with the addition of page numbers (this is not enough for me because the table of contents is not 'clickable')