[Zope] pdf + external methods question

Garry Steedman garry_steedman@yahoo.com
Mon, 7 Jan 2002 10:10:28 -0800 (PST)


Hello all,

after _much_ wailing and gnashing of teeth, i am now
happily churning out PDF reports via reportlab/
external methods, but i still have one irritation: i
am using a tempfile.mktemp(suffix=".pdf") object to
chuck the pdf into but am having trouble responsing
this back to the browser cleanly.

i am using this code (thx, messrs Washington +
Penny!):

c.save()
self.REQUEST.RESPONSE.setHeader('Content-type',
'application/x-pdf')     
self.REQUEST.RESPONSE.write(open(mypdffile).read())

but the tempfile object seems to get mangled somewhere
in the process and the client doesn't recognise the
file as PDF because the PDF suffix gets lost
somewhere... any help most welcome...

if anyone wants to enlighten me regarding what ext
methods can or should return, i would also be
grateful!

i would like to write a HOWTO on reportlab + zope once
i've got this stuff finished...

cheers,

garry

__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/