Render a template to PDF
POST
/render/template
const url = 'http://localhost:8080/render/template';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"data":{"additionalProperty":{"size":1}},"options":{"baseUrl":"example","title":"example"},"template":{"attachments":[{"content":"example","description":"example","mimeType":"example","name":"example","relationship":"example"}],"config":{"page":{"background":{"src":"example","type":"AUTO"},"footer":{"repeat":true,"rows":[{"blocks":[{"config":{"align":"LEFT","lineColor":"example","spacing":{"bottom":1,"left":1,"right":1,"top":1},"style":"SOLID","thickness":1,"typography":{"align":"LEFT","color":"example","family":"example","size":1,"weight":"LIGHT"},"width":"example"},"id":"example"}]}]},"locale":"example","margins":{"bottom":1,"left":1,"right":1,"top":1},"pageNumbers":{"enabled":true,"position":"LEFT"},"size":{"height":1,"width":1}},"typography":{"align":"LEFT","color":"example","family":"example","size":1,"weight":"LIGHT"}},"fonts":{"additionalProperty":{"src":"example","style":"example","weight":"example"}},"rows":[{"blocks":[{"config":{"align":"LEFT","lineColor":"example","spacing":{"bottom":1,"left":1,"right":1,"top":1},"style":"SOLID","thickness":1,"typography":{"align":"LEFT","color":"example","family":"example","size":1,"weight":"LIGHT"},"width":"example"},"id":"example"}]}],"version":1}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:8080/render/template \ --header 'Content-Type: application/json' \ --data '{ "data": { "additionalProperty": { "size": 1 } }, "options": { "baseUrl": "example", "title": "example" }, "template": { "attachments": [ { "content": "example", "description": "example", "mimeType": "example", "name": "example", "relationship": "example" } ], "config": { "page": { "background": { "src": "example", "type": "AUTO" }, "footer": { "repeat": true, "rows": [ { "blocks": [ { "config": { "align": "LEFT", "lineColor": "example", "spacing": { "bottom": 1, "left": 1, "right": 1, "top": 1 }, "style": "SOLID", "thickness": 1, "typography": { "align": "LEFT", "color": "example", "family": "example", "size": 1, "weight": "LIGHT" }, "width": "example" }, "id": "example" } ] } ] }, "locale": "example", "margins": { "bottom": 1, "left": 1, "right": 1, "top": 1 }, "pageNumbers": { "enabled": true, "position": "LEFT" }, "size": { "height": 1, "width": 1 } }, "typography": { "align": "LEFT", "color": "example", "family": "example", "size": 1, "weight": "LIGHT" } }, "fonts": { "additionalProperty": { "src": "example", "style": "example", "weight": "example" } }, "rows": [ { "blocks": [ { "config": { "align": "LEFT", "lineColor": "example", "spacing": { "bottom": 1, "left": 1, "right": 1, "top": 1 }, "style": "SOLID", "thickness": 1, "typography": { "align": "LEFT", "color": "example", "family": "example", "size": 1, "weight": "LIGHT" }, "width": "example" }, "id": "example" } ] } ], "version": 1 } }'Renders a JSON template (with optional per-block data overrides) to a PDF/A-3a document.
Request Body required
Section titled “Request Body required ” Media type application/json
object
data
Per-block content overrides, keyed by block id. Object for most blocks; array of row objects for tables.
object
key
additional properties
options
object
baseUrl
string
title
string
template
required
object
attachments
Array<object>
object
content
required
string
description
string
mimeType
string
name
required
string
relationship
string
config
object
page
object
background
object
src
required
string
type
string
footer
object
repeat
boolean
rows
Array<object>
object
blocks
required
Array<object>
One of: discriminator: type
object
config
required
object
align
string
lineColor
string
spacing
object
bottom
integer
left
integer
right
integer
top
integer
style
string
thickness
integer
typography
object
align
string
color
string
family
string
size
integer
weight
string
width
string
id
string
object
config
required
object
align
string
level
integer
spacing
object
bottom
integer
left
integer
right
integer
top
integer
typography
object
align
string
color
string
family
string
size
integer
weight
string
width
string
id
string
text
required
string
object
config
required
object
align
string
spacing
object
bottom
integer
left
integer
right
integer
top
integer
typography
object
align
string
color
string
family
string
size
integer
weight
string
width
string
id
string
html
required
string
object
config
required
object
align
string
maxHeight
integer
spacing
object
bottom
integer
left
integer
right
integer
top
integer
typography
object
align
string
color
string
family
string
size
integer
weight
string
width
string
id
string
alt
string
src
required
string
object
config
required
object
align
string
fields
Array<object>
object
key
required
string
label
required
string
labelWidth
string
spacing
object
bottom
integer
left
integer
right
integer
top
integer
typography
object
align
string
color
string
family
string
size
integer
weight
string
width
string
id
string
values
object
key
additional properties
string
object
config
required
object
align
string
height
integer
spacing
object
bottom
integer
left
integer
right
integer
top
integer
typography
object
align
string
color
string
family
string
size
integer
weight
string
width
string
id
string
object
config
required
object
align
string
columns
Array<object>
object
align
string
key
required
string
label
required
string
width
string
numberRows
boolean
spacing
object
bottom
integer
left
integer
right
integer
top
integer
style
string
typography
object
align
string
color
string
family
string
size
integer
weight
string
width
string
id
string
rows
Array<object>
object
entries
keys
Array<string>
size
integer
object
config
required
object
align
string
spacing
object
bottom
integer
left
integer
right
integer
top
integer
typography
object
align
string
color
string
family
string
size
integer
weight
string
width
string
id
string
text
required
string
locale
string
margins
object
bottom
integer
left
integer
right
integer
top
integer
pageNumbers
object
enabled
boolean
position
string
typography
object
align
string
color
string
family
string
size
integer
weight
string
fonts
object
key
additional properties
object
src
required
string
style
string
weight
One or more whitespace-separated [FontWeight] values, e.g. “400” or “400 700”.
string
rows
Array<object>
object
blocks
required
Array<object>
One of: discriminator: type
object
config
required
object
align
string
lineColor
string
spacing
object
bottom
integer
left
integer
right
integer
top
integer
style
string
thickness
integer
typography
object
align
string
color
string
family
string
size
integer
weight
string
width
string
id
string
object
config
required
object
align
string
level
integer
spacing
object
bottom
integer
left
integer
right
integer
top
integer
typography
object
align
string
color
string
family
string
size
integer
weight
string
width
string
id
string
text
required
string
object
config
required
object
align
string
spacing
object
bottom
integer
left
integer
right
integer
top
integer
typography
object
align
string
color
string
family
string
size
integer
weight
string
width
string
id
string
html
required
string
object
config
required
object
align
string
maxHeight
integer
spacing
object
bottom
integer
left
integer
right
integer
top
integer
typography
object
align
string
color
string
family
string
size
integer
weight
string
width
string
id
string
alt
string
src
required
string
object
config
required
object
align
string
fields
Array<object>
object
key
required
string
label
required
string
labelWidth
string
spacing
object
bottom
integer
left
integer
right
integer
top
integer
typography
object
align
string
color
string
family
string
size
integer
weight
string
width
string
id
string
values
object
key
additional properties
string
object
config
required
object
align
string
height
integer
spacing
object
bottom
integer
left
integer
right
integer
top
integer
typography
object
align
string
color
string
family
string
size
integer
weight
string
width
string
id
string
object
config
required
object
align
string
columns
Array<object>
object
align
string
key
required
string
label
required
string
width
string
numberRows
boolean
spacing
object
bottom
integer
left
integer
right
integer
top
integer
style
string
typography
object
align
string
color
string
family
string
size
integer
weight
string
width
string
id
string
rows
Array<object>
object
entries
keys
Array<string>
size
integer
object
config
required
object
align
string
spacing
object
bottom
integer
left
integer
right
integer
top
integer
typography
object
align
string
color
string
family
string
size
integer
weight
string
width
string
id
string
text
required
string
version
required
integer
Responses
Section titled “ Responses ”PDF document
Media type application/pdf
string format: binary
Invalid template, data, or request
Media type application/json
object
error
string
issues
required
Array<object>
object
code
required
string
message
required
string
path
required
string
Example generated
{ "error": "example", "issues": [ { "code": "example", "message": "example", "path": "example" } ]}Rendering failed