Use case

Turn your data into
polished PDF reports

Generate PDF reports from HTML templates or live URLs. Tables, charts, summaries, all rendered by a full browser engine on every request.

Start free

Two approaches: HTML or URL

For server-rendered reports, build the HTML yourself and POST it. For client-rendered reports (charts drawn with JavaScript), pass the URL and let the API render it with a full browser.

HTML approach (Node.js)
const html = buildReportHtml(reportData)

const res = await fetch('https://platform.htmltopdfapi.co/api/v1/pdf/generate', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.HTMLTOPDF_API_KEY}`,
    'Content-Type': 'application/json',
    Accept: 'application/pdf',
  },
  body: JSON.stringify({
    html,
    paper_size: 'a4',
    orientation: 'landscape',
    margin_top: 20,
    margin_bottom: 20,
  }),
})

const pdfBuffer = Buffer.from(await res.arrayBuffer())
URL approach: for JS-rendered charts
const res = await fetch('https://platform.htmltopdfapi.co/api/v1/pdf/generate', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.HTMLTOPDF_API_KEY}`,
    'Content-Type': 'application/json',
    Accept: 'application/pdf',
  },
  body: JSON.stringify({
    url: 'https://your-app.com/reports/monthly?token=preview_xyz',
    paper_size: 'a4',
    orientation: 'landscape',
    wait_until: 'networkidle0',
  }),
})

const pdfBuffer = Buffer.from(await res.arrayBuffer())

Features for data-heavy reports

Landscape and portrait orientation
A4, A3, A5, Letter, Legal, and custom sizes
Full CSS Grid and flexbox for layouts
SVG charts render correctly
wait_until for JS-rendered data
Custom headers with report title/date
Page numbering across long reports
Works on Vercel, Lambda, Cloudflare

Start generating PDF reports free

200 pages/day on the free tier. No credit card required.

Get your free API key