@syncfusion/ej2-pdf-export 24.1.41 → 24.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.
Files changed (164) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/ej2-pdf-export.min.js +2 -2
  3. package/dist/ej2-pdf-export.umd.min.js +2 -2
  4. package/dist/ej2-pdf-export.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-pdf-export.es2015.js +157 -28
  6. package/dist/es6/ej2-pdf-export.es2015.js.map +1 -1
  7. package/dist/es6/ej2-pdf-export.es5.js +157 -28
  8. package/dist/es6/ej2-pdf-export.es5.js.map +1 -1
  9. package/dist/global/ej2-pdf-export.min.js +2 -2
  10. package/dist/global/ej2-pdf-export.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +6 -6
  13. package/src/implementation/graphics/pdf-graphics.d.ts +35 -0
  14. package/src/implementation/graphics/pdf-graphics.js +157 -29
  15. package/dist/ts/implementation/actions/action.ts +0 -76
  16. package/dist/ts/implementation/actions/uri-action.ts +0 -52
  17. package/dist/ts/implementation/annotations/action-link-annotation.ts +0 -43
  18. package/dist/ts/implementation/annotations/annotation-collection.ts +0 -159
  19. package/dist/ts/implementation/annotations/annotation.ts +0 -241
  20. package/dist/ts/implementation/annotations/document-link-annotation.ts +0 -118
  21. package/dist/ts/implementation/annotations/link-annotation.ts +0 -32
  22. package/dist/ts/implementation/annotations/pdf-text-web-link.ts +0 -265
  23. package/dist/ts/implementation/annotations/uri-annotation.ts +0 -86
  24. package/dist/ts/implementation/collections/dictionary.ts +0 -150
  25. package/dist/ts/implementation/collections/object-object-pair/dictionary.ts +0 -125
  26. package/dist/ts/implementation/collections/utils.ts +0 -38
  27. package/dist/ts/implementation/document/automatic-fields/automatic-field-info-collection.ts +0 -39
  28. package/dist/ts/implementation/document/automatic-fields/automatic-field-info.ts +0 -108
  29. package/dist/ts/implementation/document/automatic-fields/automatic-field.ts +0 -127
  30. package/dist/ts/implementation/document/automatic-fields/composite-field.ts +0 -76
  31. package/dist/ts/implementation/document/automatic-fields/multiple-value-field.ts +0 -37
  32. package/dist/ts/implementation/document/automatic-fields/page-count-field.ts +0 -75
  33. package/dist/ts/implementation/document/automatic-fields/pdf-numbers-convertor.ts +0 -157
  34. package/dist/ts/implementation/document/automatic-fields/pdf-page-number-field.ts +0 -82
  35. package/dist/ts/implementation/document/automatic-fields/pdf-template-value-pair.ts +0 -60
  36. package/dist/ts/implementation/document/automatic-fields/single-value-field.ts +0 -48
  37. package/dist/ts/implementation/document/pdf-catalog.ts +0 -65
  38. package/dist/ts/implementation/document/pdf-document-base.ts +0 -180
  39. package/dist/ts/implementation/document/pdf-document-template.ts +0 -310
  40. package/dist/ts/implementation/document/pdf-document.ts +0 -342
  41. package/dist/ts/implementation/document/pdf-viewer-preferences.ts +0 -578
  42. package/dist/ts/implementation/drawing/pdf-drawing.ts +0 -218
  43. package/dist/ts/implementation/general/enum.ts +0 -21
  44. package/dist/ts/implementation/general/functions/pdf-function.ts +0 -66
  45. package/dist/ts/implementation/general/functions/pdf-sampled-function.ts +0 -63
  46. package/dist/ts/implementation/general/pdf-cache-collection.ts +0 -97
  47. package/dist/ts/implementation/general/pdf-collection.ts +0 -41
  48. package/dist/ts/implementation/general/pdf-destination.ts +0 -170
  49. package/dist/ts/implementation/graphics/brushes/enum.ts +0 -237
  50. package/dist/ts/implementation/graphics/brushes/pdf-blend.ts +0 -294
  51. package/dist/ts/implementation/graphics/brushes/pdf-brush.ts +0 -68
  52. package/dist/ts/implementation/graphics/brushes/pdf-brushes.ts +0 -2438
  53. package/dist/ts/implementation/graphics/brushes/pdf-color-blend.ts +0 -295
  54. package/dist/ts/implementation/graphics/brushes/pdf-gradient-brush.ts +0 -311
  55. package/dist/ts/implementation/graphics/brushes/pdf-linear-gradient-brush.ts +0 -406
  56. package/dist/ts/implementation/graphics/brushes/pdf-radial-gradient-brush.ts +0 -290
  57. package/dist/ts/implementation/graphics/brushes/pdf-solid-brush.ts +0 -107
  58. package/dist/ts/implementation/graphics/brushes/pdf-tiling-brush.ts +0 -304
  59. package/dist/ts/implementation/graphics/constants.ts +0 -31
  60. package/dist/ts/implementation/graphics/enum.ts +0 -413
  61. package/dist/ts/implementation/graphics/figures/arc.ts +0 -133
  62. package/dist/ts/implementation/graphics/figures/base/draw-element.ts +0 -59
  63. package/dist/ts/implementation/graphics/figures/base/element-layouter.ts +0 -260
  64. package/dist/ts/implementation/graphics/figures/base/fill-element.ts +0 -72
  65. package/dist/ts/implementation/graphics/figures/base/graphics-element.ts +0 -34
  66. package/dist/ts/implementation/graphics/figures/base/pdf-shape-element.ts +0 -69
  67. package/dist/ts/implementation/graphics/figures/base/shape-layouter.ts +0 -276
  68. package/dist/ts/implementation/graphics/figures/base/text-layouter.ts +0 -205
  69. package/dist/ts/implementation/graphics/figures/ellipse-part.ts +0 -76
  70. package/dist/ts/implementation/graphics/figures/enum.ts +0 -80
  71. package/dist/ts/implementation/graphics/figures/layout-element.ts +0 -132
  72. package/dist/ts/implementation/graphics/figures/path.ts +0 -646
  73. package/dist/ts/implementation/graphics/figures/pdf-template.ts +0 -205
  74. package/dist/ts/implementation/graphics/figures/rectangle-area.ts +0 -108
  75. package/dist/ts/implementation/graphics/figures/text-element.ts +0 -445
  76. package/dist/ts/implementation/graphics/fonts/enum.ts +0 -385
  77. package/dist/ts/implementation/graphics/fonts/pdf-font-metrics.ts +0 -248
  78. package/dist/ts/implementation/graphics/fonts/pdf-font.ts +0 -316
  79. package/dist/ts/implementation/graphics/fonts/pdf-standard-font-metrics-factory.ts +0 -606
  80. package/dist/ts/implementation/graphics/fonts/pdf-standard-font.ts +0 -243
  81. package/dist/ts/implementation/graphics/fonts/pdf-string-format.ts +0 -474
  82. package/dist/ts/implementation/graphics/fonts/pdf-true-type-font.ts +0 -165
  83. package/dist/ts/implementation/graphics/fonts/rtl/rtl-bidirectional.ts +0 -958
  84. package/dist/ts/implementation/graphics/fonts/rtl/rtl-text-shape.ts +0 -374
  85. package/dist/ts/implementation/graphics/fonts/rtl-renderer.ts +0 -255
  86. package/dist/ts/implementation/graphics/fonts/string-layouter.ts +0 -617
  87. package/dist/ts/implementation/graphics/fonts/string-tokenizer.ts +0 -275
  88. package/dist/ts/implementation/graphics/fonts/ttf-OS2-Table.ts +0 -206
  89. package/dist/ts/implementation/graphics/fonts/ttf-apple-cmap-sub-table.ts +0 -18
  90. package/dist/ts/implementation/graphics/fonts/ttf-cmap-sub-table.ts +0 -18
  91. package/dist/ts/implementation/graphics/fonts/ttf-cmap-table.ts +0 -14
  92. package/dist/ts/implementation/graphics/fonts/ttf-glyph-header.ts +0 -26
  93. package/dist/ts/implementation/graphics/fonts/ttf-glyph-info.ts +0 -35
  94. package/dist/ts/implementation/graphics/fonts/ttf-head-table.ts +0 -94
  95. package/dist/ts/implementation/graphics/fonts/ttf-horizontal-header-table.ts +0 -56
  96. package/dist/ts/implementation/graphics/fonts/ttf-loca-table.ts +0 -10
  97. package/dist/ts/implementation/graphics/fonts/ttf-long-hor-metric.ts +0 -14
  98. package/dist/ts/implementation/graphics/fonts/ttf-metrics.ts +0 -106
  99. package/dist/ts/implementation/graphics/fonts/ttf-microsoft-cmap-sub-table.ts +0 -58
  100. package/dist/ts/implementation/graphics/fonts/ttf-name-record.ts +0 -33
  101. package/dist/ts/implementation/graphics/fonts/ttf-name-table.ts +0 -22
  102. package/dist/ts/implementation/graphics/fonts/ttf-post-table.ts +0 -42
  103. package/dist/ts/implementation/graphics/fonts/ttf-reader.ts +0 -1254
  104. package/dist/ts/implementation/graphics/fonts/ttf-table-info.ts +0 -26
  105. package/dist/ts/implementation/graphics/fonts/ttf-trimmed-cmap-sub-table.ts +0 -26
  106. package/dist/ts/implementation/graphics/fonts/unicode-true-type-font.ts +0 -577
  107. package/dist/ts/implementation/graphics/images/byte-array.ts +0 -137
  108. package/dist/ts/implementation/graphics/images/image-decoder.ts +0 -439
  109. package/dist/ts/implementation/graphics/images/pdf-bitmap.ts +0 -110
  110. package/dist/ts/implementation/graphics/images/pdf-image.ts +0 -132
  111. package/dist/ts/implementation/graphics/pdf-color.ts +0 -478
  112. package/dist/ts/implementation/graphics/pdf-graphics.ts +0 -2429
  113. package/dist/ts/implementation/graphics/pdf-margins.ts +0 -124
  114. package/dist/ts/implementation/graphics/pdf-pen.ts +0 -370
  115. package/dist/ts/implementation/graphics/pdf-resources.ts +0 -300
  116. package/dist/ts/implementation/graphics/pdf-transformation-matrix.ts +0 -246
  117. package/dist/ts/implementation/graphics/pdf-transparency.ts +0 -93
  118. package/dist/ts/implementation/graphics/unit-convertor.ts +0 -96
  119. package/dist/ts/implementation/input-output/big-endian-writer.ts +0 -121
  120. package/dist/ts/implementation/input-output/cross-table.ts +0 -21
  121. package/dist/ts/implementation/input-output/enum.ts +0 -16
  122. package/dist/ts/implementation/input-output/pdf-cross-table.ts +0 -524
  123. package/dist/ts/implementation/input-output/pdf-dictionary-properties.ts +0 -571
  124. package/dist/ts/implementation/input-output/pdf-main-object-collection.ts +0 -194
  125. package/dist/ts/implementation/input-output/pdf-operators.ts +0 -363
  126. package/dist/ts/implementation/input-output/pdf-stream-writer.ts +0 -681
  127. package/dist/ts/implementation/input-output/pdf-writer.ts +0 -88
  128. package/dist/ts/implementation/pages/enum.ts +0 -201
  129. package/dist/ts/implementation/pages/page-added-event-arguments.ts +0 -39
  130. package/dist/ts/implementation/pages/pdf-document-page-collection.ts +0 -180
  131. package/dist/ts/implementation/pages/pdf-page-base.ts +0 -181
  132. package/dist/ts/implementation/pages/pdf-page-layer-collection.ts +0 -348
  133. package/dist/ts/implementation/pages/pdf-page-layer.ts +0 -271
  134. package/dist/ts/implementation/pages/pdf-page-settings.ts +0 -192
  135. package/dist/ts/implementation/pages/pdf-page-size.ts +0 -162
  136. package/dist/ts/implementation/pages/pdf-page-template-element.ts +0 -663
  137. package/dist/ts/implementation/pages/pdf-page.ts +0 -235
  138. package/dist/ts/implementation/pages/pdf-section-collection.ts +0 -187
  139. package/dist/ts/implementation/pages/pdf-section-page-collection.ts +0 -61
  140. package/dist/ts/implementation/pages/pdf-section-templates.ts +0 -96
  141. package/dist/ts/implementation/pages/pdf-section.ts +0 -644
  142. package/dist/ts/implementation/primitives/pdf-array.ts +0 -386
  143. package/dist/ts/implementation/primitives/pdf-boolean.ts +0 -119
  144. package/dist/ts/implementation/primitives/pdf-dictionary.ts +0 -513
  145. package/dist/ts/implementation/primitives/pdf-name.ts +0 -218
  146. package/dist/ts/implementation/primitives/pdf-number.ts +0 -165
  147. package/dist/ts/implementation/primitives/pdf-reference.ts +0 -430
  148. package/dist/ts/implementation/primitives/pdf-stream.ts +0 -306
  149. package/dist/ts/implementation/primitives/pdf-string.ts +0 -397
  150. package/dist/ts/implementation/structured-elements/grid/layout/grid-layouter.ts +0 -2027
  151. package/dist/ts/implementation/structured-elements/grid/pdf-grid-cell.ts +0 -1193
  152. package/dist/ts/implementation/structured-elements/grid/pdf-grid-column.ts +0 -206
  153. package/dist/ts/implementation/structured-elements/grid/pdf-grid-row.ts +0 -470
  154. package/dist/ts/implementation/structured-elements/grid/pdf-grid.ts +0 -853
  155. package/dist/ts/implementation/structured-elements/grid/styles/pdf-borders.ts +0 -240
  156. package/dist/ts/implementation/structured-elements/grid/styles/style.ts +0 -424
  157. package/dist/ts/implementation/structured-elements/tables/light-tables/enum.ts +0 -16
  158. package/dist/ts/interfaces/i-pdf-cache.ts +0 -23
  159. package/dist/ts/interfaces/i-pdf-changable.ts +0 -17
  160. package/dist/ts/interfaces/i-pdf-clonable.ts +0 -12
  161. package/dist/ts/interfaces/i-pdf-primitives.ts +0 -45
  162. package/dist/ts/interfaces/i-pdf-true-type-font.ts +0 -48
  163. package/dist/ts/interfaces/i-pdf-wrapper.ts +0 -13
  164. package/dist/ts/interfaces/i-pdf-writer.ts +0 -29
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 24.1.41
3
+ * version : 24.2.3
4
4
  * Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-pdf-export@*",
