This question is very simple, but I can not find any data on it. When I create a pdf file with reportlab, passing httpresponse as a file, browsers configured to display files display pdf correctly. However, the tab title remains "(anonymous) 127.0.0.1/whatnot", which looks ugly to the user.
Since most sites are capable of displaying a suitable title in some way, I think this is doable ... Is there any header parameter that I can pass to pdf? Or some kind of heading for an answer? This is my code:
def render_pdf_report(self, context, file_name): response = HttpResponse(content_type='application/pdf') response['Content-Disposition'] = 'filename="{}"'.format(file_name) document = BaseDocTemplate(response, **self.get_create_document_kwargs())
Alvaro
source share