Browse Source

PDF.js version 1.5.260 - See mozilla/pdf.js@f4e6afb74f1ae98cfa16e976c50d804949ce344d

master v1.5.260
Pdf Bot 9 years ago
parent
commit
8a9ab83bb3
  1. 2
      bower.json
  2. 52
      build/pdf.combined.js
  3. 4
      build/pdf.js
  4. 52
      build/pdf.worker.js
  5. 2
      package.json

2
bower.json

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

52
build/pdf.combined.js

@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdfCombined = {}));
// Use strict in our context only - users might not want it // Use strict in our context only - users might not want it
'use strict'; 'use strict';
var pdfjsVersion = '1.5.258'; var pdfjsVersion = '1.5.260';
var pdfjsBuild = '8aa5901'; var pdfjsBuild = 'f4e6afb';
var pdfjsFilePath = var pdfjsFilePath =
typeof document !== 'undefined' && document.currentScript ? typeof document !== 'undefined' && document.currentScript ?
@ -46464,7 +46464,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
textState = stateManager.state; textState = stateManager.state;
var fn = operation.fn; var fn = operation.fn;
args = operation.args; args = operation.args;
var advance; var advance, diff;
switch (fn | 0) { switch (fn | 0) {
case OPS.setFont: case OPS.setFont:
@ -46497,8 +46497,8 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
(args[0] - textContentItem.lastAdvanceWidth); (args[0] - textContentItem.lastAdvanceWidth);
textContentItem.height += textContentItem.height +=
(args[1] - textContentItem.lastAdvanceHeight); (args[1] - textContentItem.lastAdvanceHeight);
var diff = (args[0] - textContentItem.lastAdvanceWidth) - diff = (args[0] - textContentItem.lastAdvanceWidth) -
(args[1] - textContentItem.lastAdvanceHeight); (args[1] - textContentItem.lastAdvanceHeight);
addFakeSpaces(diff, textContentItem.str); addFakeSpaces(diff, textContentItem.str);
break; break;
} }
@ -46518,6 +46518,24 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
textState.carriageReturn(); textState.carriageReturn();
break; break;
case OPS.setTextMatrix: case OPS.setTextMatrix:
// 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 &&
advance.value > 0 &&
advance.value <= textContentItem.fakeMultiSpaceMax) {
textState.translateTextLineMatrix(advance.width,
advance.height);
textContentItem.width +=
(advance.width - textContentItem.lastAdvanceWidth);
textContentItem.height +=
(advance.height - textContentItem.lastAdvanceHeight);
diff = (advance.width - textContentItem.lastAdvanceWidth) -
(advance.height - textContentItem.lastAdvanceHeight);
addFakeSpaces(diff, textContentItem.str);
break;
}
flushTextContentItem(); flushTextContentItem();
textState.setTextMatrix(args[0], args[1], args[2], args[3], textState.setTextMatrix(args[0], args[1], args[2], args[3],
args[4], args[5]); args[4], args[5]);
@ -47615,6 +47633,30 @@ var TextState = (function TextStateClosure() {
m[4] = m[0] * x + m[2] * y + m[4]; m[4] = m[0] * x + m[2] * y + m[4];
m[5] = m[1] * x + m[3] * y + m[5]; m[5] = m[1] * x + m[3] * y + m[5];
}, },
calcTextLineMatrixAdvance:
function TextState_calcTextLineMatrixAdvance(a, b, c, d, e, f) {
var font = this.font;
if (!font) {
return null;
}
var m = this.textLineMatrix;
if (!(a === m[0] && b === m[1] && c === m[2] && d === m[3])) {
return null;
}
var txDiff = e - m[4], tyDiff = f - m[5];
if ((font.vertical && txDiff !== 0) || (!font.vertical && tyDiff !== 0)) {
return null;
}
var tx, ty, denominator = a * d - b * c;
if (font.vertical) {
tx = -tyDiff * c / denominator;
ty = tyDiff * a / denominator;
} else {
tx = txDiff * d / denominator;
ty = -txDiff * b / denominator;
}
return { width: tx, height: ty, value: (font.vertical ? ty : tx), };
},
calcRenderMatrix: function TextState_calcRendeMatrix(ctm) { calcRenderMatrix: function TextState_calcRendeMatrix(ctm) {
// 9.4.4 Text Space Details // 9.4.4 Text Space Details
var tsm = [this.fontSize * this.textHScale, 0, var tsm = [this.fontSize * this.textHScale, 0,

4
build/pdf.js

@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdf = {}));
// Use strict in our context only - users might not want it // Use strict in our context only - users might not want it
'use strict'; 'use strict';
var pdfjsVersion = '1.5.258'; var pdfjsVersion = '1.5.260';
var pdfjsBuild = '8aa5901'; var pdfjsBuild = 'f4e6afb';
var pdfjsFilePath = var pdfjsFilePath =
typeof document !== 'undefined' && document.currentScript ? typeof document !== 'undefined' && document.currentScript ?

52
build/pdf.worker.js vendored

@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdfWorker = {}));
// Use strict in our context only - users might not want it // Use strict in our context only - users might not want it
'use strict'; 'use strict';
var pdfjsVersion = '1.5.258'; var pdfjsVersion = '1.5.260';
var pdfjsBuild = '8aa5901'; var pdfjsBuild = 'f4e6afb';
var pdfjsFilePath = var pdfjsFilePath =
typeof document !== 'undefined' && document.currentScript ? typeof document !== 'undefined' && document.currentScript ?
@ -38122,7 +38122,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
textState = stateManager.state; textState = stateManager.state;
var fn = operation.fn; var fn = operation.fn;
args = operation.args; args = operation.args;
var advance; var advance, diff;
switch (fn | 0) { switch (fn | 0) {
case OPS.setFont: case OPS.setFont:
@ -38155,8 +38155,8 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
(args[0] - textContentItem.lastAdvanceWidth); (args[0] - textContentItem.lastAdvanceWidth);
textContentItem.height += textContentItem.height +=
(args[1] - textContentItem.lastAdvanceHeight); (args[1] - textContentItem.lastAdvanceHeight);
var diff = (args[0] - textContentItem.lastAdvanceWidth) - diff = (args[0] - textContentItem.lastAdvanceWidth) -
(args[1] - textContentItem.lastAdvanceHeight); (args[1] - textContentItem.lastAdvanceHeight);
addFakeSpaces(diff, textContentItem.str); addFakeSpaces(diff, textContentItem.str);
break; break;
} }
@ -38176,6 +38176,24 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
textState.carriageReturn(); textState.carriageReturn();
break; break;
case OPS.setTextMatrix: case OPS.setTextMatrix:
// 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 &&
advance.value > 0 &&
advance.value <= textContentItem.fakeMultiSpaceMax) {
textState.translateTextLineMatrix(advance.width,
advance.height);
textContentItem.width +=
(advance.width - textContentItem.lastAdvanceWidth);
textContentItem.height +=
(advance.height - textContentItem.lastAdvanceHeight);
diff = (advance.width - textContentItem.lastAdvanceWidth) -
(advance.height - textContentItem.lastAdvanceHeight);
addFakeSpaces(diff, textContentItem.str);
break;
}
flushTextContentItem(); flushTextContentItem();
textState.setTextMatrix(args[0], args[1], args[2], args[3], textState.setTextMatrix(args[0], args[1], args[2], args[3],
args[4], args[5]); args[4], args[5]);
@ -39273,6 +39291,30 @@ var TextState = (function TextStateClosure() {
m[4] = m[0] * x + m[2] * y + m[4]; m[4] = m[0] * x + m[2] * y + m[4];
m[5] = m[1] * x + m[3] * y + m[5]; m[5] = m[1] * x + m[3] * y + m[5];
}, },
calcTextLineMatrixAdvance:
function TextState_calcTextLineMatrixAdvance(a, b, c, d, e, f) {
var font = this.font;
if (!font) {
return null;
}
var m = this.textLineMatrix;
if (!(a === m[0] && b === m[1] && c === m[2] && d === m[3])) {
return null;
}
var txDiff = e - m[4], tyDiff = f - m[5];
if ((font.vertical && txDiff !== 0) || (!font.vertical && tyDiff !== 0)) {
return null;
}
var tx, ty, denominator = a * d - b * c;
if (font.vertical) {
tx = -tyDiff * c / denominator;
ty = tyDiff * a / denominator;
} else {
tx = txDiff * d / denominator;
ty = -txDiff * b / denominator;
}
return { width: tx, height: ty, value: (font.vertical ? ty : tx), };
},
calcRenderMatrix: function TextState_calcRendeMatrix(ctm) { calcRenderMatrix: function TextState_calcRendeMatrix(ctm) {
// 9.4.4 Text Space Details // 9.4.4 Text Space Details
var tsm = [this.fontSize * this.textHScale, 0, var tsm = [this.fontSize * this.textHScale, 0,

2
package.json

@ -1,6 +1,6 @@
{ {
"name": "pdfjs-dist", "name": "pdfjs-dist",
"version": "1.5.258", "version": "1.5.260",
"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": [

Loading…
Cancel
Save