1. Services
  2. PDF

HTML to PDF API

Print a web page or your own HTML to PDF. Use it for invoices, reports and saved copies of pages.

POST /v1/pdf5 creditsAbout $0.005

Try it

POST/v1/pdf
curl -X POST 'https://api.apifor.dev/v1/pdf?format=letter&response=json' \
  -H 'content-type: application/json' \
  -H 'x-api-key: YOUR_API_KEY' \
  -d '{"html":"<h1>Invoice 1042</h1><p>Total: $120.00</p>"}'

The default response is the PDF file. response=json returns base64, as below.

Example response · 200
{
  "success": true,
  "data": {
    "source": "html",
    "url": null,
    "final_url": null,
    "format": "letter",
    "landscape": false,
    "bytes": 18420,
    "pdf_base64": "JVBERi0xLjQKJdPr6eEKMSAwIG9iago8PC9U...",
    "created_at": "2026-11-28T15:53:40.902Z"
  }
}

A real response from our OpenAPI file, with long lists and strings shortened.

Endpoints and price

EndpointCreditsAbout
GET /v1/pdf5 credits$0.005
POST /v1/pdf5 credits$0.005

USD at Starter pack prices ($5 for 5,000 credits). Calls that fail before work starts are refunded.

Limits

  • HTML bodies up to 2 MB, PDFs up to 20 MB, 15 seconds to load.
  • A4, Letter or Legal, portrait or landscape.
  • Images and styles in your HTML must be on public hosts.
  • Nothing is stored.

Questions

Can I send raw HTML?

Yes. POST it with content-type text/html, or send JSON with an html or url field.

Can I use it from MCP?

The MCP tool makes the PDF and tells you its size. Download the file itself over REST.

Do you keep the PDF?

No. It is rendered for your request and not stored.

Other services