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.

Files changed (166) hide show
  1. package/CODE_OF_CONDUCT.md +15 -0
  2. package/bower.json +1 -1
  3. package/build/pdf.js +3349 -2324
  4. package/build/pdf.js.map +1 -1
  5. package/build/pdf.min.js +1 -1
  6. package/build/pdf.worker.js +2804 -1975
  7. package/build/pdf.worker.js.map +1 -1
  8. package/build/pdf.worker.min.js +1 -1
  9. package/image_decoders/pdf.image_decoders.js +431 -511
  10. package/image_decoders/pdf.image_decoders.js.map +1 -1
  11. package/image_decoders/pdf.image_decoders.min.js +1 -1
  12. package/lib/core/annotation.js +294 -224
  13. package/lib/core/arithmetic_decoder.js +1 -1
  14. package/lib/core/bidi.js +1 -1
  15. package/lib/core/ccitt.js +1 -1
  16. package/lib/core/ccitt_stream.js +1 -1
  17. package/lib/core/cff_parser.js +61 -12
  18. package/lib/core/charsets.js +1 -1
  19. package/lib/core/chunked_stream.js +24 -14
  20. package/lib/core/cmap.js +17 -13
  21. package/lib/core/colorspace.js +1 -1
  22. package/lib/core/core_utils.js +147 -0
  23. package/lib/core/crypto.js +1 -1
  24. package/lib/core/document.js +47 -40
  25. package/lib/core/encodings.js +1 -1
  26. package/lib/core/evaluator.js +346 -279
  27. package/lib/core/font_renderer.js +1 -1
  28. package/lib/core/fonts.js +23 -11
  29. package/lib/core/function.js +1 -1
  30. package/lib/core/glyphlist.js +2 -2
  31. package/lib/core/image.js +2 -2
  32. package/lib/core/image_utils.js +111 -0
  33. package/lib/core/jbig2.js +1 -1
  34. package/lib/core/jbig2_stream.js +1 -1
  35. package/lib/core/jpeg_stream.js +1 -1
  36. package/lib/core/jpg.js +2 -1
  37. package/lib/core/jpx.js +1 -1
  38. package/lib/core/jpx_stream.js +1 -1
  39. package/lib/core/metrics.js +13 -13
  40. package/lib/core/murmurhash3.js +37 -33
  41. package/lib/core/obj.js +245 -41
  42. package/lib/core/operator_list.js +43 -32
  43. package/lib/core/parser.js +228 -133
  44. package/lib/core/pattern.js +4 -2
  45. package/lib/core/pdf_manager.js +17 -15
  46. package/lib/core/primitives.js +40 -6
  47. package/lib/core/ps_parser.js +1 -1
  48. package/lib/core/standard_fonts.js +9 -9
  49. package/lib/core/stream.js +1 -1
  50. package/lib/core/type1_parser.js +1 -1
  51. package/lib/core/unicode.js +2 -2
  52. package/lib/core/worker.js +54 -171
  53. package/lib/core/worker_stream.js +277 -0
  54. package/lib/display/annotation_layer.js +112 -33
  55. package/lib/display/api.js +211 -123
  56. package/lib/display/api_compatibility.js +1 -1
  57. package/lib/display/canvas.js +40 -19
  58. package/lib/display/content_disposition.js +1 -1
  59. package/lib/display/display_utils.js +747 -0
  60. package/lib/display/fetch_stream.js +19 -12
  61. package/lib/display/font_loader.js +11 -8
  62. package/lib/display/metadata.js +1 -1
  63. package/lib/display/network.js +563 -521
  64. package/lib/display/network_utils.js +1 -1
  65. package/lib/display/node_stream.js +21 -12
  66. package/lib/display/pattern_helper.js +24 -25
  67. package/lib/display/svg.js +1068 -565
  68. package/lib/display/text_layer.js +24 -14
  69. package/lib/display/transport_stream.js +192 -70
  70. package/lib/display/webgl.js +1 -1
  71. package/lib/display/worker_options.js +1 -1
  72. package/lib/display/xml_parser.js +1 -1
  73. package/lib/examples/node/domstubs.js +4 -1
  74. package/lib/pdf.js +20 -15
  75. package/lib/pdf.worker.js +3 -3
  76. package/lib/shared/compatibility.js +6 -6
  77. package/lib/shared/global_scope.js +1 -1
  78. package/lib/shared/is_node.js +2 -2
  79. package/lib/shared/message_handler.js +7 -7
  80. package/lib/shared/streams_polyfill.js +1 -1
  81. package/lib/shared/url_polyfill.js +1 -1
  82. package/lib/shared/util.js +13 -125
  83. package/lib/test/unit/annotation_spec.js +278 -93
  84. package/lib/test/unit/api_spec.js +198 -188
  85. package/lib/test/unit/bidi_spec.js +1 -1
  86. package/lib/test/unit/cff_parser_spec.js +15 -1
  87. package/lib/test/unit/clitests_helper.js +3 -3
  88. package/lib/test/unit/cmap_spec.js +20 -20
  89. package/lib/test/unit/colorspace_spec.js +17 -12
  90. package/lib/test/unit/core_utils_spec.js +191 -0
  91. package/lib/test/unit/crypto_spec.js +1 -1
  92. package/lib/test/unit/custom_spec.js +8 -8
  93. package/lib/test/unit/display_svg_spec.js +8 -8
  94. package/lib/test/unit/display_utils_spec.js +273 -0
  95. package/lib/test/unit/document_spec.js +7 -12
  96. package/lib/test/unit/encodings_spec.js +5 -5
  97. package/lib/test/unit/evaluator_spec.js +8 -10
  98. package/lib/test/unit/fetch_stream_spec.js +109 -0
  99. package/lib/test/unit/function_spec.js +1 -1
  100. package/lib/test/unit/jasmine-boot.js +4 -4
  101. package/lib/test/unit/message_handler_spec.js +1 -1
  102. package/lib/test/unit/metadata_spec.js +1 -1
  103. package/lib/test/unit/murmurhash3_spec.js +1 -1
  104. package/lib/test/unit/network_spec.js +5 -55
  105. package/lib/test/unit/network_utils_spec.js +51 -1
  106. package/lib/test/unit/node_stream_spec.js +8 -8
  107. package/lib/test/unit/parser_spec.js +150 -86
  108. package/lib/test/unit/pdf_find_controller_spec.js +1 -1
  109. package/lib/test/unit/pdf_find_utils_spec.js +1 -1
  110. package/lib/test/unit/pdf_history_spec.js +1 -1
  111. package/lib/test/unit/primitives_spec.js +30 -17
  112. package/lib/test/unit/stream_spec.js +1 -1
  113. package/lib/test/unit/test_utils.js +197 -43
  114. package/lib/test/unit/testreporter.js +1 -1
  115. package/lib/test/unit/type1_parser_spec.js +1 -1
  116. package/lib/test/unit/ui_utils_spec.js +20 -20
  117. package/lib/test/unit/unicode_spec.js +5 -5
  118. package/lib/test/unit/util_spec.js +1 -164
  119. package/lib/web/annotation_layer_builder.js +1 -1
  120. package/lib/web/app.js +104 -60
  121. package/lib/web/app_options.js +45 -37
  122. package/lib/web/base_viewer.js +7 -7
  123. package/lib/web/chromecom.js +8 -8
  124. package/lib/web/debugger.js +7 -7
  125. package/lib/web/download_manager.js +3 -2
  126. package/lib/web/firefox_print_service.js +4 -2
  127. package/lib/web/firefoxcom.js +50 -19
  128. package/lib/web/genericcom.js +8 -8
  129. package/lib/web/genericl10n.js +10 -10
  130. package/lib/web/grab_to_pan.js +3 -1
  131. package/lib/web/interfaces.js +13 -13
  132. package/lib/web/overlay_manager.js +10 -10
  133. package/lib/web/password_prompt.js +2 -2
  134. package/lib/web/pdf_attachment_viewer.js +1 -1
  135. package/lib/web/pdf_cursor_tools.js +1 -1
  136. package/lib/web/pdf_document_properties.js +188 -119
  137. package/lib/web/pdf_find_bar.js +1 -1
  138. package/lib/web/pdf_find_controller.js +3 -3
  139. package/lib/web/pdf_find_utils.js +1 -1
  140. package/lib/web/pdf_history.js +1 -1
  141. package/lib/web/pdf_link_service.js +2 -2
  142. package/lib/web/pdf_outline_viewer.js +53 -28
  143. package/lib/web/pdf_page_view.js +9 -18
  144. package/lib/web/pdf_presentation_mode.js +1 -1
  145. package/lib/web/pdf_print_service.js +5 -3
  146. package/lib/web/pdf_rendering_queue.js +4 -7
  147. package/lib/web/pdf_sidebar.js +24 -17
  148. package/lib/web/pdf_sidebar_resizer.js +1 -1
  149. package/lib/web/pdf_single_page_viewer.js +1 -1
  150. package/lib/web/pdf_thumbnail_view.js +2 -2
  151. package/lib/web/pdf_thumbnail_viewer.js +3 -3
  152. package/lib/web/pdf_viewer.component.js +3 -3
  153. package/lib/web/pdf_viewer.js +3 -3
  154. package/lib/web/preferences.js +30 -30
  155. package/lib/web/secondary_toolbar.js +1 -1
  156. package/lib/web/text_layer_builder.js +23 -45
  157. package/lib/web/toolbar.js +1 -1
  158. package/lib/web/ui_utils.js +14 -14
  159. package/lib/web/view_history.js +15 -15
  160. package/lib/web/viewer_compatibility.js +1 -1
  161. package/package.json +1 -1
  162. package/web/pdf_viewer.css +21 -10
  163. package/web/pdf_viewer.js +126 -194
  164. package/web/pdf_viewer.js.map +1 -1
  165. package/lib/display/dom_utils.js +0 -494
  166. 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 2018 Mozilla Foundation
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.
@@ -88,8 +88,8 @@ if (!globalScope._pdfjsCompatibilityChecked) {
88
88
  tokens[_key] = arguments[_key];
89
89
  }
