mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 01:58:06 +02:00
Exposes all functional members via lib exports and use them in viewer.
This commit is contained in:
parent
1d12aed5ca
commit
1e3e14e6b2
25 changed files with 174 additions and 102 deletions
|
@ -13,7 +13,7 @@ var fs = require('fs');
|
|||
global.DOMParser = require('./domparsermock.js').DOMParserMock;
|
||||
|
||||
// Run `gulp dist` to generate 'pdfjs-dist' npm package files.
|
||||
require('../../build/dist');
|
||||
var pdfjsLib = require('../../build/dist');
|
||||
|
||||
// Loading file from file system into typed array
|
||||
var pdfPath = process.argv[2] || '../../web/compressed.tracemonkey-pldi-09.pdf';
|
||||
|
@ -21,7 +21,7 @@ var data = new Uint8Array(fs.readFileSync(pdfPath));
|
|||
|
||||
// Will be using promises to load document, pages and misc data instead of
|
||||
// callback.
|
||||
PDFJS.getDocument(data).then(function (doc) {
|
||||
pdfjsLib.getDocument(data).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