Get support for mnapoli/serverless-pdf-generator

If you're new to LTH, please see our FAQ for more information on what it is we do.

Support Options

Unfortunately, there are currently no active helpers for this repository on the platform. Until they become available, we reccomend the following actions:

View Open Issues

Take a look to see if anyone else has experienced the same issue as you and if they managed to solve it.

Open an Issue

Make sure to read any relevant guidelines for opening issues on this repo before posting a new issue.

Sponsor directly

Check out the page and see if there are any options to sponsor this project or it's developers directly.

mnapoli/serverless-pdf-generator

PDF generator built as a serverless application.

Runs on AWS Lambda, built with the Serverless Framework and Lift.

Why?

This is a small application that turns web pages into PDF.

  • Turns HTML pages to PDF using Chrome Headless and Puppeteer
  • Runs on AWS Lambda: extremely cheap, deploys in 1 minute, scales automatically
  • Generated PDFs are cached in AWS S3 to be served faster

This allows to generate PDF files by simply implementing web pages in your application.

Clear and simple API for your application:

https://123456.execute-api.us-east-1.amazonaws.com/pdf?url=<URL to export>

Demo

Try the live demo:

https://7f3oaopd3c.execute-api.us-east-1.amazonaws.com/pdf?url=https://bref.sh/docs/

☝️ the link above will export the bref.sh/docs/ page into a PDF.

Feel free to change the URL to export. However, the demo only allows generating PDF from the bref.sh domain.

Deployment

The URL of the deployed application should display in the terminal.

Usage

Call the application's URL and append the ?url= query parameter with the URL of the page you wish to export.

For example:

https://123456.execute-api.us-east-1.amazonaws.com/pdf?url=https://mywebsite.com/

The exported PDF will be returned.

Force regeneration

PDF are generated on the first HTTP call and cached into S3. That makes subsequent responses much faster.

To force regenerating the PDF (for example if the web page has changed), add the force=1 query parameter to the URL.

Configuration

Change the DOMAIN_WHITELIST environment variable to set the whitelisted domains.

Indeed, to avoid abuse, the application will only generate PDFs from pre-approved domain names.

Our Mission

We want to make open source more sustainable. The entire platform was born from this and everything we do is in aid of this.

Interesting Articles

Thank you for checking out LiveTechHelper |
2025 © lth-dev incorporated

p-e622a1a2