Pay-per-use · No subscriptions

Server-Side PDF Generation for Any Backend

Node.js, Python, PHP, Ruby, Go — one REST API for all.

HTML2DocHub works with any server-side language. No browser binary installation. No Docker configuration. Just HTTP requests. Generate PDFs and images from HTML on any backend — serverless, containers, VMs — from ₹0.10/page.

Why developers choose HTML2DocHub

Works with any server-side language or framework
Serverless compatible — Lambda, Cloud Functions, Vercel
No binary dependencies on your server
Idempotency keys prevent billing duplicates on retries
Async mode for non-blocking large document generation
Per-job pages and charge for accounting and billing exports
Multiple API keys — one per service/environment
99.9% uptime SLA

Code Examples

PHPphp
<?php
$ch = curl_init("https://api.html2dochub.com/v1/render");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER => [
        "X-API-Key: sk_live_YOUR_KEY",
        "Content-Type: application/json",
    ],
    CURLOPT_POSTFIELDS => json_encode([
        "type" => "pdf",
        "html" => "<h1>Hello PHP</h1>",
        "options" => ["format" => "A4"],
    ]),
]);
$response = json_decode(curl_exec($ch), true);
echo $response["download_url"];
Rubyruby
require "net/http"
require "json"
require "uri"

uri = URI("https://api.html2dochub.com/v1/render")
req = Net::HTTP::Post.new(uri, {
  "Content-Type" => "application/json",
  "X-API-Key" => "sk_live_YOUR_KEY",
})
req.body = { type: "pdf", html: "<h1>Hello Ruby</h1>", options: { format: "A4" } }.to_json

resp = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |h| h.request(req) }
data = JSON.parse(resp.body)
puts data["download_url"]
Gogo
package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "io"
    "net/http"
)

func renderPDF(html string) (string, error) {
    body, _ := json.Marshal(map[string]any{
        "type":    "pdf",
        "html":    html,
        "options": map[string]any{"format": "A4"},
    })

    req, _ := http.NewRequest("POST", "https://api.html2dochub.com/v1/render", bytes.NewBuffer(body))
    req.Header.Set("X-API-Key", "sk_live_YOUR_KEY")
    req.Header.Set("Content-Type", "application/json")

    resp, err := http.DefaultClient.Do(req)
    if err != nil { return "", err }
    defer resp.Body.Close()

    var result map[string]any
    json.NewDecoder(resp.Body).Decode(&result)
    return result["download_url"].(string), nil
}

Simple, transparent pricing

Pay only for pages rendered. No subscriptions. No minimum monthly fee.

1 page PDF:~₹0.10
10 page PDF:~₹0.80
100 pages/day:~₹8/day
See full pricing details

Frequently Asked Questions

Does it work in serverless environments (AWS Lambda, Vercel)?+
Yes. HTML2DocHub is a REST API — there are zero binary dependencies. It works anywhere you can make an HTTPS request.
Is there an official SDK?+
REST API client libraries are planned. For now, any HTTP library works — it's a simple POST request.
Can I use it from frontend (browser) too?+
We recommend server-side usage only to keep your API key secret. Frontend requests should proxy through your backend.

Start rendering PDFs today

Free account. No credit card required. API ready in minutes.

Get your free API key