Convert pdf to images (png,jpg)

Usage no npm install needed!

<script type="module">
  import hckrnewsPdf2png from 'https://cdn.skypack.dev/@hckrnews/pdf2png';



Convert pdf to png or jpg.

If you want convert powerpoint files to png or jpg images, you can do it with this script.


The package requires the following software to be installed:

  • imagemagick
  • ghostscript


npm install @hckrnews/pdf2png


sudo apt install imagemagick ghostscript

Example usage

import Converter from '@hckrnews/pdf2png';

const converter = Converter.create({
    file:   'test/OPW 733 Tienduizend redenen.pdf',
    output: 'output/'

const result = converter.convert();


files: Array with the files.

output: Output folder.

customConverter: set a custom converter

Test the package.

npm test

This will run all the tests in the test folder with mocha.

If you only want to check the eslint rules, just run.

npm run lint