Browse Source

PDF.js version 1.8.342 - See mozilla/pdf.js@52998c5fe1a3d74b47de6474b9b4a99346379e1a

master v1.8.342
pdfjsbot 8 years ago
parent
commit
5099b70355
  1. 2
      bower.json
  2. 12
      build/pdf.combined.js
  3. 2
      build/pdf.combined.js.map
  4. 12
      build/pdf.js
  5. 2
      build/pdf.js.map
  6. 4
      build/pdf.min.js
  7. 4
      build/pdf.worker.js
  8. 2
      build/pdf.worker.js.map
  9. 4
      lib/display/api.js
  10. 4
      lib/display/global.js
  11. 4
      lib/pdf.js
  12. 4
      lib/pdf.worker.js
  13. 66
      lib/web/pdf_find_controller.js
  14. 2
      package.json
  15. 66
      web/pdf_viewer.js
  16. 2
      web/pdf_viewer.js.map

2
bower.json

@ -1,6 +1,6 @@
{ {
"name": "pdfjs-dist", "name": "pdfjs-dist",
"version": "1.8.339", "version": "1.8.342",
"main": [ "main": [
"build/pdf.js", "build/pdf.js",
"build/pdf.worker.js" "build/pdf.worker.js"

12
build/pdf.combined.js

@ -12792,8 +12792,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
}(); }();
var version, build; var version, build;
{ {
exports.version = version = '1.8.339'; exports.version = version = '1.8.342';
exports.build = build = '9bfbf27f'; exports.build = build = '52998c5f';
} }
exports.getDocument = getDocument; exports.getDocument = getDocument;
exports.LoopbackPort = LoopbackPort; exports.LoopbackPort = LoopbackPort;
@ -28199,8 +28199,8 @@ if (!_util.globalScope.PDFJS) {
} }
var PDFJS = _util.globalScope.PDFJS; var PDFJS = _util.globalScope.PDFJS;
{ {
PDFJS.version = '1.8.339'; PDFJS.version = '1.8.342';
PDFJS.build = '9bfbf27f'; PDFJS.build = '52998c5f';
} }
PDFJS.pdfBug = false; PDFJS.pdfBug = false;
if (PDFJS.verbosity !== undefined) { if (PDFJS.verbosity !== undefined) {
@ -43786,8 +43786,8 @@ exports.TilingPattern = TilingPattern;
"use strict"; "use strict";
var pdfjsVersion = '1.8.339'; var pdfjsVersion = '1.8.342';
var pdfjsBuild = '9bfbf27f'; var pdfjsBuild = '52998c5f';
var pdfjsSharedUtil = __w_pdfjs_require__(0); var pdfjsSharedUtil = __w_pdfjs_require__(0);
var pdfjsDisplayGlobal = __w_pdfjs_require__(26); var pdfjsDisplayGlobal = __w_pdfjs_require__(26);
var pdfjsDisplayAPI = __w_pdfjs_require__(10); var pdfjsDisplayAPI = __w_pdfjs_require__(10);

2
build/pdf.combined.js.map

File diff suppressed because one or more lines are too long

12
build/pdf.js

@ -3499,8 +3499,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
}(); }();
var version, build; var version, build;
{ {
exports.version = version = '1.8.339'; exports.version = version = '1.8.342';
exports.build = build = '9bfbf27f'; exports.build = build = '52998c5f';
} }
exports.getDocument = getDocument; exports.getDocument = getDocument;
exports.LoopbackPort = LoopbackPort; exports.LoopbackPort = LoopbackPort;
@ -5473,8 +5473,8 @@ if (!_util.globalScope.PDFJS) {
} }
var PDFJS = _util.globalScope.PDFJS; var PDFJS = _util.globalScope.PDFJS;
{ {
PDFJS.version = '1.8.339'; PDFJS.version = '1.8.342';
PDFJS.build = '9bfbf27f'; PDFJS.build = '52998c5f';
} }
PDFJS.pdfBug = false; PDFJS.pdfBug = false;
if (PDFJS.verbosity !== undefined) { if (PDFJS.verbosity !== undefined) {
@ -7969,8 +7969,8 @@ exports.TilingPattern = TilingPattern;
"use strict"; "use strict";
var pdfjsVersion = '1.8.339'; var pdfjsVersion = '1.8.342';
var pdfjsBuild = '9bfbf27f'; var pdfjsBuild = '52998c5f';
var pdfjsSharedUtil = __w_pdfjs_require__(0); var pdfjsSharedUtil = __w_pdfjs_require__(0);
var pdfjsDisplayGlobal = __w_pdfjs_require__(9); var pdfjsDisplayGlobal = __w_pdfjs_require__(9);
var pdfjsDisplayAPI = __w_pdfjs_require__(3); var pdfjsDisplayAPI = __w_pdfjs_require__(3);

2
build/pdf.js.map

File diff suppressed because one or more lines are too long

4
build/pdf.min.js vendored

File diff suppressed because one or more lines are too long

4
build/pdf.worker.js vendored

@ -37144,8 +37144,8 @@ exports.Type1Parser = Type1Parser;
"use strict"; "use strict";
var pdfjsVersion = '1.8.339'; var pdfjsVersion = '1.8.342';
var pdfjsBuild = '9bfbf27f'; var pdfjsBuild = '52998c5f';
var pdfjsCoreWorker = __w_pdfjs_require__(8); var pdfjsCoreWorker = __w_pdfjs_require__(8);
{ {
__w_pdfjs_require__(19); __w_pdfjs_require__(19);

2
build/pdf.worker.js.map vendored

File diff suppressed because one or more lines are too long

4
lib/display/api.js

@ -1412,8 +1412,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
}(); }();
var version, build; var version, build;
{ {
exports.version = version = '1.8.339'; exports.version = version = '1.8.342';
exports.build = build = '9bfbf27f'; exports.build = build = '52998c5f';
} }
exports.getDocument = getDocument; exports.getDocument = getDocument;
exports.LoopbackPort = LoopbackPort; exports.LoopbackPort = LoopbackPort;

4
lib/display/global.js

@ -39,8 +39,8 @@ if (!_util.globalScope.PDFJS) {
} }
var PDFJS = _util.globalScope.PDFJS; var PDFJS = _util.globalScope.PDFJS;
{ {
PDFJS.version = '1.8.339'; PDFJS.version = '1.8.342';
PDFJS.build = '9bfbf27f'; PDFJS.build = '52998c5f';
} }
PDFJS.pdfBug = false; PDFJS.pdfBug = false;
if (PDFJS.verbosity !== undefined) { if (PDFJS.verbosity !== undefined) {

4
lib/pdf.js

@ -14,8 +14,8 @@
*/ */
'use strict'; 'use strict';
var pdfjsVersion = '1.8.339'; var pdfjsVersion = '1.8.342';
var pdfjsBuild = '9bfbf27f'; var pdfjsBuild = '52998c5f';
var pdfjsSharedUtil = require('./shared/util.js'); var pdfjsSharedUtil = require('./shared/util.js');
var pdfjsDisplayGlobal = require('./display/global.js'); var pdfjsDisplayGlobal = require('./display/global.js');
var pdfjsDisplayAPI = require('./display/api.js'); var pdfjsDisplayAPI = require('./display/api.js');

4
lib/pdf.worker.js vendored

@ -14,8 +14,8 @@
*/ */
'use strict'; 'use strict';
var pdfjsVersion = '1.8.339'; var pdfjsVersion = '1.8.342';
var pdfjsBuild = '9bfbf27f'; var pdfjsBuild = '52998c5f';
var pdfjsCoreWorker = require('./core/worker.js'); var pdfjsCoreWorker = require('./core/worker.js');
{ {
require('./core/network.js'); require('./core/network.js');

66
lib/web/pdf_find_controller.js

@ -19,6 +19,8 @@ Object.defineProperty(exports, "__esModule", {
}); });
exports.PDFFindController = exports.FindStates = undefined; exports.PDFFindController = exports.FindStates = undefined;
var _pdfjs = require('./pdfjs');
var _ui_utils = require('./ui_utils'); var _ui_utils = require('./ui_utils');
var FindStates = { var FindStates = {
@ -189,38 +191,39 @@ var PDFFindController = function PDFFindControllerClosure() {
this.updateUIResultsCount(); this.updateUIResultsCount();
} }
}, },
extractText: function PDFFindController_extractText() { extractText: function extractText() {
var _this2 = this;
if (this.startedTextExtraction) { if (this.startedTextExtraction) {
return; return;
} }
this.startedTextExtraction = true; this.startedTextExtraction = true;
this.pageContents = []; this.pageContents.length = 0;
var extractTextPromisesResolves = []; var promise = Promise.resolve();
var numPages = this.pdfViewer.pagesCount;
for (var i = 0; i < numPages; i++) { var _loop = function _loop(i, ii) {
this.extractTextPromises.push(new Promise(function (resolve) { var extractTextCapability = (0, _pdfjs.createPromiseCapability)();
extractTextPromisesResolves.push(resolve); _this2.extractTextPromises[i] = extractTextCapability.promise;
})); promise = promise.then(function () {
} return _this2.pdfViewer.getPageTextContent(i).then(function (textContent) {
var self = this; var textItems = textContent.items;
function extractPageText(pageIndex) { var strBuf = [];
self.pdfViewer.getPageTextContent(pageIndex).then(function textContentResolved(textContent) { for (var j = 0, jj = textItems.length; j < jj; j++) {
var textItems = textContent.items; strBuf.push(textItems[j].str);
var str = []; }
for (var i = 0, len = textItems.length; i < len; i++) { _this2.pageContents[i] = strBuf.join('');
str.push(textItems[i].str); extractTextCapability.resolve(i);
} });
self.pageContents.push(str.join(''));
extractTextPromisesResolves[pageIndex](pageIndex);
if (pageIndex + 1 < self.pdfViewer.pagesCount) {
extractPageText(pageIndex + 1);
}
}); });
};
for (var i = 0, ii = this.pdfViewer.pagesCount; i < ii; i++) {
_loop(i, ii);
} }
extractPageText(0);
}, },
executeCommand: function PDFFindController_executeCommand(cmd, state) { executeCommand: function PDFFindController_executeCommand(cmd, state) {
var _this2 = this; var _this3 = this;
if (this.state === null || cmd !== 'findagain') { if (this.state === null || cmd !== 'findagain') {
this.dirtyMatch = true; this.dirtyMatch = true;
@ -228,12 +231,12 @@ var PDFFindController = function PDFFindControllerClosure() {
this.state = state; this.state = state;
this.updateUIState(FindStates.FIND_PENDING); this.updateUIState(FindStates.FIND_PENDING);
this._firstPagePromise.then(function () { this._firstPagePromise.then(function () {
_this2.extractText(); _this3.extractText();
clearTimeout(_this2.findTimeout); clearTimeout(_this3.findTimeout);
if (cmd === 'find') { if (cmd === 'find') {
_this2.findTimeout = setTimeout(_this2.nextMatch.bind(_this2), 250); _this3.findTimeout = setTimeout(_this3.nextMatch.bind(_this3), 250);
} else { } else {
_this2.nextMatch(); _this3.nextMatch();
} }
}); });
}, },
@ -247,6 +250,8 @@ var PDFFindController = function PDFFindControllerClosure() {
} }
}, },
nextMatch: function PDFFindController_nextMatch() { nextMatch: function PDFFindController_nextMatch() {
var _this4 = this;
var previous = this.state.findPrevious; var previous = this.state.findPrevious;
var currentPageIndex = this.pdfViewer.currentPageNumber - 1; var currentPageIndex = this.pdfViewer.currentPageNumber - 1;
var numPages = this.pdfViewer.pagesCount; var numPages = this.pdfViewer.pagesCount;
@ -261,14 +266,13 @@ var PDFFindController = function PDFFindControllerClosure() {
this.pageMatches = []; this.pageMatches = [];
this.matchCount = 0; this.matchCount = 0;
this.pageMatchesLength = null; this.pageMatchesLength = null;
var self = this;
for (var i = 0; i < numPages; i++) { for (var i = 0; i < numPages; i++) {
this.updatePage(i); this.updatePage(i);
if (!(i in this.pendingFindMatches)) { if (!(i in this.pendingFindMatches)) {
this.pendingFindMatches[i] = true; this.pendingFindMatches[i] = true;
this.extractTextPromises[i].then(function (pageIdx) { this.extractTextPromises[i].then(function (pageIdx) {
delete self.pendingFindMatches[pageIdx]; delete _this4.pendingFindMatches[pageIdx];
self.calcFindMatch(pageIdx); _this4.calcFindMatch(pageIdx);
}); });
} }
} }

2
package.json

@ -1,6 +1,6 @@
{ {
"name": "pdfjs-dist", "name": "pdfjs-dist",
"version": "1.8.339", "version": "1.8.342",
"main": "build/pdf.js", "main": "build/pdf.js",
"description": "Generic build of Mozilla's PDF.js library.", "description": "Generic build of Mozilla's PDF.js library.",
"keywords": [ "keywords": [

66
web/pdf_viewer.js

@ -2097,6 +2097,8 @@ Object.defineProperty(exports, "__esModule", {
}); });
exports.PDFFindController = exports.FindStates = undefined; exports.PDFFindController = exports.FindStates = undefined;
var _pdfjs = __w_pdfjs_require__(0);
var _ui_utils = __w_pdfjs_require__(1); var _ui_utils = __w_pdfjs_require__(1);
var FindStates = { var FindStates = {
@ -2267,38 +2269,39 @@ var PDFFindController = function PDFFindControllerClosure() {
this.updateUIResultsCount(); this.updateUIResultsCount();
} }
}, },
extractText: function PDFFindController_extractText() { extractText: function extractText() {
var _this2 = this;
if (this.startedTextExtraction) { if (this.startedTextExtraction) {
return; return;
} }
this.startedTextExtraction = true; this.startedTextExtraction = true;
this.pageContents = []; this.pageContents.length = 0;
var extractTextPromisesResolves = []; var promise = Promise.resolve();
var numPages = this.pdfViewer.pagesCount;
for (var i = 0; i < numPages; i++) { var _loop = function _loop(i, ii) {
this.extractTextPromises.push(new Promise(function (resolve) { var extractTextCapability = (0, _pdfjs.createPromiseCapability)();
extractTextPromisesResolves.push(resolve); _this2.extractTextPromises[i] = extractTextCapability.promise;
})); promise = promise.then(function () {
} return _this2.pdfViewer.getPageTextContent(i).then(function (textContent) {
var self = this; var textItems = textContent.items;
function extractPageText(pageIndex) { var strBuf = [];
self.pdfViewer.getPageTextContent(pageIndex).then(function textContentResolved(textContent) { for (var j = 0, jj = textItems.length; j < jj; j++) {
var textItems = textContent.items; strBuf.push(textItems[j].str);
var str = []; }
for (var i = 0, len = textItems.length; i < len; i++) { _this2.pageContents[i] = strBuf.join('');
str.push(textItems[i].str); extractTextCapability.resolve(i);
} });
self.pageContents.push(str.join(''));
extractTextPromisesResolves[pageIndex](pageIndex);
if (pageIndex + 1 < self.pdfViewer.pagesCount) {
extractPageText(pageIndex + 1);
}
}); });
};
for (var i = 0, ii = this.pdfViewer.pagesCount; i < ii; i++) {
_loop(i, ii);
} }
extractPageText(0);
}, },
executeCommand: function PDFFindController_executeCommand(cmd, state) { executeCommand: function PDFFindController_executeCommand(cmd, state) {
var _this2 = this; var _this3 = this;
if (this.state === null || cmd !== 'findagain') { if (this.state === null || cmd !== 'findagain') {
this.dirtyMatch = true; this.dirtyMatch = true;
@ -2306,12 +2309,12 @@ var PDFFindController = function PDFFindControllerClosure() {
this.state = state; this.state = state;
this.updateUIState(FindStates.FIND_PENDING); this.updateUIState(FindStates.FIND_PENDING);
this._firstPagePromise.then(function () { this._firstPagePromise.then(function () {
_this2.extractText(); _this3.extractText();
clearTimeout(_this2.findTimeout); clearTimeout(_this3.findTimeout);
if (cmd === 'find') { if (cmd === 'find') {
_this2.findTimeout = setTimeout(_this2.nextMatch.bind(_this2), 250); _this3.findTimeout = setTimeout(_this3.nextMatch.bind(_this3), 250);
} else { } else {
_this2.nextMatch(); _this3.nextMatch();
} }
}); });
}, },
@ -2325,6 +2328,8 @@ var PDFFindController = function PDFFindControllerClosure() {
} }
}, },
nextMatch: function PDFFindController_nextMatch() { nextMatch: function PDFFindController_nextMatch() {
var _this4 = this;
var previous = this.state.findPrevious; var previous = this.state.findPrevious;
var currentPageIndex = this.pdfViewer.currentPageNumber - 1; var currentPageIndex = this.pdfViewer.currentPageNumber - 1;
var numPages = this.pdfViewer.pagesCount; var numPages = this.pdfViewer.pagesCount;
@ -2339,14 +2344,13 @@ var PDFFindController = function PDFFindControllerClosure() {
this.pageMatches = []; this.pageMatches = [];
this.matchCount = 0; this.matchCount = 0;
this.pageMatchesLength = null; this.pageMatchesLength = null;
var self = this;
for (var i = 0; i < numPages; i++) { for (var i = 0; i < numPages; i++) {
this.updatePage(i); this.updatePage(i);
if (!(i in this.pendingFindMatches)) { if (!(i in this.pendingFindMatches)) {
this.pendingFindMatches[i] = true; this.pendingFindMatches[i] = true;
this.extractTextPromises[i].then(function (pageIdx) { this.extractTextPromises[i].then(function (pageIdx) {
delete self.pendingFindMatches[pageIdx]; delete _this4.pendingFindMatches[pageIdx];
self.calcFindMatch(pageIdx); _this4.calcFindMatch(pageIdx);
}); });
} }
} }

2
web/pdf_viewer.js.map

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save