Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

pdftotextjs

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pdftotextjs

Extracts text from pdf with pdftotext (poppler)

Source
npmnpm
Version
0.2.4
Version published
Weekly downloads
349
2.05%
Maintainers
1
Weekly downloads
 
Created
Source

pdftotextjs - pdftotext shell wrapper for Node.js

Build Status pdftotextjs provides access to pdftotext via shell in nodejs. You'll need pdftotext which comes with poppler-utils.

  • Ubuntu/Debian sudo apt-get install poppler-utils.
  • MacOSX sudo port install poppler or brew install xpdf.
  • Windows download and install Xpdf.

Installation

via npm:

$ npm install pdftotextjs

Usage

Asynchronous example

var pdftotext = require('pdftotextjs'),
    ptext = new pdftotext('test/pdfs/sample.pdf');

ptext.success(function(i) {
  console.log(i);
});

ptext.error(function(error) {
  console.log("Error: " + error);
});

ptext.get();

You may also pass callbacks in as object. In that case above can be also re-written as:

var pdftotext = require('pdftotextjs');
var ptext = new pdftotext('test/pdfs/sample.pdf', {
  error: function(e) {
    console.log("Error:" + e);
  },
  success: function(data) {
    console.log(data);
  }
});

ptext.get();

Synchronous example

var pdftotext = require('pdftotextjs'),
    ptext = new pdftotext('test/pdfs/sample.pdf');

var data = ptext.getSync();
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

Keywords

pdf

FAQs

Package last updated on 12 Mar 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts