1.2.0 • Published 2 months ago

pdf-export-images v1.2.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 months ago

PDF Export Images

Exports images in their native resolution from a PDF file to disk.

Use via CLI

Usage: npx pdf-export-images <file> [dir]

Arguments:
  file        path to PDF file
  dir         image destination directory (default: ".")

You can also install the package globally via npm i -g pdf-export-images to run the command without npx

Programatic use

# Install
npm i pdf-export-images
import { exportImages, exportImagesEvents } from 'pdf-export-images'

// Export via promise
exportImages('file.pdf', 'output/dir')
  .then(images => console.log('Exported', images.length, 'images'))
  .catch(console.error)

// Export via EventEmitter
exportImagesEvents('file.pdf', 'output/dir')
  .on('load', event => console.log('Exporting images from', event.pageCount, 'pages...'))
  .on('image', ({ file, width, height }) => console.log(file, `(${width}x${height})`))
  .on('error', console.error)
  .on('done', images => console.log(images.length, 'images exported'))

See: cli.js for progress details during export.

Change Notes

  • v1.2.0 added typescript support
  • v1.1.0 improved image extraction
1.2.0

2 months ago

1.1.0

9 months ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago