Render a template to PDF
const url = 'http://localhost:8080/render/template';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"data":{},"template":{"version":2,"config":{"title":"example","page":{"size":{"format":"A3","orientation":"portrait"},"locale":"example","margins":{"top":1,"right":1,"bottom":1,"left":1},"pageNumbers":{"enabled":true,"position":"left"},"background":{"src":"example","type":"auto"},"footer":{"repeat":true,"rows":[{"blocks":[{"type":"text","id":"example","text":"example","config":{"typography":{"family":"example","size":1,"weight":"300","align":"left","color":"example"},"spacing":{"top":1,"right":1,"bottom":1,"left":1},"width":"example","align":"left"}}]}]}},"typography":{"family":"example","size":1,"weight":"300","align":"left","color":"example"},"embedColorProfile":true},"fonts":{"additionalProperty":{"src":"example","weight":"example","style":"example"}},"attachments":[{"name":"example","content":"example","mimeType":"example","description":"example","relationship":"example"}],"rows":[{"blocks":[{"type":"text","id":"example","text":"example","config":{"typography":{"family":"example","size":1,"weight":"300","align":"left","color":"example"},"spacing":{"top":1,"right":1,"bottom":1,"left":1},"width":"example","align":"left"}}]}]}}'};
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 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "data": {}, "template": { "version": 2, "config": { "title": "example", "page": { "size": { "format": "A3", "orientation": "portrait" }, "locale": "example", "margins": { "top": 1, "right": 1, "bottom": 1, "left": 1 }, "pageNumbers": { "enabled": true, "position": "left" }, "background": { "src": "example", "type": "auto" }, "footer": { "repeat": true, "rows": [ { "blocks": [ { "type": "text", "id": "example", "text": "example", "config": { "typography": { "family": "example", "size": 1, "weight": "300", "align": "left", "color": "example" }, "spacing": { "top": 1, "right": 1, "bottom": 1, "left": 1 }, "width": "example", "align": "left" } } ] } ] } }, "typography": { "family": "example", "size": 1, "weight": "300", "align": "left", "color": "example" }, "embedColorProfile": true }, "fonts": { "additionalProperty": { "src": "example", "weight": "example", "style": "example" } }, "attachments": [ { "name": "example", "content": "example", "mimeType": "example", "description": "example", "relationship": "example" } ], "rows": [ { "blocks": [ { "type": "text", "id": "example", "text": "example", "config": { "typography": { "family": "example", "size": 1, "weight": "300", "align": "left", "color": "example" }, "spacing": { "top": 1, "right": 1, "bottom": 1, "left": 1 }, "width": "example", "align": "left" } } ] } ] } }'Renders a JSON template to a PDF/A-3a document, or a JSON validation response when Accept is application/json.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Header Parameters
Section titled “Header Parameters ”Presigned PUT URL that receives the generated document.
Request Body required
Section titled “Request Body required ”object
Per-block content overrides, keyed by block id. Object for most blocks; array of row objects for tables.
object
object
object
Document title. Used as the PDF document title, which PDF/UA requires.
object
object
object
object
Top spacing in millimetres.
Right spacing in millimetres.
Bottom spacing in millimetres.
Left spacing in millimetres.
object
object
HTTP, HTTPS, or base64 data URI for an image or PDF page background.
object
object
object
Stable block identifier used for runtime data overrides.
object
object
Bundled or external font family key.
Font size in points.
Font weight; one of the FontWeight enum values.
Text alignment for this typography scope.
CSS color value used for text.
object
Top spacing in millimetres.
Right spacing in millimetres.
Bottom spacing in millimetres.
Left spacing in millimetres.
CSS width for this block, such as 50%, 80mm, or auto.
Horizontal placement of this block within its row cell.
object
Stable block identifier used for runtime data overrides.
object
object
Bundled or external font family key.
Font size in points.
Font weight; one of the FontWeight enum values.
Text alignment for this typography scope.
CSS color value used for text.
object
Top spacing in millimetres.
Right spacing in millimetres.
Bottom spacing in millimetres.
Left spacing in millimetres.
CSS width for this block, such as 50%, 80mm, or auto.
Horizontal placement of this block within its row cell.
object
Stable block identifier used for runtime data overrides.
object
object
Bundled or external font family key.
Font size in points.
Font weight; one of the FontWeight enum values.
Text alignment for this typography scope.
CSS color value used for text.
object
Top spacing in millimetres.
Right spacing in millimetres.
Bottom spacing in millimetres.
Left spacing in millimetres.
CSS width for this block, such as 50%, 80mm, or auto.
Horizontal placement of this block within its row cell.
object
Stable block identifier used for runtime data overrides.
Public image URL, SVG markup, or uploaded image data URL.
Alternative text for screen readers and PDF accessibility.
Maximum rendered height as a CSS length, such as 60px or 20mm.
object
object
Bundled or external font family key.
Font size in points.
Font weight; one of the FontWeight enum values.
Text alignment for this typography scope.
CSS color value used for text.
object
Top spacing in millimetres.
Right spacing in millimetres.
Bottom spacing in millimetres.
Left spacing in millimetres.
CSS width for this block, such as 50%, 80mm, or auto.
Horizontal placement of this block within its row cell.
object
Stable block identifier used for runtime data overrides.
object
object
object
object
Bundled or external font family key.
Font size in points.
Font weight; one of the FontWeight enum values.
Text alignment for this typography scope.
CSS color value used for text.
object
Top spacing in millimetres.
Right spacing in millimetres.
Bottom spacing in millimetres.
Left spacing in millimetres.
CSS width for this block, such as 50%, 80mm, or auto.
Horizontal placement of this block within its row cell.
object
Stable block identifier used for runtime data overrides.
Vertical space as a CSS length, such as 5mm or 12px.
object
object
Bundled or external font family key.
Font size in points.
Font weight; one of the FontWeight enum values.
Text alignment for this typography scope.
CSS color value used for text.
object
Top spacing in millimetres.
Right spacing in millimetres.
Bottom spacing in millimetres.
Left spacing in millimetres.
CSS width for this block, such as 50%, 80mm, or auto.
Horizontal placement of this block within its row cell.
object
Stable block identifier used for runtime data overrides.
Rule thickness as a CSS length, such as 1pt or 2px.
object
object
Bundled or external font family key.
Font size in points.
Font weight; one of the FontWeight enum values.
Text alignment for this typography scope.
CSS color value used for text.
object
Top spacing in millimetres.
Right spacing in millimetres.
Bottom spacing in millimetres.
Left spacing in millimetres.
CSS width for this block, such as 50%, 80mm, or auto.
Horizontal placement of this block within its row cell.
object
Stable block identifier used for runtime data overrides.
object
Runtime data key used for this table column.
Header label rendered for this table column.
Text alignment for this table column.
Column width as a CSS width value, such as 20mm or 15%.
object
object
Bundled or external font family key.
Font size in points.
Font weight; one of the FontWeight enum values.
Text alignment for this typography scope.
CSS color value used for text.
object
Top spacing in millimetres.
Right spacing in millimetres.
Bottom spacing in millimetres.
Left spacing in millimetres.
CSS width for this block, such as 50%, 80mm, or auto.
Horizontal placement of this block within its row cell.
object
Bundled or external font family key.
Font size in points.
Font weight; one of the FontWeight enum values.
Text alignment for this typography scope.
CSS color value used for text.
Embed the PDF/A ICC color profile. Disable only for PDF/UA-without-PDF/A output.
External fonts keyed by font family name.
object
object
One or more whitespace-separated FontWeight values, e.g. “400” or “400 700”.
object
Base64-encoded file content.
object
object
Stable block identifier used for runtime data overrides.
object
object
Bundled or external font family key.
Font size in points.
Font weight; one of the FontWeight enum values.
Text alignment for this typography scope.
CSS color value used for text.
object
Top spacing in millimetres.
Right spacing in millimetres.
Bottom spacing in millimetres.
Left spacing in millimetres.
CSS width for this block, such as 50%, 80mm, or auto.
Horizontal placement of this block within its row cell.
object
Stable block identifier used for runtime data overrides.
object
object
Bundled or external font family key.
Font size in points.
Font weight; one of the FontWeight enum values.
Text alignment for this typography scope.
CSS color value used for text.
object
Top spacing in millimetres.
Right spacing in millimetres.
Bottom spacing in millimetres.
Left spacing in millimetres.
CSS width for this block, such as 50%, 80mm, or auto.
Horizontal placement of this block within its row cell.
object
Stable block identifier used for runtime data overrides.
object
object
Bundled or external font family key.
Font size in points.
Font weight; one of the FontWeight enum values.
Text alignment for this typography scope.
CSS color value used for text.
object
Top spacing in millimetres.
Right spacing in millimetres.
Bottom spacing in millimetres.
Left spacing in millimetres.
CSS width for this block, such as 50%, 80mm, or auto.
Horizontal placement of this block within its row cell.
object
Stable block identifier used for runtime data overrides.
Public image URL, SVG markup, or uploaded image data URL.
Alternative text for screen readers and PDF accessibility.
Maximum rendered height as a CSS length, such as 60px or 20mm.
object
object
Bundled or external font family key.
Font size in points.
Font weight; one of the FontWeight enum values.
Text alignment for this typography scope.
CSS color value used for text.
object
Top spacing in millimetres.
Right spacing in millimetres.
Bottom spacing in millimetres.
Left spacing in millimetres.
CSS width for this block, such as 50%, 80mm, or auto.
Horizontal placement of this block within its row cell.
object
Stable block identifier used for runtime data overrides.
object
object
object
object
Bundled or external font family key.
Font size in points.
Font weight; one of the FontWeight enum values.
Text alignment for this typography scope.
CSS color value used for text.
object
Top spacing in millimetres.
Right spacing in millimetres.
Bottom spacing in millimetres.
Left spacing in millimetres.
CSS width for this block, such as 50%, 80mm, or auto.
Horizontal placement of this block within its row cell.
object
Stable block identifier used for runtime data overrides.
Vertical space as a CSS length, such as 5mm or 12px.
object
object
Bundled or external font family key.
Font size in points.
Font weight; one of the FontWeight enum values.
Text alignment for this typography scope.
CSS color value used for text.
object
Top spacing in millimetres.
Right spacing in millimetres.
Bottom spacing in millimetres.
Left spacing in millimetres.
CSS width for this block, such as 50%, 80mm, or auto.
Horizontal placement of this block within its row cell.
object
Stable block identifier used for runtime data overrides.
Rule thickness as a CSS length, such as 1pt or 2px.
object
object
Bundled or external font family key.
Font size in points.
Font weight; one of the FontWeight enum values.
Text alignment for this typography scope.
CSS color value used for text.
object
Top spacing in millimetres.
Right spacing in millimetres.
Bottom spacing in millimetres.
Left spacing in millimetres.
CSS width for this block, such as 50%, 80mm, or auto.
Horizontal placement of this block within its row cell.
object
Stable block identifier used for runtime data overrides.
object
Runtime data key used for this table column.
Header label rendered for this table column.
Text alignment for this table column.
Column width as a CSS width value, such as 20mm or 15%.
object
object
Bundled or external font family key.
Font size in points.
Font weight; one of the FontWeight enum values.
Text alignment for this typography scope.
CSS color value used for text.
object
Top spacing in millimetres.
Right spacing in millimetres.
Bottom spacing in millimetres.
Left spacing in millimetres.
CSS width for this block, such as 50%, 80mm, or auto.
Horizontal placement of this block within its row cell.
Responses
Section titled “ Responses ”PDF document or JSON validation response
object
object
object
object
object
object
object
object
object
Example generated
{ "validation": { "isCompliant": true, "profiles": [ { "profile": "example", "specification": "example", "isCompliant": true, "totalChecks": 1, "passedChecks": 1, "failedChecks": 1 } ], "summary": { "totalChecks": 1, "passedChecks": 1, "failedChecks": 1, "categories": [ { "category": "example", "passedChecks": 1, "failedChecks": 1 } ] }, "documentInfo": { "pages": 1, "tagged": true, "language": "example", "structureElements": 1, "fonts": [ { "name": "example", "embedded": true, "type": "example" } ], "images": 1 }, "failures": [ { "profile": "example", "clause": "example", "testNumber": 1, "category": "example", "message": "example", "location": "example", "errorDetails": "example" } ], "metadata": { "title": "example", "subject": "example", "author": "example", "creator": "example", "producer": "example", "creationDate": "example" } }, "pdf": "example"}PDF uploaded successfully
Invalid template, data, request, or JSON/upload conflict
Rendering failed
Upload target rejected the request or was unreachable