Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stopsopa/docker-puppeteer-pdf-generator
Microservice tool to generate pdf from any url/page
https://github.com/stopsopa/docker-puppeteer-pdf-generator
chromium docker google-chrome microservice node-js nodejs pdf pdf-generation puppeteer
Last synced: 11 days ago
JSON representation
Microservice tool to generate pdf from any url/page
- Host: GitHub
- URL: https://github.com/stopsopa/docker-puppeteer-pdf-generator
- Owner: stopsopa
- License: mit
- Created: 2018-05-18T21:56:32.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-09-01T23:36:52.000Z (over 1 year ago)
- Last Synced: 2024-10-25T20:23:04.107Z (about 2 months ago)
- Topics: chromium, docker, google-chrome, microservice, node-js, nodejs, pdf, pdf-generation, puppeteer
- Language: JavaScript
- Homepage: https://stopsopa.github.io/docker-puppeteer-pdf-generator/example.html
- Size: 1.29 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# DEPRECATED
Created in 2018 - quite old now and not maintained.I wouldn't suggest using it. I'm sure there are better solutions today.
# Versions:
In this repository there are two versions available. One with Google Chrome another with Chromium.
For more information see [releases](https://github.com/stopsopa/docker-puppeteer-pdf-generator/releases)I had to have Google Chrome because footerTemplate and headerTemplate options of command page.pdf(options) didn't worked in chromium. see
[page.pdf(options) doc page](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagepdfoptions)# Installation:
git clone this repository and go to main directory
yarn
make build
cp config.js.dist config.js
# manually change password in config.js for basic auth
node server.js --port 7777
# Using:
Just visit:http://localhost:7777/generate
# cli tool:
/bin/bash pdf.sh "https://www.google.com/search?ncr=&q=puppeteer"
/bin/bash pdf.sh "https://www.google.com/search?ncr=&q=puppeteer" pdf.pdf
# Current execution environment:- node v8.9.4
- yarn
- Docker version 18.03.1-ce, build 9ee9f40
# Puppeteer in Docker:
[Running puppeteer in Docker](https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md#running-puppeteer-in-docker)
# Ping:
http://xx.xx.xx.xx:7777/pdf-generator-check
http://slowwly.robertomurray.co.uk/delay/32000/url/https://github.com/stopsopa/docker-puppeteer-pdf-generator
# Useful things:
docker run -it --rm puppeteer-alpine-generate-pdf /usr/bin/chromium-browser --version
$ Chromium 64.0.3282.168
or if you follow node:8-slim : https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md#running-puppeteer-in-docker
docker run -it --rm --cap-add=SYS_ADMIN --rm slootsantos/puppeteer-chrome-linux /usr/bin/google-chrome-unstable --version
Google Chrome 68.0.3438.3 dev
on mac:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --version
$ Google Chrome 66.0.3359.181
/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary --version
$ Google Chrome 69.0.3445.0 canary
# Dev notes:
I've build this "on top" of docker not "in" docker which mean that I have instance of node server an this server creates on demand container with puppeteer to generate one pdf and kill this container because there is chance that this approach will make entire solution more stable.
And this server was ment to build as fast as possible to do its job. Main priority was to build it fast and make it work and it's seems to work so far.