is "the document", i.e. this function, returning a stream of bytes 
representing the pdf ?
If so, you're a few steps away....

Browsers get the name of the file from the Content-disposition header, e.g.

Content-disposition : attachment; filename=thedocument.pdf

will allow the browser to download the file.

It's nice to send the content-type too

Content-Type: application/pdf

you can set headers in response modifying the response.header dictionary 
before returning the stream, like

headers['Content-Type']='application/pdf'



Il giorno sabato 9 giugno 2012 23:43:08 UTC+2, Jarrod ha scritto:
>
> I have successfully used Lucas D'Avila's very helpful appreport 
> plugin<https://github.com/lucasdavila/web2py-appreport>to make pdf's of 
> invoices generated by my site. However I can't seem to 
> figure out how to specify the name that the pdf should be downloaded as.  I 
> am generating the pdf by creating the html and css and then using the 
> REPORTPISA function to return the document. 
>
> return plugin_appreport.REPORTPISA(html = html)
>
> Anyone have any insight on how to accomplish this? 
>
> Thanks,
> Jarrod 
>   
>

Reply via email to