wkhtmltopdf/views.py
def render_to_response(self, context, **response_kwargs):
        """
        Returns a PDF response with a template rendered with the given context.
        """
        filename = response_kwargs.pop('filename', None)
        cmd_options = response_kwargs.pop('cmd_options', None)

        if issubclass(self.response_class, PDFTemplateResponse):
            if filename is None:
                filename = self.get_filename()

            if cmd_options is None:
                cmd_options = self.get_cmd_options()

            return super(PDFTemplateView, self).render_to_response(
                context=context, filename=filename,
                show_content_in_browser=self.show_content_in_browser,
                header_template=self.header_template,
                footer_template=self.footer_template,
                cmd_options=cmd_options,
                cover_template=self.cover_template,
                **response_kwargs
            )
        else:
            return super(PDFTemplateView, self).render_to_response(
                context=context,
                **response_kwargs
            )
def render_to_response(self, context, **response_kwargs):
        filename = response_kwargs.pop('filename', None)
        cmd_options = response_kwargs.pop('cmd_options', None)

        if issubclass(self.response_class, PDFTemplateResponse):
            if filename is None:
                filename = self.get_filename()

            if cmd_options is None:
                cmd_options = self.get_cmd_options()

            return super(PDFTemplateView, self).render_to_response(
                context=context, filename=filename,
                show_content_in_browser=self.show_content_in_browser,
                header_template=self.header_template,
                footer_template=self.footer_template,
                cmd_options=cmd_options,
                cover_template=self.cover_template,
                **response_kwargs
            )
        else:
            return super(PDFTemplateView, self).render_to_response(
                context=context,
                **response_kwargs
            )
def render_to_response ( self , context , * * response_kwargs ) : filename = response_kwargs . pop ( 'filename' , None ) cmd_options = response_kwargs . pop ( 'cmd_options' , None ) if issubclass ( self . response_class , PDFTemplateResponse ) : if filename is None : filename = self . get_filename ( ) if cmd_options is None : cmd_options = self . get_cmd_options ( ) return super ( PDFTemplateView , self ) . render_to_response ( context = context , filename = filename , show_content_in_browser = self . show_content_in_browser , header_template = self . header_template , footer_template = self . footer_template , cmd_options = cmd_options , cover_template = self . cover_template , * * response_kwargs ) else : return super ( PDFTemplateView , self ) . render_to_response ( context = context , * * response_kwargs )
Returns a PDF response with a template rendered with the given context.
Returns a PDF response with a template rendered with the given context .