pdfjs-dist 2.5.207 → 2.6.347

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 (133) hide show
  1. package/bower.json +1 -1
  2. package/build/pdf.js +867 -216
  3. package/build/pdf.js.map +1 -1
  4. package/build/pdf.min.js +1 -1
  5. package/build/pdf.worker.js +10214 -8547
  6. package/build/pdf.worker.js.map +1 -1
  7. package/build/pdf.worker.min.js +1 -1
  8. package/es5/build/pdf.js +2023 -1046
  9. package/es5/build/pdf.js.map +1 -1
  10. package/es5/build/pdf.min.js +22 -0
  11. package/es5/build/pdf.worker.js +11136 -8144
  12. package/es5/build/pdf.worker.js.map +1 -1
  13. package/es5/build/pdf.worker.min.js +22 -0
  14. package/es5/image_decoders/pdf.image_decoders.js +12529 -0
  15. package/es5/image_decoders/pdf.image_decoders.js.map +1 -0
  16. package/es5/image_decoders/pdf.image_decoders.min.js +22 -0
  17. package/es5/web/images/shadow.png +0 -0
  18. package/es5/web/pdf_viewer.css +8 -5
  19. package/es5/web/pdf_viewer.js +195 -51
  20. package/es5/web/pdf_viewer.js.map +1 -1
  21. package/image_decoders/pdf.image_decoders.js +24 -16
  22. package/image_decoders/pdf.image_decoders.js.map +1 -1
  23. package/image_decoders/pdf.image_decoders.min.js +1 -1
  24. package/lib/core/annotation.js +479 -43
  25. package/lib/core/cff_parser.js +643 -615
  26. package/lib/core/chunked_stream.js +64 -50
  27. package/lib/core/colorspace.js +126 -104
  28. package/lib/core/crypto.js +37 -0
  29. package/lib/core/document.js +128 -75
  30. package/lib/core/evaluator.js +3015 -2754
  31. package/lib/core/fonts.js +47 -46
  32. package/lib/core/function.js +79 -6
  33. package/lib/core/image.js +364 -357
  34. package/lib/core/image_utils.js +109 -8
  35. package/lib/core/jpg.js +8 -3
  36. package/lib/core/obj.js +255 -34
  37. package/lib/core/operator_list.js +17 -15
  38. package/lib/core/parser.js +40 -3
  39. package/lib/core/pattern.js +24 -11
  40. package/lib/core/primitives.js +112 -53
  41. package/lib/core/type1_parser.js +2 -0
  42. package/lib/core/worker.js +102 -37
  43. package/lib/core/writer.js +242 -0
  44. package/lib/display/annotation_layer.js +51 -10
  45. package/lib/display/annotation_storage.js +89 -0
  46. package/lib/display/api.js +140 -54
  47. package/lib/display/canvas.js +215 -46
  48. package/lib/display/display_utils.js +55 -18
  49. package/lib/display/fetch_stream.js +6 -0
  50. package/lib/display/font_loader.js +26 -15
  51. package/lib/display/metadata.js +1 -7
  52. package/lib/display/network.js +0 -14
  53. package/lib/display/node_utils.js +87 -0
  54. package/lib/display/optional_content_config.js +184 -0
  55. package/lib/display/svg.js +1 -1
  56. package/lib/display/text_layer.js +4 -1
  57. package/lib/pdf.js +2 -2
  58. package/lib/pdf.worker.js +2 -2
  59. package/lib/shared/is_node.js +1 -1
  60. package/lib/shared/util.js +13 -10
  61. package/lib/test/unit/annotation_spec.js +520 -50
  62. package/lib/test/unit/annotation_storage_spec.js +83 -0
  63. package/lib/test/unit/api_spec.js +16 -6
  64. package/lib/test/unit/cmap_spec.js +4 -4
  65. package/lib/test/unit/colorspace_spec.js +216 -24
  66. package/lib/test/unit/crypto_spec.js +51 -4
  67. package/lib/test/unit/custom_spec.js +129 -1
  68. package/lib/test/unit/document_spec.js +112 -1
  69. package/lib/test/unit/evaluator_spec.js +29 -10
  70. package/lib/test/unit/jasmine-boot.js +1 -1
  71. package/lib/test/unit/metadata_spec.js +3 -3
  72. package/lib/test/unit/primitives_spec.js +242 -63
  73. package/lib/test/unit/test_utils.js +42 -89
  74. package/lib/test/unit/testreporter.js +17 -6
  75. package/lib/test/unit/util_spec.js +13 -12
  76. package/lib/test/unit/writer_spec.js +84 -0
  77. package/lib/web/annotation_layer_builder.js +13 -9
  78. package/lib/web/app.js +231 -26
  79. package/lib/web/app_options.js +1 -6
  80. package/lib/web/base_tree_viewer.js +100 -0
  81. package/lib/web/base_viewer.js +53 -4
  82. package/lib/web/download_manager.js +3 -10
  83. package/lib/web/firefox_print_service.js +32 -12
  84. package/lib/web/firefoxcom.js +20 -6
  85. package/lib/web/interfaces.js +1 -1
  86. package/lib/web/pdf_attachment_viewer.js +80 -38
  87. package/lib/web/pdf_find_controller.js +2 -1
  88. package/lib/web/pdf_layer_viewer.js +208 -0
  89. package/lib/web/pdf_outline_viewer.js +24 -57
  90. package/lib/web/pdf_page_view.js +29 -6
  91. package/lib/web/pdf_print_service.js +13 -11
  92. package/lib/web/pdf_sidebar.js +46 -25
  93. package/lib/web/pdf_thumbnail_view.js +16 -3
  94. package/lib/web/pdf_thumbnail_viewer.js +17 -1
  95. package/lib/web/pdf_viewer.component.js +2 -2
  96. package/lib/web/preferences.js +1 -1
  97. package/lib/web/toolbar.js +1 -1
  98. package/lib/web/ui_utils.js +7 -1
  99. package/package.json +3 -1
  100. package/types/display/annotation_layer.d.ts +61 -0
  101. package/types/display/annotation_storage.d.ts +36 -0
  102. package/types/display/api.d.ts +1107 -0
  103. package/types/display/api_compatibility.d.ts +1 -0
  104. package/types/display/canvas.d.ts +4 -0
  105. package/types/display/content_disposition.d.ts +7 -0
  106. package/types/display/display_utils.d.ts +243 -0
  107. package/types/display/fetch_stream.d.ts +67 -0
  108. package/types/display/font_loader.d.ts +19 -0
  109. package/types/display/metadata.d.ts +9 -0
  110. package/types/display/network.d.ts +80 -0
  111. package/types/display/network_utils.d.ts +14 -0
  112. package/types/display/node_stream.d.ts +72 -0
  113. package/types/display/node_utils.d.ts +6 -0
  114. package/types/display/optional_content_config.d.ts +12 -0
  115. package/types/display/pattern_helper.d.ts +5 -0
  116. package/types/display/svg.d.ts +2 -0
  117. package/types/display/text_layer.d.ts +83 -0
  118. package/types/display/transport_stream.d.ts +57 -0
  119. package/types/display/webgl.d.ts +20 -0
  120. package/types/display/worker_options.d.ts +27 -0
  121. package/types/display/xml_parser.d.ts +35 -0
  122. package/types/pdf.d.ts +33 -0
  123. package/types/shared/compatibility.d.ts +1 -0
  124. package/types/shared/is_node.d.ts +1 -0
  125. package/types/shared/message_handler.d.ts +62 -0
  126. package/types/shared/util.d.ts +421 -0
  127. package/web/images/shadow.png +0 -0
  128. package/web/pdf_viewer.css +8 -5
  129. package/web/pdf_viewer.js +109 -33
  130. package/web/pdf_viewer.js.map +1 -1
  131. package/webpack.js +1 -9
  132. package/es5/web/images/texture.png +0 -0
  133. package/web/images/texture.png +0 -0
