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:
parent
18ede8c65d
commit
d16709f5e4
7 changed files with 419 additions and 172 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue