Appearance
Schema JSON
PDFMancer accepts a JSON document with an elements array.
Versioned Schema
Machine-readable schema endpoints:
- Current metadata:
GET /api/public/schema/current - Versioned schema:
GET /api/public/schemas/document/v1.json
Use the published JSON Schema to validate client-side before calling render. For placeholder syntax rules, see Templating.
Document
json
{
"elements": [
{ "type": "text", "value": "Hello" }
]
}Elements
Text
json
{
"type": "text",
"value": "Invoice {{ invoice.number }}",
"style": "BodyText",
"text_align": "left",
"max_width": "60%",
"vertical_align": "top"
}Heading
json
{
"type": "heading",
"value": "Invoice {{ invoice.number }}",
"level": 2,
"text_align": "left"
}Divider
json
{
"type": "divider",
"thickness": 1,
"color": "#D1D5DB",
"spacing_before": 8,
"spacing_after": 8
}List
json
{
"type": "list",
"items": [
"First line item",
"Second line item"
],
"ordered": false,
"style": "BodyText"
}Image
json
{
"type": "image",
"src": "https://example.com/logo.png",
"width": 120,
"height": 60,
"horizontal_align": "left",
"vertical_align": "top"
}Row
json
{
"type": "row",
"elements": [
{ "type": "text", "value": "Left" },
{ "type": "text", "value": "Right" }
],
"horizontal_align": "center"
}Table
json
{
"type": "table",
"source": "lines",
"columns": [
{ "label": "Concept", "value": "{{ item.concept }}" },
{ "label": "Qty", "value": "{{ item.quantity }}" },
{ "label": "Line Total", "value": "{{ item.line_total }}", "format": "currency" }
],
"empty_message": "No data",
"limit": 40,
"horizontal_align": "left"
}Supported table modes:
- Dynamic table (
source+columns)
sourcemust resolve to an array in inputdata.columns[].valuecan use the loop aliasitemfor each row.
- Static table (
data)
- Provide
dataas a matrix ([["header1","header2"],["row1col1","row1col2"]]). - Cell values can be strings, numbers, booleans, or
null.
- Static columns (
columnswithoutsource)
- Renderer builds one data row from
columns[].valueusing current context.
Spacer
json
{
"type": "spacer",
"height": 12
}Page Break
json
{ "type": "pagebreak" }