beganovich / snappdf

Convert webpages or HTML into the PDF file using Chromium-powered browsers.
MIT License
184 stars 15 forks source link

Windows error [0923/112045.363:ERROR:chrome_main.cc(207)] Multiple targets are not supported in headless mode. #46

Open rebienkrdns opened 1 day ago

rebienkrdns commented 1 day ago

image

image

C:\laragon\www\joyas\vendor\beganovich\snappdf/versions/1358778-Win_x64/chrome-win/chrome.exe --headless --disable-gpu --disable-translate --disable-extensions --disable-sync --disable-background-networking --disable-software-rasterizer --disable-default-apps --disable-dev-shm-usage --safebrowsing-disable-auto-update --run-all-compositor-stages-before-draw --no-first-run --no-margins --no-sandbox --print-to-pdf-no-header --no-pdf-header-footer --hide-scrollbars --ignore-certificate-errors --print-to-pdf=C:\Users\Compu Fire\AppData\Local\Temp\pdfF074.tmp.pdf C:\Users\Compu Fire\AppData\Local\Temp\htmF073.tmp.html 2>&1

Hi, I think it is due to the spaces in the windows path C:\UsersCompu Fire..., however I tried this way and it doesn't work either 'C:\UsersCompu Fire...'.

because the unlink also starts to fail

I tried the same in the unlink but it didn't work either, instead of unlink($path) I tried unlink('“$path”') and the other way around and it doesn't work either.

I remain attentive to any possible solution or if I have news I will propose a PR, Thank you very much.

beganovich commented 23 hours ago

Hey there, thanks for report.

So, running the command directly (C:...\chrome.exe --headless --disable-gpu --disable-translate --disable-extensions --disable-sync --disable-background-networking --disable-software..) doesn't work either?

Do you see any errors in the cmd/powershell?