Generate PDF documents from HTML and CSS with a simple REST API
Our Services
HTML to PDF (WeasyPrint)
PDF/A and PDF/UA compliant. Recommended for commercial and accessible documents. CSS-based layout engine.
HTML to PDF (wkhtmltopdf)
Lightweight and fast. Full JavaScript support for dynamic content. Great for screen-capture style PDFs.
PDF/A & PDF/UA Compliance
European Accessibility Act ready. Generate archival and universally accessible PDF documents from HTML.
PDF Utilities
Merge, split, overlay text, and convert PDF pages to images. All via simple REST API calls.
See It in Action
# First, get an access token using your client credentials
ACCESS_TOKEN=$(curl -s -X POST https://login.pdfbroker.io/connect/token \
-d "grant_type=client_credentials&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET" \
| jq -r '.access_token')
# Then, generate a PDF from HTML using WeasyPrint (PDF/A & PDF/UA compliant)
HTML_BASE64=$(echo '<h1>Hello World</h1><p>Generated with PdfBroker.io</p>' | base64)
curl -X POST https://api.pdfbroker.io/api/pdf/weasyprint \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"htmlBase64String\": \"$HTML_BASE64\"}" \
--output document.pdf
// Install: dotnet add package PdfBroker.Client
using PdfBroker.Client;
// Authenticates automatically using OAuth2 client credentials
var client = new PdfBrokerClientService("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET");
var html = "<h1>Hello World</h1><p>Generated with PdfBroker.io</p>";
var htmlBase64 = Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(html));
// Generate a PDF/A and PDF/UA compliant PDF using WeasyPrint
byte[] pdf = await client.WeasyPrintAsByteArrayAsync(
new { htmlBase64String = htmlBase64 });
await File.WriteAllBytesAsync("document.pdf", pdf);
import base64, requests
# Step 1: Get an access token using client credentials
token_resp = requests.post("https://login.pdfbroker.io/connect/token", data={
"grant_type": "client_credentials",
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET",
})
access_token = token_resp.json()["access_token"]
# Step 2: Generate a PDF/A & PDF/UA compliant PDF using WeasyPrint
html = "<h1>Hello World</h1><p>Generated with PdfBroker.io</p>"
resp = requests.post(
"https://api.pdfbroker.io/api/pdf/weasyprint",
headers={"Authorization": f"Bearer {access_token}"},
json={"htmlBase64String": base64.b64encode(html.encode()).decode()},
)
with open("document.pdf", "wb") as f:
f.write(resp.content)
How It Works
Sign Up
Create your free account and get your API credentials. No credit card required.
Call the API
Send your HTML to the REST API and receive a PDF document in response. It's that simple.
Already using XSL-FO? We've got you covered
PdfBroker.io supports XSL-FO to PDF rendering, including XSLT transformation. If your workflow relies on XSL-FO, you can use our API without changing your templates.
Explore XSL-FO DocumentationPricing
Developer
- wkhtmltopdf HTML to PDF
- PDF Utilities (merge, split, overlay)
- WeasyPrint HTML to PDF
- PDF/A & PDF/UA Compliance
Basic
- wkhtmltopdf HTML to PDF
- PDF Utilities (merge, split, overlay)
- WeasyPrint HTML to PDF
- PDF/A & PDF/UA Compliance
Professional
- wkhtmltopdf HTML to PDF
- PDF Utilities (merge, split, overlay)
- WeasyPrint HTML to PDF
- PDF/A & PDF/UA Compliance
Enterprise
- wkhtmltopdf HTML to PDF
- PDF Utilities (merge, split, overlay)
- WeasyPrint HTML to PDF
- PDF/A & PDF/UA Compliance
HTML Premium services (WeasyPrint with PDF/A and PDF/UA) require Basic plan or above.
View all plans & details