3.0.2 • Published 6 months ago

puppet-show v3.0.2

Weekly downloads
7
License
MIT
Repository
github
Last release
6 months ago

Puppet Show Docker

Leverages the Puppeteer library to expose Chromium print-to-pdf and screenshot over a service

Screenshot



Overview

Use this web service to programatically convert web pages to PDF or image. For example, create a cron job that uses the service to generate a daily report PDF from a web page and then email it. The HTML form allows you to easily build your request for embedding in an application. This service should only be installed internally on an intranet and not exposed to the Internet as it can be easily abused and would be a high security risk (For example using a file:// protocol in the URL exposes local files).

Quick Start with Compose

  1. Grab project
git clone https://github.com/jeffersonlab/puppet-show
cd puppet-show
  1. Launch Compose
docker compose up
  1. Launch web browser
http://localhost:3000/puppet-show

Note: Container requires privileged mode in order to launch Chrome in a sandbox.

Install

npm i puppet-show
npm start

Note: This application runs on the Node.js JavaScript runtime, which can be downloaded here.

API

The URL parameter names for the web service end point puppet-show/pdf and puppet-show/screenshot mirror the option names for the puppeteer print-to-pdf and screenshot functions found here. The puppet-show web forms can also be used to explore the API.

Note: The default values match the puppeteer defaults and the only required parameter is "url".

Configure

export PORT=3000
npm start

Note: Use the appropriate set environment variable command for your shell; Bash shell shown above. For C Shell use "setenv PORT 3000", and for Windows use "set PORT 3000".

See Also

3.0.2

6 months ago

2.1.1

3 years ago

2.1.0

3 years ago

2.0.0

5 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago

0.5.0

7 years ago

0.4.0

7 years ago

0.3.0

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago