PDF Generator API

Easily generate PDFs from HTML content with our simple API.

Overview

The PDF Generator API allows you to create PDF documents from HTML content. Use it to generate reports, invoices, or any other documents you need in PDF format.

Endpoint

POST /api/generate-pdf

Request

Send a JSON payload with the following structure:

{
  "encodedHtml": "

Hello, PDF!

", "options": { "format": "A4", "printBackground": true }, "filename": "document.pdf" }

Required Fields:

Optional Fields:

Response

On success, the API returns a binary PDF file. The Content-Type is set to application/pdf. Example response:

HTTP/1.1 200 OK
Content-Type: application/pdf
Content-Disposition: attachment; filename="document.pdf"

(Binary PDF Content)

Try It

You can use tools like Postman or ReqBin to test the API.