Security News
New Proposed CISA Mandate Would Require Critical Infrastructure to Report Ransom Payments Within 24 Hours
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
pdf-images
Advanced tools
The pf-images library aims to simplify pdf-conversion by using poppler / pdfImages & imageMagick to convert pdfs to images.
Weekly downloads
Readme
Simplify pdf-conversion by using in built methods which use poppler & imageMagick to convert pdfs to images.
linux: Ensure you have imagemagick and pdfImages installed
mac: Ensure you have imagemagick and poppler installed
windows: not supported
Poppler is very fast and shows results in milliseconds, however it's accuracy is low compared to image magick. If your pdf has images like for example images of of cards etc. then using poppler is a good idea, however if you have proper pdfs which are let's say converted from md files, then I would suggest using imagemagick.
const { Poppler } = require('pdf-images');
const result = Poppler.convert('/pdf/path/sample_pdf.pdf', 'output/directory/path', 'outputName'); // you can also add a 4th arguement which can specify the output image extension like jpg or jpeg
{
pdfPath: '/pdf/path/sample_pdf.pf',
outputImagesDirectory: '/output/directory/outputName/',
images: [
'/output/directory/outputName/outputName-001.png',
'/output/directory/outputName/outputName-002.png'
],
success: true
}
{
pdfPath: '/pdf/path/sample_pdf.pf',
error: <Err object>
}
resultWithArgs
const { ImageMagick } = require('pdf-images');
const result = ImageMagick.convertAsync('/pdf/path/sample_pdf.pdf', 'output/directory/path', 'outputName');
const resultWithArgs = ImageMagick.convertAsync('/pdf/path/sample_pdf.pdf', 'output/directory/path', 'outputName', '-alpha background');
const resultWithDifferentExtension = ImageMagick.convertAsync(
'/pdf/path/sample_pdf.pdf',
'output/directory/path',
'outputName',
null,
'jpeg',
);
{
pdfPath: '/pdf/path/sample_pdf.pf',
outputImagesDirectory: '/output/directory/outputName/',
commandExecuted: 'convert -quiet -alpha background -density 200 -quality 100 /pdf/path/sample_pdf.pf /output/directory/outputName/outputName.jpeg',
images: [
'/output/directory/outputName/outputName-001.jpeg',
'/output/directory/outputName/outputName-002.jpeg'
],
success: true
}
const { ImageMagick } = require('pdf-images');
const result = ImageMagick.convert('/pdf/path/sample_pdf.pdf', 'output/directory/path', 'outputName'); // you can also add a 4th arguement which can specify the output image extension like jpg or jpeg
{
pdfPath: '/pdf/path/sample_pdf.pf',
outputImagesDirectory: '/output/directory/outputName/',
images: [
'/output/directory/outputName/outputName-001.png',
'/output/directory/outputName/outputName-002.png'
],
success: true
}
{
pdfPath: '/pdf/path/sample_pdf.pf',
error: <Err object>
}
ImageMagick.setQuality(100);
ImageMagick.setDensity(200);
FAQs
The pf-images library aims to simplify pdf-conversion by using poppler / pdfImages & imageMagick to convert pdfs to images.
The npm package pdf-images receives a total of 122 weekly downloads. As such, pdf-images popularity was classified as not popular.
We found that pdf-images 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
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
Security News
Redis is no longer OSS, breaking its explicit commitment to remain under the BSD 3-Clause License forever. This has angered contributors who are now working to fork the software.
Product
Socket AI now enables 'AI detected potential malware' alerts by default, ensuring users benefit from AI-powered state-of-the-art malware detection without needing to opt-in.