Code Monkey home page Code Monkey logo

pdf2images-multiple's Introduction

#pdf2images-multiple

##Usage

var PDF2Images = require('pdf2images-multiple')

var convert_options = {
	'-trim': '',
	'-density' : 150,
	'-quality' : 100,
	'-sharpen' : '0x1.0'
}

var pdf2images = PDF2Images('./foodir/foo.pdf', {
	convert_options: convert_options, //optional
	output_dir: './media/', //optional
	ext: 'jpg', //optional, png is the default value
	gm: true //Use GraphicksMagic //optional, false is the default value
})

pdf2images.pdf.convert((err, image_path) => {
	//Do something when convert every single page.
}, (err, images_paths) => {
	//Do something when convert full pdf file.
})

//You can do it by chunks
var chunks = 4

//Converting 4 pages at the same time until do it with all pages.
pdf2images.pdf.convert_chunks((err, image_path) => {
	//Do something when convert every single page.
}, (err, images_paths) => {
	//Do something when convert full pdf file.
}, chunks)	

//Optionaly you can choose the pages to convert by page number
pdf2images.pdf.convert_pages([0,4,6,7], (err, image_path) => {
	//Do something when convert every single page.
}, (err, images_paths) => {
	//Do something when convert the pages from array.
})	

//You can convert a single page
pdf2images.pdf.convert_page(0, (err, image_path) => {
	//Do something when convert the page.
})	

##Warning

###This module require to install these packages: ######imagemagick, ghostscript, poppler-utils and GraphicsMagick ###On ubuntu or debian exec:

apt-get install -y imagemagick ghostscript poppler-utils GraphicsMagick

pdf2images-multiple's People

Contributors

charliejuc avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.