@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.
- package/CHANGELOG.md +8 -0
- package/dist/ej2-pdf.umd.min.js +2 -2
- package/dist/ej2-pdf.umd.min.js.map +1 -1
- package/dist/es6/ej2-pdf.es2015.js +51 -35
- package/dist/es6/ej2-pdf.es2015.js.map +1 -1
- package/dist/es6/ej2-pdf.es5.js +51 -35
- package/dist/es6/ej2-pdf.es5.js.map +1 -1
- package/dist/global/ej2-pdf.min.js +2 -2
- package/dist/global/ej2-pdf.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +5 -5
- package/src/pdf/core/pdf-document.js +51 -35
package/dist/es6/ej2-pdf.es5.js
CHANGED
|
@@ -53173,31 +53173,45 @@ var PdfDocument = /** @__PURE__ @class */ (function () {
|
|
|
53173
53173
|
pageDictionary.objId = pageReference.toString();
|
|
53174
53174
|
pageDictionary.update('Parent', sectionReference);
|
|
53175
53175
|
sectionDictionary.update('Kids', [pageReference]);
|
|
53176
|
-
|
|
53177
|
-
|
|
53178
|
-
|
|
53179
|
-
|
|
53180
|
-
|
|
53181
|
-
|
|
53182
|
-
|
|
53183
|
-
|
|
53184
|
-
|
|
53185
|
-
|
|
53186
|
-
|
|
53187
|
-
|
|
53188
|
-
|
|
53189
|
-
|
|
53190
|
-
|
|
53191
|
-
|
|
53192
|
-
|
|
53193
|
-
|
|
53194
|
-
|
|
53195
|
-
|
|
53176
|
+
if (this.pageCount === 0) {
|
|
53177
|
+
var parentReference = this._catalog._catalogDictionary._get('Pages');
|
|
53178
|
+
if (parentReference && this._catalog._topPagesDictionary) {
|
|
53179
|
+
this._catalog._topPagesDictionary.update('Kids', [sectionReference]);
|
|
53180
|
+
sectionDictionary.update('Parent', parentReference);
|
|
53181
|
+
}
|
|
53182
|
+
else {
|
|
53183
|
+
this._catalog._catalogDictionary.update('Pages', sectionReference);
|
|
53184
|
+
}
|
|
53185
|
+
this._pages = new Map();
|
|
53186
|
+
this._pageCount = 1;
|
|
53187
|
+
}
|
|
53188
|
+
else {
|
|
53189
|
+
var lastPage_1 = this.getPage(pageIndex === this.pageCount ? (pageIndex - 1) : pageIndex);
|
|
53190
|
+
if (lastPage_1 && lastPage_1._pageDictionary) {
|
|
53191
|
+
var parentReference = lastPage_1._pageDictionary._get('Parent');
|
|
53192
|
+
var parentDictionary = this._crossReference._fetch(parentReference);
|
|
53193
|
+
if (parentDictionary && parentDictionary.has('Kids')) {
|
|
53194
|
+
var kids = parentDictionary.get('Kids');
|
|
53195
|
+
if (kids) {
|
|
53196
|
+
if (pageIndex === this.pageCount) {
|
|
53197
|
+
kids.push(sectionReference);
|
|
53198
|
+
}
|
|
53199
|
+
else {
|
|
53200
|
+
var newKids_1 = [];
|
|
53201
|
+
kids.forEach(function (entry) {
|
|
53202
|
+
if (entry === lastPage_1._ref) {
|
|
53203
|
+
newKids_1.push(sectionReference);
|
|
53204
|
+
}
|
|
53205
|
+
newKids_1.push(entry);
|
|
53206
|
+
});
|
|
53207
|
+
kids = newKids_1;
|
|
53208
|
+
this._updatePageCache(pageIndex);
|
|
53209
|
+
}
|
|
53210
|
+
parentDictionary.update('Kids', kids);
|
|
53211
|
+
sectionDictionary.update('Parent', parentReference);
|
|
53212
|
+
this._updatePageCount(parentDictionary, 1);
|
|
53213
|
+
this._pageCount = this.pageCount + 1;
|
|
53196
53214
|
}
|
|
53197
|
-
parentDictionary.update('Kids', kids);
|
|
53198
|
-
sectionDictionary.update('Parent', parentReference);
|
|
53199
|
-
this._updatePageCount(parentDictionary, 1);
|
|
53200
|
-
this._pageCount = this.pageCount + 1;
|
|
53201
53215
|
}
|
|
53202
53216
|
}
|
|
53203
53217
|
}
|
|
@@ -53297,17 +53311,19 @@ var PdfDocument = /** @__PURE__ @class */ (function () {
|
|
|
53297
53311
|
}
|
|
53298
53312
|
};
|
|
53299
53313
|
PdfDocument.prototype._removeParent = function (referenceToRemove, dictionary) {
|
|
53300
|
-
|
|
53301
|
-
|
|
53302
|
-
|
|
53303
|
-
|
|
53304
|
-
|
|
53305
|
-
|
|
53306
|
-
|
|
53307
|
-
|
|
53308
|
-
|
|
53309
|
-
|
|
53310
|
-
|
|
53314
|
+
if (dictionary.has('Parent')) {
|
|
53315
|
+
var parentReference = dictionary._get('Parent');
|
|
53316
|
+
var parentDictionary = this._crossReference._fetch(parentReference);
|
|
53317
|
+
if (parentDictionary && parentDictionary.has('Kids')) {
|
|
53318
|
+
var kids = parentDictionary.get('Kids');
|
|
53319
|
+
if (kids.length === 1 && parentDictionary && parentDictionary.get('Type').name === 'Pages') {
|
|
53320
|
+
this._removeParent(parentReference, parentDictionary);
|
|
53321
|
+
}
|
|
53322
|
+
else {
|
|
53323
|
+
kids = kids.filter(function (item) { return item !== referenceToRemove; });
|
|
53324
|
+
parentDictionary.update('Kids', kids);
|
|
53325
|
+
this._updatePageCount(parentDictionary, -1);
|
|
53326
|
+
}
|
|
53311
53327
|
}
|
|
53312
53328
|
}
|
|
53313
53329
|
};
|