1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 10:08:06 +02:00

Adds tests for node_stream

This commit is contained in:
Mukul Mishra 2017-08-05 01:00:37 +05:30
parent 18ede8c65d
commit d16709f5e4
7 changed files with 419 additions and 172 deletions

View file

@ -17,11 +17,10 @@ var pdfjsLib = require('pdfjs-dist');
// Loading file from file system into typed array
var pdfPath = process.argv[2] || '../../web/compressed.tracemonkey-pldi-09.pdf';
var data = new Uint8Array(fs.readFileSync(pdfPath));
// Will be using promises to load document, pages and misc data instead of
// callback.
pdfjsLib.getDocument(data).then(function (doc) {
pdfjsLib.getDocument(pdfPath).then(function (doc) {
var numPages = doc.numPages;
console.log('# Document Loaded');
console.log('Number of Pages: ' + numPages);