3
- "_id": "@syncfusion/ej2-pdf-export@24.1.1",
3
+ "_id": "@syncfusion/ej2-pdf-export@24.1.47",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-KQfl/Tro32JLbE459/DugsvWfwNSDKwv1h009Zzd7VXKkOHUE+8931GvO5f4+xv3YhdSryJxDQn9IWbuFo8urg==",
5
+ "_integrity": "sha512-rhlb4s7U57Fcqqei6eLYCTqiVtswVoUnpQd3bMaIJgOwa0oTFqESjGeRVw99HAfNJenof+YMwGqZnyWGw4/puA==",
6
6
  "_location": "/@syncfusion/ej2-pdf-export",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -27,8 +27,8 @@
27
27
  "/@syncfusion/ej2-pivotview",
28
28
  "/@syncfusion/ej2-treemap"
29
29
  ],
30
- "_resolved": "https://nexus.syncfusion.com/repository/ej2-release/@syncfusion/ej2-pdf-export/-/ej2-pdf-export-24.1.1.tgz",
31
- "_shasum": "7b39165b57c0d82fad694d90a2a7161f0d516be0",
30
+ "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-pdf-export/-/ej2-pdf-export-24.1.47.tgz",
31
+ "_shasum": "70db376a52b70e0893b9112b7ea318da25009978",
32
32
  "_spec": "@syncfusion/ej2-pdf-export@*",
