[reportlab-users] Layout Help

Rob McCulley RMcCulley at county24.com
Tue Feb 26 15:01:42 EST 2008


Hi all,



I'm a bit of a reportlab newb. I've used it for awhile, but only for
one specific task, and outside of that, I know very little.



I need a little help in setting up my document layout. I've attached a
.png file showing essentially what I'm trying to create. One large map
document (the map will be a .png image), and then a legend and title
block in the bottom left.



The map image is the same size as the page, so the I need the lower left
corner of the map to be covered by the legend and the title block. How
do I do this? My initial thought was to use tables, but the map area of
the document is non-rectangular. Here is what I have so far:



if os.path.isfile(outfile):

os.remove(outfile)

c1 = Canvas(outfile)

mapsize = (24*inch,36*inch)

c1.setPageSize(mapsize)

mapimage = Image(mappath,width=23*inch,height=34*inch)

data = [[mapimage]]

t1 = RLTable(data)

t1.setStyle(TableStyle([('BOX',(0,0),(-1,-1),1,colors.black),


('ALIGN',(0,0),(-1,-1),'CENTER'),


('VALIGN',(0,0),(-1,-1),'MIDDLE')]))

p1 = [t1]

f1 =
Frame(0.25*inch,0.25*inch,23.5*inch,35.5*inch,showBoundary=1)

f1.addFromList(p1,c1)

c1.showPage()



I've already created two other table elements, one for the legend and
one for the title block, and then it dawned on me, that I don't have
clue how to draw these two tables on top of the map table. Can I do
this?



Thanks,

Rob McCulley

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20080226/c0cfef4e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: drawing.png
Type: image/png
Size: 5217 bytes
Desc: drawing.png
Url : <http://two.pairlist.net/pipermail/reportlab-users/attachments/20080226/c0cfef4e/attachment.png>


More information about the reportlab-users mailing list