I installed v5 on a shared hosting within a subdomain, at first I was able to generate PDF, but after customizing a template I started to receive:
error 500: There was an error generating the PDF with Phantom JS
when previewing a PDF
and the error:
There was an error loading the PDF document
when trying to customize a template.
I already tried changing to snappdf in the .env file.
Modify
PDF_GENERATOR=phantom
to
PDF_GENERATOR=snappdf
add
LOCAL_DOWNLOAD=true
and
PHANTOMJS_PDF_GENERATION=false
But I kept getting the same thing:
error 500 generating the PDF with Phantom JS.
Then I went back to phantom js and used an api-key to increase the limit to 500, but I still get the same error. Right now I have it like this
And this is the only error in the laravel.log file, even when I use snappdf:
production.ERROR: There was an error generating the PDF with Phantom JS {“exception”:"[object] (AppExceptions/PhantomPDFFailure(code: 0): There was an error generating the PDF with Phantom JS at /home/user/routetoinvoiceninja/app/Utils/PhantomJS/Phantom.php:150)
[stacktrace]
Sometimes when previewing the PDF customization it throws me an error, but when generating an invoice in the production environment it seems to work fine and for the customization I can always use the HTML view