@syncfusion/ej2-pdf-export 26.2.14 → 27.1.50

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.
@@ -27305,19 +27305,41 @@ class PdfGridCell {
27305
27305
  }
27306
27306
  else {
27307
27307
  if (this.style.cellPadding == null || typeof this.style.cellPadding === 'undefined') {
27308
- if (typeof this.gridRow.grid.style.cellPadding.left !== 'undefined' && this.gridRow.grid.style.cellPadding.hasLeftPad) {
27309
- returnBounds.x += this.gridRow.grid.style.cellPadding.left + this.cellStyle.borders.left.width;
27310
- returnBounds.width -= this.gridRow.grid.style.cellPadding.left;
27311
- }
27312
- if (typeof this.gridRow.grid.style.cellPadding.top !== 'undefined' && this.gridRow.grid.style.cellPadding.hasTopPad) {
27313
- returnBounds.y += this.gridRow.grid.style.cellPadding.top + this.cellStyle.borders.top.width;
27314
- returnBounds.height -= this.gridRow.grid.style.cellPadding.top;
27315
- }
27316
- if (typeof this.gridRow.grid.style.cellPadding.right !== 'undefined' && this.gridRow.grid.style.cellPadding.hasRightPad) {
27317
- returnBounds.width -= this.gridRow.grid.style.cellPadding.right;
27308
+ if (this.gridRow.grid.style.cellPadding !== null && typeof this.gridRow.grid.style.cellPadding !== 'undefined') {
27309
+ const hasLeftPad = this.gridRow.grid.style.cellPadding.hasLeftPad;
27310
+ const hasTopPad = this.gridRow.grid.style.cellPadding.hasTopPad;
27311
+ const hasRightPad = this.gridRow.grid.style.cellPadding.hasRightPad;
27312
+ const hasBottomPad = this.gridRow.grid.style.cellPadding.hasBottomPad;
27313
+ if (hasLeftPad || hasTopPad || hasRightPad || hasBottomPad) {
27314
+ if (typeof this.gridRow.grid.style.cellPadding.left !== 'undefined' && hasLeftPad) {
27315
+ returnBounds.x += this.gridRow.grid.style.cellPadding.left + this.cellStyle.borders.left.width;
27316
+ returnBounds.width -= this.gridRow.grid.style.cellPadding.left;
27317
+ }
27318
+ if (typeof this.gridRow.grid.style.cellPadding.top !== 'undefined' && hasTopPad) {
27319
+ returnBounds.y += this.gridRow.grid.style.cellPadding.top + this.cellStyle.borders.top.width;
27320
+ returnBounds.height -= this.gridRow.grid.style.cellPadding.top;
27321
+ }
27322
+ if (typeof this.gridRow.grid.style.cellPadding.right !== 'undefined' && hasRightPad) {
27323
+ returnBounds.width -= this.gridRow.grid.style.cellPadding.right;
27324
+ }
27325
+ if (typeof this.gridRow.grid.style.cellPadding.bottom !== 'undefined' && hasBottomPad) {
27326
+ returnBounds.height -= this.gridRow.grid.style.cellPadding.bottom;
27327
+ }
27328
+ }
27329
+ else {
27330
+ const format = this.getStringFormat();
27331
+ if (format.alignment === null || typeof format.alignment === 'undefined') {
27332
+ returnBounds.x += this.row.grid.style.cellPadding.left;
27333
+ returnBounds.y += this.row.grid.style.cellPadding.top;
27334
+ }
27335
+ }
27318
27336
  }
27319
- if (typeof this.gridRow.grid.style.cellPadding.bottom !== 'undefined' && this.gridRow.grid.style.cellPadding.hasBottomPad) {
27320
- returnBounds.height -= this.gridRow.grid.style.cellPadding.bottom;
27337
+ else {
27338
+ const format = this.getStringFormat();
27339
+ if (format.alignment === null || typeof format.alignment === 'undefined') {
27340
+ returnBounds.x += this.row.grid.style.cellPadding.left;
27341
+ returnBounds.y += this.row.grid.style.cellPadding.top;
27342
+ }
27321
27343
  }
27322
27344
  }
27323
27345
  else {
@@ -27541,12 +27563,13 @@ class PdfGridCell {
27541
27563
  }
27542
27564
  }
27543
27565
  else if (this.objectValue instanceof PdfImage || this.objectValue instanceof PdfBitmap) {
27544
- let imageBounds;
27545
- if (this.objectValue.width <= innerLayoutArea.width) {
27546
- imageBounds = new RectangleF(innerLayoutArea.x, innerLayoutArea.y, this.objectValue.width, innerLayoutArea.height);
27566
+ const imageBounds = new RectangleF(innerLayoutArea.x, innerLayoutArea.y, innerLayoutArea.width, innerLayoutArea.height);
27567
+ const image = this.objectValue;
27568
+ if (image.width <= innerLayoutArea.width) {
27569
+ imageBounds.width = image.width;
27547
27570
  }
27548
- else {
27549
- imageBounds = innerLayoutArea;
27571
+ if (image.height <= innerLayoutArea.height) {
27572
+ imageBounds.height = image.height;
27550
27573
  }
27551
27574
  graphics.drawImage(this.objectValue, imageBounds.x, imageBounds.y, imageBounds.width, imageBounds.height);
27552
27575
  }