@syncfusion/ej2-pdf-export 29.1.40 → 29.1.41

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.
@@ -3927,10 +3927,16 @@ var PdfColor = /** @__PURE__ @class */ (function () {
3927
3927
  this.greenColor = g;
3928
3928
  this.blueColor = b;
3929
3929
  if (typeof a === 'undefined') {
3930
- this.alpha = PdfColor.maxColourChannelValue;
3930
+ this.a = PdfColor.maxColourChannelValue;
3931
3931
  }
3932
3932
  else {
3933
- this.alpha = a;
3933
+ this.a = a;
3934
+ var isFractional = (a >= 0 && a <= 1);
3935
+ var scaleFactor = isFractional ? a : a / 255;
3936
+ var inverseScale = 1 - scaleFactor;
3937
+ this.redColor = Math.max(0, Math.min(255, Math.round(r * scaleFactor + PdfColor.maxColourChannelValue * inverseScale)));
3938
+ this.greenColor = Math.max(0, Math.min(255, Math.round(g * scaleFactor + PdfColor.maxColourChannelValue * inverseScale)));
3939
+ this.blueColor = Math.max(0, Math.min(255, Math.round(b * scaleFactor + PdfColor.maxColourChannelValue * inverseScale)));
3934
3940
  }
3935
3941
  this.filled = true;
3936
3942
  this.assignCMYK(r, g, b);
@@ -32297,7 +32303,7 @@ var PdfGrid = /** @__PURE__ @class */ (function (_super) {
32297
32303
  this.setSpan();
32298
32304
  this.checkSpan();
32299
32305
  this.layoutFormat = param.format;
32300
- this.gridLocation = param.bounds;
32306
+ this._gridLocation = param.bounds;
32301
32307
  var layouter = new PdfGridLayouter(this);
32302
32308
  var result = (layouter.Layouter(param));
32303
32309
  return result;
@@ -32545,8 +32551,8 @@ var PdfGrid = /** @__PURE__ @class */ (function (_super) {
32545
32551
  widths[n] = 0;
32546
32552
  }
32547
32553
  var cellWidth = 0;
32548
- if ((typeof this.isChildGrid === 'undefined' && typeof this.gridLocation !== 'undefined') || (this.isChildGrid === null && typeof this.gridLocation !== 'undefined')) {
32549
- this.initialWidth = this.gridLocation.width;
32554
+ if ((typeof this.isChildGrid === 'undefined' && typeof this._gridLocation !== 'undefined') || (this.isChildGrid === null && typeof this._gridLocation !== 'undefined')) {
32555
+ this.initialWidth = this._gridLocation.width;
32550
32556
  }
32551
32557
  if (this.headers.count > 0) {
32552
32558
  var colCount_1 = this.headers.getHeader(0).cells.count;
@@ -33708,6 +33714,7 @@ var PdfGridLayouter = /** @__PURE__ @class */ (function (_super) {
33708
33714
  var rowHeightWithSpan = 0;
33709
33715
  var size = new SizeF(0, 0);
33710
33716
  var isHeader = false;
33717
+ var allowRowBreak = true;
33711
33718
  if (row.rowSpanExists) {
33712
33719
  var maxSpan = 0;
33713
33720
  var currRowIndex = this.Grid.rows.rowCollection.indexOf(row);
@@ -33738,7 +33745,90 @@ var PdfGridLayouter = /** @__PURE__ @class */ (function (_super) {
33738
33745
  // }
33739
33746
  // if ((rowMaxHeight > rowHeightWithSpan) && flag) {
33740
33747
  // row.height += (rowMaxHeight - rowHeightWithSpan);
33741
- // }
33748
+ // }
33749
+ if ((rowHeightWithSpan > this.currentBounds.height ||
33750
+ rowHeightWithSpan + this.currentBounds.y > this.currentBounds.height)) {
33751
+ if (row.rowSpanExists &&
33752
+ (this.Grid.LayoutFormat.break === PdfLayoutBreakType.FitElement || !this.Grid.allowRowBreakAcrossPages)) {
33753
+ allowRowBreak = false;
33754
+ }
33755
+ }
33756
+ if ((rowHeightWithSpan > this.currentBounds.height || rowHeightWithSpan + this.currentBounds.y > this.currentBounds.height)
33757
+ && allowRowBreak) {
33758
+ rowHeightWithSpan = 0;
33759
+ row.isPageBreakRowSpanApplied = true;
33760
+ for (var i = 0; i < row.cells.count; i++) {
33761
+ var cell = row.cells.getCell(i);
33762
+ maxSpan = cell.rowSpan;
33763
+ for (var i_7 = currRowIndex; i_7 < currRowIndex + maxSpan; i_7++) {
33764
+ rowHeightWithSpan += isHeader ? this.Grid.headers.getHeader(i_7).height : this.Grid.rows.getRow(i_7).height;
33765
+ var layoutFormat = this.Grid.LayoutFormat;
33766
+ var currentBoundsHeight = this.currentPageBounds.height;
33767
+ if (layoutFormat.usePaginateBounds && layoutFormat.paginateBounds && layoutFormat.paginateBounds.height > 0) {
33768
+ var bottom = layoutFormat.paginateBounds.y + layoutFormat.paginateBounds.height;
33769
+ if (!this.Grid.isChildGrid && this.Grid.listOfNavigatePages.length === 1) {
33770
+ bottom += this.Grid._gridLocation.y;
33771
+ }
33772
+ if (bottom < currentBoundsHeight) {
33773
+ currentBoundsHeight = bottom;
33774
+ this.currentPageBounds.height = currentBoundsHeight;
33775
+ this.currentBounds.height = currentBoundsHeight;
33776
+ }
33777
+ }
33778
+ if ((this.currentBounds.y + rowHeightWithSpan) > currentBoundsHeight) {
33779
+ rowHeightWithSpan -= isHeader ? this.Grid.headers.getHeader(i_7).height : this.Grid.rows.getRow(i_7).height;
33780
+ for (var j = 0; j < this.Grid.rows.getRow(currRowIndex).cells.count; j++) {
33781
+ var newSpan = i_7 - currRowIndex;
33782
+ if (!isHeader &&
33783
+ this.Grid.rows.getRow(currRowIndex).cells.getCell(j).rowSpan === maxSpan &&
33784
+ newSpan !== 0) {
33785
+ var currCell = this.Grid.rows.getRow(currRowIndex).cells.getCell(j);
33786
+ var nextCell = this.Grid.rows.getRow(i_7).cells.getCell(j);
33787
+ currCell.rowSpan = newSpan === 0 ? 1 : newSpan;
33788
+ this.Grid.rows.getRow(currRowIndex).maximumRowSpan = newSpan === 0 ? 1 : newSpan;
33789
+ nextCell.rowSpan = maxSpan - newSpan;
33790
+ if (this.Grid.rows.getRow(i_7).maximumRowSpan < (maxSpan - newSpan)) {
33791
+ this.Grid.rows.getRow(i_7).maximumRowSpan = maxSpan - newSpan;
33792
+ }
33793
+ var pdfGrid = currCell.value;
33794
+ nextCell.stringFormat = currCell.stringFormat;
33795
+ nextCell.style = currCell.style;
33796
+ nextCell.style.backgroundImage = null;
33797
+ nextCell.columnSpan = currCell.columnSpan;
33798
+ if (pdfGrid instanceof PdfGrid &&
33799
+ this.currentBounds.y + pdfGrid.size.height + this.Grid.rows.getRow(i_7).height +
33800
+ pdfGrid.style.cellPadding.top + pdfGrid.style.cellPadding.bottom >= this.currentBounds.height) {
33801
+ nextCell.value = currCell.value;
33802
+ }
33803
+ else if (!(pdfGrid instanceof PdfGrid)) {
33804
+ nextCell.value = currCell.value;
33805
+ }
33806
+ if (i_7 > 0)
33807
+ this.Grid.rows.getRow(i_7 - 1).rowSpanExists = true;
33808
+ nextCell.isRowMergeContinue = false;
33809
+ nextCell.isRowMergeStart = true;
33810
+ }
33811
+ else if (isHeader &&
33812
+ this.Grid.headers.getHeader(currRowIndex).cells.getCell(j).rowSpan === maxSpan) {
33813
+ var headerCell = this.Grid.headers.getHeader(currRowIndex).cells.getCell(j);
33814
+ var nextHeaderCell = this.Grid.headers.getHeader(i_7).cells.getCell(j);
33815
+ headerCell.rowSpan = newSpan === 0 ? 1 : newSpan;
33816
+ nextHeaderCell.rowSpan = maxSpan - newSpan;
33817
+ nextHeaderCell.stringFormat = headerCell.stringFormat;
33818
+ nextHeaderCell.style = headerCell.style;
33819
+ nextHeaderCell.columnSpan = headerCell.columnSpan;
33820
+ nextHeaderCell.value = headerCell.value;
33821
+ this.Grid.headers.getHeader(i_7 - 1).rowSpanExists = false;
33822
+ nextHeaderCell.isRowMergeContinue = false;
33823
+ nextHeaderCell.isRowMergeStart = true;
33824
+ }
33825
+ }
33826
+ break;
33827
+ }
33828
+ }
33829
+ rowHeightWithSpan = 0;
33830
+ }
33831
+ }
33742
33832
  }
33743
33833
  var calculatedHeight = row.rowBreakHeight > 0.0 ? row.rowBreakHeight : row.height;
33744
33834
  if (typeof this.Grid.isChildGrid !== 'undefined' && this.Grid.isChildGrid && typeof this.Grid.ParentCell !== 'undefined' && this.Grid.ParentCell != null) {