A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.npmjs.com/package/pdftotextjs below:

pdftotextjs - npm

pdftotextjs0.5.1 • Public • Published 7 years ago

pdftotextjs - pdftotext shell wrapper for Node.js

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

Installation

via npm:

$ npm install pdftotextjs
Usage Asynchronous example

const pdftotext = require('pdftotextjs');

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

 

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(); 

console.log(data.toString('utf8'));

Tests
$ npm test
Package Sidebar Install Downloads Weekly Downloads

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4