[Zope] Zope and PDF

Steve Alexander steve@cat-box.net
Thu, 18 Oct 2001 17:27:10 +0100


Timothy Wilson wrote:

> 
>>>A customer wants no more to produce print AND web documents. He decided 
>>>to only produce web documents of good quality and let the customers 
>>>print it out if desired. His idea is, to offer a HTML version for 
>>>browsing and a PDF version for printing.
>>>
>>Sure. I'm doing that using ReportLab.
>>
> 
> Steve,
> 
> Here's something that's crying out for a HowTo. I'm sure there are many
> folks who would be interested in knowing more about creating PDFs from Zope
> using ReportLab.


There's been some talk of this, and some examples, on the ReportLab mailing list.



I don't generate PDFs from within Zope. I get Zope to write out a 
specification file into a directory on the filesystem. This directory is 
"watched" by a long running python process (the report generator), which 
looks in a number of directories on the server every 10 seconds to see 
if there are new files there.

These specification files are added to a queue in the report generation 
software. Reports are generated, and output into a directory that is 
visible to the outside world via Apache. The reports are given a long 
unique random filename.

Finally, the report generator notifies the Zope that requested the 
report that the report is ready, and of the filename the report is saved 
under.

When I start running out of disk space, I'll write a script that gets 
rid of old reports.

--
Steve Alexander
Software Engineer
Cat-Box limited