Severe text and layout corruption in generated PDFs


I was in the process of building my invoice design when all of the sudden it started behaving weirdly when converted to PDF (with added white margins where there were none before). I could not see anything wrong with the CSS (I’m no expert, but the render looked fine before), so I tried creating a new test design using one of the presets. Surprise: default designs now exhibit some issues when converted to PDF, mostly overflow problems (the whole page overflowing and getting a part hidden at the top page border) but sometimes even severe text corruption. The HTML drafts work OK, by the way - only the generated PDFs are problematic.

Here is what the Hipster design looks like when converted to PDF:

Now here is a product table rendered with the Modern design:

I checked laravel.log, the browser console, but no errors are showing up.

I thought there might be an issue with my custom labels (special characters and whatnot), so I deleted them. It made no difference. I also tried deleting the default designs in the db and letting the seeder repopulate them, but it didn’t work either (the designs were all reloaded with the exact same code as before, so nothing seemed corrupted there).

A fully clean, manual install (with the same database and at the same subdomain) did not fix the issue either, but a new test install with a fresh db straight from Softaculous in a new subfolder did work to generate clean PDFs, so there might be something in my production database somewhere that makes the PDFs corrupted - I just can’t tell what.

I was using the hosted_ninja PDF generator on my main install, so I switched back to PhantomJSCloud for now and the issue seems even worse, with my logo not being added to the generated PDFs, some designs producing a white page and some others, like “Plain”, being completely unreadable:

What is even weirder is that if I point my production install to the new db of the test Softaculous install, I get blank PDFs, but if I instead load the same production db through the fresh Softaculous install, the PDFs generate with no problem:

So the database in itself is not a problem per se, as long as it is linked to an IN install after the setup has been completed. There is probably something in my main db that ends up corrupting something in my install eventually, and it also happens during the first run after a setup linking to that database, so I’m pretty confused as to what to do next without starting from scratch with a new database, because if work around the problem and create a new install with a fresh database and then relink the production database after the setup, I’m stuck in that loop if I ever want to reinstall and that’s not much of a fix, then. Since the issue also happened quite a few days after the latest fresh install, it means that the corruption eventually creeps in from somewhere anyway, and the workaround might just be temporary then.

To me, this looks like a bug, but if I can do something on my end to fix it, I’ll gladly do it. As of now, I can’t use the invoicing feature at all… So any help would be much appreciated. :grimacing:


The issue seems to have been linked to corruption in the Chromium Edge browser cache. Somehow, it interfered with the data involved with the PDF creation, which ended up corrupting it - even the downloaded PDF were corrupted too, so it wasn’t just a rendering issue.

I flushed all cache from the browser (and not just cache related to the IN app) and now the PDFs are working again beautifully. That was weird.