90
90
 
91
- for (var _i = 0; _i < tokens.length; _i++) {
92
- var token = tokens[_i];
91
+ for (var _i = 0, _tokens = tokens; _i < _tokens.length; _i++) {
92
+ var token = _tokens[_i];
93
93
  OriginalDOMTokenListAdd.call(this, token);
94
94
  }
95
95
  };
@@ -99,8 +99,8 @@ if (!globalScope._pdfjsCompatibilityChecked) {
99
99
  tokens[_key2] = arguments[_key2];
100
100
  }
101
101
 
102
- for (var _i2 = 0; _i2 < tokens.length; _i2++) {
103
- var token = tokens[_i2];
102
+ for (var _i2 = 0, _tokens2 = tokens; _i2 < _tokens2.length; _i2++) {
103
+ var token = _tokens2[_i2];
104
104
  OriginalDOMTokenListRemove.call(this, token);
105
105
  }
106
106
  };
@@ -196,7 +196,7 @@ if (!globalScope._pdfjsCompatibilityChecked) {
196
196
  })();
197
197
 
198
198
  (function checkPromise() {
199
- if (globalScope.Promise && globalScope.Promise.prototype && globalScope.Promise.prototype.finally) {
199
+ if (globalScope.Promise && globalScope.Promise.prototype && globalScope.Promise.prototype["finally"]) {
200
200
  return;
201
201
  }
202
202
 
@@ -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 2018 Mozilla Foundation
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.
@@ -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 2018 Mozilla Foundation
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.
@@ -24,5 +24,5 @@
24
24
  function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
25
25
 
26
26
  module.exports = function isNodeJS() {
27
- return (typeof process === "undefined" ? "undefined" : _typeof(process)) === 'object' && process + '' === '[object process]' && !process.versions['nw'];
27
+ return (typeof process === "undefined" ? "undefined" : _typeof(process)) === 'object' && process + '' === '[object process]' && !process.versions['nw'] && !process.versions['electron'];
28
28
  };
@@ -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 2018 Mozilla Foundation
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.
@@ -30,7 +30,7 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))
30
30
 
31
31
  var _util = require("./util");
32
32
 
33
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
33
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
34
34
 
35
35
  function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
36
36
 
@@ -45,10 +45,10 @@ function resolveCall(_x, _x2) {
45
45
  function _resolveCall() {
46
46
  _resolveCall = _asyncToGenerator(
47
47
  /*#__PURE__*/
48
- _regenerator.default.mark(function _callee(fn, args) {
48
+ _regenerator["default"].mark(function _callee(fn, args) {
49
49
  var thisArg,
50
50
  _args = arguments;
51
- return _regenerator.default.wrap(function _callee$(_context) {
51
+ return _regenerator["default"].wrap(function _callee$(_context) {
52
52
  while (1) {
53
53
  switch (_context.prev = _context.next) {
54
54
  case 0:
@@ -59,7 +59,7 @@ function _resolveCall() {
59
59
  break;
60
60
  }
61
61
 
62
- return _context.abrupt("return");
62
+ return _context.abrupt("return", undefined);
63
63
 
64
64
  case 3:
65
65
  return _context.abrupt("return", fn.apply(thisArg, args));
@@ -69,7 +69,7 @@ function _resolveCall() {
69
69
  return _context.stop();
70
70
  }
71
71
  }
72
- }, _callee, this);
72
+ }, _callee);
73
73
  }));
74
74
  return _resolveCall.apply(this, arguments);
75
75
  }
@@ -111,7 +111,7 @@ function resolveOrReject(capability, success, reason) {
111
111
  }
112
112
 
113
113
  function finalize(promise) {
114
- return Promise.resolve(promise).catch(function () {});
114
+ return Promise.resolve(promise)["catch"](function () {});
115
115
  }
116
116
 
117
117
  function MessageHandler(sourceName, targetName, comObj) {
@@ -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 2018 Mozilla Foundation
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.
@@ -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 2018 Mozilla Foundation
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.
@@ -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 2018 Mozilla Foundation
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.
@@ -24,18 +24,15 @@
24
24
  Object.defineProperty(exports, "__esModule", {
25
25
  value: true
26
26
  });
27
- exports.toRomanNumerals = toRomanNumerals;
28
27
  exports.arrayByteLength = arrayByteLength;
29
28
  exports.arraysToBytes = arraysToBytes;
30
29
  exports.assert = assert;
31
30
  exports.bytesToString = bytesToString;
32
31
  exports.createPromiseCapability = createPromiseCapability;
33
- exports.deprecated = deprecated;
34
- exports.getInheritableProperty = getInheritableProperty;
35
- exports.getLookupTableFactory = getLookupTableFactory;
36
32
  exports.getVerbosityLevel = getVerbosityLevel;
37
33
  exports.info = info;
38
34
  exports.isArrayBuffer = isArrayBuffer;
35
+ exports.isArrayEqual = isArrayEqual;
39
36
  exports.isBool = isBool;
40
37
  exports.isEmptyObj = isEmptyObj;
41
38
  exports.isNum = isNum;
@@ -71,7 +68,7 @@ Object.defineProperty(exports, "URL", {
71
68
  return _url_polyfill.URL;
72
69
  }
73
70
  });
74
- exports.createObjectURL = exports.FormatError = exports.XRefParseException = exports.XRefEntryException = exports.Util = exports.UnknownErrorException = exports.UnexpectedResponseException = exports.TextRenderingMode = exports.StreamType = exports.PermissionFlag = exports.PasswordResponses = exports.PasswordException = exports.NativeImageDecoding = exports.MissingPDFException = exports.MissingDataException = exports.InvalidPDFException = exports.AbortException = exports.CMapCompressionType = exports.ImageKind = exports.FontType = exports.AnnotationType = exports.AnnotationFlag = exports.AnnotationFieldFlag = exports.AnnotationBorderStyleType = exports.UNSUPPORTED_FEATURES = exports.VerbosityLevel = exports.OPS = exports.IDENTITY_MATRIX = exports.FONT_IDENTITY_MATRIX = void 0;
71
+ exports.createObjectURL = exports.FormatError = exports.Util = exports.UnknownErrorException = exports.UnexpectedResponseException = exports.TextRenderingMode = exports.StreamType = exports.PermissionFlag = exports.PasswordResponses = exports.PasswordException = exports.NativeImageDecoding = exports.MissingPDFException = exports.InvalidPDFException = exports.AbortException = exports.CMapCompressionType = exports.ImageKind = exports.FontType = exports.AnnotationType = exports.AnnotationFlag = exports.AnnotationFieldFlag = exports.AnnotationBorderStyleType = exports.UNSUPPORTED_FEATURES = exports.VerbosityLevel = exports.OPS = exports.IDENTITY_MATRIX = exports.FONT_IDENTITY_MATRIX = void 0;
75
72
 
76
73
  require("./compatibility");
77
74
 
@@ -364,10 +361,6 @@ function warn(msg) {
364
361
  }
365
362
  }
366
363
 
367
- function deprecated(details) {
368
- console.log('Deprecated API usage: ' + details);
369
- }
370
-
371
364
  function unreachable(msg) {
372
365
  throw new Error(msg);
373
366
  }
@@ -437,19 +430,6 @@ function shadow(obj, prop, value) {
437
430
  return value;
438
431
  }
439
432
 
440
- function getLookupTableFactory(initializer) {
441
- var lookup;
442
- return function () {
443
- if (initializer) {
444
- lookup = Object.create(null);
445
- initializer(lookup);
446
- initializer = null;
447
- }
448
-
449
- return lookup;
450
- };
451
- }
452
-
453
433
  var PasswordException = function PasswordExceptionClosure() {
454
434
  function PasswordException(msg, code) {
455
435
  this.name = 'PasswordException';
@@ -518,47 +498,6 @@ var UnexpectedResponseException = function UnexpectedResponseExceptionClosure()
518
498
 
519
499
  exports.UnexpectedResponseException = UnexpectedResponseException;
520
500
 
521
- var MissingDataException = function MissingDataExceptionClosure() {
522
- function MissingDataException(begin, end) {
523
- this.begin = begin;
524
- this.end = end;
525
- this.message = 'Missing data [' + begin + ', ' + end + ')';
526
- }
527
-
528
- MissingDataException.prototype = new Error();
529
- MissingDataException.prototype.name = 'MissingDataException';
530
- MissingDataException.constructor = MissingDataException;
531
- return MissingDataException;
532
- }();
533
-
534
- exports.MissingDataException = MissingDataException;
535
-
536
- var XRefEntryException = function XRefEntryExceptionClosure() {
537
- function XRefEntryException(msg) {
538
- this.message = msg;
539
- }
540
-
541
- XRefEntryException.prototype = new Error();
542
- XRefEntryException.prototype.name = 'XRefEntryException';
543
- XRefEntryException.constructor = XRefEntryException;
544
- return XRefEntryException;
545
- }();
546
-
547
- exports.XRefEntryException = XRefEntryException;
548
-
549
- var XRefParseException = function XRefParseExceptionClosure() {
550
- function XRefParseException(msg) {
551
- this.message = msg;
552
- }
553
-
554
- XRefParseException.prototype = new Error();
555
- XRefParseException.prototype.name = 'XRefParseException';
556
- XRefParseException.constructor = XRefParseException;
557
- return XRefParseException;
558
- }();
559
-
560
- exports.XRefParseException = XRefParseException;
561
-
562
501
  var FormatError = function FormatErrorClosure() {
563
502
  function FormatError(msg) {
564
503
  this.message = msg;
@@ -714,43 +653,6 @@ function isEvalSupported() {
714
653
  }
715
654
  }
716
655
 
717
- function getInheritableProperty(_ref) {
718
- var dict = _ref.dict,
719
- key = _ref.key,
720
- _ref$getArray = _ref.getArray,
721
- getArray = _ref$getArray === void 0 ? false : _ref$getArray,
722
- _ref$stopWhenFound = _ref.stopWhenFound,
723
- stopWhenFound = _ref$stopWhenFound === void 0 ? true : _ref$stopWhenFound;
724
- var LOOP_LIMIT = 100;
725
- var loopCount = 0;
726
- var values;
727
-
728
- while (dict) {
729
- var value = getArray ? dict.getArray(key) : dict.get(key);
730
-
731
- if (value !== undefined) {
732
- if (stopWhenFound) {
733
- return value;
734
- }
735
-
736
- if (!values) {
737
- values = [];
738
- }
739
-
740
- values.push(value);
741
- }
742
-
743
- if (++loopCount > LOOP_LIMIT) {
744
- warn("getInheritableProperty: maximum loop count exceeded for \"".concat(key, "\""));
745
- break;
746
- }
747
-
748
- dict = dict.get('Parent');
749
- }
750
-
751
- return values;
752
- }
753
-
754
656
  var Util = function UtilClosure() {
755
657
  function Util() {}
756
658
 
@@ -858,30 +760,6 @@ var Util = function UtilClosure() {
858
760
  }();
859
761
 
860
762
  exports.Util = Util;
861
- var ROMAN_NUMBER_MAP = ['', 'C', 'CC', 'CCC', 'CD', 'D', 'DC', 'DCC', 'DCCC', 'CM', '', 'X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC', '', 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX'];
862
-
863
- function toRomanNumerals(number) {
864
- var lowerCase = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
865
- assert(Number.isInteger(number) && number > 0, 'The number should be a positive integer.');
866
- var pos,
867
- romanBuf = [];
868
-
869
- while (number >= 1000) {
870
- number -= 1000;
871
- romanBuf.push('M');
872
- }
873
-
874
- pos = number / 100 | 0;
875
- number %= 100;
876
- romanBuf.push(ROMAN_NUMBER_MAP[pos]);
877
- pos = number / 10 | 0;
878
- number %= 10;
879
- romanBuf.push(ROMAN_NUMBER_MAP[10 + pos]);
880
- romanBuf.push(ROMAN_NUMBER_MAP[20 + number]);
881
- var romanStr = romanBuf.join('');
882
- return lowerCase ? romanStr.toLowerCase() : romanStr;
883
- }
884
-
885
763
  var PDFStringTranslateTable = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2D8, 0x2C7, 0x2C6, 0x2D9, 0x2DD, 0x2DB, 0x2DA, 0x2DC, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2022, 0x2020, 0x2021, 0x2026, 0x2014, 0x2013, 0x192, 0x2044, 0x2039, 0x203A, 0x2212, 0x2030, 0x201E, 0x201C, 0x201D, 0x2018, 0x2019, 0x201A, 0x2122, 0xFB01, 0xFB02, 0x141, 0x152, 0x160, 0x178, 0x17D, 0x131, 0x142, 0x153, 0x161, 0x17E, 0, 0x20AC];
886
764
 
887
765
  function stringToPDFString(str) {
@@ -935,6 +813,16 @@ function isArrayBuffer(v) {
935
813
  return _typeof(v) === 'object' && v !== null && v.byteLength !== undefined;
936
814
  }
937
815
 
816
+ function isArrayEqual(arr1, arr2) {
817
+ if (arr1.length !== arr2.length) {
818
+ return false;
819
+ }
820
+
821
+ return arr1.every(function (element, index) {
822
+ return element === arr2[index];
823
+ });
824
+ }
825
+
938
826
  function isSpace(ch) {
939
827
  return ch === 0x20 || ch === 0x09 || ch === 0x0D || ch === 0x0A;
940
828
  }