pdfjs-dist 2.1.266 → 2.2.228
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/CODE_OF_CONDUCT.md +15 -0
- package/bower.json +1 -1
- package/build/pdf.js +3349 -2324
- package/build/pdf.js.map +1 -1
- package/build/pdf.min.js +1 -1
- package/build/pdf.worker.js +2804 -1975
- package/build/pdf.worker.js.map +1 -1
- package/build/pdf.worker.min.js +1 -1
- package/image_decoders/pdf.image_decoders.js +431 -511
- 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 +294 -224
- package/lib/core/arithmetic_decoder.js +1 -1
- package/lib/core/bidi.js +1 -1
- package/lib/core/ccitt.js +1 -1
- package/lib/core/ccitt_stream.js +1 -1
- package/lib/core/cff_parser.js +61 -12
- package/lib/core/charsets.js +1 -1
- package/lib/core/chunked_stream.js +24 -14
- package/lib/core/cmap.js +17 -13
- package/lib/core/colorspace.js +1 -1
- package/lib/core/core_utils.js +147 -0
- package/lib/core/crypto.js +1 -1
- package/lib/core/document.js +47 -40
- package/lib/core/encodings.js +1 -1
- package/lib/core/evaluator.js +346 -279
- package/lib/core/font_renderer.js +1 -1
- package/lib/core/fonts.js +23 -11
- package/lib/core/function.js +1 -1
- package/lib/core/glyphlist.js +2 -2
- package/lib/core/image.js +2 -2
- package/lib/core/image_utils.js +111 -0
- package/lib/core/jbig2.js +1 -1
- package/lib/core/jbig2_stream.js +1 -1
- package/lib/core/jpeg_stream.js +1 -1
- package/lib/core/jpg.js +2 -1
- package/lib/core/jpx.js +1 -1
- package/lib/core/jpx_stream.js +1 -1
- package/lib/core/metrics.js +13 -13
- package/lib/core/murmurhash3.js +37 -33
- package/lib/core/obj.js +245 -41
- package/lib/core/operator_list.js +43 -32
- package/lib/core/parser.js +228 -133
- package/lib/core/pattern.js +4 -2
- package/lib/core/pdf_manager.js +17 -15
- package/lib/core/primitives.js +40 -6
- package/lib/core/ps_parser.js +1 -1
- package/lib/core/standard_fonts.js +9 -9
- package/lib/core/stream.js +1 -1
- package/lib/core/type1_parser.js +1 -1
- package/lib/core/unicode.js +2 -2
- package/lib/core/worker.js +54 -171
- package/lib/core/worker_stream.js +277 -0
- package/lib/display/annotation_layer.js +112 -33
- package/lib/display/api.js +211 -123
- package/lib/display/api_compatibility.js +1 -1
- package/lib/display/canvas.js +40 -19
- package/lib/display/content_disposition.js +1 -1
- package/lib/display/display_utils.js +747 -0
- package/lib/display/fetch_stream.js +19 -12
- package/lib/display/font_loader.js +11 -8
- package/lib/display/metadata.js +1 -1
- package/lib/display/network.js +563 -521
- package/lib/display/network_utils.js +1 -1
- package/lib/display/node_stream.js +21 -12
- package/lib/display/pattern_helper.js +24 -25
- package/lib/display/svg.js +1068 -565
- package/lib/display/text_layer.js +24 -14
- package/lib/display/transport_stream.js +192 -70
- package/lib/display/webgl.js +1 -1
- package/lib/display/worker_options.js +1 -1
- package/lib/display/xml_parser.js +1 -1
- package/lib/examples/node/domstubs.js +4 -1
- package/lib/pdf.js +20 -15
- package/lib/pdf.worker.js +3 -3
- package/lib/shared/compatibility.js +6 -6
- package/lib/shared/global_scope.js +1 -1
- package/lib/shared/is_node.js +2 -2
- package/lib/shared/message_handler.js +7 -7
- package/lib/shared/streams_polyfill.js +1 -1
- package/lib/shared/url_polyfill.js +1 -1
- package/lib/shared/util.js +13 -125
- package/lib/test/unit/annotation_spec.js +278 -93
- package/lib/test/unit/api_spec.js +198 -188
- package/lib/test/unit/bidi_spec.js +1 -1
- package/lib/test/unit/cff_parser_spec.js +15 -1
- package/lib/test/unit/clitests_helper.js +3 -3
- package/lib/test/unit/cmap_spec.js +20 -20
- package/lib/test/unit/colorspace_spec.js +17 -12
- package/lib/test/unit/core_utils_spec.js +191 -0
- package/lib/test/unit/crypto_spec.js +1 -1
- package/lib/test/unit/custom_spec.js +8 -8
- package/lib/test/unit/display_svg_spec.js +8 -8
- package/lib/test/unit/display_utils_spec.js +273 -0
- package/lib/test/unit/document_spec.js +7 -12
- package/lib/test/unit/encodings_spec.js +5 -5
- package/lib/test/unit/evaluator_spec.js +8 -10
- package/lib/test/unit/fetch_stream_spec.js +109 -0
- package/lib/test/unit/function_spec.js +1 -1
- package/lib/test/unit/jasmine-boot.js +4 -4
- package/lib/test/unit/message_handler_spec.js +1 -1
- package/lib/test/unit/metadata_spec.js +1 -1
- package/lib/test/unit/murmurhash3_spec.js +1 -1
- package/lib/test/unit/network_spec.js +5 -55
- package/lib/test/unit/network_utils_spec.js +51 -1
- package/lib/test/unit/node_stream_spec.js +8 -8
- package/lib/test/unit/parser_spec.js +150 -86
- package/lib/test/unit/pdf_find_controller_spec.js +1 -1
- package/lib/test/unit/pdf_find_utils_spec.js +1 -1
- package/lib/test/unit/pdf_history_spec.js +1 -1
- package/lib/test/unit/primitives_spec.js +30 -17
- package/lib/test/unit/stream_spec.js +1 -1
- package/lib/test/unit/test_utils.js +197 -43
- package/lib/test/unit/testreporter.js +1 -1
- package/lib/test/unit/type1_parser_spec.js +1 -1
- package/lib/test/unit/ui_utils_spec.js +20 -20
- package/lib/test/unit/unicode_spec.js +5 -5
- package/lib/test/unit/util_spec.js +1 -164
- package/lib/web/annotation_layer_builder.js +1 -1
- package/lib/web/app.js +104 -60
- package/lib/web/app_options.js +45 -37
- package/lib/web/base_viewer.js +7 -7
- package/lib/web/chromecom.js +8 -8
- package/lib/web/debugger.js +7 -7
- package/lib/web/download_manager.js +3 -2
- package/lib/web/firefox_print_service.js +4 -2
- package/lib/web/firefoxcom.js +50 -19
- package/lib/web/genericcom.js +8 -8
- package/lib/web/genericl10n.js +10 -10
- package/lib/web/grab_to_pan.js +3 -1
- package/lib/web/interfaces.js +13 -13
- package/lib/web/overlay_manager.js +10 -10
- package/lib/web/password_prompt.js +2 -2
- package/lib/web/pdf_attachment_viewer.js +1 -1
- package/lib/web/pdf_cursor_tools.js +1 -1
- package/lib/web/pdf_document_properties.js +188 -119
- package/lib/web/pdf_find_bar.js +1 -1
- package/lib/web/pdf_find_controller.js +3 -3
- package/lib/web/pdf_find_utils.js +1 -1
- package/lib/web/pdf_history.js +1 -1
- package/lib/web/pdf_link_service.js +2 -2
- package/lib/web/pdf_outline_viewer.js +53 -28
- package/lib/web/pdf_page_view.js +9 -18
- package/lib/web/pdf_presentation_mode.js +1 -1
- package/lib/web/pdf_print_service.js +5 -3
- package/lib/web/pdf_rendering_queue.js +4 -7
- package/lib/web/pdf_sidebar.js +24 -17
- package/lib/web/pdf_sidebar_resizer.js +1 -1
- package/lib/web/pdf_single_page_viewer.js +1 -1
- package/lib/web/pdf_thumbnail_view.js +2 -2
- package/lib/web/pdf_thumbnail_viewer.js +3 -3
- package/lib/web/pdf_viewer.component.js +3 -3
- package/lib/web/pdf_viewer.js +3 -3
- package/lib/web/preferences.js +30 -30
- package/lib/web/secondary_toolbar.js +1 -1
- package/lib/web/text_layer_builder.js +23 -45
- package/lib/web/toolbar.js +1 -1
- package/lib/web/ui_utils.js +14 -14
- package/lib/web/view_history.js +15 -15
- package/lib/web/viewer_compatibility.js +1 -1
- package/package.json +1 -1
- package/web/pdf_viewer.css +21 -10
- package/web/pdf_viewer.js +126 -194
- package/web/pdf_viewer.js.map +1 -1
- package/lib/display/dom_utils.js +0 -494
- package/lib/test/unit/dom_utils_spec.js +0 -89
@@ -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 2019 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.
|
@@ -25,14 +25,14 @@ var _annotation = require("../../core/annotation");
|
|
25
25
|
|
26
26
|
var _util = require("../../shared/util");
|
27
27
|
|
28
|
+
var _test_utils = require("./test_utils");
|
29
|
+
|
28
30
|
var _primitives = require("../../core/primitives");
|
29
31
|
|
30
32
|
var _parser = require("../../core/parser");
|
31
33
|
|
32
34
|
var _stream = require("../../core/stream");
|
33
35
|
|
34
|
-
var _test_utils = require("./test_utils");
|
35
|
-
|
36
36
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
37
37
|
|
38
38
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
@@ -67,34 +67,12 @@ describe('annotation', function () {
|
|
67
67
|
return PDFManagerMock;
|
68
68
|
}();
|
69
69
|
|
70
|
-
var IdFactoryMock =
|
71
|
-
/*#__PURE__*/
|
72
|
-
function () {
|
73
|
-
function IdFactoryMock(params) {
|
74
|
-
_classCallCheck(this, IdFactoryMock);
|
75
|
-
|
76
|
-
this.uniquePrefix = params.prefix || 'p0_';
|
77
|
-
this.idCounters = {
|
78
|
-
obj: params.startObjId || 0
|
79
|
-
};
|
80
|
-
}
|
81
|
-
|
82
|
-
_createClass(IdFactoryMock, [{
|
83
|
-
key: "createObjId",
|
84
|
-
value: function createObjId() {
|
85
|
-
return this.uniquePrefix + ++this.idCounters.obj;
|
86
|
-
}
|
87
|
-
}]);
|
88
|
-
|
89
|
-
return IdFactoryMock;
|
90
|
-
}();
|
91
|
-
|
92
70
|
var pdfManagerMock, idFactoryMock;
|
93
71
|
beforeAll(function (done) {
|
94
72
|
pdfManagerMock = new PDFManagerMock({
|
95
73
|
docBaseUrl: null
|
96
74
|
});
|
97
|
-
idFactoryMock =
|
75
|
+
idFactoryMock = (0, _test_utils.createIdFactory)(0);
|
98
76
|
done();
|
99
77
|
});
|
100
78
|
afterAll(function () {
|
@@ -106,7 +84,9 @@ describe('annotation', function () {
|
|
106
84
|
var annotationDict = new _primitives.Dict();
|
107
85
|
annotationDict.set('Type', _primitives.Name.get('Annot'));
|
108
86
|
annotationDict.set('Subtype', _primitives.Name.get('Link'));
|
109
|
-
|
87
|
+
|
88
|
+
var annotationRef = _primitives.Ref.get(10, 0);
|
89
|
+
|
110
90
|
var xref = new _test_utils.XRefMock([{
|
111
91
|
ref: annotationRef,
|
112
92
|
data: annotationDict
|
@@ -124,10 +104,7 @@ describe('annotation', function () {
|
|
124
104
|
annotationDict.set('Type', _primitives.Name.get('Annot'));
|
125
105
|
annotationDict.set('Subtype', _primitives.Name.get('Link'));
|
126
106
|
var xref = new _test_utils.XRefMock();
|
127
|
-
var idFactory =
|
128
|
-
prefix: 'p0_',
|
129
|
-
startObjId: 0
|
130
|
-
});
|
107
|
+
var idFactory = (0, _test_utils.createIdFactory)(0);
|
131
108
|
|
132
109
|
var annotation1 = _annotation.AnnotationFactory.create(xref, annotationDict, pdfManagerMock, idFactory).then(function (_ref2) {
|
133
110
|
var data = _ref2.data;
|
@@ -146,7 +123,9 @@ describe('annotation', function () {
|
|
146
123
|
it('should handle missing /Subtype', function (done) {
|
147
124
|
var annotationDict = new _primitives.Dict();
|
148
125
|
annotationDict.set('Type', _primitives.Name.get('Annot'));
|
149
|
-
|
126
|
+
|
127
|
+
var annotationRef = _primitives.Ref.get(1, 0);
|
128
|
+
|
150
129
|
var xref = new _test_utils.XRefMock([{
|
151
130
|
ref: annotationRef,
|
152
131
|
data: annotationDict
|
@@ -163,12 +142,44 @@ describe('annotation', function () {
|
|
163
142
|
var dict, ref;
|
164
143
|
beforeAll(function (done) {
|
165
144
|
dict = new _primitives.Dict();
|
166
|
-
ref =
|
145
|
+
ref = _primitives.Ref.get(1, 0);
|
167
146
|
done();
|
168
147
|
});
|
169
148
|
afterAll(function () {
|
170
149
|
dict = ref = null;
|
171
150
|
});
|
151
|
+
it('should set and get valid contents', function () {
|
152
|
+
var annotation = new _annotation.Annotation({
|
153
|
+
dict: dict,
|
154
|
+
ref: ref
|
155
|
+
});
|
156
|
+
annotation.setContents('Foo bar baz');
|
157
|
+
expect(annotation.contents).toEqual('Foo bar baz');
|
158
|
+
});
|
159
|
+
it('should not set and get invalid contents', function () {
|
160
|
+
var annotation = new _annotation.Annotation({
|
161
|
+
dict: dict,
|
162
|
+
ref: ref
|
163
|
+
});
|
164
|
+
annotation.setContents(undefined);
|
165
|
+
expect(annotation.contents).toEqual('');
|
166
|
+
});
|
167
|
+
it('should set and get a valid modification date', function () {
|
168
|
+
var annotation = new _annotation.Annotation({
|
169
|
+
dict: dict,
|
170
|
+
ref: ref
|
171
|
+
});
|
172
|
+
annotation.setModificationDate('D:20190422');
|
173
|
+
expect(annotation.modificationDate).toEqual('D:20190422');
|
174
|
+
});
|
175
|
+
it('should not set and get an invalid modification date', function () {
|
176
|
+
var annotation = new _annotation.Annotation({
|
177
|
+
dict: dict,
|
178
|
+
ref: ref
|
179
|
+
});
|
180
|
+
annotation.setModificationDate(undefined);
|
181
|
+
expect(annotation.modificationDate).toEqual(null);
|
182
|
+
});
|
172
183
|
it('should set and get flags', function () {
|
173
184
|
var annotation = new _annotation.Annotation({
|
174
185
|
dict: dict,
|
@@ -313,6 +324,33 @@ describe('annotation', function () {
|
|
313
324
|
expect(borderStyle.verticalCornerRadius).toEqual(0);
|
314
325
|
});
|
315
326
|
});
|
327
|
+
describe('MarkupAnnotation', function () {
|
328
|
+
var dict, ref;
|
329
|
+
beforeAll(function (done) {
|
330
|
+
dict = new _primitives.Dict();
|
331
|
+
ref = _primitives.Ref.get(1, 0);
|
332
|
+
done();
|
333
|
+
});
|
334
|
+
afterAll(function () {
|
335
|
+
dict = ref = null;
|
336
|
+
});
|
337
|
+
it('should set and get a valid creation date', function () {
|
338
|
+
var markupAnnotation = new _annotation.MarkupAnnotation({
|
339
|
+
dict: dict,
|
340
|
+
ref: ref
|
341
|
+
});
|
342
|
+
markupAnnotation.setCreationDate('D:20190422');
|
343
|
+
expect(markupAnnotation.creationDate).toEqual('D:20190422');
|
344
|
+
});
|
345
|
+
it('should not set and get an invalid creation date', function () {
|
346
|
+
var markupAnnotation = new _annotation.MarkupAnnotation({
|
347
|
+
dict: dict,
|
348
|
+
ref: ref
|
349
|
+
});
|
350
|
+
markupAnnotation.setCreationDate(undefined);
|
351
|
+
expect(markupAnnotation.creationDate).toEqual(null);
|
352
|
+
});
|
353
|
+
});
|
316
354
|
describe('LinkAnnotation', function () {
|
317
355
|
it('should correctly parse a URI action', function (done) {
|
318
356
|
var actionDict = new _primitives.Dict();
|
@@ -323,7 +361,9 @@ describe('annotation', function () {
|
|
323
361
|
annotationDict.set('Type', _primitives.Name.get('Annot'));
|
324
362
|
annotationDict.set('Subtype', _primitives.Name.get('Link'));
|
325
363
|
annotationDict.set('A', actionDict);
|
326
|
-
|
364
|
+
|
365
|
+
var annotationRef = _primitives.Ref.get(820, 0);
|
366
|
+
|
327
367
|
var xref = new _test_utils.XRefMock([{
|
328
368
|
ref: annotationRef,
|
329
369
|
data: annotationDict
|
@@ -347,7 +387,9 @@ describe('annotation', function () {
|
|
347
387
|
annotationDict.set('Type', _primitives.Name.get('Annot'));
|
348
388
|
annotationDict.set('Subtype', _primitives.Name.get('Link'));
|
349
389
|
annotationDict.set('A', actionDict);
|
350
|
-
|
390
|
+
|
391
|
+
var annotationRef = _primitives.Ref.get(353, 0);
|
392
|
+
|
351
393
|
var xref = new _test_utils.XRefMock([{
|
352
394
|
ref: annotationRef,
|
353
395
|
data: annotationDict
|
@@ -364,14 +406,18 @@ describe('annotation', function () {
|
|
364
406
|
});
|
365
407
|
it('should correctly parse a URI action, where the URI entry ' + 'has an incorrect encoding (bug 1122280)', function (done) {
|
366
408
|
var actionStream = new _stream.StringStream('<<\n' + '/Type /Action\n' + '/S /URI\n' + '/URI (http://www.example.com/\\303\\274\\303\\266\\303\\244)\n' + '>>\n');
|
367
|
-
var
|
368
|
-
|
409
|
+
var parser = new _parser.Parser({
|
410
|
+
lexer: new _parser.Lexer(actionStream),
|
411
|
+
xref: null
|
412
|
+
});
|
369
413
|
var actionDict = parser.getObj();
|
370
414
|
var annotationDict = new _primitives.Dict();
|
371
415
|
annotationDict.set('Type', _primitives.Name.get('Annot'));
|
372
416
|
annotationDict.set('Subtype', _primitives.Name.get('Link'));
|
373
417
|
annotationDict.set('A', actionDict);
|
374
|
-
|
418
|
+
|
419
|
+
var annotationRef = _primitives.Ref.get(8, 0);
|
420
|
+
|
375
421
|
var xref = new _test_utils.XRefMock([{
|
376
422
|
ref: annotationRef,
|
377
423
|
data: annotationDict
|
@@ -395,7 +441,9 @@ describe('annotation', function () {
|
|
395
441
|
annotationDict.set('Type', _primitives.Name.get('Annot'));
|
396
442
|
annotationDict.set('Subtype', _primitives.Name.get('Link'));
|
397
443
|
annotationDict.set('A', actionDict);
|
398
|
-
|
444
|
+
|
445
|
+
var annotationRef = _primitives.Ref.get(798, 0);
|
446
|
+
|
399
447
|
var xref = new _test_utils.XRefMock([{
|
400
448
|
ref: annotationRef,
|
401
449
|
data: annotationDict
|
@@ -421,7 +469,9 @@ describe('annotation', function () {
|
|
421
469
|
annotationDict.set('Type', _primitives.Name.get('Annot'));
|
422
470
|
annotationDict.set('Subtype', _primitives.Name.get('Link'));
|
423
471
|
annotationDict.set('A', actionDict);
|
424
|
-
|
472
|
+
|
473
|
+
var annotationRef = _primitives.Ref.get(489, 0);
|
474
|
+
|
425
475
|
var xref = new _test_utils.XRefMock([{
|
426
476
|
ref: annotationRef,
|
427
477
|
data: annotationDict
|
@@ -447,7 +497,9 @@ describe('annotation', function () {
|
|
447
497
|
annotationDict.set('Type', _primitives.Name.get('Annot'));
|
448
498
|
annotationDict.set('Subtype', _primitives.Name.get('Link'));
|
449
499
|
annotationDict.set('A', actionDict);
|
450
|
-
|
500
|
+
|
501
|
+
var annotationRef = _primitives.Ref.get(489, 0);
|
502
|
+
|
451
503
|
var xref = new _test_utils.XRefMock([{
|
452
504
|
ref: annotationRef,
|
453
505
|
data: annotationDict
|
@@ -475,7 +527,9 @@ describe('annotation', function () {
|
|
475
527
|
annotationDict.set('Type', _primitives.Name.get('Annot'));
|
476
528
|
annotationDict.set('Subtype', _primitives.Name.get('Link'));
|
477
529
|
annotationDict.set('A', actionDict);
|
478
|
-
|
530
|
+
|
531
|
+
var annotationRef = _primitives.Ref.get(495, 0);
|
532
|
+
|
479
533
|
var xref = new _test_utils.XRefMock([{
|
480
534
|
ref: annotationRef,
|
481
535
|
data: annotationDict
|
@@ -501,7 +555,9 @@ describe('annotation', function () {
|
|
501
555
|
annotationDict.set('Type', _primitives.Name.get('Annot'));
|
502
556
|
annotationDict.set('Subtype', _primitives.Name.get('Link'));
|
503
557
|
annotationDict.set('A', actionDict);
|
504
|
-
|
558
|
+
|
559
|
+
var annotationRef = _primitives.Ref.get(489, 0);
|
560
|
+
|
505
561
|
var xref = new _test_utils.XRefMock([{
|
506
562
|
ref: annotationRef,
|
507
563
|
data: annotationDict
|
@@ -531,7 +587,9 @@ describe('annotation', function () {
|
|
531
587
|
annotationDict.set('Type', _primitives.Name.get('Annot'));
|
532
588
|
annotationDict.set('Subtype', _primitives.Name.get('Link'));
|
533
589
|
annotationDict.set('A', actionDict);
|
534
|
-
|
590
|
+
|
591
|
+
var annotationRef = _primitives.Ref.get(88, 0);
|
592
|
+
|
535
593
|
var xref = new _test_utils.XRefMock([{
|
536
594
|
ref: annotationRef,
|
537
595
|
data: annotationDict
|
@@ -564,7 +622,9 @@ describe('annotation', function () {
|
|
564
622
|
annotationDict.set('Type', _primitives.Name.get('Annot'));
|
565
623
|
annotationDict.set('Subtype', _primitives.Name.get('Link'));
|
566
624
|
annotationDict.set('A', actionDict);
|
567
|
-
|
625
|
+
|
626
|
+
var annotationRef = _primitives.Ref.get(46, 0);
|
627
|
+
|
568
628
|
var xref = new _test_utils.XRefMock([{
|
569
629
|
ref: annotationRef,
|
570
630
|
data: annotationDict
|
@@ -608,7 +668,9 @@ describe('annotation', function () {
|
|
608
668
|
annotationDict.set('Type', _primitives.Name.get('Annot'));
|
609
669
|
annotationDict.set('Subtype', _primitives.Name.get('Link'));
|
610
670
|
annotationDict.set('A', actionDict);
|
611
|
-
|
671
|
+
|
672
|
+
var annotationRef = _primitives.Ref.get(12, 0);
|
673
|
+
|
612
674
|
var xref = new _test_utils.XRefMock([{
|
613
675
|
ref: annotationRef,
|
614
676
|
data: annotationDict
|
@@ -628,7 +690,9 @@ describe('annotation', function () {
|
|
628
690
|
annotationDict.set('Type', _primitives.Name.get('Annot'));
|
629
691
|
annotationDict.set('Subtype', _primitives.Name.get('Link'));
|
630
692
|
annotationDict.set('Dest', _primitives.Name.get('LI0'));
|
631
|
-
|
693
|
+
|
694
|
+
var annotationRef = _primitives.Ref.get(583, 0);
|
695
|
+
|
632
696
|
var xref = new _test_utils.XRefMock([{
|
633
697
|
ref: annotationRef,
|
634
698
|
data: annotationDict
|
@@ -647,8 +711,10 @@ describe('annotation', function () {
|
|
647
711
|
var annotationDict = new _primitives.Dict();
|
648
712
|
annotationDict.set('Type', _primitives.Name.get('Annot'));
|
649
713
|
annotationDict.set('Subtype', _primitives.Name.get('Link'));
|
650
|
-
annotationDict.set('Dest', [
|
651
|
-
|
714
|
+
annotationDict.set('Dest', [_primitives.Ref.get(17, 0), _primitives.Name.get('XYZ'), 0, 841.89, null]);
|
715
|
+
|
716
|
+
var annotationRef = _primitives.Ref.get(10, 0);
|
717
|
+
|
652
718
|
var xref = new _test_utils.XRefMock([{
|
653
719
|
ref: annotationRef,
|
654
720
|
data: annotationDict
|
@@ -677,7 +743,9 @@ describe('annotation', function () {
|
|
677
743
|
annotationDict.set('Type', _primitives.Name.get('Annot'));
|
678
744
|
annotationDict.set('Subtype', _primitives.Name.get('Link'));
|
679
745
|
annotationDict.set('Dest', destDict);
|
680
|
-
|
746
|
+
|
747
|
+
var annotationRef = _primitives.Ref.get(798, 0);
|
748
|
+
|
681
749
|
var xref = new _test_utils.XRefMock([{
|
682
750
|
ref: annotationRef,
|
683
751
|
data: annotationDict
|
@@ -705,7 +773,8 @@ describe('annotation', function () {
|
|
705
773
|
widgetDict = null;
|
706
774
|
});
|
707
775
|
it('should handle unknown field names', function (done) {
|
708
|
-
var widgetRef =
|
776
|
+
var widgetRef = _primitives.Ref.get(20, 0);
|
777
|
+
|
709
778
|
var xref = new _test_utils.XRefMock([{
|
710
779
|
ref: widgetRef,
|
711
780
|
data: widgetDict
|
@@ -720,7 +789,9 @@ describe('annotation', function () {
|
|
720
789
|
});
|
721
790
|
it('should construct the field name when there are no ancestors', function (done) {
|
722
791
|
widgetDict.set('T', 'foo');
|
723
|
-
|
792
|
+
|
793
|
+
var widgetRef = _primitives.Ref.get(21, 0);
|
794
|
+
|
724
795
|
var xref = new _test_utils.XRefMock([{
|
725
796
|
ref: widgetRef,
|
726
797
|
data: widgetDict
|
@@ -741,7 +812,9 @@ describe('annotation', function () {
|
|
741
812
|
secondParent.set('T', 'bar');
|
742
813
|
widgetDict.set('Parent', secondParent);
|
743
814
|
widgetDict.set('T', 'baz');
|
744
|
-
|
815
|
+
|
816
|
+
var widgetRef = _primitives.Ref.get(22, 0);
|
817
|
+
|
745
818
|
var xref = new _test_utils.XRefMock([{
|
746
819
|
ref: widgetRef,
|
747
820
|
data: widgetDict
|
@@ -760,7 +833,9 @@ describe('annotation', function () {
|
|
760
833
|
parentDict.set('T', 'foo');
|
761
834
|
widgetDict.set('Parent', parentDict);
|
762
835
|
widgetDict.set('T', 'bar');
|
763
|
-
|
836
|
+
|
837
|
+
var widgetRef = _primitives.Ref.get(22, 0);
|
838
|
+
|
764
839
|
var xref = new _test_utils.XRefMock([{
|
765
840
|
ref: widgetRef,
|
766
841
|
data: widgetDict
|
@@ -787,7 +862,8 @@ describe('annotation', function () {
|
|
787
862
|
textWidgetDict = null;
|
788
863
|
});
|
789
864
|
it('should handle unknown text alignment, maximum length and flags', function (done) {
|
790
|
-
var textWidgetRef =
|
865
|
+
var textWidgetRef = _primitives.Ref.get(124, 0);
|
866
|
+
|
791
867
|
var xref = new _test_utils.XRefMock([{
|
792
868
|
ref: textWidgetRef,
|
793
869
|
data: textWidgetDict
|
@@ -808,7 +884,9 @@ describe('annotation', function () {
|
|
808
884
|
textWidgetDict.set('Q', 'center');
|
809
885
|
textWidgetDict.set('MaxLen', 'five');
|
810
886
|
textWidgetDict.set('Ff', 'readonly');
|
811
|
-
|
887
|
+
|
888
|
+
var textWidgetRef = _primitives.Ref.get(43, 0);
|
889
|
+
|
812
890
|
var xref = new _test_utils.XRefMock([{
|
813
891
|
ref: textWidgetRef,
|
814
892
|
data: textWidgetDict
|
@@ -829,7 +907,9 @@ describe('annotation', function () {
|
|
829
907
|
textWidgetDict.set('Q', 1);
|
830
908
|
textWidgetDict.set('MaxLen', 20);
|
831
909
|
textWidgetDict.set('Ff', _util.AnnotationFieldFlag.READONLY + _util.AnnotationFieldFlag.MULTILINE);
|
832
|
-
|
910
|
+
|
911
|
+
var textWidgetRef = _primitives.Ref.get(84, 0);
|
912
|
+
|
833
913
|
var xref = new _test_utils.XRefMock([{
|
834
914
|
ref: textWidgetRef,
|
835
915
|
data: textWidgetDict
|
@@ -847,7 +927,9 @@ describe('annotation', function () {
|
|
847
927
|
});
|
848
928
|
it('should reject comb fields without a maximum length', function (done) {
|
849
929
|
textWidgetDict.set('Ff', _util.AnnotationFieldFlag.COMB);
|
850
|
-
|
930
|
+
|
931
|
+
var textWidgetRef = _primitives.Ref.get(46, 0);
|
932
|
+
|
851
933
|
var xref = new _test_utils.XRefMock([{
|
852
934
|
ref: textWidgetRef,
|
853
935
|
data: textWidgetDict
|
@@ -863,7 +945,9 @@ describe('annotation', function () {
|
|
863
945
|
it('should accept comb fields with a maximum length', function (done) {
|
864
946
|
textWidgetDict.set('MaxLen', 20);
|
865
947
|
textWidgetDict.set('Ff', _util.AnnotationFieldFlag.COMB);
|
866
|
-
|
948
|
+
|
949
|
+
var textWidgetRef = _primitives.Ref.get(46, 0);
|
950
|
+
|
867
951
|
var xref = new _test_utils.XRefMock([{
|
868
952
|
ref: textWidgetRef,
|
869
953
|
data: textWidgetDict
|
@@ -885,7 +969,9 @@ describe('annotation', function () {
|
|
885
969
|
promise = promise.then(function () {
|
886
970
|
textWidgetDict.set('MaxLen', 20);
|
887
971
|
textWidgetDict.set('Ff', flags);
|
888
|
-
|
972
|
+
|
973
|
+
var textWidgetRef = _primitives.Ref.get(93, 0);
|
974
|
+
|
889
975
|
var xref = new _test_utils.XRefMock([{
|
890
976
|
ref: textWidgetRef,
|
891
977
|
data: textWidgetDict
|
@@ -926,7 +1012,9 @@ describe('annotation', function () {
|
|
926
1012
|
exportValueOptionsDict.set('Checked', 1);
|
927
1013
|
appearanceStatesDict.set('D', exportValueOptionsDict);
|
928
1014
|
buttonWidgetDict.set('AP', appearanceStatesDict);
|
929
|
-
|
1015
|
+
|
1016
|
+
var buttonWidgetRef = _primitives.Ref.get(124, 0);
|
1017
|
+
|
930
1018
|
var xref = new _test_utils.XRefMock([{
|
931
1019
|
ref: buttonWidgetRef,
|
932
1020
|
data: buttonWidgetDict
|
@@ -944,7 +1032,9 @@ describe('annotation', function () {
|
|
944
1032
|
});
|
945
1033
|
it('should handle checkboxes without export value', function (done) {
|
946
1034
|
buttonWidgetDict.set('V', _primitives.Name.get('1'));
|
947
|
-
|
1035
|
+
|
1036
|
+
var buttonWidgetRef = _primitives.Ref.get(124, 0);
|
1037
|
+
|
948
1038
|
var xref = new _test_utils.XRefMock([{
|
949
1039
|
ref: buttonWidgetRef,
|
950
1040
|
data: buttonWidgetDict
|
@@ -969,7 +1059,9 @@ describe('annotation', function () {
|
|
969
1059
|
buttonWidgetDict.set('Ff', _util.AnnotationFieldFlag.RADIO);
|
970
1060
|
buttonWidgetDict.set('Parent', parentDict);
|
971
1061
|
buttonWidgetDict.set('AP', appearanceStatesDict);
|
972
|
-
|
1062
|
+
|
1063
|
+
var buttonWidgetRef = _primitives.Ref.get(124, 0);
|
1064
|
+
|
973
1065
|
var xref = new _test_utils.XRefMock([{
|
974
1066
|
ref: buttonWidgetRef,
|
975
1067
|
data: buttonWidgetDict
|
@@ -992,7 +1084,9 @@ describe('annotation', function () {
|
|
992
1084
|
appearanceStatesDict.set('N', normalAppearanceStateDict);
|
993
1085
|
buttonWidgetDict.set('Ff', _util.AnnotationFieldFlag.RADIO);
|
994
1086
|
buttonWidgetDict.set('AP', appearanceStatesDict);
|
995
|
-
|
1087
|
+
|
1088
|
+
var buttonWidgetRef = _primitives.Ref.get(124, 0);
|
1089
|
+
|
996
1090
|
var xref = new _test_utils.XRefMock([{
|
997
1091
|
ref: buttonWidgetRef,
|
998
1092
|
data: buttonWidgetDict
|
@@ -1022,7 +1116,8 @@ describe('annotation', function () {
|
|
1022
1116
|
choiceWidgetDict = null;
|
1023
1117
|
});
|
1024
1118
|
it('should handle missing option arrays', function (done) {
|
1025
|
-
var choiceWidgetRef =
|
1119
|
+
var choiceWidgetRef = _primitives.Ref.get(122, 0);
|
1120
|
+
|
1026
1121
|
var xref = new _test_utils.XRefMock([{
|
1027
1122
|
ref: choiceWidgetRef,
|
1028
1123
|
data: choiceWidgetDict
|
@@ -1036,9 +1131,12 @@ describe('annotation', function () {
|
|
1036
1131
|
}, done.fail);
|
1037
1132
|
});
|
1038
1133
|
it('should handle option arrays with array elements', function (done) {
|
1039
|
-
var optionBarRef =
|
1134
|
+
var optionBarRef = _primitives.Ref.get(20, 0);
|
1135
|
+
|
1040
1136
|
var optionBarStr = 'Bar';
|
1041
|
-
|
1137
|
+
|
1138
|
+
var optionOneRef = _primitives.Ref.get(10, 0);
|
1139
|
+
|
1042
1140
|
var optionOneArr = ['bar_export', optionBarRef];
|
1043
1141
|
var options = [['foo_export', 'Foo'], optionOneRef];
|
1044
1142
|
var expected = [{
|
@@ -1049,7 +1147,9 @@ describe('annotation', function () {
|
|
1049
1147
|
displayValue: 'Bar'
|
1050
1148
|
}];
|
1051
1149
|
choiceWidgetDict.set('Opt', options);
|
1052
|
-
|
1150
|
+
|
1151
|
+
var choiceWidgetRef = _primitives.Ref.get(123, 0);
|
1152
|
+
|
1053
1153
|
var xref = new _test_utils.XRefMock([{
|
1054
1154
|
ref: choiceWidgetRef,
|
1055
1155
|
data: choiceWidgetDict
|
@@ -1069,7 +1169,8 @@ describe('annotation', function () {
|
|
1069
1169
|
}, done.fail);
|
1070
1170
|
});
|
1071
1171
|
it('should handle option arrays with string elements', function (done) {
|
1072
|
-
var optionBarRef =
|
1172
|
+
var optionBarRef = _primitives.Ref.get(10, 0);
|
1173
|
+
|
1073
1174
|
var optionBarStr = 'Bar';
|
1074
1175
|
var options = ['Foo', optionBarRef];
|
1075
1176
|
var expected = [{
|
@@ -1080,7 +1181,9 @@ describe('annotation', function () {
|
|
1080
1181
|
displayValue: 'Bar'
|
1081
1182
|
}];
|
1082
1183
|
choiceWidgetDict.set('Opt', options);
|
1083
|
-
|
1184
|
+
|
1185
|
+
var choiceWidgetRef = _primitives.Ref.get(981, 0);
|
1186
|
+
|
1084
1187
|
var xref = new _test_utils.XRefMock([{
|
1085
1188
|
ref: choiceWidgetRef,
|
1086
1189
|
data: choiceWidgetDict
|
@@ -1108,7 +1211,9 @@ describe('annotation', function () {
|
|
1108
1211
|
var parentDict = new _primitives.Dict();
|
1109
1212
|
parentDict.set('Opt', options);
|
1110
1213
|
choiceWidgetDict.set('Parent', parentDict);
|
1111
|
-
|
1214
|
+
|
1215
|
+
var choiceWidgetRef = _primitives.Ref.get(123, 0);
|
1216
|
+
|
1112
1217
|
var xref = new _test_utils.XRefMock([{
|
1113
1218
|
ref: choiceWidgetRef,
|
1114
1219
|
data: choiceWidgetDict
|
@@ -1128,7 +1233,9 @@ describe('annotation', function () {
|
|
1128
1233
|
displayValue: 'Foo'
|
1129
1234
|
}];
|
1130
1235
|
choiceWidgetDict.set('Opt', options);
|
1131
|
-
|
1236
|
+
|
1237
|
+
var choiceWidgetRef = _primitives.Ref.get(984, 0);
|
1238
|
+
|
1132
1239
|
var xref = new _test_utils.XRefMock([{
|
1133
1240
|
ref: choiceWidgetRef,
|
1134
1241
|
data: choiceWidgetDict
|
@@ -1144,7 +1251,9 @@ describe('annotation', function () {
|
|
1144
1251
|
it('should handle array field values', function (done) {
|
1145
1252
|
var fieldValue = ['Foo', 'Bar'];
|
1146
1253
|
choiceWidgetDict.set('V', fieldValue);
|
1147
|
-
|
1254
|
+
|
1255
|
+
var choiceWidgetRef = _primitives.Ref.get(968, 0);
|
1256
|
+
|
1148
1257
|
var xref = new _test_utils.XRefMock([{
|
1149
1258
|
ref: choiceWidgetRef,
|
1150
1259
|
data: choiceWidgetDict
|
@@ -1160,7 +1269,9 @@ describe('annotation', function () {
|
|
1160
1269
|
it('should handle string field values', function (done) {
|
1161
1270
|
var fieldValue = 'Foo';
|
1162
1271
|
choiceWidgetDict.set('V', fieldValue);
|
1163
|
-
|
1272
|
+
|
1273
|
+
var choiceWidgetRef = _primitives.Ref.get(978, 0);
|
1274
|
+
|
1164
1275
|
var xref = new _test_utils.XRefMock([{
|
1165
1276
|
ref: choiceWidgetRef,
|
1166
1277
|
data: choiceWidgetDict
|
@@ -1174,7 +1285,8 @@ describe('annotation', function () {
|
|
1174
1285
|
}, done.fail);
|
1175
1286
|
});
|
1176
1287
|
it('should handle unknown flags', function (done) {
|
1177
|
-
var choiceWidgetRef =
|
1288
|
+
var choiceWidgetRef = _primitives.Ref.get(166, 0);
|
1289
|
+
|
1178
1290
|
var xref = new _test_utils.XRefMock([{
|
1179
1291
|
ref: choiceWidgetRef,
|
1180
1292
|
data: choiceWidgetDict
|
@@ -1191,7 +1303,9 @@ describe('annotation', function () {
|
|
1191
1303
|
});
|
1192
1304
|
it('should not set invalid flags', function (done) {
|
1193
1305
|
choiceWidgetDict.set('Ff', 'readonly');
|
1194
|
-
|
1306
|
+
|
1307
|
+
var choiceWidgetRef = _primitives.Ref.get(165, 0);
|
1308
|
+
|
1195
1309
|
var xref = new _test_utils.XRefMock([{
|
1196
1310
|
ref: choiceWidgetRef,
|
1197
1311
|
data: choiceWidgetDict
|
@@ -1208,7 +1322,9 @@ describe('annotation', function () {
|
|
1208
1322
|
});
|
1209
1323
|
it('should set valid flags', function (done) {
|
1210
1324
|
choiceWidgetDict.set('Ff', _util.AnnotationFieldFlag.READONLY + _util.AnnotationFieldFlag.COMBO + _util.AnnotationFieldFlag.MULTISELECT);
|
1211
|
-
|
1325
|
+
|
1326
|
+
var choiceWidgetRef = _primitives.Ref.get(512, 0);
|
1327
|
+
|
1212
1328
|
var xref = new _test_utils.XRefMock([{
|
1213
1329
|
ref: choiceWidgetRef,
|
1214
1330
|
data: choiceWidgetDict
|
@@ -1230,7 +1346,9 @@ describe('annotation', function () {
|
|
1230
1346
|
lineDict.set('Type', _primitives.Name.get('Annot'));
|
1231
1347
|
lineDict.set('Subtype', _primitives.Name.get('Line'));
|
1232
1348
|
lineDict.set('L', [1, 2, 3, 4]);
|
1233
|
-
|
1349
|
+
|
1350
|
+
var lineRef = _primitives.Ref.get(122, 0);
|
1351
|
+
|
1234
1352
|
var xref = new _test_utils.XRefMock([{
|
1235
1353
|
ref: lineRef,
|
1236
1354
|
data: lineDict
|
@@ -1247,19 +1365,28 @@ describe('annotation', function () {
|
|
1247
1365
|
describe('FileAttachmentAnnotation', function () {
|
1248
1366
|
it('should correctly parse a file attachment', function (done) {
|
1249
1367
|
var fileStream = new _stream.StringStream('<<\n' + '/Type /EmbeddedFile\n' + '/Subtype /text#2Fplain\n' + '>>\n' + 'stream\n' + 'Test attachment' + 'endstream\n');
|
1250
|
-
var
|
1251
|
-
|
1252
|
-
|
1368
|
+
var parser = new _parser.Parser({
|
1369
|
+
lexer: new _parser.Lexer(fileStream),
|
1370
|
+
xref: null,
|
1371
|
+
allowStreams: true
|
1372
|
+
});
|
1373
|
+
|
1374
|
+
var fileStreamRef = _primitives.Ref.get(18, 0);
|
1375
|
+
|
1253
1376
|
var fileStreamDict = parser.getObj();
|
1254
1377
|
var embeddedFileDict = new _primitives.Dict();
|
1255
1378
|
embeddedFileDict.set('F', fileStreamRef);
|
1256
|
-
|
1379
|
+
|
1380
|
+
var fileSpecRef = _primitives.Ref.get(19, 0);
|
1381
|
+
|
1257
1382
|
var fileSpecDict = new _primitives.Dict();
|
1258
1383
|
fileSpecDict.set('Type', _primitives.Name.get('Filespec'));
|
1259
1384
|
fileSpecDict.set('Desc', '');
|
1260
1385
|
fileSpecDict.set('EF', embeddedFileDict);
|
1261
1386
|
fileSpecDict.set('UF', 'Test.txt');
|
1262
|
-
|
1387
|
+
|
1388
|
+
var fileAttachmentRef = _primitives.Ref.get(20, 0);
|
1389
|
+
|
1263
1390
|
var fileAttachmentDict = new _primitives.Dict();
|
1264
1391
|
fileAttachmentDict.set('Type', _primitives.Name.get('Annot'));
|
1265
1392
|
fileAttachmentDict.set('Subtype', _primitives.Name.get('FileAttachment'));
|
@@ -1290,17 +1417,19 @@ describe('annotation', function () {
|
|
1290
1417
|
});
|
1291
1418
|
});
|
1292
1419
|
describe('PopupAnnotation', function () {
|
1293
|
-
it('should inherit
|
1420
|
+
it('should inherit properties from its parent', function (done) {
|
1294
1421
|
var parentDict = new _primitives.Dict();
|
1295
1422
|
parentDict.set('Type', _primitives.Name.get('Annot'));
|
1296
1423
|
parentDict.set('Subtype', _primitives.Name.get('Text'));
|
1297
|
-
parentDict.set('
|
1424
|
+
parentDict.set('M', 'D:20190423');
|
1425
|
+
parentDict.set('C', [0, 0, 1]);
|
1298
1426
|
var popupDict = new _primitives.Dict();
|
1299
1427
|
popupDict.set('Type', _primitives.Name.get('Annot'));
|
1300
1428
|
popupDict.set('Subtype', _primitives.Name.get('Popup'));
|
1301
|
-
popupDict.set('F', 25);
|
1302
1429
|
popupDict.set('Parent', parentDict);
|
1303
|
-
|
1430
|
+
|
1431
|
+
var popupRef = _primitives.Ref.get(13, 0);
|
1432
|
+
|
1304
1433
|
var xref = new _test_utils.XRefMock([{
|
1305
1434
|
ref: popupRef,
|
1306
1435
|
data: popupDict
|
@@ -1310,6 +1439,58 @@ describe('annotation', function () {
|
|
1310
1439
|
var data = _ref45.data,
|
1311
1440
|
viewable = _ref45.viewable;
|
1312
1441
|
expect(data.annotationType).toEqual(_util.AnnotationType.POPUP);
|
1442
|
+
expect(data.modificationDate).toEqual('D:20190423');
|
1443
|
+
expect(data.color).toEqual(new Uint8ClampedArray([0, 0, 255]));
|
1444
|
+
done();
|
1445
|
+
}, done.fail);
|
1446
|
+
});
|
1447
|
+
it('should handle missing parent properties', function (done) {
|
1448
|
+
var parentDict = new _primitives.Dict();
|
1449
|
+
parentDict.set('Type', _primitives.Name.get('Annot'));
|
1450
|
+
parentDict.set('Subtype', _primitives.Name.get('Text'));
|
1451
|
+
var popupDict = new _primitives.Dict();
|
1452
|
+
popupDict.set('Type', _primitives.Name.get('Annot'));
|
1453
|
+
popupDict.set('Subtype', _primitives.Name.get('Popup'));
|
1454
|
+
popupDict.set('Parent', parentDict);
|
1455
|
+
|
1456
|
+
var popupRef = _primitives.Ref.get(13, 0);
|
1457
|
+
|
1458
|
+
var xref = new _test_utils.XRefMock([{
|
1459
|
+
ref: popupRef,
|
1460
|
+
data: popupDict
|
1461
|
+
}]);
|
1462
|
+
|
1463
|
+
_annotation.AnnotationFactory.create(xref, popupRef, pdfManagerMock, idFactoryMock).then(function (_ref46) {
|
1464
|
+
var data = _ref46.data,
|
1465
|
+
viewable = _ref46.viewable;
|
1466
|
+
expect(data.annotationType).toEqual(_util.AnnotationType.POPUP);
|
1467
|
+
expect(data.modificationDate).toEqual(null);
|
1468
|
+
expect(data.color).toEqual(null);
|
1469
|
+
done();
|
1470
|
+
}, done.fail);
|
1471
|
+
});
|
1472
|
+
it('should inherit the parent flags when the Popup is not viewable, ' + 'but the parent is (PR 7352)', function (done) {
|
1473
|
+
var parentDict = new _primitives.Dict();
|
1474
|
+
parentDict.set('Type', _primitives.Name.get('Annot'));
|
1475
|
+
parentDict.set('Subtype', _primitives.Name.get('Text'));
|
1476
|
+
parentDict.set('F', 28);
|
1477
|
+
var popupDict = new _primitives.Dict();
|
1478
|
+
popupDict.set('Type', _primitives.Name.get('Annot'));
|
1479
|
+
popupDict.set('Subtype', _primitives.Name.get('Popup'));
|
1480
|
+
popupDict.set('F', 25);
|
1481
|
+
popupDict.set('Parent', parentDict);
|
1482
|
+
|
1483
|
+
var popupRef = _primitives.Ref.get(13, 0);
|
1484
|
+
|
1485
|
+
var xref = new _test_utils.XRefMock([{
|
1486
|
+
ref: popupRef,
|
1487
|
+
data: popupDict
|
1488
|
+
}]);
|
1489
|
+
|
1490
|
+
_annotation.AnnotationFactory.create(xref, popupRef, pdfManagerMock, idFactoryMock).then(function (_ref47) {
|
1491
|
+
var data = _ref47.data,
|
1492
|
+
viewable = _ref47.viewable;
|
1493
|
+
expect(data.annotationType).toEqual(_util.AnnotationType.POPUP);
|
1313
1494
|
expect(data.annotationFlags).toEqual(25);
|
1314
1495
|
expect(viewable).toEqual(true);
|
1315
1496
|
done();
|
@@ -1322,14 +1503,16 @@ describe('annotation', function () {
|
|
1322
1503
|
inkDict.set('Type', _primitives.Name.get('Annot'));
|
1323
1504
|
inkDict.set('Subtype', _primitives.Name.get('Ink'));
|
1324
1505
|
inkDict.set('InkList', [[1, 1, 1, 2, 2, 2, 3, 3]]);
|
1325
|
-
|
1506
|
+
|
1507
|
+
var inkRef = _primitives.Ref.get(142, 0);
|
1508
|
+
|
1326
1509
|
var xref = new _test_utils.XRefMock([{
|
1327
1510
|
ref: inkRef,
|
1328
1511
|
data: inkDict
|
1329
1512
|
}]);
|
1330
1513
|
|
1331
|
-
_annotation.AnnotationFactory.create(xref, inkRef, pdfManagerMock, idFactoryMock).then(function (
|
1332
|
-
var data =
|
1514
|
+
_annotation.AnnotationFactory.create(xref, inkRef, pdfManagerMock, idFactoryMock).then(function (_ref48) {
|
1515
|
+
var data = _ref48.data;
|
1333
1516
|
expect(data.annotationType).toEqual(_util.AnnotationType.INK);
|
1334
1517
|
expect(data.inkLists.length).toEqual(1);
|
1335
1518
|
expect(data.inkLists[0]).toEqual([{
|
@@ -1353,14 +1536,16 @@ describe('annotation', function () {
|
|
1353
1536
|
inkDict.set('Type', _primitives.Name.get('Annot'));
|
1354
1537
|
inkDict.set('Subtype', _primitives.Name.get('Ink'));
|
1355
1538
|
inkDict.set('InkList', [[1, 1, 1, 2], [3, 3, 4, 5]]);
|
1356
|
-
|
1539
|
+
|
1540
|
+
var inkRef = _primitives.Ref.get(143, 0);
|
1541
|
+
|
1357
1542
|
var xref = new _test_utils.XRefMock([{
|
1358
1543
|
ref: inkRef,
|
1359
1544
|
data: inkDict
|
1360
1545
|
}]);
|
1361
1546
|
|
1362
|
-
_annotation.AnnotationFactory.create(xref, inkRef, pdfManagerMock, idFactoryMock).then(function (
|
1363
|
-
var data =
|
1547
|
+
_annotation.AnnotationFactory.create(xref, inkRef, pdfManagerMock, idFactoryMock).then(function (_ref49) {
|
1548
|
+
var data = _ref49.data;
|
1364
1549
|
expect(data.annotationType).toEqual(_util.AnnotationType.INK);
|
1365
1550
|
expect(data.inkLists.length).toEqual(2);
|
1366
1551
|
expect(data.inkLists[0]).toEqual([{
|