An open API service indexing awesome lists of open source software.

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

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
```