Real data is never the length you designed for. An invoice has three line items today and ninety next month; a certificate gets a name twice as long as the placeholder. Every element therefore carries an overflow policy that says what to do when the content no longer fits.
The three policies
auto-shrink— keep the box, reduce the font size until the text fits. Correct for fixed-size designs: certificates, gift cards, ID cards, OG images.grow-and-push— keep the font size, let the box grow and move everything below it down, spilling onto a new page when needed. Correct for flowing documents: invoices, receipts, reports, resumes.max-lines-ellipsis— hard-clip atmaxLinesand end with an ellipsis. For places where truncating is genuinely better than shrinking or growing, such as a product blurb in a card.
Setting a sensible floor
auto-shrink without a floor will happily render a name at 4pt to make it fit. Always pair it with minFontSize, and usually maxLines too. The floor is a design decision: below it, you would rather the text wrapped or the caller sent something shorter.
{
"name": "Recipient Name",
"overflowPolicy": "auto-shrink",
"minFontSize": 26,
"maxLines": 1
}How a document decides to break
Pagination is driven by content, not by fixed page counts. As elements grow, PixlDocs measures the used height against the page's content bounds; when the next element no longer fits, it starts a new page. Elements marked as page furniture repeat on every page rather than flowing.
fixed_background— page background, painted on every page.fixed_decoration— borders, seals, rules, watermarks. Chrome, repeated.variable_text— copy that comes from data and participates in flow.variable_image— an image whose source comes from data.repeated_section— a row or entry that multiplies with an array.
Tables that grow with the data
A table becomes data-driven by marking one row as the template row and pointing it at an array. That row is then repeated once per entry, and the table paginates with the document — headers repeat on each new page, and totals stay with the last one.
{
"tableData": {
"repeat": { "from": "lineItems", "templateRow": 1, "label": "Line item" }
}
}Cells inside the template row carry a field naming which key of each entry they render, so lineItems[n].description lands in the description column.
Checking it before your customers do
Guessing whether a template survives real data is the slow way. Stress-testing renders it against generated edge cases — very long values, missing optional fields, short values, alternate fonts — and reports which elements failed and why.
- A template that is genuinely safe reports
api_ready: truewith no failing variants. - Fix the failures by setting a policy and a floor, not by shortening the placeholder text.