@syncfusion/ej2-pdf-export 19.3.53 → 19.4.48

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 : 19.3.53
3
+ * version : 19.4.48
4
4
  * Copyright Syncfusion Inc. 2001 - 2020. 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-export@*",
3
- "_id": "@syncfusion/ej2-pdf-export@19.2.56",
3
+ "_id": "@syncfusion/ej2-pdf-export@19.4.42",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-Lni0gsdRZgos5Djn+qYBhbmIVmw02XlnkXe+DGScnb4jiTNyyE5VaET8fzfJiuF01MXA26rI7TTXd+71sCWYEw==",
5
+ "_integrity": "sha512-1x4tI68iTWzZ40+iTbZ893cfy21YTpJIzZrXJtc2eumBh0Wg6IrdvMfhCCfOuVHg4MhMNj3PAYQesVUs52BHEA==",
6
6
  "_location": "/@syncfusion/ej2-pdf-export",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -28,34 +28,26 @@
28
28
  "/@syncfusion/ej2-pivotview",
29
29
  "/@syncfusion/ej2-treemap"
30
30
  ],
31
- "_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix/@syncfusion/ej2-pdf-export/-/ej2-pdf-export-19.2.56.tgz",
32
- "_shasum": "5d13f0f69f560b817b21f669f45a7c241a510c09",
31
+ "_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-pdf-export/-/ej2-pdf-export-19.4.42.tgz",
32
+ "_shasum": "0a23dd14fa70d104bfe8ec36f62b0b505c710c92",
33
33
  "_spec": "@syncfusion/ej2-pdf-export@*",
34
34
  "_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",
35
35
  "author": {
36
36
  "name": "Syncfusion Inc."
37
37
  },
38
- "bugs": {
39
- "url": "https://github.com/syncfusion/ej2-javascript-ui-controls/issues"
40
- },
41
38
  "bundleDependencies": false,
42
39
  "dependencies": {
43
- "@syncfusion/ej2-compression": "~19.3.53"
40
+ "@syncfusion/ej2-compression": "~19.4.48"
44
41
  },
45
42
  "deprecated": false,
46
- "description": "Essential Javascript 2 PDF Library",
43
+ "description": "Syncfusion TypeScript Component",
47
44
  "devDependencies": {},
48
45
  "es2015": "./dist/es6/ej2-pdf-export.es2015.js",
49
- "homepage": "https://github.com/syncfusion/ej2-javascript-ui-controls#readme",
50
46
  "license": "SEE LICENSE IN license",
51
47
  "main": "./dist/ej2-pdf-export.umd.min.js",
52
48
  "module": "./index.js",
53
49
  "name": "@syncfusion/ej2-pdf-export",
54
- "repository": {
55
- "type": "git",
56
- "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
57
- },
58
50
  "typings": "index.d.ts",
59
- "version": "19.3.53",
51
+ "version": "19.4.48",
60
52
  "sideEffects": false
61
53
  }
