Self-hosted HTML → PDF

PaperAPI lets you render PDFs with a free, Docker-based wkhtmltopdf API.

PaperAPI is an open-source service that turns raw HTML into high-fidelity PDFs. Run it locally or on your own infrastructure, then send simple HTTP requests to render invoices, reports, or any HTML document.

Step 01 Send HTML

POST raw HTML or templates to the PaperAPI /v1/generate endpoint.

Step 02 We render

PaperAPI runs wkhtmltopdf in Docker with consistent fonts and settings.

Step 03 Receive PDF

Get a binary PDF response you can store, email, or stream to users.

API example

curl http://localhost:8086/v1/generate \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data '{
    "html": "<html><body><h1>Hello PaperAPI</h1></body></html>",
    "options": {
      "pageSize": "A4",
      "orientation": "portrait"
    }
  }' \
  --output invoice.pdf

This lightweight site is a quick guide to running the open-source PaperAPI service on your own infrastructure. Replace YOUR_API_KEY with the value you set for App__ApiKeys__0 in your .env file.

Why PaperAPI

PaperAPI is the simplest way to ship PDFs with wkhtmltopdf without managing binaries on every server. It is designed for teams who want a reliable renderer they can run themselves.

Docker-first

Run a single container with all fonts, dependencies, and wkhtmltopdf wired up.

Predictable output

Same configuration across environments means consistent PDF rendering.

Simple HTTP API

Generate PDFs with a single POST request using JSON payloads.

Self-hosting in 3 commands

Clone the repository, configure your environment, start the Docker container, and you are ready to render HTML to PDF on your own infrastructure.

git clone https://github.com/hajiparvaneh/paper-api
cd paper-api
cp .env.example .env
# edit .env and set App__ApiKeys__0 (and other required values)

docker compose up -d
Runs anywhere

Works on local machines, VPS providers, or Kubernetes clusters.

Open-source

Inspect the code, customize settings, and keep control of your stack.

Free to use

No license fees or subscriptions—just infrastructure costs.

PaperAPI is self-hosted

This light version of the site only introduces the Docker-based PaperAPI project and how to run it yourself. There is no hosted PDF generation or managed service here.