[reportlab-users] proper way to make pdfs in zope
Christopher N. Deckard
reportlab-users@reportlab.com
Wed, 30 Apr 2003 12:52:51 -0500
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