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.
There are two ways to install: as a module or a microserver.
npm install --save srv-to-pdf
git clone http://github.com/uci-soe/to-pdf
cd to-pdf
npm start
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.
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
/* Add usage for submodule */
/* Add usage for microservice */
BSD-3-Clause - LICENSE