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

Wait until frame stopped loading otherwise images are not loaded #3

Merged
merged 1 commit into from
Oct 19, 2020

Conversation

HiromuHota
Copy link
Contributor

This html Abraham_Lincoln.html.txt includes (non-local) images, the printed pdf Abraham_Lincoln_1.0.40_wo_cache.pdf does not contain images.

This is the script I used:

from pdfy import Pdfy
p = Pdfy(executable_path="mypath/chromedriver")
name="Abraham_Lincoln"
p.html_to_pdf(f"{name}.html", pdf_path=f"{name}.pdf")

When I ran the script again, the pdf contains images:
Abraham_Lincoln_1.0.40_w_cache.pdf

This means that if images are cached, the pdf contains images.

This PR lets pdfy wait until a frame stop loading.
Abraham_Lincoln_pr_wo_cache.pdf

The pdf contains images even when images are not cached.

@mikahama mikahama merged commit 7401449 into mikahama:master Oct 19, 2020
@HiromuHota HiromuHota deleted the fix/image_not_loaded branch October 19, 2020 21:28
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