[reportlab-users] Appending image to Frame: no attribute 'getSpaceBefore'
Andrés Maneiro
andres.maneiro at gmail.com
Tue Apr 15 11:33:03 EDT 2008
Hi people,
im trying append an image to a frame, something like this:
/ ************ BEGIN CODE ***************** /
from reportlab.pdfgen.canvas import Canvas
from reportlab.lib.styles import getSampleStyleSheet
from reportlab.lib.units import inch, cm
from reportlab.platypus import Frame, Paragraph, Image
story1.append(Paragraph("This is a Heading",styleH))
mapa = Image('prueba1.jpg', width='256', height='192')
mapa.wrap('256', '192')
story1.append([mapa])
story2.append(Paragraph("This is a paragraph.",styleN))
c = Canvas('mydoc.pdf')
c.setPageSize((16*cm,24*cm))
f1 = Frame(0*cm, 0*cm, 16*cm, 12*cm, showBoundary=1)
f2 = Frame(0*cm, 12*cm, 16*cm, 12*cm, showBoundary=1)
f1.addFromList(story1,c)
f2.addFromList(story2,c)
c.save()
/ ************ END CODE ***************** /
but when i execute this code i get next error:
>>> Traceback (most recent call last):
File "/tmp/py9217Qyl", line 30, in <module>
f1.addFromList(story1,c)
File "/usr/lib/python2.5/site-packages/reportlab/platypus/frames.py", line
202, in addFromList
if self.add(head,canv,trySplit=0):
File "/usr/lib/python2.5/site-packages/reportlab/platypus/frames.py", line
126, in _add
s =flowable.getSpaceBefore()
AttributeError: 'list' object has no attribute 'getSpaceBefore'
How can i investigate about it? Best regards!
/amaneiro
<reportlab-users at reportlab.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20080415/e1a0bb07/attachment.htm>
More information about the reportlab-users
mailing list