@4tw/vue-cli-plugin-pdfjs-viewer 1.6.0 → 1.7.0
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/CHANGELOG.md +4 -0
- package/assets/build/pdf.mjs +206 -122
- package/assets/build/pdf.mjs.map +1 -1
- package/assets/build/pdf.sandbox.mjs +4 -4
- package/assets/build/pdf.worker.mjs +187 -52
- package/assets/build/pdf.worker.mjs.map +1 -1
- package/assets/web/locale/zh-TW/viewer.ftl +17 -25
- package/assets/web/viewer.css +8 -0
- package/assets/web/viewer.html +1 -1
- package/assets/web/viewer.mjs +267 -179
- package/assets/web/viewer.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @licstart The following is the entire license notice for the
|
|
3
3
|
* JavaScript code in this page
|
|
4
4
|
*
|
|
5
|
-
* Copyright
|
|
5
|
+
* Copyright 2024 Mozilla Foundation
|
|
6
6
|
*
|
|
7
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
8
|
* you may not use this file except in compliance with the License.
|
|
@@ -65,6 +65,7 @@ const RenderingIntentFlag = {
|
|
|
65
65
|
ANNOTATIONS_FORMS: 0x10,
|
|
66
66
|
ANNOTATIONS_STORAGE: 0x20,
|
|
67
67
|
ANNOTATIONS_DISABLE: 0x40,
|
|
68
|
+
IS_EDITING: 0x80,
|
|
68
69
|
OPLIST: 0x100
|
|
69
70
|
};
|
|
70
71
|
const AnnotationMode = {
|
|
@@ -320,7 +321,9 @@ const OPS = {
|
|
|
320
321
|
paintImageXObjectRepeat: 88,
|
|
321
322
|
paintImageMaskXObjectRepeat: 89,
|
|
322
323
|
paintSolidColorImageMask: 90,
|
|
323
|
-
constructPath: 91
|
|
324
|
+
constructPath: 91,
|
|
325
|
+
setStrokeTransparent: 92,
|
|
326
|
+
setFillTransparent: 93
|
|
324
327
|
};
|
|
325
328
|
const PasswordResponses = {
|
|
326
329
|
NEED_PASSWORD: 1,
|
|
@@ -953,6 +956,9 @@ class Dict {
|
|
|
953
956
|
}
|
|
954
957
|
return dict;
|
|
955
958
|
}
|
|
959
|
+
delete(key) {
|
|
960
|
+
delete this._map[key];
|
|
961
|
+
}
|
|
956
962
|
}
|
|
957
963
|
class Ref {
|
|
958
964
|
constructor(num, gen) {
|
|
@@ -1524,6 +1530,9 @@ function getNewAnnotationsMap(annotationStorage) {
|
|
|
1524
1530
|
}
|
|
1525
1531
|
return newAnnotationsByPage.size > 0 ? newAnnotationsByPage : null;
|
|
1526
1532
|
}
|
|
1533
|
+
function stringToAsciiOrUTF16BE(str) {
|
|
1534
|
+
return isAscii(str) ? str : stringToUTF16String(str, true);
|
|
1535
|
+
}
|
|
1527
1536
|
function isAscii(str) {
|
|
1528
1537
|
return /^[\x00-\x7F]*$/.test(str);
|
|
1529
1538
|
}
|
|
@@ -2271,7 +2280,8 @@ class ColorSpace {
|
|
|
2271
2280
|
}
|
|
2272
2281
|
}
|
|
2273
2282
|
}
|
|
2274
|
-
|
|
2283
|
+
warn(`Unrecognized ColorSpace: ${cs.name}`);
|
|
2284
|
+
return this.singletons.gray;
|
|
2275
2285
|
}
|
|
2276
2286
|
}
|
|
2277
2287
|
if (Array.isArray(cs)) {
|
|
@@ -2346,10 +2356,12 @@ class ColorSpace {
|
|
|
2346
2356
|
const range = params.getArray("Range");
|
|
2347
2357
|
return new LabCS(whitePoint, blackPoint, range);
|
|
2348
2358
|
default:
|
|
2349
|
-
|
|
2359
|
+
warn(`Unimplemented ColorSpace object: ${mode}`);
|
|
2360
|
+
return this.singletons.gray;
|
|
2350
2361
|
}
|
|
2351
2362
|
}
|
|
2352
|
-
|
|
2363
|
+
warn(`Unrecognized ColorSpace object: ${cs}`);
|
|
2364
|
+
return this.singletons.gray;
|
|
2353
2365
|
}
|
|
2354
2366
|
static isDefaultDecode(decode, numComps) {
|
|
2355
2367
|
if (!Array.isArray(decode)) {
|
|
@@ -16267,6 +16279,7 @@ function clearUnicodeCaches() {
|
|
|
16267
16279
|
|
|
16268
16280
|
|
|
16269
16281
|
|
|
16282
|
+
|
|
16270
16283
|
const SEAC_ANALYSIS_ENABLED = true;
|
|
16271
16284
|
const FontFlags = {
|
|
16272
16285
|
FixedPitch: 1,
|
|
@@ -16345,6 +16358,41 @@ function type1FontGlyphMapping(properties, builtInEncoding, glyphNames) {
|
|
|
16345
16358
|
function normalizeFontName(name) {
|
|
16346
16359
|
return name.replaceAll(/[,_]/g, "-").replaceAll(/\s/g, "");
|
|
16347
16360
|
}
|
|
16361
|
+
const getVerticalPresentationForm = getLookupTableFactory(t => {
|
|
16362
|
+
t[0x2013] = 0xfe32;
|
|
16363
|
+
t[0x2014] = 0xfe31;
|
|
16364
|
+
t[0x2025] = 0xfe30;
|
|
16365
|
+
t[0x2026] = 0xfe19;
|
|
16366
|
+
t[0x3001] = 0xfe11;
|
|
16367
|
+
t[0x3002] = 0xfe12;
|
|
16368
|
+
t[0x3008] = 0xfe3f;
|
|
16369
|
+
t[0x3009] = 0xfe40;
|
|
16370
|
+
t[0x300a] = 0xfe3d;
|
|
16371
|
+
t[0x300b] = 0xfe3e;
|
|
16372
|
+
t[0x300c] = 0xfe41;
|
|
16373
|
+
t[0x300d] = 0xfe42;
|
|
16374
|
+
t[0x300e] = 0xfe43;
|
|
16375
|
+
t[0x300f] = 0xfe44;
|
|
16376
|
+
t[0x3010] = 0xfe3b;
|
|
16377
|
+
t[0x3011] = 0xfe3c;
|
|
16378
|
+
t[0x3014] = 0xfe39;
|
|
16379
|
+
t[0x3015] = 0xfe3a;
|
|
16380
|
+
t[0x3016] = 0xfe17;
|
|
16381
|
+
t[0x3017] = 0xfe18;
|
|
16382
|
+
t[0xfe4f] = 0xfe34;
|
|
16383
|
+
t[0xff01] = 0xfe15;
|
|
16384
|
+
t[0xff08] = 0xfe35;
|
|
16385
|
+
t[0xff09] = 0xfe36;
|
|
16386
|
+
t[0xff0c] = 0xfe10;
|
|
16387
|
+
t[0xff1a] = 0xfe13;
|
|
16388
|
+
t[0xff1b] = 0xfe14;
|
|
16389
|
+
t[0xff1f] = 0xfe16;
|
|
16390
|
+
t[0xff3b] = 0xfe47;
|
|
16391
|
+
t[0xff3d] = 0xfe48;
|
|
16392
|
+
t[0xff3f] = 0xfe33;
|
|
16393
|
+
t[0xff5b] = 0xfe37;
|
|
16394
|
+
t[0xff5d] = 0xfe38;
|
|
16395
|
+
});
|
|
16348
16396
|
|
|
16349
16397
|
;// CONCATENATED MODULE: ./src/core/standard_fonts.js
|
|
16350
16398
|
|
|
@@ -24902,6 +24950,36 @@ class Font {
|
|
|
24902
24950
|
builder.addTable("post", createPostTable(properties));
|
|
24903
24951
|
return builder.toArray();
|
|
24904
24952
|
}
|
|
24953
|
+
get _spaceWidth() {
|
|
24954
|
+
const possibleSpaceReplacements = ["space", "minus", "one", "i", "I"];
|
|
24955
|
+
let width;
|
|
24956
|
+
for (const glyphName of possibleSpaceReplacements) {
|
|
24957
|
+
if (glyphName in this.widths) {
|
|
24958
|
+
width = this.widths[glyphName];
|
|
24959
|
+
break;
|
|
24960
|
+
}
|
|
24961
|
+
const glyphsUnicodeMap = getGlyphsUnicode();
|
|
24962
|
+
const glyphUnicode = glyphsUnicodeMap[glyphName];
|
|
24963
|
+
let charcode = 0;
|
|
24964
|
+
if (this.composite && this.cMap.contains(glyphUnicode)) {
|
|
24965
|
+
charcode = this.cMap.lookup(glyphUnicode);
|
|
24966
|
+
if (typeof charcode === "string") {
|
|
24967
|
+
charcode = convertCidString(glyphUnicode, charcode);
|
|
24968
|
+
}
|
|
24969
|
+
}
|
|
24970
|
+
if (!charcode && this.toUnicode) {
|
|
24971
|
+
charcode = this.toUnicode.charCodeOf(glyphUnicode);
|
|
24972
|
+
}
|
|
24973
|
+
if (charcode <= 0) {
|
|
24974
|
+
charcode = glyphUnicode;
|
|
24975
|
+
}
|
|
24976
|
+
width = this.widths[charcode];
|
|
24977
|
+
if (width) {
|
|
24978
|
+
break;
|
|
24979
|
+
}
|
|
24980
|
+
}
|
|
24981
|
+
return shadow(this, "_spaceWidth", width || this.defaultWidth);
|
|
24982
|
+
}
|
|
24905
24983
|
_charToGlyph(charcode, isSpace = false) {
|
|
24906
24984
|
let glyph = this._glyphCache[charcode];
|
|
24907
24985
|
if (glyph?.isSpace === isSpace) {
|
|
@@ -24930,6 +25008,10 @@ class Font {
|
|
|
24930
25008
|
const glyphName = this.differences[charcode] || this.defaultEncoding[charcode];
|
|
24931
25009
|
if ((glyphName === ".notdef" || glyphName === "") && this.type === "Type1") {
|
|
24932
25010
|
fontCharCode = 0x20;
|
|
25011
|
+
if (glyphName === "") {
|
|
25012
|
+
width ||= this._spaceWidth;
|
|
25013
|
+
unicode = String.fromCharCode(fontCharCode);
|
|
25014
|
+
}
|
|
24933
25015
|
}
|
|
24934
25016
|
fontCharCode = mapSpecialUnicodeValues(fontCharCode);
|
|
24935
25017
|
}
|
|
@@ -24954,6 +25036,12 @@ class Font {
|
|
|
24954
25036
|
warn(`charToGlyph - invalid fontCharCode: ${fontCharCode}`);
|
|
24955
25037
|
}
|
|
24956
25038
|
}
|
|
25039
|
+
if (this.missingFile && this.vertical && fontChar.length === 1) {
|
|
25040
|
+
const vertical = getVerticalPresentationForm()[fontChar.charCodeAt(0)];
|
|
25041
|
+
if (vertical) {
|
|
25042
|
+
fontChar = unicode = String.fromCharCode(vertical);
|
|
25043
|
+
}
|
|
25044
|
+
}
|
|
24957
25045
|
glyph = new fonts_Glyph(charcode, fontChar, unicode, accent, width, vmetric, operatorListId, isSpace, isInFont);
|
|
24958
25046
|
return this._glyphCache[charcode] = glyph;
|
|
24959
25047
|
}
|
|
@@ -31153,9 +31241,7 @@ class PartialEvaluator {
|
|
|
31153
31241
|
resources,
|
|
31154
31242
|
localColorSpaceCache
|
|
31155
31243
|
}).then(function (colorSpace) {
|
|
31156
|
-
|
|
31157
|
-
stateManager.state.fillColorSpace = colorSpace;
|
|
31158
|
-
}
|
|
31244
|
+
stateManager.state.fillColorSpace = colorSpace || ColorSpace.singletons.gray;
|
|
31159
31245
|
}));
|
|
31160
31246
|
return;
|
|
31161
31247
|
}
|
|
@@ -31171,9 +31257,7 @@ class PartialEvaluator {
|
|
|
31171
31257
|
resources,
|
|
31172
31258
|
localColorSpaceCache
|
|
31173
31259
|
}).then(function (colorSpace) {
|
|
31174
|
-
|
|
31175
|
-
stateManager.state.strokeColorSpace = colorSpace;
|
|
31176
|
-
}
|
|
31260
|
+
stateManager.state.strokeColorSpace = colorSpace || ColorSpace.singletons.gray;
|
|
31177
31261
|
}));
|
|
31178
31262
|
return;
|
|
31179
31263
|
}
|
|
@@ -31216,7 +31300,12 @@ class PartialEvaluator {
|
|
|
31216
31300
|
args = ColorSpace.singletons.rgb.getRgb(args, 0);
|
|
31217
31301
|
break;
|
|
31218
31302
|
case OPS.setFillColorN:
|
|
31219
|
-
cs = stateManager.state.
|
|
31303
|
+
cs = stateManager.state.patternFillColorSpace;
|
|
31304
|
+
if (!cs) {
|
|
31305
|
+
args = [];
|
|
31306
|
+
fn = OPS.setFillTransparent;
|
|
31307
|
+
break;
|
|
31308
|
+
}
|
|
31220
31309
|
if (cs.name === "Pattern") {
|
|
31221
31310
|
next(self.handleColorN(operatorList, OPS.setFillColorN, args, cs, patterns, resources, task, localColorSpaceCache, localTilingPatternCache, localShadingPatternCache));
|
|
31222
31311
|
return;
|
|
@@ -31225,7 +31314,12 @@ class PartialEvaluator {
|
|
|
31225
31314
|
fn = OPS.setFillRGBColor;
|
|
31226
31315
|
break;
|
|
31227
31316
|
case OPS.setStrokeColorN:
|
|
31228
|
-
cs = stateManager.state.
|
|
31317
|
+
cs = stateManager.state.patternStrokeColorSpace;
|
|
31318
|
+
if (!cs) {
|
|
31319
|
+
args = [];
|
|
31320
|
+
fn = OPS.setStrokeTransparent;
|
|
31321
|
+
break;
|
|
31322
|
+
}
|
|
31229
31323
|
if (cs.name === "Pattern") {
|
|
31230
31324
|
next(self.handleColorN(operatorList, OPS.setStrokeColorN, args, cs, patterns, resources, task, localColorSpaceCache, localTilingPatternCache, localShadingPatternCache));
|
|
31231
31325
|
return;
|
|
@@ -32440,6 +32534,9 @@ class PartialEvaluator {
|
|
|
32440
32534
|
map[charCode] = String.fromCodePoint(token);
|
|
32441
32535
|
return;
|
|
32442
32536
|
}
|
|
32537
|
+
if (token.length % 2 !== 0) {
|
|
32538
|
+
token = "\u0000" + token;
|
|
32539
|
+
}
|
|
32443
32540
|
const str = [];
|
|
32444
32541
|
for (let k = 0; k < token.length; k += 2) {
|
|
32445
32542
|
const w1 = token.charCodeAt(k) << 8 | token.charCodeAt(k + 1);
|
|
@@ -33238,8 +33335,22 @@ class EvalState {
|
|
|
33238
33335
|
this.ctm = new Float32Array(IDENTITY_MATRIX);
|
|
33239
33336
|
this.font = null;
|
|
33240
33337
|
this.textRenderingMode = TextRenderingMode.FILL;
|
|
33241
|
-
this.
|
|
33242
|
-
this.
|
|
33338
|
+
this._fillColorSpace = ColorSpace.singletons.gray;
|
|
33339
|
+
this._strokeColorSpace = ColorSpace.singletons.gray;
|
|
33340
|
+
this.patternFillColorSpace = null;
|
|
33341
|
+
this.patternStrokeColorSpace = null;
|
|
33342
|
+
}
|
|
33343
|
+
get fillColorSpace() {
|
|
33344
|
+
return this._fillColorSpace;
|
|
33345
|
+
}
|
|
33346
|
+
set fillColorSpace(colorSpace) {
|
|
33347
|
+
this._fillColorSpace = this.patternFillColorSpace = colorSpace;
|
|
33348
|
+
}
|
|
33349
|
+
get strokeColorSpace() {
|
|
33350
|
+
return this._strokeColorSpace;
|
|
33351
|
+
}
|
|
33352
|
+
set strokeColorSpace(colorSpace) {
|
|
33353
|
+
this._strokeColorSpace = this.patternStrokeColorSpace = colorSpace;
|
|
33243
33354
|
}
|
|
33244
33355
|
clone() {
|
|
33245
33356
|
return Object.create(this);
|
|
@@ -36550,6 +36661,7 @@ async function incrementalUpdate({
|
|
|
36550
36661
|
|
|
36551
36662
|
|
|
36552
36663
|
|
|
36664
|
+
|
|
36553
36665
|
const MAX_DEPTH = 40;
|
|
36554
36666
|
const StructElementType = {
|
|
36555
36667
|
PAGE_CONTENT: 1,
|
|
@@ -36834,19 +36946,19 @@ class StructTreeRoot {
|
|
|
36834
36946
|
const tagDict = new Dict(xref);
|
|
36835
36947
|
tagDict.set("S", Name.get(type));
|
|
36836
36948
|
if (title) {
|
|
36837
|
-
tagDict.set("T", title);
|
|
36949
|
+
tagDict.set("T", stringToAsciiOrUTF16BE(title));
|
|
36838
36950
|
}
|
|
36839
36951
|
if (lang) {
|
|
36840
36952
|
tagDict.set("Lang", lang);
|
|
36841
36953
|
}
|
|
36842
36954
|
if (alt) {
|
|
36843
|
-
tagDict.set("Alt", alt);
|
|
36955
|
+
tagDict.set("Alt", stringToAsciiOrUTF16BE(alt));
|
|
36844
36956
|
}
|
|
36845
36957
|
if (expanded) {
|
|
36846
|
-
tagDict.set("E", expanded);
|
|
36958
|
+
tagDict.set("E", stringToAsciiOrUTF16BE(expanded));
|
|
36847
36959
|
}
|
|
36848
36960
|
if (actualText) {
|
|
36849
|
-
tagDict.set("ActualText", actualText);
|
|
36961
|
+
tagDict.set("ActualText", stringToAsciiOrUTF16BE(actualText));
|
|
36850
36962
|
}
|
|
36851
36963
|
await this.#updateParentTag({
|
|
36852
36964
|
structTreeParent,
|
|
@@ -37274,26 +37386,27 @@ function isValidExplicitDest(dest) {
|
|
|
37274
37386
|
if (!(zoom instanceof Name)) {
|
|
37275
37387
|
return false;
|
|
37276
37388
|
}
|
|
37389
|
+
const argsLen = args.length;
|
|
37277
37390
|
let allowNull = true;
|
|
37278
37391
|
switch (zoom.name) {
|
|
37279
37392
|
case "XYZ":
|
|
37280
|
-
if (
|
|
37393
|
+
if (argsLen < 2 || argsLen > 3) {
|
|
37281
37394
|
return false;
|
|
37282
37395
|
}
|
|
37283
37396
|
break;
|
|
37284
37397
|
case "Fit":
|
|
37285
37398
|
case "FitB":
|
|
37286
|
-
return
|
|
37399
|
+
return argsLen === 0;
|
|
37287
37400
|
case "FitH":
|
|
37288
37401
|
case "FitBH":
|
|
37289
37402
|
case "FitV":
|
|
37290
37403
|
case "FitBV":
|
|
37291
|
-
if (
|
|
37404
|
+
if (argsLen > 1) {
|
|
37292
37405
|
return false;
|
|
37293
37406
|
}
|
|
37294
37407
|
break;
|
|
37295
37408
|
case "FitR":
|
|
37296
|
-
if (
|
|
37409
|
+
if (argsLen !== 4) {
|
|
37297
37410
|
return false;
|
|
37298
37411
|
}
|
|
37299
37412
|
allowNull = false;
|
|
@@ -49892,7 +50005,8 @@ class Annotation {
|
|
|
49892
50005
|
subtype: params.subtype,
|
|
49893
50006
|
hasOwnCanvas: false,
|
|
49894
50007
|
noRotate: !!(this.flags & AnnotationFlag.NOROTATE),
|
|
49895
|
-
noHTML: isLocked && isContentLocked
|
|
50008
|
+
noHTML: isLocked && isContentLocked,
|
|
50009
|
+
isEditable: false
|
|
49896
50010
|
};
|
|
49897
50011
|
if (params.collectFields) {
|
|
49898
50012
|
const kids = dict.get("Kids");
|
|
@@ -49938,6 +50052,9 @@ class Annotation {
|
|
|
49938
50052
|
}
|
|
49939
50053
|
return this.printable;
|
|
49940
50054
|
}
|
|
50055
|
+
mustBeViewedWhenEditing(isEditing, modifiedIds = null) {
|
|
50056
|
+
return isEditing ? !this.data.isEditable : !modifiedIds?.has(this.data.id);
|
|
50057
|
+
}
|
|
49941
50058
|
get viewable() {
|
|
49942
50059
|
if (this.data.quadPoints === null) {
|
|
49943
50060
|
return false;
|
|
@@ -50119,7 +50236,7 @@ class Annotation {
|
|
|
50119
50236
|
});
|
|
50120
50237
|
});
|
|
50121
50238
|
}
|
|
50122
|
-
async getOperatorList(evaluator, task, intent,
|
|
50239
|
+
async getOperatorList(evaluator, task, intent, annotationStorage) {
|
|
50123
50240
|
const {
|
|
50124
50241
|
hasOwnCanvas,
|
|
50125
50242
|
id,
|
|
@@ -50501,14 +50618,21 @@ class MarkupAnnotation extends Annotation {
|
|
|
50501
50618
|
this._streams.push(this.appearance, appearanceStream);
|
|
50502
50619
|
}
|
|
50503
50620
|
static async createNewAnnotation(xref, annotation, dependencies, params) {
|
|
50504
|
-
|
|
50621
|
+
let oldAnnotation;
|
|
50622
|
+
if (annotation.ref) {
|
|
50623
|
+
oldAnnotation = (await xref.fetchIfRefAsync(annotation.ref)).clone();
|
|
50624
|
+
} else {
|
|
50625
|
+
annotation.ref = xref.getNewTemporaryRef();
|
|
50626
|
+
}
|
|
50627
|
+
const annotationRef = annotation.ref;
|
|
50505
50628
|
const ap = await this.createNewAppearanceStream(annotation, xref, params);
|
|
50506
50629
|
const buffer = [];
|
|
50507
50630
|
let annotationDict;
|
|
50508
50631
|
if (ap) {
|
|
50509
50632
|
const apRef = xref.getNewTemporaryRef();
|
|
50510
50633
|
annotationDict = this.createNewDict(annotation, xref, {
|
|
50511
|
-
apRef
|
|
50634
|
+
apRef,
|
|
50635
|
+
oldAnnotation
|
|
50512
50636
|
});
|
|
50513
50637
|
await writeObject(apRef, ap, buffer, xref);
|
|
50514
50638
|
dependencies.push({
|
|
@@ -50516,7 +50640,9 @@ class MarkupAnnotation extends Annotation {
|
|
|
50516
50640
|
data: buffer.join("")
|
|
50517
50641
|
});
|
|
50518
50642
|
} else {
|
|
50519
|
-
annotationDict = this.createNewDict(annotation, xref, {
|
|
50643
|
+
annotationDict = this.createNewDict(annotation, xref, {
|
|
50644
|
+
oldAnnotation
|
|
50645
|
+
});
|
|
50520
50646
|
}
|
|
50521
50647
|
if (Number.isInteger(annotation.parentTreeId)) {
|
|
50522
50648
|
annotationDict.set("StructParent", annotation.parentTreeId);
|
|
@@ -50674,8 +50800,8 @@ class WidgetAnnotation extends Annotation {
|
|
|
50674
50800
|
}
|
|
50675
50801
|
return str;
|
|
50676
50802
|
}
|
|
50677
|
-
async getOperatorList(evaluator, task, intent,
|
|
50678
|
-
if (
|
|
50803
|
+
async getOperatorList(evaluator, task, intent, annotationStorage) {
|
|
50804
|
+
if (intent & RenderingIntentFlag.ANNOTATIONS_FORMS && !(this instanceof SignatureWidgetAnnotation) && !this.data.noHTML && !this.data.hasOwnCanvas) {
|
|
50679
50805
|
return {
|
|
50680
50806
|
opList: new OperatorList(),
|
|
50681
50807
|
separateForm: true,
|
|
@@ -50683,11 +50809,11 @@ class WidgetAnnotation extends Annotation {
|
|
|
50683
50809
|
};
|
|
50684
50810
|
}
|
|
50685
50811
|
if (!this._hasText) {
|
|
50686
|
-
return super.getOperatorList(evaluator, task, intent,
|
|
50812
|
+
return super.getOperatorList(evaluator, task, intent, annotationStorage);
|
|
50687
50813
|
}
|
|
50688
50814
|
const content = await this._getAppearance(evaluator, task, intent, annotationStorage);
|
|
50689
50815
|
if (this.appearance && content === null) {
|
|
50690
|
-
return super.getOperatorList(evaluator, task, intent,
|
|
50816
|
+
return super.getOperatorList(evaluator, task, intent, annotationStorage);
|
|
50691
50817
|
}
|
|
50692
50818
|
const opList = new OperatorList();
|
|
50693
50819
|
if (!this._defaultAppearance || content === null) {
|
|
@@ -50785,8 +50911,7 @@ class WidgetAnnotation extends Annotation {
|
|
|
50785
50911
|
path: this.data.fieldName,
|
|
50786
50912
|
value
|
|
50787
50913
|
};
|
|
50788
|
-
|
|
50789
|
-
dict.set("V", Array.isArray(value) ? value.map(encoder) : encoder(value));
|
|
50914
|
+
dict.set("V", Array.isArray(value) ? value.map(stringToAsciiOrUTF16BE) : stringToAsciiOrUTF16BE(value));
|
|
50790
50915
|
this.amendSavedDict(annotationStorage, dict);
|
|
50791
50916
|
const maybeMK = this._getMKDict(rotation);
|
|
50792
50917
|
if (maybeMK) {
|
|
@@ -51253,7 +51378,7 @@ class ButtonWidgetAnnotation extends WidgetAnnotation {
|
|
|
51253
51378
|
warn("Invalid field flags for button widget annotation");
|
|
51254
51379
|
}
|
|
51255
51380
|
}
|
|
51256
|
-
async getOperatorList(evaluator, task, intent,
|
|
51381
|
+
async getOperatorList(evaluator, task, intent, annotationStorage) {
|
|
51257
51382
|
if (this.data.pushButton) {
|
|
51258
51383
|
return super.getOperatorList(evaluator, task, intent, false, annotationStorage);
|
|
51259
51384
|
}
|
|
@@ -51265,7 +51390,7 @@ class ButtonWidgetAnnotation extends WidgetAnnotation {
|
|
|
51265
51390
|
rotation = storageEntry ? storageEntry.rotation : null;
|
|
51266
51391
|
}
|
|
51267
51392
|
if (value === null && this.appearance) {
|
|
51268
|
-
return super.getOperatorList(evaluator, task, intent,
|
|
51393
|
+
return super.getOperatorList(evaluator, task, intent, annotationStorage);
|
|
51269
51394
|
}
|
|
51270
51395
|
if (value === null || value === undefined) {
|
|
51271
51396
|
value = this.data.checkBox ? this.data.fieldValue === this.data.exportValue : this.data.fieldValue === this.data.buttonValue;
|
|
@@ -51278,7 +51403,7 @@ class ButtonWidgetAnnotation extends WidgetAnnotation {
|
|
|
51278
51403
|
appearance.dict.set("Matrix", this.getRotationMatrix(annotationStorage));
|
|
51279
51404
|
}
|
|
51280
51405
|
this.appearance = appearance;
|
|
51281
|
-
const operatorList = super.getOperatorList(evaluator, task, intent,
|
|
51406
|
+
const operatorList = super.getOperatorList(evaluator, task, intent, annotationStorage);
|
|
51282
51407
|
this.appearance = savedAppearance;
|
|
51283
51408
|
appearance.dict.set("Matrix", savedMatrix);
|
|
51284
51409
|
return operatorList;
|
|
@@ -51895,7 +52020,8 @@ class PopupAnnotation extends Annotation {
|
|
|
51895
52020
|
class FreeTextAnnotation extends MarkupAnnotation {
|
|
51896
52021
|
constructor(params) {
|
|
51897
52022
|
super(params);
|
|
51898
|
-
this.data.hasOwnCanvas =
|
|
52023
|
+
this.data.hasOwnCanvas = this.data.noRotate;
|
|
52024
|
+
this.data.isEditable = !this.data.noHTML;
|
|
51899
52025
|
this.data.noHTML = false;
|
|
51900
52026
|
const {
|
|
51901
52027
|
evaluatorOptions,
|
|
@@ -51941,7 +52067,8 @@ class FreeTextAnnotation extends MarkupAnnotation {
|
|
|
51941
52067
|
}
|
|
51942
52068
|
static createNewDict(annotation, xref, {
|
|
51943
52069
|
apRef,
|
|
51944
|
-
ap
|
|
52070
|
+
ap,
|
|
52071
|
+
oldAnnotation
|
|
51945
52072
|
}) {
|
|
51946
52073
|
const {
|
|
51947
52074
|
color,
|
|
@@ -51951,19 +52078,24 @@ class FreeTextAnnotation extends MarkupAnnotation {
|
|
|
51951
52078
|
user,
|
|
51952
52079
|
value
|
|
51953
52080
|
} = annotation;
|
|
51954
|
-
const freetext = new Dict(xref);
|
|
52081
|
+
const freetext = oldAnnotation || new Dict(xref);
|
|
51955
52082
|
freetext.set("Type", Name.get("Annot"));
|
|
51956
52083
|
freetext.set("Subtype", Name.get("FreeText"));
|
|
51957
|
-
|
|
52084
|
+
if (oldAnnotation) {
|
|
52085
|
+
freetext.set("M", `D:${getModificationDate()}`);
|
|
52086
|
+
freetext.delete("RC");
|
|
52087
|
+
} else {
|
|
52088
|
+
freetext.set("CreationDate", `D:${getModificationDate()}`);
|
|
52089
|
+
}
|
|
51958
52090
|
freetext.set("Rect", rect);
|
|
51959
52091
|
const da = `/Helv ${fontSize} Tf ${getPdfColor(color, true)}`;
|
|
51960
52092
|
freetext.set("DA", da);
|
|
51961
|
-
freetext.set("Contents",
|
|
52093
|
+
freetext.set("Contents", stringToAsciiOrUTF16BE(value));
|
|
51962
52094
|
freetext.set("F", 4);
|
|
51963
52095
|
freetext.set("Border", [0, 0, 0]);
|
|
51964
52096
|
freetext.set("Rotate", rotation);
|
|
51965
52097
|
if (user) {
|
|
51966
|
-
freetext.set("T",
|
|
52098
|
+
freetext.set("T", stringToAsciiOrUTF16BE(user));
|
|
51967
52099
|
}
|
|
51968
52100
|
if (apRef || ap) {
|
|
51969
52101
|
const n = new Dict(xref);
|
|
@@ -52534,7 +52666,7 @@ class HighlightAnnotation extends MarkupAnnotation {
|
|
|
52534
52666
|
highlight.set("C", Array.from(color, c => c / 255));
|
|
52535
52667
|
highlight.set("CA", opacity);
|
|
52536
52668
|
if (user) {
|
|
52537
|
-
highlight.set("T",
|
|
52669
|
+
highlight.set("T", stringToAsciiOrUTF16BE(user));
|
|
52538
52670
|
}
|
|
52539
52671
|
if (apRef || ap) {
|
|
52540
52672
|
const n = new Dict(xref);
|
|
@@ -52770,7 +52902,7 @@ class StampAnnotation extends MarkupAnnotation {
|
|
|
52770
52902
|
stamp.set("Border", [0, 0, 0]);
|
|
52771
52903
|
stamp.set("Rotate", rotation);
|
|
52772
52904
|
if (user) {
|
|
52773
|
-
stamp.set("T",
|
|
52905
|
+
stamp.set("T", stringToAsciiOrUTF16BE(user));
|
|
52774
52906
|
}
|
|
52775
52907
|
if (apRef || ap) {
|
|
52776
52908
|
const n = new Dict(xref);
|
|
@@ -53887,7 +54019,8 @@ class Page {
|
|
|
53887
54019
|
task,
|
|
53888
54020
|
intent,
|
|
53889
54021
|
cacheKey,
|
|
53890
|
-
annotationStorage = null
|
|
54022
|
+
annotationStorage = null,
|
|
54023
|
+
modifiedIds = null
|
|
53891
54024
|
}) {
|
|
53892
54025
|
const contentStreamPromise = this.getContentStream();
|
|
53893
54026
|
const resourcesPromise = this.loadResources(["ColorSpace", "ExtGState", "Font", "Pattern", "Properties", "Shading", "XObject"]);
|
|
@@ -53984,13 +54117,14 @@ class Page {
|
|
|
53984
54117
|
};
|
|
53985
54118
|
}
|
|
53986
54119
|
const renderForms = !!(intent & RenderingIntentFlag.ANNOTATIONS_FORMS),
|
|
54120
|
+
isEditing = !!(intent & RenderingIntentFlag.IS_EDITING),
|
|
53987
54121
|
intentAny = !!(intent & RenderingIntentFlag.ANY),
|
|
53988
54122
|
intentDisplay = !!(intent & RenderingIntentFlag.DISPLAY),
|
|
53989
54123
|
intentPrint = !!(intent & RenderingIntentFlag.PRINT);
|
|
53990
54124
|
const opListPromises = [];
|
|
53991
54125
|
for (const annotation of annotations) {
|
|
53992
|
-
if (intentAny || intentDisplay && annotation.mustBeViewed(annotationStorage, renderForms) || intentPrint && annotation.mustBePrinted(annotationStorage)) {
|
|
53993
|
-
opListPromises.push(annotation.getOperatorList(partialEvaluator, task, intent,
|
|
54126
|
+
if (intentAny || intentDisplay && annotation.mustBeViewed(annotationStorage, renderForms) && annotation.mustBeViewedWhenEditing(isEditing, modifiedIds) || intentPrint && annotation.mustBePrinted(annotationStorage)) {
|
|
54127
|
+
opListPromises.push(annotation.getOperatorList(partialEvaluator, task, intent, annotationStorage).catch(function (reason) {
|
|
53994
54128
|
warn("getOperatorList - ignoring annotation data during " + `"${task.name}" task: "${reason}".`);
|
|
53995
54129
|
return {
|
|
53996
54130
|
opList: null,
|
|
@@ -55710,7 +55844,7 @@ class WorkerMessageHandler {
|
|
|
55710
55844
|
docId,
|
|
55711
55845
|
apiVersion
|
|
55712
55846
|
} = docParams;
|
|
55713
|
-
const workerVersion = "4.
|
|
55847
|
+
const workerVersion = "4.5.136";
|
|
55714
55848
|
if (apiVersion !== workerVersion) {
|
|
55715
55849
|
throw new Error(`The API version "${apiVersion}" does not match ` + `the Worker version "${workerVersion}".`);
|
|
55716
55850
|
}
|
|
@@ -56178,7 +56312,8 @@ class WorkerMessageHandler {
|
|
|
56178
56312
|
task,
|
|
56179
56313
|
intent: data.intent,
|
|
56180
56314
|
cacheKey: data.cacheKey,
|
|
56181
|
-
annotationStorage: data.annotationStorage
|
|
56315
|
+
annotationStorage: data.annotationStorage,
|
|
56316
|
+
modifiedIds: data.modifiedIds
|
|
56182
56317
|
}).then(function (operatorListInfo) {
|
|
56183
56318
|
finishWorkerTask(task);
|
|
56184
56319
|
if (start) {
|
|
@@ -56280,8 +56415,8 @@ if (typeof window === "undefined" && !isNodeJS && typeof self !== "undefined" &&
|
|
|
56280
56415
|
|
|
56281
56416
|
;// CONCATENATED MODULE: ./src/pdf.worker.js
|
|
56282
56417
|
|
|
56283
|
-
const pdfjsVersion = "4.
|
|
56284
|
-
const pdfjsBuild = "
|
|
56418
|
+
const pdfjsVersion = "4.5.136";
|
|
56419
|
+
const pdfjsBuild = "3a21f03b0";
|
|
56285
56420
|
|
|
56286
56421
|
var __webpack_exports__WorkerMessageHandler = __webpack_exports__.WorkerMessageHandler;
|
|
56287
56422
|
export { __webpack_exports__WorkerMessageHandler as WorkerMessageHandler };
|