srv-to-pdf

1.0.0 • Public • Published

To PDF NPM version Build Status Dependency Status Coverage percentage

Microservice to convert HTML with embedded or served css to pdf using webkitToPDF

This accepts html files with embedded CSS and returns PDF documents utilizing the wkhtmltopdf command line tool.

Installation

There are two ways to install: as a module or a microserver.

1. As submodule

npm install --save srv-to-pdf

2. As microservice

git clone http://github.com/uci-soe/to-pdf
cd to-pdf
npm start

Dependancies

This module requires a locally installed version of wkhtmltopdf. I presently have

$ wkhtmltopdf --version
Name:
  wkhtmltopdf 0.10.0 rc2

License:
  Copyright (C) 2010 wkhtmltopdf/wkhtmltoimage Authors.

Running Microservice with PM2

PM2 is recommended. Here is an example pm2.json

{
  "name"        : "to-pdf",
  "script"      : "bin/www.js",
  "args"        : [],
  "watch"       : true,
  "node_args"   : "",
  "cwd"         : "/root/path/to/to-pdf",
  "env": {
    "NODE_ENV": "production",
    "PORT": "6000",
    "NODE_DEBUG": "",
    "CMD_PATH": "/path/to/bin/wkhtmltopdf"
  }
}

More pm2.json documentation available here

Usage

/* Add usage for submodule */
/* Add usage for microservice */

License

BSD-3-Clause - LICENSE

Package Sidebar

Install

npm i srv-to-pdf

Weekly Downloads

3

Version

1.0.0

License

BSD-3-Clause

Last publish

Collaborators

  • rhettl