Closed Fradd747 closed 3 weeks ago
I am having a very similar issue, which arised when I upgraded to puppeteer 22 to 23.
With version 22, it worked correctly.
Out of curiosity, which version of puppeteer are you using?
You're right. I'm currently using puppeteer version 23.1.0 but when I downgraded to 22.15.0 it started working. Thank you.
You're welcome; however, this seems to confirm that there is some compatibility issue with the new version.
I tried diagnosing it, but to no avail, as it seems there is no log whatsoever; or maybe logging must be somehow "enabled", but I wouldn't know how to.
Indeed, related discussion here: https://github.com/spatie/browsershot/discussions/866
Currently with puppeteer >=23 PDF generation seems only working when using save() method.
Proposed a new fix here: https://github.com/spatie/browsershot/pull/876
What happened?
I can't preview a PDF in browser using
return pdf()->view('invoice')->name('filename.pdf');
. It loads the PDF but it says "Failed to load PDF document." ->download() also works, although the file cannot be preview. It says again "Failed to load PDF document."Seems like the headers are okay, but actual PDF file is corrupted.
How to reproduce the bug
Package Version
1.5.2
PHP Version
8.2.12
Laravel Version
11.20.0
Which operating systems does with happen with?
Windows
Notes
No response