[reportlab-users] Image inside paragraph not appearing

Robin Becker robin at reportlab.com
Mon Jan 28 13:25:55 EST 2008


Stevens, Ian wrote:

> Thanks, it's working now that I'm using trunk. Is there any way to

> honour spacing to the right of the image? Padding is applied to the

> left of the image, but not to the right even if there are spaces after

> the image. This is evident in figure A-49 in the user guide as well.

>

> Thanks,

> Ian.

......
not sure exactly what's going on in the userguide, but the test shows spacing on
the right. The very last thing looks like this

Paragraph('''<img src="../docs/images/testimg.gif" valign="top"/> image is very
first thing in the line.''', style=normal)

and that certainly appears to show a space between the image and the text. This
was one of our bug cases during development. When I add the text from A-49 to
the case in test_platypus_paragraphs.py

Paragraph('''<para autoLeading="off" fontSize=12>This &lt;img/&gt; <img
src="../docs/images/testimg.gif" valign="top"/> is aligned <b>top</b>.<br/><br/>
This &lt;img/&gt; <img src="../docs/images/testimg.gif" valign="bottom"/> is
aligned <b>bottom</b>.<br/><br/> This &lt;img/&gt; <img
src="../docs/images/testimg.gif" valign="middle"/> is aligned
<b>middle</b>.<br/><br/> This &lt;img/&gt; <img src="../docs/images/testimg.gif"
valign="-4"/> is aligned <b>-4</b>.<br/><br/> This &lt;img/&gt; <img
src="../docs/images/testimg.gif" valign="+4"/> is aligned <b>+4</b>.<br/><br/>
This &lt;img/&gt; <img src="../docs/images/testimg.gif" width="10"/> has width
<b>10</b>.<br/><br/> </para>''', style=normal)


I see the attached pdf which seems to be respecting the right space. I suspect
some kind of pre-processing is going on in the userguide creation I'll have to
check further.
--
Robin Becker
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_platypus_paragraphs_autoleading.pdf
Type: application/pdf
Size: 5193 bytes
Desc: not available
Url : <http://two.pairlist.net/pipermail/reportlab-users/attachments/20080128/2ce8a6b5/attachment.pdf>


More information about the reportlab-users mailing list