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(print-pdf): wait untill all resources are loaded #466

Merged
merged 1 commit into from
Nov 11, 2023

Conversation

moleus
Copy link
Contributor

@moleus moleus commented Nov 7, 2023

I encountered an issue with the loading of js assets and custom fonts when attempting to generate a PDF. This resulted in either empty or poorly formatted pdf. Upon investigation, I determined that the problem was related to the waitUntil option of Puppeteer's goto() method.

There are several options available for the waitUntil parameter, including load, domcontentloaded, networkidle0, and networkidle2. You can find detailed descriptions of these options here and a discussion in this GitHub issue.

I changed the waitUntil value to networkidle0, and this adjustment successfully resolved the problem, allowing the assets and fonts to load properly before generating pdf

@webpro
Copy link
Owner

webpro commented Nov 11, 2023

This is great! Thanks for the investigation and the fix 👌

@webpro webpro merged commit 8406b7a into webpro:main Nov 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants