pdftotextjs
Extracts text from pdf with pdftotext (poppler)
Last updated 2 years ago by iapain .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install pdftotextjs 
SYNC missed versions from official npm registry.

pdftotextjs - pdftotext shell wrapper for Node.js

view on npm npm module downloads Dependency Status Build Status Known Vulnerabilities view on npm

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

const pdftotext = require('pdftotextjs');
const pdf = new pdftotext('test/pdfs/sample.pdf');

// Convert first page only
// These options will be passed to pdftotext
// You may use any valid option
pdf.add_options(['-f 1', '-l 1']);

pdf.getText()
.then(result) {
  console.log(result);
})
.catch(function (err) {
  console.error(err);
});

Synchronous example

const pdftotext = require('pdftotextjs');
const pdf = new pdftotext('test/pdfs/sample.pdf');

const data = pdf.getTextSync(); // returns buffer
console.log(data.toString('utf8'));

Tests

$ npm test

Current Tags

  • 0.5.1                                ...           latest (2 years ago)

12 Versions

  • 0.5.1                                ...           2 years ago
  • 0.5.0                                ...           2 years ago
  • 0.4.0                                ...           4 years ago
  • 0.3.1                                ...           7 years ago
  • 0.3.0                                ...           7 years ago
  • 0.2.4                                ...           7 years ago
  • 0.2.3                                ...           7 years ago
  • 0.2.2                                ...           7 years ago
  • 0.2.1                                ...           7 years ago
  • 0.2.0                                ...           7 years ago
  • 0.1.1                                ...           8 years ago
  • 0.1.0                                ...           8 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (3)
Dependents (2)

Copyright 2014 - 2016 © taobao.org |