This app is a PDF generator, its purpose is to convert web pages to documents. Here you will find sources, Dockerfile and Google Cloud Build configuration files. It uses Puppeteer, check out these instructions to learn more.
- Here you'll have two choices run on our docker environment or on your local one.
- By default, it runs on
localhost:8080/?url=<page_url>[&api=<api_key>]
.
- Node.js (at least version 14.x): latest
- nodemon (optional): npm install -g nodemon
- ts-node: npm install -g ts-node typescript
- Here you have to clone this repo then you can run:
npm install
- Then you can add your API key as
API_KEY
environment variable.
- If you chosed to install
nodemon
you can run the watch via:npm run dev
- Else you can start without the watch via:
npm start
- Docker: windows-mac, linux
- To build the docker image run the file:
docker.build.sh
.
- You can start the watch by running the file:
docker.run.sh [api-key]
.
The code pushed on this repo is continously deployed to App Engine.
master
is the production branch. What you push there is built and sent live here.
Any other branch or pull request will be automatically deployed too. Check out Google Cloud Build to learn more.
You can deploy manualy this app using the Cloud SDK by running this command:
gcloud builds submit --config cloudbuild.manual.yaml .
You can customize the pdf setting by using those query parms:
title
: the document title,format
: the document format,scale
: the scale to witch is rendered the page,margin.top
: the top margin,margin.left
: the left marging,margin.bottom
: the bottom margin,margin.right
: the right margin,async
: set to true to wait page data's
They're discribed on the Puppeteer API doc