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
|
@ -11,7 +11,7 @@ var fs = require('fs');
|
|||
require('./domstubs.js');
|
||||
|
||||
// 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';
|
||||
|
@ -44,7 +44,7 @@ function getFileNameFromPath(path) {
|
|||
|
||||
// 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);
|
||||
|
@ -59,7 +59,7 @@ PDFJS.getDocument(data).then(function (doc) {
|
|||
console.log();
|
||||
|
||||
return page.getOperatorList().then(function (opList) {
|
||||
var svgGfx = new PDFJS.SVGGraphics(page.commonObjs, page.objs);
|
||||
var svgGfx = new pdfjsLib.SVGGraphics(page.commonObjs, page.objs);
|
||||
svgGfx.embedFonts = true;
|
||||
return svgGfx.getSVG(opList, viewport).then(function (svg) {
|
||||
var svgDump = svg.toString();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue