1.1.5 • Published 5 years ago

pdfpage2image v1.1.5

Weekly downloads
37
License
-
Repository
github
Last release
5 years ago

PDFpage2Image

Installation

To install, use npm.

npm install pdfpage2image

Description

This is a fork of pdf2images

This version add functionnality to convert a single pdf page as an image. It also rewrites the entire library in Typescript

Code example

// Get the path to the pdf (Must be absolute)
let pdfPath = path.join(__dirname, "file.pdf");

Convert(pdfPath, 1, { quality: 200 })
	.then(imgBuffer => {
		// Save the image here or do what ever you want
	})
	.catch(err => {
		// Oops...
	});

Options

1. pdfPath:
The absolute path to the pdf fie

2. PageNumber:
The page number to convert to an image (starts with 1)

3. Options:

useLocalGs:
Set this true if you want to use an own local ghostscript installation

int quality [ = 200]:
The quality (dpi) of the output PNGs.

Tests

Tests are made with Jasmine and are under the spec directory

To run tests, execute the following command:

npm test
1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago