Error 500 on PDF generation

Towards the end of each day I was having issues with viewing the PDF Invoices created (ERROR 500), after much searching in this forum I went to the github forum and found the information linked below… The PhantomJS pdf generator is on a counter and only allows 100 pdfs per day. In an effort to save others time and effort in the search for the problem I wanted to post here…

Apparently you can sign up with Phantom for a free key allowing 500 pdfs a day…
or (if you are on shared hosting) you can simply modify your .env file to use the Invoice Ninja PDF generator, which I assume is unlimited.

Hope this helps

1 Like

Thanks for sharing!

Maybe we can figure out a way to better surface this?

cc @david


Error 500.

production.ERROR: There was an error generating the PDF with Phantom JS

v5.2.7 Docker

have you run php artisan optimize?

or /update?secret=

About me, yeah, I did.

In fact, I never used phanton, and now it shows me a mistake when a pdf is generated. Something may have been lost along the way.

Just realised you are on docker. You shouldn’t have to use phantom or the hosted PDF service. the built in SnapPDF generator will generate PDFs out of the box.

Also, the .env file in the root of the project doesn’t get read in the docker system.

you want to use the env file where the docker-compose file is.

Hi again!! I follow your instructions.

I changed it to snappdf.

Works again after clear cache.