[reportlab-users] Image inside paragraph not appearing

Robin Becker robin at reportlab.com
Sat Jan 26 04:33:23 EST 2008


Stevens, Ian wrote:

> Is this code working for anyone? I've tried this on a few different

> machines with the same results.

>

> thanks,

> Ian.

>

.......
the img tag was added recently, but we have a test in the
reportlab/tests area called test_platypus_paragraphs.py; if that test is
run then the result file called test_platypus_paragraphs_autoleading.pdf
contains paragraphs with embedded images.


> ________________________________

>

> From: reportlab-users-bounces at reportlab.com

> [mailto:reportlab-users-bounces at reportlab.com] On Behalf Of Stevens, Ian

> Sent: Thursday, January 24, 2008 4:20 PM

> To: reportlab-users at reportlab.com

> Subject: [reportlab-users] Image inside paragraph not appearing

>

>

>

> I'm having trouble getting images to appear within a Paragraph

> when I use the <img/> tag:

>

> 1 from reportlab.lib.styles import ParagraphStyle

> 2 from reportlab.pdfgen.canvas import Canvas

> 3 from reportlab.platypus import Paragraph, Frame

> 4

> 5 c = Canvas('test.pdf')

> 6 f = Frame(100, 700, 400, 100, showBoundary=True)

> 7 f.addFromList([Paragraph('This is a test image: <img

> src="test.gif" height="5"/>. That was a test.', ParagraphStyle(None))],

> c)

> 8 c.save()

>

> Where test.gif is created with the following ImageMagick

> command:

>

> echo this is a test | convert -background yellow -page

> 200x50 text:- test.gif

>

> The image will not display. What am I missing?

>

> thanks,

> Ian.

>

>

>

>

> ------------------------------------------------------------------------

>

> _______________________________________________

> reportlab-users mailing list

> reportlab-users at reportlab.com

> http://two.pairlist.net/mailman/listinfo/reportlab-users



--
Robin Becker


More information about the reportlab-users mailing list