
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
pdftotextjs
Advanced tools
pdftotextjs provides access to pdftotext via shell in nodejs. You'll
need pdftotext which comes with poppler-utils.
sudo apt-get install poppler-utils.sudo port install poppler or brew install xpdf.download and install Xpdf.via npm:
$ npm install pdftotextjs
var pdftotext = require('pdftotextjs'),
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(function(err, data, cmd) {
if (err) {
console.error(err);
else {
console.log(data);
// additionally you can also access cmd array
// it contains params which passed to pdftotext ['filename', '-f', '1', '-l', '1', '-']
console.log(cmd.join(' '));
}
});
NOTE: get method is now obsolete and not recommended to use it
further. Please use getText.
var pdftotext = require('pdftotextjs'),
pdf = new pdftotext('test/pdfs/sample.pdf');
var data = pdf.getTextSync();
console.log(data);
NOTE: getSync method is now obsolete and not recommended to use it
further. Please use getTextSync.
$ npm test
Coverage
$ npm test-cov
FAQs
Extracts text from pdf with pdftotext (poppler)
The npm package pdftotextjs receives a total of 250 weekly downloads. As such, pdftotextjs popularity was classified as not popular.
We found that pdftotextjs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.