views:

81

answers:

2

I need to generate the form seen here using Python/reportlab.

http://www.flickr.com/photos/49740282@N06/4563137758/sizes/o/

I am attempting to do this by creating a custom flowable for the header at the top (with the boxes drawn) and then having a table flowable for the jewelry table below. What shows as the JEWELRY table for this example could potentially be multiple tables. I am having trouble getting my drawn header to "flow". It gets drawn, but then my table data overlays it instead of appearing below it.

This is my first project with reportlab. Before I really get into debugging this, I would like to know from someone with reportlab experience if my approach is correct here. Thanks!

A: 

I cannot help you with reportlab because I'm not so experienced user (I left idea to use it after some problems that made me crazy:)). But if you consider using some other tool to generate your pdf in python I would avice you to take a look at xhtml2pdf - it might be a good option if you didn't go to far with reportlab. If you are familiar with html this might be easier for you to use. The idea here is simple: it converts html you provide to a pdf file. Of course you need to generate html code somehow (I use django templates for that).

Lukasz Dziedzia
Sorry, -1. This question relates to the page oriented nature of pdf documents. Trying to write html (which is document oriented) in a page oriented fashion so that the HTML is able to be converted into separate pages of a pdf document would be... excessively tedious to say the least.
Matthew J Morrison
Maybe, but it wasn't stated clearly in question. I decided to give infromation about html2pdf because Wes wrote that this is his first project in reportlab so I wanted to give information about alternatives (sometimes document-oriented approach is enough and might be easier)
Lukasz Dziedzia
A: 

I don't see the need for a custom flowable here.

You may just use tables (and tablestyles) to do the "header".

Another simple solution, if you need some fancy background, is to draw an image (like a JPG) and then draw the variable strings on top of it.

dugres