@@ -34,6 +34,10 @@ var _display_utils = require("./display_utils.js");
34
34
 
35
35
  var _font_loader = require("./font_loader.js");
36
36
 
37
+ var _node_utils = require("./node_utils.js");
38
+
39
+ var _annotation_storage = require("./annotation_storage.js");
40
+
37
41
  var _api_compatibility = require("./api_compatibility.js");
38
42
 
39
43
  var _canvas = require("./canvas.js");
@@ -46,12 +50,16 @@ var _message_handler = require("../shared/message_handler.js");
46
50
 
47
51
  var _metadata = require("./metadata.js");
48
52
 
53
+ var _optional_content_config = require("./optional_content_config.js");
54
+
49
55
  var _transport_stream = require("./transport_stream.js");
50
56
 
51
57
  var _webgl = require("./webgl.js");
52
58
 
53
59
  const DEFAULT_RANGE_CHUNK_SIZE = 65536;
54
60
  const RENDERING_CANCELLED_TIMEOUT = 100;
61
+ const DefaultCanvasFactory = _is_node.isNodeJS ? _node_utils.NodeCanvasFactory : _display_utils.DOMCanvasFactory;
62
+ const DefaultCMapReaderFactory = _is_node.isNodeJS ? _node_utils.NodeCMapReaderFactory : _display_utils.DOMCMapReaderFactory;
55
63
  let createPDFNetworkStream;
