Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A js wrapper to pdfinfo
JavaScript
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
.gitignore
.travis.yml
AUTHORS
LICENSE
Makefile
README.md
index.js
package.json

README.md

pdfinfojs - pdfinfo shell wrapper for Node.js

Build Status pdfinfojs provides access to pdfinfo via shell in nodejs.

Installation

via npm:

$ npm install pdfinfojs

Usage

Asynchronus example

var pdfinfo = require('pdfinfojs'),
    pdf = new pdfinfo('test/pdfs/sample.pdf');

pdf.getInfo(function(err, info, params) {
  if (err) {
    console.error(err.stack);
  }
  else {
    console.log(info); //info is an object
    console.log(params); // commandline params passed to pdfinfo cmd
  }
});

Synchronous Example

var pdfinfo = require('pdfinfojs'),
    pdf = new pdfinfo('test/pdfs/sample.pdf');

var data = pdf.getInfoSync();
console.log(data);

Tests

$ npm test

Coverage (Make sure you have installed jscoverage (it's easy sudo aptitude install jscoverage or brew jscoverage)

$ npm test-cov
Something went wrong with that request. Please try again.