@syncfusion/ej2-pdf-export 29.1.33 → 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.
@@ -3636,10 +3636,16 @@ class PdfColor {
3636
3636
  this.greenColor = g;
3637
3637
  this.blueColor = b;
3638
3638
  if (typeof a === 'undefined') {
3639
- this.alpha = PdfColor.maxColourChannelValue;
3639
+ this.a = PdfColor.maxColourChannelValue;
3640
3640
  }
3641
3641
  else {
3642
- this.alpha = a;
3642
+ this.a = a;
3643
+ const isFractional = (a >= 0 && a <= 1);
3644
+ const scaleFactor = isFractional ? a : a / 255;
3645
+ const inverseScale = 1 - scaleFactor;
3646
+ this.redColor = Math.max(0, Math.min(255, Math.round(r * scaleFactor + PdfColor.maxColourChannelValue * inverseScale)));
3647
+ this.greenColor = Math.max(0, Math.min(255, Math.round(g * scaleFactor + PdfColor.maxColourChannelValue * inverseScale)));
3648
+ this.blueColor = Math.max(0, Math.min(255, Math.round(b * scaleFactor + PdfColor.maxColourChannelValue * inverseScale)));
3643
3649
  }
3644
3650
  this.filled = true;
3645
3651
  this.assignCMYK(r, g, b);
@@ -16112,6 +16118,9 @@ class PdfGraphics {
16112
16118
  this.isOverloadWithPosition = false;
16113
16119
  this.isPointOverload = true;
16114
16120
  }
16121
+ else if (this.isOverloadWithPosition) {
16122
+ this.isOverloadWithPosition = false;
16123
+ }
16115
16124
  }
16116
16125
  this.getResources.getResources().requireProcedureSet(this.procedureSets.text);
