django_pdfkit package¶
Subpackages¶
Submodules¶
django_pdfkit.views module¶
django_pdfkit.views¶
Django view that converts HTML to PDF using webkit - via pdfkit and wkhtmltopdf.
-
class
django_pdfkit.views.PDFView(**kwargs)[source]¶ Bases:
django.views.generic.base.TemplateView-
filename= None¶ Set to change the filename of the PDF.
-
get(request, *args, **kwargs)[source]¶ Return a HTTPResponse either of a PDF file or HTML.
Return type: HttpResponse
-
get_filename()[source]¶ Return
self.filenameif set otherwise return the template basename with a.pdfextension.Return type: str
-
get_pdfkit_options()[source]¶ Returns
self.pdfkit_optionsif set otherwise a default dict of options to supply to pdfkit.Return type: dict
-
inline= False¶ Set to default the PDF display to inline.
-
pdfkit_options= None¶ Set pdfkit options dict.
-
Module contents¶
Django view that converts HTML to PDF using webkit.