[reportlab-users] Paragraphs with images are too small

Robin Becker robin at reportlab.com
Fri Jul 24 04:44:31 EDT 2009

Tim Roberts wrote:

> Roberto Alsina wrote:

>> This is a bug I reported in may and got no response, thought it would be ok to

>> refresh it. I apologize if it's not.


>> Here's a test case. What you will see is that the image in the second

>> paragraph completely overlaps the first paragrah:



> As far as I know, a paragraph in Platypus does not adjust its vertical

> spacing to compensate for inline images. Your image will be drawn with

> its bottom edge on the baseline of the current line, but the baseline is

> not moved to make room for that image. If the image is very tall, it

> will overlap the stuff above it. Thus, the <img> tag is mostly useful

> for icons and other small inclusions.


> If you need a large out-of-line image, perhaps you should use the Figure

> flowable instead.


There is an extra style setting to allow the line heights to adjust with the
fontSize and image heights.

Try setting autoLeading='max' on the style.
Robin Becker

More information about the reportlab-users mailing list