# 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
{{ 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') }} |