Skip to content

Convert PDF files into images using Poppler with promises. It achieves 10x faster performance compared to other PDF converters.

License

Notifications You must be signed in to change notification settings

dan-drl/pdf-poppler

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pdf-poppler

Convert PDF files into images using Poppler with promises. It achieves 10x faster performance compared to other PDF converters. Poppler library attached inside statically, so it has not require installation of poppler.

Note: Currently it supports for Windows and Mac OS only.

Installation

  $ npm install pdf-poppler

Usage

Get pdf info

const pdf = require('pdf-poppler');

let file = 'C:\\tmp\\convertme.pdf'

pdf.info(file)
    .then(pdfinfo => {
        console.log(pdfinfo);
    });

Convert pdf into image

const path = require('path');
const pdf = require('pdf-poppler');

let file = 'C:\\tmp\\convertme.pdf'

let opts = {
    format: 'jpeg',
    out_dir: path.dirname(file),
    out_prefix: path.baseName(file, path.extname(file)),
    page: null
}

pdf.convert(file, opts)
    .then(res => {
        console.log('Successfully converted');
    })
    .catch(error => {
        console.error(error);
    })

About

Convert PDF files into images using Poppler with promises. It achieves 10x faster performance compared to other PDF converters.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 47.0%
  • Objective-C 30.9%
  • C 16.3%
  • Roff 4.9%
  • Makefile 0.4%
  • CMake 0.3%
  • JavaScript 0.2%