Invoice template preview not working

I am using self hosted v5.0.40-C33 on chrome v87.0.4280.88
When I open Invoice design → customize & preview, on the right side I get error of faild to load pdf.

Same issue with Edge browser.

Hey there,

Thanks for reporting this to us. Can I know the environment you’re using? Have you configured the server yourself? Are you using Docker?

Also, can you please post the output of the storage/logs/laravel.log file. There should be an error message.

Thanks!

I installed and configured server by myself. It is running ubuntu 20.04 php7.4 and nginx.
No errors in the log: https://i.imgur.com/uozQqLl.png

All right. Can you tell me what’s the value of PHANTOMJS_PDF_GENERATION variable in .env file?

There are three variables related to phantom:

PHANTOMJS_PDF_GENERATION=true
PHANTOMJS_KEY=‘a-demo-key-with-low-quota-per-ip-address’
PHANTOMJS_SECRET=secret

One thing you could try & I’d suggest that is switching to local PDF making system.

Do the following:

  1. Make sure you have installed all required dependencies for Chromium to run (https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#chrome-headless-doesnt-launch-on-unix)
  2. Set PHANTOMJS_PDF_GENERATION to false.
  3. Run: ./vendor/bin/snappdf download (in Invoice Ninja directory)
  4. Run: php artisan optimize

See if that works for you :+1:

1 Like

After checking for missing dependencies I got this:
libgbm.so.1 => not found
Installed it and done the rest of your instruction. It works now!
Thank you

1 Like

Thanks for letting us know!

Cheers :tada: