PDF invoices broken
-
@girish quoting a mod on IN's forum.... should I proceed with this method?
The work around for the broken chromium is as follows, we suggest installing headless chrome directly to your machine: sudo apt-get update sudo apt-get install -y libappindicator1 fonts-liberation wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb sudo dpkg -i google-chrome*.deb Then update your .env variable as follows SNAPPDF_CHROMIUM_PATH=/usr/bin/google-chrome-stable Then optimize php artisan optimize
-
I got another reply from the mod that's specific to Cloudron
For cloudron, it is a read only file system, you’ll want to open your .env and change PDF_GENERATOR=hosted_ninja you may need to restart your app again afterwards
-
Yeah I saw that, not sure why this would be an issue here. The chromium binary is downloaded on image build time. But maybe snappdf need some local cache, if that is the case we can symlink this folder.
Anyways I would still say we wait for upstream release with their fix, instead of installing google-chrome on the side, patch the config file and all.
If this issue is a blocker, please just revert your Cloudron app to the previous version for now.
-
-
@nebulon Editing the env file as David suggested did fix the issue but you're right, it's best if I revert back to an older version for now.
It's definitely a breaking issue because you can't see the invoice at all no matter whether it's previewed or downloaded so clients wouldn't be able to view/pay it.
For the curious ones out there, toggling "PHANTOMJS_PDF_GENERATION=false" to true will give you a grey background and an empty file on the invoice PDF's.
And if you don't want to revert back, editing the env file to the following will fix the issue:
PHANTOMJS_PDF_GENERATION=false
PDF_GENERATOR=hosted_ninja -
@girish @nebulon Hi, sorry about replying to solved issue but I am getting this weirdly. The PDF does generate but when I go to download/print/view it I get this:
Same issue it seems.
Tried adding these to the env file. Even tried different combos of these.
Not proxied through cloudflare this time.PHANTOMJS_PDF_GENERATION=false PDF_GENERATOR=hosted_ninja
No change after at all. It is a fresh install from today as I'm messing with it for testing purposes.
Have tried edge,chrome,firefox and no change at all in either. Even tried their windows app with no avail.
The fixes and main issues aren't really descriptive enough for a fix.Any advice or tips on this?
-
@joesitsolutions do you see any errors in the app logs or the browser console when you try to download it?
-
@joesitsolutions my instance is working fine but my env file looks like this now, with no mention of the "PDF_GENERATOR=hosted_ninja" line.
NINJA_ENVIRONMENT=selfhost PHANTOMJS_PDF_GENERATION=false COMPOSER_AUTH='{"github-oauth": {"github.com": "${{ secrets.GITHUB_TOKEN }}"}}' DISABLE_AUTO_UPDATE=true
-
@joesitsolutions said in PDF invoices broken:
PDF_GENERATOR=hosted_ninja
I think we use snappdf. So, this variable should probably read
PDF_GENERATOR=snappdf
-
Hi All,
Thanks for the reply around this.
Here is the browser console
There are some errors/warnings there
Not entirely sure what this means...
Ain't too familiar with Chrome errors.
Here is a log from when I load this page. https://pastebin.com/JhNaA1v2
Trying some more fixes suggested.
@girish said in PDF invoices broken:PDF_GENERATOR=snappdf
Tried this and PDFs do not generate. Not even in the preview.
Should this be on a new line or is it fine right bellow something?
I did save the env file and restart the app upon each change.I also gave this a shot with no change.
@humptydumpty said in PDF invoices broken:
NINJA_ENVIRONMENT=selfhost
PHANTOMJS_PDF_GENERATION=false
COMPOSER_AUTH='{"github-oauth": {"github.com": "${{ secrets.GITHUB_TOKEN }}"}}'
DISABLE_AUTO_UPDATE=true -
@joesitsolutions said in PDF invoices broken:
No change after at all. It is a fresh install from today as I'm messing with it for testing purposes.
I didn't see this before. Let me test with a fresh install. So, I just create an invoice and the PDF generation fails?
-
@girish Yep, Previews work but actually making a PDF and downloading it or Viewing a PDF within the platform produces a grey file. I'm not sure if it is just a "me" issue so if you'd like to test it'd be interesting to see if it is more widespread perhaps.
-
@joesitsolutions A vanilla invoiceninja works for me both in Chrome and Firefox.
I also have the following like @humptydumpty
NINJA_ENVIRONMENT=selfhost PHANTOMJS_PDF_GENERATION=false COMPOSER_AUTH='{"github-oauth": {"github.com": "${{ secrets.GITHUB_TOKEN }}"}}'
-
@girish Yep works fine in the demo site.
This is a strange one and very likely a me issue. Even if I put my config back to normal it doesn't work for me... then I clear my pfsense's suricata blocks and it loads.
Hmm, I wonder if this pulls in external formatting/css/styles from somewhere that is being blocked on my end or something weird like that.
But then why would the preview load fine. Real head scratcher this one.Edit:
I've tried from my phone and am getting the same issue. Even with IDS/IPS/PFblocker off on my FW.
The preview itself loads fine with normal Vanilla config but when I go to preview PDF or download I get the gray file.
Still not sure what is happening tbh. Worth a reinstall perhaps?Edit 2:
Did a reinstall and it works...? Am I the problem rolf..
Thanks for your help. I'll do some more testing and see if I run into this issue again.