
Security News
Nx npm Packages Compromised in Supply Chain Attack Weaponizing AI CLI Tools
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
pdfpage2image
Advanced tools
To install, use npm.
npm install pdfpage2image
This is a fork of pdf2images
This version add functionnality to convert a single pdf page as an image. It also rewrites the entire library in Typescript
// Get the path to the pdf (Must be absolute)
let pdfPath = path.join(__dirname, "file.pdf");
Convert(pdfPath, 1, { quality: 200 })
.then(imgBuffer => {
// Save the image here or do what ever you want
})
.catch(err => {
// Oops...
});
1. pdfPath
:
The absolute path to the pdf fie
2. PageNumber
:
The page number to convert to an image (starts with 1)
3. Options
:
useLocalGs
:
Set this true if you want to use an own local ghostscript installation
int quality [ = 200]
:
The quality (dpi) of the output PNGs.
Tests are made with Jasmine and are under the spec
directory
To run tests, execute the following command:
npm test
FAQs
Convert a single page from a pdf to an image
The npm package pdfpage2image receives a total of 2 weekly downloads. As such, pdfpage2image popularity was classified as not popular.
We found that pdfpage2image 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
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.