This project creates a Node server that can export webpages to PDF using a URL or raw HTML passed to it.
$ docker pull rossjcooper/node-pdf
$ docker run -p 3000:3000 -it --rm rossjcooper/node-pdf
https://hub.docker.com/r/rossjcooper/node-pdf
$ npm install
$ npm run start
Make a request to http://localhost:3000/export/pdf?url=#urlHere#
Make a POST request to http://localhost:3000/export/pdf
with JSON body:
{
"html": "<h1>Test</h1>"
}
You can set the footer HTML by passing it through the URL query parameter ?footer_html=Example Footer
You can show page numbers using the following URL query parameter ?show_page_numbers=true
.
Note: setting the footer_html
option will override the page numbers.
docker build -t node-pdf .
docker run --name node-pdf -p 3000:3000 -it --rm node-pdf