From ed2bc20eaef3b463b472685969f0e8ede6f533ad Mon Sep 17 00:00:00 2001 From: Tim van der Meij Date: Sat, 31 Mar 2018 00:09:49 +0200 Subject: [PATCH] Update after global PDFJS removal --- Setup-PDF.js-in-a-website.md | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/Setup-PDF.js-in-a-website.md b/Setup-PDF.js-in-a-website.md index abf2ce1..f365205 100644 --- a/Setup-PDF.js-in-a-website.md +++ b/Setup-PDF.js-in-a-website.md @@ -7,16 +7,7 @@ Add the dependencies to your project: npm install pdfjs-dist --save -Simple usage example: - -``` -require('pdfjs-dist'); -var fs = require('fs'); -var data = new Uint8Array(fs.readFileSync('helloworld.pdf')); -PDFJS.getDocument(data).then(function (pdfDocument) { - console.log('Number of pages: ' + pdfDocument.numPages); -}); -``` +You can find a simple usage example at https://github.com/mozilla/pdf.js/blob/master/examples/node/getinfo.js. Depending on the APIs that you want to use, you might need to stuff some DOM APIs. Refer to https://github.com/mozilla/pdf.js/blob/master/examples/node/getinfo.js for a more complex example.