Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
A utility for converting pdf to image and base64 format.
npm install -S pdf2pic
let PDF2Pic = require('pdf2pic').default
let converter = new PDF2Pic({
density: 100, // output pixels per inch
savename: "untitled", // output file name
savedir: "./images", // output file location
format: "png", // output file format
size: 600 // output size in pixels
})
// by default the first page of the pdf will be converted
// to image
converter.convert("/path/to/pdf/sample.pdf")
.then(resolve => {
console.log("image converted successfully")
})
// or you can also convert bulk
// in this example we will only convert pages 1 4 and 6
converter.convertBulk("path/to/pdf/sample.pdf", [1,4,6])
.then(resolve => {
console.log("image converted successfully")
})
// we can also convert all pages to pdf by
// supplying -1 as second argument
converter.convertBulk("path/to/pdf/sample.pdf", -1)
.then(resolve => {
console.log("image converted successfully")
})
// you can also directly convert pdf to base64 of an image
converter.convertToBase64("path/to/pdf/sample.pdf")
.then(resolve => {
if (resolve.base64) {
// assuming you're using some ORM to save base64 to db
db.model.table('users').update({id: "1", image: resolve.base64})
}
})
FAQs
A utility for converting pdf to image formats. Supports different outputs: directly to file, base64 or buffer.
The npm package pdf2pic receives a total of 69,067 weekly downloads. As such, pdf2pic popularity was classified as popular.
We found that pdf2pic demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.