@@ -176,6 +176,7 @@ export declare class PdfSection implements IPdfWrapper {
176
176
  * @private
177
177
  * @param document The parent document.
178
178
  * @param page The parent page.
179
+ * @param headers If true - return headers/footers, if false - return simple templates.
179
180
  * @param foreground If true - return foreground templates, if false - return background templates.
180
181
  * @returns Returns array of the document templates.
181
182
  */
@@ -216,6 +216,7 @@ var PdfSection = /** @class */ (function () {
216
216
  * @private
217
217
  * @param document The parent document.
218
218
  * @param page The parent page.
219
+ * @param headers If true - return headers/footers, if false - return simple templates.
219
220
  * @param foreground If true - return foreground templates, if false - return background templates.
220
221
  * @returns Returns array of the document templates.
221
222
  */
@@ -296,6 +296,7 @@ export declare class PdfGridLayouter extends ElementLayouter {
296
296
  * @private
297
297
  */
298
298
  private layoutOnPage;
299
+ private checkIsFisished;
299
300
  /**
300
301
  * Gets the `next page`.
301
302
  * @private
@@ -200,7 +200,10 @@ var PdfGridLayouter = /** @class */ (function (_super) {
200
200
  var index = 0;
201
201
  index = this.currentGraphics.page.section.indexOf(this.currentGraphics.page);
202
202
  this.listOfNavigatePages.push(index);
203
- if (format != null && format.break === PdfLayoutBreakType.FitColumnsToPage) {
203
+ if (typeof param.bounds !== 'undefined' && param.bounds !== null && (!(param.bounds.x === 0 && param.bounds.y === 0 && param.bounds.width === 0 && param.bounds.height === 0))) {
204
+ this.currentBounds = new RectangleF(new PointF(param.bounds.x, param.bounds.y), new SizeF(param.bounds.width, param.bounds.height));
205
+ }
206
+ else if (format != null && format.break === PdfLayoutBreakType.FitColumnsToPage) {
204
207
  this.currentBounds = new RectangleF(new PointF(param.bounds.x, param.bounds.y), new SizeF(this.Grid.columns.width, this.currentGraphics.clientSize.height));
205
208
  }
206
209
  else {
@@ -240,7 +243,12 @@ var PdfGridLayouter = /** @class */ (function (_super) {
240
243
  }
241
244
  if (!this.Grid.style.allowHorizontalOverflow) {
242
245
  this.columnRanges = [];
243
- this.Grid.measureColumnsWidth(this.currentBounds);
246
+ if (typeof this.Grid.isChildGrid !== 'undefined' && typeof this.Grid.isChildGrid) {
247
+ this.Grid.measureColumnsWidth(this.currentBounds);
248
+ }
249
+ else {
250
+ this.Grid.measureColumnsWidth(new RectangleF(this.currentBounds.x, this.currentBounds.y, this.currentBounds.x + this.currentBounds.width, this.currentBounds.height));
251
+ }
244
252
  this.columnRanges.push([0, this.Grid.columns.count - 1]);
245
253
  }
246
254
  else {
@@ -628,7 +636,7 @@ var PdfGridLayouter = /** @class */ (function (_super) {
628
636
  }
629
637
  row.grid.splitChildRowIndex = -1;
630
638
  row.grid.isGridSplit = false;
631
- rowResult.isFinish = true;
639
+ rowResult.isFinish = this.checkIsFisished(row);
632
640
  //row.NestedGridLayoutResult.bounds.height = row.rowBreakHeightValue;
633
641
  //this.currentBounds.y = rowResult.bounds.y;
634
642
  for (var i_4 = 0; i_4 < row.cells.count; i_4++) {
@@ -688,9 +696,10 @@ var PdfGridLayouter = /** @class */ (function (_super) {
688
696
  {
689
697
  this.currentBounds.y = format == null ? 0 : format.paginateBounds.y;
690
698
 
691
- }
692
- if (this.raiseBeforePageLayout(this.currentPage, this.currentBounds, this.currentRowIndex))
693
- break;*/
699
+ }*/
700
+ if (this.raiseBeforePageLayout(this.currentPage, this.currentBounds, this.currentRowIndex).returnValue) {
701
+ break;
702
+ }
694
703
  if ((param.format !== null) && !param.format.usePaginateBounds && param.bounds !== null &&
695
704
  param.bounds.height > 0 && !this.Grid.isChildGrid) {
696
705
  this.currentBounds.height = param.bounds.height;
@@ -700,6 +709,11 @@ var PdfGridLayouter = /** @class */ (function (_super) {
700
709
  }
701
710
  else {
702
711
  this.currentBounds.y = format == null ? 0 : format.paginateBounds.y;
712
+ if (format != null && (format.paginateBounds.x !== 0 || format.paginateBounds.y !== 0 || format.paginateBounds.height !== 0 || format.paginateBounds.width !== 0)) {
713
+ this.currentBounds.x = format.paginateBounds.x;
714
+ this.currentBounds.width = format.paginateBounds.width;
715
+ this.currentBounds.height = format.paginateBounds.height;
716
+ }
703
717
  }
704
718
  if (typeof param.format !== 'undefined' && (param.format !== null) && typeof param.format.usePaginateBounds !== 'undefined' && !param.format.usePaginateBounds && param.bounds !== null &&
705
719
  param.bounds.y > 0 && !this.Grid.isChildGrid) {
@@ -848,6 +862,15 @@ var PdfGridLayouter = /** @class */ (function (_super) {
848
862
  this.raisePageLayouted(result);
849
863
  return result;
850
864
  };
865
+ PdfGridLayouter.prototype.checkIsFisished = function (row) {
866
+ var result = true;
867
+ for (var i = 0; i < row.cells.count; i++) {
868
+ if (!row.cells.getCell(i).FinishedDrawingCell) {
869
+ result = false;
870
+ }
871
+ }
872
+ return result;
873
+ };
851
874
  /* tslint:enable */
852
875
  /**
853
876
  * Gets the `next page`.
@@ -930,7 +953,7 @@ var PdfGridLayouter = /** @class */ (function (_super) {
930
953
  var count = 0;
931
954
  for (var j = i, count_1 = (layoutedPages.size() / this.columnRanges.length); j < layoutedPages.size(); j += count_1) {
932
955
  var page = pages[j];
933
- if (document.pages.indexOf(page) === -1) {
956
+ if (typeof page !== 'undefined' && document.pages.indexOf(page) === -1) {
934
957
  document.pages.add(page);
935
958
  }
936
959
  }
@@ -992,7 +1015,7 @@ var PdfGridLayouter = /** @class */ (function (_super) {
992
1015
  // new SizeF(args.Bounds.width + args.Bounds.x ,
993
1016
  // args.Bounds.height)));
994
1017
  // }
995
- cancel = args.cancel;
1018
+ cancel = (typeof args.cancel === 'undefined' ? false : args.cancel);
996
1019
  currentBounds = args.bounds;
997
1020
  currentRow = args.startRowIndex;
998
1021
  }
@@ -1051,7 +1074,7 @@ var PdfGridLayouter = /** @class */ (function (_super) {
1051
1074
  // }
1052
1075
  }
1053
1076
  var calculatedHeight = row.rowBreakHeight > 0.0 ? row.rowBreakHeight : row.height;
1054
- if (this.Grid.isChildGrid && this.Grid.ParentCell != null) {
1077
+ if (typeof this.Grid.isChildGrid !== 'undefined' && this.Grid.isChildGrid && typeof this.Grid.ParentCell !== 'undefined' && this.Grid.ParentCell != null) {
1055
1078
  //Split row only if row height exceeds page height and AllowRowBreakAcrossPages is true.
1056
1079
  // if (calculatedHeight + this.Grid.ParentCell.row.grid.style.cellPadding.bottom +
1057
1080
  // this.Grid.ParentCell.row.grid.style.cellPadding.top > this.currentPageBounds.height) {
@@ -1081,7 +1104,7 @@ var PdfGridLayouter = /** @class */ (function (_super) {
1081
1104
  + calculatedHeight > this.currentBounds.height || this.currentBounds.y +
1082
1105
  this.Grid.ParentCell.row.grid.style.cellPadding.bottom + rowHeightWithSpan > this.currentPageBounds.height) {
1083
1106
  //If a row is repeated and still cannot fit in page, proceed draw.
1084
- if (this.Grid.ParentCell.row.grid.LayoutFormat.break === PdfLayoutBreakType.FitPage) {
1107
+ if (typeof this.Grid.ParentCell.row.grid.LayoutFormat !== 'undefined' && this.Grid.ParentCell.row.grid.LayoutFormat.break === PdfLayoutBreakType.FitPage) {
1085
1108
  PdfGridLayouter.repeatRowIndex = this.Grid.rows.rowCollection.indexOf(row);
1086
1109
  this.Grid.splitChildRowIndex = this.Grid.rows.rowCollection.indexOf(row);
1087
1110
  }
@@ -1151,7 +1174,7 @@ var PdfGridLayouter = /** @class */ (function (_super) {
1151
1174
  // If a row is repeated and still cannot fit in page, proceed draw.
1152
1175
  var isFit = false;
1153
1176
  if ((this.Grid.allowRowBreakAcrossPages && !this.Grid.repeatHeader && !row.isRowHeightSet && !row.rowMergeComplete)) {
1154
- if (this.Grid.LayoutFormat !== null && this.Grid.LayoutFormat.paginateBounds.height > 0 && typeof this.Grid.ParentCell !== 'undefined' && this.Grid.ParentCell !== null && (this.currentBounds.y + this.Grid.ParentCell.row.grid.style.cellPadding.bottom + calculatedHeight) > this.currentBounds.height) {
1177
+ if (this.Grid.LayoutFormat !== null && this.Grid.LayoutFormat.paginateBounds.height > 0) {
1155
1178
  isFit = this.isFitToCell((this.currentBounds.height + this.startLocation.y) - this.currentBounds.y, this.Grid, row);
1156
1179
  }
1157
1180
  else
@@ -1309,7 +1332,18 @@ var PdfGridLayouter = /** @class */ (function (_super) {
1309
1332
  isFit = false;
1310
1333
  break;
1311
1334
  }
1312
- else if (currentHeight > height || (typeof this.slr.remainder !== 'undefined' && this.slr.remainder !== null)) {
1335
+ if (gridRow.cells.getCell(i).style != null && gridRow.cells.getCell(i).style.borders != null && gridRow.cells.getCell(i).style.borders.top != null && gridRow.cells.getCell(i).style.borders.bottom != null)
1336
+ height += (gridRow.cells.getCell(i).style.borders.top.width + gridRow.cells.getCell(i).style.borders.bottom.width) * 2;
1337
+ if (this.slr.lineCount > 1 && gridRow.cells.getCell(i).stringFormat != null && gridRow.cells.getCell(i).stringFormat.lineSpacing != 0)
1338
+ height += (this.slr.lineCount - 1) * (gridRow.cells.getCell(i).style.stringFormat.lineSpacing);
1339
+ if (gridRow.cells.getCell(i).style.cellPadding == null) {
1340
+ height += (grid.style.cellPadding.top + grid.style.cellPadding.bottom);
1341
+ }
1342
+ else {
1343
+ height += (grid.style.cellPadding.top + grid.style.cellPadding.bottom);
1344
+ }
1345
+ height += grid.style.cellSpacing;
1346
+ if (currentHeight > height || (typeof this.slr.remainder !== 'undefined' && this.slr.remainder !== null)) {
1313
1347
  isFit = true;
1314
1348
  break;
1315
1349
  }
@@ -1373,9 +1407,7 @@ var PdfGridLayouter = /** @class */ (function (_super) {
1373
1407
  if (stringResult != null && typeof stringResult.remainder !== 'undefined') {
1374
1408
  row.cells.getCell(i).FinishedDrawingCell = false;
1375
1409
  row.cells.getCell(i).remainingString = stringResult.remainder == null ? ' ' : stringResult.remainder;
1376
- if (row.grid.isChildGrid) {
1377
- row.rowBreakHeight = calculateHeight - stringResult.actualSize.height;
1378
- }
1410
+ row.rowBreakHeight = calculateHeight - stringResult.actualSize.height;
1379
1411
  }
1380
1412
  }
1381
1413
  result.isFinish = (!result.isFinish) ? result.isFinish : row.cells.getCell(i).FinishedDrawingCell;
@@ -721,7 +721,7 @@ var PdfGridCell = /** @class */ (function () {
721
721
  }
722
722
  };
723
723
  // private setTransparency(graphics : PdfGraphics, pen : PdfPen) : void {
724
- // let alpha : number = (pen.color.a / 255)as number;
724
+ // let alpha : number = (pen.color.a / 255) as number;
725
725
  // graphics.save();
726
726
  // graphics.setTransparency(alpha);
727
727
  // }
@@ -98,6 +98,7 @@ export declare class PdfGridRow {
98
98
  repeatFlag: boolean;
99
99
  repeatRowNumber: number;
100
100
  rowFontSplit: boolean;
101
+ isHeaderRow: boolean;
101
102
  /**
102
103
  * Initializes a new instance of the `PdfGridRow` class with the parent grid.
103
104
  * @private
@@ -56,6 +56,7 @@ var PdfGridRow = /** @class */ (function () {
56
56
  this.isRowMergeComplete = true;
57
57
  this.repeatFlag = false;
58
58
  this.rowFontSplit = false;
59
+ this.isHeaderRow = false;
59
60
  this.pdfGrid = grid;
60
61
  }
61
62
  Object.defineProperty(PdfGridRow.prototype, "rowSpanExists", {
@@ -284,10 +285,10 @@ var PdfGridRow = /** @class */ (function () {
284
285
  this.rowMergeComplete = false;
285
286
  if (cell.rowSpan > 1) {
286
287
  var cellIn = i;
287
- var rowin = this.grid.rows.rowCollection.indexOf(this);
288
+ var rowin = this.isHeaderRow ? this.grid.headers.indexOf(this) : this.grid.rows.rowCollection.indexOf(this);
288
289
  for (var j = 0; j < cell.rowSpan; j++) {
289
290
  if ((j + 1) < cell.rowSpan) {
290
- this.grid.rows.getRow(rowin + j + 1).cells.getCell(cellIn).hasRowSpan = true;
291
+ (this.isHeaderRow ? this.grid.headers.getHeader(rowin + j + 1) : this.grid.rows.getRow(rowin + j + 1)).cells.getCell(cellIn).hasRowSpan = true;
291
292
  }
292
293
  }
293
294
  if (maxHeight < cell.height) {
@@ -432,6 +433,7 @@ var PdfGridHeaderCollection = /** @class */ (function () {
432
433
  var row = void 0;
433
434
  for (var i = 0; i < arg; i++) {
434
435
  row = new PdfGridRow(this.grid);
436
+ row.isHeaderRow = true;
435
437
  for (var j = 0; j < this.grid.columns.count; j++) {
436
438
  row.cells.add(new PdfGridCell());
437
439
  }
@@ -350,6 +350,20 @@ var PdfGrid = /** @class */ (function (_super) {
350
350
  * @private
351
351
  */
352
352
  PdfGrid.prototype.layout = function (param) {
353
+ var width = param.bounds.width;
354
+ var height = param.bounds.height;
355
+ var hasChanged = false;
356
+ if (typeof param.bounds.width === 'undefined' || param.bounds.width === 0) {
357
+ width = param.page.getClientSize().width - param.bounds.x;
358
+ hasChanged = true;
359
+ }
360
+ if (typeof param.bounds.height === 'undefined' || param.bounds.height === 0) {
361
+ height = param.page.getClientSize().height - param.bounds.y;
362
+ hasChanged = true;
363
+ }
364
+ if (hasChanged) {
365
+ param.bounds = new RectangleF(param.bounds.x, param.bounds.y, width, height);
366
+ }
353
367
  if (this.rows.count !== 0) {
354
368
  var currentRow = this.rows.getRow(0).cells.getCell(0).style;
355
369
  if (currentRow.borders != null && ((currentRow.borders.left != null && currentRow.borders.left.width !== 1) ||
package/license DELETED
@@ -1,3 +0,0 @@
1
- Licensing information is available in the following link
2
-
3
- https://www.syncfusion.com/content/downloads/syncfusion_license.pdf