@syncfusion/ej2-pdf-export 26.2.11 → 27.1.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.
@@ -23095,10 +23095,8 @@ var PdfPaddings = /** @__PURE__ @class */ (function () {
23095
23095
  */
23096
23096
  this.hasBottomPad = false;
23097
23097
  if (typeof left === 'undefined') {
23098
- //5.76 and 0 are taken from ms-word default table margins.
23099
- this.leftPad = this.rightPad = 5.76;
23100
23098
  //0.5 is set for top and bottom by default.
23101
- this.bottomPad = this.topPad = 0.5;
23099
+ this.bottomPad = this.topPad = this.leftPad = this.rightPad = 0.5;
23102
23100
  }
23103
23101
  else {
23104
23102
  this.leftPad = left;
@@ -29637,10 +29635,6 @@ var PdfGridStyle = /** @__PURE__ @class */ (function (_super) {
29637
29635
  */
29638
29636
  function PdfGridStyle() {
29639
29637
  var _this = _super.call(this) || this;
29640
- /**
29641
- * @private
29642
- */
29643
- _this._isDefaultPadding = false;
29644
29638
  _this.gridBorderOverlapStyle = PdfBorderOverlapStyle.Overlap;
29645
29639
  _this.bAllowHorizontalOverflow = false;
29646
29640
  _this.gridHorizontalOverflowType = PdfHorizontalOverflowType.LastPage;
@@ -29700,7 +29694,6 @@ var PdfGridStyle = /** @__PURE__ @class */ (function (_super) {
29700
29694
  get: function () {
29701
29695
  if (typeof this.gridCellPadding === 'undefined') {
29702
29696
  this.gridCellPadding = new PdfPaddings();
29703
- this._isDefaultPadding = true;
29704
29697
  }
29705
29698
  return this.gridCellPadding;
29706
29699
  },
@@ -29712,7 +29705,6 @@ var PdfGridStyle = /** @__PURE__ @class */ (function (_super) {
29712
29705
  else {
29713
29706
  this.gridCellPadding = value;
29714
29707
  }
29715
- this._isDefaultPadding = false;
29716
29708
  },
29717
29709
  enumerable: true,
29718
29710
  configurable: true
@@ -30336,19 +30328,41 @@ var PdfGridCell = /** @__PURE__ @class */ (function () {
30336
30328
  }
30337
30329
  else {
30338
30330
  if (this.style.cellPadding == null || typeof this.style.cellPadding === 'undefined') {
30339
- if (typeof this.gridRow.grid.style.cellPadding.left !== 'undefined' && this.gridRow.grid.style.cellPadding.hasLeftPad) {
30340
- returnBounds.x += this.gridRow.grid.style.cellPadding.left + this.cellStyle.borders.left.width;
30341
- returnBounds.width -= this.gridRow.grid.style.cellPadding.left;
30342
- }
30343
- if (typeof this.gridRow.grid.style.cellPadding.top !== 'undefined' && this.gridRow.grid.style.cellPadding.hasTopPad) {
30344
- returnBounds.y += this.gridRow.grid.style.cellPadding.top + this.cellStyle.borders.top.width;
30345
- returnBounds.height -= this.gridRow.grid.style.cellPadding.top;
30346
- }
30347
- if (typeof this.gridRow.grid.style.cellPadding.right !== 'undefined' && this.gridRow.grid.style.cellPadding.hasRightPad) {
30348
- returnBounds.width -= this.gridRow.grid.style.cellPadding.right;
30331
+ if (this.gridRow.grid.style.cellPadding !== null && typeof this.gridRow.grid.style.cellPadding !== 'undefined') {
30332
+ var hasLeftPad = this.gridRow.grid.style.cellPadding.hasLeftPad;
30333
+ var hasTopPad = this.gridRow.grid.style.cellPadding.hasTopPad;
30334
+ var hasRightPad = this.gridRow.grid.style.cellPadding.hasRightPad;
30335
+ var hasBottomPad = this.gridRow.grid.style.cellPadding.hasBottomPad;
30336
+ if (hasLeftPad || hasTopPad || hasRightPad || hasBottomPad) {
30337
+ if (typeof this.gridRow.grid.style.cellPadding.left !== 'undefined' && hasLeftPad) {
30338
+ returnBounds.x += this.gridRow.grid.style.cellPadding.left + this.cellStyle.borders.left.width;
30339
+ returnBounds.width -= this.gridRow.grid.style.cellPadding.left;
30340
+ }
30341
+ if (typeof this.gridRow.grid.style.cellPadding.top !== 'undefined' && hasTopPad) {
30342
+ returnBounds.y += this.gridRow.grid.style.cellPadding.top + this.cellStyle.borders.top.width;
30343
+ returnBounds.height -= this.gridRow.grid.style.cellPadding.top;
30344
+ }
30345
+ if (typeof this.gridRow.grid.style.cellPadding.right !== 'undefined' && hasRightPad) {
30346
+ returnBounds.width -= this.gridRow.grid.style.cellPadding.right;
30347
+ }
30348
+ if (typeof this.gridRow.grid.style.cellPadding.bottom !== 'undefined' && hasBottomPad) {
30349
+ returnBounds.height -= this.gridRow.grid.style.cellPadding.bottom;
30350
+ }
30351
+ }
30352
+ else {
30353
+ var format = this.getStringFormat();
30354
+ if (format.alignment === null || typeof format.alignment === 'undefined') {
30355
+ returnBounds.x += this.row.grid.style.cellPadding.left;
30356
+ returnBounds.y += this.row.grid.style.cellPadding.top;
30357
+ }
30358
+ }
30349
30359
  }
30350
- if (typeof this.gridRow.grid.style.cellPadding.bottom !== 'undefined' && this.gridRow.grid.style.cellPadding.hasBottomPad) {
30351
- returnBounds.height -= this.gridRow.grid.style.cellPadding.bottom;
30360
+ else {
30361
+ var format = this.getStringFormat();
30362
+ if (format.alignment === null || typeof format.alignment === 'undefined') {
30363
+ returnBounds.x += this.row.grid.style.cellPadding.left;
30364
+ returnBounds.y += this.row.grid.style.cellPadding.top;
30365
+ }
30352
30366
  }
30353
30367
  }
30354
30368
  else {
@@ -30572,12 +30586,13 @@ var PdfGridCell = /** @__PURE__ @class */ (function () {
30572
30586
  }
30573
30587
  }
30574
30588
  else if (this.objectValue instanceof PdfImage || this.objectValue instanceof PdfBitmap) {
30575
- var imageBounds = void 0;
30576
- if (this.objectValue.width <= innerLayoutArea.width) {
30577
- imageBounds = new RectangleF(innerLayoutArea.x, innerLayoutArea.y, this.objectValue.width, innerLayoutArea.height);
30589
+ var imageBounds = new RectangleF(innerLayoutArea.x, innerLayoutArea.y, innerLayoutArea.width, innerLayoutArea.height);
30590
+ var image = this.objectValue;
30591
+ if (image.width <= innerLayoutArea.width) {
30592
+ imageBounds.width = image.width;
30578
30593
  }
30579
- else {
30580
- imageBounds = innerLayoutArea;
30594
+ if (image.height <= innerLayoutArea.height) {
30595
+ imageBounds.height = image.height;
30581
30596
  }
30582
30597
  graphics.drawImage(this.objectValue, imageBounds.x, imageBounds.y, imageBounds.width, imageBounds.height);
30583
30598
  }
@@ -33267,7 +33282,11 @@ var PdfGridLayouter = /** @__PURE__ @class */ (function (_super) {
33267
33282
  var cell = row.cells.getCell(c);
33268
33283
  var cellWidth = 0;
33269
33284
  var totalwidth = 0;
33285
+ var childGridCell = void 0;
33270
33286
  if (cell.value instanceof PdfGrid) {
33287
+ if (!childGridCell) {
33288
+ childGridCell = cell;
33289
+ }
33271
33290
  for (var i_6 = 0; i_6 < cell.value.columns.count; i_6++) {
33272
33291
  totalwidth += cell.value.columns.getColumn(i_6).columnWidth;
33273
33292
  }
@@ -33281,13 +33300,16 @@ var PdfGridLayouter = /** @__PURE__ @class */ (function (_super) {
33281
33300
  }
33282
33301
  else
33283
33302
  cellWidth = Math.max(totalwidth, row.grid.columns.getColumn(c).width);
33284
- if (!this.Grid.style._isDefaultPadding) {
33285
- var bottomPadding = this.Grid.style.cellPadding.top + this.Grid.style.cellPadding.bottom;
33286
- bottomPadding += cell.style.borders.top.width + cell.style.borders.bottom.width;
33287
- if ((height + bottomPadding) < pageGraphics.clientSize.height) {
33288
- height += bottomPadding;
33289
- this.currentBounds.y += bottomPadding;
33290
- }
33303
+ var bottomPadding = void 0;
33304
+ if (childGridCell && childGridCell.style && childGridCell.style.cellPadding) {
33305
+ bottomPadding = childGridCell.style.cellPadding.bottom;
33306
+ }
33307
+ else {
33308
+ bottomPadding = this.Grid.style.cellPadding.bottom;
33309
+ }
33310
+ if (typeof bottomPadding === 'number' && (height + bottomPadding) < pageGraphics.clientSize.height) {
33311
+ height += bottomPadding;
33312
+ this.currentBounds.y += bottomPadding;
33291
33313
  }
33292
33314
  cell.drawCellBorders(pageGraphics, new RectangleF(location_2, new SizeF(cellWidth, height)));
33293
33315
  var rowWidth = this.Grid.rows.getRow(this.Grid.rows.count - 1).width;