unable to create PDF through pyylons

23 views
Skip to first unread message

Anil

unread,
Aug 13, 2009, 10:42:14 AM8/13/09
to Pisa XHTML2PDF Support
I have a simple piece of code that works when I do this through
command line. (e.g. save to a test.py and then run it through cli).

pdf = pisa.CreatePDF(
html,
file(filename, "wb"))

However, when I do the same thing in Pylons web framework, a blank/
empty PDF file is generated:

def test(self):
import ho.pisa as pisa2

pisa2.showLogging()
filename = "file.pdf"
html = """
<center>
<font size="30">Testing</font>
</center>
"""

pdf = pisa2.CreatePDF(
html,
file(filename, "wb"))
if pdf.err:
return pdf.err

return "OK"


Any idea?
Reply all
Reply to author
Forward
0 new messages