[reportlab-users] simultaneous output of pdf and bmp possible ?

Sebastian Hilbert sebastian.hilbert at gmx.net
Wed Jun 21 18:24:42 EDT 2006

On Thursday 22 June 2006 00:00, Andy Robinson wrote:
> Sebastian Hilbert wrote:
> > Hi !
> >
> > We are using reportlab.pdfgen for medical forms in our free and open
> > source medical practice software GNUmed. I started to read up and took a
> > good look at the code. While at it some questions came to mind.
> >
> > What we basically need for Germany and other countries with regards to
> > forms is ideally something like this. I know that it is not yet possible
> > but I would appreciate your comments.
> Can you explain what you mean by 'forms'?
I expected that question. A form in German medical institutions is a 
preprinted piece of paper with a fixed layout printed on it. One needs to use 
these and print on them.

In GNUmed we have the medical information we would like to print.
GNUmed is python/wxpython. We have many options to reach the goal (printed 

a) tell reportlab to output text and store it in some pdf. send it to the 
printer via python system calls - works but is not very elegant
pros: cross platform, pdf for storage in database
cons : no user feedback (no pdf viewing apart short of callling acrobat ) , no 
use of the printing frameworks (chose printer etc...)

b) use wxpython itself to draw text on some sort of canvas , build image 
stream and use their framework to print
pros : cross platform, makes use of printing framework, visual user feedback
cons : can only be used with that gui framework, needs to reimplemented for 

c) as a dream i would like to be able to manipulate the form (see above) on 
screen. pdf is a no go here as there is no open source pdf form viewer
svg with xforms might be possible as xforms data is xml plus svg is supported 
by wxpython. I like svg because one can scale it for viewing.
> We've spent years building forms solutions and as far as I can tell many
> vendors and customers mean completely different things to each other
I agree.
> . 
> The context we know best is when an organisation has lots of paper
> forms; and they want to create a web form for each one to capture the
> data, which is able to populate a 'finished' PDF form afterwards.
Almost but we don't use webforms as of now but rather collect data from the 
database plus some user input via wxpython. As a top notch solution the form 
should be displayed on screen with some sort of interactive overlay. But for 
the time being we might as well design gui dialogs to gather the user's input

> We 
> have commercial code for doing this which we cannot open-source, but a
> lot of experience we might be able to share to help you.
I totally understand that you need a buisness model. I chose to go open source 
because I am a doctor. So I don't have to eran money with GNUmed. Lucky me.
That is what they call helper syndrome.
> Other people want Acrobat Reader to be their data-input device and
> produce forms you actually fill in.
one possible solution but involves lots of system calls to acroread and kind 
of feels wrong. In my environment speed is essential. It's not like we have a 
day to create business reports. You wnat your prescription now (printed that 

> Still more want a custom GUI for 
> capturing input from various processes.
Sure the gui wouls be nice although the underlying creation process ( cook a 
pdf ) should be abstracted, cross platform and reusable (webinterface, 
wxpython GUI) 
> > 4.) I noticed svg output from reportlab. Googling around I found some
> > information on svg and xforms as a means of active forms. Is there
> > support for this and do you have any ideas if this is cross platform ?
> The SVG output is from the graphical drawings, not whole pages; see
> below.  Also we have had nothing to do with xforms.
> > 5.) I noticed bitmap output from reportlab. Is it possible to output
> > bitmap and pdf off the the same reportlab 'template' ? As far as I can
> > see writing code for the pdfgen module is not identical to writing code
> > for the svg/pdf/bitmap renderer ? Is that correct ?
> >
> > Here is what I am tyring to solve. Draw and save a form as pdf
> > but 'convert' /save as bitmap as well. This bitmap object could then be
> > passed on to PIL for further manipulation or wxpython's printing
> > framework for printing. That is crossplatform processing I am dreaming
> > of.
> That's "ReportLab 3000" which pretty much exists in my head and I dare
> not give you a target date.  Well, maybe 2008!
That close ! That sound like a release well before GNUmed !

> In the earliest days 6 years ago, we were thinking of making PDF
> documents.  But then an early customer wanted to have the same custom
> charts we built in PDF available as bitmaps for the web too.  So, we
> made the reportlab/graphics portion 'cross platform'.  Drawings are
> shape hierarchies and can be output with very good fidelity to bitmaps.
>   But 'whole pages' are not.
I get it. 
> In the next major version I want to go back to basics and create a base
> canvas, a PDF canvas, a Bitmap canvas and maybe others (SVG, PS); and
> any page or part thereof could then be rendered to a bitmap.
That's kind of what I was hoping for
> However, realistically this might be 1-2 years off, unless someone has a
> month or two to help.  
I have been looking for that someone for years :-)

> As I am sure you know the license revenue from 
> open source isers is nil, so we have to live off projects and corporate
> solutions, and nudge things forward a small step at a time when the
> right projects come along.  To date none of our projects or products
> needs this kind of 'whole page preview'.
Best Regards,

Sebastian Hilbert 
Leipzig / Germany
[www.gnumed.de]  -> PGP welcome, HTML ->/dev/null

More information about the reportlab-users mailing list