Printing from Zope
Hello all: Not sure if this has been asked before, probably yes, but haven't been able to find anything yet. Does any of you has been able to print from a Zope application to a printer attached to the same machine where Zope is running, in my case it's a Red Hat Linux 6.1 box. I need to print from Zope with a specific printing format (like invoices, receipts, etc). This will be done on always the same Intranet and printing will be controlled from the Linux spooling system. If you can copy your comments to me by email besides the mail list, it'd be great. ,Any help is appreciated, thanks in advance. Felipe Barousse
"Felipe E. Barousse Boue" wrote:
I need to print from Zope with a specific printing format (like invoices, receipts, etc). This will be done on always the same Intranet and printing will be controlled from the Linux spooling system.
http://www.reportlab.com/ may be what you need. It's in Python, so it should be easy to hook up to Zope, and it outputs PDF which can then be sent to lpr for printing. Since RH uses Ghostscript as a print driver the generated docs should print fine. -- Itamar S.T. itamars@ibm.net
You'll need to write some software in Python that will interface with Zope for printing to your local Linux printer. In general, this isn't something one would normally go about doing. "Felipe E. Barousse Boue" wrote:
Hello all:
Not sure if this has been asked before, probably yes, but haven't been able to find anything yet.
Does any of you has been able to print from a Zope application to a printer attached to the same machine where Zope is running, in my case it's a Red Hat Linux 6.1 box.
I need to print from Zope with a specific printing format (like invoices, receipts, etc). This will be done on always the same Intranet and printing will be controlled from the Linux spooling system.
If you can copy your comments to me by email besides the mail list, it'd be great.
,Any help is appreciated, thanks in advance.
Felipe Barousse
-- Ken Kinder 303.381.7631
"Felipe E. Barousse Boue" wrote:
I need to print from Zope with a specific printing format (like invoices, receipts, etc). This will be done on always the same Intranet and printing will be controlled from the Linux spooling system.
If you can copy your comments to me by email besides the mail list, it'd be great.
,Any help is appreciated, thanks in advance.
I think you want this, which (it claims) generates PDF documents within zope. http://yyy.zope.org/Members/gaaros/ZpdfDocument Then you just print it however your clients are already printing. ethan fremen -- http://mindlace.net __________________ mindlace@imeme.net I don't want The Truth but I wouldn't mind a Big Analogy.
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
"Felipe E. Barousse Boue" wrote:
I need to print from Zope with a specific printing format (like invoices, receipts, etc). This will be done on always the same Intranet and printing will be controlled from the Linux spooling system.
If you can copy your comments to me by email besides the mail list, it'd be great.
,Any help is appreciated, thanks in advance.
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
Why not generate a PDF file on the local file system and then print it (linux machine) with gs ? (ghostscript) just my 2 cents... ----- Message d'origine ----- De : Felipe E. Barousse Boue <fbarousse@piensa.com> Cc : <zope@zope.org> Envoyé : vendredi 24 mars 2000 06:46 Objet : Re: [Zope] Printing from Zope.....Report writer building
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).
Am Fre, 24 Mär 2000 schrieb Olivier Deckmyn:
Why not generate a PDF file on the local file system and then print it (linux machine) with gs ? (ghostscript)
Same suggestion. How it works (one possible way of doing it): Using a standard Linux installation, create a document with your data in a Python method and safe it as a local (temporary) file (e.g. using the PDF tools that exist for Python, e.g. "PIDDLE"). Then just do the following in your Python code: import os os.system('lpr /path/filename') This works under Windows, too. Just replace the system call by something appropriate like "copy path\filename lp1". It should also be possible to redirect the stdout data stream directly to the printing device. I have also found some more sophisticated solutions: - using the classes wxPrinter and wxPrintout from the wxPython package - for Windows: using the Printer API directly with import win32ui import win32com ... (gets complicated) Joachim Werner.
According to the documnentation for my Windows NT version of Acrobat Reader, the unix ( and I suppose the linux) version of Acrobat Reader can print .PDF files from the command line. __________________________________________________________________ Jim Sanford . Database Engineer / \ / Accelerated Technology, Inc. / / 720 Oak Circle Drive East / / \ Mobile, AL 36609 / / \ Voice: 334-661-5770 fax: 334-661-5788 / \ E-Mail: jsanford@atinucleus.com Web: http://www.atinucleus.com Nucleus. All You NEED in an RTOS. Royalty Free __________________________________________________________________ ----- Original Message ----- From: Felipe E. Barousse Boue <fbarousse@piensa.com> Cc: <zope@zope.org> Sent: Thursday, March 23, 2000 11:46 PM Subject: Re: [Zope] Printing from Zope.....Report writer building 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
"Felipe E. Barousse Boue" wrote:
I need to print from Zope with a specific printing format (like invoices, receipts, etc). This will be done on always the same Intranet and printing will be controlled from the Linux spooling system.
If you can copy your comments to me by email besides the mail list, it'd be great.
,Any help is appreciated, thanks in advance.
participants (8)
-
Ben Leslie -
Felipe E. Barousse Boue -
Itamar Shtull-Trauring -
Jim Sanford -
Joachim Werner -
Ken Kinder -
mindlace -
Olivier Deckmyn