Overview
Penquify uses Jinja2 HTML templates to render documents. The default template isguia_despacho.html (Chilean dispatch guide). You can add your own templates for invoices, purchase orders, bills of lading, or any other document type.
Template Location
Templates live inpenquify/templates/. Add your .html file there.
Available Variables
Templates receive the full document data viadoc.to_dict():
Each item in
items has: pos, code, description, qty, unit, unit_price, total, batch, sap_material, sap_qty, sap_unit.
Template Structure
1
Create the HTML file
Create
penquify/templates/my_invoice.html:2
Use it in generation
Design Tips
- Use a fixed
width(e.g. 850px) for consistent rendering across documents - Use standard fonts that Playwright’s Chromium can render
- Keep the design realistic — penquify generates photos of these documents, so they should look like real printed pages
- Test your template by generating the PDF first before creating photo variations