[Zope] Printing from Zope.....Report writer building

Ben Leslie benno@sesgroup.net
Fri, 24 Mar 2000 18:01:35 +1100


> I got some replies about PDF document creation tools, both, products for Zope
> or, Python made software.
> 
> All of those products actually create the PDF document and later on it has to
> be "viewed" on the client PC with the Acrobat reader (or similar tool) and
> printed from there. This is NOT operational since, the server is the one that
> has to send the print request to the Linux spooler after the user pressed a
> "print" button on his/her browser. The "to be printed" document HAS to be
> mandatory printed (by law requirements) after user has filled in data,
> checked for errors and hit "print" on the web form (not the browser's print
> button).
> 
> Seems like a python code has to be written and kind of "intercepts" the
> rendered web page with entered data (or just the plain data itself, with no
> html tags)  and then sends it to the operating system print spooler.
> 
> It is coming to my mind to kind of build a "report writer" system for Zope
> applications, after all this...Any comments? helping volunteers?
> 
> Thanks for all replies and help so far.
> 
> Felipe Barousse


Assuming you are just going to be using linux this shouldn't be _too_ hard.

You probably would want to firstly use the http client module in python
(not sure exactly what it is sorry). Which could download a html page which
is generated by Zope.

The with the html page you can make a system call to "html2ps temphtmlfile temppsfile;  lpr temppsfile -Pprinter". Python has the ability to simply call 
external program (i think it is os.system( ) ). Of course you could find/write
your own html->ps and printing code but when you already have html2ps and lpr
I wouldn't really bother.

Now if you wrap all that up into an external method which is called when the 
print button is pressed it should be quite acceptable.

Is this the type of thing you want or am I off in another planet?

Benno