|
@@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdfCombined = {}));
|
|
|
// Use strict in our context only - users might not want it
|
|
|
'use strict';
|
|
|
|
|
|
-var pdfjsVersion = '1.5.355';
|
|
|
-var pdfjsBuild = '336b26a';
|
|
|
+var pdfjsVersion = '1.5.357';
|
|
|
+var pdfjsBuild = 'a02e268';
|
|
|
|
|
|
var pdfjsFilePath =
|
|
|
typeof document !== 'undefined' && document.currentScript ?
|
|
@@ -39178,6 +39178,8 @@ var PDFDocumentProxy = (function PDFDocumentProxyClosure() {
|
|
|
* @typedef {Object} getTextContentParameters
|
|
|
* @param {boolean} normalizeWhitespace - replaces all occurrences of
|
|
|
* whitespace with standard spaces (0x20). The default value is `false`.
|
|
|
+ * @param {boolean} disableCombineTextItems - do not attempt to combine
|
|
|
+ * same line {@link TextItem}'s. The default value is `false`.
|
|
|
*/
|
|
|
|
|
|
/**
|
|
@@ -39469,11 +39471,12 @@ var PDFPageProxy = (function PDFPageProxyClosure() {
|
|
|
* object that represent the page text content.
|
|
|
*/
|
|
|
getTextContent: function PDFPageProxy_getTextContent(params) {
|
|
|
- var normalizeWhitespace = (params && params.normalizeWhitespace) || false;
|
|
|
-
|
|
|
return this.transport.messageHandler.sendWithPromise('GetTextContent', {
|
|
|
pageIndex: this.pageNumber - 1,
|
|
|
- normalizeWhitespace: normalizeWhitespace,
|
|
|
+ normalizeWhitespace: (params && params.normalizeWhitespace === true ?
|
|
|
+ true : /* Default */ false),
|
|
|
+ combineTextItems: (params && params.disableCombineTextItems === true ?
|
|
|
+ false : /* Default */ true),
|
|
|
});
|
|
|
},
|
|
|
|
|
@@ -46245,7 +46248,8 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
|
|
getTextContent:
|
|
|
function PartialEvaluator_getTextContent(stream, task, resources,
|
|
|
stateManager,
|
|
|
- normalizeWhitespace) {
|
|
|
+ normalizeWhitespace,
|
|
|
+ combineTextItems) {
|
|
|
|
|
|
stateManager = (stateManager || new StateManager(new TextState()));
|
|
|
|
|
@@ -46556,7 +46560,8 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
|
|
var isSameTextLine = !textState.font ? false :
|
|
|
((textState.font.vertical ? args[0] : args[1]) === 0);
|
|
|
advance = args[0] - args[1];
|
|
|
- if (isSameTextLine && textContentItem.initialized &&
|
|
|
+ if (combineTextItems &&
|
|
|
+ isSameTextLine && textContentItem.initialized &&
|
|
|
advance > 0 &&
|
|
|
advance <= textContentItem.fakeMultiSpaceMax) {
|
|
|
textState.translateTextLineMatrix(args[0], args[1]);
|
|
@@ -46588,7 +46593,8 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
|
|
// Optimization to treat same line movement as advance.
|
|
|
advance = textState.calcTextLineMatrixAdvance(
|
|
|
args[0], args[1], args[2], args[3], args[4], args[5]);
|
|
|
- if (advance !== null && textContentItem.initialized &&
|
|
|
+ if (combineTextItems &&
|
|
|
+ advance !== null && textContentItem.initialized &&
|
|
|
advance.value > 0 &&
|
|
|
advance.value <= textContentItem.fakeMultiSpaceMax) {
|
|
|
textState.translateTextLineMatrix(advance.width,
|
|
@@ -46729,7 +46735,8 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
|
|
|
|
|
next(self.getTextContent(xobj, task,
|
|
|
xobj.dict.get('Resources') || resources, stateManager,
|
|
|
- normalizeWhitespace).then(function (formTextContent) {
|
|
|
+ normalizeWhitespace, combineTextItems).then(
|
|
|
+ function (formTextContent) {
|
|
|
Util.appendToArray(textContent.items, formTextContent.items);
|
|
|
Util.extendObj(textContent.styles, formTextContent.styles);
|
|
|
stateManager.restore();
|
|
@@ -49582,7 +49589,8 @@ var Page = (function PageClosure() {
|
|
|
},
|
|
|
|
|
|
extractTextContent: function Page_extractTextContent(task,
|
|
|
- normalizeWhitespace) {
|
|
|
+ normalizeWhitespace,
|
|
|
+ combineTextItems) {
|
|
|
var handler = {
|
|
|
on: function nullHandlerOn() {},
|
|
|
send: function nullHandlerSend() {}
|
|
@@ -49615,7 +49623,8 @@ var Page = (function PageClosure() {
|
|
|
task,
|
|
|
self.resources,
|
|
|
/* stateManager = */ null,
|
|
|
- normalizeWhitespace);
|
|
|
+ normalizeWhitespace,
|
|
|
+ combineTextItems);
|
|
|
});
|
|
|
},
|
|
|
|
|
@@ -50879,12 +50888,14 @@ var WorkerMessageHandler = {
|
|
|
handler.on('GetTextContent', function wphExtractText(data) {
|
|
|
var pageIndex = data.pageIndex;
|
|
|
var normalizeWhitespace = data.normalizeWhitespace;
|
|
|
+ var combineTextItems = data.combineTextItems;
|
|
|
return pdfManager.getPage(pageIndex).then(function(page) {
|
|
|
var task = new WorkerTask('GetTextContent: page ' + pageIndex);
|
|
|
startWorkerTask(task);
|
|
|
var pageNum = pageIndex + 1;
|
|
|
var start = Date.now();
|
|
|
- return page.extractTextContent(task, normalizeWhitespace).then(
|
|
|
+ return page.extractTextContent(task, normalizeWhitespace,
|
|
|
+ combineTextItems).then(
|
|
|
function(textContent) {
|
|
|
finishWorkerTask(task);
|
|
|
info('text indexing: page=' + pageNum + ' - time=' +
|