********* INSTALL ***********
Requires Node.js LTS Version

1. Configure config.json

2. Run in cmd:

    npm install
    node windows-service.js

if npm install is blocked by a firewall, run it on a different pc with the same Node.js version and copy the node_modules folder

********* UPDATING AN INSTALLATION ***********

1. Stop and delete the windows service (administrator cmd -> sc delete <<ServiceName>>)
2. Make a copy of the config.json
3. Delete the folder containing this application
4. Make a fresh install as described above and merge your old configs in the new config file if necessary

********* USAGE *********

example: http://localhost:3000/?url=https%3A%2F%2Fwww.google.com&format=A4&landscape=true
(should work after installation if google is reachable and not blocked by a firewall)

service parameters:

url: string
format: string (A4, A3, etc) optional
landscape: boolean optional
width: string (10px) optional
height: string (10px) optional
marginBottom: string (10px) optional
marginLeft: string (10px) optional
marginRight: string (10px) optional
marginTop: string (10px) optional
windowStatus: string (javascript variable on window.status, indicating that the page is ready for print, if used the windowStatus must be set by the site to be printed, e.g., window.status = 'ready_for_print') optional
addAttachementHeader: boolean optional
image: boolean optional
deviceScaleFactor: number optional
useBodyHeight: boolean optional (overwrites height)

********* DEBUGGING *********
    stop windows service
    open command line as administrator -> move to folder containing pdf-service.js
    run next line in cmd:
    node pdf-service

********* CONFIG ************
port: The port where the service will run. The service is not able to start if the port is already used by another process.
windowsStatusTimeout: Time to wait until the window.status variable is set after the webpage has loaded (default 1min)
printOnWindowsStatusTimeout: If the timeout occures, the page will be printed in its current state (helps for debugging, e.g. you can see that some tile of a specific service are missing)
navigationTimeout: Time to wait until the webpage is loaded (default 30sec)
ignoreHTTPSErrors: If https certificate errors should be ignored or not
userAgent: A different user agent, e.g. the one from the normal Chrome browser can be used. Sometimes webpages block requests from the Headless Chrome used by this service.
referer: A custom referer header value can be set
args: A list of arguments can be passed to Chrome, e.g. the follwoing can help with connection issues: ["--proxy-server='direct://'", "--proxy-bypass-list=*"]