56
64
 
57
65
  function setPDFNetworkStreamFactory(pdfNetworkStreamFactory) {
@@ -120,7 +128,7 @@ function getDocument(src) {
120
128
  }
121
129
 
122
130
  params.rangeChunkSize = params.rangeChunkSize || DEFAULT_RANGE_CHUNK_SIZE;
123
- params.CMapReaderFactory = params.CMapReaderFactory || _display_utils.DOMCMapReaderFactory;
131
+ params.CMapReaderFactory = params.CMapReaderFactory || DefaultCMapReaderFactory;
124
132
  params.ignoreErrors = params.stopAtErrors !== true;
125
133
  params.fontExtraProperties = params.fontExtraProperties === true;
126
134
  params.pdfBug = params.pdfBug === true;
@@ -137,6 +145,10 @@ function getDocument(src) {
137
145
  params.disableFontFace = _api_compatibility.apiCompatibilityParams.disableFontFace || false;
138
146
  }
139
147
 
148
+ if (typeof params.ownerDocument === "undefined") {
149
+ params.ownerDocument = globalThis.document;
150
+ }
151
+
140
152
  if (typeof params.disableRange !== "boolean") {
141
153
  params.disableRange = false;
142
154
  }
@@ -221,7 +233,7 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) {
221
233
 
222
234
  return worker.messageHandler.sendWithPromise("GetDocRequest", {
223
235
  docId,
224
- apiVersion: '2.5.207',
236
+ apiVersion: '2.6.347',
225
237
  source: {
226
238
  data: source.data,
227
239
  url: source.url,
@@ -362,6 +374,10 @@ class PDFDocumentProxy {
362
374
  this._transport = transport;
363
375
  }
364
376
 
377
+ get annotationStorage() {
378
+ return (0, _util.shadow)(this, "annotationStorage", new _annotation_storage.AnnotationStorage());
379
+ }
380
+
365
381
  get numPages() {
366
382
  return this._pdfInfo.numPages;
367
383
  }
@@ -406,13 +422,6 @@ class PDFDocumentProxy {
406
422
  return this._transport.getOpenAction();
407
423
  }
408
424
 
409
- getOpenActionDestination() {
410
- (0, _display_utils.deprecated)("getOpenActionDestination, use getOpenAction instead.");
411
- return this.getOpenAction().then(function (openAction) {
412
- return openAction && openAction.dest ? openAction.dest : null;
413
- });
414
- }
415
-
416
425
  getAttachments() {
417
426
  return this._transport.getAttachments();
418
427
  }
@@ -425,6 +434,10 @@ class PDFDocumentProxy {
425
434
  return this._transport.getOutline();
426
435
  }
427
436
 
437
+ getOptionalContentConfig() {
438
+ return this._transport.getOptionalContentConfig();
439
+ }
440
+
428
441
  getPermissions() {
429
442
  return this._transport.getPermissions();
430
443
  }
@@ -461,14 +474,19 @@ class PDFDocumentProxy {
461
474
  return this._transport.loadingTask;
462
475
  }
463
476
 
477
+ saveDocument(annotationStorage) {
478
+ return this._transport.saveDocument(annotationStorage);
479
+ }
480
+
464
481
  }
465
482
 
466
483
  exports.PDFDocumentProxy = PDFDocumentProxy;
467
484
 
468
485
  class PDFPageProxy {
469
- constructor(pageIndex, pageInfo, transport, pdfBug = false) {
486
+ constructor(pageIndex, pageInfo, transport, ownerDocument, pdfBug = false) {
470
487
  this._pageIndex = pageIndex;
471
488
  this._pageInfo = pageInfo;
489
+ this._ownerDocument = ownerDocument;
472
490
  this._transport = transport;
473
491
  this._stats = pdfBug ? new _display_utils.StatTimer() : null;
474
492
  this._pdfBug = pdfBug;
@@ -476,7 +494,7 @@ class PDFPageProxy {
476
494
  this.objs = new PDFObjects();
477
495
  this.cleanupAfterRender = false;
478
496
  this.pendingCleanup = false;
479
- this.intentStates = Object.create(null);
497
+ this._intentStates = new Map();
480
498
  this.destroyed = false;
481
499
  }
482
500
 
@@ -537,7 +555,9 @@ class PDFPageProxy {
537
555
  transform = null,
538
556
  imageLayer = null,
539
557
  canvasFactory = null,
540
- background = null
558
+ background = null,
559
+ annotationStorage = null,
560
+ optionalContentConfigPromise = null
541
561
  }) {
542
562
  if (this._stats) {
543
563
  this._stats.time("Overall");
@@ -546,18 +566,26 @@ class PDFPageProxy {
546
566
  const renderingIntent = intent === "print" ? "print" : "display";
547
567
  this.pendingCleanup = false;
548
568
 
549
- if (!this.intentStates[renderingIntent]) {
550
- this.intentStates[renderingIntent] = Object.create(null);
569
+ if (!optionalContentConfigPromise) {
570
+ optionalContentConfigPromise = this._transport.getOptionalContentConfig();
551
571
  }
552
572
 
553
- const intentState = this.intentStates[renderingIntent];
573
+ let intentState = this._intentStates.get(renderingIntent);
574
+
575
+ if (!intentState) {
576
+ intentState = Object.create(null);
577
+
578
+ this._intentStates.set(renderingIntent, intentState);
579
+ }
554
580
 
555
581
  if (intentState.streamReaderCancelTimeout) {
556
582
  clearTimeout(intentState.streamReaderCancelTimeout);
557
583
  intentState.streamReaderCancelTimeout = null;
558
584
  }
559
585
 
560
- const canvasFactoryInstance = canvasFactory || new _display_utils.DOMCanvasFactory();
586
+ const canvasFactoryInstance = canvasFactory || new DefaultCanvasFactory({
587
+ ownerDocument: this._ownerDocument
588
+ });
561
589
  const webGLContext = new _webgl.WebGLContext({
562
590
  enable: enableWebGL
563
591
  });
@@ -577,7 +605,8 @@ class PDFPageProxy {
577
605
  this._pumpOperatorList({
578
606
  pageIndex: this._pageIndex,
579
607
  intent: renderingIntent,
580
- renderInteractiveForms: renderInteractiveForms === true
608
+ renderInteractiveForms: renderInteractiveForms === true,
609
+ annotationStorage: annotationStorage && annotationStorage.getAll() || null
581
610
  });
582
611
  }
583
612
 
@@ -637,7 +666,7 @@ class PDFPageProxy {
637
666
 
638
667
  intentState.renderTasks.push(internalRenderTask);
639
668
  const renderTask = internalRenderTask.task;
640
- intentState.displayReadyCapability.promise.then(transparency => {
669
+ Promise.all([intentState.displayReadyCapability.promise, optionalContentConfigPromise]).then(([transparency, optionalContentConfig]) => {
641
670
  if (this.pendingCleanup) {
642
671
  complete();
643
672
  return;
@@ -647,7 +676,10 @@ class PDFPageProxy {
647
676
  this._stats.time("Rendering");
648
677
  }
649
678
 
650
- internalRenderTask.initializeGraphics(transparency);
679
+ internalRenderTask.initializeGraphics({
680
+ transparency,
681
+ optionalContentConfig
682
+ });
651
683
  internalRenderTask.operatorListChanged();
652
684
  }).catch(complete);
653
685
  return renderTask;
@@ -667,15 +699,18 @@ class PDFPageProxy {
667
699
 
668
700
  const renderingIntent = "oplist";
669
701
 
670
- if (!this.intentStates[renderingIntent]) {
671
- this.intentStates[renderingIntent] = Object.create(null);
702
+ let intentState = this._intentStates.get(renderingIntent);
703
+
704
+ if (!intentState) {
705
+ intentState = Object.create(null);
706
+
707
+ this._intentStates.set(renderingIntent, intentState);
672
708
  }
673
709
 
674
- const intentState = this.intentStates[renderingIntent];
675
710
  let opListTask;
676
711
 
677
712
  if (!intentState.opListReadCapability) {
678
- opListTask = {};
713
+ opListTask = Object.create(null);
679
714
  opListTask.operatorListChanged = operatorListChanged;
680
715
  intentState.opListReadCapability = (0, _util.createPromiseCapability)();
681
716
  intentState.renderTasks = [];
@@ -750,9 +785,8 @@ class PDFPageProxy {
750
785
  this.destroyed = true;
751
786
  this._transport.pageCache[this._pageIndex] = null;
752
787
  const waitOn = [];
753
- Object.keys(this.intentStates).forEach(intent => {
754
- const intentState = this.intentStates[intent];
755
788
 
789
+ for (const [intent, intentState] of this._intentStates) {
756
790
  this._abortOperatorList({
757
791
  intentState,
758
792
  reason: new Error("Page was destroyed."),
@@ -760,15 +794,15 @@ class PDFPageProxy {
760
794
  });
761
795
 
762
796
  if (intent === "oplist") {
763
- return;
797
+ continue;
764
798
  }
765
799
 
766
- intentState.renderTasks.forEach(function (renderTask) {
767
- const renderCompleted = renderTask.capability.promise.catch(function () {});
768
- waitOn.push(renderCompleted);
769
- renderTask.cancel();
770
- });
771
- });
800
+ for (const internalRenderTask of intentState.renderTasks) {
801
+ waitOn.push(internalRenderTask.completed);
802
+ internalRenderTask.cancel();
803
+ }
804
+ }
805
+
772
806
  this.objs.clear();
773
807
  this.annotationsPromise = null;
774
808
  this.pendingCleanup = false;
@@ -781,16 +815,21 @@ class PDFPageProxy {
781
815
  }
782
816
 
783
817
  _tryCleanup(resetStats = false) {
784
- if (!this.pendingCleanup || Object.keys(this.intentStates).some(intent => {
785
- const intentState = this.intentStates[intent];
786
- return intentState.renderTasks.length !== 0 || !intentState.operatorList.lastChunk;
787
- })) {
818
+ if (!this.pendingCleanup) {
788
819
  return false;
789
820
  }
790
821
 
791
- Object.keys(this.intentStates).forEach(intent => {
792
- delete this.intentStates[intent];
793
- });
822
+ for (const {
823
+ renderTasks,
824
+ operatorList
825
+ } of this._intentStates.values()) {
826
+ if (renderTasks.length !== 0 || !operatorList.lastChunk) {
827
+ return false;
828
+ }
829
+ }
830
+
831
+ this._intentStates.clear();
832
+
794
833
  this.objs.clear();
795
834
  this.annotationsPromise = null;
796
835
 
@@ -803,7 +842,7 @@ class PDFPageProxy {
803
842
  }
804
843
 
805
844
  _startRenderPage(transparency, intent) {
806
- const intentState = this.intentStates[intent];
845
+ const intentState = this._intentStates.get(intent);
807
846
 
808
847
  if (!intentState) {
809
848
  return;
@@ -841,7 +880,9 @@ class PDFPageProxy {
841
880
  const readableStream = this._transport.messageHandler.sendWithStream("GetOperatorList", args);
842
881
 
843
882
  const reader = readableStream.getReader();
844
- const intentState = this.intentStates[args.intent];
883
+
884
+ const intentState = this._intentStates.get(args.intent);
885
+
845
886
  intentState.streamReader = reader;
846
887
 
847
888
  const pump = () => {
@@ -928,14 +969,14 @@ class PDFPageProxy {
928
969
  return;
929
970
  }
930
971
 
931
- Object.keys(this.intentStates).some(intent => {
932
- if (this.intentStates[intent] === intentState) {
933
- delete this.intentStates[intent];
934
- return true;
972
+ for (const [intent, curIntentState] of this._intentStates) {
973
+ if (curIntentState === intentState) {
974
+ this._intentStates.delete(intent);
975
+
976
+ break;
935
977
  }
978
+ }
936
979
 
937
- return false;
938
- });
939
980
  this.cleanup();
940
981
  }
941
982
 
@@ -1352,7 +1393,8 @@ class WorkerTransport {
1352
1393
  this.commonObjs = new PDFObjects();
1353
1394
  this.fontLoader = new _font_loader.FontLoader({
1354
1395
  docId: loadingTask.docId,
1355
- onUnsupportedFeature: this._onUnsupportedFeature.bind(this)
1396
+ onUnsupportedFeature: this._onUnsupportedFeature.bind(this),
1397
+ ownerDocument: params.ownerDocument
1356
1398
  });
1357
1399
  this._params = params;
1358
1400
  this.CMapReaderFactory = new params.CMapReaderFactory({
@@ -1445,6 +1487,14 @@ class WorkerTransport {
1445
1487
 
1446
1488
  sink.onCancel = reason => {
1447
1489
  this._fullReader.cancel(reason);
1490
+
1491
+ sink.ready.catch(readyReason => {
1492
+ if (this.destroyed) {
1493
+ return;
1494
+ }
1495
+
1496
+ throw readyReason;
1497
+ });
1448
1498
  };
1449
1499
  });
1450
1500
  messageHandler.on("ReaderHeadersReady", data => {
@@ -1503,6 +1553,13 @@ class WorkerTransport {
1503
1553
 
1504
1554
  sink.onCancel = reason => {
1505
1555
  rangeReader.cancel(reason);
1556
+ sink.ready.catch(readyReason => {
1557
+ if (this.destroyed) {
1558
+ return;
1559
+ }
1560
+
1561
+ throw readyReason;
1562
+ });
1506
1563
  };
1507
1564
  });
1508
1565
  messageHandler.on("GetDoc", ({
@@ -1537,6 +1594,11 @@ class WorkerTransport {
1537
1594
  break;
1538
1595
  }
1539
1596
 
1597
+ if (!(reason instanceof Error)) {
1598
+ const msg = "DocException - expected a valid Error.";
1599
+ (0, _util.warn)(msg);
1600
+ }
1601
+
1540
1602
  loadingTask._capability.reject(reason);
1541
1603
  });
1542
1604
  messageHandler.on("PasswordRequest", exception => {
@@ -1633,7 +1695,6 @@ class WorkerTransport {
1633
1695
  break;
1634
1696
 
1635
1697
  case "FontPath":
1636
- case "FontType3Res":
1637
1698
  case "Image":
1638
1699
  this.commonObjs.resolve(id, exportedData);
1639
1700
  break;
@@ -1742,7 +1803,7 @@ class WorkerTransport {
1742
1803
  throw new Error("Transport destroyed");
1743
1804
  }
1744
1805
 
1745
- const page = new PDFPageProxy(pageIndex, pageInfo, this, this._params.pdfBug);
1806
+ const page = new PDFPageProxy(pageIndex, pageInfo, this, this._params.ownerDocument, this._params.pdfBug);
1746
1807
  this.pageCache[pageIndex] = page;
1747
1808
  return page;
1748
1809
  });
@@ -1765,6 +1826,18 @@ class WorkerTransport {
1765
1826
  });
1766
1827
  }
1767
1828
 
1829
+ saveDocument(annotationStorage) {
1830
+ return this.messageHandler.sendWithPromise("SaveDocument", {
1831
+ numPages: this._numPages,
1832
+ annotationStorage: annotationStorage && annotationStorage.getAll() || null,
1833
+ filename: this._fullReader ? this._fullReader.filename : null
1834
+ }).finally(() => {
1835
+ if (annotationStorage) {
1836
+ annotationStorage.resetModified();
1837
+ }
1838
+ });
1839
+ }
1840
+
1768
1841
  getDestinations() {
1769
1842
  return this.messageHandler.sendWithPromise("GetDestinations", null);
1770
1843
  }
@@ -1811,6 +1884,12 @@ class WorkerTransport {
1811
1884
  return this.messageHandler.sendWithPromise("GetOutline", null);
1812
1885
  }
1813
1886
 
1887
+ getOptionalContentConfig() {
1888
+ return this.messageHandler.sendWithPromise("GetOptionalContentConfig", null).then(results => {
1889
+ return new _optional_content_config.OptionalContentConfig(results);
1890
+ });
1891
+ }
1892
+
1814
1893
  getPermissions() {
1815
1894
  return this.messageHandler.sendWithPromise("GetPermissions", null);
1816
1895
  }
@@ -1965,7 +2044,14 @@ const InternalRenderTask = function InternalRenderTaskClosure() {
1965
2044
  this._canvas = params.canvasContext.canvas;
1966
2045
  }
1967
2046
 
1968
- initializeGraphics(transparency = false) {
2047
+ get completed() {
2048
+ return this.capability.promise.catch(function () {});
2049
+ }
2050
+
2051
+ initializeGraphics({
2052
+ transparency = false,
2053
+ optionalContentConfig
2054
+ }) {
1969
2055
  if (this.cancelled) {
1970
2056
  return;
1971
2057
  }
@@ -1991,7 +2077,7 @@ const InternalRenderTask = function InternalRenderTaskClosure() {
1991
2077
  imageLayer,
1992
2078
  background
1993
2079
  } = this.params;
1994
- this.gfx = new _canvas.CanvasGraphics(canvasContext, this.commonObjs, this.objs, this.canvasFactory, this.webGLContext, imageLayer);
2080
+ this.gfx = new _canvas.CanvasGraphics(canvasContext, this.commonObjs, this.objs, this.canvasFactory, this.webGLContext, imageLayer, optionalContentConfig);
1995
2081
  this.gfx.beginDrawing({
1996
2082
  transform,
1997
2083
  viewport,
@@ -2092,7 +2178,7 @@ const InternalRenderTask = function InternalRenderTaskClosure() {
2092
2178
  return InternalRenderTask;
2093
2179
  }();
2094
2180
 
2095
- const version = '2.5.207';
2181
+ const version = '2.6.347';
2096
2182
  exports.version = version;
2097
- const build = '0974d605';
2183
+ const build = '3be9c65f';
2098
2184
  exports.build = build;