PDF Generation API Convert Any URL to PDF
Turn any webpage or HTML into a polished PDF document with a single API call. The Nodium HTML to PDF API supports custom paper sizes, margins, headers, footers, and print backgrounds. Generate invoices, reports, and documents programmatically.
Free plan includes 100 API calls/month. No credit card required.
Every Paper Format You Need
Generate PDFs in standard paper sizes used worldwide.
A4
210 x 297mm
Letter
8.5 x 11in
Legal
8.5 x 14in
A3
297 x 420mm
A5
148 x 210mm
Tabloid
11 x 17in
Full Control Over PDF Output
Customize every aspect of the generated PDF document.
Custom Margins
Set top, right, bottom, and left margins independently. Specify values in pixels, inches, or millimeters for precise layout control.
Headers & Footers
Add custom HTML headers and footers with dynamic variables like page number, total pages, date, title, and URL.
Landscape Mode
Generate landscape-oriented PDFs for wide tables, charts, dashboards, and horizontal layouts with a single parameter.
Print Background
Include CSS background colors and images in the PDF output. Essential for branded documents, colored tables, and styled invoices.
Additional PDF options
Generate a PDF in One API Call
Set format=pdf and customize the output.
curl "https://api.nodium.io/api/v1/screenshot?\
url=https://example.com&\
format=pdf&\
pdf_format=A4" \
-H "X-API-Key: ndm_your_api_key" \
--output document.pdfconst response = await fetch(
"https://api.nodium.io/api/v1/screenshot?" +
new URLSearchParams({
url: "https://example.com/invoice/12345",
format: "pdf",
pdf_format: "A4",
pdf_margin_top: "20",
pdf_margin_bottom: "20",
pdf_margin_left: "15",
pdf_margin_right: "15",
pdf_print_background: "true",
pdf_landscape: "false",
}),
{
headers: { "X-API-Key": "ndm_your_api_key" },
}
);
const pdfBuffer = await response.arrayBuffer();import requests
response = requests.get(
"https://api.nodium.io/api/v1/screenshot",
params={
"url": "https://example.com/report",
"format": "pdf",
"pdf_format": "Letter",
"pdf_print_background": True,
"pdf_header_template": "<div style='font-size:9px;width:100%;text-align:center;'>Company Report</div>",
"pdf_footer_template": "<div style='font-size:9px;width:100%;text-align:center;'>Page <span class='pageNumber'></span> of <span class='totalPages'></span></div>",
"pdf_display_header_footer": True,
},
headers={"X-API-Key": "ndm_your_api_key"},
)
with open("report.pdf", "wb") as f:
f.write(response.content)What Developers Build with the PDF API
Invoices and receipts
Render HTML invoice templates as pixel-perfect PDF documents. Automate invoice generation from your billing system and email them directly to customers.
Reports and dashboards
Convert data dashboards, analytics reports, and charts into downloadable PDF documents. Schedule automated report generation on a daily, weekly, or monthly basis.
Web page archiving
Save point-in-time snapshots of web pages as PDF documents for compliance, legal discovery, or record-keeping. PDFs preserve layout and content faithfully.
Contracts and agreements
Generate contracts from HTML templates with dynamic data. PDFs maintain consistent formatting across all devices and platforms, making them ideal for legal documents.
Compliance documentation
Produce regulatory filings, audit reports, and compliance documents from structured HTML data. Add page numbers, headers, and footers automatically.
E-commerce order summaries
Create downloadable order confirmations, packing slips, and shipping labels as PDF documents from your e-commerce platform data.
Nodium vs. Other PDF Solutions
Why choose Nodium for HTML to PDF conversion over self-hosted or alternative tools.
| Feature | Nodium API | wkhtmltopdf | Puppeteer |
|---|---|---|---|
| Modern CSS support | |||
| JavaScript execution | Limited | ||
| Setup required | None (API) | Install binary | Node.js + browser |
| Scaling | Automatic | Manual | Manual |
| Custom headers/footers | |||
| Flexbox & Grid layout | |||
| Web fonts | Partial | ||
| Signed URLs | |||
| Async webhooks |
Frequently Asked Questions
What is an HTML to PDF API?
What paper sizes does the PDF API support?
Can I add headers and footers to generated PDFs?
Does the PDF API support CSS backgrounds and images?
How does Nodium compare to wkhtmltopdf?
Can I generate PDFs from raw HTML instead of a URL?
Start generating PDFs today
Convert any URL or HTML to a polished PDF document with a single API call. 100 free API calls every month, no credit card needed.