@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
|
@@ -51195,31 +51195,45 @@ class PdfDocument {
|
|
|
51195
51195
|
pageDictionary.objId = pageReference.toString();
|
|
51196
51196
|
pageDictionary.update('Parent', sectionReference);
|
|
51197
51197
|
sectionDictionary.update('Kids', [pageReference]);
|
|
51198
|
-
|
|
51199
|
-
|
|
51200
|
-
|
|
51201
|
-
|
|
51202
|
-
|
|
51203
|
-
|
|
51204
|
-
|
|
51205
|
-
|
|
51206
|
-
|
|
51207
|
-
|
|
51208
|
-
|
|
51209
|
-
|
|
51210
|
-
|
|
51211
|
-
|
|
51212
|
-
|
|
51213
|
-
|
|
51214
|
-
|
|
51215
|
-
|
|
51216
|
-
|
|
51217
|
-
|
|
51198
|
+
if (this.pageCount === 0) {
|
|
51199
|
+
let parentReference = this._catalog._catalogDictionary._get('Pages');
|
|
51200
|
+
if (parentReference && this._catalog._topPagesDictionary) {
|
|
51201
|
+
this._catalog._topPagesDictionary.update('Kids', [sectionReference]);
|
|
51202
|
+
sectionDictionary.update('Parent', parentReference);
|
|
51203
|
+
}
|
|
51204
|
+
else {
|
|
51205
|
+
this._catalog._catalogDictionary.update('Pages', sectionReference);
|
|
51206
|
+
}
|
|
51207
|
+
this._pages = new Map();
|
|
51208
|
+
this._pageCount = 1;
|
|
51209
|
+
}
|
|
51210
|
+
else {
|
|
51211
|
+
const lastPage = this.getPage(pageIndex === this.pageCount ? (pageIndex - 1) : pageIndex);
|
|
51212
|
+
if (lastPage && lastPage._pageDictionary) {
|
|
51213
|
+
const parentReference = lastPage._pageDictionary._get('Parent');
|
|
51214
|
+
const parentDictionary = this._crossReference._fetch(parentReference);
|
|
51215
|
+
if (parentDictionary && parentDictionary.has('Kids')) {
|
|
51216
|
+
let kids = parentDictionary.get('Kids');
|
|
51217
|
+
if (kids) {
|
|
51218
|
+
if (pageIndex === this.pageCount) {
|
|
51219
|
+
kids.push(sectionReference);
|
|
51220
|
+
}
|
|
51221
|
+
else {
|
|
51222
|
+
const newKids = [];
|
|
51223
|
+
kids.forEach((entry) => {
|
|
51224
|
+
if (entry === lastPage._ref) {
|
|
51225
|
+
newKids.push(sectionReference);
|
|
51226
|
+
}
|
|
51227
|
+
newKids.push(entry);
|
|
51228
|
+
});
|
|
51229
|
+
kids = newKids;
|
|
51230
|
+
this._updatePageCache(pageIndex);
|
|
51231
|
+
}
|
|
51232
|
+
parentDictionary.update('Kids', kids);
|
|
51233
|
+
sectionDictionary.update('Parent', parentReference);
|
|
51234
|
+
this._updatePageCount(parentDictionary, 1);
|
|
51235
|
+
this._pageCount = this.pageCount + 1;
|
|
51218
51236
|
}
|
|
51219
|
-
parentDictionary.update('Kids', kids);
|
|
51220
|
-
sectionDictionary.update('Parent', parentReference);
|
|
51221
|
-
this._updatePageCount(parentDictionary, 1);
|
|
51222
|
-
this._pageCount = this.pageCount + 1;
|
|
51223
51237
|
}
|
|
51224
51238
|
}
|
|
51225
51239
|
}
|
|
@@ -51318,17 +51332,19 @@ class PdfDocument {
|
|
|
51318
51332
|
}
|
|
51319
51333
|
}
|
|
51320
51334
|
_removeParent(referenceToRemove, dictionary) {
|
|
51321
|
-
|
|
51322
|
-
|
|
51323
|
-
|
|
51324
|
-
|
|
51325
|
-
|
|
51326
|
-
|
|
51327
|
-
|
|
51328
|
-
|
|
51329
|
-
|
|
51330
|
-
|
|
51331
|
-
|
|
51335
|
+
if (dictionary.has('Parent')) {
|
|
51336
|
+
const parentReference = dictionary._get('Parent');
|
|
51337
|
+
const parentDictionary = this._crossReference._fetch(parentReference);
|
|
51338
|
+
if (parentDictionary && parentDictionary.has('Kids')) {
|
|
51339
|
+
let kids = parentDictionary.get('Kids');
|
|
51340
|
+
if (kids.length === 1 && parentDictionary && parentDictionary.get('Type').name === 'Pages') {
|
|
51341
|
+
this._removeParent(parentReference, parentDictionary);
|
|
51342
|
+
}
|
|
51343
|
+
else {
|
|
51344
|
+
kids = kids.filter((item) => item !== referenceToRemove);
|
|
51345
|
+
parentDictionary.update('Kids', kids);
|
|
51346
|
+
this._updatePageCount(parentDictionary, -1);
|
|
51347
|
+
}
|
|
51332
51348
|
}
|
|
51333
51349
|
}
|
|
51334
51350
|
}
|