0.5 Credits

PDF generator API — Generate PDFs from templates, HTML, and data

Nutrient’s PDF generator API converts HTML templates and structured data into production-ready PDFs via a single REST call. Use it for invoices, contracts, payslips, compliance reports, or any document an application generates at scale — without a PDF library, desktop software, or rendering server.

Accurate, pixel-perfect rendering

Preserve layout, styles, fonts, and responsive design to ensure your HTML content looks exactly as intended in PDF format.

Automate with Zapier

Automatically convert HTML files in Google Drive to PDFs using our Zapier integration. It’s the fastest way to turn web content into documents without writing code.

Simple and transparent pricing

Select a package that suits your needs according to the number of credits you wish to spend. Each API tool and action has a specific credit cost.

Used by Lufthansa, Disney, Autodesk, UBS, Dropbox, IBM
Lufthansa
Disney
Autodesk
UBS
Dropbox
IBM

Try it out

This example will create a PDF from the supplied index.html file and render it on an A4-sized page. For detailed information on how to structure your HTML files, along with all the available customization options, see guides.


Try it out in three steps

  1. Add an HTML file named index.html to your project folder.
  2. Run the code from the same folder.
  3. Open result.pdf to see the output.
curl -X POST https://api.nutrient.io/processor/generate_pdf \
-H "Authorization: Bearer your_api_key_here" \
-o result.pdf \
--fail \
-F html=@index.html

Start now

Create an account to access your API key and start with 50 free credits per month

Start building with DWS Processor API in minutes — no payment information required.

Already have an account? Sign in →

API comparison

BASIC

PDF generation API

Straightforward API for common PDF generation tasks. Perfect for most use cases.


FEATURES

  • Simple request format
  • Minimal configuration required
  • Purpose-built for specific tasks
ADVANCED

Build API

Maximum flexibility and advanced features for complex workflows.


FEATURES

  • Multipart document support
  • Advanced actions and transformations
  • Workflow orchestration

Generate PDFs from HTML templates

The application sends an HTML/CSS template with data placeholders to the API, which merges the data and returns a PDF. Rendering is pixel-perfect, with support for custom fonts and embedded images, so a template designed in HTML produces a matching PDF without a separate rendering pipeline.

Generate PDFs from data — invoices, reports, payslips

Common workflows include finance (invoices, statements), HR (payslips, offer letters), healthcare (patient reports), and legal (contracts) — anywhere structured data needs to become a formatted, shareable document on demand.

Batch PDF generation

A backend can run generation requests in parallel, making it practical to produce hundreds of invoices or reports in a single batch run rather than one request at a time.

What’s the difference

PDF generator API vs. PDF converter API

The PDF generator API creates PDFs from data or templates — there is no existing source file. The PDF converter API transforms an existing file from one format into another, such as Word into PDF. Building documents from application data calls for the generator; converting an uploaded file calls for the converter.

Getting started

Go from a simple HTML file to a fully featured invoice, making use of all the functionality the PDF generator API provides.


Download sample documents

Try generating PDFs with different HTML templates. Download our various sample documents and customize them to your needs.



PDF generator API FAQs

What is a PDF generator API?

A PDF generator API is a web service that creates PDF documents programmatically from input data — such as an HTML template, a JSON payload, or a data model. Rather than using desktop software or a client-side library, a backend calls a REST endpoint and receives a ready-to-use PDF file in response.

How is a PDF generated from a template using an API?

An HTTP POST request is sent with an HTML template and data payload. The API merges the data into the template and returns a PDF binary. The process works in any language — Node.js, Python, Java, C#, and PHP — and takes less than a second for most documents.

Can PDFs be generated from HTML and CSS?

Yes. The PDF generator API accepts HTML and CSS as input and renders it into a pixel-perfect PDF. It supports web fonts, embedded images, flexbox layouts, and print-specific CSS rules, making it well-suited to converting web-based invoice or report templates directly to PDF.

What’s the difference between a PDF generator and a PDF converter?

A PDF generator creates a PDF from scratch — from HTML, a template, or raw data. A PDF converter transforms an existing file (Word, Excel, PowerPoint, image) into PDF format. Building invoices or reports from data calls for the PDF generator API; converting user-uploaded documents calls for the PDF converter API.

Is there a free PDF generator API?

Yes. Nutrient’s PDF generator API includes a free tier with 50 credits per month for evaluating the API and generating documents in development. Paid plans scale by volume — see the Processor API pricing page for current rates.

How are PDF invoices generated at scale?

The PDF generator API works with a parametric HTML invoice template. For each invoice, the backend sends customer data as a JSON payload via POST, and the API returns a PDF in milliseconds. For batch generation, parallel requests can produce many invoices at once.

Can the API generate PDFs with digital signatures or watermarks?

Yes. An application can pass generated PDFs directly to Nutrient’s digital signatures API for signing or apply a watermark at generation time. This enables single-pipeline generation and signing without storing intermediate files.

What programming languages does the PDF generator API support?

The API is a standard REST endpoint, so it works with any language capable of making HTTP requests. Nutrient provides code examples for JavaScript/Node.js, Python, Java, C#, PHP, and Shell.

Security is our top priority

SOC 2 Type 2 audited

Nutrient’s infrastructure is SOC 2 Type 2 audited and GDPR-compliant. See our privacy policy and security documentation for details on data handling.

HTTPS encryption

All communication between your application and Nutrient is done via HTTPS to ensure your data is encrypted when it’s sent to us.

Safe payment processing

All payments are handled by Paddle. Nutrient DWS Processor API never has direct access to any of your payment data.

Ready to try it?

Create an account to get your DWS Processor API key and start making API calls.