PigDF Logo

PigDF

Introduction

PigDF turns an HTML document into a PDF file through a single API endpoint: you send your HTML, you get back a PDF. This page covers the base URL, how to get an API key, and how to authenticate. For the full request options, the response format, and how to decode the PDF, see HTML to PDF.

Base URL

Every endpoint lives under /api/:

https://pigdf.com/api/

Getting an API key

  1. Create an account and verify your email to activate your free plan.
  2. Open your dashboard → API Keys.
  3. Click Generate new key and copy it. Every key starts with pigdf_.

Keep your key secret, since anyone who has it can make requests billed to your account.

Authentication

Send your API key as a Bearer token in the Authorization header on every request:

Authorization: Bearer pigdf_a1b2c3d4e5************************

Requests with a missing or invalid key, or from an account without an active subscription, are rejected.

Your first request

Send your HTML in the content field to POST /api/html-to-pdf. Replace pigdf_YOUR_API_KEY with your own key.

curl https://pigdf.com/api/html-to-pdf \
  -H "Authorization: Bearer pigdf_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"content": "<h1>Hello, PigDF</h1>"}'

Every response uses the same JSON envelope, and on success the PDF comes back base64-encoded in the content field, so you decode it before saving. The HTML to PDF reference covers the request fields, the response format, decoding, and every error code.