1.0.3 • Published 10 years ago
pdf-to-png v1.0.3
pdf-to-png
Render a PDF to a PNG, useful for generating thumbnails. Uses electron-spawn and pdf.js, so it doesn't require any image processing libraries. Supports a custom scale factor. Currently only renders the first page.
install
npm install pdf-to-pngexample
Use as a command line tool
pdf-to-png -i goat.pdf -o goat.pngOr as a module
require('pdf-to-png')({
input: 'goat.pdf',
output: 'goat.png'
})To run the included example clone this repo then call
npm run exampleusage
pdf-to-png -i input -o output -s scale
input: input fileoutput: output filescale: fraction of full size
require('pdf-to-png')(opts, [cb])
opts.input: input fileopts.output: output fileopts.scale: fraction of full sizecb: optional callback to be called on completion