16117
16126
  if (vAlignShift !== 0) {
@@ -29106,7 +29115,7 @@ class PdfGrid extends PdfLayoutElement {
29106
29115
  this.setSpan();
29107
29116
  this.checkSpan();
29108
29117
  this.layoutFormat = param.format;
29109
- this.gridLocation = param.bounds;
29118
+ this._gridLocation = param.bounds;
29110
29119
  let layouter = new PdfGridLayouter(this);
29111
29120
  let result = (layouter.Layouter(param));
29112
29121
  return result;
@@ -29354,8 +29363,8 @@ class PdfGrid extends PdfLayoutElement {
29354
29363
  widths[n] = 0;
29355
29364
  }
29356
29365
  let cellWidth = 0;
29357
- if ((typeof this.isChildGrid === 'undefined' && typeof this.gridLocation !== 'undefined') || (this.isChildGrid === null && typeof this.gridLocation !== 'undefined')) {
29358
- this.initialWidth = this.gridLocation.width;
29366
+ if ((typeof this.isChildGrid === 'undefined' && typeof this._gridLocation !== 'undefined') || (this.isChildGrid === null && typeof this._gridLocation !== 'undefined')) {
29367
+ this.initialWidth = this._gridLocation.width;
29359
29368
  }
29360
29369
  if (this.headers.count > 0) {
29361
29370
  let colCount = this.headers.getHeader(0).cells.count;
@@ -30494,6 +30503,7 @@ class PdfGridLayouter extends ElementLayouter {
30494
30503
  let result = new RowLayoutResult();
30495
30504
  let rowHeightWithSpan = 0;
30496
30505
  let isHeader = false;
30506
+ let allowRowBreak = true;
30497
30507
  if (row.rowSpanExists) {
30498
30508
  let maxSpan = 0;
30499
30509
  let currRowIndex = this.Grid.rows.rowCollection.indexOf(row);
@@ -30524,7 +30534,90 @@ class PdfGridLayouter extends ElementLayouter {
30524
30534
  // }
30525
30535
  // if ((rowMaxHeight > rowHeightWithSpan) && flag) {
30526
30536
  // row.height += (rowMaxHeight - rowHeightWithSpan);
30527
- // }
30537
+ // }
30538
+ if ((rowHeightWithSpan > this.currentBounds.height ||
30539
+ rowHeightWithSpan + this.currentBounds.y > this.currentBounds.height)) {
30540
+ if (row.rowSpanExists &&
30541
+ (this.Grid.LayoutFormat.break === PdfLayoutBreakType.FitElement || !this.Grid.allowRowBreakAcrossPages)) {
30542
+ allowRowBreak = false;
30543
+ }
30544
+ }
30545
+ if ((rowHeightWithSpan > this.currentBounds.height || rowHeightWithSpan + this.currentBounds.y > this.currentBounds.height)
30546
+ && allowRowBreak) {
30547
+ rowHeightWithSpan = 0;
30548
+ row.isPageBreakRowSpanApplied = true;
30549
+ for (let i = 0; i < row.cells.count; i++) {
30550
+ let cell = row.cells.getCell(i);
30551
+ maxSpan = cell.rowSpan;
30552
+ for (let i = currRowIndex; i < currRowIndex + maxSpan; i++) {
30553
+ rowHeightWithSpan += isHeader ? this.Grid.headers.getHeader(i).height : this.Grid.rows.getRow(i).height;
30554
+ const layoutFormat = this.Grid.LayoutFormat;
30555
+ let currentBoundsHeight = this.currentPageBounds.height;
30556
+ if (layoutFormat.usePaginateBounds && layoutFormat.paginateBounds && layoutFormat.paginateBounds.height > 0) {
30557
+ let bottom = layoutFormat.paginateBounds.y + layoutFormat.paginateBounds.height;
30558
+ if (!this.Grid.isChildGrid && this.Grid.listOfNavigatePages.length === 1) {
30559
+ bottom += this.Grid._gridLocation.y;
30560
+ }
30561
+ if (bottom < currentBoundsHeight) {
30562
+ currentBoundsHeight = bottom;
30563
+ this.currentPageBounds.height = currentBoundsHeight;
30564
+ this.currentBounds.height = currentBoundsHeight;
30565
+ }
30566
+ }
30567
+ if ((this.currentBounds.y + rowHeightWithSpan) > currentBoundsHeight) {
30568
+ rowHeightWithSpan -= isHeader ? this.Grid.headers.getHeader(i).height : this.Grid.rows.getRow(i).height;
30569
+ for (let j = 0; j < this.Grid.rows.getRow(currRowIndex).cells.count; j++) {
30570
+ const newSpan = i - currRowIndex;
30571
+ if (!isHeader &&
30572
+ this.Grid.rows.getRow(currRowIndex).cells.getCell(j).rowSpan === maxSpan &&
30573
+ newSpan !== 0) {
30574
+ const currCell = this.Grid.rows.getRow(currRowIndex).cells.getCell(j);
30575
+ const nextCell = this.Grid.rows.getRow(i).cells.getCell(j);
30576
+ currCell.rowSpan = newSpan === 0 ? 1 : newSpan;
30577
+ this.Grid.rows.getRow(currRowIndex).maximumRowSpan = newSpan === 0 ? 1 : newSpan;
30578
+ nextCell.rowSpan = maxSpan - newSpan;
30579
+ if (this.Grid.rows.getRow(i).maximumRowSpan < (maxSpan - newSpan)) {
30580
+ this.Grid.rows.getRow(i).maximumRowSpan = maxSpan - newSpan;
30581
+ }
30582
+ const pdfGrid = currCell.value;
30583
+ nextCell.stringFormat = currCell.stringFormat;
30584
+ nextCell.style = currCell.style;
30585
+ nextCell.style.backgroundImage = null;
30586
+ nextCell.columnSpan = currCell.columnSpan;
30587
+ if (pdfGrid instanceof PdfGrid &&
30588
+ this.currentBounds.y + pdfGrid.size.height + this.Grid.rows.getRow(i).height +
30589
+ pdfGrid.style.cellPadding.top + pdfGrid.style.cellPadding.bottom >= this.currentBounds.height) {
30590
+ nextCell.value = currCell.value;
30591
+ }
30592
+ else if (!(pdfGrid instanceof PdfGrid)) {
30593
+ nextCell.value = currCell.value;
30594
+ }
30595
+ if (i > 0)
30596
+ this.Grid.rows.getRow(i - 1).rowSpanExists = true;
30597
+ nextCell.isRowMergeContinue = false;
30598
+ nextCell.isRowMergeStart = true;
30599
+ }
30600
+ else if (isHeader &&
30601
+ this.Grid.headers.getHeader(currRowIndex).cells.getCell(j).rowSpan === maxSpan) {
30602
+ const headerCell = this.Grid.headers.getHeader(currRowIndex).cells.getCell(j);
30603
+ const nextHeaderCell = this.Grid.headers.getHeader(i).cells.getCell(j);
30604
+ headerCell.rowSpan = newSpan === 0 ? 1 : newSpan;
30605
+ nextHeaderCell.rowSpan = maxSpan - newSpan;
30606
+ nextHeaderCell.stringFormat = headerCell.stringFormat;
30607
+ nextHeaderCell.style = headerCell.style;
30608
+ nextHeaderCell.columnSpan = headerCell.columnSpan;
30609
+ nextHeaderCell.value = headerCell.value;
30610
+ this.Grid.headers.getHeader(i - 1).rowSpanExists = false;
30611
+ nextHeaderCell.isRowMergeContinue = false;
30612
+ nextHeaderCell.isRowMergeStart = true;
30613
+ }
30614
+ }
30615
+ break;
30616
+ }
30617
+ }
30618
+ rowHeightWithSpan = 0;
30619
+ }
30620
+ }
30528
30621
  }
30529
30622
  let calculatedHeight = row.rowBreakHeight > 0.0 ? row.rowBreakHeight : row.height;
30530
30623
  if (typeof this.Grid.isChildGrid !== 'undefined' && this.Grid.isChildGrid && typeof this.Grid.ParentCell !== 'undefined' && this.Grid.ParentCell != null) {