[reportlab-users] How to properly get alignments of flowables right...

Brower Jason Jason.Brower at kone.com
Thu Oct 1 04:56:27 EDT 2009


I felt I was doing something similar now.
---
salesman_comments = "This is something called lorem ipsom text.<br/> It
is used as a filler text. Lorem ipsum dolor sit amet, consectetur
adipisicing..."
style = getSampleStyleSheet()
P=Paragraph(salesman_comments,style["Normal"])
P.wrap(140, 800)
P.drawOn(pdf,6.1*cm,4.5*cm)
pdf.showPage()
pdf.save()
---
But it looks like I have to make adjustments from the bottom left corner
of the object. It doesn't seem logical that way. Is there something I
am missing about doing zero point of the object at the top left of
itself?
Otherwise as my dynamic text gets longer it pulls the top higher and
higher.
Regards,
Jason

-----Original Message-----
From: reportlab-users-bounces at lists2.reportlab.com
[mailto:reportlab-users-bounces at lists2.reportlab.com] On Behalf Of Robin
Becker
Sent: 01/10/2009 11:40
To: Support list for users of Reportlab software
Subject: Re: [reportlab-users] How to properly get alignments of
flowables right...

Brower Jason wrote:

> I am trying to get my first flowable working in my pdf.

>

> It works, but I want to have it start at a certain upper left

position.

> 5*cm x 5*cm

>

> Is there a way to designate that? It seems to always want to draw

from

> the lower left. I have no problem with that, it's just that when I

> create the text in the box the starting point moves UP and I can't

> figure out how to logically place this object.

>

> Best Regards,

>

> Jason Brower



Although Drawings are flowables they were originally intended as stand
alone
objects ie create a single bitmap, pdf, eps or svg image etc etc. If you
intend
to use the flowable interface then either you add the flowable to a
platypus
story or you need to use the drawOn method. So if D is your drawing you
should
do something like

D.drawOn(canv,x,y)

where canv is your pdf canvas and x and y are the coordinates with x
measured
from left edge of the user space and y from the bottom.
--
Robin Becker
_______________________________________________
reportlab-users mailing list
reportlab-users at lists2.reportlab.com
http://two.pairlist.net/mailman/listinfo/reportlab-users


More information about the reportlab-users mailing list