Are you setting the PDF's title before streaming it?
pdf.set_title('Whatever you want to appear in the tab')
pdf_stream = pdf.output(dest='S')
On Thursday, 6 September 2018 13:16:32 UTC+1, Simona Chovancová wrote:
>
> Hello.
> I have a backend function that is supposed to stream a pdf file, but not
> instantly download it. It's being called like this
> .../function_to_create_pdf/323, where the number is some ID. I create a
> FPDF stream and make function return this
> response.headers['Content-Type'] = None
> return response.stream(pdf_stream, 4096, filename="iwanthisname.pdf")
>
> Soo the problem is, this works well if I set attachment=True, but since I
> only want to display this pdf file, the filename is not applied in any way.
> I get the right document and all that, but the browser tab title is
> basically just the argument (ID) I passed to the function and if I press
> the download button it is saved as 323.pdf. I want to edit its name, how
> can I do this? I tried changing tab name with reponse.title, but it didn't
> work. Thank you.
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.