<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.0.9">
</HEAD>
<BODY>
On Tue, 2004-03-23 at 13:44, Pascal Francq wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE><FONT COLOR="#40a3c5"><I>If I use reportlab within a Python module in Zope, how should I make the 
interface between Zope and Python function:
1&#176;) Creating a local file in the python function and returning a string which 
will be used to create a anchor tag.
2&#176;) Something more special, like returning a canvas object which can be handle 
by Zope as a normal Zope object.</I></FONT></PRE>
</BLOCKQUOTE>
<BR>
I use &quot;reportlab&quot; to generate PDF reports with Zope in two ways :<BR>
&nbsp; 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 ;<BR>
&nbsp; 2. create a PDF file &quot;on the fly&quot; which is not stored in the ZODB and is returned directly in the response stream.<BR>
<BR>
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 &quot;as is&quot; in the response.<BR>
<BR>
I can send you some examples if you want.<BR>
<BR>
<BR>
&nbsp; Thierry<BR>
<BR>
<BR>
<BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
<PRE><FONT COLOR="#40a3c5"><I>On Tuesday 23 March 2004 12:23, David Convent wrote:
&gt; Pascal Francq wrote:
&gt; &gt;Hi,
&gt; &gt;I want to generate PDF document from within Zope. What is the easiest way
&gt; &gt; to do it? I know there is a python package (reportlab) which provides
&gt; &gt; functions to create PDF documents, but I am not sure it is the right
&gt; &gt; solution for Zope.
&gt;
&gt; as far as i know, it is the right solution</I></FONT></PRE>
</BLOCKQUOTE>
</BODY>
</HTML>