[reportlab-users] platypus - rendering template with a right aligned image in the template header as background

Tim Roberts timr at probo.com
Wed Apr 11 13:23:50 EDT 2012


luke lukes wrote:

> hi everyone. i'm tryng to use Reportlab to output an invoice on a

> simple Django app. it seems quite difficult to do simple things like

> this.


It is ALWAYS hard to climb the learning curve for using a new software
package, until you learn the philosophies behind it. Do not blame
ReportLab for your inexperience.



> here's my code:

>

> http://dpaste.de/mSXQm/

> <http://www.google.com/url?sa=D&q=http://dpaste.de/mSXQm/&usg=AFQjCNH5lk3qBW59Ebe5EjODc-LTh-sI-w>

>

> with this code, my header image is always rendered on page center.


The code in your snippet never places the image on the page. There must
be other code you haven't shown us. Please try to construct a complete
sample program that demonstrates your problem that the rest of us can
run. There's too much missing here.



> i want to insert it on the right (like

> that: http://i.imgur.com/0Ahww.png

> <http://www.google.com/url?sa=D&q=http://i.imgur.com/0Ahww.png&usg=AFQjCNE0enFkfWCz61ZGrkE01E9ivZ0sKQ>)

> or even better having image on the right and text on the left. i've

> tried in many ways (setting the hAlign or oAlign propetry of img,

> inserting image in a ParagraphAndImage flowable) but always i got

> errors or the same alignment. what is the right way?


If you are constructing an invoice, it's possible that Platypus is not
the right way to go. Platypus is a little bit like a word processor,
like Microsoft Word. You provide a stream of "things" to be placed on
the paper, and Platypus worries about placing them and flowing on to
additional pages. For something like an invoice, you often want to have
more control over where things are placed. For that, I find it much
less frustrating to draw directly on the canvas.

--
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/20120411/9cf3db97/attachment.htm>


More information about the reportlab-users mailing list