[Zope] Generating and Downloading PDF

David Hassalevris bluepaul at earthlink.net
Fri Feb 25 19:58:23 EST 2005


robert wrote:

> Fernando Lujan wrote:
>
>> I have a system running Zope generating .pdf using the reportlabs lib.
>>
>> How can I put this files available to download?
>>
>> Because I'm attaching the file to a e-mail and sending a message to 
>> the user.
>> I don't want to waste the time between the send and the arrival of 
>> the mail
>> message.
>>
>> Thanks in advance.
>>
>> Fernando Lujan
>>
>> _______________________________________________
>> Zope maillist  -  Zope at zope.org
>> http://mail.zope.org/mailman/listinfo/zope
>> **   No cross posts or HTML encoding!  **
>> (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
>> http://mail.zope.org/mailman/listinfo/zope-dev )
>>
>>  
>>
>
>  I quote from an answer to a similar question on the german speaking 
> usergroup
>
>        R = self.REQUEST.RESPONSE
>        R.setHeader('content-type', 'application/rtf')
>        R.setHeader('content-length', str(len(data))
>        R.write(data)
>    robert

Fernando,

I did this  with external python script using smtplib,MimeWriter, base64 
and ReportLab modules:
a)  Create the pdf (unless it was aquired via self) using ReportLab
b) Loop thru recipients and
   1)  format each email using MimeWriter
   2)  send it using smtplib.SMTP.sendmail( .... )

David







More information about the Zope mailing list