Introduction to html4pdf
html4pdf is a privacy-first, stateless PDF generation API designed for developers working with sensitive data. Our zero-storage architecture ensures your documents never touch our servers after generation.
Why html4pdf?
Zero Storage Architecture
Your PDFs are generated in memory and immediately discarded. No storage means no breach risk—perfect for GDPR, HIPAA, and SOC2 compliance.
Built for Sensitive Data
Designed specifically for Finance, Legal, Healthcare, and Security teams who need compliant document generation without compromise.
Simple Integration
One API endpoint. Three input methods. Multiple response formats. Get started in minutes.
Key Features
- HTML to PDF: Convert raw HTML with CSS to professional PDFs
- URL to PDF: Transform any public webpage into a PDF document
- Template System: Use pre-built templates for invoices, receipts, and contracts
- Binary & Base64: Choose your response format
- Webhook Support: Async delivery for complex operations
- Fast Processing: 3-5 seconds average generation time
Quick Example
const response = await fetch('https://api.html4pdf.com/generate-pdf', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
html: '<h1>Hello World</h1>',
responseFormat: 'base64'
})
});
const data = await response.json();
console.log(data.pdf); // Base64-encoded PDFGetting Started
- Sign up and get your API key (10 free credits)
- Read the Quickstart Guide
- Explore the API Reference
- Check out Code Examples
Credit System
- HTML Sync: 1 credit per PDF
- HTML Webhook: 2 credits per PDF
- URL Conversion: 2 credits per PDF (always webhook)
- Templates: Same as HTML (1 sync, 2 webhook)
Credits never expire. Pay only for what you use.
Support
- Documentation: You're reading it
- Dashboard: html4pdf.com/dashboard
- Issues: Check your API logs in the dashboard
Ready to get started? Head to the Quickstart Guide.