Fill a template and print it
render_templateFills a template with JSON data and prints it to PDF (a download link, valid 24 hours, and the edit link in the editor, where its template and data stay editable — until the person edits it on the page, which makes it a plain HTML document: then change its html). Either a gallery template (template_id from list_templates; without data it prints its sample) or your own template source. Send data in the shape of the template's sample (get_template). The language: read_guide topic "templates".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | The values the template reads, in the shape of its sample data. | |
| preview | No | A picture (PNG) of page 1 comes with the answer, so you can check the layout, fonts and images before giving the links. Default: true. | |
| filename | No | The PDF file name. Default: the template's name or the document's <title>. | |
| template | No | Your own template source (HTML with {{ value }}, {% for %}, {% if %}), instead of template_id. | |
| template_id | No | A gallery template's id, from list_templates. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The link, valid 24 hours. | |
| mark | Yes | Whether the PDF carries the ReflowPDF mark, and why. | |
| bytes | Yes | ||
| notes | Yes | What to tell the person about this PDF. | |
| pages | Yes | ||
| timing | No | The engine's own parts of it, when it states them: layoutMs (styles, layout and pagination) and writeMs (writing the PDF). | |
| editUrl | No | The document in the ReflowPDF editor: the person edits it there (the link is the document; it lasts while it is used). | |
| preview | No | What picture of the PDF came with this answer (page 1, as PNG), or why none did. | |
| filename | Yes | ||
| renderMs | No | How long the print took on the server, in milliseconds (the engine and its adapter). | |
| revision | No | Its revision: name it to update_document as base_revision. | |
| expiresAt | Yes | When the link stops working (ISO 8601). | |
| documentId | No | The document, for get_document and update_document. | |
| missingVariables | No | Template values the data did not have (printed empty). | |
| skippedResources | No | Images, fonts or style sheets the server could not fetch. |