I'm hoping to switch from xhtml2pdf to weasyprint and have been trying it out; generally it seems excellent, and many problems I've had have have come down to my own deficiencies in CSS understanding. However, I think this one's a bug:
I find that for table rows (tr) with background-colour applied, the colour bleeds beyond the edge of the cell. For comparison, neither Chrome nor xhtml2pdf do this, and I don't think there's any CSS option that instructs this to happen (though I'm happy to be corrected!).
I'm using a fresh install of weasyprint (from pip install weasyprint) as of 5 Jan 2014.
... look particularly at the grey and black shadings bleeding to the right and below the table row to which it is applied.
The CSS is embedded in the HTML, and the PDF was generated using "weasyprint test_weasyprint_bleed.html test_weasyprint_bleed.pdf". There are a couple of errors relating to the image links being dead, but that's for a different part of the document so I presume that's not relevant (and the bleed still occurs when the image links work). There's also an "@frame" error (relating to fact that this source was originally for xhtml2pdf) but I presume that's irrelevant as well.
Many thanks for your attention, and congratulations again on a fine piece of software!
all the best,
The text was updated successfully, but these errors were encountered:
The problem might be be due to padding_left / padding_right / padding_top / padding_bottom, in that editing formatting_structure/boxes.py as follows:
"""Width of the padding box."""# return self.width + self.padding_left + self.padding_rightreturnself.widthdefpadding_height(self):
"""Height of the padding box."""# return self.height + self.padding_top + self.padding_bottomreturnself.height
... makes table background colours align with their tables (though it doesn't do a perfect job, e.g. it clips off the bottom of divs and font descenders can escape their containing table cells). Does that help track down the bug? Sorry, have been unable to find the root cause as yet. Any progress elsewhere?