Socket
Book a DemoInstallSign in
Socket

pdfpage2image

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pdfpage2image

Convert a single page from a pdf to an image

1.1.5
latest
Source
npmnpm
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

pdf

FAQs

Package last updated on 07 Mar 2019

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.