Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/barchart/aws-lambda-pdf-generator/llms.txt

Use this file to discover all available pages before exploring further.

The AWS Lambda PDF Generator exposes a lightweight REST API deployed via AWS API Gateway. Every HTTP request is handled by an AWS Lambda function that loads Puppeteer and headless Chromium to convert HTML documents into binary PDF files. The API surface is intentionally minimal: one endpoint renders PDFs and a second returns service metadata. No built-in authentication is required to call the service within your own AWS account, though standard API Gateway security mechanisms can be layered on top at any time.

Base URL

All endpoints share the following base URL pattern:
https://{api-identifier}.execute-api.{region}.amazonaws.com/{stage}
PlaceholderDescription
{api-identifier}Unique identifier assigned by AWS when you deploy the stack
{region}AWS region where the service is deployed; defaults to us-east-1
{stage}Deployment stage name; either stage or prod

Endpoints

POST /print

Generate a PDF from an HTML document

GET /service/version

Read service metadata and version

Authentication

The PDF Generator does not ship with built-in authentication. By default, the endpoint deployed to AWS API Gateway is publicly accessible to anyone who knows the URL. AWS API Gateway natively supports several security mechanisms that can be configured independently of this service:
  • IAM authorization — restrict access to callers with valid AWS credentials and the correct IAM policy.
  • API keys — issue API keys through API Gateway and require them on every request.
  • Custom authorizers (Lambda authorizers) — attach a Lambda function that validates tokens or other credentials before the request reaches the print handler.
Refer to the AWS API Gateway documentation for guidance on enabling any of these options after deployment.

Content Types

DirectionContent-Type
Request bodyapplication/json
Successful responseapplication/pdf (binary)
Error responseapplication/json

Error Format

When a request cannot be fulfilled, the API returns an application/json array. Each element contains a value object with a machine-readable code and a human-readable message, plus a children array reserved for nested error detail:
[
  {
    "value": {
      "code": "PRINT_FAILED_HTML_MISSING",
      "message": "Failed to print PDF, no HTML document provided."
    },
    "children": []
  }
]
The code field is the authoritative identifier for the error condition and is safe to use in programmatic error handling. See Request Body and Responses for full schema details.

Build docs developers (and LLMs) love