@@ -735,7 +735,6 @@ exports.isSameOrigin = isSameOrigin;
735735exports.isString = isString;
736736exports.objectFromMap = objectFromMap;
737737exports.objectSize = objectSize;
738- exports.removeNullCharacters = removeNullCharacters;
739738exports.setVerbosityLevel = setVerbosityLevel;
740739exports.shadow = shadow;
741740exports.string32 = string32;
@@ -1282,21 +1281,6 @@ class AbortException extends BaseException {
12821281}
12831282
12841283exports.AbortException = AbortException;
1285- const NullCharactersRegExp = /\x00+/g;
1286- const InvisibleCharactersRegExp = /[\x01-\x1F]/g;
1287-
1288- function removeNullCharacters(str, replaceInvisible = false) {
1289- if (typeof str !== "string") {
1290- warn("The argument for removeNullCharacters must be a string.");
1291- return str;
1292- }
1293-
1294- if (replaceInvisible) {
1295- str = str.replace(InvisibleCharactersRegExp, " ");
1296- }
1297-
1298- return str.replace(NullCharactersRegExp, "");
1299- }
13001284
13011285function bytesToString(bytes) {
13021286 assert(bytes !== null && typeof bytes === "object" && bytes.length !== undefined, "Invalid argument for bytesToString");
@@ -23799,8 +23783,8 @@ class PartialEvaluator {
2379923783 return {
2380023784 str,
2380123785 dir: bidiResult.dir,
23802- width: textChunk.totalWidth,
23803- height: textChunk.totalHeight,
23786+ width: Math.abs( textChunk.totalWidth) ,
23787+ height: Math.abs( textChunk.totalHeight) ,
2380423788 transform: textChunk.transform,
2380523789 fontName: textChunk.fontName,
2380623790 hasEOL: textChunk.hasEOL
@@ -23866,8 +23850,9 @@ class PartialEvaluator {
2386623850 if (textState.font.vertical) {
2386723851 const advanceY = (lastPosY - posY) / textContentItem.textAdvanceScale;
2386823852 const advanceX = posX - lastPosX;
23853+ const textOrientation = Math.sign(textContentItem.height);
2386923854
23870- if (advanceY < textContentItem.negativeSpaceMax) {
23855+ if (advanceY < textOrientation * textContentItem.negativeSpaceMax) {
2387123856 if (Math.abs(advanceX) > 0.5 * textContentItem.width) {
2387223857 appendEOL();
2387323858 return;
@@ -23882,15 +23867,15 @@ class PartialEvaluator {
2388223867 return;
2388323868 }
2388423869
23885- if (advanceY <= textContentItem.trackingSpaceMin) {
23870+ if (advanceY <= textOrientation * textContentItem.trackingSpaceMin) {
2388623871 textContentItem.height += advanceY;
23887- } else if (!addFakeSpaces(advanceY, textContentItem.prevTransform)) {
23872+ } else if (!addFakeSpaces(advanceY, textContentItem.prevTransform, textOrientation )) {
2388823873 if (textContentItem.str.length === 0) {
2388923874 textContent.items.push({
2389023875 str: " ",
2389123876 dir: "ltr",
2389223877 width: 0,
23893- height: advanceY,
23878+ height: Math.abs( advanceY) ,
2389423879 transform: textContentItem.prevTransform,
2389523880 fontName: textContentItem.fontName,
2389623881 hasEOL: false
@@ -23905,8 +23890,9 @@ class PartialEvaluator {
2390523890
2390623891 const advanceX = (posX - lastPosX) / textContentItem.textAdvanceScale;
2390723892 const advanceY = posY - lastPosY;
23893+ const textOrientation = Math.sign(textContentItem.width);
2390823894
23909- if (advanceX < textContentItem.negativeSpaceMax) {
23895+ if (advanceX < textOrientation * textContentItem.negativeSpaceMax) {
2391023896 if (Math.abs(advanceY) > 0.5 * textContentItem.height) {
2391123897 appendEOL();
2391223898 return;
@@ -23921,14 +23907,14 @@ class PartialEvaluator {
2392123907 return;
2392223908 }
2392323909
23924- if (advanceX <= textContentItem.trackingSpaceMin) {
23910+ if (advanceX <= textOrientation * textContentItem.trackingSpaceMin) {
2392523911 textContentItem.width += advanceX;
23926- } else if (!addFakeSpaces(advanceX, textContentItem.prevTransform)) {
23912+ } else if (!addFakeSpaces(advanceX, textContentItem.prevTransform, textOrientation )) {
2392723913 if (textContentItem.str.length === 0) {
2392823914 textContent.items.push({
2392923915 str: " ",
2393023916 dir: "ltr",
23931- width: advanceX,
23917+ width: Math.abs( advanceX) ,
2393223918 height: 0,
2393323919 transform: textContentItem.prevTransform,
2393423920 fontName: textContentItem.fontName,
@@ -24039,8 +24025,8 @@ class PartialEvaluator {
2403924025 }
2404024026 }
2404124027
24042- function addFakeSpaces(width, transf) {
24043- if (textContentItem.spaceInFlowMin <= width && width <= textContentItem.spaceInFlowMax) {
24028+ function addFakeSpaces(width, transf, textOrientation ) {
24029+ if (textOrientation * textContentItem.spaceInFlowMin <= width && width <= textOrientation * textContentItem.spaceInFlowMax) {
2404424030 if (textContentItem.initialized) {
2404524031 textContentItem.str.push(" ");
2404624032 }
@@ -24060,8 +24046,8 @@ class PartialEvaluator {
2406024046 textContent.items.push({
2406124047 str: " ",
2406224048 dir: "ltr",
24063- width,
24064- height,
24049+ width: Math.abs(width) ,
24050+ height: Math.abs(height) ,
2406524051 transform: transf || getCurrentTextTransform(),
2406624052 fontName,
2406724053 hasEOL: false
@@ -73560,7 +73546,7 @@ Object.defineProperty(exports, "WorkerMessageHandler", ({
7356073546var _worker = __w_pdfjs_require__(1);
7356173547
7356273548const pdfjsVersion = '2.13.0';
73563- const pdfjsBuild = 'f287c5f ';
73549+ const pdfjsBuild = '8ac0ccc ';
7356473550})();
7356573551
7356673552/******/ return __webpack_exports__;
0 commit comments