@syncfusion/ej2-pdf 23.1.44 → 23.2.6

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.
@@ -22214,12 +22214,17 @@ var PdfDocumentLinkAnnotation = /** @__PURE__ @class */ (function (_super) {
22214
22214
  else if (this._dictionary.has('A') && !this._destination) {
22215
22215
  var action = this._dictionary.get('A');
22216
22216
  if (action.has('D')) {
22217
- var reference = action.get('D');
22218
- if (reference) {
22219
- var referenceValue = this._crossReference._fetch(reference); // eslint-disable-line
22217
+ var reference = action.get('D'); // eslint-disable-line
22218
+ if (reference !== null && typeof reference !== 'undefined') {
22220
22219
  var referenceArray = void 0; // eslint-disable-line
22221
- if (Array.isArray(referenceValue)) {
22222
- referenceArray = referenceValue;
22220
+ if (Array.isArray(reference)) {
22221
+ referenceArray = reference;
22222
+ }
22223
+ else if (reference instanceof _PdfReference) {
22224
+ var referenceValue = this._crossReference._fetch(reference); // eslint-disable-line
22225
+ if (Array.isArray(referenceValue)) {
22226
+ referenceArray = referenceValue;
22227
+ }
22223
22228
  }
22224
22229
  if (referenceArray) {
22225
22230
  if (referenceArray[0] instanceof _PdfReference) {
@@ -28497,6 +28502,7 @@ var PdfAnnotationCollection = /** @__PURE__ @class */ (function () {
28497
28502
  }
28498
28503
  if (this._parsedAnnotations.has(index)) {
28499
28504
  this._parsedAnnotations.delete(index);
28505
+ this._reorderParsedAnnotations(index);
28500
28506
  }
28501
28507
  var crossReference = this._page._crossReference;
28502
28508
  if (crossReference && crossReference._cacheMap.has(reference)) {
@@ -28504,6 +28510,18 @@ var PdfAnnotationCollection = /** @__PURE__ @class */ (function () {
28504
28510
  }
28505
28511
  }
28506
28512
  };
28513
+ PdfAnnotationCollection.prototype._reorderParsedAnnotations = function (index) {
28514
+ var result = new Map();
28515
+ this._parsedAnnotations.forEach(function (value, key) {
28516
+ if (key > index) {
28517
+ result.set(key - 1, value);
28518
+ }
28519
+ else {
28520
+ result.set(key, value);
28521
+ }
28522
+ });
28523
+ this._parsedAnnotations = result;
28524
+ };
28507
28525
  PdfAnnotationCollection.prototype._updateCustomAppearanceResource = function (annotation) {
28508
28526
  if (annotation instanceof PdfRubberStampAnnotation && typeof annotation._appearance !== 'undefined') {
28509
28527
  annotation._appearance.normal.graphics._processResources(annotation._crossReference);
@@ -37484,12 +37502,8 @@ var _PdfCatalog = /** @__PURE__ @class */ (function () {
37484
37502
  if (this._catalogDictionary.has('AcroForm')) {
37485
37503
  form = this._catalogDictionary.get('AcroForm');
37486
37504
  }
37487
- else {
37488
- form = new _PdfDictionary(this._crossReference);
37489
- var ref = this._crossReference._getNextReference();
37490
- this._crossReference._cacheMap.set(ref, form);
37491
- this._catalogDictionary.set('AcroForm', ref);
37492
- this._catalogDictionary._updated = true;
37505
+ if (form === null || typeof form === 'undefined') {
37506
+ form = this._createForm();
37493
37507
  }
37494
37508
  return form;
37495
37509
  },
@@ -37497,6 +37511,14 @@ var _PdfCatalog = /** @__PURE__ @class */ (function () {
37497
37511
  configurable: true
37498
37512
  });
37499
37513
  /* eslint-disable */
37514
+ _PdfCatalog.prototype._createForm = function () {
37515
+ var form = new _PdfDictionary(this._crossReference);
37516
+ var ref = this._crossReference._getNextReference();
37517
+ this._crossReference._cacheMap.set(ref, form);
37518
+ this._catalogDictionary.set('AcroForm', ref);
37519
+ this._catalogDictionary._updated = true;
37520
+ return form;
37521
+ };
37500
37522
  _PdfCatalog.prototype.getPageDictionary = function (pageIndex) {
37501
37523
  var nodesToVisit = [this._topPagesDictionary];
37502
37524
  var visitedNodes = new _PdfReferenceSet();
@@ -38573,7 +38595,7 @@ var _PdfParser = /** @__PURE__ @class */ (function () {
38573
38595
  var dictBytes = stream.getBytes(dictLength);
38574
38596
  stream.position = initialStreamPos;
38575
38597
  cacheKey = this._computeMaxNumber(imageBytes) + '_' + this._computeMaxNumber(dictBytes);
38576
- var cacheEntry = this.imageCache[cacheKey]; // eslint-disable-line
38598
+ var cacheEntry = this.imageCache.get(cacheKey);
38577
38599
  if (cacheEntry !== undefined) {
38578
38600
  this.second = _PdfCommand.get('EI');
38579
38601
  this.shift();
@@ -38587,7 +38609,7 @@ var _PdfParser = /** @__PURE__ @class */ (function () {
38587
38609
  imageStream = this.filter(imageStream, dictionary, length);
38588
38610
  imageStream.dictionary = dictionary;
38589
38611
  if (cacheKey !== undefined) {
38590
- this.imageCache[cacheKey] = imageStream; // eslint-disable-line
38612
+ this.imageCache.set(cacheKey, imageStream);
38591
38613
  }
38592
38614
  this.second = _PdfCommand.get('EI');
38593
38615
  this.shift();