layout_rules
An example template.
Browse this template in the repository →
The PDFs below are rendered live by PDF Server from the shipped examples.
long
split_terms
Inputs
Render data
long
examples/long.json
{
"invoice": {
"number": "INV-2026-0301",
"currency": "EUR",
"total": "\u20ac10,250.00",
"items": [
{
"description": "Widget assembly, size 1",
"amount": "$12.50"
},
{
"description": "Widget assembly, size 2",
"amount": "$25.00"
},
{
"description": "Widget assembly, size 3",
"amount": "$37.50"
},
{
"description": "Widget assembly, size 4",
"amount": "$50.00"
},
{
"description": "Widget assembly, size 5",
"amount": "$62.50"
},
{
"description": "Widget assembly, size 6",
"amount": "$75.00"
},
{
"description": "Widget assembly, size 7",
"amount": "$87.50"
},
{
"description": "Widget assembly, size 8",
"amount": "$100.00"
},
{
"description": "Widget assembly, size 9",
"amount": "$112.50"
},
{
"description": "Widget assembly, size 10",
"amount": "$125.00"
},
{
"description": "Widget assembly, size 11",
"amount": "$137.50"
},
{
"description": "Widget assembly, size 12",
"amount": "$150.00"
},
{
"description": "Widget assembly, size 13",
"amount": "$162.50"
},
{
"description": "Widget assembly, size 14",
"amount": "$175.00"
},
{
"description": "Widget assembly, size 15",
"amount": "$187.50"
},
{
"description": "Widget assembly, size 16",
"amount": "$200.00"
},
{
"description": "Widget assembly, size 17",
"amount": "$212.50"
},
{
"description": "Widget assembly, size 18",
"amount": "$225.00"
},
{
"description": "Widget assembly, size 19",
"amount": "$237.50"
},
{
"description": "Widget assembly, size 20",
"amount": "$250.00"
},
{
"description": "Widget assembly, size 21",
"amount": "$262.50"
},
{
"description": "Widget assembly, size 22",
"amount": "$275.00"
},
{
"description": "Widget assembly, size 23",
"amount": "$287.50"
},
{
"description": "Widget assembly, size 24",
"amount": "$300.00"
},
{
"description": "Widget assembly, size 25",
"amount": "$312.50"
},
{
"description": "Widget assembly, size 26",
"amount": "$325.00"
},
{
"description": "Widget assembly, size 27",
"amount": "$337.50"
},
{
"description": "Widget assembly, size 28",
"amount": "$350.00"
},
{
"description": "Widget assembly, size 29",
"amount": "$362.50"
},
{
"description": "Widget assembly, size 30",
"amount": "$375.00"
},
{
"description": "Widget assembly, size 31",
"amount": "$387.50"
},
{
"description": "Widget assembly, size 32",
"amount": "$400.00"
},
{
"description": "Widget assembly, size 33",
"amount": "$412.50"
},
{
"description": "Widget assembly, size 34",
"amount": "$425.00"
},
{
"description": "Widget assembly, size 35",
"amount": "$437.50"
},
{
"description": "Widget assembly, size 36",
"amount": "$450.00"
},
{
"description": "Widget assembly, size 37",
"amount": "$462.50"
},
{
"description": "Widget assembly, size 38",
"amount": "$475.00"
},
{
"description": "Widget assembly, size 39",
"amount": "$487.50"
},
{
"description": "Widget assembly, size 40",
"amount": "$500.00"
}
]
}
}
split_terms
examples/split_terms.json
{
"invoice": {
"number": "INV-2026-0302",
"currency": "EUR",
"total": "€75.00",
"items": [
{
"description": "Widget assembly, size 1",
"amount": "$12.50"
},
{
"description": "Widget assembly, size 2",
"amount": "$25.00"
},
{
"description": "Widget assembly, size 3",
"amount": "$37.50"
}
],
"terms": "1. The supplier warrants that all goods delivered under this invoice conform to the specification agreed in writing at the time of order, and that title passes to the customer only on receipt of payment in full and in cleared funds. 2. Payment falls due thirty days from the invoice date. Sums outstanding after that date carry interest at the statutory rate, accruing daily from the due date until payment is received. 3. The customer shall inspect the goods on delivery and notify the supplier in writing of any shortage, damage or non-conformity within seven days. A claim notified after that period is deemed waived save in respect of a latent defect. 4. Risk in the goods passes to the customer on delivery to the address shown on the face of this invoice, or on collection where the customer has elected to collect. 5. Neither party is liable for a failure to perform caused by an event beyond its reasonable control, provided it notifies the other party promptly and resumes performance as soon as the event ceases to have effect. 6. The supplier's aggregate liability arising out of or in connection with this invoice, whether in contract, tort, breach of statutory duty or otherwise, is limited to the total amount payable under it. 7. Neither party excludes or limits liability for death or personal injury caused by its negligence, for fraud or fraudulent misrepresentation, or for any other liability that cannot lawfully be excluded. 8. Neither party is liable to the other for loss of profit, loss of business, depletion of goodwill, or any indirect or consequential loss, however arising. 9. Each party shall keep confidential all information disclosed by the other that is marked confidential or would reasonably be understood to be so, and shall use it only for the purposes of the supply described here. 10. The confidentiality obligation does not extend to information that is or becomes public through no breach of these terms, that was lawfully held before disclosure, or whose disclosure is required by law or by a competent regulator. 11. Any variation of these terms is effective only if recorded in writing and signed by an authorised representative of each party. A waiver of one breach is not a waiver of any other. 12. A delay in exercising a right under these terms does not operate as a waiver of that right, and a partial exercise does not preclude any further exercise. 13. If any provision of these terms is held to be invalid or unenforceable, the remaining provisions continue in force and the invalid provision is replaced by one that most nearly achieves its commercial intent. 14. These terms are governed by the law of the place of the supplier's registered office, and each party submits to the exclusive jurisdiction of its courts. 15. Goods returned without a written authorisation reference are not accepted. An authorised return must reach the supplier's premises within twenty-eight days of the authorisation, in the original packaging and in a resaleable condition. 16. Where a return is accepted, the supplier may deduct a restocking charge reflecting the cost of inspection and repackaging, notified to the customer before the credit is issued. 17. The customer may not assign or otherwise transfer any of its rights or obligations under this invoice without the supplier's prior written consent, which shall not be unreasonably withheld or delayed. 18. The supplier may subcontract the performance of any of its obligations, but remains responsible to the customer for the acts and omissions of its subcontractors. 19. Nothing in these terms creates a partnership, joint venture or relationship of agency between the parties, and neither party may hold itself out as having authority to bind the other. 20. A person who is not a party to these terms has no right to enforce any of them, and the parties may vary or rescind them without the consent of any third party. 21. Notices under these terms must be given in writing to the address shown on the face of this invoice, and are deemed received on delivery if delivered by hand, or on the second business day after posting if sent by prepaid post. 22. A notice sent by electronic mail is deemed received on the next business day after transmission, provided no delivery failure notification has been received by the sender. 23. Delivery dates are estimates given in good faith and are not of the essence. The supplier shall notify the customer promptly of any material delay and of the revised date it expects to meet. 24. Where the supply is made in instalments, each instalment is treated as a separate contract, and a defect in one instalment does not entitle the customer to reject any other. 25. The customer shall provide safe and adequate access for delivery, and shall bear any additional cost the supplier reasonably incurs where access proves inadequate. 26. Prices are exclusive of value added tax and of any other duty or levy, which the customer shall pay in addition at the rate applying on the tax point date. 27. The supplier may set off any amount owed to it by the customer against any amount it owes the customer, giving written notice of the amounts concerned. 28. The customer shall not withhold payment of any undisputed amount on account of a dispute about any other amount invoiced. 29. Where the customer disputes an invoiced amount it shall notify the supplier within fourteen days, identifying the amount disputed and the grounds relied on, and the parties shall discuss the matter in good faith. 30. The supplier may suspend further deliveries while an undispu
… (truncated)
Data schema
schema.json
{
"title": "Layout rules example",
"type": "object",
"required": ["invoice"],
"additionalProperties": false,
"properties": {
"invoice": {
"type": "object",
"required": ["number", "items", "total", "currency"],
"additionalProperties": false,
"properties": {
"number": { "type": "string" },
"currency": { "type": "string" },
"total": { "type": "string" },
"terms": { "type": "string" },
"items": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"required": ["description", "amount"],
"additionalProperties": false,
"properties": {
"description": { "type": "string" },
"amount": { "type": "string" }
}
}
}
}
}
}
}
PDF parameters
params.json
{
"pdf": {
"printBackground": true,
"paperWidth": 8.27,
"paperHeight": 11.69,
"marginTop": 0.6,
"marginBottom": 0.6,
"marginLeft": 0.6,
"marginRight": 0.6,
"waitLifecycleEvent": "load"
}
}
Template
template.mustache