Inkspan › Node.js

How to generate a PDF from a template in Node.js

Use the Inkspan /v1/generate/template endpoint to generate a PDF from a template in Node.js. It runs as a managed API — no headless-browser infrastructure, fonts, or scaling to maintain. Authenticate with your API key and send a single POST request.

Node.js example

const res = await fetch('https://api.inkspan.dev/v1/generate/template', {
  method: 'POST',
  headers: { 'X-API-Key': 'ink_live_...', 'Content-Type': 'application/json' },
  body: JSON.stringify({"template":"<h1>{{name}}</h1>","data":{"name":"Ada"}})
});
fs.writeFileSync('out.pdf', Buffer.from(await res.arrayBuffer()));

Notes

Get an API key →

Related: generate a PDF from HTML · convert Markdown to PDF · merge PDF files