pdfjs-dist 2.4.456 → 2.5.207

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.

Potentially problematic release.


This version of pdfjs-dist might be problematic. Click here for more details.

Files changed (101) hide show
  1. package/bower.json +1 -1
  2. package/build/pdf.js +4447 -4379
  3. package/build/pdf.js.map +1 -1
  4. package/build/pdf.min.js +1 -1
  5. package/build/pdf.worker.js +8549 -8507
  6. package/build/pdf.worker.js.map +1 -1
  7. package/build/pdf.worker.min.js +1 -1
  8. package/es5/build/pdf.js +14755 -14540
  9. package/es5/build/pdf.js.map +1 -1
  10. package/es5/build/pdf.worker.js +9830 -9469
  11. package/es5/build/pdf.worker.js.map +1 -1
  12. package/es5/web/pdf_viewer.css +5 -9
  13. package/es5/web/pdf_viewer.js +157 -172
  14. package/es5/web/pdf_viewer.js.map +1 -1
  15. package/image_decoders/pdf.image_decoders.js +107 -93
  16. package/image_decoders/pdf.image_decoders.js.map +1 -1
  17. package/image_decoders/pdf.image_decoders.min.js +1 -1
  18. package/lib/README.md +2 -2
  19. package/lib/core/ccitt.js +7 -7
  20. package/lib/core/cff_parser.js +1 -1
  21. package/lib/core/chunked_stream.js +5 -5
  22. package/lib/core/cmap.js +13 -0
  23. package/lib/core/document.js +22 -18
  24. package/lib/core/evaluator.js +285 -247
  25. package/lib/core/font_renderer.js +7 -7
  26. package/lib/core/fonts.js +163 -147
  27. package/lib/core/function.js +4 -5
  28. package/lib/core/glyphlist.js +4523 -4523
  29. package/lib/core/image.js +19 -44
  30. package/lib/core/image_utils.js +123 -47
  31. package/lib/core/jpeg_stream.js +2 -116
  32. package/lib/core/jpg.js +47 -55
  33. package/lib/core/jpx.js +6 -6
  34. package/lib/core/metrics.js +2916 -2916
  35. package/lib/core/obj.js +18 -7
  36. package/lib/core/operator_list.js +5 -0
  37. package/lib/core/parser.js +1 -1
  38. package/lib/core/pdf_manager.js +2 -2
  39. package/lib/core/primitives.js +4 -0
  40. package/lib/core/standard_fonts.js +103 -103
  41. package/lib/core/type1_parser.js +6 -6
  42. package/lib/core/worker.js +31 -24
  43. package/lib/core/worker_stream.js +1 -1
  44. package/lib/display/annotation_layer.js +3 -0
  45. package/lib/display/api.js +29 -137
  46. package/lib/display/api_compatibility.js +11 -18
  47. package/lib/display/canvas.js +7 -34
  48. package/lib/display/content_disposition.js +4 -4
  49. package/lib/display/display_utils.js +6 -15
  50. package/lib/display/fetch_stream.js +3 -1
  51. package/lib/display/font_loader.js +2 -2
  52. package/lib/display/network.js +1 -1
  53. package/lib/display/node_stream.js +10 -8
  54. package/lib/display/pattern_helper.js +1 -1
  55. package/lib/display/svg.js +61 -31
  56. package/lib/display/text_layer.js +44 -32
  57. package/lib/display/transport_stream.js +3 -3
  58. package/lib/pdf.js +210 -48
  59. package/lib/pdf.worker.js +12 -4
  60. package/lib/shared/compatibility.js +2 -0
  61. package/lib/shared/is_node.js +1 -1
  62. package/lib/shared/message_handler.js +6 -6
  63. package/lib/shared/util.js +15 -9
  64. package/lib/test/unit/api_spec.js +165 -95
  65. package/lib/test/unit/cff_parser_spec.js +12 -12
  66. package/lib/test/unit/clitests_helper.js +1 -1
  67. package/lib/test/unit/display_svg_spec.js +1 -5
  68. package/lib/test/unit/jasmine-boot.js +2 -2
  69. package/lib/test/unit/node_stream_spec.js +5 -3
  70. package/lib/test/unit/parser_spec.js +3 -3
  71. package/lib/test/unit/test_utils.js +1 -1
  72. package/lib/test/unit/testreporter.js +4 -4
  73. package/lib/test/unit/ui_utils_spec.js +1 -55
  74. package/lib/test/unit/unicode_spec.js +1 -1
  75. package/lib/web/app.js +247 -159
  76. package/lib/web/app_options.js +16 -10
  77. package/lib/web/base_viewer.js +14 -6
  78. package/lib/web/download_manager.js +3 -1
  79. package/lib/web/firefox_print_service.js +1 -1
  80. package/lib/web/firefoxcom.js +16 -4
  81. package/lib/web/pdf_attachment_viewer.js +14 -7
  82. package/lib/web/pdf_document_properties.js +11 -16
  83. package/lib/web/pdf_find_bar.js +3 -3
  84. package/lib/web/pdf_find_controller.js +3 -3
  85. package/lib/web/pdf_history.js +7 -5
  86. package/lib/web/pdf_link_service.js +7 -8
  87. package/lib/web/pdf_page_view.js +1 -1
  88. package/lib/web/pdf_presentation_mode.js +6 -2
  89. package/lib/web/pdf_print_service.js +1 -1
  90. package/lib/web/pdf_single_page_viewer.js +2 -2
  91. package/lib/web/pdf_viewer.component.js +2 -2
  92. package/lib/web/pdf_viewer.js +2 -2
  93. package/lib/web/preferences.js +4 -1
  94. package/lib/web/text_layer_builder.js +1 -3
  95. package/lib/web/ui_utils.js +3 -55
  96. package/lib/web/view_history.js +8 -9
  97. package/lib/web/viewer_compatibility.js +14 -1
  98. package/package.json +1 -1
  99. package/web/pdf_viewer.css +5 -9
  100. package/web/pdf_viewer.js +97 -127
  101. package/web/pdf_viewer.js.map +1 -1
@@ -58,24 +58,21 @@ var _metrics = require("./metrics.js");
58
58
 
59
59
  var _function = require("./function.js");
60
60
 
61
- var _jpeg_stream = require("./jpeg_stream.js");
61
+ var _image_utils = require("./image_utils.js");
62
62
 
63
63
  var _murmurhash = require("./murmurhash3.js");
64
64
 
65
- var _image_utils = require("./image_utils.js");
66
-
67
65
  var _operator_list = require("./operator_list.js");
68
66
 
69
67
  var _image = require("./image.js");
70
68
 
