This script generates an invoice using custom JSON data. You can customize the invoice data as per your liking in the file named data.json
. The invoice is generated using HTML, so you can edit it accordingly.
Steps to run:
-
Create a virtual environment using the command:
virtualenv env
-
Activate the virtual environment using the command:
env\Scripts\activate
-
Install the required Python packages using the following commands:
pip install pdfkit
pip install jinja2
pip install num2words
-
Install the
wkhtmltopdf
package. You can download it from here or install it using the following command:Sudo apt install wkhtmltopdf
-
Create a JSON file named
data.json
and enter your invoice data. You can customize the invoice data as per your liking. -
Run the following command to generate the invoice:
python final.py
This will generate a PDF invoice file named invoice.pdf
. You can open this file in a PDF reader to view the invoice.