pdf.py

This module contains the functions for converting HTML to PDF.

Function definitions:

apps.utils.pdf.convertHtmlToPdf(sourceHtml)[source]

Converts the HTML to PDF

Args:
  • sourceHtml: the HTML (string) to convert
Returns:
An HttpResponse instance with the PDF included or an HttpResponse instance with the HTML included.
apps.utils.pdf.render_to_PDF(request, body)[source]

Shortcut for rendering the HTML template and create PDF

Args:
  • request: the initial request
  • body: the body to include in the PDF in HTML format
Returns:
An HttpResponse instance with the PDF included or an HttpResponse instance with the HTML included.