mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-02-08 00:21:11 +01:00
For consistency, also updates the `pdf2png.js` example to use the slightly less verbose `canvasAndContext` parameter name.
Overview
Example to demonstrate converting a PDF file to a PNG image using the PDF.js library.
Getting started
Install the dependencies and build the project:
$ npm install
$ gulp dist
Install the Node canvas library to convert the first page of a PDF file to a PNG image:
$ npm install canvas
$ cd examples/node/pdf2png
$ node pdf2png.js