Skip to content

npm module for converting a pdf file to an image (png, jpeg, tiff, svg) using pdftocairo from Poppler

License

Notifications You must be signed in to change notification settings

ksami/pdftoimage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pdftoimage

npm module for converting a pdf file to an image (png, jpeg, tiff, svg) using pdftocairo from Poppler.

Installation

Make sure pdftocairo is installed and on your path, then

npm install pdftoimage

Usage

var pdftoimage = require('pdftoimage');
var file = 'sample.pdf';

// Returns a Promise
pdftoimage(file, {
  format: 'png',  // png, jpeg, tiff or svg, defaults to png
  prefix: 'img',  // prefix for each image except svg, defaults to input filename
  outdir: 'out'   // path to output directory, defaults to current directory
})
.then(function(){
  console.log('Conversion done');
})
.catch(function(err){
  console.log(err);
});

Test

Make sure mocha is installed, then run

npm test

License

MIT

About

npm module for converting a pdf file to an image (png, jpeg, tiff, svg) using pdftocairo from Poppler

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published