Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Some floating images not being output to pdf since 0.42 #576
Some float images that display fine in HTML are not being included in rendered WeasyPrint PDFs using
A very simple self-contained html document which has a couple images. This is a simplified version using actual CSS from Bootstrap (which is what my actual site is using):
<html> <body> <img src="https://i.imgur.com/mK3ufI3.png"> <div style="float: right;"><img style="max-width: 100%;" src="https://i.imgur.com/mK3ufI3.png"></div> </body> </html>
The output looks like this (or live https://jsfiddle.net/kzLhtejh/):
When generating a PDF from this HTML with WeasyPrint
However when simply upgrading to WeasyPrint
All subsequent versions of weasyprint have the same result. Here is a comparison of the two versions, there were quite a few changes to float logic - v0.41...v0.42
I did notice #561, however cairo versions do not have an affect, it's purely in WeasyPrint.
A little more research...
Commit 1076b10 seems to have broken this.
If I reset the repo to this commit and install it:
The generated PDF is still broken. If I revert this commit:
The generated PDF is correct.