image2pdf
Helps make the generation of a PDF of multiple images easier
Installation
$ npm install [-g] image2pdf
Usage
If installed locally:
var imager =
If installed globally:
Options: -h, --help output usage information -V, --version output the version number -v, --verbose Increase verbosity -s, --silly Increase verbosity even more -d, --dir <dir> The directory from which to read the images -o, --output <file> The output pdf -q, --quiet Only log errors -t, --use-title <title> Specify the document title -d, --no-date Do not print date created -n, --name <name> Specify created by
Requirements
node.js >= v0.11.3
phantomjs
--harmony-generators
flag
API
- imager.buildTitle()
- imager.readfiles()
- imager.getHead()
- imager.createHTML()
- imager.genPDF()
- imager.htmlToPDF()
imager.buildTitle(opts:Object)
Builds the title HTML
imager.readfiles(opts:Object, cb:Function)
Reads the given opts.dir
imager.getHead(opts:Object, function(err,:Function)
Generates the HTML head
imager.createHTML(opts:Object, cb:Function)
Generates the actual HTML document
imager.genPDF(input:String, output:String, cb:Function)
Takes the given input and generates a PDF to output
imager.htmlToPDF(html:String, fp:String, cb:Function)
Takes the given html string and writes it as a PDF to fp