Generating PDF is a very common task in web development. They are used for a variety of purposes such are reporting, invoice generation and accounting purposes, etc.
In Django, there is this package xhtml2pdf through which we can generate pdf. In this post you’ll be covering three main topics those are generating PDF from HTML and saving as PDF file in the directory, generating PDF from a template by passing context data and saving as PDF file in a directory, rendering PDF from a template in the browser.
Enter below command in terminal.
pip install xhtml2pdf
If you want to install the latest version for Python 3 then go with below command
pip install --pre xhtml2pdf
#django #pdf #html #python #developer