Unreadable PDF content #173
Unanswered
CagliotiAtik
asked this question in
Q&A
Replies: 1 comment
-
There is currently a known issue in Browsershot (dependency of laravel-pdf) that prevents it from working with Puppeteer v23+. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
What happened?
Spatie LaravelPDF works well on windows machines, but in the Debian12 production all the PDF generated are unreadable.
First of all, I had a previous problem that completely prevented me from generating PDFs. I solved it by adopting the solution proposed in this discussion.
Now the related problem is that I cannot generate a valid PDF.
Every time I try to open one I get a size other than 0 but (on both Edge and Firefox) I get a “Unable to open document” error.
How to reproduce the bug
I am going to generate the document from a Laravel blade file.
I have created a Service for generating and saving PDFs to which I pass two variables:
The code that goes to perform the generation and saving is divided into two files:
The file generated after downloading it (but it is the same size if I don't download it)


And the result if i try to open it in Edge

Anyone who can give me guidance on how I can solve this problem?
Verisons
Package Version
PHP Version
Laravel Version
11.9
Operating System
Kernel: 6.1.0-12-amd64
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
Notes
As mentioned, the solution works perfectly with development Windows machines.
In fact, for them I did not need to modify the puppeteer cache, indeed, if I try to insert the file with the modified configuration on Windows machines I get the following error:
Beta Was this translation helpful? Give feedback.
All reactions