HTML to PDF

HTML to PDF API
One POST Request

Send raw HTML, Markdown, or a URL. Get back a PDF rendered in real Chrome with ads and cookie banners already removed. No browser to manage, nothing to install.

Raw HTML Input

POST up to 2 MB of your own HTML and CSS. External images, Google Fonts, flexbox, and grid render exactly as they do in the browser. Markdown input works too.

URL to PDF

Point the same endpoint at any public URL and get the rendered page back as a PDF. One GET request, no body needed.

Full-Page Capture

Set full_page to true and the whole scrolled page lands in the PDF as one continuous page, up to 65,000 pixels tall. Lazy-loaded content included.

Clean Documents

Ads and cookie consent banners are blocked by default, so archived pages and reports show content, not pop-ups. Dark mode and device emulation work too.

From Zero to PDF in One Request

The same endpoint that captures screenshots produces PDFs. Change one parameter.

URL to PDF (cURL)

curl "https://app.snap-render.com/v1/screenshot?url=https://example.com&format=pdf&full_page=true" \
  -H "X-API-Key: YOUR_API_KEY" \
  --output page.pdf

Raw HTML to PDF (cURL)

curl -X POST "https://app.snap-render.com/v1/screenshot" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"html": "<h1>Invoice #1042</h1><p>Total: $290</p>", "format": "pdf", "width": 1240}' \
  --output invoice.pdf

Node.js

import { SnapRender } from 'snaprender';
import { writeFileSync } from 'fs';

const snap = new SnapRender({ apiKey: 'YOUR_API_KEY' });
const pdf = await snap.capture({
  html: renderTemplate(order),   // your own HTML string
  format: 'pdf',
  width: 1240,
});
writeFileSync('order.pdf', pdf);

Python

from snaprender import SnapRender

snap = SnapRender(api_key="YOUR_API_KEY")
pdf = snap.capture(
    url="https://example.com/report",
    format="pdf",
    full_page=True,
)
with open("report.pdf", "wb") as f:
    f.write(pdf)

What These PDFs Are (and Are Not)

SnapRender PDFs are pixel-accurate snapshots of the rendered page wrapped as a PDF document. What you see in Chrome is exactly what lands in the file: fonts, gradients, embedded images, the lot. That is the right shape for archives, visual records, compliance snapshots, sharable previews, and design sign-offs.

The trade-off, stated plainly: the PDF does not contain a selectable text layer. If your use case is text documents that need copy-paste, search, or accessibility tooling (contracts, generated invoices for accounting systems), a text-layout PDF engine serves you better. If your use case is "make this page a document that looks exactly right," this API does it in one request.

Parameters That Matter for PDF

Parameter What it does
format=pdfSwitches output from image to PDF
url | html | markdownExactly one source: a public URL, raw HTML (2 MB), or Markdown (500 KB)
full_page=trueCapture the entire scrolled page, not just the viewport
widthPage width in pixels (320 to 3,840); 1240 approximates A4 at 150 dpi
block_ads, block_cookie_bannersBoth on by default for clean documents
dark_mode, device, delayForce dark rendering, emulate a device, or wait for late content

Full parameter reference in the API docs.

Related

Frequently Asked Questions

Can I send raw HTML instead of a URL?
Yes. POST up to 2 MB of HTML (or 500 KB of Markdown) in the request body with format set to pdf. The markup renders in a real Chrome browser, so external images, web fonts, and full CSS all work.
Is the PDF text selectable?
No. The PDF contains a pixel-accurate image of the rendered page, not a text layer. That makes it ideal for visual records, archives, and previews that must look exactly like the browser. If you need selectable text for documents like invoices, a text-layout PDF engine is the better fit.
Does full-page capture work with PDF output?
Yes. Set full_page to true and the PDF contains the entire scrolled page as one continuous page, up to 65,000 pixels tall.
Can I remove ads and cookie banners from the PDF?
Yes, both are blocked by default. The PDF shows the page content without consent pop-ups or ad slots.
How is PDF output billed?
A PDF conversion counts as one render, the same as a PNG screenshot. Every plan includes PDF output, starting with the free tier of 200 renders per month.

Screenshots as an API call

Send a GET request, get a PNG back. Ads and cookie banners blocked by default.

200 free renders a month. Paid plans start at $9.

Your First PDF Is 30 Seconds Away

200 free renders per month. Every format included. No credit card required.