@syncfusion/ej2-pdf 25.1.35 → 25.1.37

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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 25.1.35
3
+ * version : 25.1.37
4
4
  * Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-pdf@*",
3
- "_id": "@syncfusion/ej2-pdf@17.9.0",
3
+ "_id": "@syncfusion/ej2-pdf@25.1.35",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-Y6DIlbyztDBA51hnUIszQDLZTppZui6wyqkFjK92YSoZipHQED53oNwZKJUr8OjoWWZW7hDEajPH7IIXaJ1cBg==",
5
+ "_integrity": "sha512-Xc7M7OB3Ky2RaFsvufVzgwyt8wV+lDbN2w/gUJ2U/qgvtDEbO25mGId3FdTfuB+W7jACrSg/v7Q32XzcKwKvsA==",
6
6
  "_location": "/@syncfusion/ej2-pdf",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -21,8 +21,8 @@
21
21
  "/@syncfusion/ej2",
22
22
  "/@syncfusion/ej2-pdfviewer"
23
23
  ],
24
- "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-release/@syncfusion/ej2-pdf/-/ej2-pdf-17.9.0.tgz",
25
- "_shasum": "57d95829b4e070199fe2d8f6df9c4a6a2a6d90bc",
24
+ "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-pdf/-/ej2-pdf-25.1.35.tgz",
25
+ "_shasum": "4200e860c764ae3e2ecfff9460bf964404f6d9cc",
26
26
  "_spec": "@syncfusion/ej2-pdf@*",
27
27
  "_where": "/jenkins/workspace/elease-automation_release_25.1.1/packages/included",
28
28
  "author": {
@@ -55,7 +55,7 @@
55
55
  "url": "https://github.com/syncfusion/ej2-javascript-ui-controls/tree/master/controls/pdf"
56
56
  },
57
57
  "typings": "index.d.ts",
58
- "version": "25.1.35",
58
+ "version": "25.1.37",
59
59
  "sideEffects": false,
60
60
  "homepage": "https://www.syncfusion.com/javascript-ui-controls"
61
61
  }
@@ -426,31 +426,45 @@ var PdfDocument = /** @class */ (function () {
426
426
  pageDictionary.objId = pageReference.toString();
427
427
  pageDictionary.update('Parent', sectionReference);
428
428
  sectionDictionary.update('Kids', [pageReference]);
429
- var lastPage = this.getPage(pageIndex === this.pageCount ? (pageIndex - 1) : pageIndex);
430
- if (lastPage && lastPage._pageDictionary) {
431
- var parentReference = lastPage._pageDictionary._get('Parent');
432
- var parentDictionary = this._crossReference._fetch(parentReference);
433
- if (parentDictionary && parentDictionary.has('Kids')) {
434
- var kids = parentDictionary.get('Kids');
435
- if (kids) {
436
- if (pageIndex === this.pageCount) {
437
- kids.push(sectionReference);
438
- }
439
- else {
440
- var newKids_1 = [];
441
- kids.forEach(function (entry) {
442
- if (entry === lastPage._ref) {
443
- newKids_1.push(sectionReference);
444
- }
445
- newKids_1.push(entry);
446
- });
447
- kids = newKids_1;
448
- this._updatePageCache(pageIndex);
429
+ if (this.pageCount === 0) {
430
+ var parentReference = this._catalog._catalogDictionary._get('Pages');
431
+ if (parentReference && this._catalog._topPagesDictionary) {
432
+ this._catalog._topPagesDictionary.update('Kids', [sectionReference]);
433
+ sectionDictionary.update('Parent', parentReference);
434
+ }
435
+ else {
436
+ this._catalog._catalogDictionary.update('Pages', sectionReference);
437
+ }
438
+ this._pages = new Map();
439
+ this._pageCount = 1;
440
+ }
441
+ else {
442
+ var lastPage_1 = this.getPage(pageIndex === this.pageCount ? (pageIndex - 1) : pageIndex);
443
+ if (lastPage_1 && lastPage_1._pageDictionary) {
444
+ var parentReference = lastPage_1._pageDictionary._get('Parent');
445
+ var parentDictionary = this._crossReference._fetch(parentReference);
446
+ if (parentDictionary && parentDictionary.has('Kids')) {
447
+ var kids = parentDictionary.get('Kids');
448
+ if (kids) {
449
+ if (pageIndex === this.pageCount) {
450
+ kids.push(sectionReference);
451
+ }
452
+ else {
453
+ var newKids_1 = [];
454
+ kids.forEach(function (entry) {
455
+ if (entry === lastPage_1._ref) {
456
+ newKids_1.push(sectionReference);
457
+ }
458
+ newKids_1.push(entry);
459
+ });
460
+ kids = newKids_1;
461
+ this._updatePageCache(pageIndex);
462
+ }
463
+ parentDictionary.update('Kids', kids);
464
+ sectionDictionary.update('Parent', parentReference);
465
+ this._updatePageCount(parentDictionary, 1);
466
+ this._pageCount = this.pageCount + 1;
449
467
  }
450
- parentDictionary.update('Kids', kids);
451
- sectionDictionary.update('Parent', parentReference);
452
- this._updatePageCount(parentDictionary, 1);
453
- this._pageCount = this.pageCount + 1;
454
468
  }
455
469
  }
456
470
  }
@@ -550,17 +564,19 @@ var PdfDocument = /** @class */ (function () {
550
564
  }
551
565
  };
552
566
  PdfDocument.prototype._removeParent = function (referenceToRemove, dictionary) {
553
- var parentReference = dictionary._get('Parent');
554
- var parentDictionary = this._crossReference._fetch(parentReference);
555
- if (parentDictionary && parentDictionary.has('Kids')) {
556
- var kids = parentDictionary.get('Kids');
557
- if (kids.length === 1 && parentDictionary && parentDictionary.get('Type').name === 'Pages') {
558
- this._removeParent(parentReference, parentDictionary);
559
- }
560
- else {
561
- kids = kids.filter(function (item) { return item !== referenceToRemove; });
562
- parentDictionary.update('Kids', kids);
563
- this._updatePageCount(parentDictionary, -1);
567
+ if (dictionary.has('Parent')) {
568
+ var parentReference = dictionary._get('Parent');
569
+ var parentDictionary = this._crossReference._fetch(parentReference);
570
+ if (parentDictionary && parentDictionary.has('Kids')) {
571
+ var kids = parentDictionary.get('Kids');
572
+ if (kids.length === 1 && parentDictionary && parentDictionary.get('Type').name === 'Pages') {
573
+ this._removeParent(parentReference, parentDictionary);
574
+ }
575
+ else {
576
+ kids = kids.filter(function (item) { return item !== referenceToRemove; });
577
+ parentDictionary.update('Kids', kids);
578
+ this._updatePageCount(parentDictionary, -1);
579
+ }
564
580
  }
565
581
  }
566
582
  };