Skip to content

A simple Express server designed to return a PDF either via an URL or an HTML Body using Puppeteer

License

Notifications You must be signed in to change notification settings

elavrom/puppeteer-standalone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Puppeteer as a Service (PPTaaS)

A simple Express server designed to return a PDF either via an URL or an HTML Body using Puppeteer.

Install and run

Build and run the Docker via :

docker build -t pptaas .
docker run --name pptaas -p 8080:8080 pptaas 

Precautions regarding Puppeteer

Puppeteer is running on noSandbox mode, so it assumes the URL or any content in your HTML is SAFE. As it is said on Puppeteer's README :

If you absolutely trust the content you open in Chrome, you can launch Chrome with the --no-sandbox argument:

Usage

The service is listening on port 8080, and waiting for a POST request. You have two options :

Public URL

If the page you want to print is publicly accessible, use its URL :

http://localhost:8080?url=<The URL you want to print as a PDF>

HTML Body

If your HTML is not public, you may want to upload your HTML content directly in the request body. Don't forget to mention the header Content-Type: text/html[ charset=utf-8] or else it won't work.

About

A simple Express server designed to return a PDF either via an URL or an HTML Body using Puppeteer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published