Skip to content

Quick start

rustedf.cloud turns an HTML template and some data into a PDF. You call one endpoint with an API key; the PDF comes back in the response.

Sign in to the portal with your email. We send a link; there is no password. Open API keys, create a key and copy it. It is shown once.

Send HTML and data in one request. The HTML is a template: {{ name }} is replaced by the value of name in data.

Terminal window
curl -X POST https://api.example.com/v1/render \
-H "Authorization: Bearer $RUSTEDF_KEY" \
-H "Content-Type: application/json" \
-d '{
"html": "<h1>Hello {{ name }}</h1>",
"data": { "name": "World" }
}' \
-o hello.pdf

Open hello.pdf. One credit was used. Your remaining credits are in the X-Credits-Remaining response header.

Real documents live in templates you edit in the portal, with a live preview. Render one by id:

import { writeFile } from 'node:fs/promises';
const response = await fetch('https://api.example.com/v1/render', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.RUSTEDF_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
template_id: '0194f2c0-…',
locale: 'pt-BR',
data: { number: '2025-0042', total: '2040.50' },
}),
});
if (!response.ok) throw new Error((await response.json()).error.message);
await writeFile('invoice.pdf', Buffer.from(await response.arrayBuffer()));