[reportlab-users] A bug using <img>

Roberto Alsina ralsina at netmanagers.com.ar
Sat May 16 17:57:41 EDT 2009


I got this bug report for rst2pdf, but I was able to reproduce it using just
reportlab:

http://code.google.com/p/rst2pdf/issues/detail?id=113

Basically, a paragraph containing <img src="thanks.png"> draws the image above
the previous paragraph. The text is there, but it's under the image.

It should be possible to reproduce with almost any image, but you can get
thanks.png here:
http://rst2pdf.googlecode.com/issues/attachment?aid=9059379037914234984&name=thanks.png

And here is my reportlab program to reproduce it:

from reportlab.platypus import SimpleDocTemplate, Paragraph
from reportlab.lib.styles import getSampleStyleSheet
styles = getSampleStyleSheet()

def go():
Story=[]
doc = SimpleDocTemplate("phello.pdf")
style = styles["Normal"]
p = Paragraph('This should be above the image', style)
Story.append(p)
p = Paragraph('<img src="thanks.png">', style)
Story.append(p)
p = Paragraph('This should be below the image', style)
Story.append(p)
doc.build(Story)

go()

--
("\''/").__..-''"`-. . Roberto Alsina
`9_ 9 ) `-. ( ).`-._.`) KDE Developer (MFCH)
(_Y_.)' ._ ) `._`. " -.-' http://lateral.netmanagers.com.ar
_..`-'_..-_/ /-'_.' The 6,855th most popular site of Slovenia
(l)-'' ((i).' ((!.' according to alexa.com (27/5/2007)
"Our opponent is an alien starship packed with atomic bombs, I said.
We have a protractor. Okay, I’ll go home and see if I can scrounge up a
ruler and a piece of string." — Neal Stephenson


More information about the reportlab-users mailing list