[reportlab-users] Appending image to Frame: no attribute 'getSpaceBefore'

Andrés Maneiro andres.maneiro at gmail.com
Wed Apr 16 05:20:09 EDT 2008


2008/4/15, Tim Roberts <timr at probo.com>:

>

> story1.append(Paragraph("This is a Heading",styleH))

> > mapa = Image('prueba1.jpg', width='256', height='192')

> > mapa.wrap('256', '192')

> > story1.append([mapa])

> >

>

> But you are not appending an Image. You are appending a list containing

> an image. That's why you get this:

>

> >>> 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'

> >

> Thanks Tim by your answer.


I did several tests, and i think error was in image units (altought append
list instead image was a mistake too). Now, i did:

sizePage = {'width':16*cm, 'height':24*cm}
story1.append(Image("prueba_xANCHO_1.gif",width=sizePage['width'],
height=(350*sizePage['width'])/670))


.. and it works fine. Best regards!
/amaneiro
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20080416/c08d4b89/attachment.html>


More information about the reportlab-users mailing list