Skip to main content

Insurance Policy

Homeowners insurance declarations page with coverage schedules, premium breakdown, and agent details.

  • Data-driven tables. Coverages, endorsements and the premium breakdown are each a table bound to the data.
  • Boxed label-over-value grids. One each for the policy, the property, the mortgagee and the agent, and a data-driven list of policy conditions.
  • A Code 128 barcode. It carries the policy number, under the conditions.
  • Premium summary. Each charge and discount on a line of its own, then the total annual premium.

Features used: PDF/A-2b conformance, columns, tables, lists, rules, images, barcodes (code128), data binding, headers and footers

How it's built​

Two kinds of table carry the page: boxed grids for the fixed facts, and tables bound to lists for the schedules.

Label over value​

Each box is a cell of a grid table whose paragraph puts a small label over its value with a [span, boxLabel] and a [br]. colspan widens a box across the four tracks:

{
"table": {
"style": "grid",
"widths": [1, 1, 1, 1],
"rows": [
[
{ "p": "[span, boxLabel]Policy number[/span][br][span, strong]$data.policy.number[/span]", "style": "box" },
{ "p": "[span, boxLabel]Policy form[/span][br]$data.policy.form", "style": "box", "colspan": 2 },
{ "p": "[span, boxLabel]Prior policy[/span][br]$data.policy.priorPolicy", "style": "box" }
]
]
}
}

Schedules from lists​

The coverages, the endorsements and the premium summary are tables bound with source. In the premium summary, the row after the template carries no $item token, so it is drawn once, after the repeated rows, as the total:

{
"table": {
"widths": [4, 1.5],
"source": "$data.premiumBreakdown",
"rows": [
[{ "th": "Item", "style": "th" }, { "th": "Amount", "style": "thRight" }],
[{ "p": "$item.item", "style": "td" }, { "p": "$item.amount", "style": "tdRight" }],
[{ "p": "Total annual premium", "style": "totalLabel" }, { "p": "$data.policy.totalPremium", "style": "totalValue" }]
],
"style": "grid"
}
}

The discounts are ordinary elements of premiumBreakdown, their amounts written in the data as negatives ("−$166.10"). The total is read from the record, not added up by the document.

The conditions are a list bound to the data, each item the text of one element:

{ "ul": { "source": "$data.conditions", "map": "$item.text" } },
{ "p": "[barcode, code128, $data.policy.number, 220|35]", "style": "codeRow" }

The paragraph after it prints the policy number as Code 128 with a tag. The insurer's logo comes from the record as well: the header's [image, $data.insurer.logo, 180|45] reads its path from insurer.logo.