[reportlab-users] proper way to make pdfs in zope

Jesse D'Aguanno reportlab-users@reportlab.com
Wed, 30 Apr 2003 15:42:38 -0700


Hello Chris,

I'm currently using external methods for my reportlab reports. Since zope's
security boundries do not allow you to import much into an internal python
script, external methods have always seemed the the easiest way to get around
these restrictions. This way you use the canvas librarys or whatever directly.

Jesse D'Aguanno
JJRaM, LLC.
www.jjram.com

Quoting "Christopher N. Deckard" <chris@globalfoo.net>:

> Hello,
> I want to generate custom PDFs with reportlab in Zope.  I've
> rewritten rlzope to handle what I'm doing, and it works, but I don't
> know if it's the proper way to do it.  IMO, it's a kludge.
> 
> Since I can't exactly import anything useful from reportlab into a
> Python Script in Zope, I change rlzope to exec() a string of code
> that I write in a PScript.  I set up the beforeDrawPage() to put a
> header on each page.  My code that I exec may look something like
> this:
> 
>   self.append(Spacer(0, 20))
>   self.append(Table([[]])
>   self.append(PageBreak())
>   self.append(Spacer(0, 20))
>   self.append(Table([[]])
>   self.append(PageBreak())
>   self.append(Spacer(0, 20))
>   self.append(Table([[]]))
>   self.append(PageBreak())
>   self.append(Spacer(0, 20))
>   self.append(Table([[]]))
>   self.append(PageBreak())
> 
> where [[]] is some list of people information like Name, Address,
> Phone, Email.
> 
> I then call rlzope like this from the PScript:
> 
>   container.rlzope(toExec=toExec)
> 
> With the Zope security restrictions on importing things, I don't see
> a better way to make use of the other RL stuff without doing it like
> this.
> 
> Thoughts/comments/flames appreciated.
> 
> Thanks,
> -Chris
> _______________________________________________
> reportlab-users mailing list
> reportlab-users@reportlab.com
> http://two.pairlist.net/mailman/listinfo/reportlab-users
>