AWS Lambda PDF Generator is a fully serverless web service that converts HTML documents into PDF files on demand. Deploy it to your own AWS account using the Serverless framework — it provisions an API Gateway endpoint backed by a Lambda function running headless Chromium, so you get pixel-perfect PDFs without managing any infrastructure.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.
Quickstart
Make your first HTML-to-PDF request in minutes
Deploy to AWS
Step-by-step guide to deploying the service
API Reference
Explore endpoints, request parameters, and responses
Architecture
Understand how the service works under the hood
How It Works
Send an HTML string to the/print endpoint and receive a binary PDF file in response. The Lambda function spins up a headless Chromium instance, renders your HTML, and streams the resulting PDF back — all in a single HTTP round-trip.
Deploy the service
Clone the repository, install dependencies, and run
yarn deploy:prod to provision API Gateway and Lambda in your AWS account.POST your HTML
Send a JSON request body containing your HTML string to the
/print endpoint. Optionally include Puppeteer PDF options to control page size, margins, and more.Key Features
Puppeteer & Chromium
Renders HTML with full browser fidelity using headless Chromium v122 via Puppeteer v22.
Large PDF Support
Responses over the API Gateway limit are handled automatically via gzip compression or S3 redirect.
Configurable Output
Pass any Puppeteer
page.pdf() options — paper size, orientation, margins, background printing, and more.Lambda Layers
Chromium is packaged as a Lambda Layer for fast cold starts and clean separation from function code.