Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
node-poppler
Advanced tools
Asynchronous node.js wrapper for the Poppler PDF rendering library
Poppler is a PDF rendering library that also includes a collection of utility binaries, which allows for the manipulation and extraction of data from PDF documents such as converting PDF files to HTML, TXT, or PostScript.
The node-poppler
module provides an asynchronous node.js wrapper around said utility binaries for easier use.
It was originally created out of a need for a PDF-to-HTML conversion module at Yeovil District Hospital NHS Foundation Trust to convert clinical documents in PDF format to HTML.
Install using npm
:
npm install node-poppler
Or yarn
:
yarn add node-poppler
node-poppler's test scripts use npm commands.
Windows and macOS/Darwin binaries are provided with this repository.
For Linux users, you will need to download the poppler-data
and poppler-utils
binaries separately.
An example of downloading the binaries on a Debian system:
sudo apt-get install poppler-data
sudo apt-get install poppler-utils
If you do not wish to use the included macOS binaries, you can download the latest versions with Homebrew:
brew install poppler
Once they have been installed, you will need to pass the poppler-utils
installation directory in as parameters to an instance of the Poppler class:
const { Poppler } = require("node-poppler");
const poppler = new Poppler("./usr/bin");
const { Poppler } = require("node-poppler");
API Documentation can be found here
Example of an async
await
call to poppler.pdfToCairo, to convert only the first and second page of a PDF file to PNG:
const { Poppler } = require("node-poppler");
const file = "test_document.pdf";
const poppler = new Poppler();
const options = {
firstPageToConvert: 1,
lastPageToConvert: 2,
pngFile: true,
};
const outputFile = `test_document.png`;
const res = await poppler.pdfToCairo(file, outputFile, options);
console.log(res);
Example of calling poppler.pdfToHtml with a promise chain:
const { Poppler } = require("node-poppler");
const file = "test_document.pdf";
const poppler = new Poppler();
const options = {
firstPageToConvert: 1,
lastPageToConvert: 2,
};
poppler.pdfToHtml(file, options).then((res) => {
console.log(res);
});
Example of calling poppler.pdfToText with a promise chain:
const { Poppler } = require("node-poppler");
const file = "test_document.pdf";
const poppler = new Poppler();
const options = {
firstPageToConvert: 1,
lastPageToConvert: 2,
};
poppler.pdfToText(file, options).then((res) => {
console.log(res);
});
Please see CONTRIBUTING.md for more details regarding contributing to this project.
node-poppler
is licensed under the MIT license.
2.4.0 (2021-03-09)
dataurls
option to pdftohtml (ec45b5b)forcepagenumber
option to pdftoppm (533f424)hideannotations
option to pdftoppm (ffbe119)separator
option to pdftoppm (7744abd)received
in error string (f6b7fcb)FAQs
Asynchronous node.js wrapper for the Poppler PDF rendering library
The npm package node-poppler receives a total of 10,554 weekly downloads. As such, node-poppler popularity was classified as popular.
We found that node-poppler demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.