PDF Generation API for SaaS HTML, Templates & Forms

Generate pixel-perfect PDFs from reusable templates, HTML, or URLs. Simple REST API, free tier, enterprise-ready.

No credit card required
25 free credits per month
Start generating in minutes

Choose your generation method

Three ways to generate PDFs, one API. Pick the method that fits your workflow.

URL to PDF

Convert any web page to a pixel-perfect PDF. Pass a URL, get a PDF. Supports batch processing for multiple pages.

HTML to PDF

Send raw HTML and CSS, receive a rendered PDF. Full control over layout and styling.

Template Fill

Fill pre-built or custom templates with JSON data. Variables, line items, and conditionals supported.

What is PDF Generation API?

A PDF Generation API is a REST endpoint that programmatically creates PDF documents from structured data, HTML markup, or web page URLs. Instead of manually designing documents in word processors, developers send a request to the API and receive a formatted PDF in return. This automates document workflows at scale, eliminating repetitive manual work.

Developers use PDF generation APIs to automate invoice creation, contract assembly, certificate generation, report rendering, and tax form filling. The API handles layout, styling, fonts, and pagination, so your application focuses on data, not document design. Whether you need a single PDF or ten thousand, the API scales to match.

DocuQueue simplifies PDF generation with a single REST API. Pass a URL to convert any web page to PDF, send raw HTML for full design control (step-by-step HTML to PDF examples), or fill pre-built templates with JSON data. Authentication is a single API key header, no OAuth complexity. Rendered via Chromium for pixel-perfect accuracy. Start with 5 free credits.

API Endpoints

Six endpoints to handle every PDF generation workflow. Convert URLs, render HTML, fill templates, and manage jobs.

POST

/api/v1/convert

Convert any URL to a pixel-perfect PDF. Supports batch processing for multiple pages.

POST

/api/v1/convert-html

Send raw HTML and CSS, receive a rendered PDF. Full control over layout and styling.

POST

/api/v1/templates/{id}/fill

Fill a pre-built or custom template with JSON data. Variables, line items, and conditionals supported.

POST

/api/v1/forms/upload

Upload a PDF and auto-detect all fillable form fields. Learn more →

GET

/api/v1/status/{job_id}

Check the status of an async conversion job. Poll or use webhooks.

GET

/api/v1/download/{job_id}

Download the generated PDF once the job completes.

Code Examples

Get started in minutes with any language. Copy, paste, and run.

# Convert a URL to PDF
curl -X POST https://docuqueue.com/api/v1/convert \
  -H "api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"urls": ["https://example.com"]}'

# Convert HTML to PDF
curl -X POST https://docuqueue.com/api/v1/convert-html \
  -H "api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"html": "<h1>Hello</h1><p>World</p>"}'

# Fill a template with data
curl -X POST https://docuqueue.com/api/v1/templates/{id}/fill \
  -H "api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data": {"name": "John", "amount": 100}}'
import requests

API_KEY = "your_api_key"
BASE_URL = "https://docuqueue.com/api/v1"

# Convert a URL to PDF
response = requests.post(
    f"{BASE_URL}/convert",
    headers={"api-key": API_KEY},
    json={"urls": ["https://example.com"]}
)

# Check job status
job_id = response.json()["job_id"]
status = requests.get(
    f"{BASE_URL}/status/{job_id}",
    headers={"api-key": API_KEY}
)

# Download the PDF
pdf = requests.get(
    f"{BASE_URL}/download/{job_id}",
    headers={"api-key": API_KEY}
)
open("output.pdf", "wb").write(pdf.content)
const API_KEY = "your_api_key";
const BASE_URL = "https://docuqueue.com/api/v1";

// Convert a URL to PDF
const response = await fetch(`${BASE_URL}/convert`, {
  method: "POST",
  headers: {
    "api-key": API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    urls: ["https://example.com"],
  }),
});

const { job_id } = await response.json();

// Download the PDF
const pdf = await fetch(`${BASE_URL}/download/${job_id}`, {
  headers: { "api-key": API_KEY },
});
const buffer = await pdf.arrayBuffer();
require("fs").writeFileSync("output.pdf", buffer);

