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.pdf

API Playground

Test endpoints directly in your browser

Your key is never stored. Get yours from the dashboard.

POST

PDF Conversion

1 endpoint

PDF Operations

6 endpoints

Templates

3 endpoints

Usage & Billing

1 endpoint

Developer 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 axios

Python

requests

pip install requests

Go

net/http

built-in

Ruby

net/http

built-in

PHP

cURL / Guzzle

composer require guzzlehttp/guzzle

Java

HttpClient

Java 11+ built-in

C#

HttpClient

.NET built-in

Rust

reqwest

cargo add reqwest

Troubleshooting

Error Handling

HTTP Status Codes

200Success
201Created
400Bad Request - Invalid input
401Unauthorized - Invalid API key
403Forbidden - Insufficient permissions
404Not Found
429Rate Limited / Quota Exceeded
500Server Error

Error 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 PDF
FILE_TOO_LARGEPDF exceeds size limit
RATE_LIMIT_EXCEEDEDToo many requests per minute
QUOTA_EXCEEDEDMonthly conversion/operation limit reached
INVALID_BASE64Base64 encoding is invalid
PDF_ENCRYPTEDCannot process password-protected PDF