PDF generation not working

Hi folks,

I’ve migrated a v4 installation to a v5 installation. I’ve used phantomjs (locally installed via Debian package) with v4 without problems. I tried the following for v5:

  1. Install phantomjs debian package (Debian Buster)
    This didn’t work.

2a. composer require beganovich/snappdf
2b. php artisan optimize
2c. edit .env:


The laravel log suggests InvoiceNinja is still trying to use PhantomJS:

There was an error generating the PDF with Phantom JS {“exception”:"[object] (App\Exceptions\PhantomPDFFailure(code: 0): There was an error generating the PDF with Phantom JS at /data/www/invoiceninja-url/app/Utils/PhantomJS/Phantom.php:131)
#0 /data/www/invoiceninja-url/app/Utils/PhantomJS/Phantom.php(91): App\Utils\PhantomJS\Phantom->checkMime(’{
\t"statusCode"…’, Object(App\Models\InvoiceInvitation), ‘invoice’)

Any suggestions? Should I use PhantomJS? If so, can I use the locally installed phantomjs (Debian Buster package)? Should I use snappdf? Did I install that correctly?


if you have SnapPDF configured, the only .env change that needs to be made is