HTML to PDF API Convert URLs and HTML to PDF

Convert web pages and HTML to beautifully formatted PDFs via a simple REST API. Fast rendering, no setup required.

Why Developers Choose DocuQueue

Web Page to PDF

Convert any URL to a pixel-perfect PDF. JavaScript rendering, custom headers, and wait-for-element support.

HTML to PDF Conversion

Pass raw HTML content and get a formatted PDF back. Perfect for reports, invoices, and documents.

Document Generation

Use pre-built templates or create your own. Merge data into PDFs with variables and line items.

Batch Processing

Convert multiple URLs or HTML files in a single API call. Save time and credits.

Fast Rendering

Powered by Chromium for accurate rendering. Complex layouts, fonts, and CSS supported.

Developer Friendly

Simple REST API with API key authentication. SDKs for Python, Node.js, and more.

How do I generate PDFs from HTML or URLs using an API?

Two endpoints, one API key — pick your input:

POST /api/v1/convert-html HTML → PDF

Send raw HTML markup, get a rendered PDF back.

POST /api/v1/convert URL → PDF

Send a live page URL — JavaScript rendering included.

Then, for either endpoint:

1 Poll GET /api/v1/status/{job_id} until ready
→
2 Download GET /api/v1/download/{job_id}
Example A — HTML to PDF with curl
# 1) Submit raw HTML
curl -X POST https://docuqueue.com/api/v1/convert-html \
  -H "api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"html": "<html><body><h1>Hello PDF</h1></body></html>"}'

# → {"job_id": "abc123", "status": "queued"}

# 2) Poll until ready, then download
curl https://docuqueue.com/api/v1/status/abc123 \
  -H "api-key: YOUR_API_KEY"
curl -o result.pdf https://docuqueue.com/api/v1/download/abc123 \
  -H "api-key: YOUR_API_KEY"

# URL instead of HTML? POST /api/v1/convert with {"urls": ["https://example.com"]}
Example B — HTML to PDF with Python
import requests

resp = requests.post(
    "https://docuqueue.com/api/v1/convert-html",
    headers={"api-key": "YOUR_API_KEY"},
    json={"html": "<html><body><h1>Hello PDF</h1></body></html>"},
)
job_id = resp.json()["job_id"]

# Poll status, then download the finished PDF
pdf = requests.get(
    f"https://docuqueue.com/api/v1/download/{job_id}",
    headers={"api-key": "YOUR_API_KEY"},
)
open("result.pdf", "wb").write(pdf.content)

Batch or JavaScript-heavy pages? See the web page to PDF endpoint for URL options like wait-for-element and custom headers. Full request and response schemas live in the API reference.

How It Works

1

Send URL or HTML

Pass a web page URL or raw HTML content to our API endpoint.

2

We Render It

Our Chromium-based renderer processes your content with full CSS and JavaScript support.

3

Get Your PDF

Download the generated PDF or save it directly to your storage.

DocuQueue vs Other PDF APIs

Feature DocuQueue PDFShift CloudConvert
HTML to PDF ✅ Fast rendering ✅ Good ✅ Good
Web page to PDF ✅ JavaScript support ✅ Good ✅ Good
Document generation ✅ Templates + variables ❌ ❌
Batch processing ✅ 50+ per call ✅ Limited ✅ Good
Free tier ✅ 25 credits/mo ❌ ❌
Starting price $9/mo $19/mo $8/mo

See the full comparison of 15 PDF generation APIs for more options.

Frequently Asked Questions

Is there a free HTML to PDF converter?

Yes. Every new DocuQueue account includes 25 free credits per month, no credit card required, and each conversion uses 1 credit. Paste your HTML into the curl or Python example above, call POST /api/v1/convert-html, and download the PDF — nothing to install.

How do I generate PDFs from HTML or URLs using an API?

  • POST your HTML to /api/v1/convert-html or a URL to /api/v1/convert with your API key
  • Poll /api/v1/status/{job_id} until ready
  • Download from /api/v1/download/{job_id}

Both flows are shown step-by-step above.

How fast is the HTML to PDF conversion?

Most conversions complete in under 5 seconds. Complex pages with heavy JavaScript may take slightly longer.

Does it support JavaScript rendering?

Yes. We use Chromium for rendering, so JavaScript-heavy pages, SPAs, and dynamic content are fully supported.

Can I convert multiple URLs at once?

Yes. Our batch endpoint supports up to 50 URLs per request, all processed in parallel.

What file formats are supported?

We convert HTML, URLs, and raw HTML content to PDF. Output is always high-quality PDF.

Is there a free tier?

Yes. You get 25 free credits per month. Each conversion uses 1 credit.

Do I need to install anything?

No. It's a REST API — just make HTTP requests. No SDK required, though we have one for convenience.

Start Converting HTML to PDF Today

Free tier with 25 credits. No credit card required.

Try it free — no card needed