On Tue, 2004-03-23 at 14:32, Pascal Francq wrote:
I think it could be helpfull for me if you could send me an example. Thanks in advance.
You'll find a little sample of source code extracted from one of my custom Zope products generating PDF files. It's a simple one there, as other reports can use Paragraphs, custom flowables, charts... I'm not sure also if it's really a "best practice", but at least it works quite well for me !! Just hope that it will be useful for you... Thierry
On Tuesday 23 March 2004 14:05, FLORAC Thierry wrote:
On Tue, 2004-03-23 at 13:44, Pascal Francq wrote:
If I use reportlab within a Python module in Zope, how should I make the interface between Zope and Python function: 1°) Creating a local file in the python function and returning a string which will be used to create a anchor tag. 2°) Something more special, like returning a canvas object which can be handle by Zope as a normal Zope object.
I use "reportlab" to generate PDF reports with Zope in two ways : 1. create a PDF file which is stored in the ZODB ; the result of the method call is then a redirection to the given file ; 2. create a PDF file "on the fly" which is not stored in the ZODB and is returned directly in the response stream.
In these two ways, the Python method generates a complete PDF document (my documents are based on BaseDocTemplate with custom Flowable subclasses) in the form of a string : this string can then be used to create a file or returned "as is" in the response.
I can send you some examples if you want.
Thierry
On Tuesday 23 March 2004 12:23, David Convent wrote:
Pascal Francq wrote:
Hi, I want to generate PDF document from within Zope. What is the easiest way to do it? I know there is a python package (reportlab) which provides functions to create PDF documents, but I am not sure it is the right solution for Zope.
as far as i know, it is the right solution
-- Linux every day, keeps Dr Watson away... http://gpc.sourceforge.net -- http://www.ulthar.net