I have got a Dict from a .txt data, and I want to create a PDF file with this data.
How can I create it?
I have got a Dict from a .txt data, and I want to create a PDF file with this data.
How can I create it?
pip install pdfkit
Also install wkhtmltopdf:
Debian/Ubuntu:
$ sudo apt-get install wkhtmltopdf
Then in your code:
import pdfkit
import json
pdfkit.from_string(json.dumps(yourdict))
You could also do:
import pdfkit
pdfkit.from_file('your.txt', 'out.pdf')