[reportlab-users] Image position
Tim Roberts
timr at probo.com
Fri Jan 21 14:00:53 EST 2011
Stefanie Lück wrote:
>
> Hi!
>
>
>
> I'm trying to add some images to my PDF with platypus:
>
>
>
> story = []
>
> styles = getSampleStyleSheet()
>
> styleN = styles['Normal']
>
> im_query = Image("src/seq.jpg", width=8*inch, height=0.025*inch)
>
> im_query.hAlign = 'CENTER'
>
> story.append(im_query)
>
> doc = SimpleDocTemplate('mydoc.pdf',pagesize = letter, topMargin=0)
>
> doc.build(story)
>
>
>
> Is there any option to specify the Position X,Y of the image on the PDF?
>
Yes, but you need to step back and think about it. The Platypus
philosophy is that a document is a series of "flowables"; you supply
blocks of content, and Platypus places them on the page for you
automatically. If you want to place things by hand, then you need to
think about how that interacts with the flow. If you don't care about
flow for a particular document, and just want to place things yourself,
that's great, but skip Platypus.
Mixing the two is possible, if you are careful.
--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20110121/89a190b7/attachment.htm>
More information about the reportlab-users
mailing list