Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
A utility for converting pdf to image and base64 format.
npm install -S pdf2pic
const PDF2Pic = require("pdf2pic");
const pdf2pic = 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
});
pdf2pic.convert("/path/to/pdf/sample.pdf").then((resolve) => {
console.log("image converter successfully!");
return resolve;
});
const PDF2Pic = require("pdf2pic");
const pdf2pic = 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
});
pdf2pic.convertBulk("path/to/pdf/sample.pdf", -1).then((resolve) => {
console.log("image converter successfully!");
return resolve;
});
const PDF2Pic = require("pdf2pic");
const pdf2pic = 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
});
pdf2pic.convertBulk("path/to/pdf/sample.pdf", [1,4,6]).then((resolve) => {
console.log("image converter successfully!");
return resolve;
});
const PDF2Pic = require("pdf2pic");
const pdf2pic = 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
});
pdf2pic.convertToBase64("path/to/pdf/sample.pdf").then((resolve) => {
if (resolve.base64) {
console.log("image converter successfully!");
// assuming you're using some ORM to save base64 to db
return 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
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.