@syncfusion/ej2-pdf-export 23.1.43 → 23.2.6

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.
@@ -16888,7 +16888,12 @@ class PdfGraphicsState {
16888
16888
  this.pdfColorSpace = PdfColorSpace.Rgb;
16889
16889
  if (typeof graphics !== 'undefined') {
16890
16890
  this.pdfGraphics = graphics;
16891
- this.transformationMatrix = matrix;
16891
+ const elements = [];
16892
+ graphics.matrix.matrix.elements.forEach((element) => {
16893
+ elements.push(element);
16894
+ });
16895
+ this.transformationMatrix = new PdfTransformationMatrix();
16896
+ this.transformationMatrix.matrix = new Matrix(elements);
16892
16897
  }
16893
16898
  }
16894
16899
  // Properties
@@ -32320,9 +32325,6 @@ class PdfPageTemplateElement {
32320
32325
  draw(layer, document) {
32321
32326
  let page = layer.page;
32322
32327
  let bounds = this.calculateBounds(page, document);
32323
- if (bounds.x === -0) {
32324
- bounds.x = 0;
32325
- }
32326
32328
  layer.graphics.drawPdfTemplate(this.template, new PointF(bounds.x, bounds.y), new SizeF(bounds.width, bounds.height));
32327
32329
  }
32328
32330
  /**
@@ -32418,17 +32420,17 @@ class PdfPageTemplateElement {
32418
32420
  switch (this.alignmentStyle) {
32419
32421
  case PdfAlignmentStyle.TopLeft:
32420
32422
  if (this.type === TemplateType.Left) {
32421
- x = -actualBounds.x;
32423
+ x = this.convertSign(actualBounds.x);
32422
32424
  y = 0;
32423
32425
  }
32424
32426
  else if (this.type === TemplateType.Top) {
32425
- x = -actualBounds.x;
32426
- y = -actualBounds.y;
32427
+ x = this.convertSign(actualBounds.x);
32428
+ y = this.convertSign(actualBounds.y);
32427
32429
  }
32428
32430
  break;
32429
32431
  case PdfAlignmentStyle.TopCenter:
32430
32432
  x = (actualBounds.width - this.width) / 2;
32431
- y = -actualBounds.y;
32433
+ y = this.convertSign(actualBounds.y);
32432
32434
  break;
32433
32435
  case PdfAlignmentStyle.TopRight:
32434
32436
  if (this.type === TemplateType.Right) {
@@ -32437,11 +32439,11 @@ class PdfPageTemplateElement {
32437
32439
  }
32438
32440
  else if (this.type === TemplateType.Top) {
32439
32441
  x = actualBounds.width + section.getRightIndentWidth(document, page, false) - this.width;
32440
- y = -actualBounds.y;
32442
+ y = this.convertSign(actualBounds.y);
32441
32443
  }
32442
32444
  break;
32443
32445
  case PdfAlignmentStyle.MiddleLeft:
32444
- x = -actualBounds.x;
32446
+ x = this.convertSign(actualBounds.x);
32445
32447
  y = (actualBounds.height - this.height) / 2;
32446
32448
  break;
32447
32449
  case PdfAlignmentStyle.MiddleCenter:
@@ -32454,11 +32456,11 @@ class PdfPageTemplateElement {
32454
32456
  break;
32455
32457
  case PdfAlignmentStyle.BottomLeft:
32456
32458
  if (this.type === TemplateType.Left) {
32457
- x = -actualBounds.x;
32459
+ x = this.convertSign(actualBounds.x);
32458
32460
  y = actualBounds.height - this.height;
32459
32461
  }
32460
32462
  else if (this.type === TemplateType.Bottom) {
32461
- x = -actualBounds.x;
32463
+ x = this.convertSign(actualBounds.x);
32462
32464
  y = actualBounds.height + section.getBottomIndentHeight(document, page, false) - this.height;
32463
32465
  }
32464
32466
  break;
@@ -32557,18 +32559,18 @@ class PdfPageTemplateElement {
32557
32559
  let height = this.height;
32558
32560
  switch (this.dockStyle) {
32559
32561
  case PdfDockStyle.Left:
32560
- x = -actualBounds.x;
32562
+ x = this.convertSign(actualBounds.x);
32561
32563
  y = 0;
32562
32564
  width = this.width;
32563
32565
  height = actualBounds.height;
32564
32566
  break;
32565
32567
  case PdfDockStyle.Top:
32566
- x = -actualBounds.x;
32567
- y = -actualBounds.y;
32568
+ x = this.convertSign(actualBounds.x);
32569
+ y = this.convertSign(actualBounds.y);
32568
32570
  width = actualSize.width;
32569
32571
  height = this.height;
32570
32572
  if (actualBounds.height < 0) {
32571
- y = -actualBounds.y + actualSize.height;
32573
+ y = actualSize.height - actualBounds.y;
32572
32574
  }
32573
32575
  break;
32574
32576
  case PdfDockStyle.Right:
@@ -32578,7 +32580,7 @@ class PdfPageTemplateElement {
32578
32580
  height = actualBounds.height;
32579
32581
  break;
32580
32582
  case PdfDockStyle.Bottom:
32581
- x = -actualBounds.x;
32583
+ x = this.convertSign(actualBounds.x);
32582
32584
  y = actualBounds.height + section.getBottomIndentHeight(document, page, false) - this.height;
32583
32585
  width = actualSize.width;
32584
32586
  height = this.height;
@@ -32596,6 +32598,13 @@ class PdfPageTemplateElement {
32596
32598
  result = new RectangleF(x, y, width, height);
32597
32599
  return result;
32598
32600
  }
32601
+ /**
32602
+ * Ignore value zero, otherwise convert sign.
32603
+ * @private
32604
+ */
32605
+ convertSign(value) {
32606
+ return (value !== 0 || (value === 0 && 1 / value === -Infinity)) ? -value : value;
32607
+ }
32599
32608
  }
32600
32609
 
32601
32610
  /**