PDFEngine API
API Documentation
Complete reference for HTML-to-PDF conversion, template rendering, and PDF operations. Includes code examples in 8 languages and an interactive testing playground.
v1Stable
Getting Started
Quickstart Guide
1
Get API Key
Sign up and get your key from the dashboard
2
Make Request
Send HTML or template data to the API
3
Get PDF
Receive your PDF in the response
Quick Example
cURL
curl -X POST "https://api.pdfengine.io/v1/api/v1/convert" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"source": "<h1>Hello World</h1>", "format": "A4"}' \
--output hello.pdfAPI Playground
Test endpoints directly in your browser
Your key is never stored. Get yours from the dashboard.
POST
PDF Conversion
1 endpointPDF Operations
6 endpointsTemplates
3 endpointsUsage & Billing
1 endpointDeveloper Tools
SDKs & Libraries
While we provide a REST API that works with any HTTP client, here are recommended libraries for each language:
JavaScript
axios / fetch
npm install axiosPython
requests
pip install requestsGo
net/http
built-inRuby
net/http
built-inPHP
cURL / Guzzle
composer require guzzlehttp/guzzleJava
HttpClient
Java 11+ built-inC#
HttpClient
.NET built-inRust
reqwest
cargo add reqwestTroubleshooting
Error Handling
HTTP Status Codes
200Success201Created400Bad Request - Invalid input401Unauthorized - Invalid API key403Forbidden - Insufficient permissions404Not Found429Rate Limited / Quota Exceeded500Server ErrorError Response Format
JSON
{
"error": "Invalid PDF: File does not have a valid PDF header",
"code": "INVALID_PDF_HEADER"
}
// Validation errors include details:
{
"error": "Validation failed",
"details": [
{
"path": ["source"],
"message": "Required"
}
]
}Common Error Codes
INVALID_PDF_HEADERFile is not a valid PDFFILE_TOO_LARGEPDF exceeds size limitRATE_LIMIT_EXCEEDEDToo many requests per minuteQUOTA_EXCEEDEDMonthly conversion/operation limit reachedINVALID_BASE64Base64 encoding is invalidPDF_ENCRYPTEDCannot process password-protected PDF