@syncfusion/ej2-pdf 24.2.3 → 24.2.5

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.
@@ -22541,50 +22541,54 @@ var PdfDocumentLinkAnnotation = /** @__PURE__ @class */ (function (_super) {
22541
22541
  referenceArray = referenceValue;
22542
22542
  }
22543
22543
  }
22544
- if (referenceArray) {
22544
+ if (referenceArray && (referenceArray[0] instanceof _PdfReference || typeof referenceArray[0] === 'number')) {
22545
+ var document_1 = this._crossReference._document;
22546
+ var index = void 0;
22545
22547
  if (referenceArray[0] instanceof _PdfReference) {
22546
- var document_1 = this._crossReference._document;
22547
- var index = _getPageIndex(document_1, this._crossReference._fetch(referenceArray[0]));
22548
- var page = document_1.getPage(index);
22549
- if (page) {
22550
- var mode = referenceArray[1];
22551
- if (mode.name === 'FitBH' || mode.name === 'FitH') {
22552
- var top_5 = referenceArray[2];
22553
- var topValue = (typeof top_5 !== 'undefined' && top_5 !== null) ? (page.size[1] - top_5) : 0;
22554
- this._destination = new PdfDestination(page, [0, topValue]);
22555
- if (typeof top_5 === 'undefined' || top_5 === null) {
22556
- this._destination._setValidation(false);
22557
- }
22548
+ index = _getPageIndex(document_1, this._crossReference._fetch(referenceArray[0]));
22549
+ }
22550
+ else {
22551
+ index = referenceArray[0];
22552
+ }
22553
+ var page = document_1.getPage(index);
22554
+ if (page) {
22555
+ var mode = referenceArray[1];
22556
+ if (mode.name === 'FitBH' || mode.name === 'FitH') {
22557
+ var top_5 = referenceArray[2];
22558
+ var topValue = (typeof top_5 !== 'undefined' && top_5 !== null) ? (page.size[1] - top_5) : 0;
22559
+ this._destination = new PdfDestination(page, [0, topValue]);
22560
+ if (typeof top_5 === 'undefined' || top_5 === null) {
22561
+ this._destination._setValidation(false);
22558
22562
  }
22559
- else if (mode.name === 'XYZ') {
22560
- var left = referenceArray[2];
22561
- var top_6 = referenceArray[3];
22562
- var zoom = referenceArray[4];
22563
- var topValue = (typeof top_6 !== 'undefined' && top_6 !== null) ? (page.size[1] - top_6) : 0;
22564
- var leftValue = (typeof left !== 'undefined' && left !== null) ? left : 0;
22565
- this._destination = new PdfDestination(page, [leftValue, topValue]);
22566
- if (typeof zoom !== 'undefined' && zoom !== null) {
22567
- this._destination.zoom = zoom;
22568
- }
22569
- if ((typeof left !== 'undefined' && left !== null) || (typeof top_6 !== 'undefined' && top_6 !== null)
22570
- || (typeof zoom !== 'undefined' && zoom !== null)) {
22571
- this._destination._setValidation(false);
22572
- }
22563
+ }
22564
+ else if (mode.name === 'XYZ') {
22565
+ var left = referenceArray[2];
22566
+ var top_6 = referenceArray[3];
22567
+ var zoom = referenceArray[4];
22568
+ var topValue = (typeof top_6 !== 'undefined' && top_6 !== null) ? (page.size[1] - top_6) : 0;
22569
+ var leftValue = (typeof left !== 'undefined' && left !== null) ? left : 0;
22570
+ this._destination = new PdfDestination(page, [leftValue, topValue]);
22571
+ if (typeof zoom !== 'undefined' && zoom !== null) {
22572
+ this._destination.zoom = zoom;
22573
22573
  }
22574
- else if (mode.name === 'FitR') {
22575
- if (referenceArray.length === 6) {
22576
- var left = referenceArray[2];
22577
- var bottom = referenceArray[3];
22578
- var right = referenceArray[4];
22579
- var top_7 = referenceArray[5];
22580
- this._destination = new PdfDestination(page, [left, bottom, right, top_7]);
22581
- }
22574
+ if ((typeof left !== 'undefined' && left !== null) || (typeof top_6 !== 'undefined' && top_6 !== null)
22575
+ || (typeof zoom !== 'undefined' && zoom !== null)) {
22576
+ this._destination._setValidation(false);
22582
22577
  }
22583
- else if (mode.name === 'Fit') {
22584
- this._destination = new PdfDestination(page);
22585
- this._destination.mode = PdfDestinationMode.fitToPage;
22578
+ }
22579
+ else if (mode.name === 'FitR') {
22580
+ if (referenceArray.length === 6) {
22581
+ var left = referenceArray[2];
22582
+ var bottom = referenceArray[3];
22583
+ var right = referenceArray[4];
22584
+ var top_7 = referenceArray[5];
22585
+ this._destination = new PdfDestination(page, [left, bottom, right, top_7]);
22586
22586
  }
22587
22587
  }
22588
+ else if (mode.name === 'Fit') {
22589
+ this._destination = new PdfDestination(page);
22590
+ this._destination.mode = PdfDestinationMode.fitToPage;
22591
+ }
22588
22592
  }
22589
22593
  }
22590
22594
  }
@@ -42291,22 +42295,26 @@ var PdfForm = /** @__PURE__ @class */ (function () {
42291
42295
  if (page && document_1) {
42292
42296
  for (var i = 0; i < this._fieldCollection.length; i++) {
42293
42297
  var field = this._fieldCollection[Number.parseInt(i.toString(), 10)];
42294
- var index = _getPageIndex(document_1, field.page._pageDictionary);
42295
- if (fieldCollection.has(index)) {
42296
- value = fieldCollection.get(index);
42297
- value.push(field);
42298
- }
42299
- else {
42300
- value = [];
42301
- value.push(field);
42302
- fieldCollection.set(index, value);
42303
- }
42304
- var page_1 = document_1.getPage(index);
42305
- if (!this._tabCollection.has(index)) {
42306
- this._tabCollection.set(index, page_1.tabOrder);
42307
- }
42308
- if (setTabOrder) {
42309
- page_1.tabOrder = this._tabCollection.get(index);
42298
+ if (field.page) {
42299
+ var index = _getPageIndex(document_1, field.page._pageDictionary);
42300
+ if (index >= 0) {
42301
+ if (fieldCollection.has(index)) {
42302
+ value = fieldCollection.get(index);
42303
+ value.push(field);
42304
+ }
42305
+ else {
42306
+ value = [];
42307
+ value.push(field);
42308
+ fieldCollection.set(index, value);
42309
+ }
42310
+ var page_1 = document_1.getPage(index);
42311
+ if (!this._tabCollection.has(index)) {
42312
+ this._tabCollection.set(index, page_1.tabOrder);
42313
+ }
42314
+ if (setTabOrder) {
42315
+ page_1.tabOrder = this._tabCollection.get(index);
42316
+ }
42317
+ }
42310
42318
  }
42311
42319
  }
42312
42320
  var fieldsCount_1 = 0;