Convenience Python module for creating templated PDF documents using Jinja2
and WeasyPrint
.
pip3 install onnpdf
Pass a dictionary into onnpdf
, and it will:
- Perform a "find and replace" operation (as well as other Jinja2 operations defined in your template)
- Convert the template into a PDF document
Example dictionary as seen in code snippets:
kv_pairs = {
'title': 'OzNetNerd.com Demo PDF',
'author': 'Will Robinson',
'job_title': 'DevOps Specialist',
'company': 'OzNetNerd.com',
'email': 'will@oznetnerd.com',
'phone': '+61 00 000 000',
'website': 'https://oznetnerd.com'
}
The above produces this PDF document.
Automate the creation of personalised lab guides for users.
This enables lab admins to easily provide users with unique usernames, passwords, DNS entries, etc.
- Blog: oznetnerd.com
- Email: will@oznetnerd.com