Skip to content

Creates a Node server that can export webpages to PDF using a URL or raw HTML passed to it

Notifications You must be signed in to change notification settings

rossjcooper/node-pdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

{
	"html": "<h1>Test</h1>"
}

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

About

Creates a Node server that can export webpages to PDF using a URL or raw HTML passed to it

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published