71
69
  var PartialEvaluator = function PartialEvaluatorClosure() {
72
70
  const DefaultPartialEvaluatorOptions = {
73
- forceDataSchema: false,
74
71
  maxImageSize: -1,
75
72
  disableFontFace: false,
76
- nativeImageDecoderSupport: _util.NativeImageDecoding.DECODE,
77
73
  ignoreErrors: false,
78
- isEvalSupported: true
74
+ isEvalSupported: true,
75
+ fontExtraProperties: false
79
76
  };
80
77
 
81
78
  function PartialEvaluator({
@@ -85,6 +82,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
85
82
  idFactory,
86
83
  fontCache,
87
84
  builtInCMapCache,
85
+ globalImageCache,
88
86
  options = null,
89
87
  pdfFunctionFactory
90
88
  }) {
@@ -94,6 +92,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
94
92
  this.idFactory = idFactory;
95
93
  this.fontCache = fontCache;
96
94
  this.builtInCMapCache = builtInCMapCache;
95
+ this.globalImageCache = globalImageCache;
97
96
  this.options = options || DefaultPartialEvaluatorOptions;
98
97
  this.pdfFunctionFactory = pdfFunctionFactory;
99
98
  this.parsingType3Font = false;
@@ -289,7 +288,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
289
288
  }
290
289
 
291
290
  this.handler.send("UnsupportedFeature", {
292
- featureId: _util.UNSUPPORTED_FEATURES.unknown
291
+ featureId: _util.UNSUPPORTED_FEATURES.errorExtGState
293
292
  });
294
293
  (0, _util.warn)(`hasBlendModes - ignoring ExtGState: "${ex}".`);
295
294
  continue;
@@ -357,7 +356,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
357
356
  }
358
357
 
359
358
  this.handler.send("UnsupportedFeature", {
360
- featureId: _util.UNSUPPORTED_FEATURES.unknown
359
+ featureId: _util.UNSUPPORTED_FEATURES.errorXObject
361
360
  });
362
361
  (0, _util.warn)(`hasBlendModes - ignoring XObject: "${ex}".`);
363
362
  continue;
@@ -460,10 +459,10 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
460
459
  isInline = false,
461
460
  operatorList,
462
461
  cacheKey,
