
Product
Introducing Module Reachability: Focus on the Vulnerabilities That Matter
Module Reachability filters out unreachable CVEs so you can focus on vulnerabilities that actually matter to your application.
A nodejs module for converting pdf into image file
Note: Currently it only works on Linux.
$ [sudo] npm install pdf2img
var fs = require('fs');
var path = require('path');
var pdf2img = require('pdf2img');
var input = __dirname + '/test.pdf';
pdf2img.setOptions({
type: 'png', // png or jpg, default jpg
size: 1024, // default 1024
density: 600, // default 600
outputdir: __dirname + path.sep + 'output', // output folder, default null (if null given, then it will create folder name same as file name)
outputname: 'test', // output file name, dafault null (if null given, then it will create image name same as input name)
page: null // convert selected page, default null (if null given, then it will convert all pages)
});
pdf2img.convert(input, function(err, info) {
if (err) console.log(err)
else console.log(info);
});
It will return array of splitted and converted image files.
{ result: 'success',
message:
[ { page: 1,
name: 'test_1.jpg',
size: 17.275,
path: '/output/test_1.jpg' },
{ page: 2,
name: 'test_2.jpg',
size: 24.518,
path: '/output/test_2.jpg' },
{ page: 3,
name: 'test_3.jpg',
size: 24.055,
path: '/output/test_3.jpg' } ] }
MIT
FAQs
A nodejs module for converting pdf into image
The npm package pdf2img receives a total of 1,508 weekly downloads. As such, pdf2img popularity was classified as popular.
We found that pdf2img 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.
Product
Module Reachability filters out unreachable CVEs so you can focus on vulnerabilities that actually matter to your application.
Company News
Socket is bringing best-in-class reachability analysis into the platform — cutting false positives, accelerating triage, and cementing our place as the leader in software supply chain security.
Product
Socket is introducing a new way to organize repositories and apply repository-specific security policies.