Generate PDF API

Generate a PDF from a web page and upload it to S3.

Overview

This endpoint launches a headless browser, navigates to your URL, renders the page, and returns a public S3 URL to the generated PDF.

Endpoint

  • Method: GET
  • Path: /api/generate-pdf
  • Parameters:
    • url (required): Full URL to render (e.g., https://example.com/orders/12345).
    • filename (required): Output filename (with or without .pdf). Example: AUDLA_ABC_REF001.
    • bucket (optional): S3 bucket name. Defaults to audla.
    • key (optional): S3 key/path prefix. Example: pdfs/2025/01/. Defaults to pdfs/.
    • page-format (optional): One of Letter, Legal, Tabloid, Ledger, A0A6. Default: Letter.
GET https://apis.audla.ca/api/generate-pdf?url=https://example.com/orders/123&filename=AUDLA_ABC_REF001&bucket=audla&key=pdfs/&page-format=A4

{
  "success": true,
  "url": "https://audla.s3.amazonaws.com/pdfs/AUDLA_ABC_REF001.pdf",
  "filename": "AUDLA_ABC_REF001.pdf"
}

Was this page helpful?