463
- imageCache,
464
- forceDisableNativeImageDecoder = false
462
+ localImageCache
465
463
  }) {
466
464
  var dict = image.dict;
465
+ const imageRef = dict.objId;
467
466
  var w = dict.get("Width", "W");
468
467
  var h = dict.get("Height", "H");
469
468
 
@@ -500,10 +499,10 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
500
499
  operatorList.addOp(_util.OPS.paintImageMaskXObject, args);
501
500
 
502
501
  if (cacheKey) {
503
- imageCache[cacheKey] = {
502
+ localImageCache.set(cacheKey, imageRef, {
504
503
  fn: _util.OPS.paintImageMaskXObject,
505
504
  args
506
- };
505
+ });
507
506
  }
508
507
 
509
508
  return undefined;
@@ -513,7 +512,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
513
512
  var mask = dict.get("Mask") || false;
514
513
  var SMALL_IMAGE_DIMENSIONS = 200;
515
514
 
516
- if (isInline && !softMask && !mask && !(image instanceof _jpeg_stream.JpegStream) && w + h < SMALL_IMAGE_DIMENSIONS) {
515
+ if (isInline && !softMask && !mask && w + h < SMALL_IMAGE_DIMENSIONS) {
517
516
  const imageObj = new _image.PDFImage({
518
517
  xref: this.xref,
519
518
  res: resources,
@@ -526,68 +525,36 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
526
525
  return undefined;
527
526
  }
528
527
 
529
- const nativeImageDecoderSupport = forceDisableNativeImageDecoder ? _util.NativeImageDecoding.NONE : this.options.nativeImageDecoderSupport;
530
- let objId = `img_${this.idFactory.createObjId()}`;
528
+ let objId = `img_${this.idFactory.createObjId()}`,
529
+ cacheGlobally = false;
531
530
 
532
531
  if (this.parsingType3Font) {
533
- (0, _util.assert)(nativeImageDecoderSupport === _util.NativeImageDecoding.NONE, "Type3 image resources should be completely decoded in the worker.");
534
532
  objId = `${this.idFactory.getDocId()}_type3res_${objId}`;
535
- }
536
-
537
- if (nativeImageDecoderSupport !== _util.NativeImageDecoding.NONE && !softMask && !mask && image instanceof _jpeg_stream.JpegStream && _image_utils.NativeImageDecoder.isSupported(image, this.xref, resources, this.pdfFunctionFactory) && image.maybeValidDimensions) {
538
- return this.handler.sendWithPromise("obj", [objId, this.pageIndex, "JpegStream", image.getIR(this.options.forceDataSchema)]).then(function () {
539
- operatorList.addDependency(objId);
540
- args = [objId, w, h];
541
- operatorList.addOp(_util.OPS.paintJpegXObject, args);
542
-
543
- if (cacheKey) {
544
- imageCache[cacheKey] = {
545
- fn: _util.OPS.paintJpegXObject,
546
- args
547
- };
548
- }
549
- }, reason => {
550
- (0, _util.warn)("Native JPEG decoding failed -- trying to recover: " + (reason && reason.message));
551
- return this.buildPaintImageXObject({
552
- resources,
553
- image,
554
- isInline,
555
- operatorList,
556
- cacheKey,
557
- imageCache,
558
- forceDisableNativeImageDecoder: true
559
- });
560
- });
561
- }
562
-
563
- var nativeImageDecoder = null;
533
+ } else if (imageRef) {
534
+ cacheGlobally = this.globalImageCache.shouldCache(imageRef, this.pageIndex);
564
535
 
565
- if (nativeImageDecoderSupport === _util.NativeImageDecoding.DECODE && (image instanceof _jpeg_stream.JpegStream || mask instanceof _jpeg_stream.JpegStream || softMask instanceof _jpeg_stream.JpegStream)) {
566
- nativeImageDecoder = new _image_utils.NativeImageDecoder({
567
- xref: this.xref,
568
- resources,
569
- handler: this.handler,
570
- forceDataSchema: this.options.forceDataSchema,
571
- pdfFunctionFactory: this.pdfFunctionFactory
572
- });
536
+ if (cacheGlobally) {
537
+ objId = `${this.idFactory.getDocId()}_${objId}`;
538
+ }
573
539
  }
574
540
 
575
541
  operatorList.addDependency(objId);
576
542
  args = [objId, w, h];
577
543
 
578
544
  const imgPromise = _image.PDFImage.buildImage({
579
- handler: this.handler,
580
545
  xref: this.xref,
581
546
  res: resources,
582
547
  image,
583
548
  isInline,
584
- nativeDecoder: nativeImageDecoder,
585
549
  pdfFunctionFactory: this.pdfFunctionFactory
586
550
  }).then(imageObj => {
587
- var imgData = imageObj.createImageData(false);
551
+ imgData = imageObj.createImageData(false);
588
552
 
589
553
  if (this.parsingType3Font) {
590
554
  return this.handler.sendWithPromise("commonobj", [objId, "FontType3Res", imgData], [imgData.data.buffer]);
555
+ } else if (cacheGlobally) {
556
+ this.handler.send("commonobj", [objId, "Image", imgData], [imgData.data.buffer]);
557
+ return undefined;
591
558
  }
592
559
 
593
560
  this.handler.send("obj", [objId, this.pageIndex, "Image", imgData], [imgData.data.buffer]);
@@ -597,6 +564,9 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
597
564
 
598
565
  if (this.parsingType3Font) {
599
566
  return this.handler.sendWithPromise("commonobj", [objId, "FontType3Res", null]);
567
+ } else if (cacheGlobally) {
568
+ this.handler.send("commonobj", [objId, "Image", null]);
569
+ return undefined;
600
570
  }
601
571
 
602
572
  this.handler.send("obj", [objId, this.pageIndex, "Image", null]);
@@ -610,10 +580,23 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
610
580
  operatorList.addOp(_util.OPS.paintImageXObject, args);
611
581
 
612
582
  if (cacheKey) {
613
- imageCache[cacheKey] = {
583
+ localImageCache.set(cacheKey, imageRef, {
614
584
  fn: _util.OPS.paintImageXObject,
615
585
  args
616
- };
586
+ });
587
+
588
+ if (imageRef) {
589
+ (0, _util.assert)(!isInline, "Cannot cache an inline image globally.");
590
+ this.globalImageCache.addPageIndex(imageRef, this.pageIndex);
591
+
592
+ if (cacheGlobally) {
593
+ this.globalImageCache.setData(imageRef, {
594
+ objId,
595
+ fn: _util.OPS.paintImageXObject,
596
+ args
597
+ });
598
+ }
599
+ }
617
600
  }
618
601
 
619
602
  return undefined;
@@ -670,7 +653,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
670
653
 
671
654
  if (this.options.ignoreErrors) {
672
655
  this.handler.send("UnsupportedFeature", {
673
- featureId: _util.UNSUPPORTED_FEATURES.unknown
656
+ featureId: _util.UNSUPPORTED_FEATURES.errorTilingPattern
674
657
  });
675
658
  (0, _util.warn)(`handleTilingType - ignoring pattern: "${reason}".`);
676
659
  return;
@@ -697,9 +680,14 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
697
680
  return translated;
698
681
  }).catch(reason => {
699
682
  this.handler.send("UnsupportedFeature", {
700
- featureId: _util.UNSUPPORTED_FEATURES.font
683
+ featureId: _util.UNSUPPORTED_FEATURES.errorFontLoadType3
684
+ });
685
+ return new TranslatedFont({
686
+ loadedName: "g_font_error",
687
+ font: new _fonts.ErrorFont(`Type3 font load error: ${reason}`),
688
+ dict: translated.font,
689
+ extraProperties: this.options.fontExtraProperties
701
690
  });
702
- return new TranslatedFont("g_font_error", new _fonts.ErrorFont("Type3 font load error: " + reason), translated.font);
703
691
  });
704
692
  }).then(translated => {
705
693
  state.font = translated.font;
@@ -732,7 +720,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
732
720
 
733
721
  if (this.options.ignoreErrors) {
734
722
  this.handler.send("UnsupportedFeature", {
735
- featureId: _util.UNSUPPORTED_FEATURES.font
723
+ featureId: _util.UNSUPPORTED_FEATURES.errorFontState
736
724
  });
737
725
  (0, _util.warn)(`ensureStateFont: "${reason}".`);
738
726
  return;
@@ -826,9 +814,14 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
826
814
  });
827
815
  },
828
816
  loadFont: function PartialEvaluator_loadFont(fontName, font, resources) {
829
- function errorFont() {
830
- return Promise.resolve(new TranslatedFont("g_font_error", new _fonts.ErrorFont("Font " + fontName + " is not available"), font));
831
- }
817
+ const errorFont = () => {
818
+ return Promise.resolve(new TranslatedFont({
819
+ loadedName: "g_font_error",
820
+ font: new _fonts.ErrorFont(`Font "${fontName}" is not available.`),
821
+ dict: font,
822
+ extraProperties: this.options.fontExtraProperties
823
+ }));
824
+ };
832
825
 
833
826
  var fontRef,
834
827
  xref = this.xref;
@@ -856,7 +849,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
856
849
  }
857
850
 
858
851
  this.handler.send("UnsupportedFeature", {
859
- featureId: _util.UNSUPPORTED_FEATURES.font
852
+ featureId: _util.UNSUPPORTED_FEATURES.errorFontMissing
860
853
  });
861
854
  (0, _util.warn)(`${partialMsg} -- attempting to fallback to a default font.`);
862
855
  fontRef = PartialEvaluator.getFallbackFontDict();
@@ -937,16 +930,21 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
937
930
  translatedPromise = Promise.reject(e);
938
931
  }
939
932
 
940
- translatedPromise.then(function (translatedFont) {
933
+ translatedPromise.then(translatedFont => {
941
934
  if (translatedFont.fontType !== undefined) {
942
935
  var xrefFontStats = xref.stats.fontTypes;
943
936
  xrefFontStats[translatedFont.fontType] = true;
944
937
  }
945
938
 
946
- fontCapability.resolve(new TranslatedFont(font.loadedName, translatedFont, font));
939
+ fontCapability.resolve(new TranslatedFont({
940
+ loadedName: font.loadedName,
941
+ font: translatedFont,
942
+ dict: font,
943
+ extraProperties: this.options.fontExtraProperties
944
+ }));
947
945
  }).catch(reason => {
948
946
  this.handler.send("UnsupportedFeature", {
949
- featureId: _util.UNSUPPORTED_FEATURES.font
947
+ featureId: _util.UNSUPPORTED_FEATURES.errorFontTranslate
950
948
  });
951
949
 
952
950
  try {
@@ -957,7 +955,12 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
957
955
  xrefFontStats[fontType] = true;
958
956
  } catch (ex) {}
959
957
 
960
- fontCapability.resolve(new TranslatedFont(font.loadedName, new _fonts.ErrorFont(reason instanceof Error ? reason.message : reason), font));
958
+ fontCapability.resolve(new TranslatedFont({
959
+ loadedName: font.loadedName,
960
+ font: new _fonts.ErrorFont(reason instanceof Error ? reason.message : reason),
961
+ dict: font,
962
+ extraProperties: this.options.fontExtraProperties
963
+ }));
961
964
  });
962
965
  return fontCapability.promise;
963
966
  },
@@ -1000,7 +1003,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
1000
1003
 
1001
1004
  if (this.options.ignoreErrors) {
1002
1005
  this.handler.send("UnsupportedFeature", {
1003
- featureId: _util.UNSUPPORTED_FEATURES.unknown
1006
+ featureId: _util.UNSUPPORTED_FEATURES.errorColorSpace
1004
1007
  });
1005
1008
  (0, _util.warn)(`parseColorSpace - ignoring ColorSpace: "${reason}".`);
1006
1009
  return null;
@@ -1052,7 +1055,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
1052
1055
  var self = this;
1053
1056
  var xref = this.xref;
1054
1057
  let parsingText = false;
1055
- var imageCache = Object.create(null);
1058
+ const localImageCache = new _image_utils.LocalImageCache();
1056
1059
 
1057
1060
  var xobjs = resources.get("XObject") || _primitives.Dict.empty;
1058
1061
 
@@ -1101,10 +1104,14 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
1101
1104
  case _util.OPS.paintXObject:
1102
1105
  var name = args[0].name;
1103
1106
 
1104
- if (name && imageCache[name] !== undefined) {
1105
- operatorList.addOp(imageCache[name].fn, imageCache[name].args);
1106
- args = null;
1107
- continue;
1107
+ if (name) {
1108
+ const localImage = localImageCache.getByName(name);
1109
+
1110
+ if (localImage) {
1111
+ operatorList.addOp(localImage.fn, localImage.args);
1112
+ args = null;
1113
+ continue;
1114
+ }
1108
1115
  }
1109
1116
 
1110
1117
  next(new Promise(function (resolveXObject, rejectXObject) {
@@ -1112,7 +1119,28 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
1112
1119
  throw new _util.FormatError("XObject must be referred to by name.");
1113
1120
  }
1114
1121
 
1115
- const xobj = xobjs.get(name);
1122
+ let xobj = xobjs.getRaw(name);
1123
+
1124
+ if (xobj instanceof _primitives.Ref) {
1125
+ const localImage = localImageCache.getByRef(xobj);
1126
+
1127
+ if (localImage) {
1128
+ operatorList.addOp(localImage.fn, localImage.args);
1129
+ resolveXObject();
1130
+ return;
1131
+ }
1132
+
1133
+ const globalImage = self.globalImageCache.getData(xobj, self.pageIndex);
1134
+
1135
+ if (globalImage) {
1136
+ operatorList.addDependency(globalImage.objId);
1137
+ operatorList.addOp(globalImage.fn, globalImage.args);
1138
+ resolveXObject();
1139
+ return;
1140
+ }
1141
+
1142
+ xobj = xref.fetch(xobj);
1143
+ }
1116
1144
 
1117
1145
  if (!xobj) {
1118
1146
  operatorList.addOp(fn, args);
@@ -1143,7 +1171,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
1143
1171
  image: xobj,
1144
1172
  operatorList,
1145
1173
  cacheKey: name,
1146
- imageCache
1174
+ localImageCache
1147
1175
  }).then(resolveXObject, rejectXObject);
1148
1176
  return;
1149
1177
  } else if (type.name === "PS") {
@@ -1160,7 +1188,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
1160
1188
 
1161
1189
  if (self.options.ignoreErrors) {
1162
1190
  self.handler.send("UnsupportedFeature", {
1163
- featureId: _util.UNSUPPORTED_FEATURES.unknown
1191
+ featureId: _util.UNSUPPORTED_FEATURES.errorXObject
1164
1192
  });
1165
1193
  (0, _util.warn)(`getOperatorList - ignoring XObject: "${reason}".`);
1166
1194
  return;
@@ -1190,10 +1218,10 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
1190
1218
  var cacheKey = args[0].cacheKey;
1191
1219
 
1192
1220
  if (cacheKey) {
1193
- var cacheEntry = imageCache[cacheKey];
1221
+ const localImage = localImageCache.getByName(cacheKey);
1194
1222
 
1195
- if (cacheEntry !== undefined) {
1196
- operatorList.addOp(cacheEntry.fn, cacheEntry.args);
1223
+ if (localImage) {
1224
+ operatorList.addOp(localImage.fn, localImage.args);
1197
1225
  args = null;
1198
1226
  continue;
1199
1227
  }
@@ -1205,7 +1233,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
1205
1233
  isInline: true,
1206
1234
  operatorList,
1207
1235
  cacheKey,
1208
- imageCache
1236
+ localImageCache
1209
1237
  }));
1210
1238
  return;
1211
1239
 
@@ -1447,7 +1475,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
1447
1475
 
1448
1476
  if (this.options.ignoreErrors) {
1449
1477
  this.handler.send("UnsupportedFeature", {
1450
- featureId: _util.UNSUPPORTED_FEATURES.unknown
1478
+ featureId: _util.UNSUPPORTED_FEATURES.errorOperatorList
1451
1479
  });
1452
1480
  (0, _util.warn)(`getOperatorList - ignoring errors during "${task.name}" ` + `task: "${reason}".`);
1453
1481
  closePendingRestoreOPS();
@@ -1498,7 +1526,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
1498
1526
  var self = this;
1499
1527
  var xref = this.xref;
1500
1528
  var xobjs = null;
1501
- var skipEmptyXObjs = Object.create(null);
1529
+ const emptyXObjectCache = new _image_utils.LocalImageCache();
1502
1530
  var preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager);
1503
1531
  var textState;
1504
1532
 
@@ -1515,7 +1543,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
1515
1543
  fontFamily: font.fallbackName,
1516
1544
  ascent: font.ascent,
1517
1545
  descent: font.descent,
1518
- vertical: !!font.vertical
1546
+ vertical: font.vertical
1519
1547
  };
1520
1548
  }
1521
1549
 
@@ -1923,7 +1951,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
1923
1951
 
1924
1952
  var name = args[0].name;
1925
1953
 
1926
- if (name && skipEmptyXObjs[name] !== undefined) {
1954
+ if (name && emptyXObjectCache.getByName(name)) {
1927
1955
  break;
1928
1956
  }
1929
1957
 
@@ -1932,7 +1960,16 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
1932
1960
  throw new _util.FormatError("XObject must be referred to by name.");
1933
1961
  }
1934
1962
 
1935
- const xobj = xobjs.get(name);
1963
+ let xobj = xobjs.getRaw(name);
1964
+
1965
+ if (xobj instanceof _primitives.Ref) {
1966
+ if (emptyXObjectCache.getByRef(xobj)) {
1967
+ resolveXObject();
1968
+ return;
1969
+ }
1970
+
1971
+ xobj = xref.fetch(xobj);
1972
+ }
1936
1973
 
1937
1974
  if (!xobj) {
1938
1975
  resolveXObject();
@@ -1950,7 +1987,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
1950
1987
  }
1951
1988
 
1952
1989
  if (type.name !== "Form") {
1953
- skipEmptyXObjs[name] = true;
1990
+ emptyXObjectCache.set(name, xobj.dict.objId, true);
1954
1991
  resolveXObject();
1955
1992
  return;
1956
1993
  }
@@ -1992,7 +2029,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
1992
2029
  seenStyles
1993
2030
  }).then(function () {
1994
2031
  if (!sinkWrapper.enqueueInvoked) {
1995
- skipEmptyXObjs[name] = true;
2032
+ emptyXObjectCache.set(name, xobj.dict.objId, true);
1996
2033
  }
1997
2034
 
1998
2035
  resolveXObject();
@@ -2160,14 +2197,14 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
2160
2197
  properties.baseEncodingName = baseEncodingName;
2161
2198
  properties.hasEncoding = !!baseEncodingName || differences.length > 0;
2162
2199
  properties.dict = dict;
2163
- return toUnicodePromise.then(toUnicode => {
2164
- properties.toUnicode = toUnicode;
2200
+ return toUnicodePromise.then(readToUnicode => {
2201
+ properties.toUnicode = readToUnicode;
2165
2202
  return this.buildToUnicode(properties);
2166
- }).then(toUnicode => {
2167
- properties.toUnicode = toUnicode;
2203
+ }).then(builtToUnicode => {
2204
+ properties.toUnicode = builtToUnicode;
2168
2205
 
2169
2206
  if (cidToGidBytes) {
2170
- properties.cidToGidMap = this.readCidToGidMap(cidToGidBytes, toUnicode);
2207
+ properties.cidToGidMap = this.readCidToGidMap(cidToGidBytes, builtToUnicode);
2171
2208
  }
2172
2209
 
2173
2210
  return properties;
@@ -2244,7 +2281,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
2244
2281
 
2245
2282
  }
2246
2283
 
2247
- if (code > 0 && Number.isInteger(code)) {
2284
+ if (code > 0 && code <= 0x10ffff && Number.isInteger(code)) {
2248
2285
  if (baseEncodingName && code === +charcode) {
2249
2286
  const baseEncoding = (0, _encodings.getEncoding)(baseEncodingName);
2250
2287
 
@@ -2364,7 +2401,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
2364
2401
 
2365
2402
  if (this.options.ignoreErrors) {
2366
2403
  this.handler.send("UnsupportedFeature", {
2367
- featureId: _util.UNSUPPORTED_FEATURES.font
2404
+ featureId: _util.UNSUPPORTED_FEATURES.errorFontToUnicode
2368
2405
  });
2369
2406
  (0, _util.warn)(`readToUnicode - ignoring ToUnicode data: "${reason}".`);
2370
2407
  return null;
@@ -2690,7 +2727,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
2690
2727
  lastChar
2691
2728
  };
2692
2729
  const widths = dict.get("Widths");
2693
- return this.extractDataStructures(dict, dict, properties).then(properties => {
2730
+ return this.extractDataStructures(dict, dict, properties).then(newProperties => {
2694
2731
  if (widths) {
2695
2732
  const glyphWidths = [];
2696
2733
  let j = firstChar;
@@ -2699,12 +2736,12 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
2699
2736
  glyphWidths[j++] = this.xref.fetchIfRef(widths[i]);
2700
2737
  }
2701
2738
 
2702
- properties.widths = glyphWidths;
2739
+ newProperties.widths = glyphWidths;
2703
2740
  } else {
2704
- properties.widths = this.buildCharCodeToWidth(metrics.widths, properties);
2741
+ newProperties.widths = this.buildCharCodeToWidth(metrics.widths, newProperties);
2705
2742
  }
2706
2743
 
2707
- return new _fonts.Font(baseFontName, null, properties);
2744
+ return new _fonts.Font(baseFontName, null, newProperties);
2708
2745
  });
2709
2746
  }
2710
2747
  }
@@ -2765,7 +2802,6 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
2765
2802
  length3,
2766
2803
  loadedName: baseDict.loadedName,
2767
2804
  composite,
2768
- wideChars: composite,
2769
2805
  fixedPitch: false,
2770
2806
  fontMatrix: dict.getArray("FontMatrix") || _util.FONT_IDENTITY_MATRIX,
2771
2807
  firstChar: firstChar || 0,
@@ -2802,14 +2838,14 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
2802
2838
 
2803
2839
  return cMapPromise.then(() => {
2804
2840
  return this.extractDataStructures(dict, baseDict, properties);
2805
- }).then(properties => {
2806
- this.extractWidths(dict, descriptor, properties);
2841
+ }).then(newProperties => {
2842
+ this.extractWidths(dict, descriptor, newProperties);
2807
2843
 
2808
2844
  if (type === "Type3") {
2809
- properties.isType3Font = true;
2845
+ newProperties.isType3Font = true;
2810
2846
  }
2811
2847
 
2812
- return new _fonts.Font(fontName.name, fontFile, properties);
2848
+ return new _fonts.Font(fontName.name, fontFile, newProperties);
2813
2849
  });
2814
2850
  }
2815
2851
  };
@@ -2851,86 +2887,88 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
2851
2887
 
2852
2888
  exports.PartialEvaluator = PartialEvaluator;
2853
2889
 
2854
- var TranslatedFont = function TranslatedFontClosure() {
2855
- function TranslatedFont(loadedName, font, dict) {
2890
+ class TranslatedFont {
2891
+ constructor({
2892
+ loadedName,
2893
+ font,
2894
+ dict,
2895
+ extraProperties = false
2896
+ }) {
2856
2897
  this.loadedName = loadedName;
2857
2898
  this.font = font;
2858
2899
  this.dict = dict;
2900
+ this._extraProperties = extraProperties;
2859
2901
  this.type3Loaded = null;
2860
2902
  this.sent = false;
2861
2903
  }
2862
2904
 
2863
- TranslatedFont.prototype = {
2864
- send(handler) {
2865
- if (this.sent) {
2866
- return;
2867
- }
2905
+ send(handler) {
2906
+ if (this.sent) {
2907
+ return;
2908
+ }
2868
2909
 
2869
- this.sent = true;
2870
- handler.send("commonobj", [this.loadedName, "Font", this.font.exportData()]);
2871
- },
2910
+ this.sent = true;
2911
+ handler.send("commonobj", [this.loadedName, "Font", this.font.exportData(this._extraProperties)]);
2912
+ }
2872
2913
 
2873
- fallback(handler) {
2874
- if (!this.font.data) {
2875
- return;
2876
- }
2914
+ fallback(handler) {
2915
+ if (!this.font.data) {
2916
+ return;
2917
+ }
2877
2918
 
2878
- this.font.disableFontFace = true;
2879
- const glyphs = this.font.glyphCacheValues;
2880
- PartialEvaluator.buildFontPaths(this.font, glyphs, handler);
2881
- },
2919
+ this.font.disableFontFace = true;
2920
+ const glyphs = this.font.glyphCacheValues;
2921
+ PartialEvaluator.buildFontPaths(this.font, glyphs, handler);
2922
+ }
2882
2923
 
2883
- loadType3Data(evaluator, resources, parentOperatorList, task) {
2884
- if (!this.font.isType3Font) {
2885
- throw new Error("Must be a Type3 font.");
2886
- }
2887
-
2888
- if (this.type3Loaded) {
2889
- return this.type3Loaded;
2890
- }
2891
-
2892
- var type3Options = Object.create(evaluator.options);
2893
- type3Options.ignoreErrors = false;
2894
- type3Options.nativeImageDecoderSupport = _util.NativeImageDecoding.NONE;
2895
- var type3Evaluator = evaluator.clone(type3Options);
2896
- type3Evaluator.parsingType3Font = true;
2897
- var translatedFont = this.font;
2898
- var loadCharProcsPromise = Promise.resolve();
2899
- var charProcs = this.dict.get("CharProcs");
2900
- var fontResources = this.dict.get("Resources") || resources;
2901
- var charProcKeys = charProcs.getKeys();
2902
- var charProcOperatorList = Object.create(null);
2903
-
2904
- for (var i = 0, n = charProcKeys.length; i < n; ++i) {
2905
- const key = charProcKeys[i];
2906
- loadCharProcsPromise = loadCharProcsPromise.then(function () {
2907
- var glyphStream = charProcs.get(key);
2908
- var operatorList = new _operator_list.OperatorList();
2909
- return type3Evaluator.getOperatorList({
2910
- stream: glyphStream,
2911
- task,
2912
- resources: fontResources,
2913
- operatorList
2914
- }).then(function () {
2915
- charProcOperatorList[key] = operatorList.getIR();
2916
- parentOperatorList.addDependencies(operatorList.dependencies);
2917
- }).catch(function (reason) {
2918
- (0, _util.warn)(`Type3 font resource "${key}" is not available.`);
2919
- var operatorList = new _operator_list.OperatorList();
2920
- charProcOperatorList[key] = operatorList.getIR();
2921
- });
2922
- });
2923
- }
2924
+ loadType3Data(evaluator, resources, parentOperatorList, task) {
2925
+ if (!this.font.isType3Font) {
2926
+ throw new Error("Must be a Type3 font.");
2927
+ }
2924
2928
 
2925
- this.type3Loaded = loadCharProcsPromise.then(function () {
2926
- translatedFont.charProcOperatorList = charProcOperatorList;
2927
- });
2929
+ if (this.type3Loaded) {
2928
2930
  return this.type3Loaded;
2929
2931
  }
2930
2932
 
2931
- };
2932
- return TranslatedFont;
2933
- }();
2933
+ var type3Options = Object.create(evaluator.options);
2934
+ type3Options.ignoreErrors = false;
2935
+ var type3Evaluator = evaluator.clone(type3Options);
2936
+ type3Evaluator.parsingType3Font = true;
2937
+ var translatedFont = this.font;
2938
+ var loadCharProcsPromise = Promise.resolve();
2939
+ var charProcs = this.dict.get("CharProcs");
2940
+ var fontResources = this.dict.get("Resources") || resources;
2941
+ var charProcKeys = charProcs.getKeys();
2942
+ var charProcOperatorList = Object.create(null);
2943
+
2944
+ for (var i = 0, n = charProcKeys.length; i < n; ++i) {
2945
+ const key = charProcKeys[i];
2946
+ loadCharProcsPromise = loadCharProcsPromise.then(function () {
2947
+ var glyphStream = charProcs.get(key);
2948
+ var operatorList = new _operator_list.OperatorList();
2949
+ return type3Evaluator.getOperatorList({
2950
+ stream: glyphStream,
2951
+ task,
2952
+ resources: fontResources,
2953
+ operatorList
2954
+ }).then(function () {
2955
+ charProcOperatorList[key] = operatorList.getIR();
2956
+ parentOperatorList.addDependencies(operatorList.dependencies);
2957
+ }).catch(function (reason) {
2958
+ (0, _util.warn)(`Type3 font resource "${key}" is not available.`);
2959
+ const dummyOperatorList = new _operator_list.OperatorList();
2960
+ charProcOperatorList[key] = dummyOperatorList.getIR();
2961
+ });
2962
+ });
2963
+ }
2964
+
2965
+ this.type3Loaded = loadCharProcsPromise.then(function () {
2966
+ translatedFont.charProcOperatorList = charProcOperatorList;
2967
+ });
2968
+ return this.type3Loaded;
2969
+ }
2970
+
2971
+ }
2934
2972
 
2935
2973
  var StateManager = function StateManagerClosure() {
2936
2974
  function StateManager(initialState) {
@@ -3082,112 +3120,112 @@ var EvalState = function EvalStateClosure() {
3082
3120
 
3083
3121
  var EvaluatorPreprocessor = function EvaluatorPreprocessorClosure() {
3084
3122
  var getOPMap = (0, _core_utils.getLookupTableFactory)(function (t) {
3085
- t["w"] = {
3123
+ t.w = {
3086
3124
  id: _util.OPS.setLineWidth,
3087
3125
  numArgs: 1,
3088
3126
  variableArgs: false
3089
3127
  };
3090
- t["J"] = {
3128
+ t.J = {
3091
3129
  id: _util.OPS.setLineCap,
3092
3130
  numArgs: 1,
3093
3131
  variableArgs: false
3094
3132
  };
3095
- t["j"] = {
3133
+ t.j = {
3096
3134
  id: _util.OPS.setLineJoin,
3097
3135
  numArgs: 1,
3098
3136
  variableArgs: false
3099
3137
  };
3100
- t["M"] = {
3138
+ t.M = {
3101
3139
  id: _util.OPS.setMiterLimit,
3102
3140
  numArgs: 1,
3103
3141
  variableArgs: false
3104
3142
  };
3105
- t["d"] = {
3143
+ t.d = {
3106
3144
  id: _util.OPS.setDash,
3107
3145
  numArgs: 2,
3108
3146
  variableArgs: false
3109
3147
  };
3110
- t["ri"] = {
3148
+ t.ri = {
3111
3149
  id: _util.OPS.setRenderingIntent,
3112
3150
  numArgs: 1,
3113
3151
  variableArgs: false
3114
3152
  };
3115
- t["i"] = {
3153
+ t.i = {
3116
3154
  id: _util.OPS.setFlatness,
3117
3155
  numArgs: 1,
3118
3156
  variableArgs: false
3119
3157
  };
3120
- t["gs"] = {
3158
+ t.gs = {
3121
3159
  id: _util.OPS.setGState,
3122
3160
  numArgs: 1,
3123
3161
  variableArgs: false
3124
3162
  };
3125
- t["q"] = {
3163
+ t.q = {
3126
3164
  id: _util.OPS.save,
3127
3165
  numArgs: 0,
3128
3166
  variableArgs: false
3129
3167
  };
3130
- t["Q"] = {
3168
+ t.Q = {
3131
3169
  id: _util.OPS.restore,
3132
3170
  numArgs: 0,
3133
3171
  variableArgs: false
3134
3172
  };
3135
- t["cm"] = {
3173
+ t.cm = {
3136
3174
  id: _util.OPS.transform,
3137
3175
  numArgs: 6,
3138
3176
  variableArgs: false
3139
3177
  };
3140
- t["m"] = {
3178
+ t.m = {
3141
3179
  id: _util.OPS.moveTo,
3142
3180
  numArgs: 2,
3143
3181
  variableArgs: false
3144
3182
  };
3145
- t["l"] = {
3183
+ t.l = {
3146
3184
  id: _util.OPS.lineTo,
3147
3185
  numArgs: 2,
3148
3186
  variableArgs: false
3149
3187
  };
3150
- t["c"] = {
3188
+ t.c = {
3151
3189
  id: _util.OPS.curveTo,
3152
3190
  numArgs: 6,
3153
3191
  variableArgs: false
3154
3192
  };
3155
- t["v"] = {
3193
+ t.v = {
3156
3194
  id: _util.OPS.curveTo2,
3157
3195
  numArgs: 4,
3158
3196
  variableArgs: false
3159
3197
  };
3160
- t["y"] = {
3198
+ t.y = {
3161
3199
  id: _util.OPS.curveTo3,
3162
3200
  numArgs: 4,
3163
3201
  variableArgs: false
3164
3202
  };
3165
- t["h"] = {
3203
+ t.h = {
3166
3204
  id: _util.OPS.closePath,
3167
3205
  numArgs: 0,
3168
3206
  variableArgs: false
3169
3207
  };
3170
- t["re"] = {
3208
+ t.re = {
3171
3209
  id: _util.OPS.rectangle,
3172
3210
  numArgs: 4,
3173
3211
  variableArgs: false
3174
3212
  };
3175
- t["S"] = {
3213
+ t.S = {
3176
3214
  id: _util.OPS.stroke,
3177
3215
  numArgs: 0,
3178
3216
  variableArgs: false
3179
3217
  };
3180
- t["s"] = {
3218
+ t.s = {
3181
3219
  id: _util.OPS.closeStroke,
3182
3220
  numArgs: 0,
3183
3221
  variableArgs: false
3184
3222
  };
3185
- t["f"] = {
3223
+ t.f = {
3186
3224
  id: _util.OPS.fill,
3187
3225
  numArgs: 0,
3188
3226
  variableArgs: false
3189
3227
  };
3190
- t["F"] = {
3228
+ t.F = {
3191
3229
  id: _util.OPS.fill,
3192
3230
  numArgs: 0,
3193
3231
  variableArgs: false
@@ -3197,7 +3235,7 @@ var EvaluatorPreprocessor = function EvaluatorPreprocessorClosure() {
3197
3235
  numArgs: 0,
3198
3236
  variableArgs: false
3199
3237
  };
3200
- t["B"] = {
3238
+ t.B = {
3201
3239
  id: _util.OPS.fillStroke,
3202
3240
  numArgs: 0,
3203
3241
  variableArgs: false
@@ -3207,7 +3245,7 @@ var EvaluatorPreprocessor = function EvaluatorPreprocessorClosure() {
3207
3245
  numArgs: 0,
3208
3246
  variableArgs: false
3209
3247
  };
3210
- t["b"] = {
3248
+ t.b = {
3211
3249
  id: _util.OPS.closeFillStroke,
3212
3250
  numArgs: 0,
3213
3251
  variableArgs: false
@@ -3217,12 +3255,12 @@ var EvaluatorPreprocessor = function EvaluatorPreprocessorClosure() {
3217
3255
  numArgs: 0,
3218
3256
  variableArgs: false
3219
3257
  };
3220
- t["n"] = {
3258
+ t.n = {
3221
3259
  id: _util.OPS.endPath,
3222
3260
  numArgs: 0,
3223
3261
  variableArgs: false
3224
3262
  };
3225
- t["W"] = {
3263
+ t.W = {
3226
3264
  id: _util.OPS.clip,
3227
3265
  numArgs: 0,
3228
3266
  variableArgs: false
@@ -3232,62 +3270,62 @@ var EvaluatorPreprocessor = function EvaluatorPreprocessorClosure() {
3232
3270
  numArgs: 0,
3233
3271
  variableArgs: false
3234
3272
  };
3235
- t["BT"] = {
3273
+ t.BT = {
3236
3274
  id: _util.OPS.beginText,
3237
3275
  numArgs: 0,
3238
3276
  variableArgs: false
3239
3277
  };
3240
- t["ET"] = {
3278
+ t.ET = {
3241
3279
  id: _util.OPS.endText,
3242
3280
  numArgs: 0,
3243
3281
  variableArgs: false
3244
3282
  };
3245
- t["Tc"] = {
3283
+ t.Tc = {
3246
3284
  id: _util.OPS.setCharSpacing,
3247
3285
  numArgs: 1,
3248
3286
  variableArgs: false
3249
3287
  };
3250
- t["Tw"] = {
3288
+ t.Tw = {
3251
3289
  id: _util.OPS.setWordSpacing,
3252
3290
  numArgs: 1,
3253
3291
  variableArgs: false
3254
3292
  };
3255
- t["Tz"] = {
3293
+ t.Tz = {
3256
3294
  id: _util.OPS.setHScale,
3257
3295
  numArgs: 1,
3258
3296
  variableArgs: false
3259
3297
  };
3260
- t["TL"] = {
3298
+ t.TL = {
3261
3299
  id: _util.OPS.setLeading,
3262
3300
  numArgs: 1,
3263
3301
  variableArgs: false
3264
3302
  };
3265
- t["Tf"] = {
3303
+ t.Tf = {
3266
3304
  id: _util.OPS.setFont,
3267
3305
  numArgs: 2,
3268
3306
  variableArgs: false
3269
3307
  };
3270
- t["Tr"] = {
3308
+ t.Tr = {
3271
3309
  id: _util.OPS.setTextRenderingMode,
3272
3310
  numArgs: 1,
3273
3311
  variableArgs: false
3274
3312
  };
3275
- t["Ts"] = {
3313
+ t.Ts = {
3276
3314
  id: _util.OPS.setTextRise,
3277
3315
  numArgs: 1,
3278
3316
  variableArgs: false
3279
3317
  };
3280
- t["Td"] = {
3318
+ t.Td = {
3281
3319
  id: _util.OPS.moveText,
3282
3320
  numArgs: 2,
3283
3321
  variableArgs: false
3284
3322
  };
3285
- t["TD"] = {
3323
+ t.TD = {
3286
3324
  id: _util.OPS.setLeadingMoveText,
3287
3325
  numArgs: 2,
3288
3326
  variableArgs: false
3289
3327
  };
3290
- t["Tm"] = {
3328
+ t.Tm = {
3291
3329
  id: _util.OPS.setTextMatrix,
3292
3330
  numArgs: 6,
3293
3331
  variableArgs: false
@@ -3297,12 +3335,12 @@ var EvaluatorPreprocessor = function EvaluatorPreprocessorClosure() {
3297
3335
  numArgs: 0,
3298
3336
  variableArgs: false
3299
3337
  };
3300
- t["Tj"] = {
3338
+ t.Tj = {
3301
3339
  id: _util.OPS.showText,
3302
3340
  numArgs: 1,
3303
3341
  variableArgs: false
3304
3342
  };
3305
- t["TJ"] = {
3343
+ t.TJ = {
3306
3344
  id: _util.OPS.showSpacedText,
3307
3345
  numArgs: 1,
3308
3346
  variableArgs: false
@@ -3317,146 +3355,146 @@ var EvaluatorPreprocessor = function EvaluatorPreprocessorClosure() {
3317
3355
  numArgs: 3,
3318
3356
  variableArgs: false
3319
3357
  };
3320
- t["d0"] = {
3358
+ t.d0 = {
3321
3359
  id: _util.OPS.setCharWidth,
3322
3360
  numArgs: 2,
3323
3361
  variableArgs: false
3324
3362
  };
3325
- t["d1"] = {
3363
+ t.d1 = {
3326
3364
  id: _util.OPS.setCharWidthAndBounds,
3327
3365
  numArgs: 6,
3328
3366
  variableArgs: false
3329
3367
  };
3330
- t["CS"] = {
3368
+ t.CS = {
3331
3369
  id: _util.OPS.setStrokeColorSpace,
3332
3370
  numArgs: 1,
3333
3371
  variableArgs: false
3334
3372
  };
3335
- t["cs"] = {
3373
+ t.cs = {
3336
3374
  id: _util.OPS.setFillColorSpace,
3337
3375
  numArgs: 1,
3338
3376
  variableArgs: false
3339
3377
  };
3340
- t["SC"] = {
3378
+ t.SC = {
3341
3379
  id: _util.OPS.setStrokeColor,
3342
3380
  numArgs: 4,
3343
3381
  variableArgs: true
3344
3382
  };
3345
- t["SCN"] = {
3383
+ t.SCN = {
3346
3384
  id: _util.OPS.setStrokeColorN,
3347
3385
  numArgs: 33,
3348
3386
  variableArgs: true
3349
3387
  };
3350
- t["sc"] = {
3388
+ t.sc = {
3351
3389
  id: _util.OPS.setFillColor,
3352
3390
  numArgs: 4,
3353
3391
  variableArgs: true
3354
3392
  };
3355
- t["scn"] = {
3393
+ t.scn = {
3356
3394
  id: _util.OPS.setFillColorN,
3357
3395
  numArgs: 33,
3358
3396
  variableArgs: true
3359
3397
  };
3360
- t["G"] = {
3398
+ t.G = {
3361
3399
  id: _util.OPS.setStrokeGray,
3362
3400
  numArgs: 1,
3363
3401
  variableArgs: false
3364
3402
  };
3365
- t["g"] = {
3403
+ t.g = {
3366
3404
  id: _util.OPS.setFillGray,
3367
3405
  numArgs: 1,
3368
3406
  variableArgs: false
3369
3407
  };
3370
- t["RG"] = {
3408
+ t.RG = {
3371
3409
  id: _util.OPS.setStrokeRGBColor,
3372
3410
  numArgs: 3,
3373
3411
  variableArgs: false
3374
3412
  };
3375
- t["rg"] = {
3413
+ t.rg = {
3376
3414
  id: _util.OPS.setFillRGBColor,
3377
3415
  numArgs: 3,
3378
3416
  variableArgs: false
3379
3417
  };
3380
- t["K"] = {
3418
+ t.K = {
3381
3419
  id: _util.OPS.setStrokeCMYKColor,
3382
3420
  numArgs: 4,
3383
3421
  variableArgs: false
3384
3422
  };
3385
- t["k"] = {
3423
+ t.k = {
3386
3424
  id: _util.OPS.setFillCMYKColor,
3387
3425
  numArgs: 4,
3388
3426
  variableArgs: false
3389
3427
  };
3390
- t["sh"] = {
3428
+ t.sh = {
3391
3429
  id: _util.OPS.shadingFill,
3392
3430
  numArgs: 1,
3393
3431
  variableArgs: false
3394
3432
  };
3395
- t["BI"] = {
3433
+ t.BI = {
3396
3434
  id: _util.OPS.beginInlineImage,
3397
3435
  numArgs: 0,
3398
3436
  variableArgs: false
3399
3437
  };
3400
- t["ID"] = {
3438
+ t.ID = {
3401
3439
  id: _util.OPS.beginImageData,
3402
3440
  numArgs: 0,
3403
3441
  variableArgs: false
3404
3442
  };
3405
- t["EI"] = {
3443
+ t.EI = {
3406
3444
  id: _util.OPS.endInlineImage,
3407
3445
  numArgs: 1,
3408
3446
  variableArgs: false
3409
3447
  };
3410
- t["Do"] = {
3448
+ t.Do = {
3411
3449
  id: _util.OPS.paintXObject,
3412
3450
  numArgs: 1,
3413
3451
  variableArgs: false
3414
3452
  };
3415
- t["MP"] = {
3453
+ t.MP = {
3416
3454
  id: _util.OPS.markPoint,
3417
3455
  numArgs: 1,
3418
3456
  variableArgs: false
3419
3457
  };
3420
- t["DP"] = {
3458
+ t.DP = {
3421
3459
  id: _util.OPS.markPointProps,
3422
3460
  numArgs: 2,
3423
3461
  variableArgs: false
3424
3462
  };
3425
- t["BMC"] = {
3463
+ t.BMC = {
3426
3464
  id: _util.OPS.beginMarkedContent,
3427
3465
  numArgs: 1,
3428
3466
  variableArgs: false
3429
3467
  };
3430
- t["BDC"] = {
3468
+ t.BDC = {
3431
3469
  id: _util.OPS.beginMarkedContentProps,
3432
3470
  numArgs: 2,
3433
3471
  variableArgs: false
3434
3472
  };
3435
- t["EMC"] = {
3473
+ t.EMC = {
3436
3474
  id: _util.OPS.endMarkedContent,
3437
3475
  numArgs: 0,
3438
3476
  variableArgs: false
3439
3477
  };
3440
- t["BX"] = {
3478
+ t.BX = {
3441
3479
  id: _util.OPS.beginCompat,
3442
3480
  numArgs: 0,
3443
3481
  variableArgs: false
3444
3482
  };
3445
- t["EX"] = {
3483
+ t.EX = {
3446
3484
  id: _util.OPS.endCompat,
3447
3485
  numArgs: 0,
3448
3486
  variableArgs: false
3449
3487
  };
3450
- t["BM"] = null;
3451
- t["BD"] = null;
3452
- t["true"] = null;
3453
- t["fa"] = null;
3454
- t["fal"] = null;
3455
- t["fals"] = null;
3456
- t["false"] = null;
3457
- t["nu"] = null;
3458
- t["nul"] = null;
3459
- t["null"] = null;
3488
+ t.BM = null;
3489
+ t.BD = null;
3490
+ t.true = null;
3491
+ t.fa = null;
3492
+ t.fal = null;
3493
+ t.fals = null;
3494
+ t.false = null;
3495
+ t.nu = null;
3496
+ t.nul = null;
3497
+ t.null = null;
3460
3498
  });
3461
3499
  const MAX_INVALID_PATH_OPS = 20;
3462
3500