Features Pricing Docs API Log in Get Started Free
Now in public beta

Generate Beautiful
PDFs & Images
from HTML

Production-ready API for invoices, reports, certificates, OG images, and more. From HTML to pixel-perfect documents in milliseconds.

No credit card required. Free forever.

0ms
Avg render time
0%
Uptime SLA
0 endpoints
REST API
terminal
# Generate a PDF from HTML
curl -X POST https://api.docforge.dev/v1/pdf/from-html \
  -H "Authorization: Bearer df_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "html": "<h1>Invoice #1042</h1>",
    "css": "h1 { color: #1a1a2e; }",
    "format": "A4",
    "margin": "20mm"
  }' \
  -o invoice.pdf
Response 200 OK • 94ms
{
  "status": "success",
  "pages": 1,
  "size": "24.3 KB",
  "render_time": "94ms"
}
Developer Experience

Simple API, Powerful Output

Integrate DocForge in minutes with your favorite language. Clean, intuitive endpoints.

curl -X POST https://api.docforge.dev/v1/pdf/from-html \
  -H "Authorization: Bearer df_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "html": "<!DOCTYPE html><html><body><div class=\"invoice\"><h1>Invoice #1042</h1><p>Amount: $2,500.00</p><table><tr><td>Web Development</td><td>$2,500.00</td></tr></table></div></body></html>",
    "css": ".invoice { font-family: Inter; padding: 40px; } h1 { color: #1a1a2e; }",
    "format": "A4",
    "margin": "20mm",
    "printBackground": true
  }' \
  --output invoice.pdf

# Response: 200 OK (94ms) - PDF saved to invoice.pdf
const response = await fetch('https://api.docforge.dev/v1/pdf/from-html', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${process.env.DOCFORGE_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    html: `
      <div class="invoice">
        <h1>Invoice #1042</h1>
        <p>Amount: $2,500.00</p>
        <table>
          <tr><td>Web Development</td><td>$2,500.00</td></tr>
        </table>
      </div>`,
    css: '.invoice { font-family: Inter; padding: 40px; }',
    format: 'A4',
    margin: '20mm',
  }),
});

const pdf = await response.arrayBuffer();
fs.writeFileSync('invoice.pdf', Buffer.from(pdf));
import requests
import os

response = requests.post(
    "https://api.docforge.dev/v1/pdf/from-html",
    headers={
        "Authorization": f"Bearer {os.environ['DOCFORGE_API_KEY']}",
        "Content-Type": "application/json",
    },
    json={
        "html": """
            <div class="invoice">
                <h1>Invoice #1042</h1>
                <p>Amount: $2,500.00</p>
                <table>
                    <tr><td>Web Development</td><td>$2,500.00</td></tr>
                </table>
            </div>
        """,
        "css": ".invoice { font-family: Inter; padding: 40px; }",
        "format": "A4",
        "margin": "20mm",
    },
)

with open("invoice.pdf", "wb") as f:
    f.write(response.content)
package main

import (
    "bytes"
    "encoding/json"
    "net/http"
    "os"
)

func main() {
    payload, _ := json.Marshal(map[string]interface{}{
        "html":   `<div class="invoice"><h1>Invoice #1042</h1></div>`,
        "css":    ".invoice { font-family: Inter; padding: 40px; }",
        "format": "A4",
        "margin": "20mm",
    })

    req, _ := http.NewRequest("POST",
        "https://api.docforge.dev/v1/pdf/from-html",
        bytes.NewBuffer(payload))

    req.Header.Set("Authorization", "Bearer "+os.Getenv("DOCFORGE_API_KEY"))
    req.Header.Set("Content-Type", "application/json")

    resp, _ := http.DefaultClient.Do(req)
    defer resp.Body.Close()

    out, _ := os.Create("invoice.pdf")
    io.Copy(out, resp.Body)
}
<?php

$ch = curl_init('https://api.docforge.dev/v1/pdf/from-html');

