-
-
Notifications
You must be signed in to change notification settings - Fork 647
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
WeasyPrint does not show images in PDF #1427
Comments
Long story short: there is a problem with flexbox. My image was inside a flexbox container and would never display correctly. I think its weird, that the logs didnt show anything? <div class="signature__wrapper">
<img src="{{ signature_image.url }}">
</div> and .signature__wrapper {
display: flex;
justify-content: center;
align-items: center;
} removing the |
Thanks for the report. I can reproduce your problem, with a width set to a percentage for the image. Is that what you have too? If that’s your case too, then it’s a duplicate of #656 (see #656 (comment)). |
Yes, this is what I have too. Sorry! I should have thouroughly read the other comments and issue before making my own. My apologies. This issue here can be closed. :) |
No problem, that was not obvious at all, and I’ve spent 5 minutes finding the right issue myself 😉. |
Hey.
I hope there is a way around my current issue:
Pre-knowledge
HTML template
Problem
The PDF does not contain two of my images, but all the others.
The html template, which is used as a base for the PDF, is a Jinja2 html. template. It is used both the html preview (just rendering the html template) and making the pdf. The initial images are pngs, pixbuff and all other stuff is installed correctly
Suspicion
Since its only a couple of images that arent working, and they are manually generated (signatures for a contrat), I assume there might be something wrong with the image itself.
Code
I have tried setting up logs, to see if there is a potential issue with downloading the image.
But nothing of error shows up in here.
Images rendered in the html, using the html template:
Images rendered in the pdf, using the html template:
My main question is: how can I debug further? I might want to see if there is an issue with downloading/inserting the image.. or if the image has a wrong alpha channel.. or whats wrong
Specs
python version: 3.8.10
weasyprint version: 52.5
django 3.2.6
The text was updated successfully, but these errors were encountered: