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.
- package/bower.json +1 -1
- package/build/pdf.js +867 -216
- package/build/pdf.js.map +1 -1
- package/build/pdf.min.js +1 -1
- package/build/pdf.worker.js +10214 -8547
- package/build/pdf.worker.js.map +1 -1
- package/build/pdf.worker.min.js +1 -1
- package/es5/build/pdf.js +2023 -1046
- package/es5/build/pdf.js.map +1 -1
- package/es5/build/pdf.min.js +22 -0
- package/es5/build/pdf.worker.js +11136 -8144
- package/es5/build/pdf.worker.js.map +1 -1
- package/es5/build/pdf.worker.min.js +22 -0
- package/es5/image_decoders/pdf.image_decoders.js +12529 -0
- package/es5/image_decoders/pdf.image_decoders.js.map +1 -0
- package/es5/image_decoders/pdf.image_decoders.min.js +22 -0
- package/es5/web/images/shadow.png +0 -0
- package/es5/web/pdf_viewer.css +8 -5
- package/es5/web/pdf_viewer.js +195 -51
- package/es5/web/pdf_viewer.js.map +1 -1
- package/image_decoders/pdf.image_decoders.js +24 -16
- package/image_decoders/pdf.image_decoders.js.map +1 -1
- package/image_decoders/pdf.image_decoders.min.js +1 -1
- package/lib/core/annotation.js +479 -43
- package/lib/core/cff_parser.js +643 -615
- package/lib/core/chunked_stream.js +64 -50
- package/lib/core/colorspace.js +126 -104
- package/lib/core/crypto.js +37 -0
- package/lib/core/document.js +128 -75
- package/lib/core/evaluator.js +3015 -2754
- package/lib/core/fonts.js +47 -46
- package/lib/core/function.js +79 -6
- package/lib/core/image.js +364 -357
- package/lib/core/image_utils.js +109 -8
- package/lib/core/jpg.js +8 -3
- package/lib/core/obj.js +255 -34
- package/lib/core/operator_list.js +17 -15
- package/lib/core/parser.js +40 -3
- package/lib/core/pattern.js +24 -11
- package/lib/core/primitives.js +112 -53
- package/lib/core/type1_parser.js +2 -0
- package/lib/core/worker.js +102 -37
- package/lib/core/writer.js +242 -0
- package/lib/display/annotation_layer.js +51 -10
- package/lib/display/annotation_storage.js +89 -0
- package/lib/display/api.js +140 -54
- package/lib/display/canvas.js +215 -46
- package/lib/display/display_utils.js +55 -18
- package/lib/display/fetch_stream.js +6 -0
- package/lib/display/font_loader.js +26 -15
- package/lib/display/metadata.js +1 -7
- package/lib/display/network.js +0 -14
- package/lib/display/node_utils.js +87 -0
- package/lib/display/optional_content_config.js +184 -0
- package/lib/display/svg.js +1 -1
- package/lib/display/text_layer.js +4 -1
- package/lib/pdf.js +2 -2
- package/lib/pdf.worker.js +2 -2
- package/lib/shared/is_node.js +1 -1
- package/lib/shared/util.js +13 -10
- package/lib/test/unit/annotation_spec.js +520 -50
- package/lib/test/unit/annotation_storage_spec.js +83 -0
- package/lib/test/unit/api_spec.js +16 -6
- package/lib/test/unit/cmap_spec.js +4 -4
- package/lib/test/unit/colorspace_spec.js +216 -24
- package/lib/test/unit/crypto_spec.js +51 -4
- package/lib/test/unit/custom_spec.js +129 -1
- package/lib/test/unit/document_spec.js +112 -1
- package/lib/test/unit/evaluator_spec.js +29 -10
- package/lib/test/unit/jasmine-boot.js +1 -1
- package/lib/test/unit/metadata_spec.js +3 -3
- package/lib/test/unit/primitives_spec.js +242 -63
- package/lib/test/unit/test_utils.js +42 -89
- package/lib/test/unit/testreporter.js +17 -6
- package/lib/test/unit/util_spec.js +13 -12
- package/lib/test/unit/writer_spec.js +84 -0
- package/lib/web/annotation_layer_builder.js +13 -9
- package/lib/web/app.js +231 -26
- package/lib/web/app_options.js +1 -6
- package/lib/web/base_tree_viewer.js +100 -0
- package/lib/web/base_viewer.js +53 -4
- package/lib/web/download_manager.js +3 -10
- package/lib/web/firefox_print_service.js +32 -12
- package/lib/web/firefoxcom.js +20 -6
- package/lib/web/interfaces.js +1 -1
- package/lib/web/pdf_attachment_viewer.js +80 -38
- package/lib/web/pdf_find_controller.js +2 -1
- package/lib/web/pdf_layer_viewer.js +208 -0
- package/lib/web/pdf_outline_viewer.js +24 -57
- package/lib/web/pdf_page_view.js +29 -6
- package/lib/web/pdf_print_service.js +13 -11
- package/lib/web/pdf_sidebar.js +46 -25
- package/lib/web/pdf_thumbnail_view.js +16 -3
- package/lib/web/pdf_thumbnail_viewer.js +17 -1
- package/lib/web/pdf_viewer.component.js +2 -2
- package/lib/web/preferences.js +1 -1
- package/lib/web/toolbar.js +1 -1
- package/lib/web/ui_utils.js +7 -1
- package/package.json +3 -1
- package/types/display/annotation_layer.d.ts +61 -0
- package/types/display/annotation_storage.d.ts +36 -0
- package/types/display/api.d.ts +1107 -0
- package/types/display/api_compatibility.d.ts +1 -0
- package/types/display/canvas.d.ts +4 -0
- package/types/display/content_disposition.d.ts +7 -0
- package/types/display/display_utils.d.ts +243 -0
- package/types/display/fetch_stream.d.ts +67 -0
- package/types/display/font_loader.d.ts +19 -0
- package/types/display/metadata.d.ts +9 -0
- package/types/display/network.d.ts +80 -0
- package/types/display/network_utils.d.ts +14 -0
- package/types/display/node_stream.d.ts +72 -0
- package/types/display/node_utils.d.ts +6 -0
- package/types/display/optional_content_config.d.ts +12 -0
- package/types/display/pattern_helper.d.ts +5 -0
- package/types/display/svg.d.ts +2 -0
- package/types/display/text_layer.d.ts +83 -0
- package/types/display/transport_stream.d.ts +57 -0
- package/types/display/webgl.d.ts +20 -0
- package/types/display/worker_options.d.ts +27 -0
- package/types/display/xml_parser.d.ts +35 -0
- package/types/pdf.d.ts +33 -0
- package/types/shared/compatibility.d.ts +1 -0
- package/types/shared/is_node.d.ts +1 -0
- package/types/shared/message_handler.d.ts +62 -0
- package/types/shared/util.d.ts +421 -0
- package/web/images/shadow.png +0 -0
- package/web/pdf_viewer.css +8 -5
- package/web/pdf_viewer.js +109 -33
- package/web/pdf_viewer.js.map +1 -1
- package/webpack.js +1 -9
- package/es5/web/images/texture.png +0 -0
- package/web/images/texture.png +0 -0
package/lib/display/api.js
CHANGED
@@ -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 ||
|
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.
|
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.
|
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 (!
|
550
|
-
|
569
|
+
if (!optionalContentConfigPromise) {
|
570
|
+
optionalContentConfigPromise = this._transport.getOptionalContentConfig();
|
551
571
|
}
|
552
572
|
|
553
|
-
|
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
|
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(
|
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
|
-
|
671
|
-
|
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
|
-
|
797
|
+
continue;
|
764
798
|
}
|
765
799
|
|
766
|
-
intentState.renderTasks
|
767
|
-
|
768
|
-
|
769
|
-
|
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
|
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
|
-
|
792
|
-
|
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.
|
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
|
-
|
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
|
-
|
932
|
-
if (
|
933
|
-
|
934
|
-
|
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
|
-
|
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.
|
2181
|
+
const version = '2.6.347';
|
2096
2182
|
exports.version = version;
|
2097
|
-
const build = '
|
2183
|
+
const build = '3be9c65f';
|
2098
2184
|
exports.build = build;
|