https://github.com/rossjcooper/node-pdf
Creates a Node server that can export webpages to PDF using a URL or raw HTML passed to it
https://github.com/rossjcooper/node-pdf
export-webpages hacktoberfest node node-pdf pdf
Last synced: about 2 months ago
JSON representation
Creates a Node server that can export webpages to PDF using a URL or raw HTML passed to it
- Host: GitHub
- URL: https://github.com/rossjcooper/node-pdf
- Owner: rossjcooper
- Created: 2019-08-12T07:59:41.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-11T01:39:20.000Z (over 3 years ago)
- Last Synced: 2023-06-04T10:25:13.900Z (about 3 years ago)
- Topics: export-webpages, hacktoberfest, node, node-pdf, pdf
- Language: JavaScript
- Homepage:
- Size: 117 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Node PDF Export Server
This project creates a Node server that can export webpages to PDF using a URL or raw HTML passed to it.
## Quick Start Docker
```
$ docker pull rossjcooper/node-pdf
$ docker run -p 3000:3000 -it --rm rossjcooper/node-pdf
```
https://hub.docker.com/r/rossjcooper/node-pdf
## Quick Start Node
```
$ npm install
$ npm run start
```
## PDF from URL
Make a request to `http://localhost:3000/export/pdf?url=#urlHere#`
## PDF from HTML
Make a POST request to `http://localhost:3000/export/pdf` with JSON body:
```json
{
"html": "
Test
"
}
```
## PDF Page Options
### Page Footer
You can set the footer HTML by passing it through the URL query parameter `?footer_html=Example Footer`
### Page Numbers
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
### Build docker image locally from source
```
docker build -t node-pdf .
```
### Running local docker image
```
docker run --name node-pdf -p 3000:3000 -it --rm node-pdf
```