@syncfusion/ej2-pdf-export 28.1.33 → 28.2.3

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.
@@ -16358,8 +16358,8 @@ class PdfGraphics {
16358
16358
  let symbols = StringTokenizer.spaces;
16359
16359
  let whitespacesCount = StringTokenizer.getCharsCount(line, symbols);
16360
16360
  let hasSpaces = (whitespacesCount > 0 && line[0] !== StringTokenizer.whiteSpace);
16361
- let goodLineBreakStyle = ((lineInfo.lineType & LineType.LayoutBreak) > 0);
16362
- let shouldJustify = (justifyStyle && goodWidth && hasSpaces && (goodLineBreakStyle || format.alignment === PdfTextAlignment.Justify));
16361
+ let goodLineBreakStyle = ((lineInfo.lineType & LineType.LayoutBreak) > 0) || (format && format.wordWrap === PdfWordWrapType.None);
16362
+ let shouldJustify = (justifyStyle && goodWidth && hasSpaces && goodLineBreakStyle);
16363
16363
  return shouldJustify;
16364
16364
  }
16365
16365
  /**
@@ -21512,6 +21512,12 @@ class TextLayouter extends ElementLayouter {
21512
21512
  let brush = this.element.getBrush();
21513
21513
  if (this.element instanceof PdfTextWebLink) {
21514
21514
  brush.color = new PdfColor(0, 0, 255);
21515
+ if (!this.element._isLastElement && this.element.stringFormat && this.element.stringFormat.alignment === PdfTextAlignment.Justify) {
21516
+ stringResult.layoutLines[0].type = LineType.LayoutBreak | LineType.FirstParagraphLine;
21517
+ }
21518
+ }
21519
+ if (this.element && this.element instanceof PdfTextElement && !this.element._isLastElement && this.element.stringFormat && this.element.stringFormat.alignment === PdfTextAlignment.Justify) {
21520
+ stringResult.layoutLines[0].type = LineType.LayoutBreak | LineType.FirstParagraphLine;
21515
21521
  }
21516
21522
  graphics.drawStringLayoutResult(stringResult, this.element.font, this.element.pen, brush, currentBounds, this.format);
21517
21523
  let lineInfo = stringResult.lines[stringResult.lineCount - 1];
@@ -21610,6 +21616,7 @@ class PdfTextElement extends PdfLayoutElement {
21610
21616
  * @private
21611
21617
  */
21612
21618
  this.hasPointOverload = false;
21619
+ this._isLastElement = false;
21613
21620
  /**
21614
21621
  * indicate whether the PdfGridCell value is `PdfTextElement`
21615
21622
  * @default false
@@ -21844,6 +21851,9 @@ class PdfTextElement extends PdfLayoutElement {
21844
21851
  }
21845
21852
  param.bounds = bounds;
21846
21853
  }
21854
+ if (i === stringLayoutResult.lines.length - 1) {
21855
+ this._isLastElement = true;
21856
+ }
21847
21857
  layoutResult = this.layout(param);
21848
21858
  if (i !== (stringLayoutResult.lines.length - 1)) {
21849
21859
  bounds = new RectangleF(0, layoutResult.bounds.y + stringLayoutResult.lineHeight, layoutResult.page.graphics.clientSize.width, stringLayoutResult.lineHeight);
@@ -22155,6 +22165,9 @@ class PdfTextWebLink extends PdfTextElement {
22155
22165
  let layoutResult;
22156
22166
  for (let i = 0; i < result.layoutLines.length; i++) {
22157
22167
  let size = this.font.measureString(result.lines[i].text);
22168
+ if (i === result.layoutLines.length - 1 && this.stringFormat && this.stringFormat.alignment === PdfTextAlignment.Justify) {
22169
+ this._isLastElement = true;
22170
+ }
22158
22171
  let bounds = new RectangleF(location, size);
22159
22172
  if (i !== 0) {
22160
22173
  bounds.x = 0;