Printing From Python

Jamey Cribbs jcribbs at twmi.rr.com
Thu Jan 29 23:33:24 EST 2004


Fuzzyman wrote:

> Any 'print' modules out there - that implement cross platform printing
> interfaces ?

Well, this solution isn't cross platform, it isn't written in Python, 
and it isn't free, but I have used it quite a bit and it works great (on 
Windows, at least).

Rpv (http://www.rpvreport.com) is a report generator that is totally 
unlike Crystal Reports or other products.  To me, it fills a great niche 
between complex, gui-designer report writers like Crystal, and the other 
end of the spectrum such as trying to format text as an html document 
and then doing an external call to your web browser.

Basically, Rpv is a program that will read a text file that your program 
creates that will have all of the data that you want to print.  It then 
reads a template file (another text file) that you create beforehand, 
which tells it how to format the report, where to place the data from 
the text file, where the headers go, etc.

So, basically the steps I use in a program to let the user print data are:

1).  Create the text file containing the data.
2).  Do an external call to Rpv, passing it the name of the text file 
and the name of the template file.
3).  Rpv then opens up a nice print preview window that shows the user 
what the report will look like with all of the data included.
4).  The user can then press the print button in the preview window and 
print the report.

Combined with pygtk (or wxPython), it makes your application look 
professional.

And Rpv is pretty cheap.  I think I paid something like $40 for an 
royalty free version that lets me use it and distribute the runtime to 
all my customers.

Also, I have absolutely no connection to the makers of Rpv, I just 
really like their product.

Hope this helps.

Jamey



More information about the Python-list mailing list