-
-
Notifications
You must be signed in to change notification settings - Fork 686
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
png images are not reflected in pdf for ubuntu 16.04 #561
Comments
That's probably a duplicate of #556 😢. The bug is in Cairo 1.14.12, it's been fixed in Cairo's master branch but no new version has been released yet. The easy solution is to downgrade Cairo to 1.14.10. |
but for linux, the comand doesn't mention the version of cairo... sudo apt-get install build-essential python3-dev python3-pip python3-cffi libcairo2 libpango-1.0-0 libpangocairo-1.0.0 libgdk-pixbuf2.0-0 libffi-dev shared-mime-info |
You can have the version launching in your terminal: |
@deepak-ace12 Is the problem fixed for you? |
no..not yet |
Could you please tell what |
Hello! Having the same/similar issue, except I can't get any images to render. I'm working from a Macbook Pro and running Rendering HTML via a Jinja template and handing that off to weasyprint for rendering: |
Then … it's probably not the same issue 😉.
Do you have anything interesting in the logs? If you don't, I'd be interested in the HTML source and the generated PDF. |
Hi, thanks for responding. Nothing in the logs. The HTML that gets generated is pretty extensive, but this bare-bones example does not render the image -- just the text. I've tried several different images of various types (jpg, png, gif, svg) but no luck. Attached the image and the resulting PDF. <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>skyline</title>
</head>
<body>
<img src="skyline.jpg" />
<p>Hello!</p>
</body>
</html> Rendered to PDF like this: from weasyprint import HTML
HTML(filename='test.html').write_pdf('test.pdf', stylesheets=["style.css"]) I don't have any image-related styling in my stylesheet. I'm running
Thanks for any insight you can offer! |
It really looks like #556. Cairo 1.15.10 and 1.14.12 have this bug, but not 1.15.8, 1.14.10 or current master branch.
Does it mean that you didn't manage to install 1.14.10 or that it didn't solve your problem? |
I downgraded and it did not solve my problem. I'll try running the script against 1.14.10 again, and 1.15.8, and let you know the results. |
No luck. I'm managing four versions of Cairo with homebrew:
For each version, I run Is there more information I could provide that would help debug? |
Oh, I'm stupid. If you use WeasyPrint as a library, you have to configure logs like explained on this page and read what's in the logging file.
Then it's something else. If it doesn't work, even with SVG files, then for some reason WeasyPrint can't find image files. You'll get more info in logs. |
Aha! Missed that. Logged: Adding Thanks for helping me resolve! |
@cjwinchester you're welcome! @deepak-ace12 closing this issue, as your problem is probably due to your Cairo version. |
Hi,
I am trying to generate a pdf using weasyprint. I have installed everything as per the doc http://weasyprint.readthedocs.io/en/latest/install.html The pdf is working well on my mac system but when I am trying to deploy it on server (Ubuntu 16.04), the png images are not printed on the pdf file. Jpeg images are working just fine.
The text was updated successfully, but these errors were encountered: