def render_to_response(self, filename):
        response = HttpResponse(content_type='application/pdf')
        filename = 'filename=%s.pdf;' % self.get_filename()
        response['Content-Disposition'] = filename.encode('utf-8')

        buffer = BytesIO()
        pdf_document = self.get_template(buffer)
        pdf_document.title = self.get_document_title()
        story = [Spacer(1, self.get_top_space() * cm)]

        self.append_to_pdf(story)

        self.build_document(pdf_document, story)

        pdf = buffer.getvalue()
        buffer.close()
        response.write(pdf)
        return response
dataset/ETHPy150Open OpenSlides/OpenSlides/openslides/utils/views.py/PDFView.render_to_response/original