Chris Withers wrote:

Um? What else is that method returning?
I'd suggest you call getrarTCE directly by URL, check you're setting the correct content-type and maybe set a content disposition too...

Solved. :) I create a External Method that returns the code.

I'm calling the external method using:
      <dtml-var "generatePDF(REQUEST.response)">

And I put the following lines at the end of the code:

fname stands for the filename

def generatePDF(page):

        os.rename(_fname, "tces/"+_fname)
        file = open("tces/"+_fname).read()
        page.setHeader('content-type', 'x-application/pdf')
        page.setHeader('content-length', str(len(file)))

This was the best solution that I could thought, once reportlab didn't create PDF 
"on the fly", without writing in the filesystem.

Zope maillist -
** No cross posts or HTML encoding! **
(Related lists - )

Reply via email to