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

Chorny, Ilya ichorny at illumina.com
Wed Apr 11 13:24:30 EDT 2012


image_file = "%s/LOGO_RGB_new.jpg" %(exec_dir)
im = Im.open(image_file)
imsize = im.size
imw = float(imsize[0])*.15
imh = float(imsize[1])*.15
im = Image(image_file, imw, imh)
im.hAlign ='RIGHT'
Story.append(im)


From: reportlab-users-bounces at lists2.reportlab.com [mailto:reportlab-users-bounces at lists2.reportlab.com] On Behalf Of luke lukes
Sent: Wednesday, April 11, 2012 5:44 AM
To: reportlab-users at lists2.reportlab.com
Subject: [reportlab-users] platypus - rendering template with a right aligned image in the template header as background

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. 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. 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?

i've tried to look at Reportlab documentation but seems not so clear
to me and poor of code snippets.

tnx to everyone,
LuKe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20120411/7be5a6a6/attachment.htm>


More information about the reportlab-users mailing list