33
33
  "_where": "/jenkins/workspace/elease-automation_release_24.1.1/packages/included",
34
34
  "author": {
@@ -36,7 +36,7 @@
36
36
  },
37
37
  "bundleDependencies": false,
38
38
  "dependencies": {
39
- "@syncfusion/ej2-compression": "~24.1.41"
39
+ "@syncfusion/ej2-compression": "~24.2.3"
40
40
  },
41
41
  "deprecated": false,
42
42
  "description": "Syncfusion TypeScript Component",
@@ -47,7 +47,7 @@
47
47
  "module": "./index.js",
48
48
  "name": "@syncfusion/ej2-pdf-export",
49
49
  "typings": "index.d.ts",
50
- "version": "24.1.41",
50
+ "version": "24.2.3",
51
51
  "sideEffects": false,
52
52
  "homepage": "https://www.syncfusion.com/javascript-ui-controls"
53
53
  }
@@ -300,6 +300,8 @@ export declare class PdfGraphics {
300
300
  * @private
301
301
  */
302
302
  private startCutIndex;
303
+ private _pathPoints;
304
+ private _pathTypes;
303
305
  /**
304
306
  * Returns the `result` after drawing string.
305
307
  * @private
@@ -528,6 +530,38 @@ export declare class PdfGraphics {
528
530
  * @param height Height of the rectangle to draw.
529
531
  */
530
532
  drawRectangle(pen: PdfPen, brush: PdfBrush, x: number, y: number, width: number, height: number): void;
533
+ /**
534
+ * Draw rounded rectangle specified by a brush, pen, coordinate pair, a width, a height and a radius.
535
+ * ```typescript
536
+ * // Create a new PDF document.
537
+ * let document : PdfDocument = new PdfDocument();
538
+ * // Create a new page
539
+ * let page : PdfPage = document.pages.add();
540
+ * // Create brush for draw rectangle
541
+ * let brush : PdfSolidBrush = new PdfSolidBrush(new PdfColor(238, 130, 238));
542
+ * // Create a new PDF pen
543
+ * let pen: PdfPen = new PdfPen(new PdfColor(255, 0, 0), 1);
544
+ * // Draw rounded rectangle
545
+ * page.graphics.drawRoundedRectangle(pen, brush, 20, 20, 100, 50, 5);
546
+ * // save the document
547
+ * document.save('output.pdf');
548
+ * // destroy the document
549
+ * document.destroy();
550
+ * ```
551
+ * @param pen Stoke color of the rectangle.
552
+ * @param brush Fill color of the rectangle.
553
+ * @param x The x-coordinate of the upper-left corner of the rectangle to draw.
554
+ * @param y The y-coordinate of the upper-left corner of the rectangle to draw.
555
+ * @param width Width of the rectangle to draw.
556
+ * @param height Height of the rectangle to draw.
557
+ * @param radius Radius of the arcs to draw.
558
+ */
559
+ drawRoundedRectangle(pen: PdfPen, brush: PdfBrush, x: number, y: number, width: number, height: number, radius: number): void;
560
+ private _addArc;
561
+ private _addArcPoints;
562
+ private _getLastPoint;
563
+ private _addPoint;
564
+ private _getBezierArcPoints;
531
565
  /**
532
566
  * `Draws the path`.
533
567
  * @private
@@ -984,6 +1018,7 @@ export declare class PdfGraphics {
984
1018
  * @param path Draw path.
985
1019
  */
986
1020
  drawPath(pen: PdfPen, brush: PdfBrush, path: PdfPath): void;
1021
+ private _drawPath;
987
1022
  /**
988
1023
  * `Draws the specified arc`, using its original physical size, at the location specified by a coordinate pair.
989
1024
  * ```typescript
@@ -395,7 +395,6 @@ var PdfGraphics = /** @class */ (function () {
395
395
  this.getResources.getResources().requireProcedureSet(this.procedureSets.text);
396
396
  }
397
397
  };
398
- /* tslint:disable */
399
398
  /**
400
399
  * @public
401
400
  */
@@ -433,7 +432,7 @@ var PdfGraphics = /** @class */ (function () {
433
432
  this.pdfStringLayoutResult = result;
434
433
  this.isUseFontSize = false;
435
434
  }
436
- }; /* tslint:enable */
435
+ };
437
436
  PdfGraphics.prototype.drawLine = function (arg1, arg2, arg3, arg4, arg5) {
438
437
  if (arg2 instanceof PointF) {
439
438
  var temparg2 = arg2;
@@ -453,7 +452,6 @@ var PdfGraphics = /** @class */ (function () {
453
452
  this.getResources.getResources().requireProcedureSet(this.procedureSets.pdf);
454
453
  }
455
454
  };
456
- /* tslint:disable */
457
455
  PdfGraphics.prototype.drawRectangle = function (arg1, arg2, arg3, arg4, arg5, arg6) {
458
456
  if (arg1 instanceof PdfPen && typeof arg2 === 'number') {
459
457
  var temparg3 = arg3;
@@ -494,6 +492,152 @@ var PdfGraphics = /** @class */ (function () {
494
492
  this.drawPathHelper(temparg1, temparg2, false);
495
493
  }
496
494
  };
495
+ /**
496
+ * Draw rounded rectangle specified by a brush, pen, coordinate pair, a width, a height and a radius.
497
+ * ```typescript
498
+ * // Create a new PDF document.
499
+ * let document : PdfDocument = new PdfDocument();
500
+ * // Create a new page
501
+ * let page : PdfPage = document.pages.add();
502
+ * // Create brush for draw rectangle
503
+ * let brush : PdfSolidBrush = new PdfSolidBrush(new PdfColor(238, 130, 238));
504
+ * // Create a new PDF pen
505
+ * let pen: PdfPen = new PdfPen(new PdfColor(255, 0, 0), 1);
506
+ * // Draw rounded rectangle
507
+ * page.graphics.drawRoundedRectangle(pen, brush, 20, 20, 100, 50, 5);
508
+ * // save the document
509
+ * document.save('output.pdf');
510
+ * // destroy the document
511
+ * document.destroy();
512
+ * ```
513
+ * @param pen Stoke color of the rectangle.
514
+ * @param brush Fill color of the rectangle.
515
+ * @param x The x-coordinate of the upper-left corner of the rectangle to draw.
516
+ * @param y The y-coordinate of the upper-left corner of the rectangle to draw.
517
+ * @param width Width of the rectangle to draw.
518
+ * @param height Height of the rectangle to draw.
519
+ * @param radius Radius of the arcs to draw.
520
+ */
521
+ PdfGraphics.prototype.drawRoundedRectangle = function (pen, brush, x, y, width, height, radius) {
522
+ if (pen === null) {
523
+ throw new Error('pen');
524
+ }
525
+ if (brush === null) {
526
+ throw new Error('brush');
527
+ }
528
+ if (radius === 0) {
529
+ this.drawRectangle(pen, brush, x, y, width, height);
530
+ }
531
+ else {
532
+ var bounds = [x, y, width, height];
533
+ var diameter = radius * 2;
534
+ var size = [diameter, diameter];
535
+ var arc = [bounds[0], bounds[1], size[0], size[1]];
536
+ this._pathPoints = [];
537
+ this._pathTypes = [];
538
+ var startFigure = true;
539
+ startFigure = this._addArc(arc[0], arc[1], arc[2], arc[3], 180, 90, startFigure);
540
+ arc[0] = (bounds[0] + bounds[2]) - diameter;
541
+ startFigure = this._addArc(arc[0], arc[1], arc[2], arc[3], 270, 90, startFigure);
542
+ arc[1] = (bounds[1] + bounds[3]) - diameter;
543
+ startFigure = this._addArc(arc[0], arc[1], arc[2], arc[3], 0, 90, startFigure);
544
+ arc[0] = bounds[0];
545
+ startFigure = this._addArc(arc[0], arc[1], arc[2], arc[3], 90, 90, startFigure);
546
+ var index = this._pathPoints.length - 1;
547
+ var type = ((this._pathTypes[index]));
548
+ type = (type | PathPointType.CloseSubpath);
549
+ this._pathTypes[index] = (type);
550
+ this._drawPath(pen, brush, this._pathPoints, this._pathTypes, PdfFillMode.Alternate);
551
+ this._pathPoints = [];
552
+ this._pathTypes = [];
553
+ }
554
+ };
555
+ PdfGraphics.prototype._addArc = function (x, y, width, height, startAngle, sweepAngle, startFigure) {
556
+ var points = this._getBezierArcPoints(x, y, (x + width), (y + height), startAngle, sweepAngle);
557
+ for (var i = 0; i < points.length; i = i + 8) {
558
+ var point = [points[i], points[i + 1], points[i + 2], points[i + 3], points[i + 4], points[i + 5], points[i + 6], points[i + 7]];
559
+ startFigure = this._addArcPoints(point, PathPointType.Bezier3, startFigure);
560
+ }
561
+ return startFigure;
562
+ };
563
+ PdfGraphics.prototype._addArcPoints = function (points, pointType, startFigure) {
564
+ for (var i = 0; i < points.length; i++) {
565
+ var point = new PointF(points[i], points[(i + 1)]);
566
+ if (i === 0) {
567
+ if (this._pathPoints.length === 0 || startFigure) {
568
+ this._addPoint(point, PathPointType.Start);
569
+ startFigure = false;
570
+ }
571
+ else if (point.x !== this._getLastPoint().x || point.y !== this._getLastPoint().y) {
572
+ this._addPoint(point, PathPointType.Line);
573
+ }
574
+ }
575
+ else {
576
+ this._addPoint(point, pointType);
577
+ }
578
+ i++;
579
+ }
580
+ return startFigure;
581
+ };
582
+ PdfGraphics.prototype._getLastPoint = function () {
583
+ var lastPoint = new PointF(0, 0);
584
+ var count = this._pathPoints.length;
585
+ if (count > 0) {
586
+ lastPoint.x = this._pathPoints[(count - 1)].x;
587
+ lastPoint.y = this._pathPoints[(count - 1)].y;
588
+ }
589
+ return lastPoint;
590
+ };
591
+ PdfGraphics.prototype._addPoint = function (point, type) {
592
+ this._pathPoints.push(point);
593
+ this._pathTypes.push(type);
594
+ };
595
+ PdfGraphics.prototype._getBezierArcPoints = function (x1, y1, x2, y2, s1, e1) {
596
+ if ((x1 > x2)) {
597
+ var tmp = void 0;
598
+ tmp = x1;
599
+ x1 = x2;
600
+ x2 = tmp;
601
+ }
602
+ if ((y2 > y1)) {
603
+ var tmp = void 0;
604
+ tmp = y1;
605
+ y1 = y2;
606
+ y2 = tmp;
607
+ }
608
+ var fragAngle;
609
+ var numFragments;
610
+ if ((Math.abs(e1) <= 90)) {
611
+ fragAngle = e1;
612
+ numFragments = 1;
613
+ }
614
+ else {
615
+ numFragments = (Math.ceil((Math.abs(e1) / 90)));
616
+ fragAngle = (e1 / numFragments);
617
+ }
618
+ var xcen = ((x1 + x2) / 2);
619
+ var ycen = ((y1 + y2) / 2);
620
+ var rx = ((x2 - x1) / 2);
621
+ var ry = ((y2 - y1) / 2);
622
+ var halfAng = ((fragAngle * (Math.PI / 360)));
623
+ var kappa = (Math.abs(4.0 / 3.0 * (1.0 - Math.cos(halfAng)) / Math.sin(halfAng)));
624
+ var pointList = [];
625
+ for (var i = 0; (i < numFragments); i++) {
626
+ var theta0 = (((s1 + (i * fragAngle)) * (Math.PI / 180)));
627
+ var theta1 = (((s1 + ((i + 1) * fragAngle)) * (Math.PI / 180)));
628
+ var cos0 = (Math.cos(theta0));
629
+ var cos1 = (Math.cos(theta1));
630
+ var sin0 = (Math.sin(theta0));
631
+ var sin1 = (Math.sin(theta1));
632
+ if ((fragAngle > 0)) {
633
+ pointList.push((xcen + (rx * cos0)), (ycen - (ry * sin0)), (xcen + (rx * (cos0 - (kappa * sin0)))), (ycen - (ry * (sin0 + (kappa * cos0)))), (xcen + (rx * (cos1 + (kappa * sin1)))), (ycen - (ry * (sin1 - (kappa * cos1)))), (xcen + (rx * cos1)), (ycen - (ry * sin1)));
634
+ }
635
+ else {
636
+ pointList.push((xcen + (rx * cos0)), (ycen - (ry * sin0)), (xcen + (rx * (cos0 + (kappa * sin0)))), (ycen - (ry * (sin0 - (kappa * cos0)))), (xcen + (rx * (cos1 - (kappa * sin1)))), (ycen - (ry * (sin1 + (kappa * cos1)))), (xcen + (rx * cos1)), (ycen - (ry * sin1)));
637
+ }
638
+ }
639
+ return pointList;
640
+ };
497
641
  PdfGraphics.prototype.drawPathHelper = function (arg1, arg2, arg3, arg4) {
498
642
  if (typeof arg3 === 'boolean') {
499
643
  var temparg3 = arg3;
@@ -519,7 +663,6 @@ var PdfGraphics = /** @class */ (function () {
519
663
  }
520
664
  }
521
665
  };
522
- /* tslint:disable */
523
666
  PdfGraphics.prototype.drawImage = function (arg1, arg2, arg3, arg4, arg5) {
524
667
  if (typeof arg2 === 'number' && typeof arg3 === 'number' && typeof arg4 === 'undefined') {
525
668
  var size = arg1.physicalDimension;
@@ -556,7 +699,6 @@ var PdfGraphics = /** @class */ (function () {
556
699
  }
557
700
  };
558
701
  //Implementation
559
- /* tslint:disable */
560
702
  /**
561
703
  * Returns `bounds` of the line info.
562
704
  * @private
@@ -572,8 +714,7 @@ var PdfGraphics = /** @class */ (function () {
572
714
  var lineIndent = this.getLineIndent(line, format, layoutRectangle, (lineIndex === 0));
573
715
  hShift += (!this.rightToLeft(format)) ? lineIndent : 0;
574
716
  var x = layoutRectangle.x + hShift;
575
- /* tslint:disable */
576
- var width = (!this.shouldJustify(line, layoutRectangle.width, format)) ? lineWidth - lineIndent : layoutRectangle.width - lineIndent; /* tslint:enable */
717
+ var width = (!this.shouldJustify(line, layoutRectangle.width, format)) ? lineWidth - lineIndent : layoutRectangle.width - lineIndent;
577
718
  var height = result.lineHeight;
578
719
  bounds = new RectangleF(x, y, width, height);
579
720
  }
@@ -623,7 +764,6 @@ var PdfGraphics = /** @class */ (function () {
623
764
  * Adding page number field before page saving.
624
765
  * @private
625
766
  */
626
- /* tslint:disable */
627
767
  PdfGraphics.prototype.pageSave = function (page) {
628
768
  if (page.graphics.automaticFields != null) {
629
769
  for (var i = 0; i < page.graphics.automaticFields.automaticFields.length; i++) {
@@ -756,7 +896,6 @@ var PdfGraphics = /** @class */ (function () {
756
896
  }
757
897
  return shift;
758
898
  };
759
- /* tslint:disable */
760
899
  /**
761
900
  * `Draws layout result`.
762
901
  * @private
@@ -883,9 +1022,7 @@ var PdfGraphics = /** @class */ (function () {
883
1022
  /**
884
1023
  * Draws array of unicode tokens.
885
1024
  */
886
- /* tslint:disable */
887
1025
  PdfGraphics.prototype.drawUnicodeBlocks = function (blocks, words, font, format, wordSpacing) {
888
- /* tslint:enable */
889
1026
  if (blocks == null) {
890
1027
  throw new Error('Argument Null Exception : blocks');
891
1028
  }
@@ -1045,11 +1182,9 @@ var PdfGraphics = /** @class */ (function () {
1045
1182
  var whitespacesCount = StringTokenizer.getCharsCount(line, symbols);
1046
1183
  var hasSpaces = (whitespacesCount > 0 && line[0] !== StringTokenizer.whiteSpace);
1047
1184
  var goodLineBreakStyle = ((lineInfo.lineType & LineType.LayoutBreak) > 0);
1048
- /* tslint:disable */
1049
- var shouldJustify = (justifyStyle && goodWidth && hasSpaces && (goodLineBreakStyle || format.alignment === PdfTextAlignment.Justify)); /* tslint:enable */
1185
+ var shouldJustify = (justifyStyle && goodWidth && hasSpaces && (goodLineBreakStyle || format.alignment === PdfTextAlignment.Justify));
1050
1186
  return shouldJustify;
1051
1187
  };
1052
- /* tslint:disable */
1053
1188
  /**
1054
1189
  * Emulates `Underline, Strikeout` of the text if needed.
1055
1190
  * @private
@@ -1074,9 +1209,7 @@ var PdfGraphics = /** @class */ (function () {
1074
1209
  var lineIndent = this.getLineIndent(lineInfo, format, layoutRectangle, (i === 0));
1075
1210
  hShift += (!this.rightToLeft(format)) ? lineIndent : 0;
1076
1211
  var x1 = layoutRectangle.x + hShift;
1077
- /* tslint:disable */
1078
1212
  var x2 = (!this.shouldJustify(lineInfo, layoutRectangle.width, format)) ? x1 + lineWidth - lineIndent : x1 + layoutRectangle.width - lineIndent;
1079
- /* tslint:enable */
1080
1213
  if (font.underline) {
1081
1214
  var y = underlineYOffset;
1082
1215
  this.drawLine(linePen, x1, y, x2, y);
@@ -1207,7 +1340,6 @@ var PdfGraphics = /** @class */ (function () {
1207
1340
  else if (pen != null) {
1208
1341
  var pdfPen = pen;
1209
1342
  if (typeof this.pageLayer !== 'undefined' && this.pageLayer != null) {
1210
- /* tslint:disable */
1211
1343
  this.colorSpace = this.pageLayer.page.document.colorSpace;
1212
1344
  this.currentColorSpace = this.pageLayer.page.document.colorSpace;
1213
1345
  }
@@ -1244,9 +1376,7 @@ var PdfGraphics = /** @class */ (function () {
1244
1376
  PdfGraphics.prototype.penControl = function (pen, saveState) {
1245
1377
  if (pen != null) {
1246
1378
  this.currentPen = pen;
1247
- /* tslint:disable */
1248
1379
  pen.monitorChanges(this.currentPen, this.pdfStreamWriter, this.getResources, saveState, this.colorSpace, this.matrix.clone());
1249
- /* tslint:enable */
1250
1380
  this.currentPen = pen.clone();
1251
1381
  }
1252
1382
  };
@@ -1269,9 +1399,7 @@ var PdfGraphics = /** @class */ (function () {
1269
1399
  }
1270
1400
  this.currentBrush = lgb;
1271
1401
  var br = (brush);
1272
- /* tslint:disable */
1273
1402
  b.monitorChanges(this.currentBrush, this.pdfStreamWriter, this.getResources, saveState, this.colorSpace);
1274
- /* tslint:enable */
1275
1403
  this.currentBrush = brush;
1276
1404
  brush = null;
1277
1405
  }
@@ -1283,14 +1411,12 @@ var PdfGraphics = /** @class */ (function () {
1283
1411
  PdfGraphics.prototype.fontControl = function (font, format, saveState) {
1284
1412
  if (font != null) {
1285
1413
  var curSubSuper = (format != null) ? format.subSuperScript : PdfSubSuperScript.None;
1286
- /* tslint:disable */
1287
- var prevSubSuper = (this.currentStringFormat != null) ? this.currentStringFormat.subSuperScript : PdfSubSuperScript.None; /* tslint:enable */
1414
+ var prevSubSuper = (this.currentStringFormat != null) ? this.currentStringFormat.subSuperScript : PdfSubSuperScript.None;
1288
1415
  if (saveState || font !== this.currentFont || curSubSuper !== prevSubSuper) {
1289
1416
  var resources = this.getResources.getResources();
1290
1417
  this.currentFont = font;
1291
1418
  this.currentStringFormat = format;
1292
1419
  var size = font.metrics.getSize(format);
1293
- /* tslint:disable */
1294
1420
  this.isEmfTextScaled = false;
1295
1421
  var fontName = resources.getName(font);
1296
1422
  this.pdfStreamWriter.setFont(font, fontName, size);
@@ -1389,7 +1515,6 @@ var PdfGraphics = /** @class */ (function () {
1389
1515
  input.translate(x, this.updateY(y));
1390
1516
  return input;
1391
1517
  };
1392
- /* tslint:disable */
1393
1518
  /**
1394
1519
  * Applies the specified `scaling operation` to the transformation matrix of this Graphics by prepending it to the object's transformation matrix.
1395
1520
  * ```typescript
@@ -1413,7 +1538,6 @@ var PdfGraphics = /** @class */ (function () {
1413
1538
  * @param scaleX Scale factor in the x direction.
1414
1539
  * @param scaleY Scale factor in the y direction.
1415
1540
  */
1416
- /* tslint:enable */
1417
1541
  PdfGraphics.prototype.scaleTransform = function (scaleX, scaleY) {
1418
1542
  var matrix = new PdfTransformationMatrix();
1419
1543
  this.getScaleTransform(scaleX, scaleY, matrix);
@@ -1565,7 +1689,6 @@ var PdfGraphics = /** @class */ (function () {
1565
1689
  this.pdfStreamWriter.restoreGraphicsState();
1566
1690
  return state;
1567
1691
  };
1568
- /* tslint:enable */
1569
1692
  /**
1570
1693
  * `Draws the specified path`, using its original physical size, at the location specified by a coordinate pair.
1571
1694
  * ```typescript
@@ -1596,6 +1719,9 @@ var PdfGraphics = /** @class */ (function () {
1596
1719
  * @param path Draw path.
1597
1720
  */
1598
1721
  PdfGraphics.prototype.drawPath = function (pen, brush, path) {
1722
+ this._drawPath(pen, brush, path.pathPoints, path.pathTypes, path.fillMode);
1723
+ };
1724
+ PdfGraphics.prototype._drawPath = function (pen, brush, pathPoints, pathTypes, fillMode) {
1599
1725
  if (brush instanceof PdfTilingBrush) {
1600
1726
  this.bCSInitialized = false;
1601
1727
  brush.graphics.colorSpace = this.colorSpace;
@@ -1605,8 +1731,8 @@ var PdfGraphics = /** @class */ (function () {
1605
1731
  brush.colorSpace = this.colorSpace;
1606
1732
  }
1607
1733
  this.stateControl(pen, brush, null);
1608
- this.buildUpPath(path.pathPoints, path.pathTypes);
1609
- this.drawPathHelper(pen, brush, path.fillMode, false);
1734
+ this.buildUpPath(pathPoints, pathTypes);
1735
+ this.drawPathHelper(pen, brush, fillMode, false);
1610
1736
  };
1611
1737
  /* tslint:disable-next-line:max-line-length */
1612
1738
  PdfGraphics.prototype.drawArc = function (arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
@@ -1752,6 +1878,7 @@ var PdfGraphics = /** @class */ (function () {
1752
1878
  }
1753
1879
  return pointsList;
1754
1880
  };
1881
+ /* tslint:disable */
1755
1882
  // Constants
1756
1883
  /**
1757
1884
  * Specifies the mask of `path type values`.
@@ -1984,3 +2111,4 @@ var TransparencyData = /** @class */ (function () {
1984
2111
  }
1985
2112
  return TransparencyData;
1986
2113
  }());
2114
+ /* tslint:enable */
@@ -1,76 +0,0 @@
1
- import { IPdfWrapper } from './../../interfaces/i-pdf-wrapper';
2
- import { IPdfPrimitive } from './../../interfaces/i-pdf-primitives';
3
- import { PdfDictionary } from './../primitives/pdf-dictionary';
4
- import { PdfReferenceHolder } from './../primitives/pdf-reference';
5
- import { PdfName } from './../primitives/pdf-name';
6
- import { DictionaryProperties } from './../input-output/pdf-dictionary-properties';
7
- /**
8
- * `PdfAction` class represents base class for all action types.
9
- * @private
10
- */
11
- export abstract class PdfAction implements IPdfWrapper {
12
- /**
13
- * Specifies the Next `action` to perform.
14
- * @private
15
- */
16
- private action : PdfAction = null;
17
- /**
18
- * Specifies the Internal variable to store `dictionary`.
19
- * @private
20
- */
21
- private pdfDictionary : PdfDictionary;
22
- /**
23
- * Specifies the Internal variable to store `dictionary properties`.
24
- * @private
25
- */
26
- protected dictionaryProperties : DictionaryProperties = new DictionaryProperties();
27
- // Constructors
28
- /**
29
- * Initialize instance for `Action` class.
30
- * @private
31
- */
32
- protected constructor() {
33
- // super(); -> Object()
34
- this.initialize();
35
- }
36
- // Properties
37
- /**
38
- * Gets and Sets the `Next` action to perform.
39
- * @private
40
- */
41
- public get next() : PdfAction {
42
- return this.action;
43
- }
44
- public set next(value : PdfAction) {
45
- // if (this.action !== value) {
46
- this.action = value;
47
- this.dictionary.items.setValue(this.dictionaryProperties.next, new PdfReferenceHolder(this.action));
48
- // }
49
- }
50
- /**
51
- * Gets and Sets the instance of PdfDictionary class for `Dictionary`.
52
- * @private
53
- */
54
- public get dictionary() : PdfDictionary {
55
- if (typeof this.pdfDictionary === 'undefined') {
56
- this.pdfDictionary = new PdfDictionary();
57
- }
58
- return this.pdfDictionary;
59
- }
60
- // Implementation
61
- /**
62
- * `Initialize` the action type.
63
- * @private
64
- */
65
- protected initialize() : void {
66
- this.dictionary.items.setValue(this.dictionaryProperties.type, new PdfName(this.dictionaryProperties.action));
67
- }
68
- // IPdfWrapper Members
69
- /**
70
- * Gets the `Element` as IPdfPrimitive class.
71
- * @private
72
- */
73
- public get element() : IPdfPrimitive {
74
- return this.dictionary;
75
- }
76
- }
@@ -1,52 +0,0 @@
1
- import { PdfAction } from './action';
2
- import { PdfString } from './../primitives/pdf-string';
3
- import { PdfName } from './../primitives/pdf-name';
4
- /**
5
- * `PdfUriAction` class for initialize the uri related internals.
6
- * @private
7
- */
8
- export class PdfUriAction extends PdfAction {
9
- // Fields
10
- /**
11
- * Specifies the `uri` string.
12
- * @default ''.
13
- * @private
14
- */
15
- private uniformResourceIdentifier : string = '';
16
-
17
- // Constructors
18
- /**
19
- * Initialize instance of `PdfUriAction` class.
20
- * @private
21
- */
22
- public constructor()
23
- /**
24
- * Initialize instance of `PdfUriAction` class.
25
- * @private
26
- */
27
- public constructor(uri : string)
28
- public constructor(uri ?: string) {
29
- super();
30
- }
31
- // Properties
32
- /**
33
- * Gets and Sets the value of `Uri`.
34
- * @private
35
- */
36
- public get uri() : string {
37
- return this.uniformResourceIdentifier;
38
- }
39
- public set uri(value : string) {
40
- this.uniformResourceIdentifier = value;
41
- this.dictionary.items.setValue(this.dictionaryProperties.uri, new PdfString(this.uniformResourceIdentifier));
42
- }
43
- // Implementation
44
- /**
45
- * `Initialize` the internals.
46
- * @private
47
- */
48
- protected initialize() : void {
49
- super.initialize();
50
- this.dictionary.items.setValue(this.dictionaryProperties.s, new PdfName(this.dictionaryProperties.uri));
51
- }
52
- }
@@ -1,43 +0,0 @@
1
- import { RectangleF } from './../drawing/pdf-drawing';
2
- import { PdfAction } from './../actions/action';
3
- import { PdfLinkAnnotation } from './link-annotation';
4
- /**
5
- * Represents base class for `link annotations` with associated action.
6
- * @private
7
- */
8
- export abstract class PdfActionLinkAnnotation extends PdfLinkAnnotation {
9
- // Fields
10
- /**
11
- * Internal variable to store annotation's `action`.
12
- * @default null
13
- * @private
14
- */
15
- private pdfAction : PdfAction = null;
16
- // Properties
17
- /**
18
- * Internal variable to store annotation's `Action`.
19
- * @private
20
- */
21
- public abstract get action() : PdfAction;
22
- public abstract set action(value : PdfAction);
23
- // Constructors
24
- /**
25
- * Specifies the constructor for `ActionLinkAnnotation`.
26
- * @private
27
- */
28
- public constructor(rectangle : RectangleF) {
29
- super(rectangle);
30
- }
31
- //Public method
32
- /**
33
- * get and set the `action`.
34
- * @hidden
35
- */
36
- public getSetAction(value ?: PdfAction) : PdfAction|void {
37
- if (typeof value === 'undefined') {
38
- return this.pdfAction;
39
- } else {
40
- this.pdfAction = value;
41
- }
42
- }
43
- }