Snappdf: Unable to generate the raw PDF

Hi

I’m using the latest v5.10.13.

I installed the snappdf dependencies and then installed using vendor/bin/snappdf download which installed the ‘ungoogled’ version.

When I run a test via the command line it works fine:

./vendor/bin/snappdf convert --html "Hello world" test.pdf
Success! PDF saved at test.pdf

But when I update .env to PDF_GENERATOR=snappdf and then run php artisan optimize and then try to view an invoice it comes up with:

production.ERROR: Unable to generate the raw PDF {"userId":267,"exception":"[object] (App\\Exceptions\\FilePermissionsFailure(code: 0): Unable to generate the raw PDF at /home/runcloud/webapps/invoiceninja/app/Jobs/Entity/CreateRawPdf.php:116)

I’ve run the ownership and file permissions commands, tried creating /home/webuser/tmp/Crashpad and chmod +x on /chrome-linux/chrome_crashpad_handler but still no luck.

Any ideas much appreciated.

Thanks

Hi josh,

what is the output in the ssh shell when executing sudo -u www-data ./chrome ?

Hi @cybacoffee

This is the output:

[284796:284796:0728/135157.441509:ERROR:ozone_platform_x11.cc(244)] Missing X server or $DISPLAY
[284796:284796:0728/135157.441562:ERROR:env.cc(258)] The platform failed to initialize.  Exiting.

Same issue as reported here - unable to generate invoice pdf · Issue #9801 · invoiceninja/invoiceninja · GitHub

The solution was to set memSoftLimit and memHardlimit to 80G in the OpenLiteSpeed config. Might be worth putting something in the docs about that as anyone using OLS is bound to run into the same issue.

1 Like