# Print Format A PrintFormat represents an HTML template that is used to create a printer-friendly version of the DocType ## Creating a Print Format To make a printer friendly version, you must create a "PrintFormat" for the doctype Example: ```js module.exports = { doctype: "PrintFormat", name: "Standard Invoice Format", for: "Invoice", template: require('./invoice.html') } ``` This must be referenced in the `print.printFormat` property of the DocType. ```js "print": { "printFormat": "Standard Invoice Format", }, ``` ## Templating The templating system used by frappe is [nunjucks](https://mozilla.github.io/nunjucks/) and is very similar to Jinja2 system from Python ### Example Example of a print format for an Invoice ```html

{{ doc.name }}

{{ frappe._("Customer") }}
{{ doc.customer }}
{{ frappe._("Date") }}
{{ frappe.format(doc.date, 'Date') }}
{% for row in doc.items %} {% endfor %}
{{ frappe._("Item") }} {{ frappe._("Qty") }} {{ frappe._("Rate") }} {{ frappe._("Amount") }}
{{ row.idx + 1 }} {{ row.item }}
{{ frappe.format(row.description, 'Text') }}
{{ row.quantity }} {{ frappe.format(row.rate, 'Currency') }} {{ frappe.format(row.amount, 'Currency') }}
{{ frappe._("Total") }}
{{ frappe.format(doc.netTotal, 'Currency')}}
{% for tax in doc.taxes %}
{{ tax.account }} ({{ tax.rate }}%)
{{ frappe.format(tax.amount, 'Currency')}}
{% endfor %}
{{ frappe._("Grand Total") }}
{{ frappe.format(doc.grandTotal, 'Currency')}}
```