forked from mirrors/gecko-dev
Bug 1876508 - Update PDF.js to new version bf9236009521621891d73dd77acc68215cb2cadb r=pdfjs-reviewers,fluent-reviewers,marco,flod
Differential Revision: https://phabricator.services.mozilla.com/D199621
This commit is contained in:
parent
6b5127fad2
commit
10ca73335c
12 changed files with 1667 additions and 1012 deletions
|
|
@ -18,32 +18,32 @@
|
|||
//
|
||||
|
||||
export const PdfJsDefaultPreferences = Object.freeze({
|
||||
"annotationEditorMode": 0,
|
||||
"annotationMode": 2,
|
||||
"cursorToolOnLoad": 0,
|
||||
"defaultZoomDelay": 400,
|
||||
"defaultZoomValue": "",
|
||||
"disablePageLabels": false,
|
||||
"enableHighlightEditor": false,
|
||||
"enablePermissions": false,
|
||||
"enablePrintAutoRotate": true,
|
||||
"enableScripting": true,
|
||||
"externalLinkTarget": 0,
|
||||
"highlightEditorColors": "yellow=#FFFF98,green=#53FFBC,blue=#80EBFF,pink=#FFCBE6,red=#FF4F5F",
|
||||
"historyUpdateUrl": false,
|
||||
"ignoreDestinationZoom": false,
|
||||
"forcePageColors": false,
|
||||
"pageColorsBackground": "Canvas",
|
||||
"pageColorsForeground": "CanvasText",
|
||||
"pdfBugEnabled": false,
|
||||
"sidebarViewOnLoad": -1,
|
||||
"scrollModeOnLoad": -1,
|
||||
"spreadModeOnLoad": -1,
|
||||
"textLayerMode": 1,
|
||||
"viewOnLoad": 0,
|
||||
"disableAutoFetch": false,
|
||||
"disableFontFace": false,
|
||||
"disableRange": false,
|
||||
"disableStream": false,
|
||||
"enableXfa": true
|
||||
annotationEditorMode: 0,
|
||||
annotationMode: 2,
|
||||
cursorToolOnLoad: 0,
|
||||
defaultZoomDelay: 400,
|
||||
defaultZoomValue: "",
|
||||
disablePageLabels: false,
|
||||
enableHighlightEditor: false,
|
||||
enablePermissions: false,
|
||||
enablePrintAutoRotate: true,
|
||||
enableScripting: true,
|
||||
externalLinkTarget: 0,
|
||||
highlightEditorColors: "yellow=#FFFF98,green=#53FFBC,blue=#80EBFF,pink=#FFCBE6,red=#FF4F5F",
|
||||
historyUpdateUrl: false,
|
||||
ignoreDestinationZoom: false,
|
||||
forcePageColors: false,
|
||||
pageColorsBackground: "Canvas",
|
||||
pageColorsForeground: "CanvasText",
|
||||
pdfBugEnabled: false,
|
||||
sidebarViewOnLoad: -1,
|
||||
scrollModeOnLoad: -1,
|
||||
spreadModeOnLoad: -1,
|
||||
textLayerMode: 1,
|
||||
viewOnLoad: 0,
|
||||
disableAutoFetch: false,
|
||||
disableFontFace: false,
|
||||
disableRange: false,
|
||||
disableStream: false,
|
||||
enableXfa: true
|
||||
});
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -14,128 +14,114 @@
|
|||
*/
|
||||
|
||||
export class SandboxSupportBase {
|
||||
constructor(win) {
|
||||
this.win = win;
|
||||
this.timeoutIds = new Map();
|
||||
this.commFun = null;
|
||||
}
|
||||
destroy() {
|
||||
this.commFun = null;
|
||||
for (const id of this.timeoutIds.values()) {
|
||||
this.win.clearTimeout(id);
|
||||
constructor(win) {
|
||||
this.win = win;
|
||||
this.timeoutIds = new Map();
|
||||
this.commFun = null;
|
||||
}
|
||||
this.timeoutIds = null;
|
||||
}
|
||||
exportValueToSandbox(val) {
|
||||
throw new Error("Not implemented");
|
||||
}
|
||||
importValueFromSandbox(val) {
|
||||
throw new Error("Not implemented");
|
||||
}
|
||||
createErrorForSandbox(errorMessage) {
|
||||
throw new Error("Not implemented");
|
||||
}
|
||||
callSandboxFunction(name, args) {
|
||||
try {
|
||||
args = this.exportValueToSandbox(args);
|
||||
this.commFun(name, args);
|
||||
} catch (e) {
|
||||
this.win.console.error(e);
|
||||
destroy() {
|
||||
this.commFun = null;
|
||||
for (const id of this.timeoutIds.values()) {
|
||||
this.win.clearTimeout(id);
|
||||
}
|
||||
this.timeoutIds = null;
|
||||
}
|
||||
}
|
||||
createSandboxExternals() {
|
||||
const externals = {
|
||||
setTimeout: (callbackId, nMilliseconds) => {
|
||||
if (typeof callbackId !== "number" || typeof nMilliseconds !== "number") {
|
||||
return;
|
||||
exportValueToSandbox(val) {
|
||||
throw new Error("Not implemented");
|
||||
}
|
||||
importValueFromSandbox(val) {
|
||||
throw new Error("Not implemented");
|
||||
}
|
||||
createErrorForSandbox(errorMessage) {
|
||||
throw new Error("Not implemented");
|
||||
}
|
||||
callSandboxFunction(name, args) {
|
||||
try {
|
||||
args = this.exportValueToSandbox(args);
|
||||
this.commFun(name, args);
|
||||
} catch (e) {
|
||||
this.win.console.error(e);
|
||||
}
|
||||
if (callbackId === 0) {
|
||||
this.win.clearTimeout(this.timeoutIds.get(callbackId));
|
||||
}
|
||||
const id = this.win.setTimeout(() => {
|
||||
this.timeoutIds.delete(callbackId);
|
||||
this.callSandboxFunction("timeoutCb", {
|
||||
callbackId,
|
||||
interval: false
|
||||
});
|
||||
}, nMilliseconds);
|
||||
this.timeoutIds.set(callbackId, id);
|
||||
},
|
||||
clearTimeout: callbackId => {
|
||||
this.win.clearTimeout(this.timeoutIds.get(callbackId));
|
||||
this.timeoutIds.delete(callbackId);
|
||||
},
|
||||
setInterval: (callbackId, nMilliseconds) => {
|
||||
if (typeof callbackId !== "number" || typeof nMilliseconds !== "number") {
|
||||
return;
|
||||
}
|
||||
const id = this.win.setInterval(() => {
|
||||
this.callSandboxFunction("timeoutCb", {
|
||||
callbackId,
|
||||
interval: true
|
||||
});
|
||||
}, nMilliseconds);
|
||||
this.timeoutIds.set(callbackId, id);
|
||||
},
|
||||
clearInterval: callbackId => {
|
||||
this.win.clearInterval(this.timeoutIds.get(callbackId));
|
||||
this.timeoutIds.delete(callbackId);
|
||||
},
|
||||
alert: cMsg => {
|
||||
if (typeof cMsg !== "string") {
|
||||
return;
|
||||
}
|
||||
this.win.alert(cMsg);
|
||||
},
|
||||
confirm: cMsg => {
|
||||
if (typeof cMsg !== "string") {
|
||||
return false;
|
||||
}
|
||||
return this.win.confirm(cMsg);
|
||||
},
|
||||
prompt: (cQuestion, cDefault) => {
|
||||
if (typeof cQuestion !== "string" || typeof cDefault !== "string") {
|
||||
return null;
|
||||
}
|
||||
return this.win.prompt(cQuestion, cDefault);
|
||||
},
|
||||
parseURL: cUrl => {
|
||||
const url = new this.win.URL(cUrl);
|
||||
const props = [
|
||||
"hash",
|
||||
"host",
|
||||
"hostname",
|
||||
"href",
|
||||
"origin",
|
||||
"password",
|
||||
"pathname",
|
||||
"port",
|
||||
"protocol",
|
||||
"search",
|
||||
"searchParams",
|
||||
"username"
|
||||
];
|
||||
return Object.fromEntries(props.map(name => [
|
||||
name,
|
||||
url[name].toString()
|
||||
]));
|
||||
},
|
||||
send: data => {
|
||||
if (!data) {
|
||||
return;
|
||||
}
|
||||
const event = new this.win.CustomEvent("updatefromsandbox", { detail: this.importValueFromSandbox(data) });
|
||||
this.win.dispatchEvent(event);
|
||||
}
|
||||
};
|
||||
Object.setPrototypeOf(externals, null);
|
||||
return (name, args) => {
|
||||
try {
|
||||
const result = externals[name](...args);
|
||||
return this.exportValueToSandbox(result);
|
||||
} catch (error) {
|
||||
throw this.createErrorForSandbox(error?.toString() ?? "");
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
createSandboxExternals() {
|
||||
const externals = {
|
||||
setTimeout: (callbackId, nMilliseconds) => {
|
||||
if (typeof callbackId !== "number" || typeof nMilliseconds !== "number") {
|
||||
return;
|
||||
}
|
||||
if (callbackId === 0) {
|
||||
this.win.clearTimeout(this.timeoutIds.get(callbackId));
|
||||
}
|
||||
const id = this.win.setTimeout(() => {
|
||||
this.timeoutIds.delete(callbackId);
|
||||
this.callSandboxFunction("timeoutCb", {
|
||||
callbackId,
|
||||
interval: false
|
||||
});
|
||||
}, nMilliseconds);
|
||||
this.timeoutIds.set(callbackId, id);
|
||||
},
|
||||
clearTimeout: callbackId => {
|
||||
this.win.clearTimeout(this.timeoutIds.get(callbackId));
|
||||
this.timeoutIds.delete(callbackId);
|
||||
},
|
||||
setInterval: (callbackId, nMilliseconds) => {
|
||||
if (typeof callbackId !== "number" || typeof nMilliseconds !== "number") {
|
||||
return;
|
||||
}
|
||||
const id = this.win.setInterval(() => {
|
||||
this.callSandboxFunction("timeoutCb", {
|
||||
callbackId,
|
||||
interval: true
|
||||
});
|
||||
}, nMilliseconds);
|
||||
this.timeoutIds.set(callbackId, id);
|
||||
},
|
||||
clearInterval: callbackId => {
|
||||
this.win.clearInterval(this.timeoutIds.get(callbackId));
|
||||
this.timeoutIds.delete(callbackId);
|
||||
},
|
||||
alert: cMsg => {
|
||||
if (typeof cMsg !== "string") {
|
||||
return;
|
||||
}
|
||||
this.win.alert(cMsg);
|
||||
},
|
||||
confirm: cMsg => {
|
||||
if (typeof cMsg !== "string") {
|
||||
return false;
|
||||
}
|
||||
return this.win.confirm(cMsg);
|
||||
},
|
||||
prompt: (cQuestion, cDefault) => {
|
||||
if (typeof cQuestion !== "string" || typeof cDefault !== "string") {
|
||||
return null;
|
||||
}
|
||||
return this.win.prompt(cQuestion, cDefault);
|
||||
},
|
||||
parseURL: cUrl => {
|
||||
const url = new this.win.URL(cUrl);
|
||||
const props = ["hash", "host", "hostname", "href", "origin", "password", "pathname", "port", "protocol", "search", "searchParams", "username"];
|
||||
return Object.fromEntries(props.map(name => [name, url[name].toString()]));
|
||||
},
|
||||
send: data => {
|
||||
if (!data) {
|
||||
return;
|
||||
}
|
||||
const event = new this.win.CustomEvent("updatefromsandbox", {
|
||||
detail: this.importValueFromSandbox(data)
|
||||
});
|
||||
this.win.dispatchEvent(event);
|
||||
}
|
||||
};
|
||||
Object.setPrototypeOf(externals, null);
|
||||
return (name, args) => {
|
||||
try {
|
||||
const result = externals[name](...args);
|
||||
return this.exportValueToSandbox(result);
|
||||
} catch (error) {
|
||||
throw this.createErrorForSandbox(error?.toString() ?? "");
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
@ -1074,9 +1074,6 @@ class AForm {
|
|||
}
|
||||
AFNumber_Format(nDec, sepStyle, negStyle, currStyle, strCurrency, bCurrencyPrepend) {
|
||||
const event = globalThis.event;
|
||||
if (!event.value) {
|
||||
return;
|
||||
}
|
||||
let value = this.AFMakeNumber(event.value);
|
||||
if (value === null) {
|
||||
event.value = "";
|
||||
|
|
@ -1686,23 +1683,27 @@ class EventDispatcher {
|
|||
}
|
||||
event.value = null;
|
||||
const target = this._objects[targetId];
|
||||
let savedValue = target.obj.value;
|
||||
let savedValue = target.obj._getValue();
|
||||
this.runActions(source, target, event, "Calculate");
|
||||
if (!event.rc) {
|
||||
continue;
|
||||
}
|
||||
if (event.value !== null) {
|
||||
target.obj.value = event.value;
|
||||
} else {
|
||||
event.value = target.obj._getValue();
|
||||
}
|
||||
event.value = target.obj.value;
|
||||
this.runActions(target, target, event, "Validate");
|
||||
if (!event.rc) {
|
||||
if (target.obj.value !== savedValue) {
|
||||
if (target.obj._getValue() !== savedValue) {
|
||||
target.wrapped.value = savedValue;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
savedValue = event.value = target.obj.value;
|
||||
if (event.value === null) {
|
||||
event.value = target.obj._getValue();
|
||||
}
|
||||
savedValue = target.obj._getValue();
|
||||
let formattedValue = null;
|
||||
if (this.runActions(target, target, event, "Format")) {
|
||||
formattedValue = event.value?.toString?.();
|
||||
|
|
@ -3486,66 +3487,26 @@ class Util extends PDFObject {
|
|||
return this.printd("m/d/yy h:MM:ss tt", oDate);
|
||||
}
|
||||
const handlers = {
|
||||
mmmm: data => {
|
||||
return this._months[data.month];
|
||||
},
|
||||
mmm: data => {
|
||||
return this._months[data.month].substring(0, 3);
|
||||
},
|
||||
mm: data => {
|
||||
return (data.month + 1).toString().padStart(2, "0");
|
||||
},
|
||||
m: data => {
|
||||
return (data.month + 1).toString();
|
||||
},
|
||||
dddd: data => {
|
||||
return this._days[data.dayOfWeek];
|
||||
},
|
||||
ddd: data => {
|
||||
return this._days[data.dayOfWeek].substring(0, 3);
|
||||
},
|
||||
dd: data => {
|
||||
return data.day.toString().padStart(2, "0");
|
||||
},
|
||||
d: data => {
|
||||
return data.day.toString();
|
||||
},
|
||||
yyyy: data => {
|
||||
return data.year.toString();
|
||||
},
|
||||
yy: data => {
|
||||
return (data.year % 100).toString().padStart(2, "0");
|
||||
},
|
||||
HH: data => {
|
||||
return data.hours.toString().padStart(2, "0");
|
||||
},
|
||||
H: data => {
|
||||
return data.hours.toString();
|
||||
},
|
||||
hh: data => {
|
||||
return (1 + (data.hours + 11) % 12).toString().padStart(2, "0");
|
||||
},
|
||||
h: data => {
|
||||
return (1 + (data.hours + 11) % 12).toString();
|
||||
},
|
||||
MM: data => {
|
||||
return data.minutes.toString().padStart(2, "0");
|
||||
},
|
||||
M: data => {
|
||||
return data.minutes.toString();
|
||||
},
|
||||
ss: data => {
|
||||
return data.seconds.toString().padStart(2, "0");
|
||||
},
|
||||
s: data => {
|
||||
return data.seconds.toString();
|
||||
},
|
||||
tt: data => {
|
||||
return data.hours < 12 ? "am" : "pm";
|
||||
},
|
||||
t: data => {
|
||||
return data.hours < 12 ? "a" : "p";
|
||||
}
|
||||
mmmm: data => this._months[data.month],
|
||||
mmm: data => this._months[data.month].substring(0, 3),
|
||||
mm: data => (data.month + 1).toString().padStart(2, "0"),
|
||||
m: data => (data.month + 1).toString(),
|
||||
dddd: data => this._days[data.dayOfWeek],
|
||||
ddd: data => this._days[data.dayOfWeek].substring(0, 3),
|
||||
dd: data => data.day.toString().padStart(2, "0"),
|
||||
d: data => data.day.toString(),
|
||||
yyyy: data => data.year.toString(),
|
||||
yy: data => (data.year % 100).toString().padStart(2, "0"),
|
||||
HH: data => data.hours.toString().padStart(2, "0"),
|
||||
H: data => data.hours.toString(),
|
||||
hh: data => (1 + (data.hours + 11) % 12).toString().padStart(2, "0"),
|
||||
h: data => (1 + (data.hours + 11) % 12).toString(),
|
||||
MM: data => data.minutes.toString().padStart(2, "0"),
|
||||
M: data => data.minutes.toString(),
|
||||
ss: data => data.seconds.toString().padStart(2, "0"),
|
||||
s: data => data.seconds.toString(),
|
||||
tt: data => data.hours < 12 ? "am" : "pm",
|
||||
t: data => data.hours < 12 ? "a" : "p"
|
||||
};
|
||||
const data = {
|
||||
year: oDate.getFullYear(),
|
||||
|
|
@ -3996,8 +3957,8 @@ function initSandbox(params) {
|
|||
|
||||
;// CONCATENATED MODULE: ./src/pdf.scripting.js
|
||||
|
||||
const pdfjsVersion = '4.1.30';
|
||||
const pdfjsBuild = 'a22b5a4f0';
|
||||
const pdfjsVersion = "4.1.86";
|
||||
const pdfjsBuild = "bf9236009";
|
||||
globalThis.pdfjsScripting = {
|
||||
initSandbox: initSandbox
|
||||
};
|
||||
|
|
|
|||
|
|
@ -92,7 +92,8 @@ const AnnotationEditorParamsType = {
|
|||
INK_THICKNESS: 22,
|
||||
INK_OPACITY: 23,
|
||||
HIGHLIGHT_COLOR: 31,
|
||||
HIGHLIGHT_DEFAULT_COLOR: 32
|
||||
HIGHLIGHT_DEFAULT_COLOR: 32,
|
||||
HIGHLIGHT_THICKNESS: 33
|
||||
};
|
||||
const PermissionFlag = {
|
||||
PRINT: 0x04,
|
||||
|
|
@ -530,43 +531,43 @@ class Util {
|
|||
if (transform[0]) {
|
||||
if (transform[0] < 0) {
|
||||
temp = minMax[0];
|
||||
minMax[0] = minMax[1];
|
||||
minMax[1] = temp;
|
||||
minMax[0] = minMax[2];
|
||||
minMax[2] = temp;
|
||||
}
|
||||
minMax[0] *= transform[0];
|
||||
minMax[1] *= transform[0];
|
||||
minMax[2] *= transform[0];
|
||||
if (transform[3] < 0) {
|
||||
temp = minMax[2];
|
||||
minMax[2] = minMax[3];
|
||||
temp = minMax[1];
|
||||
minMax[1] = minMax[3];
|
||||
minMax[3] = temp;
|
||||
}
|
||||
minMax[2] *= transform[3];
|
||||
minMax[1] *= transform[3];
|
||||
minMax[3] *= transform[3];
|
||||
} else {
|
||||
temp = minMax[0];
|
||||
minMax[0] = minMax[2];
|
||||
minMax[2] = temp;
|
||||
temp = minMax[1];
|
||||
minMax[1] = minMax[3];
|
||||
minMax[0] = minMax[1];
|
||||
minMax[1] = temp;
|
||||
temp = minMax[2];
|
||||
minMax[2] = minMax[3];
|
||||
minMax[3] = temp;
|
||||
if (transform[1] < 0) {
|
||||
temp = minMax[2];
|
||||
minMax[2] = minMax[3];
|
||||
temp = minMax[1];
|
||||
minMax[1] = minMax[3];
|
||||
minMax[3] = temp;
|
||||
}
|
||||
minMax[2] *= transform[1];
|
||||
minMax[1] *= transform[1];
|
||||
minMax[3] *= transform[1];
|
||||
if (transform[2] < 0) {
|
||||
temp = minMax[0];
|
||||
minMax[0] = minMax[1];
|
||||
minMax[1] = temp;
|
||||
minMax[0] = minMax[2];
|
||||
minMax[2] = temp;
|
||||
}
|
||||
minMax[0] *= transform[2];
|
||||
minMax[1] *= transform[2];
|
||||
minMax[2] *= transform[2];
|
||||
}
|
||||
minMax[0] += transform[4];
|
||||
minMax[1] += transform[4];
|
||||
minMax[2] += transform[5];
|
||||
minMax[1] += transform[5];
|
||||
minMax[2] += transform[4];
|
||||
minMax[3] += transform[5];
|
||||
}
|
||||
static transform(m1, m2) {
|
||||
|
|
@ -631,59 +632,48 @@ class Util {
|
|||
}
|
||||
return [xLow, yLow, xHigh, yHigh];
|
||||
}
|
||||
static bezierBoundingBox(x0, y0, x1, y1, x2, y2, x3, y3) {
|
||||
const tvalues = [],
|
||||
bounds = [[], []];
|
||||
let a, b, c, t, t1, t2, b2ac, sqrtb2ac;
|
||||
for (let i = 0; i < 2; ++i) {
|
||||
if (i === 0) {
|
||||
b = 6 * x0 - 12 * x1 + 6 * x2;
|
||||
a = -3 * x0 + 9 * x1 - 9 * x2 + 3 * x3;
|
||||
c = 3 * x1 - 3 * x0;
|
||||
} else {
|
||||
b = 6 * y0 - 12 * y1 + 6 * y2;
|
||||
a = -3 * y0 + 9 * y1 - 9 * y2 + 3 * y3;
|
||||
c = 3 * y1 - 3 * y0;
|
||||
}
|
||||
if (Math.abs(a) < 1e-12) {
|
||||
if (Math.abs(b) < 1e-12) {
|
||||
continue;
|
||||
}
|
||||
t = -c / b;
|
||||
if (0 < t && t < 1) {
|
||||
tvalues.push(t);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
b2ac = b * b - 4 * c * a;
|
||||
sqrtb2ac = Math.sqrt(b2ac);
|
||||
if (b2ac < 0) {
|
||||
continue;
|
||||
}
|
||||
t1 = (-b + sqrtb2ac) / (2 * a);
|
||||
if (0 < t1 && t1 < 1) {
|
||||
tvalues.push(t1);
|
||||
}
|
||||
t2 = (-b - sqrtb2ac) / (2 * a);
|
||||
if (0 < t2 && t2 < 1) {
|
||||
tvalues.push(t2);
|
||||
}
|
||||
static #getExtremumOnCurve(x0, x1, x2, x3, y0, y1, y2, y3, t, minMax) {
|
||||
if (t <= 0 || t >= 1) {
|
||||
return;
|
||||
}
|
||||
let j = tvalues.length,
|
||||
mt;
|
||||
const jlen = j;
|
||||
while (j--) {
|
||||
t = tvalues[j];
|
||||
mt = 1 - t;
|
||||
bounds[0][j] = mt * mt * mt * x0 + 3 * mt * mt * t * x1 + 3 * mt * t * t * x2 + t * t * t * x3;
|
||||
bounds[1][j] = mt * mt * mt * y0 + 3 * mt * mt * t * y1 + 3 * mt * t * t * y2 + t * t * t * y3;
|
||||
const mt = 1 - t;
|
||||
const tt = t * t;
|
||||
const ttt = tt * t;
|
||||
const x = mt * (mt * (mt * x0 + 3 * t * x1) + 3 * tt * x2) + ttt * x3;
|
||||
const y = mt * (mt * (mt * y0 + 3 * t * y1) + 3 * tt * y2) + ttt * y3;
|
||||
minMax[0] = Math.min(minMax[0], x);
|
||||
minMax[1] = Math.min(minMax[1], y);
|
||||
minMax[2] = Math.max(minMax[2], x);
|
||||
minMax[3] = Math.max(minMax[3], y);
|
||||
}
|
||||
static #getExtremum(x0, x1, x2, x3, y0, y1, y2, y3, a, b, c, minMax) {
|
||||
if (Math.abs(a) < 1e-12) {
|
||||
if (Math.abs(b) >= 1e-12) {
|
||||
this.#getExtremumOnCurve(x0, x1, x2, x3, y0, y1, y2, y3, -c / b, minMax);
|
||||
}
|
||||
return;
|
||||
}
|
||||
bounds[0][jlen] = x0;
|
||||
bounds[1][jlen] = y0;
|
||||
bounds[0][jlen + 1] = x3;
|
||||
bounds[1][jlen + 1] = y3;
|
||||
bounds[0].length = bounds[1].length = jlen + 2;
|
||||
return [Math.min(...bounds[0]), Math.min(...bounds[1]), Math.max(...bounds[0]), Math.max(...bounds[1])];
|
||||
const delta = b ** 2 - 4 * c * a;
|
||||
if (delta < 0) {
|
||||
return;
|
||||
}
|
||||
const sqrtDelta = Math.sqrt(delta);
|
||||
const a2 = 2 * a;
|
||||
this.#getExtremumOnCurve(x0, x1, x2, x3, y0, y1, y2, y3, (-b + sqrtDelta) / a2, minMax);
|
||||
this.#getExtremumOnCurve(x0, x1, x2, x3, y0, y1, y2, y3, (-b - sqrtDelta) / a2, minMax);
|
||||
}
|
||||
static bezierBoundingBox(x0, y0, x1, y1, x2, y2, x3, y3, minMax) {
|
||||
if (minMax) {
|
||||
minMax[0] = Math.min(minMax[0], x0, x3);
|
||||
minMax[1] = Math.min(minMax[1], y0, y3);
|
||||
minMax[2] = Math.max(minMax[2], x0, x3);
|
||||
minMax[3] = Math.max(minMax[3], y0, y3);
|
||||
} else {
|
||||
minMax = [Math.min(x0, x3), Math.min(y0, y3), Math.max(x0, x3), Math.max(y0, y3)];
|
||||
}
|
||||
this.#getExtremum(x0, x1, x2, x3, y0, y1, y2, y3, 3 * (-x0 + 3 * (x1 - x2) + x3), 6 * (x0 - 2 * x1 + x2), 3 * (x1 - x0), minMax);
|
||||
this.#getExtremum(x0, x1, x2, x3, y0, y1, y2, y3, 3 * (-y0 + 3 * (y1 - y2) + y3), 6 * (y0 - 2 * y1 + y2), 3 * (y1 - y0), minMax);
|
||||
return minMax;
|
||||
}
|
||||
}
|
||||
const PDFStringTranslateTable = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2d8, 0x2c7, 0x2c6, 0x2d9, 0x2dd, 0x2db, 0x2da, 0x2dc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2022, 0x2020, 0x2021, 0x2026, 0x2014, 0x2013, 0x192, 0x2044, 0x2039, 0x203a, 0x2212, 0x2030, 0x201e, 0x201c, 0x201d, 0x2018, 0x2019, 0x201a, 0x2122, 0xfb01, 0xfb02, 0x141, 0x152, 0x160, 0x178, 0x17d, 0x131, 0x142, 0x153, 0x161, 0x17e, 0, 0x20ac];
|
||||
|
|
@ -737,9 +727,6 @@ function stringToUTF8String(str) {
|
|||
function utf8StringToString(str) {
|
||||
return unescape(encodeURIComponent(str));
|
||||
}
|
||||
function isArrayBuffer(v) {
|
||||
return typeof v === "object" && v?.byteLength !== undefined;
|
||||
}
|
||||
function isArrayEqual(arr1, arr2) {
|
||||
if (arr1.length !== arr2.length) {
|
||||
return false;
|
||||
|
|
@ -780,9 +767,7 @@ function normalizeUnicode(str) {
|
|||
NormalizeRegex = /([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu;
|
||||
NormalizationMap = new Map([["ſt", "ſt"]]);
|
||||
}
|
||||
return str.replaceAll(NormalizeRegex, (_, p1, p2) => {
|
||||
return p1 ? p1.normalize("NFKC") : NormalizationMap.get(p2);
|
||||
});
|
||||
return str.replaceAll(NormalizeRegex, (_, p1, p2) => p1 ? p1.normalize("NFKC") : NormalizationMap.get(p2));
|
||||
}
|
||||
function getUuid() {
|
||||
return crypto.randomUUID();
|
||||
|
|
@ -1366,6 +1351,15 @@ const XMLEntities = {
|
|||
0x22: """,
|
||||
0x27: "'"
|
||||
};
|
||||
function* codePointIter(str) {
|
||||
for (let i = 0, ii = str.length; i < ii; i++) {
|
||||
const char = str.codePointAt(i);
|
||||
if (char > 0xd7ff && (char < 0xe000 || char > 0xfffd)) {
|
||||
i++;
|
||||
}
|
||||
yield char;
|
||||
}
|
||||
}
|
||||
function encodeToXmlString(str) {
|
||||
const buffer = [];
|
||||
let start = 0;
|
||||
|
|
@ -11290,9 +11284,7 @@ async function createBuiltInCMap(name, fetchBuiltInCMap) {
|
|||
} = await fetchBuiltInCMap(name);
|
||||
const cMap = new CMap(true);
|
||||
if (compressionType === CMapCompressionType.BINARY) {
|
||||
return new BinaryCMapReader().process(cMapData, cMap, useCMap => {
|
||||
return extendCMap(cMap, fetchBuiltInCMap, useCMap);
|
||||
});
|
||||
return new BinaryCMapReader().process(cMapData, cMap, useCMap => extendCMap(cMap, fetchBuiltInCMap, useCMap));
|
||||
}
|
||||
if (compressionType === CMapCompressionType.NONE) {
|
||||
const lexer = new Lexer(new Stream(cMapData));
|
||||
|
|
@ -25279,15 +25271,11 @@ class Font {
|
|||
endOffset: 0
|
||||
});
|
||||
}
|
||||
locaEntries.sort((a, b) => {
|
||||
return a.offset - b.offset;
|
||||
});
|
||||
locaEntries.sort((a, b) => a.offset - b.offset);
|
||||
for (i = 0; i < numGlyphs; i++) {
|
||||
locaEntries[i].endOffset = locaEntries[i + 1].offset;
|
||||
}
|
||||
locaEntries.sort((a, b) => {
|
||||
return a.index - b.index;
|
||||
});
|
||||
locaEntries.sort((a, b) => a.index - b.index);
|
||||
for (i = 0; i < numGlyphs; i++) {
|
||||
const {
|
||||
offset,
|
||||
|
|
@ -29590,7 +29578,6 @@ class ImageResizer {
|
|||
ImageResizer._goodSquareLength = MIN_IMAGE_DIM;
|
||||
|
||||
;// CONCATENATED MODULE: ./src/shared/murmurhash3.js
|
||||
|
||||
const SEED = 0xc3d2e1f0;
|
||||
const MASK_HIGH = 0xffff0000;
|
||||
const MASK_LOW = 0xffff;
|
||||
|
|
@ -29613,11 +29600,11 @@ class MurmurHash3_64 {
|
|||
data[length++] = code & 0xff;
|
||||
}
|
||||
}
|
||||
} else if (isArrayBuffer(input)) {
|
||||
} else if (ArrayBuffer.isView(input)) {
|
||||
data = input.slice();
|
||||
length = data.byteLength;
|
||||
} else {
|
||||
throw new Error("Wrong data format in MurmurHash3_64_update. " + "Input must be a string or array.");
|
||||
throw new Error("Invalid data format, must be a string or TypedArray.");
|
||||
}
|
||||
const blockCounts = length >> 2;
|
||||
const tailLength = length - blockCounts * 4;
|
||||
|
|
@ -31312,21 +31299,20 @@ class PartialEvaluator {
|
|||
}
|
||||
const args = group ? [matrix, null] : [matrix, bbox];
|
||||
operatorList.addOp(OPS.paintFormXObjectBegin, args);
|
||||
return this.getOperatorList({
|
||||
await this.getOperatorList({
|
||||
stream: xobj,
|
||||
task,
|
||||
resources: dict.get("Resources") || resources,
|
||||
operatorList,
|
||||
initialState
|
||||
}).then(function () {
|
||||
operatorList.addOp(OPS.paintFormXObjectEnd, []);
|
||||
if (group) {
|
||||
operatorList.addOp(OPS.endGroup, [groupOptions]);
|
||||
}
|
||||
if (optionalContent !== undefined) {
|
||||
operatorList.addOp(OPS.endMarkedContent, []);
|
||||
}
|
||||
});
|
||||
operatorList.addOp(OPS.paintFormXObjectEnd, []);
|
||||
if (group) {
|
||||
operatorList.addOp(OPS.endGroup, [groupOptions]);
|
||||
}
|
||||
if (optionalContent !== undefined) {
|
||||
operatorList.addOp(OPS.endMarkedContent, []);
|
||||
}
|
||||
}
|
||||
_sendImgData(objId, imgData, cacheGlobally = false) {
|
||||
const transfers = imgData ? [imgData.bitmap || imgData.data.buffer] : null;
|
||||
|
|
@ -31624,28 +31610,25 @@ class PartialEvaluator {
|
|||
throw reason;
|
||||
});
|
||||
}
|
||||
handleSetFont(resources, fontArgs, fontRef, operatorList, task, state, fallbackFontDict = null, cssFontInfo = null) {
|
||||
async handleSetFont(resources, fontArgs, fontRef, operatorList, task, state, fallbackFontDict = null, cssFontInfo = null) {
|
||||
const fontName = fontArgs?.[0] instanceof Name ? fontArgs[0].name : null;
|
||||
return this.loadFont(fontName, fontRef, resources, fallbackFontDict, cssFontInfo).then(translated => {
|
||||
if (!translated.font.isType3Font) {
|
||||
return translated;
|
||||
}
|
||||
return translated.loadType3Data(this, resources, task).then(function () {
|
||||
let translated = await this.loadFont(fontName, fontRef, resources, fallbackFontDict, cssFontInfo);
|
||||
if (translated.font.isType3Font) {
|
||||
try {
|
||||
await translated.loadType3Data(this, resources, task);
|
||||
operatorList.addDependencies(translated.type3Dependencies);
|
||||
return translated;
|
||||
}).catch(reason => {
|
||||
return new TranslatedFont({
|
||||
} catch (reason) {
|
||||
translated = new TranslatedFont({
|
||||
loadedName: "g_font_error",
|
||||
font: new ErrorFont(`Type3 font load error: ${reason}`),
|
||||
dict: translated.font,
|
||||
evaluatorOptions: this.options
|
||||
});
|
||||
});
|
||||
}).then(translated => {
|
||||
state.font = translated.font;
|
||||
translated.send(this.handler);
|
||||
return translated.loadedName;
|
||||
});
|
||||
}
|
||||
}
|
||||
state.font = translated.font;
|
||||
translated.send(this.handler);
|
||||
return translated.loadedName;
|
||||
}
|
||||
handleText(chars, state) {
|
||||
const font = state.font;
|
||||
|
|
@ -31701,12 +31684,10 @@ class PartialEvaluator {
|
|||
break;
|
||||
case "Font":
|
||||
isSimpleGState = false;
|
||||
promise = promise.then(() => {
|
||||
return this.handleSetFont(resources, null, value[0], operatorList, task, stateManager.state).then(function (loadedName) {
|
||||
operatorList.addDependency(loadedName);
|
||||
gStateObj.push([key, [loadedName, value[1]]]);
|
||||
});
|
||||
});
|
||||
promise = promise.then(() => this.handleSetFont(resources, null, value[0], operatorList, task, stateManager.state).then(function (loadedName) {
|
||||
operatorList.addDependency(loadedName);
|
||||
gStateObj.push([key, [loadedName, value[1]]]);
|
||||
}));
|
||||
break;
|
||||
case "BM":
|
||||
gStateObj.push([key, normalizeBlendMode(value)]);
|
||||
|
|
@ -31718,9 +31699,7 @@ class PartialEvaluator {
|
|||
}
|
||||
if (value instanceof Dict) {
|
||||
isSimpleGState = false;
|
||||
promise = promise.then(() => {
|
||||
return this.handleSMask(value, resources, operatorList, task, stateManager, localColorSpaceCache);
|
||||
});
|
||||
promise = promise.then(() => this.handleSMask(value, resources, operatorList, task, stateManager, localColorSpaceCache));
|
||||
gStateObj.push([key, true]);
|
||||
} else {
|
||||
warn("Unsupported SMask type");
|
||||
|
|
@ -31750,14 +31729,13 @@ class PartialEvaluator {
|
|||
break;
|
||||
}
|
||||
}
|
||||
return promise.then(function () {
|
||||
if (gStateObj.length > 0) {
|
||||
operatorList.addOp(OPS.setGState, [gStateObj]);
|
||||
}
|
||||
if (isSimpleGState) {
|
||||
localGStateCache.set(cacheKey, gStateRef, gStateObj);
|
||||
}
|
||||
});
|
||||
await promise;
|
||||
if (gStateObj.length > 0) {
|
||||
operatorList.addOp(OPS.setGState, [gStateObj]);
|
||||
}
|
||||
if (isSimpleGState) {
|
||||
localGStateCache.set(cacheKey, gStateRef, gStateObj);
|
||||
}
|
||||
}
|
||||
loadFont(fontName, font, resources, fallbackFontDict = null, cssFontInfo = null) {
|
||||
const errorFont = async () => {
|
||||
|
|
@ -31875,14 +31853,14 @@ class PartialEvaluator {
|
|||
case OPS.rectangle:
|
||||
const x = args[0] + args[2];
|
||||
const y = args[1] + args[3];
|
||||
minMax = [Math.min(args[0], x), Math.max(args[0], x), Math.min(args[1], y), Math.max(args[1], y)];
|
||||
minMax = [Math.min(args[0], x), Math.min(args[1], y), Math.max(args[0], x), Math.max(args[1], y)];
|
||||
break;
|
||||
case OPS.moveTo:
|
||||
case OPS.lineTo:
|
||||
minMax = [args[0], args[0], args[1], args[1]];
|
||||
minMax = [args[0], args[1], args[0], args[1]];
|
||||
break;
|
||||
default:
|
||||
minMax = [Infinity, -Infinity, Infinity, -Infinity];
|
||||
minMax = [Infinity, Infinity, -Infinity, -Infinity];
|
||||
break;
|
||||
}
|
||||
operatorList.addOp(OPS.constructPath, [[fn], args, minMax]);
|
||||
|
|
@ -31899,15 +31877,15 @@ class PartialEvaluator {
|
|||
const x = args[0] + args[2];
|
||||
const y = args[1] + args[3];
|
||||
minMax[0] = Math.min(minMax[0], args[0], x);
|
||||
minMax[1] = Math.max(minMax[1], args[0], x);
|
||||
minMax[2] = Math.min(minMax[2], args[1], y);
|
||||
minMax[1] = Math.min(minMax[1], args[1], y);
|
||||
minMax[2] = Math.max(minMax[2], args[0], x);
|
||||
minMax[3] = Math.max(minMax[3], args[1], y);
|
||||
break;
|
||||
case OPS.moveTo:
|
||||
case OPS.lineTo:
|
||||
minMax[0] = Math.min(minMax[0], args[0]);
|
||||
minMax[1] = Math.max(minMax[1], args[0]);
|
||||
minMax[2] = Math.min(minMax[2], args[1]);
|
||||
minMax[1] = Math.min(minMax[1], args[1]);
|
||||
minMax[2] = Math.max(minMax[2], args[0]);
|
||||
minMax[3] = Math.max(minMax[3], args[1]);
|
||||
break;
|
||||
}
|
||||
|
|
@ -32701,19 +32679,16 @@ class PartialEvaluator {
|
|||
hasEOL: textChunk.hasEOL
|
||||
};
|
||||
}
|
||||
function handleSetFont(fontName, fontRef) {
|
||||
return self.loadFont(fontName, fontRef, resources).then(function (translated) {
|
||||
if (!translated.font.isType3Font) {
|
||||
return translated;
|
||||
}
|
||||
return translated.loadType3Data(self, resources, task).catch(function () {}).then(function () {
|
||||
return translated;
|
||||
});
|
||||
}).then(function (translated) {
|
||||
textState.loadedName = translated.loadedName;
|
||||
textState.font = translated.font;
|
||||
textState.fontMatrix = translated.font.fontMatrix || FONT_IDENTITY_MATRIX;
|
||||
});
|
||||
async function handleSetFont(fontName, fontRef) {
|
||||
const translated = await self.loadFont(fontName, fontRef, resources);
|
||||
if (translated.font.isType3Font) {
|
||||
try {
|
||||
await translated.loadType3Data(self, resources, task);
|
||||
} catch {}
|
||||
}
|
||||
textState.loadedName = translated.loadedName;
|
||||
textState.font = translated.font;
|
||||
textState.fontMatrix = translated.font.fontMatrix || FONT_IDENTITY_MATRIX;
|
||||
}
|
||||
function applyInverseRotation(x, y, matrix) {
|
||||
const scale = Math.hypot(matrix[0], matrix[1]);
|
||||
|
|
@ -33334,10 +33309,10 @@ class PartialEvaluator {
|
|||
throw reason;
|
||||
});
|
||||
}
|
||||
extractDataStructures(dict, baseDict, properties) {
|
||||
async extractDataStructures(dict, properties) {
|
||||
const xref = this.xref;
|
||||
let cidToGidBytes;
|
||||
const toUnicodePromise = this.readToUnicode(properties.toUnicode || dict.get("ToUnicode") || baseDict.get("ToUnicode"));
|
||||
const toUnicodePromise = this.readToUnicode(properties.toUnicode);
|
||||
if (properties.composite) {
|
||||
const cidSystemInfo = dict.get("CIDSystemInfo");
|
||||
if (cidSystemInfo instanceof Dict) {
|
||||
|
|
@ -33426,16 +33401,13 @@ class PartialEvaluator {
|
|||
properties.baseEncodingName = baseEncodingName;
|
||||
properties.hasEncoding = !!baseEncodingName || differences.length > 0;
|
||||
properties.dict = dict;
|
||||
return toUnicodePromise.then(readToUnicode => {
|
||||
properties.toUnicode = readToUnicode;
|
||||
return this.buildToUnicode(properties);
|
||||
}).then(builtToUnicode => {
|
||||
properties.toUnicode = builtToUnicode;
|
||||
if (cidToGidBytes) {
|
||||
properties.cidToGidMap = this.readCidToGidMap(cidToGidBytes, builtToUnicode);
|
||||
}
|
||||
return properties;
|
||||
});
|
||||
properties.toUnicode = await toUnicodePromise;
|
||||
const builtToUnicode = await this.buildToUnicode(properties);
|
||||
properties.toUnicode = builtToUnicode;
|
||||
if (cidToGidBytes) {
|
||||
properties.cidToGidMap = this.readCidToGidMap(cidToGidBytes, builtToUnicode);
|
||||
}
|
||||
return properties;
|
||||
}
|
||||
_simpleFontToUnicode(properties, forceGlyphs = false) {
|
||||
assert(!properties.composite, "Must be a simple font.");
|
||||
|
|
@ -33557,27 +33529,28 @@ class PartialEvaluator {
|
|||
}
|
||||
return new IdentityToUnicodeMap(properties.firstChar, properties.lastChar);
|
||||
}
|
||||
readToUnicode(cmapObj) {
|
||||
async readToUnicode(cmapObj) {
|
||||
if (!cmapObj) {
|
||||
return Promise.resolve(null);
|
||||
return null;
|
||||
}
|
||||
if (cmapObj instanceof Name) {
|
||||
return CMapFactory.create({
|
||||
const cmap = await CMapFactory.create({
|
||||
encoding: cmapObj,
|
||||
fetchBuiltInCMap: this._fetchBuiltInCMapBound,
|
||||
useCMap: null
|
||||
}).then(function (cmap) {
|
||||
if (cmap instanceof IdentityCMap) {
|
||||
return new IdentityToUnicodeMap(0, 0xffff);
|
||||
}
|
||||
return new ToUnicodeMap(cmap.getMap());
|
||||
});
|
||||
} else if (cmapObj instanceof BaseStream) {
|
||||
return CMapFactory.create({
|
||||
encoding: cmapObj,
|
||||
fetchBuiltInCMap: this._fetchBuiltInCMapBound,
|
||||
useCMap: null
|
||||
}).then(function (cmap) {
|
||||
if (cmap instanceof IdentityCMap) {
|
||||
return new IdentityToUnicodeMap(0, 0xffff);
|
||||
}
|
||||
return new ToUnicodeMap(cmap.getMap());
|
||||
}
|
||||
if (cmapObj instanceof BaseStream) {
|
||||
try {
|
||||
const cmap = await CMapFactory.create({
|
||||
encoding: cmapObj,
|
||||
fetchBuiltInCMap: this._fetchBuiltInCMapBound,
|
||||
useCMap: null
|
||||
});
|
||||
if (cmap instanceof IdentityCMap) {
|
||||
return new IdentityToUnicodeMap(0, 0xffff);
|
||||
}
|
||||
|
|
@ -33601,7 +33574,7 @@ class PartialEvaluator {
|
|||
map[charCode] = String.fromCodePoint(...str);
|
||||
});
|
||||
return new ToUnicodeMap(map);
|
||||
}, reason => {
|
||||
} catch (reason) {
|
||||
if (reason instanceof AbortException) {
|
||||
return null;
|
||||
}
|
||||
|
|
@ -33610,9 +33583,9 @@ class PartialEvaluator {
|
|||
return null;
|
||||
}
|
||||
throw reason;
|
||||
});
|
||||
}
|
||||
}
|
||||
return Promise.resolve(null);
|
||||
return null;
|
||||
}
|
||||
readCidToGidMap(glyphsData, toUnicode) {
|
||||
const result = [];
|
||||
|
|
@ -33767,7 +33740,7 @@ class PartialEvaluator {
|
|||
throw new FormatError("invalid font Subtype");
|
||||
}
|
||||
let composite = false;
|
||||
let hash, toUnicode;
|
||||
let hash;
|
||||
if (type.name === "Type0") {
|
||||
const df = dict.get("DescendantFonts");
|
||||
if (!df) {
|
||||
|
|
@ -33786,6 +33759,7 @@ class PartialEvaluator {
|
|||
const firstChar = dict.get("FirstChar") || 0,
|
||||
lastChar = dict.get("LastChar") || (composite ? 0xffff : 0xff);
|
||||
const descriptor = dict.get("FontDescriptor");
|
||||
const toUnicode = dict.get("ToUnicode") || baseDict.get("ToUnicode");
|
||||
if (descriptor) {
|
||||
hash = new MurmurHash3_64();
|
||||
const encoding = baseDict.getRaw("Encoding");
|
||||
|
|
@ -33815,7 +33789,6 @@ class PartialEvaluator {
|
|||
}
|
||||
}
|
||||
hash.update(`${firstChar}-${lastChar}`);
|
||||
toUnicode = dict.get("ToUnicode") || baseDict.get("ToUnicode");
|
||||
if (toUnicode instanceof BaseStream) {
|
||||
const stream = toUnicode.str || toUnicode;
|
||||
const uint8array = stream.buffer ? new Uint8Array(stream.buffer.buffer, 0, stream.bufferLength) : new Uint8Array(stream.bytes.buffer, stream.start, stream.end - stream.start);
|
||||
|
|
@ -33887,7 +33860,6 @@ class PartialEvaluator {
|
|||
cssFontInfo
|
||||
}) {
|
||||
const isType3Font = type === "Type3";
|
||||
let properties;
|
||||
if (!descriptor) {
|
||||
if (isType3Font) {
|
||||
descriptor = new Dict(null);
|
||||
|
|
@ -33902,7 +33874,7 @@ class PartialEvaluator {
|
|||
const metrics = this.getBaseFontMetrics(baseFontName);
|
||||
const fontNameWoStyle = baseFontName.split("-")[0];
|
||||
const flags = (this.isSerifFont(fontNameWoStyle) ? FontFlags.Serif : 0) | (metrics.monospace ? FontFlags.FixedPitch : 0) | (getSymbolsFonts()[fontNameWoStyle] ? FontFlags.Symbolic : FontFlags.Nonsymbolic);
|
||||
properties = {
|
||||
const properties = {
|
||||
type,
|
||||
name: baseFontName,
|
||||
loadedName: baseDict.loadedName,
|
||||
|
|
@ -33929,19 +33901,18 @@ class PartialEvaluator {
|
|||
if (!properties.isInternalFont && this.options.useSystemFonts) {
|
||||
properties.systemFontInfo = getFontSubstitution(this.systemFontCache, this.idFactory, this.options.standardFontDataUrl, baseFontName, standardFontName);
|
||||
}
|
||||
return this.extractDataStructures(dict, dict, properties).then(newProperties => {
|
||||
if (widths) {
|
||||
const glyphWidths = [];
|
||||
let j = firstChar;
|
||||
for (const width of widths) {
|
||||
glyphWidths[j++] = this.xref.fetchIfRef(width);
|
||||
}
|
||||
newProperties.widths = glyphWidths;
|
||||
} else {
|
||||
newProperties.widths = this.buildCharCodeToWidth(metrics.widths, newProperties);
|
||||
const newProperties = await this.extractDataStructures(dict, properties);
|
||||
if (widths) {
|
||||
const glyphWidths = [];
|
||||
let j = firstChar;
|
||||
for (const width of widths) {
|
||||
glyphWidths[j++] = this.xref.fetchIfRef(width);
|
||||
}
|
||||
return new Font(baseFontName, file, newProperties);
|
||||
});
|
||||
newProperties.widths = glyphWidths;
|
||||
} else {
|
||||
newProperties.widths = this.buildCharCodeToWidth(metrics.widths, newProperties);
|
||||
}
|
||||
return new Font(baseFontName, file, newProperties);
|
||||
}
|
||||
}
|
||||
let fontName = descriptor.get("FontName");
|
||||
|
|
@ -34008,7 +33979,7 @@ class PartialEvaluator {
|
|||
systemFontInfo = getFontSubstitution(this.systemFontCache, this.idFactory, this.options.standardFontDataUrl, fontName.name, standardFontName);
|
||||
}
|
||||
}
|
||||
properties = {
|
||||
const properties = {
|
||||
type,
|
||||
name: fontName.name,
|
||||
subtype,
|
||||
|
|
@ -34049,10 +34020,9 @@ class PartialEvaluator {
|
|||
properties.cMap = cMap;
|
||||
properties.vertical = properties.cMap.vertical;
|
||||
}
|
||||
return this.extractDataStructures(dict, baseDict, properties).then(newProperties => {
|
||||
this.extractWidths(dict, descriptor, newProperties);
|
||||
return new Font(fontName.name, fontFile, newProperties);
|
||||
});
|
||||
const newProperties = await this.extractDataStructures(dict, properties);
|
||||
this.extractWidths(dict, descriptor, newProperties);
|
||||
return new Font(fontName.name, fontFile, newProperties);
|
||||
}
|
||||
static buildFontPaths(font, glyphs, handler, evaluatorOptions) {
|
||||
function buildPath(fontChar) {
|
||||
|
|
@ -34332,7 +34302,7 @@ class EvalState {
|
|||
}
|
||||
class EvaluatorPreprocessor {
|
||||
static get opMap() {
|
||||
return shadow(this, "opMap", {
|
||||
return shadow(this, "opMap", Object.assign(Object.create(null), {
|
||||
w: {
|
||||
id: OPS.setLineWidth,
|
||||
numArgs: 1,
|
||||
|
|
@ -34708,7 +34678,7 @@ class EvaluatorPreprocessor {
|
|||
nu: null,
|
||||
nul: null,
|
||||
null: null
|
||||
});
|
||||
}));
|
||||
}
|
||||
static MAX_INVALID_PATH_OPS = 10;
|
||||
constructor(stream, xref, stateManager = new StateManager()) {
|
||||
|
|
@ -35008,31 +34978,6 @@ class FakeUnicodeFont {
|
|||
}
|
||||
this.fontName = Name.get(`InvalidPDFjsFont_${fontFamily}_${FakeUnicodeFont._fontNameId++}`);
|
||||
}
|
||||
get toUnicodeRef() {
|
||||
if (!FakeUnicodeFont._toUnicodeRef) {
|
||||
const toUnicode = `/CIDInit /ProcSet findresource begin
|
||||
12 dict begin
|
||||
begincmap
|
||||
/CIDSystemInfo
|
||||
<< /Registry (Adobe)
|
||||
/Ordering (UCS) /Supplement 0 >> def
|
||||
/CMapName /Adobe-Identity-UCS def
|
||||
/CMapType 2 def
|
||||
1 begincodespacerange
|
||||
<0000> <FFFF>
|
||||
endcodespacerange
|
||||
1 beginbfrange
|
||||
<0000> <FFFF> <0000>
|
||||
endbfrange
|
||||
endcmap CMapName currentdict /CMap defineresource pop end end`;
|
||||
const toUnicodeStream = FakeUnicodeFont.toUnicodeStream = new StringStream(toUnicode);
|
||||
const toUnicodeDict = new Dict(this.xref);
|
||||
toUnicodeStream.dict = toUnicodeDict;
|
||||
toUnicodeDict.set("Length", toUnicode.length);
|
||||
FakeUnicodeFont._toUnicodeRef = this.xref.getNewPersistentRef(toUnicodeStream);
|
||||
}
|
||||
return FakeUnicodeFont._toUnicodeRef;
|
||||
}
|
||||
get fontDescriptorRef() {
|
||||
if (!FakeUnicodeFont._fontDescriptorRef) {
|
||||
const fontDescriptor = new Dict(this.xref);
|
||||
|
|
@ -35093,7 +35038,7 @@ endcmap CMapName currentdict /CMap defineresource pop end end`;
|
|||
baseFont.set("Subtype", Name.get("Type0"));
|
||||
baseFont.set("Encoding", Name.get("Identity-H"));
|
||||
baseFont.set("DescendantFonts", [this.descendantFontRef]);
|
||||
baseFont.set("ToUnicode", this.toUnicodeRef);
|
||||
baseFont.set("ToUnicode", Name.get("Identity-H"));
|
||||
return this.xref.getNewPersistentRef(baseFont);
|
||||
}
|
||||
get resources() {
|
||||
|
|
@ -35148,8 +35093,8 @@ endcmap CMapName currentdict /CMap defineresource pop end end`;
|
|||
lines.push(line);
|
||||
const lineWidth = ctx.measureText(line).width;
|
||||
maxWidth = Math.max(maxWidth, lineWidth);
|
||||
for (const char of line.split("")) {
|
||||
const code = char.charCodeAt(0);
|
||||
for (const code of codePointIter(line)) {
|
||||
const char = String.fromCodePoint(code);
|
||||
let width = this.widths.get(code);
|
||||
if (width === undefined) {
|
||||
const metrics = ctx.measureText(char);
|
||||
|
|
@ -37255,7 +37200,7 @@ async function writeObject(ref, obj, buffer, {
|
|||
await writeDict(obj, buffer, transform);
|
||||
} else if (obj instanceof BaseStream) {
|
||||
await writeStream(obj, buffer, transform);
|
||||
} else if (Array.isArray(obj)) {
|
||||
} else if (Array.isArray(obj) || ArrayBuffer.isView(obj)) {
|
||||
await writeArray(obj, buffer, transform);
|
||||
}
|
||||
buffer.push("\nendobj\n");
|
||||
|
|
@ -37330,7 +37275,7 @@ async function writeValue(value, buffer, transform) {
|
|||
buffer.push(`/${escapePDFName(value.name)}`);
|
||||
} else if (value instanceof Ref) {
|
||||
buffer.push(`${value.num} ${value.gen} R`);
|
||||
} else if (Array.isArray(value)) {
|
||||
} else if (Array.isArray(value) || ArrayBuffer.isView(value)) {
|
||||
await writeArray(value, buffer, transform);
|
||||
} else if (typeof value === "string") {
|
||||
if (transform) {
|
||||
|
|
@ -37524,9 +37469,7 @@ async function incrementalUpdate({
|
|||
ref: refForXrefTable,
|
||||
data: ""
|
||||
});
|
||||
newRefs = newRefs.sort((a, b) => {
|
||||
return a.ref.num - b.ref.num;
|
||||
});
|
||||
newRefs = newRefs.sort((a, b) => a.ref.num - b.ref.num);
|
||||
const xrefTableData = [[0, 1, 0xffff]];
|
||||
const indexes = [0, 1];
|
||||
let maxOffset = 0;
|
||||
|
|
@ -39036,9 +38979,7 @@ class Catalog {
|
|||
break;
|
||||
case "PrintPageRange":
|
||||
if (Array.isArray(value) && value.length % 2 === 0) {
|
||||
const isValid = value.every((page, i, arr) => {
|
||||
return Number.isInteger(page) && page > 0 && (i === 0 || page >= arr[i - 1]) && page <= this.numPages;
|
||||
});
|
||||
const isValid = value.every((page, i, arr) => Number.isInteger(page) && page > 0 && (i === 0 || page >= arr[i - 1]) && page <= this.numPages);
|
||||
if (isValid) {
|
||||
prefValue = value;
|
||||
}
|
||||
|
|
@ -40010,12 +39951,10 @@ function getRelevant(data) {
|
|||
if (!data) {
|
||||
return [];
|
||||
}
|
||||
return data.trim().split(/\s+/).map(e => {
|
||||
return {
|
||||
excluded: e[0] === "-",
|
||||
viewname: e.substring(1)
|
||||
};
|
||||
});
|
||||
return data.trim().split(/\s+/).map(e => ({
|
||||
excluded: e[0] === "-",
|
||||
viewname: e.substring(1)
|
||||
}));
|
||||
}
|
||||
function getColor(data, def = [0, 0, 0]) {
|
||||
let [r, g, b] = def;
|
||||
|
|
@ -50653,7 +50592,11 @@ class AnnotationFactory {
|
|||
}));
|
||||
break;
|
||||
case AnnotationEditorType.HIGHLIGHT:
|
||||
promises.push(HighlightAnnotation.createNewAnnotation(xref, annotation, dependencies));
|
||||
if (annotation.quadPoints) {
|
||||
promises.push(HighlightAnnotation.createNewAnnotation(xref, annotation, dependencies));
|
||||
} else {
|
||||
promises.push(InkAnnotation.createNewAnnotation(xref, annotation, dependencies));
|
||||
}
|
||||
break;
|
||||
case AnnotationEditorType.INK:
|
||||
promises.push(InkAnnotation.createNewAnnotation(xref, annotation, dependencies));
|
||||
|
|
@ -50720,9 +50663,15 @@ class AnnotationFactory {
|
|||
}));
|
||||
break;
|
||||
case AnnotationEditorType.HIGHLIGHT:
|
||||
promises.push(HighlightAnnotation.createNewPrintAnnotation(annotationGlobals, xref, annotation, {
|
||||
evaluatorOptions: options
|
||||
}));
|
||||
if (annotation.quadPoints) {
|
||||
promises.push(HighlightAnnotation.createNewPrintAnnotation(annotationGlobals, xref, annotation, {
|
||||
evaluatorOptions: options
|
||||
}));
|
||||
} else {
|
||||
promises.push(InkAnnotation.createNewPrintAnnotation(annotationGlobals, xref, annotation, {
|
||||
evaluatorOptions: options
|
||||
}));
|
||||
}
|
||||
break;
|
||||
case AnnotationEditorType.INK:
|
||||
promises.push(InkAnnotation.createNewPrintAnnotation(annotationGlobals, xref, annotation, {
|
||||
|
|
@ -51740,9 +51689,7 @@ class WidgetAnnotation extends Annotation {
|
|||
path: this.data.fieldName,
|
||||
value
|
||||
};
|
||||
const encoder = val => {
|
||||
return isAscii(val) ? val : stringToUTF16String(val, true);
|
||||
};
|
||||
const encoder = val => isAscii(val) ? val : stringToUTF16String(val, true);
|
||||
dict.set("V", Array.isArray(value) ? value.map(encoder) : encoder(value));
|
||||
this.amendSavedDict(annotationStorage, dict);
|
||||
const maybeMK = this._getMKDict(rotation);
|
||||
|
|
@ -52880,7 +52827,7 @@ class FreeTextAnnotation extends MarkupAnnotation {
|
|||
const strokeAlpha = params.dict.get("CA");
|
||||
const fakeUnicodeFont = new FakeUnicodeFont(xref, "sans-serif");
|
||||
this.appearance = fakeUnicodeFont.createAppearance(this._contents.str, this.rectangle, this.rotation, fontSize, fontColor, strokeAlpha);
|
||||
this._streams.push(this.appearance, FakeUnicodeFont.toUnicodeStream);
|
||||
this._streams.push(this.appearance);
|
||||
} else {
|
||||
warn("FreeTextAnnotation: OffscreenCanvas is not supported, annotation may not render correctly.");
|
||||
}
|
||||
|
|
@ -53296,6 +53243,7 @@ class InkAnnotation extends MarkupAnnotation {
|
|||
color,
|
||||
opacity,
|
||||
paths,
|
||||
outlines,
|
||||
rect,
|
||||
rotation,
|
||||
thickness
|
||||
|
|
@ -53305,9 +53253,12 @@ class InkAnnotation extends MarkupAnnotation {
|
|||
ink.set("Subtype", Name.get("Ink"));
|
||||
ink.set("CreationDate", `D:${getModificationDate()}`);
|
||||
ink.set("Rect", rect);
|
||||
ink.set("InkList", paths.map(p => p.points));
|
||||
ink.set("InkList", outlines?.points || paths.map(p => p.points));
|
||||
ink.set("F", 4);
|
||||
ink.set("Rotate", rotation);
|
||||
if (outlines) {
|
||||
ink.set("IT", Name.get("InkHighlight"));
|
||||
}
|
||||
const bs = new Dict(xref);
|
||||
ink.set("BS", bs);
|
||||
bs.set("W", thickness);
|
||||
|
|
@ -53323,6 +53274,9 @@ class InkAnnotation extends MarkupAnnotation {
|
|||
return ink;
|
||||
}
|
||||
static async createNewAppearanceStream(annotation, xref, params) {
|
||||
if (annotation.outlines) {
|
||||
return this.createNewAppearanceStreamForHighlight(annotation, xref, params);
|
||||
}
|
||||
const {
|
||||
color,
|
||||
rect,
|
||||
|
|
@ -53372,6 +53326,48 @@ class InkAnnotation extends MarkupAnnotation {
|
|||
ap.dict = appearanceStreamDict;
|
||||
return ap;
|
||||
}
|
||||
static async createNewAppearanceStreamForHighlight(annotation, xref, params) {
|
||||
const {
|
||||
color,
|
||||
rect,
|
||||
outlines: {
|
||||
outline
|
||||
},
|
||||
opacity
|
||||
} = annotation;
|
||||
const appearanceBuffer = [`${getPdfColor(color, true)}`, "/R0 gs"];
|
||||
appearanceBuffer.push(`${numberToString(outline[4])} ${numberToString(outline[5])} m`);
|
||||
for (let i = 6, ii = outline.length; i < ii; i += 6) {
|
||||
if (isNaN(outline[i]) || outline[i] === null) {
|
||||
appearanceBuffer.push(`${numberToString(outline[i + 4])} ${numberToString(outline[i + 5])} l`);
|
||||
} else {
|
||||
const curve = outline.slice(i, i + 6).map(numberToString).join(" ");
|
||||
appearanceBuffer.push(`${curve} c`);
|
||||
}
|
||||
}
|
||||
appearanceBuffer.push("h f");
|
||||
const appearance = appearanceBuffer.join("\n");
|
||||
const appearanceStreamDict = new Dict(xref);
|
||||
appearanceStreamDict.set("FormType", 1);
|
||||
appearanceStreamDict.set("Subtype", Name.get("Form"));
|
||||
appearanceStreamDict.set("Type", Name.get("XObject"));
|
||||
appearanceStreamDict.set("BBox", rect);
|
||||
appearanceStreamDict.set("Length", appearance.length);
|
||||
const resources = new Dict(xref);
|
||||
const extGState = new Dict(xref);
|
||||
resources.set("ExtGState", extGState);
|
||||
appearanceStreamDict.set("Resources", resources);
|
||||
const r0 = new Dict(xref);
|
||||
extGState.set("R0", r0);
|
||||
r0.set("BM", Name.get("Multiply"));
|
||||
if (opacity !== 1) {
|
||||
r0.set("ca", opacity);
|
||||
r0.set("Type", Name.get("ExtGState"));
|
||||
}
|
||||
const ap = new StringStream(appearance);
|
||||
ap.dict = appearanceStreamDict;
|
||||
return ap;
|
||||
}
|
||||
}
|
||||
class HighlightAnnotation extends MarkupAnnotation {
|
||||
constructor(params) {
|
||||
|
|
@ -53606,9 +53602,7 @@ class StampAnnotation extends MarkupAnnotation {
|
|||
const jpegBufferPromise = canvas.convertToBlob({
|
||||
type: "image/jpeg",
|
||||
quality: 1
|
||||
}).then(blob => {
|
||||
return blob.arrayBuffer();
|
||||
});
|
||||
}).then(blob => blob.arrayBuffer());
|
||||
const xobjectName = Name.get("XObject");
|
||||
const imageName = Name.get("Image");
|
||||
const image = new Dict(xref);
|
||||
|
|
@ -56594,7 +56588,7 @@ class WorkerMessageHandler {
|
|||
docId,
|
||||
apiVersion
|
||||
} = docParams;
|
||||
const workerVersion = '4.1.30';
|
||||
const workerVersion = "4.1.86";
|
||||
if (apiVersion !== workerVersion) {
|
||||
throw new Error(`The API version "${apiVersion}" does not match ` + `the Worker version "${workerVersion}".`);
|
||||
}
|
||||
|
|
@ -57155,8 +57149,8 @@ if (typeof window === "undefined" && !isNodeJS && typeof self !== "undefined" &&
|
|||
|
||||
;// CONCATENATED MODULE: ./src/pdf.worker.js
|
||||
|
||||
const pdfjsVersion = '4.1.30';
|
||||
const pdfjsBuild = 'a22b5a4f0';
|
||||
const pdfjsVersion = "4.1.86";
|
||||
const pdfjsBuild = "bf9236009";
|
||||
|
||||
var __webpack_exports__WorkerMessageHandler = __webpack_exports__.WorkerMessageHandler;
|
||||
export { __webpack_exports__WorkerMessageHandler as WorkerMessageHandler };
|
||||
|
|
|
|||
|
|
@ -18,12 +18,17 @@
|
|||
text-align:initial;
|
||||
inset:0;
|
||||
overflow:hidden;
|
||||
opacity:0.25;
|
||||
opacity:1;
|
||||
line-height:1;
|
||||
text-size-adjust:none;
|
||||
forced-color-adjust:none;
|
||||
transform-origin:0 0;
|
||||
z-index:2;
|
||||
caret-color:CanvasText;
|
||||
|
||||
&.drawing{
|
||||
touch-action:none;
|
||||
}
|
||||
|
||||
:is(span, br){
|
||||
color:transparent;
|
||||
|
|
@ -34,17 +39,22 @@
|
|||
}
|
||||
|
||||
.highlight{
|
||||
--highlight-bg-color:rgb(180 0 170);
|
||||
--highlight-selected-bg-color:rgb(0 100 0);
|
||||
--highlight-bg-color:rgb(180 0 170 / 0.25);
|
||||
--highlight-selected-bg-color:rgb(0 100 0 / 0.25);
|
||||
--highlight-backdrop-filter:none;
|
||||
--highlight-selected-backdrop-filter:none;
|
||||
|
||||
@media screen and (forced-colors: active){
|
||||
--highlight-bg-color:Highlight;
|
||||
--highlight-selected-bg-color:ButtonText;
|
||||
--highlight-bg-color:transparent;
|
||||
--highlight-selected-bg-color:transparent;
|
||||
--highlight-backdrop-filter:var(--hcm-highlight-filter);
|
||||
--highlight-selected-backdrop-filter:var(--hcm-highlight-selected-filter);
|
||||
}
|
||||
|
||||
margin:-1px;
|
||||
padding:1px;
|
||||
background-color:var(--highlight-bg-color);
|
||||
backdrop-filter:var(--highlight-backdrop-filter);
|
||||
border-radius:4px;
|
||||
|
||||
&.appended{
|
||||
|
|
@ -65,11 +75,12 @@
|
|||
|
||||
&.selected{
|
||||
background-color:var(--highlight-selected-bg-color);
|
||||
backdrop-filter:var(--highlight-selected-backdrop-filter);
|
||||
}
|
||||
}
|
||||
|
||||
::selection{
|
||||
background:AccentColor;
|
||||
background:color-mix(in srgb, AccentColor, transparent 75%);
|
||||
}
|
||||
|
||||
.endOfContent{
|
||||
|
|
@ -101,7 +112,6 @@
|
|||
--input-disabled-border-color:GrayText;
|
||||
--input-hover-border-color:Highlight;
|
||||
--link-outline:1.5px solid LinkText;
|
||||
--hcm-highlight-filter:invert(100%);
|
||||
|
||||
.textWidgetAnnotation :is(input, textarea):required,
|
||||
.choiceWidgetAnnotation select:required,
|
||||
|
|
@ -785,6 +795,13 @@
|
|||
--scale-factor:1;
|
||||
|
||||
padding-bottom:var(--pdfViewer-padding-bottom);
|
||||
|
||||
--hcm-highlight-filter:none;
|
||||
--hcm-highlight-selected-filter:none;
|
||||
|
||||
@media screen and (forced-colors: active){
|
||||
--hcm-highlight-filter:invert(100%);
|
||||
}
|
||||
}
|
||||
|
||||
.pdfViewer .canvasWrapper{
|
||||
|
|
|
|||
|
|
@ -182,15 +182,13 @@ function parseQueryString(query) {
|
|||
}
|
||||
return params;
|
||||
}
|
||||
const InvisibleCharactersRegExp = /[\x00-\x1F]/g;
|
||||
const InvisibleCharsRegExp = /[\x00-\x1F]/g;
|
||||
function removeNullCharacters(str, replaceInvisible = false) {
|
||||
if (!InvisibleCharactersRegExp.test(str)) {
|
||||
if (!InvisibleCharsRegExp.test(str)) {
|
||||
return str;
|
||||
}
|
||||
if (replaceInvisible) {
|
||||
return str.replaceAll(InvisibleCharactersRegExp, m => {
|
||||
return m === "\x00" ? "" : " ";
|
||||
});
|
||||
return str.replaceAll(InvisibleCharsRegExp, m => m === "\x00" ? "" : " ");
|
||||
}
|
||||
return str.replaceAll("\x00", "");
|
||||
}
|
||||
|
|
@ -992,9 +990,7 @@ function addLinkAttributes(link, {
|
|||
} else {
|
||||
link.href = "";
|
||||
link.title = `Disabled: ${url}`;
|
||||
link.onclick = () => {
|
||||
return false;
|
||||
};
|
||||
link.onclick = () => false;
|
||||
}
|
||||
let targetStr = "";
|
||||
switch (target) {
|
||||
|
|
@ -2128,9 +2124,7 @@ class PDFFindController {
|
|||
const extractTextCapability = new PromiseCapability();
|
||||
this._extractTextPromises[i] = extractTextCapability.promise;
|
||||
promise = promise.then(() => {
|
||||
return this._pdfDocument.getPage(i + 1).then(pdfPage => {
|
||||
return pdfPage.getTextContent(textOptions);
|
||||
}).then(textContent => {
|
||||
return this._pdfDocument.getPage(i + 1).then(pdfPage => pdfPage.getTextContent(textOptions)).then(textContent => {
|
||||
const strBuf = [];
|
||||
for (const textItem of textContent.items) {
|
||||
strBuf.push(textItem.str);
|
||||
|
|
@ -5036,7 +5030,7 @@ class PDFViewer {
|
|||
#scaleTimeoutId = null;
|
||||
#textLayerMode = TextLayerMode.ENABLE;
|
||||
constructor(options) {
|
||||
const viewerVersion = '4.1.30';
|
||||
const viewerVersion = "4.1.86";
|
||||
if (version !== viewerVersion) {
|
||||
throw new Error(`The API version "${version}" does not match the Viewer version "${viewerVersion}".`);
|
||||
}
|
||||
|
|
@ -5440,7 +5434,8 @@ class PDFViewer {
|
|||
});
|
||||
this.viewer.style.setProperty("--scale-factor", viewport.scale);
|
||||
if (this.pageColors?.foreground === "CanvasText" || this.pageColors?.background === "Canvas") {
|
||||
this.viewer.style.setProperty("--hcm-highlight-filter", pdfDocument.filterFactory.addHighlightHCMFilter("CanvasText", "Canvas", "HighlightText", "Highlight"));
|
||||
this.viewer.style.setProperty("--hcm-highlight-filter", pdfDocument.filterFactory.addHighlightHCMFilter("highlight", "CanvasText", "Canvas", "HighlightText", "Highlight"));
|
||||
this.viewer.style.setProperty("--hcm-highlight-selected-filter", pdfDocument.filterFactory.addHighlightHCMFilter("highlight_selected", "CanvasText", "Canvas", "HighlightText", "ButtonText"));
|
||||
}
|
||||
for (let pageNum = 1; pageNum <= pagesCount; ++pageNum) {
|
||||
const pageView = new PDFPageView({
|
||||
|
|
@ -7636,9 +7631,7 @@ const PDFViewerApplication = {
|
|||
this.pdfRenderingQueue.renderHighestPriority();
|
||||
},
|
||||
beforePrint() {
|
||||
this._printAnnotationStoragePromise = this.pdfScriptingManager.dispatchWillPrint().catch(() => {}).then(() => {
|
||||
return this.pdfDocument?.annotationStorage.print;
|
||||
});
|
||||
this._printAnnotationStoragePromise = this.pdfScriptingManager.dispatchWillPrint().catch(() => {}).then(() => this.pdfDocument?.annotationStorage.print);
|
||||
if (this.printService) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -8617,34 +8610,34 @@ const PDFPrintServiceFactory = {
|
|||
|
||||
class BasePreferences {
|
||||
#defaults = Object.freeze({
|
||||
"annotationEditorMode": 0,
|
||||
"annotationMode": 2,
|
||||
"cursorToolOnLoad": 0,
|
||||
"defaultZoomDelay": 400,
|
||||
"defaultZoomValue": "",
|
||||
"disablePageLabels": false,
|
||||
"enableHighlightEditor": false,
|
||||
"enablePermissions": false,
|
||||
"enablePrintAutoRotate": true,
|
||||
"enableScripting": true,
|
||||
"externalLinkTarget": 0,
|
||||
"highlightEditorColors": "yellow=#FFFF98,green=#53FFBC,blue=#80EBFF,pink=#FFCBE6,red=#FF4F5F",
|
||||
"historyUpdateUrl": false,
|
||||
"ignoreDestinationZoom": false,
|
||||
"forcePageColors": false,
|
||||
"pageColorsBackground": "Canvas",
|
||||
"pageColorsForeground": "CanvasText",
|
||||
"pdfBugEnabled": false,
|
||||
"sidebarViewOnLoad": -1,
|
||||
"scrollModeOnLoad": -1,
|
||||
"spreadModeOnLoad": -1,
|
||||
"textLayerMode": 1,
|
||||
"viewOnLoad": 0,
|
||||
"disableAutoFetch": false,
|
||||
"disableFontFace": false,
|
||||
"disableRange": false,
|
||||
"disableStream": false,
|
||||
"enableXfa": true
|
||||
annotationEditorMode: 0,
|
||||
annotationMode: 2,
|
||||
cursorToolOnLoad: 0,
|
||||
defaultZoomDelay: 400,
|
||||
defaultZoomValue: "",
|
||||
disablePageLabels: false,
|
||||
enableHighlightEditor: false,
|
||||
enablePermissions: false,
|
||||
enablePrintAutoRotate: true,
|
||||
enableScripting: true,
|
||||
externalLinkTarget: 0,
|
||||
highlightEditorColors: "yellow=#FFFF98,green=#53FFBC,blue=#80EBFF,pink=#FFCBE6,red=#FF4F5F",
|
||||
historyUpdateUrl: false,
|
||||
ignoreDestinationZoom: false,
|
||||
forcePageColors: false,
|
||||
pageColorsBackground: "Canvas",
|
||||
pageColorsForeground: "CanvasText",
|
||||
pdfBugEnabled: false,
|
||||
sidebarViewOnLoad: -1,
|
||||
scrollModeOnLoad: -1,
|
||||
spreadModeOnLoad: -1,
|
||||
textLayerMode: 1,
|
||||
viewOnLoad: 0,
|
||||
disableAutoFetch: false,
|
||||
disableFontFace: false,
|
||||
disableRange: false,
|
||||
disableStream: false,
|
||||
enableXfa: true
|
||||
});
|
||||
#prefs = Object.create(null);
|
||||
#initializedPromise = null;
|
||||
|
|
@ -8657,13 +8650,13 @@ class BasePreferences {
|
|||
prefs
|
||||
}) => {
|
||||
const BROWSER_PREFS = {
|
||||
"canvasMaxAreaInBytes": -1,
|
||||
"isInAutomation": false,
|
||||
"supportsDocumentFonts": true,
|
||||
"supportsIntegratedFind": false,
|
||||
"supportsMouseWheelZoomCtrlKey": true,
|
||||
"supportsMouseWheelZoomMetaKey": true,
|
||||
"supportsPinchToZoom": true
|
||||
canvasMaxAreaInBytes: -1,
|
||||
isInAutomation: false,
|
||||
supportsDocumentFonts: true,
|
||||
supportsIntegratedFind: false,
|
||||
supportsMouseWheelZoomCtrlKey: true,
|
||||
supportsMouseWheelZoomMetaKey: true,
|
||||
supportsPinchToZoom: true
|
||||
};
|
||||
const options = Object.create(null);
|
||||
for (const [name, defaultVal] of Object.entries(BROWSER_PREFS)) {
|
||||
|
|
@ -9249,8 +9242,8 @@ PDFPrintServiceFactory.instance = {
|
|||
|
||||
|
||||
|
||||
const pdfjsVersion = '4.1.30';
|
||||
const pdfjsBuild = 'a22b5a4f0';
|
||||
const pdfjsVersion = "4.1.86";
|
||||
const pdfjsBuild = "bf9236009";
|
||||
const AppConstants = null;
|
||||
window.PDFViewerApplication = PDFViewerApplication;
|
||||
window.PDFViewerApplicationConstants = AppConstants;
|
||||
|
|
|
|||
|
|
@ -18,12 +18,17 @@
|
|||
text-align:initial;
|
||||
inset:0;
|
||||
overflow:hidden;
|
||||
opacity:0.25;
|
||||
opacity:1;
|
||||
line-height:1;
|
||||
text-size-adjust:none;
|
||||
forced-color-adjust:none;
|
||||
transform-origin:0 0;
|
||||
z-index:2;
|
||||
caret-color:CanvasText;
|
||||
|
||||
&.drawing{
|
||||
touch-action:none;
|
||||
}
|
||||
|
||||
:is(span, br){
|
||||
color:transparent;
|
||||
|
|
@ -34,17 +39,22 @@
|
|||
}
|
||||
|
||||
.highlight{
|
||||
--highlight-bg-color:rgb(180 0 170);
|
||||
--highlight-selected-bg-color:rgb(0 100 0);
|
||||
--highlight-bg-color:rgb(180 0 170 / 0.25);
|
||||
--highlight-selected-bg-color:rgb(0 100 0 / 0.25);
|
||||
--highlight-backdrop-filter:none;
|
||||
--highlight-selected-backdrop-filter:none;
|
||||
|
||||
@media screen and (forced-colors: active){
|
||||
--highlight-bg-color:Highlight;
|
||||
--highlight-selected-bg-color:ButtonText;
|
||||
--highlight-bg-color:transparent;
|
||||
--highlight-selected-bg-color:transparent;
|
||||
--highlight-backdrop-filter:var(--hcm-highlight-filter);
|
||||
--highlight-selected-backdrop-filter:var(--hcm-highlight-selected-filter);
|
||||
}
|
||||
|
||||
margin:-1px;
|
||||
padding:1px;
|
||||
background-color:var(--highlight-bg-color);
|
||||
backdrop-filter:var(--highlight-backdrop-filter);
|
||||
border-radius:4px;
|
||||
|
||||
&.appended{
|
||||
|
|
@ -65,11 +75,12 @@
|
|||
|
||||
&.selected{
|
||||
background-color:var(--highlight-selected-bg-color);
|
||||
backdrop-filter:var(--highlight-selected-backdrop-filter);
|
||||
}
|
||||
}
|
||||
|
||||
::selection{
|
||||
background:AccentColor;
|
||||
background:color-mix(in srgb, AccentColor, transparent 75%);
|
||||
}
|
||||
|
||||
.endOfContent{
|
||||
|
|
@ -101,7 +112,6 @@
|
|||
--input-disabled-border-color:GrayText;
|
||||
--input-hover-border-color:Highlight;
|
||||
--link-outline:1.5px solid LinkText;
|
||||
--hcm-highlight-filter:invert(100%);
|
||||
|
||||
.textWidgetAnnotation :is(input, textarea):required,
|
||||
.choiceWidgetAnnotation select:required,
|
||||
|
|
@ -774,7 +784,10 @@
|
|||
|
||||
position:absolute;
|
||||
mix-blend-mode:var(--blend-mode);
|
||||
fill-rule:evenodd;
|
||||
|
||||
&:not(.free){
|
||||
fill-rule:evenodd;
|
||||
}
|
||||
}
|
||||
|
||||
&.highlightOutline{
|
||||
|
|
@ -1706,25 +1719,25 @@
|
|||
|
||||
.annotationEditorLayer{
|
||||
&[data-main-rotation="0"]{
|
||||
.highlightEditor > .editToolbar{
|
||||
.highlightEditor:not(.free) > .editToolbar{
|
||||
rotate:0deg;
|
||||
}
|
||||
}
|
||||
|
||||
&[data-main-rotation="90"]{
|
||||
.highlightEditor > .editToolbar{
|
||||
.highlightEditor:not(.free) > .editToolbar{
|
||||
rotate:270deg;
|
||||
}
|
||||
}
|
||||
|
||||
&[data-main-rotation="180"]{
|
||||
.highlightEditor > .editToolbar{
|
||||
.highlightEditor:not(.free) > .editToolbar{
|
||||
rotate:180deg;
|
||||
}
|
||||
}
|
||||
|
||||
&[data-main-rotation="270"]{
|
||||
.highlightEditor > .editToolbar{
|
||||
.highlightEditor:not(.free) > .editToolbar{
|
||||
rotate:90deg;
|
||||
}
|
||||
}
|
||||
|
|
@ -1733,14 +1746,17 @@
|
|||
position:absolute;
|
||||
background:transparent;
|
||||
z-index:1;
|
||||
transform-origin:0 0;
|
||||
cursor:auto;
|
||||
max-width:100%;
|
||||
max-height:100%;
|
||||
border:none;
|
||||
outline:none;
|
||||
pointer-events:none;
|
||||
transform:none;
|
||||
transform-origin:0 0;
|
||||
|
||||
&:not(.free){
|
||||
transform:none;
|
||||
}
|
||||
|
||||
.internal{
|
||||
position:absolute;
|
||||
|
|
@ -1793,6 +1809,10 @@
|
|||
|
||||
&:has(.dropdown:not(.hidden)){
|
||||
background-color:var(--editor-toolbar-hover-bg-color);
|
||||
|
||||
&::after{
|
||||
scale:-1;
|
||||
}
|
||||
}
|
||||
|
||||
.dropdown{
|
||||
|
|
@ -1851,21 +1871,22 @@
|
|||
height:auto;
|
||||
padding-inline:10px;
|
||||
padding-block:10px 16px;
|
||||
gap:16px;
|
||||
display:flex;
|
||||
flex-direction:column;
|
||||
box-sizing:border-box;
|
||||
|
||||
.editorParamsLabel{
|
||||
width:-moz-fit-content;
|
||||
width:fit-content;
|
||||
inset-inline-start:0;
|
||||
}
|
||||
|
||||
.colorPicker{
|
||||
display:flex;
|
||||
flex-direction:column;
|
||||
gap:8px;
|
||||
|
||||
#highlightColorPickerLabel{
|
||||
width:-moz-fit-content;
|
||||
width:fit-content;
|
||||
inset-inline-start:0;
|
||||
}
|
||||
|
||||
.dropdown{
|
||||
display:flex;
|
||||
justify-content:space-between;
|
||||
|
|
@ -1903,6 +1924,60 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#editorHighlightThickness{
|
||||
display:flex;
|
||||
flex-direction:column;
|
||||
align-items:center;
|
||||
gap:4px;
|
||||
align-self:stretch;
|
||||
|
||||
.editorParamsLabel{
|
||||
width:100%;
|
||||
height:auto;
|
||||
align-self:stretch;
|
||||
}
|
||||
|
||||
.thicknessPicker{
|
||||
display:flex;
|
||||
justify-content:space-between;
|
||||
align-items:center;
|
||||
align-self:stretch;
|
||||
|
||||
--example-color:#bfbfc9;
|
||||
|
||||
@media (prefers-color-scheme: dark){
|
||||
--example-color:#80808e;
|
||||
}
|
||||
|
||||
@media screen and (forced-colors: active){
|
||||
--example-color:HighlightText;
|
||||
}
|
||||
|
||||
&::before{
|
||||
content:"";
|
||||
width:8px;
|
||||
aspect-ratio:1;
|
||||
display:block;
|
||||
border-radius:100%;
|
||||
background-color:var(--example-color);
|
||||
}
|
||||
|
||||
.editorParamsSlider{
|
||||
width:unset;
|
||||
height:14px;
|
||||
}
|
||||
|
||||
&::after{
|
||||
content:"";
|
||||
width:24px;
|
||||
aspect-ratio:1;
|
||||
display:block;
|
||||
border-radius:100%;
|
||||
background-color:var(--example-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:root{
|
||||
|
|
@ -1947,6 +2022,13 @@
|
|||
--scale-factor:1;
|
||||
|
||||
padding-bottom:var(--pdfViewer-padding-bottom);
|
||||
|
||||
--hcm-highlight-filter:none;
|
||||
--hcm-highlight-selected-filter:none;
|
||||
|
||||
@media screen and (forced-colors: active){
|
||||
--hcm-highlight-filter:invert(100%);
|
||||
}
|
||||
}
|
||||
|
||||
.pdfViewer .canvasWrapper{
|
||||
|
|
|
|||
|
|
@ -121,6 +121,12 @@ See https://github.com/adobe-type-tools/cmap-resources
|
|||
<div id="editorHighlightColorPicker" class="colorPicker">
|
||||
<span id="highlightColorPickerLabel" class="editorParamsLabel" data-l10n-id="pdfjs-editor-highlight-colorpicker-label">Highlight color</span>
|
||||
</div>
|
||||
<div id="editorHighlightThickness">
|
||||
<label for="editorFreeHighlightThickness" class="editorParamsLabel" data-l10n-id="pdfjs-editor-free-highlight-thickness-input">Thickness</label>
|
||||
<div class="thicknessPicker">
|
||||
<input type="range" id="editorFreeHighlightThickness" class="editorParamsSlider" value="12" min="8" max="24" step="1" tabindex="101">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -182,15 +182,13 @@ function parseQueryString(query) {
|
|||
}
|
||||
return params;
|
||||
}
|
||||
const InvisibleCharactersRegExp = /[\x00-\x1F]/g;
|
||||
const InvisibleCharsRegExp = /[\x00-\x1F]/g;
|
||||
function removeNullCharacters(str, replaceInvisible = false) {
|
||||
if (!InvisibleCharactersRegExp.test(str)) {
|
||||
if (!InvisibleCharsRegExp.test(str)) {
|
||||
return str;
|
||||
}
|
||||
if (replaceInvisible) {
|
||||
return str.replaceAll(InvisibleCharactersRegExp, m => {
|
||||
return m === "\x00" ? "" : " ";
|
||||
});
|
||||
return str.replaceAll(InvisibleCharsRegExp, m => m === "\x00" ? "" : " ");
|
||||
}
|
||||
return str.replaceAll("\x00", "");
|
||||
}
|
||||
|
|
@ -992,9 +990,7 @@ function addLinkAttributes(link, {
|
|||
} else {
|
||||
link.href = "";
|
||||
link.title = `Disabled: ${url}`;
|
||||
link.onclick = () => {
|
||||
return false;
|
||||
};
|
||||
link.onclick = () => false;
|
||||
}
|
||||
let targetStr = "";
|
||||
switch (target) {
|
||||
|
|
@ -1673,7 +1669,8 @@ class AnnotationEditorParams {
|
|||
editorInkColor,
|
||||
editorInkThickness,
|
||||
editorInkOpacity,
|
||||
editorStampAddImage
|
||||
editorStampAddImage,
|
||||
editorFreeHighlightThickness
|
||||
}) {
|
||||
const dispatchEvent = (typeStr, value) => {
|
||||
this.eventBus.dispatch("switchannotationeditorparams", {
|
||||
|
|
@ -1700,6 +1697,9 @@ class AnnotationEditorParams {
|
|||
editorStampAddImage.addEventListener("click", () => {
|
||||
dispatchEvent("CREATE");
|
||||
});
|
||||
editorFreeHighlightThickness.addEventListener("input", function () {
|
||||
dispatchEvent("HIGHLIGHT_THICKNESS", this.valueAsNumber);
|
||||
});
|
||||
this.eventBus._on("annotationeditorparamschanged", evt => {
|
||||
for (const [type, value] of evt.details) {
|
||||
switch (type) {
|
||||
|
|
@ -1718,6 +1718,9 @@ class AnnotationEditorParams {
|
|||
case AnnotationEditorParamsType.INK_OPACITY:
|
||||
editorInkOpacity.value = value;
|
||||
break;
|
||||
case AnnotationEditorParamsType.HIGHLIGHT_THICKNESS:
|
||||
editorFreeHighlightThickness.value = value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -3040,9 +3043,7 @@ class PDFFindController {
|
|||
const extractTextCapability = new PromiseCapability();
|
||||
this._extractTextPromises[i] = extractTextCapability.promise;
|
||||
promise = promise.then(() => {
|
||||
return this._pdfDocument.getPage(i + 1).then(pdfPage => {
|
||||
return pdfPage.getTextContent(textOptions);
|
||||
}).then(textContent => {
|
||||
return this._pdfDocument.getPage(i + 1).then(pdfPage => pdfPage.getTextContent(textOptions)).then(textContent => {
|
||||
const strBuf = [];
|
||||
for (const textItem of textContent.items) {
|
||||
strBuf.push(textItem.str);
|
||||
|
|
@ -7634,7 +7635,7 @@ class PDFViewer {
|
|||
#scaleTimeoutId = null;
|
||||
#textLayerMode = TextLayerMode.ENABLE;
|
||||
constructor(options) {
|
||||
const viewerVersion = '4.1.30';
|
||||
const viewerVersion = "4.1.86";
|
||||
if (version !== viewerVersion) {
|
||||
throw new Error(`The API version "${version}" does not match the Viewer version "${viewerVersion}".`);
|
||||
}
|
||||
|
|
@ -8038,7 +8039,8 @@ class PDFViewer {
|
|||
});
|
||||
this.viewer.style.setProperty("--scale-factor", viewport.scale);
|
||||
if (this.pageColors?.foreground === "CanvasText" || this.pageColors?.background === "Canvas") {
|
||||
this.viewer.style.setProperty("--hcm-highlight-filter", pdfDocument.filterFactory.addHighlightHCMFilter("CanvasText", "Canvas", "HighlightText", "Highlight"));
|
||||
this.viewer.style.setProperty("--hcm-highlight-filter", pdfDocument.filterFactory.addHighlightHCMFilter("highlight", "CanvasText", "Canvas", "HighlightText", "Highlight"));
|
||||
this.viewer.style.setProperty("--hcm-highlight-selected-filter", pdfDocument.filterFactory.addHighlightHCMFilter("highlight_selected", "CanvasText", "Canvas", "HighlightText", "ButtonText"));
|
||||
}
|
||||
for (let pageNum = 1; pageNum <= pagesCount; ++pageNum) {
|
||||
const pageView = new PDFPageView({
|
||||
|
|
@ -10743,9 +10745,7 @@ const PDFViewerApplication = {
|
|||
this.pdfRenderingQueue.renderHighestPriority();
|
||||
},
|
||||
beforePrint() {
|
||||
this._printAnnotationStoragePromise = this.pdfScriptingManager.dispatchWillPrint().catch(() => {}).then(() => {
|
||||
return this.pdfDocument?.annotationStorage.print;
|
||||
});
|
||||
this._printAnnotationStoragePromise = this.pdfScriptingManager.dispatchWillPrint().catch(() => {}).then(() => this.pdfDocument?.annotationStorage.print);
|
||||
if (this.printService) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -11724,34 +11724,34 @@ const PDFPrintServiceFactory = {
|
|||
|
||||
class BasePreferences {
|
||||
#defaults = Object.freeze({
|
||||
"annotationEditorMode": 0,
|
||||
"annotationMode": 2,
|
||||
"cursorToolOnLoad": 0,
|
||||
"defaultZoomDelay": 400,
|
||||
"defaultZoomValue": "",
|
||||
"disablePageLabels": false,
|
||||
"enableHighlightEditor": false,
|
||||
"enablePermissions": false,
|
||||
"enablePrintAutoRotate": true,
|
||||
"enableScripting": true,
|
||||
"externalLinkTarget": 0,
|
||||
"highlightEditorColors": "yellow=#FFFF98,green=#53FFBC,blue=#80EBFF,pink=#FFCBE6,red=#FF4F5F",
|
||||
"historyUpdateUrl": false,
|
||||
"ignoreDestinationZoom": false,
|
||||
"forcePageColors": false,
|
||||
"pageColorsBackground": "Canvas",
|
||||
"pageColorsForeground": "CanvasText",
|
||||
"pdfBugEnabled": false,
|
||||
"sidebarViewOnLoad": -1,
|
||||
"scrollModeOnLoad": -1,
|
||||
"spreadModeOnLoad": -1,
|
||||
"textLayerMode": 1,
|
||||
"viewOnLoad": 0,
|
||||
"disableAutoFetch": false,
|
||||
"disableFontFace": false,
|
||||
"disableRange": false,
|
||||
"disableStream": false,
|
||||
"enableXfa": true
|
||||
annotationEditorMode: 0,
|
||||
annotationMode: 2,
|
||||
cursorToolOnLoad: 0,
|
||||
defaultZoomDelay: 400,
|
||||
defaultZoomValue: "",
|
||||
disablePageLabels: false,
|
||||
enableHighlightEditor: false,
|
||||
enablePermissions: false,
|
||||
enablePrintAutoRotate: true,
|
||||
enableScripting: true,
|
||||
externalLinkTarget: 0,
|
||||
highlightEditorColors: "yellow=#FFFF98,green=#53FFBC,blue=#80EBFF,pink=#FFCBE6,red=#FF4F5F",
|
||||
historyUpdateUrl: false,
|
||||
ignoreDestinationZoom: false,
|
||||
forcePageColors: false,
|
||||
pageColorsBackground: "Canvas",
|
||||
pageColorsForeground: "CanvasText",
|
||||
pdfBugEnabled: false,
|
||||
sidebarViewOnLoad: -1,
|
||||
scrollModeOnLoad: -1,
|
||||
spreadModeOnLoad: -1,
|
||||
textLayerMode: 1,
|
||||
viewOnLoad: 0,
|
||||
disableAutoFetch: false,
|
||||
disableFontFace: false,
|
||||
disableRange: false,
|
||||
disableStream: false,
|
||||
enableXfa: true
|
||||
});
|
||||
#prefs = Object.create(null);
|
||||
#initializedPromise = null;
|
||||
|
|
@ -11764,13 +11764,13 @@ class BasePreferences {
|
|||
prefs
|
||||
}) => {
|
||||
const BROWSER_PREFS = {
|
||||
"canvasMaxAreaInBytes": -1,
|
||||
"isInAutomation": false,
|
||||
"supportsDocumentFonts": true,
|
||||
"supportsIntegratedFind": false,
|
||||
"supportsMouseWheelZoomCtrlKey": true,
|
||||
"supportsMouseWheelZoomMetaKey": true,
|
||||
"supportsPinchToZoom": true
|
||||
canvasMaxAreaInBytes: -1,
|
||||
isInAutomation: false,
|
||||
supportsDocumentFonts: true,
|
||||
supportsIntegratedFind: false,
|
||||
supportsMouseWheelZoomCtrlKey: true,
|
||||
supportsMouseWheelZoomMetaKey: true,
|
||||
supportsPinchToZoom: true
|
||||
};
|
||||
const options = Object.create(null);
|
||||
for (const [name, defaultVal] of Object.entries(BROWSER_PREFS)) {
|
||||
|
|
@ -12321,8 +12321,8 @@ PDFPrintServiceFactory.instance = {
|
|||
|
||||
|
||||
|
||||
const pdfjsVersion = '4.1.30';
|
||||
const pdfjsBuild = 'a22b5a4f0';
|
||||
const pdfjsVersion = "4.1.86";
|
||||
const pdfjsBuild = "bf9236009";
|
||||
const AppConstants = null;
|
||||
window.PDFViewerApplication = PDFViewerApplication;
|
||||
window.PDFViewerApplicationConstants = AppConstants;
|
||||
|
|
@ -12447,7 +12447,8 @@ function getViewerConfiguration() {
|
|||
editorInkColor: document.getElementById("editorInkColor"),
|
||||
editorInkThickness: document.getElementById("editorInkThickness"),
|
||||
editorInkOpacity: document.getElementById("editorInkOpacity"),
|
||||
editorStampAddImage: document.getElementById("editorStampAddImage")
|
||||
editorStampAddImage: document.getElementById("editorStampAddImage"),
|
||||
editorFreeHighlightThickness: document.getElementById("editorFreeHighlightThickness")
|
||||
},
|
||||
printContainer: document.getElementById("printContainer"),
|
||||
openFileInput: null,
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ origin:
|
|||
|
||||
# Human-readable identifier for this version/release
|
||||
# Generally "version NNN", "tag SSS", "bookmark SSS"
|
||||
release: a22b5a4f02d046b5113630b1c333281841cbe309 (2024-01-16T21:27:14Z).
|
||||
revision: a22b5a4f02d046b5113630b1c333281841cbe309
|
||||
release: bf9236009521621891d73dd77acc68215cb2cadb (2024-01-25T09:07:48Z).
|
||||
revision: bf9236009521621891d73dd77acc68215cb2cadb
|
||||
|
||||
# The package's license, where possible using the mnemonic from
|
||||
# https://spdx.org/licenses/
|
||||
|
|
|
|||
|
|
@ -349,6 +349,8 @@ pdfjs-editor-ink-opacity-input = Opacity
|
|||
pdfjs-editor-stamp-add-image-button =
|
||||
.title = Add image
|
||||
pdfjs-editor-stamp-add-image-button-label = Add image
|
||||
# This refers to the thickness of the line used for free highlighting (not bound to text)
|
||||
pdfjs-editor-free-highlight-thickness-input = Thickness
|
||||
|
||||
pdfjs-free-text =
|
||||
.aria-label = Text Editor
|
||||
|
|
|
|||
Loading…
Reference in a new issue