Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix generation of large PDFs #827

Merged
merged 2 commits into from
May 21, 2024
Merged

Fix generation of large PDFs #827

merged 2 commits into from
May 21, 2024

Conversation

clementmas
Copy link
Contributor

@clementmas clementmas commented Mar 13, 2024

Browsershot can not currently save PDFs that are over 512 MB.

Browsershot::url('https://page-containing-large-images.com')->save('large-file.pdf');

The issue is described quite well here: microsoft/playwright#14675

The error Cannot create a string longer than 0x1fffffe8 characters occurs at output.toString('base64') which can not handle very large output (see Stack Overflow thread).

However, we don't need to convert the output to base64 when saving PDF files to disk. If we did, we should serialize the output to buffer but I don't think this is necessary.

Fixes #642 and #745.

Note: this is the same PR as #779 but reopened to fix the git rebase issue

@sweptsquash
Copy link

sweptsquash commented May 20, 2024

Sorry for being direct, but is there any update on this PR @freekmurze I'm also facing a similar issue.

@freekmurze freekmurze merged commit 73313cc into spatie:main May 21, 2024
1 of 5 checks passed
@freekmurze
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants