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)

latest
Source
npmnpm
Version
0.5.1
Version published
Weekly downloads
243
-26.81%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

pdf

FAQs

Package last updated on 18 Apr 2018

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