PDF Generation API Features

REST API with API key auth, Chromium rendering, batch processing, async jobs, templates, and webhooks.

API Key Authentication

Pass your API key in the api-key header with every request. No OAuth or token refresh required.

Chromium Rendering

PDFs are rendered via Chromium. Supports complex HTML layouts, CSS, and web fonts.

Batch Processing

Process multiple documents in parallel. Generate hundreds of PDFs per request.

Async Jobs

Submit jobs and poll for status. Non-blocking workflow for high-throughput apps.

Template System

Pre-built templates or custom DOCX. Variables, line items, and conditionals.

Webhook Support

Get notified when jobs complete. Build event-driven document workflows.

When to Use PDF Generation API

Automate any document workflow that currently involves manual PDF creation.

Invoices

Generate invoices from CRM data automatically

Certificates

Create awards, completions, and credentials

Contracts

Assemble agreements from templates and data

Reports

Render analytics and business reports as PDF

Tax Forms

Fill and generate W-9, W-4, I-9, 1099 forms

PDF Generation for SaaS Applications

Generate PDFs programmatically inside your product. Multi-tenant, white-label ready.

Multi-Tenant

Each API key maps to a tenant. Isolated data, separate billing, per-tenant rate limits.

White-Label

Remove DocuQueue branding. Your PDFs look like they come from your product.

Scale

From 10 PDFs/month to 100,000+. Same API, same latency, same quality.

PDF API vs Document Generation API

Two terms, overlapping but distinct. Here's the short version.

A PDF API focuses specifically on PDF output. You send HTML, a URL, or structured data; you get a PDF back. The API handles rendering, pagination, and styling.

A Document Generation API is broader. It may produce PDFs, Word docs, Excel spreadsheets, or presentations from the same template. Useful when your workflow requires multiple output formats.

DocuQueue is a PDF-focused API. If you need PDFs only, you get a simpler interface, faster rendering, and lower cost. If you need multiple formats, compare document generation APIs.

DocuQueue vs Other PDF APIs

Key differences at a glance. See full comparison with pricing →

Feature DocuQueue APITemplate.io CraftMyPDF PDFGeneratorAPI
Free Tier 25 credits/mo None 3 credits/mo None
HTML to PDF Yes Yes No No
Batch Processing Yes No No No
PDF Form Filling Yes No No No

What Developers Say

"We replaced our entire PDF pipeline with DocuQueue's API. The HTML to PDF conversion is pixel-perfect, and batch processing cut our document generation time from hours to minutes."
Marcus Chen CTO, InvoiceFlow
"The template system is exactly what we needed. We upload a DOCX template, send JSON data via the API, and get formatted PDFs back. Our legal team generates 200+ contracts per week now."
Sarah Mitchell Operations Manager, LegalEdge
"Finally, a PDF API with a real free tier. I evaluated five different services and DocuQueue was the only one that let me prototype without entering a credit card. The API docs are excellent."
James Park Solo Developer

Frequently Asked Questions

Pass your API key in the api-key header with every request. Get your key from the dashboard after registering. No OAuth or token refresh required.
Rate limits: Free 5 req/min, Starter 20 req/min, Pro 50 req/min, Business 100 req/min. View pricing details.
Yes. Free tier includes 25 credits per month. Each API call uses 1 credit. No credit card required. Sign up to get your API key.
Official SDKs: Python and Node.js. Any HTTP client works (cURL, Go, Ruby, Java) via standard REST with JSON payloads.
Yes. Set a webhook URL in your dashboard to receive POST notifications when generation jobs complete. Integrates with Zapier and n8n.
Three input methods: URL to PDF, HTML to PDF, and template fill with JSON data. All outputs are Chromium-rendered PDFs. API documentation.
Yes. DocuQueue provides a REST API and MCP server for programmatic form filling. Send a POST request with your PDF and JSON data to /api/v1/forms/fill, or connect via MCP: claude mcp add docuqueue --transport http https://docuqueue.com/mcp. Supports W-4, W-9, I-9, and custom PDF forms.

Start Generating PDFs Today

Free tier includes 25 credits per month. No credit card required.
Start Generating for Free