curl_setopt_array($ch, [
    CURLOPT_POST           => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => [
        'Authorization: Bearer ' . getenv('DOCFORGE_API_KEY'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode([
        'html'   => '<div class="invoice">
            <h1>Invoice #1042</h1>
            <p>Amount: $2,500.00</p>
        </div>',
        'css'    => '.invoice { font-family: Inter; padding: 40px; }',
        'format' => 'A4',
        'margin' => '20mm',
    ]),
]);

$pdf = curl_exec($ch);
curl_close($ch);

file_put_contents('invoice.pdf', $pdf);
?>
Features

Everything you need to generate documents

Six powerful endpoints covering every document generation use case. Built for developers, designed for production.

HTML to PDF

Convert any HTML and CSS to pixel-perfect PDF documents. Full support for web fonts, flexbox, grid, and modern CSS.

HTML to Image

Generate PNG, JPEG, or WebP images from HTML templates. Perfect for social cards, thumbnails, and dynamic graphics.

URL to PDF/Image

Capture any live webpage as a PDF or screenshot. Set custom viewports, wait for JS execution, and handle authentication.

Template Engine

Create reusable templates with {{variable}} interpolation. Store templates server-side and render with dynamic data.

Custom Styling

Inject custom CSS, execute JavaScript before capture, set viewports, and control every aspect of the rendering pipeline.

Lightning Fast

Sub-second rendering powered by optimized Chromium headless instances. Average response time under 100ms for simple documents.

How It Works

Three steps to perfect documents

No SDKs to install. No complex configuration. Just a simple REST API call.

1

Send HTML

POST your HTML and CSS to our API endpoint. Include any styling, scripts, or template variables.

2

We Render

Our Chromium-powered engine renders your content with pixel-perfect accuracy in under 100ms.

3

Get Document

Receive your PDF or image in the response body. Stream it, save it, or serve it directly to users.

Use Cases

Built for real-world applications

From invoices to social cards, DocForge handles every document generation scenario.

🗃

Invoices & Receipts

Generate branded invoices with dynamic line items, tax calculations, and professional layouts.

📊

Reports & Dashboards

Create data-rich PDF reports with charts, tables, and visualizations from your analytics data.

🏅

Certificates & Diplomas

Issue personalized certificates with custom designs, signatures, and verification codes.

🎨

OG Social Cards

Dynamically generate Open Graph images for blog posts, products, and social media sharing.

📣

Marketing Materials

Produce flyers, brochures, and promotional materials with pixel-perfect brand consistency.

📜

Legal Documents

Generate contracts, agreements, and compliance documents with proper formatting and pagination.

🗃

Invoices & Receipts

Generate branded invoices with dynamic line items, tax calculations, and professional layouts.

📊

Reports & Dashboards

Create data-rich PDF reports with charts, tables, and visualizations from your analytics data.

🏅

Certificates & Diplomas

Issue personalized certificates with custom designs, signatures, and verification codes.

🞐

OG Social Cards

Dynamically generate Open Graph images for blog posts, products, and social media sharing.

📣

Marketing Materials

Produce flyers, brochures, and promotional materials with pixel-perfect brand consistency.

📜

Legal Documents

Generate contracts, agreements, and compliance documents with proper formatting and pagination.

Pricing

Simple, transparent pricing

Start free. Scale as you grow. No hidden fees, no surprises.

Monthly
Annual Save 17%
Free
$ 0 /month
100 renders per month
  • HTML to PDF rendering
  • HTML to Image (PNG)
  • Community support
  • API documentation
Get Started
Starter
$ 19 /month
2,000 renders per month
  • Everything in Free
  • PDF + Image generation
  • Custom CSS & JavaScript
  • Email support
Subscribe
Business
$ 149 /month
50,000 renders per month
  • Everything in Pro
  • All endpoints & features
  • 99.9% uptime SLA
  • Dedicated support
  • Custom integrations
Contact Us
Comparison

See how DocForge compares

We built DocForge to be faster, simpler, and more affordable than the competition.

Feature DocForge CraftMyPDF PDFShift Browserless
Starting Price Free / $19/mo $49/mo $9/mo $200/mo
Avg Render Speed ~100ms ~500ms ~300ms ~200ms
Template Engine Yes Yes No No
Image Generation PNG, JPEG, WebP PNG, JPEG No PNG, JPEG
Custom CSS/JS Full support CSS only CSS only Full support
Free Tier 100 renders/mo No 50 renders/mo No
URL Capture Yes No Yes Yes
FAQ

Frequently asked questions

Everything you need to know about DocForge. Can't find an answer? Contact our team.

DocForge supports PDF output for document generation, plus PNG, JPEG, and WebP for image generation. PDFs support A4, Letter, Legal, and custom page sizes with configurable margins, headers, and footers. Images can be generated at any resolution with custom viewports.
Upload your HTML templates with {{variable}} placeholders. When generating a document, pass a JSON object with your variable values and DocForge handles the interpolation. Templates support conditionals, loops, and nested objects. Store unlimited templates on our servers for instant rendering.
Absolutely. DocForge uses a full Chromium headless browser for rendering, which means complete JavaScript execution support. You can inject custom scripts, wait for specific elements to load, set timeouts, and even use popular charting libraries like Chart.js or D3. Use the waitForSelector parameter to ensure dynamic content is fully rendered before capture.
Rate limits depend on your plan. Free: 10 requests/minute. Starter: 60/min. Pro: 200/min. Business: 1,000/min. If you need higher limits, contact us for a custom enterprise plan. All rate limits are per API key, and we return clear headers showing your remaining quota.
Yes. You can use Google Fonts by including the standard <link> tag in your HTML. For custom fonts, include them as base64-encoded @font-face rules in your CSS, or upload them to our CDN for persistent use across all your renders.
We are working on a self-hosted Docker image for enterprise customers who need to keep data on-premise. This will be available as part of our Enterprise plan. Contact our sales team for early access and to discuss your infrastructure requirements.

Start generating documents
in 30 seconds

No setup required. Get your API key and start rendering immediately.

Get Started Free — 100 renders/mo

Free plan includes 100 renders per month. No credit card required.