JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q23253F
  • License MIT

Print-to-PDF and Screenshot web service

Package Exports

  • puppet-show
  • puppet-show/bin/www

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (puppet-show) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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