Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Generate a pdf from a directory of images...
JavaScript CSS
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
lib
tests
Gruntfile.js
README.md
package.json

README.md

image2pdf

Helps make the generation of a PDF of multiple images easier

Installation

$ npm install [-g] image2pdf

Usage

If installed locally:

var imager = require('image2pdf')

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 (takes precedence over verbose)
    -d, --dir <dir>          The directory from which to read the images
    -o, --output <file>      The output pdf
    -q, --quiet              Only log errors (takes precendence over silly and verbose)
    -t, --use-title <title>  Specify the document title
    -d, --no-date            Do not print date created (takes precedence over -D, --date)
    -n, --name <name>        Specify created by

Requirements

node.js >= v0.11.3 phantomjs --harmony-generators flag

API

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

Something went wrong with that request. Please try again.