Invoice
An invoice whose line items repeat from an array of data.
Everything below is generated from the template itself, so it always matches what you get. Start from this template to open an editable copy.
What it teaches
- Binding a table to an array field
- Referencing item properties inside table cells
- Tokens with a date format
- Page numbers in a repeating page footer
The data you send
Pass this as your render payload. The field names come from the template's schema — rename them there and the tokens follow.
{
"invoiceNumber": "INV-1024",
"customerName": "Acme Corp",
"issueDate": "2026-08-22",
"total": 4250,
"lineItems": [
{
"description": "Design retainer",
"quantity": 2,
"unitPrice": 850,
"amount": 1700
},
{
"description": "Design retainer",
"quantity": 2,
"unitPrice": 850,
"amount": 1700
}
]
}
The schema stores one sample value per field, so every generated row looks the same. Trimmed to 2 here; your real array can be any length.
How the array reaches the page
The table's bindingField is lineItems, so its body row repeats once per item in that array. Each cell binds to one property of the item:
| Column | Binds to | Width |
|---|---|---|
| Description | description | 52% |
| Qty | quantity | 12% |
| Unit price | unitPrice | 18% |
| Amount | amount | 18% |
A token inside a body cell resolves against that row's item, not the document. That is the single thing people get wrong most often.
Band stack
A Paperwright document is a stack of bands. This template uses:
report-headerreport-footerpage-footer
Properties that matter
Only properties this template changed from their defaults — anything omitted is left as-is.
| Band | Element | Property | Value |
|---|---|---|---|
report-header | text | role | heading |
report-header | text | text | INVOICE |
report-header | text | fontSize | 28 |
report-header | text | fontWeight | 700 |
report-header | text | text | {{invoiceNumber}} |
report-header | text | fontWeight | 600 |
report-header | text | align | right |
report-header | text | text | Billed to {{customerName}} |
report-header | text | text | Issued {{issueDate | date:"medium"}} |
report-header | text | align | right |
report-footer | text | role | caption |
report-footer | text | text | Payment due within 30 days. Thanks for your bu… |
report-footer | text | fontSize | 10 |
report-footer | text | color | #737373 |
page-footer | text | role | caption |
page-footer | text | text | {{$page}} / {{$pages}} |
page-footer | text | fontSize | 10 |
page-footer | text | color | #737373 |
page-footer | text | align | right |