PDF from template
What this tool does
This tool fills a document template with your data and returns a finished PDF. You write the template once in Markdown or HTML with {{placeholders}}, send the values as JSON and get the same layout with every field replaced.
When to use it
- Generating contracts, offers or receipts from a fixed layout.
- Producing certificates or letters with per-recipient data.
- Creating reports from pipeline results without a Word step.
- Standardising documents that must look identical every time.
What to expect
You receive a link to the PDF, the number of distinct fields replaced, the list of placeholders that had no value and the paper size used.
Limitations
- Placeholders are replaced literally: no AI, no free-form interpretation.
- Values are HTML-escaped, so they cannot inject markup.
- Nested values use dots (
{{customer.name}}); lists render as JSON text. - Filling an existing PDF that is not a template is a different (AI-assisted) mode, not yet available.
When it fails
- No template or no data was provided.
strictis on and some placeholder has no value.- The paper size is invalid or the conversion service is unavailable.
Good to know
- Leave
strictoff while iterating and reviewmissing_fields; turn it on for final documents. - Pass
cssto tweak fonts, colours or margins. - Pairs with
convert-markdown-to-pdfwhen the template needs no data.
Input data
| Parameter | Required | Example | Description |
|---|---|---|---|
template | Yes | # Hola {{name}} | Markdown or HTML template with {{placeholders}}. |
data | Yes | {"name": "Miquel"} | JSON object with the values for the placeholders. |
format | No | markdown | Template syntax: markdown or html. Default markdown. |
title | No | Contrato | Optional PDF title. |
strict | No | false | Fail when a placeholder has no value (recommended for final documents). |
paper_size | No | a4 | Paper size: a4, letter or a3. Default a4. |
css | No | - | Optional CSS appended to the default stylesheet. |
Output data
| Field | Description |
|---|---|
result | Signed URL of the generated PDF. |
replaced | Number of distinct placeholders replaced. |
missing_fields | Placeholders that had no value in the data. |
paper_size | Paper size applied. |