Open robwent opened 3 months ago
@beganovich this is a widespread issue I think may be related to the newer version of snapped. I am also seeing that if attempting to use a dedicated path to a separate chrome binary, this is not being respected by snappdf
The path to binary is working for me as I have it set on the live site but not the local one.
$snappdf->setChromiumPath( '/my/path/chrome' );
I just tested command line and got the same signal "6" error, but if I set the --binary flag then it works.
I was previously using hosted_ninja for pdfs on another server, but switched that to snappdf today as the servers were a similar setup (that one is Ubuntu 22.04). That one worked straight away without installing any new packages, but the binary was already downloaded. I didn't force a new download so it could be an older version.
On another note, I couldn't get any flags working like width & height, removing margins and making landscape. I got that working by setting @page in CSS like dompdf:
@page {
size: 11in 8.5in;
margin: 0;
}
Thanks, guys, I'll tinker on this one soon.
@robwent can you try adding 0755 to chrome_crashpad_handler too?
You can find it in vendor/beganovich/snappdf/versions and find folder where chrome
is. There should be chrome_crashpad_handler
too.
chmod 0755 chrome_crashpad_handler
I got this working on my local Windows machine, but after uploading to my live site, I was getting an unhelpful Symfony error:
The process has been signalled with signal "6"
I installed all the mentioned packages but couldn't get past this.
I then downloaded a separate copy of Chrome to see if that was the issue, but I still got the same error. Trying to run it on the command line, I got a permission error, so chowned the main chrome file to 755 and then got an error:
I found some threads about Chrome not being able to find a default display and running
printenv DISPLAY
showed nothing. I then found this thread https://github.com/puppeteer/puppeteer/issues/8148#issuecomment-1397528849 RanAfter that, running
printenv DISPLAY
outputs::99
At that point, I could generate a PDF by using the copy of Chrome I uploaded, but not the one downloaded by the download command (I ran it separately on each machine originally).
Unfortunately, I can't remember where I downloaded Chrome from manually, but it doesn't seem to be an official version. The filename is ungoogled-chromium_126.0.6478.127_1.vaapi_linux.tar.xz
Hopefully, this might help someone else get it working.