@ntlab/ntjs-assets 2.0.50 → 2.0.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/js/pdfjs/build/pdf.mjs +749 -343
- package/assets/js/pdfjs/build/pdf.mjs.map +1 -1
- package/assets/js/pdfjs/build/pdf.sandbox.mjs +6 -6
- package/assets/js/pdfjs/build/pdf.sandbox.mjs.map +1 -1
- package/assets/js/pdfjs/build/pdf.worker.mjs +426 -214
- package/assets/js/pdfjs/build/pdf.worker.mjs.map +1 -1
- package/assets/js/pdfjs/web/locale/ar/viewer.ftl +23 -2
- package/assets/js/pdfjs/web/locale/be/viewer.ftl +24 -0
- package/assets/js/pdfjs/web/locale/bg/viewer.ftl +16 -0
- package/assets/js/pdfjs/web/locale/ca/viewer.ftl +20 -6
- package/assets/js/pdfjs/web/locale/cs/viewer.ftl +24 -0
- package/assets/js/pdfjs/web/locale/cy/viewer.ftl +30 -0
- package/assets/js/pdfjs/web/locale/da/viewer.ftl +16 -0
- package/assets/js/pdfjs/web/locale/de/viewer.ftl +30 -2
- package/assets/js/pdfjs/web/locale/dsb/viewer.ftl +30 -0
- package/assets/js/pdfjs/web/locale/el/viewer.ftl +16 -0
- package/assets/js/pdfjs/web/locale/en-CA/viewer.ftl +31 -1
- package/assets/js/pdfjs/web/locale/en-GB/viewer.ftl +16 -0
- package/assets/js/pdfjs/web/locale/eo/viewer.ftl +30 -0
- package/assets/js/pdfjs/web/locale/es-AR/viewer.ftl +16 -0
- package/assets/js/pdfjs/web/locale/es-CL/viewer.ftl +16 -0
- package/assets/js/pdfjs/web/locale/es-ES/viewer.ftl +38 -8
- package/assets/js/pdfjs/web/locale/eu/viewer.ftl +23 -8
- package/assets/js/pdfjs/web/locale/fi/viewer.ftl +30 -2
- package/assets/js/pdfjs/web/locale/fr/viewer.ftl +16 -0
- package/assets/js/pdfjs/web/locale/fur/viewer.ftl +30 -2
- package/assets/js/pdfjs/web/locale/fy-NL/viewer.ftl +16 -0
- package/assets/js/pdfjs/web/locale/gd/viewer.ftl +20 -6
- package/assets/js/pdfjs/web/locale/gl/viewer.ftl +27 -6
- package/assets/js/pdfjs/web/locale/gn/viewer.ftl +30 -2
- package/assets/js/pdfjs/web/locale/he/viewer.ftl +16 -0
- package/assets/js/pdfjs/web/locale/hi-IN/viewer.ftl +20 -6
- package/assets/js/pdfjs/web/locale/hr/viewer.ftl +48 -22
- package/assets/js/pdfjs/web/locale/hsb/viewer.ftl +16 -0
- package/assets/js/pdfjs/web/locale/hu/viewer.ftl +16 -0
- package/assets/js/pdfjs/web/locale/ia/viewer.ftl +16 -0
- package/assets/js/pdfjs/web/locale/is/viewer.ftl +30 -0
- package/assets/js/pdfjs/web/locale/ja/viewer.ftl +31 -2
- package/assets/js/pdfjs/web/locale/ka/viewer.ftl +27 -8
- package/assets/js/pdfjs/web/locale/kab/viewer.ftl +52 -0
- package/assets/js/pdfjs/web/locale/kk/viewer.ftl +16 -0
- package/assets/js/pdfjs/web/locale/ko/viewer.ftl +16 -0
- package/assets/js/pdfjs/web/locale/lo/viewer.ftl +20 -6
- package/assets/js/pdfjs/web/locale/nb-NO/viewer.ftl +87 -2
- package/assets/js/pdfjs/web/locale/nl/viewer.ftl +16 -0
- package/assets/js/pdfjs/web/locale/nn-NO/viewer.ftl +32 -0
- package/assets/js/pdfjs/web/locale/pa-IN/viewer.ftl +30 -2
- package/assets/js/pdfjs/web/locale/pl/viewer.ftl +30 -0
- package/assets/js/pdfjs/web/locale/pt-BR/viewer.ftl +18 -2
- package/assets/js/pdfjs/web/locale/pt-PT/viewer.ftl +30 -2
- package/assets/js/pdfjs/web/locale/rm/viewer.ftl +87 -2
- package/assets/js/pdfjs/web/locale/ru/viewer.ftl +17 -1
- package/assets/js/pdfjs/web/locale/sat/viewer.ftl +20 -6
- package/assets/js/pdfjs/web/locale/si/viewer.ftl +20 -6
- package/assets/js/pdfjs/web/locale/sk/viewer.ftl +30 -2
- package/assets/js/pdfjs/web/locale/skr/viewer.ftl +38 -0
- package/assets/js/pdfjs/web/locale/sl/viewer.ftl +16 -0
- package/assets/js/pdfjs/web/locale/sq/viewer.ftl +24 -0
- package/assets/js/pdfjs/web/locale/sr/viewer.ftl +20 -6
- package/assets/js/pdfjs/web/locale/sv-SE/viewer.ftl +16 -0
- package/assets/js/pdfjs/web/locale/tg/viewer.ftl +61 -2
- package/assets/js/pdfjs/web/locale/th/viewer.ftl +16 -0
- package/assets/js/pdfjs/web/locale/tr/viewer.ftl +16 -0
- package/assets/js/pdfjs/web/locale/uk/viewer.ftl +55 -1
- package/assets/js/pdfjs/web/locale/vi/viewer.ftl +16 -0
- package/assets/js/pdfjs/web/locale/zh-CN/viewer.ftl +16 -0
- package/assets/js/pdfjs/web/locale/zh-TW/viewer.ftl +16 -0
- package/assets/js/pdfjs/web/viewer.css +777 -592
- package/assets/js/pdfjs/web/viewer.html +271 -250
- package/assets/js/pdfjs/web/viewer.mjs +384 -213
- package/assets/js/pdfjs/web/viewer.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -63,6 +63,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
63
63
|
InvalidPDFException: () => (/* reexport */ InvalidPDFException),
|
|
64
64
|
MissingPDFException: () => (/* reexport */ MissingPDFException),
|
|
65
65
|
OPS: () => (/* reexport */ OPS),
|
|
66
|
+
OutputScale: () => (/* reexport */ OutputScale),
|
|
66
67
|
PDFDataRangeTransport: () => (/* reexport */ PDFDataRangeTransport),
|
|
67
68
|
PDFDateString: () => (/* reexport */ PDFDateString),
|
|
68
69
|
PDFWorker: () => (/* reexport */ PDFWorker),
|
|
@@ -91,7 +92,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
91
92
|
version: () => (/* reexport */ version)
|
|
92
93
|
});
|
|
93
94
|
|
|
94
|
-
;//
|
|
95
|
+
;// ./src/shared/util.js
|
|
95
96
|
const isNodeJS = typeof process === "object" && process + "" === "[object process]" && !process.versions.nw && !(process.versions.electron && process.type && process.type !== "browser");
|
|
96
97
|
const IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0];
|
|
97
98
|
const FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0];
|
|
@@ -559,11 +560,15 @@ class util_FeatureTest {
|
|
|
559
560
|
static get platform() {
|
|
560
561
|
if (typeof navigator !== "undefined" && typeof navigator?.platform === "string") {
|
|
561
562
|
return shadow(this, "platform", {
|
|
562
|
-
isMac: navigator.platform.includes("Mac")
|
|
563
|
+
isMac: navigator.platform.includes("Mac"),
|
|
564
|
+
isWindows: navigator.platform.includes("Win"),
|
|
565
|
+
isFirefox: typeof navigator?.userAgent === "string" && navigator.userAgent.includes("Firefox")
|
|
563
566
|
});
|
|
564
567
|
}
|
|
565
568
|
return shadow(this, "platform", {
|
|
566
|
-
isMac: false
|
|
569
|
+
isMac: false,
|
|
570
|
+
isWindows: false,
|
|
571
|
+
isFirefox: false
|
|
567
572
|
});
|
|
568
573
|
}
|
|
569
574
|
static get isCSSRoundSupported() {
|
|
@@ -827,7 +832,7 @@ const FontRenderOps = {
|
|
|
827
832
|
TRANSLATE: 8
|
|
828
833
|
};
|
|
829
834
|
|
|
830
|
-
;//
|
|
835
|
+
;// ./src/display/base_factory.js
|
|
831
836
|
|
|
832
837
|
class BaseFilterFactory {
|
|
833
838
|
addFilter(maps) {
|
|
@@ -851,7 +856,7 @@ class BaseCanvasFactory {
|
|
|
851
856
|
#enableHWA = false;
|
|
852
857
|
constructor({
|
|
853
858
|
enableHWA = false
|
|
854
|
-
}
|
|
859
|
+
}) {
|
|
855
860
|
this.#enableHWA = enableHWA;
|
|
856
861
|
}
|
|
857
862
|
create(width, height) {
|
|
@@ -966,7 +971,7 @@ class BaseSVGFactory {
|
|
|
966
971
|
}
|
|
967
972
|
}
|
|
968
973
|
|
|
969
|
-
;//
|
|
974
|
+
;// ./src/display/display_utils.js
|
|
970
975
|
|
|
971
976
|
|
|
972
977
|
const SVG_NS = "http://www.w3.org/2000/svg";
|
|
@@ -986,7 +991,7 @@ class DOMFilterFactory extends BaseFilterFactory {
|
|
|
986
991
|
constructor({
|
|
987
992
|
docId,
|
|
988
993
|
ownerDocument = globalThis.document
|
|
989
|
-
}
|
|
994
|
+
}) {
|
|
990
995
|
super();
|
|
991
996
|
this.#docId = docId;
|
|
992
997
|
this.#document = ownerDocument;
|
|
@@ -1295,7 +1300,7 @@ class DOMCanvasFactory extends BaseCanvasFactory {
|
|
|
1295
1300
|
constructor({
|
|
1296
1301
|
ownerDocument = globalThis.document,
|
|
1297
1302
|
enableHWA = false
|
|
1298
|
-
}
|
|
1303
|
+
}) {
|
|
1299
1304
|
super({
|
|
1300
1305
|
enableHWA
|
|
1301
1306
|
});
|
|
@@ -1683,8 +1688,8 @@ function setLayerDimensions(div, viewport, mustFlip = false, mustRotate = true)
|
|
|
1683
1688
|
const useRound = util_FeatureTest.isCSSRoundSupported;
|
|
1684
1689
|
const w = `var(--scale-factor) * ${pageWidth}px`,
|
|
1685
1690
|
h = `var(--scale-factor) * ${pageHeight}px`;
|
|
1686
|
-
const widthStr = useRound ? `round(${w}, 1px)` : `calc(${w})`,
|
|
1687
|
-
heightStr = useRound ? `round(${h}, 1px)` : `calc(${h})`;
|
|
1691
|
+
const widthStr = useRound ? `round(down, ${w}, var(--scale-round-x, 1px))` : `calc(${w})`,
|
|
1692
|
+
heightStr = useRound ? `round(down, ${h}, var(--scale-round-y, 1px))` : `calc(${h})`;
|
|
1688
1693
|
if (!mustFlip || viewport.rotation % 180 === 0) {
|
|
1689
1694
|
style.width = widthStr;
|
|
1690
1695
|
style.height = heightStr;
|
|
@@ -1697,8 +1702,21 @@ function setLayerDimensions(div, viewport, mustFlip = false, mustRotate = true)
|
|
|
1697
1702
|
div.setAttribute("data-main-rotation", viewport.rotation);
|
|
1698
1703
|
}
|
|
1699
1704
|
}
|
|
1705
|
+
class OutputScale {
|
|
1706
|
+
constructor() {
|
|
1707
|
+
const pixelRatio = window.devicePixelRatio || 1;
|
|
1708
|
+
this.sx = pixelRatio;
|
|
1709
|
+
this.sy = pixelRatio;
|
|
1710
|
+
}
|
|
1711
|
+
get scaled() {
|
|
1712
|
+
return this.sx !== 1 || this.sy !== 1;
|
|
1713
|
+
}
|
|
1714
|
+
get symmetric() {
|
|
1715
|
+
return this.sx === this.sy;
|
|
1716
|
+
}
|
|
1717
|
+
}
|
|
1700
1718
|
|
|
1701
|
-
;//
|
|
1719
|
+
;// ./src/display/editor/toolbar.js
|
|
1702
1720
|
|
|
1703
1721
|
class EditorToolbar {
|
|
1704
1722
|
#toolbar = null;
|
|
@@ -1718,7 +1736,7 @@ class EditorToolbar {
|
|
|
1718
1736
|
}
|
|
1719
1737
|
render() {
|
|
1720
1738
|
const editToolbar = this.#toolbar = document.createElement("div");
|
|
1721
|
-
editToolbar.
|
|
1739
|
+
editToolbar.classList.add("editToolbar", "hidden");
|
|
1722
1740
|
editToolbar.setAttribute("role", "toolbar");
|
|
1723
1741
|
const signal = this.#editor._uiManager._signal;
|
|
1724
1742
|
editToolbar.addEventListener("contextmenu", noContextMenu, {
|
|
@@ -1742,6 +1760,9 @@ class EditorToolbar {
|
|
|
1742
1760
|
this.#addDeleteButton();
|
|
1743
1761
|
return editToolbar;
|
|
1744
1762
|
}
|
|
1763
|
+
get div() {
|
|
1764
|
+
return this.#toolbar;
|
|
1765
|
+
}
|
|
1745
1766
|
static #pointerDown(e) {
|
|
1746
1767
|
e.stopPropagation();
|
|
1747
1768
|
}
|
|
@@ -1895,7 +1916,7 @@ class HighlightToolbar {
|
|
|
1895
1916
|
}
|
|
1896
1917
|
}
|
|
1897
1918
|
|
|
1898
|
-
;//
|
|
1919
|
+
;// ./src/display/editor/tools.js
|
|
1899
1920
|
|
|
1900
1921
|
|
|
1901
1922
|
|
|
@@ -1952,8 +1973,10 @@ class ImageManager {
|
|
|
1952
1973
|
if (typeof rawData === "string") {
|
|
1953
1974
|
data.url = rawData;
|
|
1954
1975
|
image = await fetchData(rawData, "blob");
|
|
1955
|
-
} else {
|
|
1976
|
+
} else if (rawData instanceof File) {
|
|
1956
1977
|
image = data.file = rawData;
|
|
1978
|
+
} else if (rawData instanceof Blob) {
|
|
1979
|
+
image = rawData;
|
|
1957
1980
|
}
|
|
1958
1981
|
if (image.type === "image/svg+xml") {
|
|
1959
1982
|
const mustRemoveAspectRatioPromise = ImageManager._isSVGFittingCanvas;
|
|
@@ -1999,6 +2022,10 @@ class ImageManager {
|
|
|
1999
2022
|
async getFromUrl(url) {
|
|
2000
2023
|
return this.#get(url, url);
|
|
2001
2024
|
}
|
|
2025
|
+
async getFromBlob(id, blobPromise) {
|
|
2026
|
+
const blob = await blobPromise;
|
|
2027
|
+
return this.#get(id, blob);
|
|
2028
|
+
}
|
|
2002
2029
|
async getFromId(id) {
|
|
2003
2030
|
this.#cache ||= new Map();
|
|
2004
2031
|
const data = this.#cache.get(id);
|
|
@@ -2012,8 +2039,35 @@ class ImageManager {
|
|
|
2012
2039
|
if (data.file) {
|
|
2013
2040
|
return this.getFromFile(data.file);
|
|
2014
2041
|
}
|
|
2042
|
+
if (data.blobPromise) {
|
|
2043
|
+
const {
|
|
2044
|
+
blobPromise
|
|
2045
|
+
} = data;
|
|
2046
|
+
delete data.blobPromise;
|
|
2047
|
+
return this.getFromBlob(data.id, blobPromise);
|
|
2048
|
+
}
|
|
2015
2049
|
return this.getFromUrl(data.url);
|
|
2016
2050
|
}
|
|
2051
|
+
getFromCanvas(id, canvas) {
|
|
2052
|
+
this.#cache ||= new Map();
|
|
2053
|
+
let data = this.#cache.get(id);
|
|
2054
|
+
if (data?.bitmap) {
|
|
2055
|
+
data.refCounter += 1;
|
|
2056
|
+
return data;
|
|
2057
|
+
}
|
|
2058
|
+
const offscreen = new OffscreenCanvas(canvas.width, canvas.height);
|
|
2059
|
+
const ctx = offscreen.getContext("2d");
|
|
2060
|
+
ctx.drawImage(canvas, 0, 0);
|
|
2061
|
+
data = {
|
|
2062
|
+
bitmap: offscreen.transferToImageBitmap(),
|
|
2063
|
+
id: `image_${this.#baseId}_${this.#id++}`,
|
|
2064
|
+
refCounter: 1,
|
|
2065
|
+
isSvg: false
|
|
2066
|
+
};
|
|
2067
|
+
this.#cache.set(id, data);
|
|
2068
|
+
this.#cache.set(data.id, data);
|
|
2069
|
+
return data;
|
|
2070
|
+
}
|
|
2017
2071
|
getSvgUrl(id) {
|
|
2018
2072
|
const data = this.#cache.get(id);
|
|
2019
2073
|
if (!data?.isSvg) {
|
|
@@ -2031,6 +2085,16 @@ class ImageManager {
|
|
|
2031
2085
|
if (data.refCounter !== 0) {
|
|
2032
2086
|
return;
|
|
2033
2087
|
}
|
|
2088
|
+
const {
|
|
2089
|
+
bitmap
|
|
2090
|
+
} = data;
|
|
2091
|
+
if (!data.url && !data.file) {
|
|
2092
|
+
const canvas = new OffscreenCanvas(bitmap.width, bitmap.height);
|
|
2093
|
+
const ctx = canvas.getContext("bitmaprenderer");
|
|
2094
|
+
ctx.transferFromImageBitmap(bitmap);
|
|
2095
|
+
data.blobPromise = canvas.convertToBlob();
|
|
2096
|
+
}
|
|
2097
|
+
bitmap.close?.();
|
|
2034
2098
|
data.bitmap = null;
|
|
2035
2099
|
}
|
|
2036
2100
|
isValidId(id) {
|
|
@@ -2275,6 +2339,7 @@ class AnnotationEditorUIManager {
|
|
|
2275
2339
|
#translationTimeoutId = null;
|
|
2276
2340
|
#container = null;
|
|
2277
2341
|
#viewer = null;
|
|
2342
|
+
#updateModeCapability = null;
|
|
2278
2343
|
static TRANSLATE_SMALL = 1;
|
|
2279
2344
|
static TRANSLATE_BIG = 10;
|
|
2280
2345
|
static get _keyboardManager() {
|
|
@@ -2377,6 +2442,8 @@ class AnnotationEditorUIManager {
|
|
|
2377
2442
|
this.isShiftKeyDown = false;
|
|
2378
2443
|
}
|
|
2379
2444
|
destroy() {
|
|
2445
|
+
this.#updateModeCapability?.resolve();
|
|
2446
|
+
this.#updateModeCapability = null;
|
|
2380
2447
|
this.#abortController?.abort();
|
|
2381
2448
|
this.#abortController = null;
|
|
2382
2449
|
this._signal = null;
|
|
@@ -2814,7 +2881,7 @@ class AnnotationEditorUIManager {
|
|
|
2814
2881
|
this.copy(event);
|
|
2815
2882
|
this.delete();
|
|
2816
2883
|
}
|
|
2817
|
-
paste(event) {
|
|
2884
|
+
async paste(event) {
|
|
2818
2885
|
event.preventDefault();
|
|
2819
2886
|
const {
|
|
2820
2887
|
clipboardData
|
|
@@ -2845,7 +2912,7 @@ class AnnotationEditorUIManager {
|
|
|
2845
2912
|
try {
|
|
2846
2913
|
const newEditors = [];
|
|
2847
2914
|
for (const editor of data) {
|
|
2848
|
-
const deserializedEditor = layer.deserialize(editor);
|
|
2915
|
+
const deserializedEditor = await layer.deserialize(editor);
|
|
2849
2916
|
if (!deserializedEditor) {
|
|
2850
2917
|
return;
|
|
2851
2918
|
}
|
|
@@ -2973,36 +3040,46 @@ class AnnotationEditorUIManager {
|
|
|
2973
3040
|
removeLayer(layer) {
|
|
2974
3041
|
this.#allLayers.delete(layer.pageIndex);
|
|
2975
3042
|
}
|
|
2976
|
-
updateMode(mode, editId = null, isFromKeyboard = false) {
|
|
3043
|
+
async updateMode(mode, editId = null, isFromKeyboard = false) {
|
|
2977
3044
|
if (this.#mode === mode) {
|
|
2978
3045
|
return;
|
|
2979
3046
|
}
|
|
3047
|
+
if (this.#updateModeCapability) {
|
|
3048
|
+
await this.#updateModeCapability.promise;
|
|
3049
|
+
if (!this.#updateModeCapability) {
|
|
3050
|
+
return;
|
|
3051
|
+
}
|
|
3052
|
+
}
|
|
3053
|
+
this.#updateModeCapability = Promise.withResolvers();
|
|
2980
3054
|
this.#mode = mode;
|
|
2981
3055
|
if (mode === AnnotationEditorType.NONE) {
|
|
2982
3056
|
this.setEditingState(false);
|
|
2983
3057
|
this.#disableAll();
|
|
3058
|
+
this.#updateModeCapability.resolve();
|
|
2984
3059
|
return;
|
|
2985
3060
|
}
|
|
2986
3061
|
this.setEditingState(true);
|
|
2987
|
-
this.#enableAll();
|
|
3062
|
+
await this.#enableAll();
|
|
2988
3063
|
this.unselectAll();
|
|
2989
3064
|
for (const layer of this.#allLayers.values()) {
|
|
2990
3065
|
layer.updateMode(mode);
|
|
2991
3066
|
}
|
|
2992
|
-
if (!editId && isFromKeyboard) {
|
|
2993
|
-
this.addNewEditorFromKeyboard();
|
|
2994
|
-
return;
|
|
2995
|
-
}
|
|
2996
3067
|
if (!editId) {
|
|
3068
|
+
if (isFromKeyboard) {
|
|
3069
|
+
this.addNewEditorFromKeyboard();
|
|
3070
|
+
}
|
|
3071
|
+
this.#updateModeCapability.resolve();
|
|
2997
3072
|
return;
|
|
2998
3073
|
}
|
|
2999
3074
|
for (const editor of this.#allEditors.values()) {
|
|
3000
3075
|
if (editor.annotationElementId === editId) {
|
|
3001
3076
|
this.setSelected(editor);
|
|
3002
3077
|
editor.enterInEditMode();
|
|
3003
|
-
|
|
3078
|
+
} else {
|
|
3079
|
+
editor.unselect();
|
|
3004
3080
|
}
|
|
3005
3081
|
}
|
|
3082
|
+
this.#updateModeCapability.resolve();
|
|
3006
3083
|
}
|
|
3007
3084
|
addNewEditorFromKeyboard() {
|
|
3008
3085
|
if (this.currentLayer.canCreateNewEmptyEditor()) {
|
|
@@ -3076,12 +3153,14 @@ class AnnotationEditorUIManager {
|
|
|
3076
3153
|
layer.div.classList.toggle("waiting", mustWait);
|
|
3077
3154
|
}
|
|
3078
3155
|
}
|
|
3079
|
-
#enableAll() {
|
|
3156
|
+
async #enableAll() {
|
|
3080
3157
|
if (!this.#isEnabled) {
|
|
3081
3158
|
this.#isEnabled = true;
|
|
3159
|
+
const promises = [];
|
|
3082
3160
|
for (const layer of this.#allLayers.values()) {
|
|
3083
|
-
layer.enable();
|
|
3161
|
+
promises.push(layer.enable());
|
|
3084
3162
|
}
|
|
3163
|
+
await Promise.all(promises);
|
|
3085
3164
|
for (const editor of this.#allEditors.values()) {
|
|
3086
3165
|
editor.enable();
|
|
3087
3166
|
}
|
|
@@ -3572,7 +3651,7 @@ class AnnotationEditorUIManager {
|
|
|
3572
3651
|
}
|
|
3573
3652
|
}
|
|
3574
3653
|
|
|
3575
|
-
;//
|
|
3654
|
+
;// ./src/display/editor/alt_text.js
|
|
3576
3655
|
|
|
3577
3656
|
class AltText {
|
|
3578
3657
|
#altText = null;
|
|
@@ -3586,10 +3665,16 @@ class AltText {
|
|
|
3586
3665
|
#guessedText = null;
|
|
3587
3666
|
#textWithDisclaimer = null;
|
|
3588
3667
|
#useNewAltTextFlow = false;
|
|
3668
|
+
static #l10nNewButton = null;
|
|
3589
3669
|
static _l10nPromise = null;
|
|
3590
3670
|
constructor(editor) {
|
|
3591
3671
|
this.#editor = editor;
|
|
3592
3672
|
this.#useNewAltTextFlow = editor._uiManager.useNewAltTextFlow;
|
|
3673
|
+
AltText.#l10nNewButton ||= Object.freeze({
|
|
3674
|
+
added: "pdfjs-editor-new-alt-text-added-button-label",
|
|
3675
|
+
missing: "pdfjs-editor-new-alt-text-missing-button-label",
|
|
3676
|
+
review: "pdfjs-editor-new-alt-text-to-review-button-label"
|
|
3677
|
+
});
|
|
3593
3678
|
}
|
|
3594
3679
|
static initialize(l10nPromise) {
|
|
3595
3680
|
AltText._l10nPromise ||= l10nPromise;
|
|
@@ -3600,7 +3685,7 @@ class AltText {
|
|
|
3600
3685
|
let msg;
|
|
3601
3686
|
if (this.#useNewAltTextFlow) {
|
|
3602
3687
|
altText.classList.add("new");
|
|
3603
|
-
msg = await AltText._l10nPromise.get(
|
|
3688
|
+
msg = await AltText._l10nPromise.get(AltText.#l10nNewButton.missing);
|
|
3604
3689
|
} else {
|
|
3605
3690
|
msg = await AltText._l10nPromise.get("pdfjs-editor-alt-text-button-label");
|
|
3606
3691
|
}
|
|
@@ -3760,10 +3845,8 @@ class AltText {
|
|
|
3760
3845
|
return;
|
|
3761
3846
|
}
|
|
3762
3847
|
if (this.#useNewAltTextFlow) {
|
|
3763
|
-
const label = this.#label;
|
|
3764
|
-
const type = label === "review" ? "to-review" : label;
|
|
3765
3848
|
button.classList.toggle("done", !!this.#altText);
|
|
3766
|
-
AltText._l10nPromise.get(
|
|
3849
|
+
AltText._l10nPromise.get(AltText.#l10nNewButton[this.#label]).then(msg => {
|
|
3767
3850
|
button.setAttribute("aria-label", msg);
|
|
3768
3851
|
for (const child of button.childNodes) {
|
|
3769
3852
|
if (child.nodeType === Node.TEXT_NODE) {
|
|
@@ -3792,8 +3875,7 @@ class AltText {
|
|
|
3792
3875
|
this.#altTextTooltip = tooltip = document.createElement("span");
|
|
3793
3876
|
tooltip.className = "tooltip";
|
|
3794
3877
|
tooltip.setAttribute("role", "tooltip");
|
|
3795
|
-
|
|
3796
|
-
button.setAttribute("aria-describedby", id);
|
|
3878
|
+
tooltip.id = `alt-text-tooltip-${this.#editor.id}`;
|
|
3797
3879
|
const DELAY_TO_SHOW_TOOLTIP = 100;
|
|
3798
3880
|
const signal = this.#editor._uiManager._signal;
|
|
3799
3881
|
signal.addEventListener("abort", () => {
|
|
@@ -3832,7 +3914,7 @@ class AltText {
|
|
|
3832
3914
|
}
|
|
3833
3915
|
}
|
|
3834
3916
|
|
|
3835
|
-
;//
|
|
3917
|
+
;// ./src/display/editor/editor.js
|
|
3836
3918
|
|
|
3837
3919
|
|
|
3838
3920
|
|
|
@@ -3859,6 +3941,7 @@ class AnnotationEditor {
|
|
|
3859
3941
|
#telemetryTimeouts = null;
|
|
3860
3942
|
_editToolbar = null;
|
|
3861
3943
|
_initialOptions = Object.create(null);
|
|
3944
|
+
_initialData = null;
|
|
3862
3945
|
_isVisible = true;
|
|
3863
3946
|
_uiManager = null;
|
|
3864
3947
|
_focusEventsAllowed = true;
|
|
@@ -4233,9 +4316,7 @@ class AnnotationEditor {
|
|
|
4233
4316
|
parentScale,
|
|
4234
4317
|
pageDimensions: [pageWidth, pageHeight]
|
|
4235
4318
|
} = this;
|
|
4236
|
-
|
|
4237
|
-
const scaledHeight = pageHeight * parentScale;
|
|
4238
|
-
return util_FeatureTest.isCSSRoundSupported ? [Math.round(scaledWidth), Math.round(scaledHeight)] : [scaledWidth, scaledHeight];
|
|
4319
|
+
return [pageWidth * parentScale, pageHeight * parentScale];
|
|
4239
4320
|
}
|
|
4240
4321
|
setDims(width, height) {
|
|
4241
4322
|
const [parentWidth, parentHeight] = this.parentDimensions;
|
|
@@ -4474,6 +4555,14 @@ class AnnotationEditor {
|
|
|
4474
4555
|
this._editToolbar = null;
|
|
4475
4556
|
this.#altText?.destroy();
|
|
4476
4557
|
}
|
|
4558
|
+
addContainer(container) {
|
|
4559
|
+
const editToolbarDiv = this._editToolbar?.div;
|
|
4560
|
+
if (editToolbarDiv) {
|
|
4561
|
+
editToolbarDiv.before(container);
|
|
4562
|
+
} else {
|
|
4563
|
+
this.div.append(container);
|
|
4564
|
+
}
|
|
4565
|
+
}
|
|
4477
4566
|
getClientDimensions() {
|
|
4478
4567
|
return this.div.getBoundingClientRect();
|
|
4479
4568
|
}
|
|
@@ -4692,10 +4781,18 @@ class AnnotationEditor {
|
|
|
4692
4781
|
this.#addFocusListeners();
|
|
4693
4782
|
}
|
|
4694
4783
|
rotate(_angle) {}
|
|
4784
|
+
serializeDeleted() {
|
|
4785
|
+
return {
|
|
4786
|
+
id: this.annotationElementId,
|
|
4787
|
+
deleted: true,
|
|
4788
|
+
pageIndex: this.pageIndex,
|
|
4789
|
+
popupRef: this._initialData?.popupRef || ""
|
|
4790
|
+
};
|
|
4791
|
+
}
|
|
4695
4792
|
serialize(isForCopying = false, context = null) {
|
|
4696
4793
|
unreachable("An editor must be serializable");
|
|
4697
4794
|
}
|
|
4698
|
-
static deserialize(data, parent, uiManager) {
|
|
4795
|
+
static async deserialize(data, parent, uiManager) {
|
|
4699
4796
|
const editor = new this.prototype.constructor({
|
|
4700
4797
|
parent,
|
|
4701
4798
|
id: parent.getNextId(),
|
|
@@ -5000,7 +5097,7 @@ class AnnotationEditor {
|
|
|
5000
5097
|
const {
|
|
5001
5098
|
firstChild
|
|
5002
5099
|
} = annotation.container;
|
|
5003
|
-
if (firstChild
|
|
5100
|
+
if (firstChild?.nodeName === "DIV" && firstChild.classList.contains("annotationContent")) {
|
|
5004
5101
|
firstChild.remove();
|
|
5005
5102
|
}
|
|
5006
5103
|
}
|
|
@@ -5012,15 +5109,11 @@ class FakeEditor extends AnnotationEditor {
|
|
|
5012
5109
|
this.deleted = true;
|
|
5013
5110
|
}
|
|
5014
5111
|
serialize() {
|
|
5015
|
-
return
|
|
5016
|
-
id: this.annotationElementId,
|
|
5017
|
-
deleted: true,
|
|
5018
|
-
pageIndex: this.pageIndex
|
|
5019
|
-
};
|
|
5112
|
+
return this.serializeDeleted();
|
|
5020
5113
|
}
|
|
5021
5114
|
}
|
|
5022
5115
|
|
|
5023
|
-
;//
|
|
5116
|
+
;// ./src/shared/murmurhash3.js
|
|
5024
5117
|
const SEED = 0xc3d2e1f0;
|
|
5025
5118
|
const MASK_HIGH = 0xffff0000;
|
|
5026
5119
|
const MASK_LOW = 0xffff;
|
|
@@ -5113,7 +5206,7 @@ class MurmurHash3_64 {
|
|
|
5113
5206
|
}
|
|
5114
5207
|
}
|
|
5115
5208
|
|
|
5116
|
-
;//
|
|
5209
|
+
;// ./src/display/annotation_storage.js
|
|
5117
5210
|
|
|
5118
5211
|
|
|
5119
5212
|
|
|
@@ -5328,7 +5421,7 @@ class PrintAnnotationStorage extends AnnotationStorage {
|
|
|
5328
5421
|
}
|
|
5329
5422
|
}
|
|
5330
5423
|
|
|
5331
|
-
;//
|
|
5424
|
+
;// ./src/display/font_loader.js
|
|
5332
5425
|
|
|
5333
5426
|
class FontLoader {
|
|
5334
5427
|
#systemFonts = new Set();
|
|
@@ -5664,17 +5757,17 @@ class FontFaceObject {
|
|
|
5664
5757
|
}
|
|
5665
5758
|
}
|
|
5666
5759
|
|
|
5667
|
-
;//
|
|
5760
|
+
;// ./src/display/node_utils.js
|
|
5668
5761
|
|
|
5669
5762
|
|
|
5670
5763
|
if (isNodeJS) {
|
|
5671
5764
|
var packageCapability = Promise.withResolvers();
|
|
5672
5765
|
var packageMap = null;
|
|
5673
5766
|
const loadPackages = async () => {
|
|
5674
|
-
const fs = await import(
|
|
5675
|
-
http = await import(
|
|
5676
|
-
https = await import(
|
|
5677
|
-
url = await import(
|
|
5767
|
+
const fs = await import(/*webpackIgnore: true*/"fs"),
|
|
5768
|
+
http = await import(/*webpackIgnore: true*/"http"),
|
|
5769
|
+
https = await import(/*webpackIgnore: true*/"https"),
|
|
5770
|
+
url = await import(/*webpackIgnore: true*/"url");
|
|
5678
5771
|
let canvas, path2d;
|
|
5679
5772
|
return new Map(Object.entries({
|
|
5680
5773
|
fs,
|
|
@@ -5727,7 +5820,7 @@ class NodeStandardFontDataFactory extends BaseStandardFontDataFactory {
|
|
|
5727
5820
|
}
|
|
5728
5821
|
}
|
|
5729
5822
|
|
|
5730
|
-
;//
|
|
5823
|
+
;// ./src/display/pattern_helper.js
|
|
5731
5824
|
|
|
5732
5825
|
|
|
5733
5826
|
const PathType = {
|
|
@@ -5780,7 +5873,7 @@ class RadialAxialShadingPattern extends BaseShadingPattern {
|
|
|
5780
5873
|
const ownerBBox = owner.current.getClippedPathBoundingBox(pathType, getCurrentTransform(ctx)) || [0, 0, 0, 0];
|
|
5781
5874
|
const width = Math.ceil(ownerBBox[2] - ownerBBox[0]) || 1;
|
|
5782
5875
|
const height = Math.ceil(ownerBBox[3] - ownerBBox[1]) || 1;
|
|
5783
|
-
const tmpCanvas = owner.cachedCanvases.getCanvas("pattern", width, height
|
|
5876
|
+
const tmpCanvas = owner.cachedCanvases.getCanvas("pattern", width, height);
|
|
5784
5877
|
const tmpCtx = tmpCanvas.context;
|
|
5785
5878
|
tmpCtx.clearRect(0, 0, tmpCtx.canvas.width, tmpCtx.canvas.height);
|
|
5786
5879
|
tmpCtx.beginPath();
|
|
@@ -5965,7 +6058,7 @@ class MeshShadingPattern extends BaseShadingPattern {
|
|
|
5965
6058
|
};
|
|
5966
6059
|
const paddedWidth = width + BORDER_SIZE * 2;
|
|
5967
6060
|
const paddedHeight = height + BORDER_SIZE * 2;
|
|
5968
|
-
const tmpCanvas = cachedCanvases.getCanvas("mesh", paddedWidth, paddedHeight
|
|
6061
|
+
const tmpCanvas = cachedCanvases.getCanvas("mesh", paddedWidth, paddedHeight);
|
|
5969
6062
|
const tmpCtx = tmpCanvas.context;
|
|
5970
6063
|
const data = tmpCtx.createImageData(width, height);
|
|
5971
6064
|
if (backgroundColor) {
|
|
@@ -6050,58 +6143,102 @@ class TilingPattern {
|
|
|
6050
6143
|
this.baseTransform = baseTransform;
|
|
6051
6144
|
}
|
|
6052
6145
|
createPatternCanvas(owner) {
|
|
6053
|
-
const
|
|
6054
|
-
|
|
6055
|
-
|
|
6056
|
-
|
|
6057
|
-
|
|
6058
|
-
|
|
6059
|
-
|
|
6060
|
-
|
|
6146
|
+
const {
|
|
6147
|
+
bbox,
|
|
6148
|
+
operatorList,
|
|
6149
|
+
paintType,
|
|
6150
|
+
tilingType,
|
|
6151
|
+
color,
|
|
6152
|
+
canvasGraphicsFactory
|
|
6153
|
+
} = this;
|
|
6154
|
+
let {
|
|
6155
|
+
xstep,
|
|
6156
|
+
ystep
|
|
6157
|
+
} = this;
|
|
6158
|
+
xstep = Math.abs(xstep);
|
|
6159
|
+
ystep = Math.abs(ystep);
|
|
6061
6160
|
info("TilingType: " + tilingType);
|
|
6062
6161
|
const x0 = bbox[0],
|
|
6063
6162
|
y0 = bbox[1],
|
|
6064
6163
|
x1 = bbox[2],
|
|
6065
6164
|
y1 = bbox[3];
|
|
6165
|
+
const width = x1 - x0;
|
|
6166
|
+
const height = y1 - y0;
|
|
6066
6167
|
const matrixScale = Util.singularValueDecompose2dScale(this.matrix);
|
|
6067
6168
|
const curMatrixScale = Util.singularValueDecompose2dScale(this.baseTransform);
|
|
6068
|
-
const
|
|
6069
|
-
const
|
|
6070
|
-
|
|
6071
|
-
|
|
6169
|
+
const combinedScaleX = matrixScale[0] * curMatrixScale[0];
|
|
6170
|
+
const combinedScaleY = matrixScale[1] * curMatrixScale[1];
|
|
6171
|
+
let canvasWidth = width,
|
|
6172
|
+
canvasHeight = height,
|
|
6173
|
+
redrawHorizontally = false,
|
|
6174
|
+
redrawVertically = false;
|
|
6175
|
+
const xScaledStep = Math.ceil(xstep * combinedScaleX);
|
|
6176
|
+
const yScaledStep = Math.ceil(ystep * combinedScaleY);
|
|
6177
|
+
const xScaledWidth = Math.ceil(width * combinedScaleX);
|
|
6178
|
+
const yScaledHeight = Math.ceil(height * combinedScaleY);
|
|
6179
|
+
if (xScaledStep >= xScaledWidth) {
|
|
6180
|
+
canvasWidth = xstep;
|
|
6181
|
+
} else {
|
|
6182
|
+
redrawHorizontally = true;
|
|
6183
|
+
}
|
|
6184
|
+
if (yScaledStep >= yScaledHeight) {
|
|
6185
|
+
canvasHeight = ystep;
|
|
6186
|
+
} else {
|
|
6187
|
+
redrawVertically = true;
|
|
6188
|
+
}
|
|
6189
|
+
const dimx = this.getSizeAndScale(canvasWidth, this.ctx.canvas.width, combinedScaleX);
|
|
6190
|
+
const dimy = this.getSizeAndScale(canvasHeight, this.ctx.canvas.height, combinedScaleY);
|
|
6191
|
+
const tmpCanvas = owner.cachedCanvases.getCanvas("pattern", dimx.size, dimy.size);
|
|
6072
6192
|
const tmpCtx = tmpCanvas.context;
|
|
6073
6193
|
const graphics = canvasGraphicsFactory.createCanvasGraphics(tmpCtx);
|
|
6074
6194
|
graphics.groupLevel = owner.groupLevel;
|
|
6075
6195
|
this.setFillAndStrokeStyleToContext(graphics, paintType, color);
|
|
6076
|
-
|
|
6077
|
-
let adjustedY0 = y0;
|
|
6078
|
-
let adjustedX1 = x1;
|
|
6079
|
-
let adjustedY1 = y1;
|
|
6080
|
-
if (x0 < 0) {
|
|
6081
|
-
adjustedX0 = 0;
|
|
6082
|
-
adjustedX1 += Math.abs(x0);
|
|
6083
|
-
}
|
|
6084
|
-
if (y0 < 0) {
|
|
6085
|
-
adjustedY0 = 0;
|
|
6086
|
-
adjustedY1 += Math.abs(y0);
|
|
6087
|
-
}
|
|
6088
|
-
tmpCtx.translate(-(dimx.scale * adjustedX0), -(dimy.scale * adjustedY0));
|
|
6196
|
+
tmpCtx.translate(-dimx.scale * x0, -dimy.scale * y0);
|
|
6089
6197
|
graphics.transform(dimx.scale, 0, 0, dimy.scale, 0, 0);
|
|
6090
6198
|
tmpCtx.save();
|
|
6091
|
-
this.clipBbox(graphics,
|
|
6199
|
+
this.clipBbox(graphics, x0, y0, x1, y1);
|
|
6092
6200
|
graphics.baseTransform = getCurrentTransform(graphics.ctx);
|
|
6093
6201
|
graphics.executeOperatorList(operatorList);
|
|
6094
6202
|
graphics.endDrawing();
|
|
6203
|
+
tmpCtx.restore();
|
|
6204
|
+
if (redrawHorizontally || redrawVertically) {
|
|
6205
|
+
const image = tmpCanvas.canvas;
|
|
6206
|
+
if (redrawHorizontally) {
|
|
6207
|
+
canvasWidth = xstep;
|
|
6208
|
+
}
|
|
6209
|
+
if (redrawVertically) {
|
|
6210
|
+
canvasHeight = ystep;
|
|
6211
|
+
}
|
|
6212
|
+
const dimx2 = this.getSizeAndScale(canvasWidth, this.ctx.canvas.width, combinedScaleX);
|
|
6213
|
+
const dimy2 = this.getSizeAndScale(canvasHeight, this.ctx.canvas.height, combinedScaleY);
|
|
6214
|
+
const xSize = dimx2.size;
|
|
6215
|
+
const ySize = dimy2.size;
|
|
6216
|
+
const tmpCanvas2 = owner.cachedCanvases.getCanvas("pattern-workaround", xSize, ySize);
|
|
6217
|
+
const tmpCtx2 = tmpCanvas2.context;
|
|
6218
|
+
const ii = redrawHorizontally ? Math.floor(width / xstep) : 0;
|
|
6219
|
+
const jj = redrawVertically ? Math.floor(height / ystep) : 0;
|
|
6220
|
+
for (let i = 0; i <= ii; i++) {
|
|
6221
|
+
for (let j = 0; j <= jj; j++) {
|
|
6222
|
+
tmpCtx2.drawImage(image, xSize * i, ySize * j, xSize, ySize, 0, 0, xSize, ySize);
|
|
6223
|
+
}
|
|
6224
|
+
}
|
|
6225
|
+
return {
|
|
6226
|
+
canvas: tmpCanvas2.canvas,
|
|
6227
|
+
scaleX: dimx2.scale,
|
|
6228
|
+
scaleY: dimy2.scale,
|
|
6229
|
+
offsetX: x0,
|
|
6230
|
+
offsetY: y0
|
|
6231
|
+
};
|
|
6232
|
+
}
|
|
6095
6233
|
return {
|
|
6096
6234
|
canvas: tmpCanvas.canvas,
|
|
6097
6235
|
scaleX: dimx.scale,
|
|
6098
6236
|
scaleY: dimy.scale,
|
|
6099
|
-
offsetX:
|
|
6100
|
-
offsetY:
|
|
6237
|
+
offsetX: x0,
|
|
6238
|
+
offsetY: y0
|
|
6101
6239
|
};
|
|
6102
6240
|
}
|
|
6103
6241
|
getSizeAndScale(step, realOutputSize, scale) {
|
|
6104
|
-
step = Math.abs(step);
|
|
6105
6242
|
const maxSize = Math.max(TilingPattern.MAX_PATTERN_SIZE, realOutputSize);
|
|
6106
6243
|
let size = Math.ceil(step * scale);
|
|
6107
6244
|
if (size >= maxSize) {
|
|
@@ -6162,7 +6299,7 @@ class TilingPattern {
|
|
|
6162
6299
|
}
|
|
6163
6300
|
}
|
|
6164
6301
|
|
|
6165
|
-
;//
|
|
6302
|
+
;// ./src/shared/image_utils.js
|
|
6166
6303
|
|
|
6167
6304
|
function convertToRGBA(params) {
|
|
6168
6305
|
switch (params.kind) {
|
|
@@ -6269,7 +6406,7 @@ function grayToRGBA(src, dest) {
|
|
|
6269
6406
|
}
|
|
6270
6407
|
}
|
|
6271
6408
|
|
|
6272
|
-
;//
|
|
6409
|
+
;// ./src/display/canvas.js
|
|
6273
6410
|
|
|
6274
6411
|
|
|
6275
6412
|
|
|
@@ -8077,9 +8214,10 @@ class CanvasGraphics {
|
|
|
8077
8214
|
resetCtxToDefault(this.ctx);
|
|
8078
8215
|
} else {
|
|
8079
8216
|
resetCtxToDefault(this.ctx);
|
|
8217
|
+
this.endPath();
|
|
8080
8218
|
this.ctx.rect(rect[0], rect[1], width, height);
|
|
8081
8219
|
this.ctx.clip();
|
|
8082
|
-
this.
|
|
8220
|
+
this.ctx.beginPath();
|
|
8083
8221
|
}
|
|
8084
8222
|
}
|
|
8085
8223
|
this.current = new CanvasExtraState(this.ctx.canvas.width, this.ctx.canvas.height);
|
|
@@ -8448,7 +8586,7 @@ for (const op in OPS) {
|
|
|
8448
8586
|
}
|
|
8449
8587
|
}
|
|
8450
8588
|
|
|
8451
|
-
;//
|
|
8589
|
+
;// ./src/display/worker_options.js
|
|
8452
8590
|
class GlobalWorkerOptions {
|
|
8453
8591
|
static #port = null;
|
|
8454
8592
|
static #src = "";
|
|
@@ -8472,7 +8610,7 @@ class GlobalWorkerOptions {
|
|
|
8472
8610
|
}
|
|
8473
8611
|
}
|
|
8474
8612
|
|
|
8475
|
-
;//
|
|
8613
|
+
;// ./src/shared/message_handler.js
|
|
8476
8614
|
|
|
8477
8615
|
const CallbackKind = {
|
|
8478
8616
|
UNKNOWN: 0,
|
|
@@ -8875,7 +9013,7 @@ class MessageHandler {
|
|
|
8875
9013
|
}
|
|
8876
9014
|
}
|
|
8877
9015
|
|
|
8878
|
-
;//
|
|
9016
|
+
;// ./src/display/metadata.js
|
|
8879
9017
|
|
|
8880
9018
|
class Metadata {
|
|
8881
9019
|
#metadataMap;
|
|
@@ -8901,7 +9039,7 @@ class Metadata {
|
|
|
8901
9039
|
}
|
|
8902
9040
|
}
|
|
8903
9041
|
|
|
8904
|
-
;//
|
|
9042
|
+
;// ./src/display/optional_content_config.js
|
|
8905
9043
|
|
|
8906
9044
|
|
|
8907
9045
|
const INTERNAL = Symbol("INTERNAL");
|
|
@@ -9153,7 +9291,7 @@ class OptionalContentConfig {
|
|
|
9153
9291
|
}
|
|
9154
9292
|
}
|
|
9155
9293
|
|
|
9156
|
-
;//
|
|
9294
|
+
;// ./src/display/transport_stream.js
|
|
9157
9295
|
|
|
9158
9296
|
|
|
9159
9297
|
class PDFDataTransportStream {
|
|
@@ -9421,7 +9559,7 @@ class PDFDataTransportStreamRangeReader {
|
|
|
9421
9559
|
}
|
|
9422
9560
|
}
|
|
9423
9561
|
|
|
9424
|
-
;//
|
|
9562
|
+
;// ./src/display/content_disposition.js
|
|
9425
9563
|
|
|
9426
9564
|
function getFilenameFromContentDispositionHeader(contentDisposition) {
|
|
9427
9565
|
let needsEncodingFixup = true;
|
|
@@ -9552,12 +9690,25 @@ function getFilenameFromContentDispositionHeader(contentDisposition) {
|
|
|
9552
9690
|
return "";
|
|
9553
9691
|
}
|
|
9554
9692
|
|
|
9555
|
-
;//
|
|
9693
|
+
;// ./src/display/network_utils.js
|
|
9556
9694
|
|
|
9557
9695
|
|
|
9558
9696
|
|
|
9697
|
+
function createHeaders(isHttp, httpHeaders) {
|
|
9698
|
+
const headers = new Headers();
|
|
9699
|
+
if (!isHttp || !httpHeaders || typeof httpHeaders !== "object") {
|
|
9700
|
+
return headers;
|
|
9701
|
+
}
|
|
9702
|
+
for (const key in httpHeaders) {
|
|
9703
|
+
const val = httpHeaders[key];
|
|
9704
|
+
if (val !== undefined) {
|
|
9705
|
+
headers.append(key, val);
|
|
9706
|
+
}
|
|
9707
|
+
}
|
|
9708
|
+
return headers;
|
|
9709
|
+
}
|
|
9559
9710
|
function validateRangeRequestCapabilities({
|
|
9560
|
-
|
|
9711
|
+
responseHeaders,
|
|
9561
9712
|
isHttp,
|
|
9562
9713
|
rangeChunkSize,
|
|
9563
9714
|
disableRange
|
|
@@ -9566,7 +9717,7 @@ function validateRangeRequestCapabilities({
|
|
|
9566
9717
|
allowRangeRequests: false,
|
|
9567
9718
|
suggestedLength: undefined
|
|
9568
9719
|
};
|
|
9569
|
-
const length = parseInt(
|
|
9720
|
+
const length = parseInt(responseHeaders.get("Content-Length"), 10);
|
|
9570
9721
|
if (!Number.isInteger(length)) {
|
|
9571
9722
|
return returnValues;
|
|
9572
9723
|
}
|
|
@@ -9577,18 +9728,18 @@ function validateRangeRequestCapabilities({
|
|
|
9577
9728
|
if (disableRange || !isHttp) {
|
|
9578
9729
|
return returnValues;
|
|
9579
9730
|
}
|
|
9580
|
-
if (
|
|
9731
|
+
if (responseHeaders.get("Accept-Ranges") !== "bytes") {
|
|
9581
9732
|
return returnValues;
|
|
9582
9733
|
}
|
|
9583
|
-
const contentEncoding =
|
|
9734
|
+
const contentEncoding = responseHeaders.get("Content-Encoding") || "identity";
|
|
9584
9735
|
if (contentEncoding !== "identity") {
|
|
9585
9736
|
return returnValues;
|
|
9586
9737
|
}
|
|
9587
9738
|
returnValues.allowRangeRequests = true;
|
|
9588
9739
|
return returnValues;
|
|
9589
9740
|
}
|
|
9590
|
-
function extractFilenameFromHeader(
|
|
9591
|
-
const contentDisposition =
|
|
9741
|
+
function extractFilenameFromHeader(responseHeaders) {
|
|
9742
|
+
const contentDisposition = responseHeaders.get("Content-Disposition");
|
|
9592
9743
|
if (contentDisposition) {
|
|
9593
9744
|
let filename = getFilenameFromContentDispositionHeader(contentDisposition);
|
|
9594
9745
|
if (filename.includes("%")) {
|
|
@@ -9612,7 +9763,7 @@ function validateResponseStatus(status) {
|
|
|
9612
9763
|
return status === 200 || status === 206;
|
|
9613
9764
|
}
|
|
9614
9765
|
|
|
9615
|
-
;//
|
|
9766
|
+
;// ./src/display/fetch_stream.js
|
|
9616
9767
|
|
|
9617
9768
|
|
|
9618
9769
|
function createFetchOptions(headers, withCredentials, abortController) {
|
|
@@ -9625,17 +9776,6 @@ function createFetchOptions(headers, withCredentials, abortController) {
|
|
|
9625
9776
|
redirect: "follow"
|
|
9626
9777
|
};
|
|
9627
9778
|
}
|
|
9628
|
-
function createHeaders(httpHeaders) {
|
|
9629
|
-
const headers = new Headers();
|
|
9630
|
-
for (const property in httpHeaders) {
|
|
9631
|
-
const value = httpHeaders[property];
|
|
9632
|
-
if (value === undefined) {
|
|
9633
|
-
continue;
|
|
9634
|
-
}
|
|
9635
|
-
headers.append(property, value);
|
|
9636
|
-
}
|
|
9637
|
-
return headers;
|
|
9638
|
-
}
|
|
9639
9779
|
function getArrayBuffer(val) {
|
|
9640
9780
|
if (val instanceof Uint8Array) {
|
|
9641
9781
|
return val.buffer;
|
|
@@ -9650,7 +9790,7 @@ class PDFFetchStream {
|
|
|
9650
9790
|
constructor(source) {
|
|
9651
9791
|
this.source = source;
|
|
9652
9792
|
this.isHttp = /^https?:/i.test(source.url);
|
|
9653
|
-
this.
|
|
9793
|
+
this.headers = createHeaders(this.isHttp, source.httpHeaders);
|
|
9654
9794
|
this._fullRequestReader = null;
|
|
9655
9795
|
this._rangeRequestReaders = [];
|
|
9656
9796
|
}
|
|
@@ -9695,27 +9835,27 @@ class PDFFetchStreamReader {
|
|
|
9695
9835
|
this._abortController = new AbortController();
|
|
9696
9836
|
this._isStreamingSupported = !source.disableStream;
|
|
9697
9837
|
this._isRangeSupported = !source.disableRange;
|
|
9698
|
-
|
|
9838
|
+
const headers = new Headers(stream.headers);
|
|
9699
9839
|
const url = source.url;
|
|
9700
|
-
fetch(url, createFetchOptions(
|
|
9840
|
+
fetch(url, createFetchOptions(headers, this._withCredentials, this._abortController)).then(response => {
|
|
9701
9841
|
if (!validateResponseStatus(response.status)) {
|
|
9702
9842
|
throw createResponseStatusError(response.status, url);
|
|
9703
9843
|
}
|
|
9704
9844
|
this._reader = response.body.getReader();
|
|
9705
9845
|
this._headersCapability.resolve();
|
|
9706
|
-
const
|
|
9846
|
+
const responseHeaders = response.headers;
|
|
9707
9847
|
const {
|
|
9708
9848
|
allowRangeRequests,
|
|
9709
9849
|
suggestedLength
|
|
9710
9850
|
} = validateRangeRequestCapabilities({
|
|
9711
|
-
|
|
9712
|
-
isHttp:
|
|
9851
|
+
responseHeaders,
|
|
9852
|
+
isHttp: stream.isHttp,
|
|
9713
9853
|
rangeChunkSize: this._rangeChunkSize,
|
|
9714
9854
|
disableRange: this._disableRange
|
|
9715
9855
|
});
|
|
9716
9856
|
this._isRangeSupported = allowRangeRequests;
|
|
9717
9857
|
this._contentLength = suggestedLength || this._contentLength;
|
|
9718
|
-
this._filename = extractFilenameFromHeader(
|
|
9858
|
+
this._filename = extractFilenameFromHeader(responseHeaders);
|
|
9719
9859
|
if (!this._isStreamingSupported && this._isRangeSupported) {
|
|
9720
9860
|
this.cancel(new AbortException("Streaming is disabled."));
|
|
9721
9861
|
}
|
|
@@ -9774,10 +9914,10 @@ class PDFFetchStreamRangeReader {
|
|
|
9774
9914
|
this._readCapability = Promise.withResolvers();
|
|
9775
9915
|
this._isStreamingSupported = !source.disableStream;
|
|
9776
9916
|
this._abortController = new AbortController();
|
|
9777
|
-
|
|
9778
|
-
|
|
9917
|
+
const headers = new Headers(stream.headers);
|
|
9918
|
+
headers.append("Range", `bytes=${begin}-${end - 1}`);
|
|
9779
9919
|
const url = source.url;
|
|
9780
|
-
fetch(url, createFetchOptions(
|
|
9920
|
+
fetch(url, createFetchOptions(headers, this._withCredentials, this._abortController)).then(response => {
|
|
9781
9921
|
if (!validateResponseStatus(response.status)) {
|
|
9782
9922
|
throw createResponseStatusError(response.status, url);
|
|
9783
9923
|
}
|
|
@@ -9816,7 +9956,7 @@ class PDFFetchStreamRangeReader {
|
|
|
9816
9956
|
}
|
|
9817
9957
|
}
|
|
9818
9958
|
|
|
9819
|
-
;//
|
|
9959
|
+
;// ./src/display/network.js
|
|
9820
9960
|
|
|
9821
9961
|
|
|
9822
9962
|
const OK_RESPONSE = 200;
|
|
@@ -9829,11 +9969,15 @@ function network_getArrayBuffer(xhr) {
|
|
|
9829
9969
|
return stringToBytes(data).buffer;
|
|
9830
9970
|
}
|
|
9831
9971
|
class NetworkManager {
|
|
9832
|
-
constructor(
|
|
9972
|
+
constructor({
|
|
9973
|
+
url,
|
|
9974
|
+
httpHeaders,
|
|
9975
|
+
withCredentials
|
|
9976
|
+
}) {
|
|
9833
9977
|
this.url = url;
|
|
9834
9978
|
this.isHttp = /^https?:/i.test(url);
|
|
9835
|
-
this.
|
|
9836
|
-
this.withCredentials =
|
|
9979
|
+
this.headers = createHeaders(this.isHttp, httpHeaders);
|
|
9980
|
+
this.withCredentials = withCredentials || false;
|
|
9837
9981
|
this.currXhrId = 0;
|
|
9838
9982
|
this.pendingRequests = Object.create(null);
|
|
9839
9983
|
}
|
|
@@ -9858,12 +10002,8 @@ class NetworkManager {
|
|
|
9858
10002
|
};
|
|
9859
10003
|
xhr.open("GET", this.url);
|
|
9860
10004
|
xhr.withCredentials = this.withCredentials;
|
|
9861
|
-
for (const
|
|
9862
|
-
|
|
9863
|
-
if (value === undefined) {
|
|
9864
|
-
continue;
|
|
9865
|
-
}
|
|
9866
|
-
xhr.setRequestHeader(property, value);
|
|
10005
|
+
for (const [key, val] of this.headers) {
|
|
10006
|
+
xhr.setRequestHeader(key, val);
|
|
9867
10007
|
}
|
|
9868
10008
|
if (this.isHttp && "begin" in args && "end" in args) {
|
|
9869
10009
|
xhr.setRequestHeader("Range", `bytes=${args.begin}-${args.end - 1}`);
|
|
@@ -9952,10 +10092,7 @@ class NetworkManager {
|
|
|
9952
10092
|
class PDFNetworkStream {
|
|
9953
10093
|
constructor(source) {
|
|
9954
10094
|
this._source = source;
|
|
9955
|
-
this._manager = new NetworkManager(source
|
|
9956
|
-
httpHeaders: source.httpHeaders,
|
|
9957
|
-
withCredentials: source.withCredentials
|
|
9958
|
-
});
|
|
10095
|
+
this._manager = new NetworkManager(source);
|
|
9959
10096
|
this._rangeChunkSize = source.rangeChunkSize;
|
|
9960
10097
|
this._fullRequestReader = null;
|
|
9961
10098
|
this._rangeRequestReaders = [];
|
|
@@ -9995,7 +10132,7 @@ class PDFNetworkStreamFullRequestReader {
|
|
|
9995
10132
|
};
|
|
9996
10133
|
this._url = source.url;
|
|
9997
10134
|
this._fullRequestId = manager.requestFull(args);
|
|
9998
|
-
this.
|
|
10135
|
+
this._headersCapability = Promise.withResolvers();
|
|
9999
10136
|
this._disableRange = source.disableRange || false;
|
|
10000
10137
|
this._contentLength = source.length;
|
|
10001
10138
|
this._rangeChunkSize = source.rangeChunkSize;
|
|
@@ -10014,12 +10151,15 @@ class PDFNetworkStreamFullRequestReader {
|
|
|
10014
10151
|
_onHeadersReceived() {
|
|
10015
10152
|
const fullRequestXhrId = this._fullRequestId;
|
|
10016
10153
|
const fullRequestXhr = this._manager.getRequestXhr(fullRequestXhrId);
|
|
10017
|
-
const
|
|
10154
|
+
const responseHeaders = new Headers(fullRequestXhr.getAllResponseHeaders().trim().split(/[\r\n]+/).map(x => {
|
|
10155
|
+
const [key, ...val] = x.split(": ");
|
|
10156
|
+
return [key, val.join(": ")];
|
|
10157
|
+
}));
|
|
10018
10158
|
const {
|
|
10019
10159
|
allowRangeRequests,
|
|
10020
10160
|
suggestedLength
|
|
10021
10161
|
} = validateRangeRequestCapabilities({
|
|
10022
|
-
|
|
10162
|
+
responseHeaders,
|
|
10023
10163
|
isHttp: this._manager.isHttp,
|
|
10024
10164
|
rangeChunkSize: this._rangeChunkSize,
|
|
10025
10165
|
disableRange: this._disableRange
|
|
@@ -10028,11 +10168,11 @@ class PDFNetworkStreamFullRequestReader {
|
|
|
10028
10168
|
this._isRangeSupported = true;
|
|
10029
10169
|
}
|
|
10030
10170
|
this._contentLength = suggestedLength || this._contentLength;
|
|
10031
|
-
this._filename = extractFilenameFromHeader(
|
|
10171
|
+
this._filename = extractFilenameFromHeader(responseHeaders);
|
|
10032
10172
|
if (this._isRangeSupported) {
|
|
10033
10173
|
this._manager.abortRequest(fullRequestXhrId);
|
|
10034
10174
|
}
|
|
10035
|
-
this.
|
|
10175
|
+
this._headersCapability.resolve();
|
|
10036
10176
|
}
|
|
10037
10177
|
_onDone(data) {
|
|
10038
10178
|
if (data) {
|
|
@@ -10060,7 +10200,7 @@ class PDFNetworkStreamFullRequestReader {
|
|
|
10060
10200
|
}
|
|
10061
10201
|
_onError(status) {
|
|
10062
10202
|
this._storedError = createResponseStatusError(status, this._url);
|
|
10063
|
-
this.
|
|
10203
|
+
this._headersCapability.reject(this._storedError);
|
|
10064
10204
|
for (const requestCapability of this._requests) {
|
|
10065
10205
|
requestCapability.reject(this._storedError);
|
|
10066
10206
|
}
|
|
@@ -10086,7 +10226,7 @@ class PDFNetworkStreamFullRequestReader {
|
|
|
10086
10226
|
return this._contentLength;
|
|
10087
10227
|
}
|
|
10088
10228
|
get headersReady() {
|
|
10089
|
-
return this.
|
|
10229
|
+
return this._headersCapability.promise;
|
|
10090
10230
|
}
|
|
10091
10231
|
async read() {
|
|
10092
10232
|
if (this._storedError) {
|
|
@@ -10111,7 +10251,7 @@ class PDFNetworkStreamFullRequestReader {
|
|
|
10111
10251
|
}
|
|
10112
10252
|
cancel(reason) {
|
|
10113
10253
|
this._done = true;
|
|
10114
|
-
this.
|
|
10254
|
+
this._headersCapability.reject(reason);
|
|
10115
10255
|
for (const requestCapability of this._requests) {
|
|
10116
10256
|
requestCapability.resolve({
|
|
10117
10257
|
value: undefined,
|
|
@@ -10222,7 +10362,7 @@ class PDFNetworkStreamRangeRequestReader {
|
|
|
10222
10362
|
}
|
|
10223
10363
|
}
|
|
10224
10364
|
|
|
10225
|
-
;//
|
|
10365
|
+
;// ./src/display/node_stream.js
|
|
10226
10366
|
|
|
10227
10367
|
|
|
10228
10368
|
|
|
@@ -10252,7 +10392,7 @@ class PDFNodeStream {
|
|
|
10252
10392
|
this.url = parseUrlOrPath(source.url);
|
|
10253
10393
|
this.isHttp = this.url.protocol === "http:" || this.url.protocol === "https:";
|
|
10254
10394
|
this.isFsUrl = this.url.protocol === "file:";
|
|
10255
|
-
this.
|
|
10395
|
+
this.headers = createHeaders(this.isHttp, source.httpHeaders);
|
|
10256
10396
|
this._fullRequestReader = null;
|
|
10257
10397
|
this._rangeRequestReaders = [];
|
|
10258
10398
|
}
|
|
@@ -10447,6 +10587,7 @@ class BaseRangeReader {
|
|
|
10447
10587
|
class PDFNodeStreamFullReader extends BaseFullReader {
|
|
10448
10588
|
constructor(stream) {
|
|
10449
10589
|
super(stream);
|
|
10590
|
+
const headers = Object.fromEntries(stream.headers);
|
|
10450
10591
|
const handleResponse = response => {
|
|
10451
10592
|
if (response.statusCode === 404) {
|
|
10452
10593
|
const error = new MissingPDFException(`Missing PDF "${this._url}".`);
|
|
@@ -10456,21 +10597,21 @@ class PDFNodeStreamFullReader extends BaseFullReader {
|
|
|
10456
10597
|
}
|
|
10457
10598
|
this._headersCapability.resolve();
|
|
10458
10599
|
this._setReadableStream(response);
|
|
10459
|
-
const
|
|
10600
|
+
const responseHeaders = new Headers(this._readableStream.headers);
|
|
10460
10601
|
const {
|
|
10461
10602
|
allowRangeRequests,
|
|
10462
10603
|
suggestedLength
|
|
10463
10604
|
} = validateRangeRequestCapabilities({
|
|
10464
|
-
|
|
10605
|
+
responseHeaders,
|
|
10465
10606
|
isHttp: stream.isHttp,
|
|
10466
10607
|
rangeChunkSize: this._rangeChunkSize,
|
|
10467
10608
|
disableRange: this._disableRange
|
|
10468
10609
|
});
|
|
10469
10610
|
this._isRangeSupported = allowRangeRequests;
|
|
10470
10611
|
this._contentLength = suggestedLength || this._contentLength;
|
|
10471
|
-
this._filename = extractFilenameFromHeader(
|
|
10612
|
+
this._filename = extractFilenameFromHeader(responseHeaders);
|
|
10472
10613
|
};
|
|
10473
|
-
this._request = createRequest(this._url,
|
|
10614
|
+
this._request = createRequest(this._url, headers, handleResponse);
|
|
10474
10615
|
this._request.on("error", reason => {
|
|
10475
10616
|
this._storedError = reason;
|
|
10476
10617
|
this._headersCapability.reject(reason);
|
|
@@ -10481,15 +10622,8 @@ class PDFNodeStreamFullReader extends BaseFullReader {
|
|
|
10481
10622
|
class PDFNodeStreamRangeReader extends BaseRangeReader {
|
|
10482
10623
|
constructor(stream, start, end) {
|
|
10483
10624
|
super(stream);
|
|
10484
|
-
|
|
10485
|
-
|
|
10486
|
-
const value = stream.httpHeaders[property];
|
|
10487
|
-
if (value === undefined) {
|
|
10488
|
-
continue;
|
|
10489
|
-
}
|
|
10490
|
-
this._httpHeaders[property] = value;
|
|
10491
|
-
}
|
|
10492
|
-
this._httpHeaders.Range = `bytes=${start}-${end - 1}`;
|
|
10625
|
+
const headers = Object.fromEntries(stream.headers);
|
|
10626
|
+
headers.Range = `bytes=${start}-${end - 1}`;
|
|
10493
10627
|
const handleResponse = response => {
|
|
10494
10628
|
if (response.statusCode === 404) {
|
|
10495
10629
|
const error = new MissingPDFException(`Missing PDF "${this._url}".`);
|
|
@@ -10498,7 +10632,7 @@ class PDFNodeStreamRangeReader extends BaseRangeReader {
|
|
|
10498
10632
|
}
|
|
10499
10633
|
this._setReadableStream(response);
|
|
10500
10634
|
};
|
|
10501
|
-
this._request = createRequest(this._url,
|
|
10635
|
+
this._request = createRequest(this._url, headers, handleResponse);
|
|
10502
10636
|
this._request.on("error", reason => {
|
|
10503
10637
|
this._storedError = reason;
|
|
10504
10638
|
});
|
|
@@ -10533,7 +10667,7 @@ class PDFNodeStreamFsRangeReader extends BaseRangeReader {
|
|
|
10533
10667
|
}
|
|
10534
10668
|
}
|
|
10535
10669
|
|
|
10536
|
-
;//
|
|
10670
|
+
;// ./src/display/text_layer.js
|
|
10537
10671
|
|
|
10538
10672
|
|
|
10539
10673
|
const MAX_TEXT_DIVS_TO_RENDER = 100000;
|
|
@@ -10560,6 +10694,7 @@ class TextLayer {
|
|
|
10560
10694
|
#transform = null;
|
|
10561
10695
|
static #ascentCache = new Map();
|
|
10562
10696
|
static #canvasContexts = new Map();
|
|
10697
|
+
static #canvasCtxFonts = new WeakMap();
|
|
10563
10698
|
static #minFontSize = null;
|
|
10564
10699
|
static #pendingTextLayers = new Set();
|
|
10565
10700
|
constructor({
|
|
@@ -10583,8 +10718,6 @@ class TextLayer {
|
|
|
10583
10718
|
this.#scale = viewport.scale * (globalThis.devicePixelRatio || 1);
|
|
10584
10719
|
this.#rotation = viewport.rotation;
|
|
10585
10720
|
this.#layoutTextParams = {
|
|
10586
|
-
prevFontSize: null,
|
|
10587
|
-
prevFontFamily: null,
|
|
10588
10721
|
div: null,
|
|
10589
10722
|
properties: null,
|
|
10590
10723
|
ctx: null
|
|
@@ -10600,11 +10733,18 @@ class TextLayer {
|
|
|
10600
10733
|
this.#pageHeight = pageHeight;
|
|
10601
10734
|
TextLayer.#ensureMinFontSizeComputed();
|
|
10602
10735
|
setLayerDimensions(container, viewport);
|
|
10603
|
-
this.#capability.promise.
|
|
10736
|
+
this.#capability.promise.finally(() => {
|
|
10604
10737
|
TextLayer.#pendingTextLayers.delete(this);
|
|
10605
10738
|
this.#layoutTextParams = null;
|
|
10606
10739
|
this.#styleCache = null;
|
|
10607
|
-
});
|
|
10740
|
+
}).catch(() => {});
|
|
10741
|
+
}
|
|
10742
|
+
static get fontFamilyMap() {
|
|
10743
|
+
const {
|
|
10744
|
+
isWindows,
|
|
10745
|
+
isFirefox
|
|
10746
|
+
} = util_FeatureTest.platform;
|
|
10747
|
+
return shadow(this, "fontFamilyMap", new Map([["sans-serif", `${isWindows && isFirefox ? "Calibri, " : ""}sans-serif`], ["monospace", `${isWindows && isFirefox ? "Lucida Console, " : ""}monospace`]]));
|
|
10608
10748
|
}
|
|
10609
10749
|
render() {
|
|
10610
10750
|
const pump = () => {
|
|
@@ -10644,8 +10784,6 @@ class TextLayer {
|
|
|
10644
10784
|
onBefore?.();
|
|
10645
10785
|
this.#scale = scale;
|
|
10646
10786
|
const params = {
|
|
10647
|
-
prevFontSize: null,
|
|
10648
|
-
prevFontFamily: null,
|
|
10649
10787
|
div: null,
|
|
10650
10788
|
properties: null,
|
|
10651
10789
|
ctx: TextLayer.#getCtx(this.#lang)
|
|
@@ -10716,7 +10854,8 @@ class TextLayer {
|
|
|
10716
10854
|
if (style.vertical) {
|
|
10717
10855
|
angle += Math.PI / 2;
|
|
10718
10856
|
}
|
|
10719
|
-
|
|
10857
|
+
let fontFamily = this.#fontInspectorEnabled && style.fontSubstitution || style.fontFamily;
|
|
10858
|
+
fontFamily = TextLayer.fontFamilyMap.get(fontFamily) || fontFamily;
|
|
10720
10859
|
const fontHeight = Math.hypot(tx[2], tx[3]);
|
|
10721
10860
|
const fontAscent = fontHeight * TextLayer.#getAscent(fontFamily, this.#lang);
|
|
10722
10861
|
let left, top;
|
|
@@ -10778,9 +10917,7 @@ class TextLayer {
|
|
|
10778
10917
|
const {
|
|
10779
10918
|
div,
|
|
10780
10919
|
properties,
|
|
10781
|
-
ctx
|
|
10782
|
-
prevFontSize,
|
|
10783
|
-
prevFontFamily
|
|
10920
|
+
ctx
|
|
10784
10921
|
} = params;
|
|
10785
10922
|
const {
|
|
10786
10923
|
style
|
|
@@ -10797,11 +10934,7 @@ class TextLayer {
|
|
|
10797
10934
|
canvasWidth,
|
|
10798
10935
|
fontSize
|
|
10799
10936
|
} = properties;
|
|
10800
|
-
|
|
10801
|
-
ctx.font = `${fontSize * this.#scale}px ${fontFamily}`;
|
|
10802
|
-
params.prevFontSize = fontSize;
|
|
10803
|
-
params.prevFontFamily = fontFamily;
|
|
10804
|
-
}
|
|
10937
|
+
TextLayer.#ensureCtxFont(ctx, fontSize * this.#scale, fontFamily);
|
|
10805
10938
|
const {
|
|
10806
10939
|
width
|
|
10807
10940
|
} = ctx.measureText(div.textContent);
|
|
@@ -10829,19 +10962,32 @@ class TextLayer {
|
|
|
10829
10962
|
this.#canvasContexts.clear();
|
|
10830
10963
|
}
|
|
10831
10964
|
static #getCtx(lang = null) {
|
|
10832
|
-
let
|
|
10833
|
-
if (!
|
|
10965
|
+
let ctx = this.#canvasContexts.get(lang ||= "");
|
|
10966
|
+
if (!ctx) {
|
|
10834
10967
|
const canvas = document.createElement("canvas");
|
|
10835
10968
|
canvas.className = "hiddenCanvasElement";
|
|
10836
10969
|
canvas.lang = lang;
|
|
10837
10970
|
document.body.append(canvas);
|
|
10838
|
-
|
|
10971
|
+
ctx = canvas.getContext("2d", {
|
|
10839
10972
|
alpha: false,
|
|
10840
10973
|
willReadFrequently: true
|
|
10841
10974
|
});
|
|
10842
|
-
this.#canvasContexts.set(lang,
|
|
10975
|
+
this.#canvasContexts.set(lang, ctx);
|
|
10976
|
+
this.#canvasCtxFonts.set(ctx, {
|
|
10977
|
+
size: 0,
|
|
10978
|
+
family: ""
|
|
10979
|
+
});
|
|
10980
|
+
}
|
|
10981
|
+
return ctx;
|
|
10982
|
+
}
|
|
10983
|
+
static #ensureCtxFont(ctx, size, family) {
|
|
10984
|
+
const cached = this.#canvasCtxFonts.get(ctx);
|
|
10985
|
+
if (size === cached.size && family === cached.family) {
|
|
10986
|
+
return;
|
|
10843
10987
|
}
|
|
10844
|
-
|
|
10988
|
+
ctx.font = `${size}px ${family}`;
|
|
10989
|
+
cached.size = size;
|
|
10990
|
+
cached.family = family;
|
|
10845
10991
|
}
|
|
10846
10992
|
static #ensureMinFontSizeComputed() {
|
|
10847
10993
|
if (this.#minFontSize !== null) {
|
|
@@ -10863,9 +11009,8 @@ class TextLayer {
|
|
|
10863
11009
|
return cachedAscent;
|
|
10864
11010
|
}
|
|
10865
11011
|
const ctx = this.#getCtx(lang);
|
|
10866
|
-
const savedFont = ctx.font;
|
|
10867
11012
|
ctx.canvas.width = ctx.canvas.height = DEFAULT_FONT_SIZE;
|
|
10868
|
-
ctx
|
|
11013
|
+
this.#ensureCtxFont(ctx, DEFAULT_FONT_SIZE, fontFamily);
|
|
10869
11014
|
const metrics = ctx.measureText("");
|
|
10870
11015
|
let ascent = metrics.fontBoundingBoxAscent;
|
|
10871
11016
|
let descent = Math.abs(metrics.fontBoundingBoxDescent);
|
|
@@ -10873,7 +11018,6 @@ class TextLayer {
|
|
|
10873
11018
|
const ratio = ascent / (ascent + descent);
|
|
10874
11019
|
this.#ascentCache.set(fontFamily, ratio);
|
|
10875
11020
|
ctx.canvas.width = ctx.canvas.height = 0;
|
|
10876
|
-
ctx.font = savedFont;
|
|
10877
11021
|
return ratio;
|
|
10878
11022
|
}
|
|
10879
11023
|
ctx.strokeStyle = "red";
|
|
@@ -10898,14 +11042,13 @@ class TextLayer {
|
|
|
10898
11042
|
}
|
|
10899
11043
|
}
|
|
10900
11044
|
ctx.canvas.width = ctx.canvas.height = 0;
|
|
10901
|
-
ctx.font = savedFont;
|
|
10902
11045
|
const ratio = ascent ? ascent / (ascent + descent) : DEFAULT_FONT_ASCENT;
|
|
10903
11046
|
this.#ascentCache.set(fontFamily, ratio);
|
|
10904
11047
|
return ratio;
|
|
10905
11048
|
}
|
|
10906
11049
|
}
|
|
10907
11050
|
|
|
10908
|
-
;//
|
|
11051
|
+
;// ./src/display/xfa_text.js
|
|
10909
11052
|
class XfaText {
|
|
10910
11053
|
static textContent(xfa) {
|
|
10911
11054
|
const items = [];
|
|
@@ -10948,7 +11091,7 @@ class XfaText {
|
|
|
10948
11091
|
}
|
|
10949
11092
|
}
|
|
10950
11093
|
|
|
10951
|
-
;//
|
|
11094
|
+
;// ./src/display/api.js
|
|
10952
11095
|
|
|
10953
11096
|
|
|
10954
11097
|
|
|
@@ -11014,33 +11157,37 @@ function getDocument(src = {}) {
|
|
|
11014
11157
|
const disableStream = src.disableStream === true;
|
|
11015
11158
|
const disableAutoFetch = src.disableAutoFetch === true;
|
|
11016
11159
|
const pdfBug = src.pdfBug === true;
|
|
11160
|
+
const CanvasFactory = src.CanvasFactory || DefaultCanvasFactory;
|
|
11161
|
+
const FilterFactory = src.FilterFactory || DefaultFilterFactory;
|
|
11017
11162
|
const enableHWA = src.enableHWA === true;
|
|
11018
11163
|
const length = rangeTransport ? rangeTransport.length : src.length ?? NaN;
|
|
11019
11164
|
const useSystemFonts = typeof src.useSystemFonts === "boolean" ? src.useSystemFonts : !isNodeJS && !disableFontFace;
|
|
11020
11165
|
const useWorkerFetch = typeof src.useWorkerFetch === "boolean" ? src.useWorkerFetch : CMapReaderFactory === DOMCMapReaderFactory && StandardFontDataFactory === DOMStandardFontDataFactory && cMapUrl && standardFontDataUrl && isValidFetchUrl(cMapUrl, document.baseURI) && isValidFetchUrl(standardFontDataUrl, document.baseURI);
|
|
11021
|
-
|
|
11022
|
-
|
|
11023
|
-
|
|
11024
|
-
|
|
11025
|
-
|
|
11026
|
-
|
|
11027
|
-
ownerDocument
|
|
11028
|
-
});
|
|
11166
|
+
if (src.canvasFactory) {
|
|
11167
|
+
deprecated("`canvasFactory`-instance option, please use `CanvasFactory` instead.");
|
|
11168
|
+
}
|
|
11169
|
+
if (src.filterFactory) {
|
|
11170
|
+
deprecated("`filterFactory`-instance option, please use `FilterFactory` instead.");
|
|
11171
|
+
}
|
|
11029
11172
|
const styleElement = null;
|
|
11030
11173
|
setVerbosityLevel(verbosity);
|
|
11031
11174
|
const transportFactory = {
|
|
11032
|
-
canvasFactory
|
|
11033
|
-
|
|
11034
|
-
|
|
11035
|
-
|
|
11036
|
-
|
|
11175
|
+
canvasFactory: new CanvasFactory({
|
|
11176
|
+
ownerDocument,
|
|
11177
|
+
enableHWA
|
|
11178
|
+
}),
|
|
11179
|
+
filterFactory: new FilterFactory({
|
|
11180
|
+
docId,
|
|
11181
|
+
ownerDocument
|
|
11182
|
+
}),
|
|
11183
|
+
cMapReaderFactory: useWorkerFetch ? null : new CMapReaderFactory({
|
|
11037
11184
|
baseUrl: cMapUrl,
|
|
11038
11185
|
isCompressed: cMapPacked
|
|
11039
|
-
})
|
|
11040
|
-
|
|
11186
|
+
}),
|
|
11187
|
+
standardFontDataFactory: useWorkerFetch ? null : new StandardFontDataFactory({
|
|
11041
11188
|
baseUrl: standardFontDataUrl
|
|
11042
|
-
})
|
|
11043
|
-
}
|
|
11189
|
+
})
|
|
11190
|
+
};
|
|
11044
11191
|
if (!worker) {
|
|
11045
11192
|
const workerParams = {
|
|
11046
11193
|
verbosity,
|
|
@@ -11051,7 +11198,7 @@ function getDocument(src = {}) {
|
|
|
11051
11198
|
}
|
|
11052
11199
|
const docParams = {
|
|
11053
11200
|
docId,
|
|
11054
|
-
apiVersion: "4.
|
|
11201
|
+
apiVersion: "4.7.76",
|
|
11055
11202
|
data,
|
|
11056
11203
|
password,
|
|
11057
11204
|
disableAutoFetch,
|
|
@@ -11101,16 +11248,14 @@ function getDocument(src = {}) {
|
|
|
11101
11248
|
if (!url) {
|
|
11102
11249
|
throw new Error("getDocument - no `url` parameter provided.");
|
|
11103
11250
|
}
|
|
11104
|
-
|
|
11105
|
-
|
|
11106
|
-
|
|
11107
|
-
|
|
11108
|
-
|
|
11109
|
-
|
|
11110
|
-
|
|
11111
|
-
|
|
11112
|
-
};
|
|
11113
|
-
networkStream = createPDFNetworkStream({
|
|
11251
|
+
let NetworkStream;
|
|
11252
|
+
if (isNodeJS) {
|
|
11253
|
+
const isFetchSupported = typeof fetch !== "undefined" && typeof Response !== "undefined" && "body" in Response.prototype;
|
|
11254
|
+
NetworkStream = isFetchSupported && isValidFetchUrl(url) ? PDFFetchStream : PDFNodeStream;
|
|
11255
|
+
} else {
|
|
11256
|
+
NetworkStream = isValidFetchUrl(url) ? PDFFetchStream : PDFNetworkStream;
|
|
11257
|
+
}
|
|
11258
|
+
networkStream = new NetworkStream({
|
|
11114
11259
|
url,
|
|
11115
11260
|
length,
|
|
11116
11261
|
httpHeaders,
|
|
@@ -11266,6 +11411,9 @@ class PDFDocumentProxy {
|
|
|
11266
11411
|
get annotationStorage() {
|
|
11267
11412
|
return this._transport.annotationStorage;
|
|
11268
11413
|
}
|
|
11414
|
+
get canvasFactory() {
|
|
11415
|
+
return this._transport.canvasFactory;
|
|
11416
|
+
}
|
|
11269
11417
|
get filterFactory() {
|
|
11270
11418
|
return this._transport.filterFactory;
|
|
11271
11419
|
}
|
|
@@ -12044,7 +12192,7 @@ class PDFWorker {
|
|
|
12044
12192
|
if (this.#mainThreadWorkerMessageHandler) {
|
|
12045
12193
|
return this.#mainThreadWorkerMessageHandler;
|
|
12046
12194
|
}
|
|
12047
|
-
const worker = await import(
|
|
12195
|
+
const worker = await import(/*webpackIgnore: true*/this.workerSrc);
|
|
12048
12196
|
return worker.WorkerMessageHandler;
|
|
12049
12197
|
};
|
|
12050
12198
|
return shadow(this, "_setupFakeWorkerGlobal", loader());
|
|
@@ -12832,10 +12980,10 @@ class InternalRenderTask {
|
|
|
12832
12980
|
}
|
|
12833
12981
|
}
|
|
12834
12982
|
}
|
|
12835
|
-
const version = "4.
|
|
12836
|
-
const build = "
|
|
12983
|
+
const version = "4.7.76";
|
|
12984
|
+
const build = "8b73b828b";
|
|
12837
12985
|
|
|
12838
|
-
;//
|
|
12986
|
+
;// ./src/shared/scripting_utils.js
|
|
12839
12987
|
function makeColorComp(n) {
|
|
12840
12988
|
return Math.floor(Math.max(0, Math.min(1, n)) * 255).toString(16).padStart(2, "0");
|
|
12841
12989
|
}
|
|
@@ -12894,7 +13042,7 @@ class ColorConverters {
|
|
|
12894
13042
|
}
|
|
12895
13043
|
}
|
|
12896
13044
|
|
|
12897
|
-
;//
|
|
13045
|
+
;// ./src/display/xfa_layer.js
|
|
12898
13046
|
|
|
12899
13047
|
class XfaLayer {
|
|
12900
13048
|
static setupStorage(html, id, element, storage, intent) {
|
|
@@ -13105,7 +13253,7 @@ class XfaLayer {
|
|
|
13105
13253
|
}
|
|
13106
13254
|
}
|
|
13107
13255
|
|
|
13108
|
-
;//
|
|
13256
|
+
;// ./src/display/annotation_layer.js
|
|
13109
13257
|
|
|
13110
13258
|
|
|
13111
13259
|
|
|
@@ -15338,7 +15486,7 @@ class InkAnnotationElement extends AnnotationElement {
|
|
|
15338
15486
|
});
|
|
15339
15487
|
this.containerClassName = "inkAnnotation";
|
|
15340
15488
|
this.svgElementName = "svg:polyline";
|
|
15341
|
-
this.annotationEditorType = AnnotationEditorType.INK;
|
|
15489
|
+
this.annotationEditorType = this.data.it === "InkHighlight" ? AnnotationEditorType.HIGHLIGHT : AnnotationEditorType.INK;
|
|
15342
15490
|
}
|
|
15343
15491
|
render() {
|
|
15344
15492
|
this.container.classList.add(this.containerClassName);
|
|
@@ -15375,6 +15523,7 @@ class InkAnnotationElement extends AnnotationElement {
|
|
|
15375
15523
|
svg.append(polyline);
|
|
15376
15524
|
}
|
|
15377
15525
|
this.container.append(svg);
|
|
15526
|
+
this._editOnDoubleClick();
|
|
15378
15527
|
return this.container;
|
|
15379
15528
|
}
|
|
15380
15529
|
getElementsToTriggerPopup() {
|
|
@@ -15391,12 +15540,14 @@ class HighlightAnnotationElement extends AnnotationElement {
|
|
|
15391
15540
|
ignoreBorder: true,
|
|
15392
15541
|
createQuadrilaterals: true
|
|
15393
15542
|
});
|
|
15543
|
+
this.annotationEditorType = AnnotationEditorType.HIGHLIGHT;
|
|
15394
15544
|
}
|
|
15395
15545
|
render() {
|
|
15396
15546
|
if (!this.data.popupRef && this.hasPopupData) {
|
|
15397
15547
|
this._createPopup();
|
|
15398
15548
|
}
|
|
15399
15549
|
this.container.classList.add("highlightAnnotation");
|
|
15550
|
+
this._editOnDoubleClick();
|
|
15400
15551
|
return this.container;
|
|
15401
15552
|
}
|
|
15402
15553
|
}
|
|
@@ -15454,12 +15605,15 @@ class StampAnnotationElement extends AnnotationElement {
|
|
|
15454
15605
|
isRenderable: true,
|
|
15455
15606
|
ignoreBorder: true
|
|
15456
15607
|
});
|
|
15608
|
+
this.annotationEditorType = AnnotationEditorType.STAMP;
|
|
15457
15609
|
}
|
|
15458
15610
|
render() {
|
|
15459
15611
|
this.container.classList.add("stampAnnotation");
|
|
15612
|
+
this.container.setAttribute("role", "img");
|
|
15460
15613
|
if (!this.data.popupRef && this.hasPopupData) {
|
|
15461
15614
|
this._createPopup();
|
|
15462
15615
|
}
|
|
15616
|
+
this._editOnDoubleClick();
|
|
15463
15617
|
return this.container;
|
|
15464
15618
|
}
|
|
15465
15619
|
}
|
|
@@ -15527,17 +15681,20 @@ class AnnotationLayer {
|
|
|
15527
15681
|
#accessibilityManager = null;
|
|
15528
15682
|
#annotationCanvasMap = null;
|
|
15529
15683
|
#editableAnnotations = new Map();
|
|
15684
|
+
#structTreeLayer = null;
|
|
15530
15685
|
constructor({
|
|
15531
15686
|
div,
|
|
15532
15687
|
accessibilityManager,
|
|
15533
15688
|
annotationCanvasMap,
|
|
15534
15689
|
annotationEditorUIManager,
|
|
15535
15690
|
page,
|
|
15536
|
-
viewport
|
|
15691
|
+
viewport,
|
|
15692
|
+
structTreeLayer
|
|
15537
15693
|
}) {
|
|
15538
15694
|
this.div = div;
|
|
15539
15695
|
this.#accessibilityManager = accessibilityManager;
|
|
15540
15696
|
this.#annotationCanvasMap = annotationCanvasMap;
|
|
15697
|
+
this.#structTreeLayer = structTreeLayer || null;
|
|
15541
15698
|
this.page = page;
|
|
15542
15699
|
this.viewport = viewport;
|
|
15543
15700
|
this.zIndex = 0;
|
|
@@ -15546,9 +15703,15 @@ class AnnotationLayer {
|
|
|
15546
15703
|
hasEditableAnnotations() {
|
|
15547
15704
|
return this.#editableAnnotations.size > 0;
|
|
15548
15705
|
}
|
|
15549
|
-
#appendElement(element, id) {
|
|
15706
|
+
async #appendElement(element, id) {
|
|
15550
15707
|
const contentElement = element.firstChild || element;
|
|
15551
|
-
contentElement.id = `${AnnotationPrefix}${id}`;
|
|
15708
|
+
const annotationId = contentElement.id = `${AnnotationPrefix}${id}`;
|
|
15709
|
+
const ariaAttributes = await this.#structTreeLayer?.getAriaAttributes(annotationId);
|
|
15710
|
+
if (ariaAttributes) {
|
|
15711
|
+
for (const [key, value] of ariaAttributes) {
|
|
15712
|
+
contentElement.setAttribute(key, value);
|
|
15713
|
+
}
|
|
15714
|
+
}
|
|
15552
15715
|
this.div.append(element);
|
|
15553
15716
|
this.#accessibilityManager?.moveElementInDOM(this.div, element, contentElement, false);
|
|
15554
15717
|
}
|
|
@@ -15611,7 +15774,7 @@ class AnnotationLayer {
|
|
|
15611
15774
|
if (data.hidden) {
|
|
15612
15775
|
rendered.style.visibility = "hidden";
|
|
15613
15776
|
}
|
|
15614
|
-
this.#appendElement(rendered, data.id);
|
|
15777
|
+
await this.#appendElement(rendered, data.id);
|
|
15615
15778
|
if (element._isEditable) {
|
|
15616
15779
|
this.#editableAnnotations.set(element.data.id, element);
|
|
15617
15780
|
this._annotationEditorUIManager?.renderAnnotationElement(element);
|
|
@@ -15664,7 +15827,7 @@ class AnnotationLayer {
|
|
|
15664
15827
|
}
|
|
15665
15828
|
}
|
|
15666
15829
|
|
|
15667
|
-
;//
|
|
15830
|
+
;// ./src/display/editor/freetext.js
|
|
15668
15831
|
|
|
15669
15832
|
|
|
15670
15833
|
|
|
@@ -15676,7 +15839,6 @@ class FreeTextEditor extends AnnotationEditor {
|
|
|
15676
15839
|
#editorDivId = `${this.id}-editor`;
|
|
15677
15840
|
#editModeAC = null;
|
|
15678
15841
|
#fontSize;
|
|
15679
|
-
#initialData = null;
|
|
15680
15842
|
static _freeTextDefaultContent = "";
|
|
15681
15843
|
static _internalPadding = 0;
|
|
15682
15844
|
static _defaultColor = null;
|
|
@@ -15890,8 +16052,13 @@ class FreeTextEditor extends AnnotationEditor {
|
|
|
15890
16052
|
#extractText() {
|
|
15891
16053
|
const buffer = [];
|
|
15892
16054
|
this.editorDiv.normalize();
|
|
16055
|
+
let prevChild = null;
|
|
15893
16056
|
for (const child of this.editorDiv.childNodes) {
|
|
16057
|
+
if (prevChild?.nodeType === Node.TEXT_NODE && child.nodeName === "BR") {
|
|
16058
|
+
continue;
|
|
16059
|
+
}
|
|
15894
16060
|
buffer.push(FreeTextEditor.#getNodeContent(child));
|
|
16061
|
+
prevChild = child;
|
|
15895
16062
|
}
|
|
15896
16063
|
return buffer.join("\n");
|
|
15897
16064
|
}
|
|
@@ -16024,7 +16191,7 @@ class FreeTextEditor extends AnnotationEditor {
|
|
|
16024
16191
|
if (this.annotationElementId) {
|
|
16025
16192
|
const {
|
|
16026
16193
|
position
|
|
16027
|
-
} = this
|
|
16194
|
+
} = this._initialData;
|
|
16028
16195
|
let [tx, ty] = this.getInitialTranslation();
|
|
16029
16196
|
[tx, ty] = this.pageTranslationToScreen(tx, ty);
|
|
16030
16197
|
const [pageWidth, pageHeight] = this.pageDimensions;
|
|
@@ -16163,7 +16330,7 @@ class FreeTextEditor extends AnnotationEditor {
|
|
|
16163
16330
|
get contentDiv() {
|
|
16164
16331
|
return this.editorDiv;
|
|
16165
16332
|
}
|
|
16166
|
-
static deserialize(data, parent, uiManager) {
|
|
16333
|
+
static async deserialize(data, parent, uiManager) {
|
|
16167
16334
|
let initialData = null;
|
|
16168
16335
|
if (data instanceof FreeTextAnnotationElement) {
|
|
16169
16336
|
const {
|
|
@@ -16174,7 +16341,8 @@ class FreeTextEditor extends AnnotationEditor {
|
|
|
16174
16341
|
},
|
|
16175
16342
|
rect,
|
|
16176
16343
|
rotation,
|
|
16177
|
-
id
|
|
16344
|
+
id,
|
|
16345
|
+
popupRef
|
|
16178
16346
|
},
|
|
16179
16347
|
textContent,
|
|
16180
16348
|
textPosition,
|
|
@@ -16197,15 +16365,16 @@ class FreeTextEditor extends AnnotationEditor {
|
|
|
16197
16365
|
rect: rect.slice(0),
|
|
16198
16366
|
rotation,
|
|
16199
16367
|
id,
|
|
16200
|
-
deleted: false
|
|
16368
|
+
deleted: false,
|
|
16369
|
+
popupRef
|
|
16201
16370
|
};
|
|
16202
16371
|
}
|
|
16203
|
-
const editor = super.deserialize(data, parent, uiManager);
|
|
16372
|
+
const editor = await super.deserialize(data, parent, uiManager);
|
|
16204
16373
|
editor.#fontSize = data.fontSize;
|
|
16205
16374
|
editor.#color = Util.makeHexColor(...data.color);
|
|
16206
16375
|
editor.#content = FreeTextEditor.#deserializeContent(data.value);
|
|
16207
16376
|
editor.annotationElementId = data.id || null;
|
|
16208
|
-
editor
|
|
16377
|
+
editor._initialData = initialData;
|
|
16209
16378
|
return editor;
|
|
16210
16379
|
}
|
|
16211
16380
|
serialize(isForCopying = false) {
|
|
@@ -16213,11 +16382,7 @@ class FreeTextEditor extends AnnotationEditor {
|
|
|
16213
16382
|
return null;
|
|
16214
16383
|
}
|
|
16215
16384
|
if (this.deleted) {
|
|
16216
|
-
return
|
|
16217
|
-
pageIndex: this.pageIndex,
|
|
16218
|
-
id: this.annotationElementId,
|
|
16219
|
-
deleted: true
|
|
16220
|
-
};
|
|
16385
|
+
return this.serializeDeleted();
|
|
16221
16386
|
}
|
|
16222
16387
|
const padding = FreeTextEditor._internalPadding * this.parentScale;
|
|
16223
16388
|
const rect = this.getRect(padding, padding);
|
|
@@ -16247,7 +16412,7 @@ class FreeTextEditor extends AnnotationEditor {
|
|
|
16247
16412
|
fontSize,
|
|
16248
16413
|
color,
|
|
16249
16414
|
pageIndex
|
|
16250
|
-
} = this
|
|
16415
|
+
} = this._initialData;
|
|
16251
16416
|
return this._hasBeenMoved || serialized.value !== value || serialized.fontSize !== fontSize || serialized.color.some((c, i) => c !== color[i]) || serialized.pageIndex !== pageIndex;
|
|
16252
16417
|
}
|
|
16253
16418
|
renderAnnotationElement(annotation) {
|
|
@@ -16279,7 +16444,7 @@ class FreeTextEditor extends AnnotationEditor {
|
|
|
16279
16444
|
}
|
|
16280
16445
|
}
|
|
16281
16446
|
|
|
16282
|
-
;//
|
|
16447
|
+
;// ./src/display/editor/outliner.js
|
|
16283
16448
|
|
|
16284
16449
|
class Outliner {
|
|
16285
16450
|
#box;
|
|
@@ -16879,7 +17044,7 @@ class FreeHighlightOutline extends Outline {
|
|
|
16879
17044
|
}
|
|
16880
17045
|
}
|
|
16881
17046
|
|
|
16882
|
-
;//
|
|
17047
|
+
;// ./src/display/editor/color_picker.js
|
|
16883
17048
|
|
|
16884
17049
|
|
|
16885
17050
|
|
|
@@ -16896,6 +17061,7 @@ class ColorPicker {
|
|
|
16896
17061
|
#eventBus;
|
|
16897
17062
|
#uiManager = null;
|
|
16898
17063
|
#type;
|
|
17064
|
+
static #l10nColor = null;
|
|
16899
17065
|
static get _keyboardManager() {
|
|
16900
17066
|
return shadow(this, "_keyboardManager", new KeyboardManager([[["Escape", "mac+Escape"], ColorPicker.prototype._hideDropdownFromKeyboard], [[" ", "mac+ "], ColorPicker.prototype._colorSelectFromKeyboard], [["ArrowDown", "ArrowRight", "mac+ArrowDown", "mac+ArrowRight"], ColorPicker.prototype._moveToNext], [["ArrowUp", "ArrowLeft", "mac+ArrowUp", "mac+ArrowLeft"], ColorPicker.prototype._moveToPrevious], [["Home", "mac+Home"], ColorPicker.prototype._moveToBeginning], [["End", "mac+End"], ColorPicker.prototype._moveToEnd]]));
|
|
16901
17067
|
}
|
|
@@ -16914,6 +17080,13 @@ class ColorPicker {
|
|
|
16914
17080
|
this.#uiManager = editor?._uiManager || uiManager;
|
|
16915
17081
|
this.#eventBus = this.#uiManager._eventBus;
|
|
16916
17082
|
this.#defaultColor = editor?.color || this.#uiManager?.highlightColors.values().next().value || "#FFFF98";
|
|
17083
|
+
ColorPicker.#l10nColor ||= Object.freeze({
|
|
17084
|
+
blue: "pdfjs-editor-colorpicker-blue",
|
|
17085
|
+
green: "pdfjs-editor-colorpicker-green",
|
|
17086
|
+
pink: "pdfjs-editor-colorpicker-pink",
|
|
17087
|
+
red: "pdfjs-editor-colorpicker-red",
|
|
17088
|
+
yellow: "pdfjs-editor-colorpicker-yellow"
|
|
17089
|
+
});
|
|
16917
17090
|
}
|
|
16918
17091
|
renderButton() {
|
|
16919
17092
|
const button = this.#button = document.createElement("button");
|
|
@@ -16958,7 +17131,7 @@ class ColorPicker {
|
|
|
16958
17131
|
button.role = "option";
|
|
16959
17132
|
button.setAttribute("data-color", color);
|
|
16960
17133
|
button.title = name;
|
|
16961
|
-
button.setAttribute("data-l10n-id",
|
|
17134
|
+
button.setAttribute("data-l10n-id", ColorPicker.#l10nColor[name]);
|
|
16962
17135
|
const swatch = document.createElement("span");
|
|
16963
17136
|
button.append(swatch);
|
|
16964
17137
|
swatch.className = "swatch";
|
|
@@ -17097,7 +17270,8 @@ class ColorPicker {
|
|
|
17097
17270
|
}
|
|
17098
17271
|
}
|
|
17099
17272
|
|
|
17100
|
-
;//
|
|
17273
|
+
;// ./src/display/editor/highlight.js
|
|
17274
|
+
|
|
17101
17275
|
|
|
17102
17276
|
|
|
17103
17277
|
|
|
@@ -17126,7 +17300,6 @@ class HighlightEditor extends AnnotationEditor {
|
|
|
17126
17300
|
static _defaultColor = null;
|
|
17127
17301
|
static _defaultOpacity = 1;
|
|
17128
17302
|
static _defaultThickness = 12;
|
|
17129
|
-
static _l10nPromise;
|
|
17130
17303
|
static _type = "highlight";
|
|
17131
17304
|
static _editorType = AnnotationEditorType.HIGHLIGHT;
|
|
17132
17305
|
static _freeHighlightId = -1;
|
|
@@ -17160,7 +17333,7 @@ class HighlightEditor extends AnnotationEditor {
|
|
|
17160
17333
|
this.#isFreeHighlight = true;
|
|
17161
17334
|
this.#createFreeOutlines(params);
|
|
17162
17335
|
this.#addToDrawLayer();
|
|
17163
|
-
} else {
|
|
17336
|
+
} else if (this.#boxes) {
|
|
17164
17337
|
this.#anchorNode = params.anchorNode;
|
|
17165
17338
|
this.#anchorOffset = params.anchorOffset;
|
|
17166
17339
|
this.#focusNode = params.focusNode;
|
|
@@ -17304,15 +17477,18 @@ class HighlightEditor extends AnnotationEditor {
|
|
|
17304
17477
|
return [[AnnotationEditorParamsType.HIGHLIGHT_COLOR, this.color || HighlightEditor._defaultColor], [AnnotationEditorParamsType.HIGHLIGHT_THICKNESS, this.#thickness || HighlightEditor._defaultThickness], [AnnotationEditorParamsType.HIGHLIGHT_FREE, this.#isFreeHighlight]];
|
|
17305
17478
|
}
|
|
17306
17479
|
#updateColor(color) {
|
|
17307
|
-
const
|
|
17480
|
+
const setColorAndOpacity = (col, opa) => {
|
|
17308
17481
|
this.color = col;
|
|
17309
17482
|
this.parent?.drawLayer.changeColor(this.#id, col);
|
|
17310
17483
|
this.#colorPicker?.updateColor(col);
|
|
17484
|
+
this.#opacity = opa;
|
|
17485
|
+
this.parent?.drawLayer.changeOpacity(this.#id, opa);
|
|
17311
17486
|
};
|
|
17312
17487
|
const savedColor = this.color;
|
|
17488
|
+
const savedOpacity = this.#opacity;
|
|
17313
17489
|
this.addCommands({
|
|
17314
|
-
cmd:
|
|
17315
|
-
undo:
|
|
17490
|
+
cmd: setColorAndOpacity.bind(this, color, HighlightEditor._defaultOpacity),
|
|
17491
|
+
undo: setColorAndOpacity.bind(this, savedColor, savedOpacity),
|
|
17316
17492
|
post: this._uiManager.updateUI.bind(this._uiManager, this),
|
|
17317
17493
|
mustExec: true,
|
|
17318
17494
|
type: AnnotationEditorParamsType.HIGHLIGHT_COLOR,
|
|
@@ -17375,7 +17551,9 @@ class HighlightEditor extends AnnotationEditor {
|
|
|
17375
17551
|
return super.getRect(tx, ty, this.#getRotation());
|
|
17376
17552
|
}
|
|
17377
17553
|
onceAdded() {
|
|
17378
|
-
this.
|
|
17554
|
+
if (!this.annotationElementId) {
|
|
17555
|
+
this.parent.addUndoableEditor(this);
|
|
17556
|
+
}
|
|
17379
17557
|
this.div.focus();
|
|
17380
17558
|
}
|
|
17381
17559
|
remove() {
|
|
@@ -17683,37 +17861,136 @@ class HighlightEditor extends AnnotationEditor {
|
|
|
17683
17861
|
this._freeHighlight = null;
|
|
17684
17862
|
this._freeHighlightClipId = "";
|
|
17685
17863
|
}
|
|
17686
|
-
static deserialize(data, parent, uiManager) {
|
|
17687
|
-
|
|
17864
|
+
static async deserialize(data, parent, uiManager) {
|
|
17865
|
+
let initialData = null;
|
|
17866
|
+
if (data instanceof HighlightAnnotationElement) {
|
|
17867
|
+
const {
|
|
17868
|
+
data: {
|
|
17869
|
+
quadPoints,
|
|
17870
|
+
rect,
|
|
17871
|
+
rotation,
|
|
17872
|
+
id,
|
|
17873
|
+
color,
|
|
17874
|
+
opacity,
|
|
17875
|
+
popupRef
|
|
17876
|
+
},
|
|
17877
|
+
parent: {
|
|
17878
|
+
page: {
|
|
17879
|
+
pageNumber
|
|
17880
|
+
}
|
|
17881
|
+
}
|
|
17882
|
+
} = data;
|
|
17883
|
+
initialData = data = {
|
|
17884
|
+
annotationType: AnnotationEditorType.HIGHLIGHT,
|
|
17885
|
+
color: Array.from(color),
|
|
17886
|
+
opacity,
|
|
17887
|
+
quadPoints,
|
|
17888
|
+
boxes: null,
|
|
17889
|
+
pageIndex: pageNumber - 1,
|
|
17890
|
+
rect: rect.slice(0),
|
|
17891
|
+
rotation,
|
|
17892
|
+
id,
|
|
17893
|
+
deleted: false,
|
|
17894
|
+
popupRef
|
|
17895
|
+
};
|
|
17896
|
+
} else if (data instanceof InkAnnotationElement) {
|
|
17897
|
+
const {
|
|
17898
|
+
data: {
|
|
17899
|
+
inkLists,
|
|
17900
|
+
rect,
|
|
17901
|
+
rotation,
|
|
17902
|
+
id,
|
|
17903
|
+
color,
|
|
17904
|
+
borderStyle: {
|
|
17905
|
+
rawWidth: thickness
|
|
17906
|
+
},
|
|
17907
|
+
popupRef
|
|
17908
|
+
},
|
|
17909
|
+
parent: {
|
|
17910
|
+
page: {
|
|
17911
|
+
pageNumber
|
|
17912
|
+
}
|
|
17913
|
+
}
|
|
17914
|
+
} = data;
|
|
17915
|
+
initialData = data = {
|
|
17916
|
+
annotationType: AnnotationEditorType.HIGHLIGHT,
|
|
17917
|
+
color: Array.from(color),
|
|
17918
|
+
thickness,
|
|
17919
|
+
inkLists,
|
|
17920
|
+
boxes: null,
|
|
17921
|
+
pageIndex: pageNumber - 1,
|
|
17922
|
+
rect: rect.slice(0),
|
|
17923
|
+
rotation,
|
|
17924
|
+
id,
|
|
17925
|
+
deleted: false,
|
|
17926
|
+
popupRef
|
|
17927
|
+
};
|
|
17928
|
+
}
|
|
17688
17929
|
const {
|
|
17689
|
-
rect: [blX, blY, trX, trY],
|
|
17690
17930
|
color,
|
|
17691
|
-
quadPoints
|
|
17931
|
+
quadPoints,
|
|
17932
|
+
inkLists,
|
|
17933
|
+
opacity
|
|
17692
17934
|
} = data;
|
|
17935
|
+
const editor = await super.deserialize(data, parent, uiManager);
|
|
17693
17936
|
editor.color = Util.makeHexColor(...color);
|
|
17694
|
-
editor.#opacity =
|
|
17937
|
+
editor.#opacity = opacity || 1;
|
|
17938
|
+
if (inkLists) {
|
|
17939
|
+
editor.#thickness = data.thickness;
|
|
17940
|
+
}
|
|
17941
|
+
editor.annotationElementId = data.id || null;
|
|
17942
|
+
editor._initialData = initialData;
|
|
17695
17943
|
const [pageWidth, pageHeight] = editor.pageDimensions;
|
|
17696
|
-
|
|
17697
|
-
|
|
17698
|
-
|
|
17699
|
-
|
|
17700
|
-
|
|
17701
|
-
|
|
17702
|
-
|
|
17703
|
-
|
|
17704
|
-
|
|
17944
|
+
const [pageX, pageY] = editor.pageTranslation;
|
|
17945
|
+
if (quadPoints) {
|
|
17946
|
+
const boxes = editor.#boxes = [];
|
|
17947
|
+
for (let i = 0; i < quadPoints.length; i += 8) {
|
|
17948
|
+
boxes.push({
|
|
17949
|
+
x: (quadPoints[i] - pageX) / pageWidth,
|
|
17950
|
+
y: 1 - (quadPoints[i + 1] - pageY) / pageHeight,
|
|
17951
|
+
width: (quadPoints[i + 2] - quadPoints[i]) / pageWidth,
|
|
17952
|
+
height: (quadPoints[i + 1] - quadPoints[i + 5]) / pageHeight
|
|
17953
|
+
});
|
|
17954
|
+
}
|
|
17955
|
+
editor.#createOutlines();
|
|
17956
|
+
editor.#addToDrawLayer();
|
|
17957
|
+
editor.rotate(editor.rotation);
|
|
17958
|
+
} else if (inkLists) {
|
|
17959
|
+
editor.#isFreeHighlight = true;
|
|
17960
|
+
const points = inkLists[0];
|
|
17961
|
+
const point = {
|
|
17962
|
+
x: points[0] - pageX,
|
|
17963
|
+
y: pageHeight - (points[1] - pageY)
|
|
17964
|
+
};
|
|
17965
|
+
const outliner = new FreeOutliner(point, [0, 0, pageWidth, pageHeight], 1, editor.#thickness / 2, true, 0.001);
|
|
17966
|
+
for (let i = 0, ii = points.length; i < ii; i += 2) {
|
|
17967
|
+
point.x = points[i] - pageX;
|
|
17968
|
+
point.y = pageHeight - (points[i + 1] - pageY);
|
|
17969
|
+
outliner.add(point);
|
|
17970
|
+
}
|
|
17971
|
+
const {
|
|
17972
|
+
id,
|
|
17973
|
+
clipPathId
|
|
17974
|
+
} = parent.drawLayer.highlight(outliner, editor.color, editor._defaultOpacity, true);
|
|
17975
|
+
editor.#createFreeOutlines({
|
|
17976
|
+
highlightOutlines: outliner.getOutlines(),
|
|
17977
|
+
highlightId: id,
|
|
17978
|
+
clipPathId
|
|
17705
17979
|
});
|
|
17980
|
+
editor.#addToDrawLayer();
|
|
17706
17981
|
}
|
|
17707
|
-
editor.#createOutlines();
|
|
17708
17982
|
return editor;
|
|
17709
17983
|
}
|
|
17710
17984
|
serialize(isForCopying = false) {
|
|
17711
17985
|
if (this.isEmpty() || isForCopying) {
|
|
17712
17986
|
return null;
|
|
17713
17987
|
}
|
|
17988
|
+
if (this.deleted) {
|
|
17989
|
+
return this.serializeDeleted();
|
|
17990
|
+
}
|
|
17714
17991
|
const rect = this.getRect(0, 0);
|
|
17715
17992
|
const color = AnnotationEditor._colorManager.convert(this.color);
|
|
17716
|
-
|
|
17993
|
+
const serialized = {
|
|
17717
17994
|
annotationType: AnnotationEditorType.HIGHLIGHT,
|
|
17718
17995
|
color,
|
|
17719
17996
|
opacity: this.#opacity,
|
|
@@ -17725,13 +18002,30 @@ class HighlightEditor extends AnnotationEditor {
|
|
|
17725
18002
|
rotation: this.#getRotation(),
|
|
17726
18003
|
structTreeParentId: this._structTreeParentId
|
|
17727
18004
|
};
|
|
18005
|
+
if (this.annotationElementId && !this.#hasElementChanged(serialized)) {
|
|
18006
|
+
return null;
|
|
18007
|
+
}
|
|
18008
|
+
serialized.id = this.annotationElementId;
|
|
18009
|
+
return serialized;
|
|
18010
|
+
}
|
|
18011
|
+
#hasElementChanged(serialized) {
|
|
18012
|
+
const {
|
|
18013
|
+
color
|
|
18014
|
+
} = this._initialData;
|
|
18015
|
+
return serialized.color.some((c, i) => c !== color[i]);
|
|
18016
|
+
}
|
|
18017
|
+
renderAnnotationElement(annotation) {
|
|
18018
|
+
annotation.updateEdited({
|
|
18019
|
+
rect: this.getRect(0, 0)
|
|
18020
|
+
});
|
|
18021
|
+
return null;
|
|
17728
18022
|
}
|
|
17729
18023
|
static canCreateNewEmptyEditor() {
|
|
17730
18024
|
return false;
|
|
17731
18025
|
}
|
|
17732
18026
|
}
|
|
17733
18027
|
|
|
17734
|
-
;//
|
|
18028
|
+
;// ./src/display/editor/ink.js
|
|
17735
18029
|
|
|
17736
18030
|
|
|
17737
18031
|
|
|
@@ -18485,11 +18779,11 @@ class InkEditor extends AnnotationEditor {
|
|
|
18485
18779
|
const unscaledPadding = firstTime ? padding / this.scaleFactor / 2 : 0;
|
|
18486
18780
|
this.translate(prevTranslationX - this.translationX - unscaledPadding, prevTranslationY - this.translationY - unscaledPadding);
|
|
18487
18781
|
}
|
|
18488
|
-
static deserialize(data, parent, uiManager) {
|
|
18782
|
+
static async deserialize(data, parent, uiManager) {
|
|
18489
18783
|
if (data instanceof InkAnnotationElement) {
|
|
18490
18784
|
return null;
|
|
18491
18785
|
}
|
|
18492
|
-
const editor = super.deserialize(data, parent, uiManager);
|
|
18786
|
+
const editor = await super.deserialize(data, parent, uiManager);
|
|
18493
18787
|
editor.thickness = data.thickness;
|
|
18494
18788
|
editor.color = Util.makeHexColor(...data.color);
|
|
18495
18789
|
editor.opacity = data.opacity;
|
|
@@ -18554,7 +18848,7 @@ class InkEditor extends AnnotationEditor {
|
|
|
18554
18848
|
}
|
|
18555
18849
|
}
|
|
18556
18850
|
|
|
18557
|
-
;//
|
|
18851
|
+
;// ./src/display/editor/stamp.js
|
|
18558
18852
|
|
|
18559
18853
|
|
|
18560
18854
|
|
|
@@ -18675,7 +18969,7 @@ class StampEditor extends AnnotationEditor {
|
|
|
18675
18969
|
data,
|
|
18676
18970
|
width,
|
|
18677
18971
|
height
|
|
18678
|
-
} = imageData || this.copyCanvas(null, true).imageData;
|
|
18972
|
+
} = imageData || this.copyCanvas(null, null, true).imageData;
|
|
18679
18973
|
const response = await mlManager.guess({
|
|
18680
18974
|
name: "altText",
|
|
18681
18975
|
request: {
|
|
@@ -18813,13 +19107,14 @@ class StampEditor extends AnnotationEditor {
|
|
|
18813
19107
|
}
|
|
18814
19108
|
super.render();
|
|
18815
19109
|
this.div.hidden = true;
|
|
19110
|
+
this.div.setAttribute("role", "figure");
|
|
18816
19111
|
this.addAltTextButton();
|
|
18817
19112
|
if (this.#bitmap) {
|
|
18818
19113
|
this.#createCanvas();
|
|
18819
19114
|
} else {
|
|
18820
19115
|
this.#getBitmap();
|
|
18821
19116
|
}
|
|
18822
|
-
if (this.width) {
|
|
19117
|
+
if (this.width && !this.annotationElementId) {
|
|
18823
19118
|
const [parentWidth, parentHeight] = this.parentDimensions;
|
|
18824
19119
|
this.setAt(baseX * parentWidth, baseY * parentHeight, this.width * parentWidth, this.height * parentHeight);
|
|
18825
19120
|
}
|
|
@@ -18847,8 +19142,9 @@ class StampEditor extends AnnotationEditor {
|
|
|
18847
19142
|
this.setDims(width * parentWidth / pageWidth, height * parentHeight / pageHeight);
|
|
18848
19143
|
this._uiManager.enableWaiting(false);
|
|
18849
19144
|
const canvas = this.#canvas = document.createElement("canvas");
|
|
18850
|
-
|
|
18851
|
-
|
|
19145
|
+
canvas.setAttribute("role", "img");
|
|
19146
|
+
this.addContainer(canvas);
|
|
19147
|
+
if (!this._uiManager.useNewAltTextWhenAddingImage || !this._uiManager.useNewAltTextFlow || this.annotationElementId) {
|
|
18852
19148
|
div.hidden = false;
|
|
18853
19149
|
}
|
|
18854
19150
|
this.#drawBitmap(width, height);
|
|
@@ -18864,76 +19160,94 @@ class StampEditor extends AnnotationEditor {
|
|
|
18864
19160
|
canvas.setAttribute("aria-label", this.#bitmapFileName);
|
|
18865
19161
|
}
|
|
18866
19162
|
}
|
|
18867
|
-
copyCanvas(
|
|
18868
|
-
if (!
|
|
18869
|
-
|
|
19163
|
+
copyCanvas(maxDataDimension, maxPreviewDimension, createImageData = false) {
|
|
19164
|
+
if (!maxDataDimension) {
|
|
19165
|
+
maxDataDimension = 224;
|
|
18870
19166
|
}
|
|
18871
19167
|
const {
|
|
18872
19168
|
width: bitmapWidth,
|
|
18873
19169
|
height: bitmapHeight
|
|
18874
19170
|
} = this.#bitmap;
|
|
18875
|
-
const
|
|
19171
|
+
const outputScale = new OutputScale();
|
|
18876
19172
|
let bitmap = this.#bitmap;
|
|
18877
19173
|
let width = bitmapWidth,
|
|
18878
19174
|
height = bitmapHeight;
|
|
18879
|
-
|
|
18880
|
-
|
|
18881
|
-
|
|
18882
|
-
|
|
19175
|
+
let canvas = null;
|
|
19176
|
+
if (maxPreviewDimension) {
|
|
19177
|
+
if (bitmapWidth > maxPreviewDimension || bitmapHeight > maxPreviewDimension) {
|
|
19178
|
+
const ratio = Math.min(maxPreviewDimension / bitmapWidth, maxPreviewDimension / bitmapHeight);
|
|
19179
|
+
width = Math.floor(bitmapWidth * ratio);
|
|
19180
|
+
height = Math.floor(bitmapHeight * ratio);
|
|
19181
|
+
}
|
|
19182
|
+
canvas = document.createElement("canvas");
|
|
19183
|
+
const scaledWidth = canvas.width = Math.ceil(width * outputScale.sx);
|
|
19184
|
+
const scaledHeight = canvas.height = Math.ceil(height * outputScale.sy);
|
|
18883
19185
|
if (!this.#isSvg) {
|
|
18884
|
-
bitmap = this.#scaleBitmap(
|
|
19186
|
+
bitmap = this.#scaleBitmap(scaledWidth, scaledHeight);
|
|
18885
19187
|
}
|
|
18886
|
-
|
|
18887
|
-
|
|
18888
|
-
|
|
18889
|
-
|
|
18890
|
-
|
|
18891
|
-
|
|
18892
|
-
|
|
18893
|
-
|
|
18894
|
-
|
|
18895
|
-
|
|
18896
|
-
|
|
18897
|
-
|
|
18898
|
-
|
|
18899
|
-
|
|
18900
|
-
|
|
18901
|
-
|
|
18902
|
-
|
|
18903
|
-
|
|
18904
|
-
|
|
18905
|
-
|
|
18906
|
-
|
|
18907
|
-
|
|
18908
|
-
|
|
19188
|
+
const ctx = canvas.getContext("2d");
|
|
19189
|
+
ctx.filter = this._uiManager.hcmFilter;
|
|
19190
|
+
let white = "white",
|
|
19191
|
+
black = "#cfcfd8";
|
|
19192
|
+
if (this._uiManager.hcmFilter !== "none") {
|
|
19193
|
+
black = "black";
|
|
19194
|
+
} else if (window.matchMedia?.("(prefers-color-scheme: dark)").matches) {
|
|
19195
|
+
white = "#8f8f9d";
|
|
19196
|
+
black = "#42414d";
|
|
19197
|
+
}
|
|
19198
|
+
const boxDim = 15;
|
|
19199
|
+
const boxDimWidth = boxDim * outputScale.sx;
|
|
19200
|
+
const boxDimHeight = boxDim * outputScale.sy;
|
|
19201
|
+
const pattern = new OffscreenCanvas(boxDimWidth * 2, boxDimHeight * 2);
|
|
19202
|
+
const patternCtx = pattern.getContext("2d");
|
|
19203
|
+
patternCtx.fillStyle = white;
|
|
19204
|
+
patternCtx.fillRect(0, 0, boxDimWidth * 2, boxDimHeight * 2);
|
|
19205
|
+
patternCtx.fillStyle = black;
|
|
19206
|
+
patternCtx.fillRect(0, 0, boxDimWidth, boxDimHeight);
|
|
19207
|
+
patternCtx.fillRect(boxDimWidth, boxDimHeight, boxDimWidth, boxDimHeight);
|
|
19208
|
+
ctx.fillStyle = ctx.createPattern(pattern, "repeat");
|
|
19209
|
+
ctx.fillRect(0, 0, scaledWidth, scaledHeight);
|
|
19210
|
+
ctx.drawImage(bitmap, 0, 0, bitmap.width, bitmap.height, 0, 0, scaledWidth, scaledHeight);
|
|
19211
|
+
}
|
|
19212
|
+
let imageData = null;
|
|
18909
19213
|
if (createImageData) {
|
|
18910
|
-
|
|
19214
|
+
let dataWidth, dataHeight;
|
|
19215
|
+
if (outputScale.symmetric && bitmap.width < maxDataDimension && bitmap.height < maxDataDimension) {
|
|
19216
|
+
dataWidth = bitmap.width;
|
|
19217
|
+
dataHeight = bitmap.height;
|
|
19218
|
+
} else {
|
|
19219
|
+
bitmap = this.#bitmap;
|
|
19220
|
+
if (bitmapWidth > maxDataDimension || bitmapHeight > maxDataDimension) {
|
|
19221
|
+
const ratio = Math.min(maxDataDimension / bitmapWidth, maxDataDimension / bitmapHeight);
|
|
19222
|
+
dataWidth = Math.floor(bitmapWidth * ratio);
|
|
19223
|
+
dataHeight = Math.floor(bitmapHeight * ratio);
|
|
19224
|
+
if (!this.#isSvg) {
|
|
19225
|
+
bitmap = this.#scaleBitmap(dataWidth, dataHeight);
|
|
19226
|
+
}
|
|
19227
|
+
}
|
|
19228
|
+
}
|
|
19229
|
+
const offscreen = new OffscreenCanvas(dataWidth, dataHeight);
|
|
18911
19230
|
const offscreenCtx = offscreen.getContext("2d", {
|
|
18912
19231
|
willReadFrequently: true
|
|
18913
19232
|
});
|
|
18914
|
-
offscreenCtx.drawImage(bitmap, 0, 0, bitmap.width, bitmap.height, 0, 0,
|
|
18915
|
-
|
|
18916
|
-
|
|
18917
|
-
|
|
18918
|
-
|
|
18919
|
-
imageData: {
|
|
18920
|
-
width,
|
|
18921
|
-
height,
|
|
18922
|
-
data
|
|
18923
|
-
}
|
|
19233
|
+
offscreenCtx.drawImage(bitmap, 0, 0, bitmap.width, bitmap.height, 0, 0, dataWidth, dataHeight);
|
|
19234
|
+
imageData = {
|
|
19235
|
+
width: dataWidth,
|
|
19236
|
+
height: dataHeight,
|
|
19237
|
+
data: offscreenCtx.getImageData(0, 0, dataWidth, dataHeight).data
|
|
18924
19238
|
};
|
|
18925
19239
|
}
|
|
18926
|
-
ctx.drawImage(bitmap, 0, 0, bitmap.width, bitmap.height, 0, 0, width, height);
|
|
18927
19240
|
return {
|
|
18928
19241
|
canvas,
|
|
18929
|
-
|
|
19242
|
+
width,
|
|
19243
|
+
height,
|
|
19244
|
+
imageData
|
|
18930
19245
|
};
|
|
18931
19246
|
}
|
|
18932
19247
|
#setDimensions(width, height) {
|
|
18933
19248
|
const [parentWidth, parentHeight] = this.parentDimensions;
|
|
18934
19249
|
this.width = width / parentWidth;
|
|
18935
19250
|
this.height = height / parentHeight;
|
|
18936
|
-
this.setDims(width, height);
|
|
18937
19251
|
if (this._initialOptions?.isCentered) {
|
|
18938
19252
|
this.center();
|
|
18939
19253
|
} else {
|
|
@@ -18974,18 +19288,19 @@ class StampEditor extends AnnotationEditor {
|
|
|
18974
19288
|
return bitmap;
|
|
18975
19289
|
}
|
|
18976
19290
|
#drawBitmap(width, height) {
|
|
18977
|
-
|
|
18978
|
-
|
|
19291
|
+
const outputScale = new OutputScale();
|
|
19292
|
+
const scaledWidth = Math.ceil(width * outputScale.sx);
|
|
19293
|
+
const scaledHeight = Math.ceil(height * outputScale.sy);
|
|
18979
19294
|
const canvas = this.#canvas;
|
|
18980
|
-
if (!canvas || canvas.width ===
|
|
19295
|
+
if (!canvas || canvas.width === scaledWidth && canvas.height === scaledHeight) {
|
|
18981
19296
|
return;
|
|
18982
19297
|
}
|
|
18983
|
-
canvas.width =
|
|
18984
|
-
canvas.height =
|
|
18985
|
-
const bitmap = this.#isSvg ? this.#bitmap : this.#scaleBitmap(
|
|
19298
|
+
canvas.width = scaledWidth;
|
|
19299
|
+
canvas.height = scaledHeight;
|
|
19300
|
+
const bitmap = this.#isSvg ? this.#bitmap : this.#scaleBitmap(scaledWidth, scaledHeight);
|
|
18986
19301
|
const ctx = canvas.getContext("2d");
|
|
18987
19302
|
ctx.filter = this._uiManager.hcmFilter;
|
|
18988
|
-
ctx.drawImage(bitmap, 0, 0, bitmap.width, bitmap.height, 0, 0,
|
|
19303
|
+
ctx.drawImage(bitmap, 0, 0, bitmap.width, bitmap.height, 0, 0, scaledWidth, scaledHeight);
|
|
18989
19304
|
}
|
|
18990
19305
|
getImageForAltText() {
|
|
18991
19306
|
return this.#canvas;
|
|
@@ -19036,13 +19351,50 @@ class StampEditor extends AnnotationEditor {
|
|
|
19036
19351
|
once: true
|
|
19037
19352
|
});
|
|
19038
19353
|
}
|
|
19039
|
-
static deserialize(data, parent, uiManager) {
|
|
19354
|
+
static async deserialize(data, parent, uiManager) {
|
|
19355
|
+
let initialData = null;
|
|
19040
19356
|
if (data instanceof StampAnnotationElement) {
|
|
19041
|
-
|
|
19357
|
+
const {
|
|
19358
|
+
data: {
|
|
19359
|
+
rect,
|
|
19360
|
+
rotation,
|
|
19361
|
+
id,
|
|
19362
|
+
structParent,
|
|
19363
|
+
popupRef
|
|
19364
|
+
},
|
|
19365
|
+
container,
|
|
19366
|
+
parent: {
|
|
19367
|
+
page: {
|
|
19368
|
+
pageNumber
|
|
19369
|
+
}
|
|
19370
|
+
}
|
|
19371
|
+
} = data;
|
|
19372
|
+
const canvas = container.querySelector("canvas");
|
|
19373
|
+
const imageData = uiManager.imageManager.getFromCanvas(container.id, canvas);
|
|
19374
|
+
canvas.remove();
|
|
19375
|
+
const altText = (await parent._structTree.getAriaAttributes(`${AnnotationPrefix}${id}`))?.get("aria-label") || "";
|
|
19376
|
+
initialData = data = {
|
|
19377
|
+
annotationType: AnnotationEditorType.STAMP,
|
|
19378
|
+
bitmapId: imageData.id,
|
|
19379
|
+
bitmap: imageData.bitmap,
|
|
19380
|
+
pageIndex: pageNumber - 1,
|
|
19381
|
+
rect: rect.slice(0),
|
|
19382
|
+
rotation,
|
|
19383
|
+
id,
|
|
19384
|
+
deleted: false,
|
|
19385
|
+
accessibilityData: {
|
|
19386
|
+
decorative: false,
|
|
19387
|
+
altText
|
|
19388
|
+
},
|
|
19389
|
+
isSvg: false,
|
|
19390
|
+
structParent,
|
|
19391
|
+
popupRef
|
|
19392
|
+
};
|
|
19042
19393
|
}
|
|
19043
|
-
const editor = super.deserialize(data, parent, uiManager);
|
|
19394
|
+
const editor = await super.deserialize(data, parent, uiManager);
|
|
19044
19395
|
const {
|
|
19045
19396
|
rect,
|
|
19397
|
+
bitmap,
|
|
19046
19398
|
bitmapUrl,
|
|
19047
19399
|
bitmapId,
|
|
19048
19400
|
isSvg,
|
|
@@ -19050,6 +19402,9 @@ class StampEditor extends AnnotationEditor {
|
|
|
19050
19402
|
} = data;
|
|
19051
19403
|
if (bitmapId && uiManager.imageManager.isValidId(bitmapId)) {
|
|
19052
19404
|
editor.#bitmapId = bitmapId;
|
|
19405
|
+
if (bitmap) {
|
|
19406
|
+
editor.#bitmap = bitmap;
|
|
19407
|
+
}
|
|
19053
19408
|
} else {
|
|
19054
19409
|
editor.#bitmapUrl = bitmapUrl;
|
|
19055
19410
|
}
|
|
@@ -19057,15 +19412,21 @@ class StampEditor extends AnnotationEditor {
|
|
|
19057
19412
|
const [parentWidth, parentHeight] = editor.pageDimensions;
|
|
19058
19413
|
editor.width = (rect[2] - rect[0]) / parentWidth;
|
|
19059
19414
|
editor.height = (rect[3] - rect[1]) / parentHeight;
|
|
19415
|
+
editor.annotationElementId = data.id || null;
|
|
19060
19416
|
if (accessibilityData) {
|
|
19061
19417
|
editor.altTextData = accessibilityData;
|
|
19062
19418
|
}
|
|
19419
|
+
editor._initialData = initialData;
|
|
19420
|
+
editor.#hasBeenAddedInUndoStack = !!initialData;
|
|
19063
19421
|
return editor;
|
|
19064
19422
|
}
|
|
19065
19423
|
serialize(isForCopying = false, context = null) {
|
|
19066
19424
|
if (this.isEmpty()) {
|
|
19067
19425
|
return null;
|
|
19068
19426
|
}
|
|
19427
|
+
if (this.deleted) {
|
|
19428
|
+
return this.serializeDeleted();
|
|
19429
|
+
}
|
|
19069
19430
|
const serialized = {
|
|
19070
19431
|
annotationType: AnnotationEditorType.STAMP,
|
|
19071
19432
|
bitmapId: this.#bitmapId,
|
|
@@ -19090,6 +19451,18 @@ class StampEditor extends AnnotationEditor {
|
|
|
19090
19451
|
alt: altText
|
|
19091
19452
|
};
|
|
19092
19453
|
}
|
|
19454
|
+
if (this.annotationElementId) {
|
|
19455
|
+
const changes = this.#hasElementChanged(serialized);
|
|
19456
|
+
if (changes.isSame) {
|
|
19457
|
+
return null;
|
|
19458
|
+
}
|
|
19459
|
+
if (changes.isSameAltText) {
|
|
19460
|
+
delete serialized.accessibilityData;
|
|
19461
|
+
} else {
|
|
19462
|
+
serialized.accessibilityData.structParent = this._initialData.structParent ?? -1;
|
|
19463
|
+
}
|
|
19464
|
+
}
|
|
19465
|
+
serialized.id = this.annotationElementId;
|
|
19093
19466
|
if (context === null) {
|
|
19094
19467
|
return serialized;
|
|
19095
19468
|
}
|
|
@@ -19111,9 +19484,31 @@ class StampEditor extends AnnotationEditor {
|
|
|
19111
19484
|
}
|
|
19112
19485
|
return serialized;
|
|
19113
19486
|
}
|
|
19487
|
+
#hasElementChanged(serialized) {
|
|
19488
|
+
const {
|
|
19489
|
+
rect,
|
|
19490
|
+
pageIndex,
|
|
19491
|
+
accessibilityData: {
|
|
19492
|
+
altText
|
|
19493
|
+
}
|
|
19494
|
+
} = this._initialData;
|
|
19495
|
+
const isSameRect = serialized.rect.every((x, i) => Math.abs(x - rect[i]) < 1);
|
|
19496
|
+
const isSamePageIndex = serialized.pageIndex === pageIndex;
|
|
19497
|
+
const isSameAltText = (serialized.accessibilityData?.alt || "") === altText;
|
|
19498
|
+
return {
|
|
19499
|
+
isSame: isSameRect && isSamePageIndex && isSameAltText,
|
|
19500
|
+
isSameAltText
|
|
19501
|
+
};
|
|
19502
|
+
}
|
|
19503
|
+
renderAnnotationElement(annotation) {
|
|
19504
|
+
annotation.updateEdited({
|
|
19505
|
+
rect: this.getRect(0, 0)
|
|
19506
|
+
});
|
|
19507
|
+
return null;
|
|
19508
|
+
}
|
|
19114
19509
|
}
|
|
19115
19510
|
|
|
19116
|
-
;//
|
|
19511
|
+
;// ./src/display/editor/annotation_editor_layer.js
|
|
19117
19512
|
|
|
19118
19513
|
|
|
19119
19514
|
|
|
@@ -19140,6 +19535,7 @@ class AnnotationEditorLayer {
|
|
|
19140
19535
|
uiManager,
|
|
19141
19536
|
pageIndex,
|
|
19142
19537
|
div,
|
|
19538
|
+
structTreeLayer,
|
|
19143
19539
|
accessibilityManager,
|
|
19144
19540
|
annotationLayer,
|
|
19145
19541
|
drawLayer,
|
|
@@ -19163,6 +19559,7 @@ class AnnotationEditorLayer {
|
|
|
19163
19559
|
this.viewport = viewport;
|
|
19164
19560
|
this.#textLayer = textLayer;
|
|
19165
19561
|
this.drawLayer = drawLayer;
|
|
19562
|
+
this._structTree = structTreeLayer;
|
|
19166
19563
|
this.#uiManager.addLayer(this);
|
|
19167
19564
|
}
|
|
19168
19565
|
get isEmpty() {
|
|
@@ -19244,7 +19641,7 @@ class AnnotationEditorLayer {
|
|
|
19244
19641
|
toggleAnnotationLayerPointerEvents(enabled = false) {
|
|
19245
19642
|
this.#annotationLayer?.div.classList.toggle("disabled", !enabled);
|
|
19246
19643
|
}
|
|
19247
|
-
enable() {
|
|
19644
|
+
async enable() {
|
|
19248
19645
|
this.div.tabIndex = 0;
|
|
19249
19646
|
this.togglePointerEvents(true);
|
|
19250
19647
|
const annotationElementIds = new Set();
|
|
@@ -19268,7 +19665,7 @@ class AnnotationEditorLayer {
|
|
|
19268
19665
|
if (annotationElementIds.has(editable.data.id)) {
|
|
19269
19666
|
continue;
|
|
19270
19667
|
}
|
|
19271
|
-
const editor = this.deserialize(editable);
|
|
19668
|
+
const editor = await this.deserialize(editable);
|
|
19272
19669
|
if (!editor) {
|
|
19273
19670
|
continue;
|
|
19274
19671
|
}
|
|
@@ -19315,8 +19712,9 @@ class AnnotationEditorLayer {
|
|
|
19315
19712
|
editor = changedAnnotations.get(id);
|
|
19316
19713
|
if (editor) {
|
|
19317
19714
|
this.#uiManager.addChangedExistingAnnotation(editor);
|
|
19318
|
-
editor.renderAnnotationElement(editable)
|
|
19319
|
-
|
|
19715
|
+
if (editor.renderAnnotationElement(editable)) {
|
|
19716
|
+
editor.show(false);
|
|
19717
|
+
}
|
|
19320
19718
|
}
|
|
19321
19719
|
editable.show();
|
|
19322
19720
|
}
|
|
@@ -19369,7 +19767,7 @@ class AnnotationEditorLayer {
|
|
|
19369
19767
|
const {
|
|
19370
19768
|
target
|
|
19371
19769
|
} = event;
|
|
19372
|
-
if (target === this.#textLayer.div || target.classList.contains("endOfContent") && this.#textLayer.div.contains(target)) {
|
|
19770
|
+
if (target === this.#textLayer.div || (target.getAttribute("role") === "img" || target.classList.contains("endOfContent")) && this.#textLayer.div.contains(target)) {
|
|
19373
19771
|
const {
|
|
19374
19772
|
isMac
|
|
19375
19773
|
} = util_FeatureTest.platform;
|
|
@@ -19379,7 +19777,11 @@ class AnnotationEditorLayer {
|
|
|
19379
19777
|
this.#uiManager.showAllEditors("highlight", true, true);
|
|
19380
19778
|
this.#textLayer.div.classList.add("free");
|
|
19381
19779
|
this.toggleDrawing();
|
|
19382
|
-
HighlightEditor.startHighlighting(this, this.#uiManager.direction === "ltr",
|
|
19780
|
+
HighlightEditor.startHighlighting(this, this.#uiManager.direction === "ltr", {
|
|
19781
|
+
target: this.#textLayer.div,
|
|
19782
|
+
x: event.x,
|
|
19783
|
+
y: event.y
|
|
19784
|
+
});
|
|
19383
19785
|
this.#textLayer.div.addEventListener("pointerup", () => {
|
|
19384
19786
|
this.#textLayer.div.classList.remove("free");
|
|
19385
19787
|
this.toggleDrawing(true);
|
|
@@ -19549,8 +19951,8 @@ class AnnotationEditorLayer {
|
|
|
19549
19951
|
this.add(editor);
|
|
19550
19952
|
}
|
|
19551
19953
|
}
|
|
19552
|
-
deserialize(data) {
|
|
19553
|
-
return AnnotationEditorLayer.#editorTypes.get(data.annotationType ?? data.annotationEditorType)?.deserialize(data, this, this.#uiManager) || null;
|
|
19954
|
+
async deserialize(data) {
|
|
19955
|
+
return (await AnnotationEditorLayer.#editorTypes.get(data.annotationType ?? data.annotationEditorType)?.deserialize(data, this, this.#uiManager)) || null;
|
|
19554
19956
|
}
|
|
19555
19957
|
createAndAddNewEditor(event, isCentered, data = {}) {
|
|
19556
19958
|
const id = this.getNextId();
|
|
@@ -19724,7 +20126,7 @@ class AnnotationEditorLayer {
|
|
|
19724
20126
|
}
|
|
19725
20127
|
}
|
|
19726
20128
|
|
|
19727
|
-
;//
|
|
20129
|
+
;// ./src/display/draw_layer.js
|
|
19728
20130
|
|
|
19729
20131
|
|
|
19730
20132
|
class DrawLayer {
|
|
@@ -19903,6 +20305,9 @@ class DrawLayer {
|
|
|
19903
20305
|
removeClass(id, className) {
|
|
19904
20306
|
this.#mapping.get(id).classList.remove(className);
|
|
19905
20307
|
}
|
|
20308
|
+
getSVGRoot(id) {
|
|
20309
|
+
return this.#mapping.get(id);
|
|
20310
|
+
}
|
|
19906
20311
|
remove(id) {
|
|
19907
20312
|
if (this.#parent === null) {
|
|
19908
20313
|
return;
|
|
@@ -19919,7 +20324,7 @@ class DrawLayer {
|
|
|
19919
20324
|
}
|
|
19920
20325
|
}
|
|
19921
20326
|
|
|
19922
|
-
;//
|
|
20327
|
+
;// ./src/pdf.js
|
|
19923
20328
|
|
|
19924
20329
|
|
|
19925
20330
|
|
|
@@ -19932,8 +20337,8 @@ class DrawLayer {
|
|
|
19932
20337
|
|
|
19933
20338
|
|
|
19934
20339
|
|
|
19935
|
-
const pdfjsVersion = "4.
|
|
19936
|
-
const pdfjsBuild = "
|
|
20340
|
+
const pdfjsVersion = "4.7.76";
|
|
20341
|
+
const pdfjsBuild = "8b73b828b";
|
|
19937
20342
|
|
|
19938
20343
|
var __webpack_exports__AbortException = __webpack_exports__.AbortException;
|
|
19939
20344
|
var __webpack_exports__AnnotationEditorLayer = __webpack_exports__.AnnotationEditorLayer;
|
|
@@ -19952,6 +20357,7 @@ var __webpack_exports__ImageKind = __webpack_exports__.ImageKind;
|
|
|
19952
20357
|
var __webpack_exports__InvalidPDFException = __webpack_exports__.InvalidPDFException;
|
|
19953
20358
|
var __webpack_exports__MissingPDFException = __webpack_exports__.MissingPDFException;
|
|
19954
20359
|
var __webpack_exports__OPS = __webpack_exports__.OPS;
|
|
20360
|
+
var __webpack_exports__OutputScale = __webpack_exports__.OutputScale;
|
|
19955
20361
|
var __webpack_exports__PDFDataRangeTransport = __webpack_exports__.PDFDataRangeTransport;
|
|
19956
20362
|
var __webpack_exports__PDFDateString = __webpack_exports__.PDFDateString;
|
|
19957
20363
|
var __webpack_exports__PDFWorker = __webpack_exports__.PDFWorker;
|
|
@@ -19978,6 +20384,6 @@ var __webpack_exports__normalizeUnicode = __webpack_exports__.normalizeUnicode;
|
|
|
19978
20384
|
var __webpack_exports__setLayerDimensions = __webpack_exports__.setLayerDimensions;
|
|
19979
20385
|
var __webpack_exports__shadow = __webpack_exports__.shadow;
|
|
19980
20386
|
var __webpack_exports__version = __webpack_exports__.version;
|
|
19981
|
-
export { __webpack_exports__AbortException as AbortException, __webpack_exports__AnnotationEditorLayer as AnnotationEditorLayer, __webpack_exports__AnnotationEditorParamsType as AnnotationEditorParamsType, __webpack_exports__AnnotationEditorType as AnnotationEditorType, __webpack_exports__AnnotationEditorUIManager as AnnotationEditorUIManager, __webpack_exports__AnnotationLayer as AnnotationLayer, __webpack_exports__AnnotationMode as AnnotationMode, __webpack_exports__CMapCompressionType as CMapCompressionType, __webpack_exports__ColorPicker as ColorPicker, __webpack_exports__DOMSVGFactory as DOMSVGFactory, __webpack_exports__DrawLayer as DrawLayer, __webpack_exports__FeatureTest as FeatureTest, __webpack_exports__GlobalWorkerOptions as GlobalWorkerOptions, __webpack_exports__ImageKind as ImageKind, __webpack_exports__InvalidPDFException as InvalidPDFException, __webpack_exports__MissingPDFException as MissingPDFException, __webpack_exports__OPS as OPS, __webpack_exports__PDFDataRangeTransport as PDFDataRangeTransport, __webpack_exports__PDFDateString as PDFDateString, __webpack_exports__PDFWorker as PDFWorker, __webpack_exports__PasswordResponses as PasswordResponses, __webpack_exports__PermissionFlag as PermissionFlag, __webpack_exports__PixelsPerInch as PixelsPerInch, __webpack_exports__RenderingCancelledException as RenderingCancelledException, __webpack_exports__TextLayer as TextLayer, __webpack_exports__UnexpectedResponseException as UnexpectedResponseException, __webpack_exports__Util as Util, __webpack_exports__VerbosityLevel as VerbosityLevel, __webpack_exports__XfaLayer as XfaLayer, __webpack_exports__build as build, __webpack_exports__createValidAbsoluteUrl as createValidAbsoluteUrl, __webpack_exports__fetchData as fetchData, __webpack_exports__getDocument as getDocument, __webpack_exports__getFilenameFromUrl as getFilenameFromUrl, __webpack_exports__getPdfFilenameFromUrl as getPdfFilenameFromUrl, __webpack_exports__getXfaPageViewport as getXfaPageViewport, __webpack_exports__isDataScheme as isDataScheme, __webpack_exports__isPdfFile as isPdfFile, __webpack_exports__noContextMenu as noContextMenu, __webpack_exports__normalizeUnicode as normalizeUnicode, __webpack_exports__setLayerDimensions as setLayerDimensions, __webpack_exports__shadow as shadow, __webpack_exports__version as version };
|
|
20387
|
+
export { __webpack_exports__AbortException as AbortException, __webpack_exports__AnnotationEditorLayer as AnnotationEditorLayer, __webpack_exports__AnnotationEditorParamsType as AnnotationEditorParamsType, __webpack_exports__AnnotationEditorType as AnnotationEditorType, __webpack_exports__AnnotationEditorUIManager as AnnotationEditorUIManager, __webpack_exports__AnnotationLayer as AnnotationLayer, __webpack_exports__AnnotationMode as AnnotationMode, __webpack_exports__CMapCompressionType as CMapCompressionType, __webpack_exports__ColorPicker as ColorPicker, __webpack_exports__DOMSVGFactory as DOMSVGFactory, __webpack_exports__DrawLayer as DrawLayer, __webpack_exports__FeatureTest as FeatureTest, __webpack_exports__GlobalWorkerOptions as GlobalWorkerOptions, __webpack_exports__ImageKind as ImageKind, __webpack_exports__InvalidPDFException as InvalidPDFException, __webpack_exports__MissingPDFException as MissingPDFException, __webpack_exports__OPS as OPS, __webpack_exports__OutputScale as OutputScale, __webpack_exports__PDFDataRangeTransport as PDFDataRangeTransport, __webpack_exports__PDFDateString as PDFDateString, __webpack_exports__PDFWorker as PDFWorker, __webpack_exports__PasswordResponses as PasswordResponses, __webpack_exports__PermissionFlag as PermissionFlag, __webpack_exports__PixelsPerInch as PixelsPerInch, __webpack_exports__RenderingCancelledException as RenderingCancelledException, __webpack_exports__TextLayer as TextLayer, __webpack_exports__UnexpectedResponseException as UnexpectedResponseException, __webpack_exports__Util as Util, __webpack_exports__VerbosityLevel as VerbosityLevel, __webpack_exports__XfaLayer as XfaLayer, __webpack_exports__build as build, __webpack_exports__createValidAbsoluteUrl as createValidAbsoluteUrl, __webpack_exports__fetchData as fetchData, __webpack_exports__getDocument as getDocument, __webpack_exports__getFilenameFromUrl as getFilenameFromUrl, __webpack_exports__getPdfFilenameFromUrl as getPdfFilenameFromUrl, __webpack_exports__getXfaPageViewport as getXfaPageViewport, __webpack_exports__isDataScheme as isDataScheme, __webpack_exports__isPdfFile as isPdfFile, __webpack_exports__noContextMenu as noContextMenu, __webpack_exports__normalizeUnicode as normalizeUnicode, __webpack_exports__setLayerDimensions as setLayerDimensions, __webpack_exports__shadow as shadow, __webpack_exports__version as version };
|
|
19982
20388
|
|
|
19983
20389
|
//# sourceMappingURL=pdf.mjs.map
|