Problems with PDF generation

I have self-hosted invoiceninja v5 5.5.98-C110, with snappdf enabled. There are two companies present.

In the first company the pdf are generated (almost) correctly. The “almost” is because the generation totally mismatch the end of the page with the available space to add content

In the second company, instead, I have a blocking error. When I try to “view pdf” I receive error “cannot raster a malformed PDF file” from the app and “Promise was rejected with a value of undefined” from the browser. I tried to clear cache from the app, and tried with incognito page from chrome.

Do you have any idea?


@david any thoughts?

In the next release we’ll break these types of containers to roll onto a new page. In particular the playful design as this has zero margins due to the bottom colorful banners.

Thanks @david .
Do you have any idea about the blocking error in the second company (same installation, just added a second company).

In the apache error log I see

==> error_log <==
[Thu Mar 23 22:21:40.461092 2023] [fcgid:warn] [pid 1578:tid 139693299574336] [client xxxxx:53690] mod_fcgid: stderr: PHP Deprecated: Return type of League\Fractal\ParamBag::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in xxxxx/public_html/vendor/league/fractal/src/ParamBag.php on line 108

it looks like you have composer v1 on your system, you need to upgrade to v2

composer self-update should fix it.

No composer at all. Snappdf is installed manually with /vendor/bin/snappdf download.

With company1 it works smooth and produce pdf file.
Only with company2 it doesn’t work and give me error.

I tried also do install and download with composer but the result is the same.

I also tried to add chromium-browser by apt and added SNAPPDF_CHROMIUM_PATH=/usr/bin/chromium-browser to the .env file. It is faster in pdf generation with company1 but still malformed pdf with company2, plus it doesn’t show the preview anymore while I edit invoice, so I rolled back (snapshot of the vm).

Solved. The error was generated by missing custom logo in the new company.

When I created the new company, it wasn’t mandatory and I did not upload a logo (as instead I did in the first company after having a license to do it.

I do suggest to create a default logo in case this is not uploaded as custom because of the white label.