JSON to PDF API
for Dynamic Documents
Convert JSON data and HTML templates into beautiful PDF documents. Perfect for invoices, reports, payslips, receipts, and certificates. No design skills required—just HTML, CSS, and data.
What Is JSON to PDF?
A powerful document generation API that combines HTML templates with dynamic data to create professional PDF documents. Use Mustache template syntax ([[variable]]) to inject data into your designs.
Template-Based
Write HTML templates once, reuse them with different data. Use [[variable]] syntax for dynamic content.
Full CSS Styling
Style your PDFs with standard CSS. Fonts, colors, layouts, borders—full design control.
Image Support
Embed images via URLs or data URIs. Perfect for logos, signatures, and product photos.
Security Built-in
CSS sanitization, SSRF protection, memory limits, and page count restrictions for safe document generation.
From Data to PDF in One Request
Send HTML template + CSS + JSON data, receive a professional PDF. It's that simple.
POST https://api.nisastack.com/pdf/json-to-pdf { "html": "<h1>Invoice #[[id]]</h1> <p>Customer: [[customer]]</p> <p>Total: $[[amount]]</p>", "css": "h1 { color: #333; } p { font-size: 14px; }", "data": { "id": "INV-12345", "customer": "Acme Corp", "amount": "1,499.99" }, "page_size": "A4", "orientation": "portrait" }
{
"download_url": "https://app.nisastack.com/
files/download/files/123/doc.pdf",
"signed_url": "https://pub-xxx.r2.dev/
files/123/doc.pdf?X-Amz-Signature=...",
"signed_url_expires_at":
"2026-05-24T15:30:00Z",
"expires_at": "2026-05-23T15:30:00Z",
"size_bytes": 45678,
"page_count": 1,
"pdf_base64": "JVBERi0xLjQKJeLjz9MK..."
}
Perfect For
Generate professional documents on-demand from your automation workflows.
Invoices & Receipts
Generate branded invoices with line items, tax calculations, and payment details. Perfect for e-commerce and SaaS platforms.
Reports & Analytics
Create data-driven reports with charts, tables, and metrics. Automate monthly reports for clients or stakeholders.
Certificates & Payslips
Issue completion certificates, employment letters, or payslips with personalized details and signatures.
Simple Mustache Template Syntax
Use [[variable]] syntax to inject dynamic data into your HTML templates. No complex templating languages to learn.
<!-- HTML Template --> <div class="invoice"> <header> <h1>Invoice #[[invoice_number]]</h1> <p>Date: [[invoice_date]]</p> </header> <section class="customer"> <h2>Bill To:</h2> <p>[[customer_name]]</p> <p>[[customer_address]]</p> </section> <table> <tr> <td>[[item_description]]</td> <td>$[[item_amount]]</td> </tr> </table> <footer> <strong>Total: $[[total_amount]]</strong> </footer> </div> // JSON Data { "invoice_number": "INV-2024-001", "invoice_date": "2024-05-23", "customer_name": "Acme Corporation", "customer_address": "123 Business St, Suite 100", "item_description": "Professional Services", "item_amount": "1,499.99", "total_amount": "1,499.99" }
JSON to PDF vs HTML to PDF
Both tools use the same powerful PDF engine, but serve different use cases.
JSON to PDF
Best for dynamic documents with data-driven templates and variables.
HTML to PDF
Best for converting static HTML content without variables or templates.
Powerful & Flexible
Enterprise-grade PDF generation with the features you need.
Page Formats
File Access Options
Built-in Security
Start Generating PDFs Today
Professional document generation costs just 3 actions per PDF. Start with 100 free actions per month—no credit card required.