Use case
Generate PDF reports with charts and tables
Monthly reporting is the document people ask for and nobody wants to build: a summary paragraph, a chart of the numbers, a table underneath, page headers, and a page break that does not tear a table row in half.
What you send
This is the template's own sample data — the document on the left was drawn from exactly this.
{
"data": {
"title": "Quarterly review",
"period": "April – June 2026",
"months": [
{
"name": "April",
"revenue": 18400
},
{
"name": "May",
"revenue": 22750
},
{
"name": "June",
"revenue": 27300
}
]
}
}POST it to your document's endpoint with your API key. The reply is JSON carrying a signed pdf_url — a link rather than the bytes, because a base64 document breaks receivers sitting behind a default body limit.
curl -X POST https://www.doc2api.co/api/v1/documents/<ID>/render \
-H "X-Api-Key: d2a_live_…" \
-H "Content-Type: application/json" \
-d @payload.json
# → { "pdf_url": "https://…", "pdf_bytes": 17185, "sha256": "…",
# "pdf_url_expires_at": "…" }What the template already does
- A bar chart drawn from your data — no browser, no screenshot step
- A data table that repeats over your rows and can span pages
- A running header and page numbers
- A summary section above the figures
And what you can add in the designer
Not in the starting template — a few clicks once it is open.
- Line and pie charts, from the same data
- Sections that appear only when the data warrants it
- Keep-together on any block, so a table row never tears across a page
- More pages, with their own headers and breaks
Charts without a headless browser
The chart is drawn as part of the document, from the same JSON as the table beside it. Nothing renders a web page, screenshots it and pastes the image in — which is why this costs a flat price per document rather than billing you for seconds of Chrome.
Already have a PDF you have to use?
Designing from a template is one of the three things Doc2api does. If you were handed a form you cannot redraw — a claim form, a government return, a contract in someone else's house style — upload it instead and we read its fields into a JSON schema. Or paste your own HTML into the designer and we render that.
Open it and see for yourself
The template opens in the editor, filled with the sample data above, with a live endpoint and an API key. No account, nothing to cancel — and the first 100 test fills each month are free.