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

Lazy loading images are not included in the PDF #53

Closed
meddbase-steve opened this issue May 21, 2022 · 4 comments
Closed

Lazy loading images are not included in the PDF #53

meddbase-steve opened this issue May 21, 2022 · 4 comments

Comments

@meddbase-steve
Copy link
Contributor

Docusaurus v2 seems to make images lazy loading by default. They are not included in the PDF because puppeteer never loads them.

Suggested approach that I've tested on my fork is to use puppeteer-autoscroll-down to scroll to the bottom of each page. This forces loading of all the images. I will create a PR, but welcome comments.

@kohheepeace
Copy link
Owner

@meddbase-steve After merging PR #54, do you feel stuck on the last page ? Though, I'm not sure this is related with PR #54

@meddbase-steve
Copy link
Contributor Author

Hi, I'll give it a test now.

@meddbase-steve
Copy link
Contributor Author

For my docusaurus v2 site, the latest version of mr-pdf (run with npx) completes successfully and includes my footers and images. Generating the pdf is a bit slower when encoding actual images, could that be what you're seeing?

@kohheepeace
Copy link
Owner

@meddbase-steve Okay, It seemed a bit stuck when generating the PDF on the last page, but it may be due to a different PR.

Anyway, thanks for your work 👍 I close this issue.

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

No branches or pull requests

2 participants