Convert HTML, webpages, and URLs to pixel-perfect PDFs. Full CSS & JavaScript support. Custom headers, footers, and page settings.
$0.02 per conversion • Full CSS/JS support • Custom page sizes
# Convert URL to PDF
curl -X POST "https://api.chargedapi.com/pdf/url-to-pdf" \
-H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com"}'
# Convert HTML string to PDF
curl -X POST "https://api.chargedapi.com/pdf/url-to-pdf" \
-H "X-API-Key: your_api_key" \
-d '{"html": "<h1>Hello World</h1>"}'
Convert any public webpage to PDF. Just pass the URL and get a perfect PDF rendering.
Pass raw HTML content directly. Perfect for invoices, reports, and dynamic documents.
Modern CSS including Flexbox, Grid, custom fonts, and print stylesheets fully supported.
Full JavaScript execution. Convert SPAs, charts, and dynamically rendered content.
A4, Letter, Legal, or custom dimensions. Set margins, orientation, and scale.
Add custom headers and footers with page numbers, dates, and logos.
Generate professional PDF invoices from HTML templates. Perfect for billing systems and e-commerce platforms.
Convert analytics dashboards and reports to shareable PDFs with charts and graphs intact.
Generate PDF receipts, tickets, and confirmations from your web application.
Archive web content as PDFs for compliance, legal records, or offline access.
import requests
response = requests.post(
"https://api.chargedapi.com/pdf/url-to-pdf",
headers={"X-API-Key": "your_api_key"},
json={
"url": "https://example.com",
"format": "A4",
"landscape": False
}
)
pdf_url = response.json()["download_url"]
const response = await fetch(
"https://api.chargedapi.com/pdf/url-to-pdf",
{
method: "POST",
headers: {
"X-API-Key": "your_api_key",
"Content-Type": "application/json"
},
body: JSON.stringify({
html: "<h1>Invoice #123</h1>"
})
}
);
const { download_url } = await response.json();
Pixel-perfect PDF generation from any HTML source. Try free today.
Get Your Free API Key