HTML to PDF API
for Web Content
Convert HTML pages and CSS styling into professional PDF documents. Perfect for web archiving, documentation, reports, and print-ready files. No browser automation required.
What Is HTML to PDF?
A fast, reliable API that converts static HTML and CSS into high-quality PDF documents. Send your HTML content, receive a downloadable PDF—perfect for archiving web content, generating reports, or creating print-ready files.
Standard HTML & CSS
Use the same HTML and CSS you know. No special syntax or proprietary markup required.
Fast Conversion
Server-side rendering with mPDF engine. No headless browsers, no JavaScript execution delays.
Images & Media
Embed images via HTTPS URLs or data URIs. Supports PNG, JPEG, and GIF formats.
Flexible Page Sizes
A4, Letter, and Legal sizes in both portrait and landscape orientations.
HTML In, PDF Out
Send your HTML and CSS, receive a professional PDF in seconds.
POST https://api.nisastack.com/pdf/html-to-pdf { "html": "<h1>Project Documentation</h1> <p>This document contains technical specifications for the project.</p> <img src='https://example.com/logo.png'> <table>...</table>", "css": "h1 { color: #2563eb; font-size: 32px; } p { line-height: 1.6; color: #333; } table { border-collapse: collapse; width: 100%; }", "page_size": "A4", "orientation": "portrait" }
{
"download_url": "https://app.nisastack.com/
files/download/files/456/doc.pdf",
"signed_url": "https://pub-xxx.r2.dev/
files/456/doc.pdf?X-Amz-Signature=...",
"signed_url_expires_at":
"2026-05-24T15:30:00Z",
"expires_at": "2026-05-23T15:30:00Z",
"size_bytes": 123456,
"page_count": 3,
"pdf_base64": "JVBERi0xLjQKJeLjz9MK..."
}
Common Use Cases
Convert any HTML content into print-ready PDFs from your automation workflows.
Web Page Archiving
Archive blog posts, articles, or web pages as PDFs. Perfect for creating offline copies or long-term storage.
Technical Documentation
Convert API docs, user guides, or technical specifications into shareable PDF documents.
Print-Ready Reports
Generate printer-friendly versions of dashboards, analytics reports, or data visualizations.
HTML to PDF vs JSON to PDF
Both tools use the same powerful PDF engine, but serve different use cases.
HTML to PDF
Best for converting static HTML content without variables or templates.
JSON to PDF
Best for dynamic documents with data-driven templates and variables.
Powerful & Flexible
Enterprise-grade PDF generation with the features you need.
Page Formats
File Access Options
Built-in Security
Convert HTML to PDF Today
Fast, reliable HTML to PDF conversion costs just 3 actions per file. Start with 100 free actions per month—no credit card required.