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

there is no img when convert html to pdf #994

Closed
zhizunbao84 opened this issue Nov 18, 2019 · 6 comments
Closed

there is no img when convert html to pdf #994

zhizunbao84 opened this issue Nov 18, 2019 · 6 comments

Comments

@zhizunbao84
Copy link

zhizunbao84 commented Nov 18, 2019

in the html file there are some img:
<p style="text-align: center;"><img class="rich_pages " data-ratio="0.5625" data-s="300,640" data-src="https://s1.51cto.com/images/20190714/1563098235772223.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=" data-type="jpeg" data-w="1280" style="width: 677px !important; height: auto !important; visibility: visible !important;" _width="677px" src="https://s1.51cto.com/images/20190714/1563098235772223.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=" crossorigin="anonymous" data-fail="0"></p>

but i get no img when convert html to pdf.

@zhizunbao84
Copy link
Author

weasyprint.log

@zhizunbao84
Copy link
Author

the page seems lazy load

@Tontyna
Copy link
Contributor

Tontyna commented Nov 18, 2019

When I weasyprint your example paragraph my PDF contains the image as expected.

In the given weasyprint.log there is nothing that indicates an image-not-found-problem.

So maybe the images you are missing are hit by a css rule that hides them?

@zhizunbao84 Could you please provide an HTML+CSS example that fails to show images?

@zhizunbao84
Copy link
Author

from the source code of the html page, the img is actually like this:
<img class="" data-copyright="0" data-ratio="0.8169934640522876" data-s="300,640" data-src="https://s1.51cto.com/images/20190714/1563098235772223.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=" data-type="jpeg" data-w="1224" style=""/>

the src of the img file will be changed by javascript

@Tontyna
Copy link
Contributor

Tontyna commented Nov 18, 2019

the src of the img file will be changed by javascript

WeasyPrint doesn't support JavaScript, cf #817

@liZe
Copy link
Member

liZe commented Nov 25, 2019

WeasyPrint doesn't support JavaScript, cf #817

Yes, it's a disguised duplicate of #817.

@liZe liZe closed this as completed Nov 25, 2019
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

3 participants