@syncfusion/ej2-pdf-export 19.4.42 → 19.4.43

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 (165) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/dist/ej2-pdf-export.umd.min.js +2 -2
  3. package/dist/ej2-pdf-export.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-pdf-export.es2015.js +65 -17
  5. package/dist/es6/ej2-pdf-export.es2015.js.map +1 -1
  6. package/dist/es6/ej2-pdf-export.es5.js +65 -17
  7. package/dist/es6/ej2-pdf-export.es5.js.map +1 -1
  8. package/dist/global/ej2-pdf-export.min.js +2 -2
  9. package/dist/global/ej2-pdf-export.min.js.map +1 -1
  10. package/dist/global/index.d.ts +1 -1
  11. package/package.json +5 -6
  12. package/src/implementation/structured-elements/grid/layout/grid-layouter.d.ts +1 -0
  13. package/src/implementation/structured-elements/grid/layout/grid-layouter.js +47 -15
  14. package/src/implementation/structured-elements/grid/pdf-grid-row.d.ts +1 -0
  15. package/src/implementation/structured-elements/grid/pdf-grid-row.js +4 -2
  16. package/src/implementation/structured-elements/grid/pdf-grid.js +14 -0
  17. package/dist/ts/implementation/actions/action.ts +0 -76
  18. package/dist/ts/implementation/actions/uri-action.ts +0 -52
  19. package/dist/ts/implementation/annotations/action-link-annotation.ts +0 -43
  20. package/dist/ts/implementation/annotations/annotation-collection.ts +0 -159
  21. package/dist/ts/implementation/annotations/annotation.ts +0 -241
  22. package/dist/ts/implementation/annotations/document-link-annotation.ts +0 -118
  23. package/dist/ts/implementation/annotations/link-annotation.ts +0 -32
  24. package/dist/ts/implementation/annotations/pdf-text-web-link.ts +0 -265
  25. package/dist/ts/implementation/annotations/uri-annotation.ts +0 -86
  26. package/dist/ts/implementation/collections/dictionary.ts +0 -150
  27. package/dist/ts/implementation/collections/object-object-pair/dictionary.ts +0 -125
  28. package/dist/ts/implementation/collections/utils.ts +0 -38
  29. package/dist/ts/implementation/document/automatic-fields/automatic-field-info-collection.ts +0 -39
  30. package/dist/ts/implementation/document/automatic-fields/automatic-field-info.ts +0 -108
  31. package/dist/ts/implementation/document/automatic-fields/automatic-field.ts +0 -127
  32. package/dist/ts/implementation/document/automatic-fields/composite-field.ts +0 -76
  33. package/dist/ts/implementation/document/automatic-fields/multiple-value-field.ts +0 -37
  34. package/dist/ts/implementation/document/automatic-fields/page-count-field.ts +0 -75
  35. package/dist/ts/implementation/document/automatic-fields/pdf-numbers-convertor.ts +0 -157
  36. package/dist/ts/implementation/document/automatic-fields/pdf-page-number-field.ts +0 -82
  37. package/dist/ts/implementation/document/automatic-fields/pdf-template-value-pair.ts +0 -60
  38. package/dist/ts/implementation/document/automatic-fields/single-value-field.ts +0 -48
  39. package/dist/ts/implementation/document/pdf-catalog.ts +0 -52
  40. package/dist/ts/implementation/document/pdf-document-base.ts +0 -166
  41. package/dist/ts/implementation/document/pdf-document-template.ts +0 -310
  42. package/dist/ts/implementation/document/pdf-document.ts +0 -342
  43. package/dist/ts/implementation/drawing/pdf-drawing.ts +0 -218
  44. package/dist/ts/implementation/general/enum.ts +0 -21
  45. package/dist/ts/implementation/general/functions/pdf-function.ts +0 -66
  46. package/dist/ts/implementation/general/functions/pdf-sampled-function.ts +0 -62
  47. package/dist/ts/implementation/general/pdf-cache-collection.ts +0 -97
  48. package/dist/ts/implementation/general/pdf-collection.ts +0 -41
  49. package/dist/ts/implementation/general/pdf-destination.ts +0 -170
  50. package/dist/ts/implementation/graphics/brushes/enum.ts +0 -237
  51. package/dist/ts/implementation/graphics/brushes/pdf-blend.ts +0 -294
  52. package/dist/ts/implementation/graphics/brushes/pdf-brush.ts +0 -68
  53. package/dist/ts/implementation/graphics/brushes/pdf-brushes.ts +0 -2438
  54. package/dist/ts/implementation/graphics/brushes/pdf-color-blend.ts +0 -295
  55. package/dist/ts/implementation/graphics/brushes/pdf-gradient-brush.ts +0 -311
  56. package/dist/ts/implementation/graphics/brushes/pdf-linear-gradient-brush.ts +0 -406
  57. package/dist/ts/implementation/graphics/brushes/pdf-radial-gradient-brush.ts +0 -290
  58. package/dist/ts/implementation/graphics/brushes/pdf-solid-brush.ts +0 -107
  59. package/dist/ts/implementation/graphics/brushes/pdf-tiling-brush.ts +0 -304
  60. package/dist/ts/implementation/graphics/constants.ts +0 -31
  61. package/dist/ts/implementation/graphics/enum.ts +0 -413
  62. package/dist/ts/implementation/graphics/figures/arc.ts +0 -133
  63. package/dist/ts/implementation/graphics/figures/base/draw-element.ts +0 -59
  64. package/dist/ts/implementation/graphics/figures/base/element-layouter.ts +0 -260
  65. package/dist/ts/implementation/graphics/figures/base/fill-element.ts +0 -72
  66. package/dist/ts/implementation/graphics/figures/base/graphics-element.ts +0 -34
  67. package/dist/ts/implementation/graphics/figures/base/pdf-shape-element.ts +0 -69
  68. package/dist/ts/implementation/graphics/figures/base/shape-layouter.ts +0 -276
  69. package/dist/ts/implementation/graphics/figures/base/text-layouter.ts +0 -205
  70. package/dist/ts/implementation/graphics/figures/ellipse-part.ts +0 -76
  71. package/dist/ts/implementation/graphics/figures/enum.ts +0 -80
  72. package/dist/ts/implementation/graphics/figures/layout-element.ts +0 -132
  73. package/dist/ts/implementation/graphics/figures/path.ts +0 -646
  74. package/dist/ts/implementation/graphics/figures/pdf-template.ts +0 -205
  75. package/dist/ts/implementation/graphics/figures/rectangle-area.ts +0 -108
  76. package/dist/ts/implementation/graphics/figures/text-element.ts +0 -445
  77. package/dist/ts/implementation/graphics/fonts/enum.ts +0 -385
  78. package/dist/ts/implementation/graphics/fonts/pdf-font-metrics.ts +0 -248
  79. package/dist/ts/implementation/graphics/fonts/pdf-font.ts +0 -316
  80. package/dist/ts/implementation/graphics/fonts/pdf-standard-font-metrics-factory.ts +0 -606
  81. package/dist/ts/implementation/graphics/fonts/pdf-standard-font.ts +0 -243
  82. package/dist/ts/implementation/graphics/fonts/pdf-string-format.ts +0 -474
  83. package/dist/ts/implementation/graphics/fonts/pdf-true-type-font.ts +0 -165
  84. package/dist/ts/implementation/graphics/fonts/rtl/rtl-bidirectional.ts +0 -958
  85. package/dist/ts/implementation/graphics/fonts/rtl/rtl-text-shape.ts +0 -374
  86. package/dist/ts/implementation/graphics/fonts/rtl-renderer.ts +0 -255
  87. package/dist/ts/implementation/graphics/fonts/string-layouter.ts +0 -617
  88. package/dist/ts/implementation/graphics/fonts/string-tokenizer.ts +0 -275
  89. package/dist/ts/implementation/graphics/fonts/ttf-OS2-Table.ts +0 -206
  90. package/dist/ts/implementation/graphics/fonts/ttf-apple-cmap-sub-table.ts +0 -18
  91. package/dist/ts/implementation/graphics/fonts/ttf-cmap-sub-table.ts +0 -18
  92. package/dist/ts/implementation/graphics/fonts/ttf-cmap-table.ts +0 -14
  93. package/dist/ts/implementation/graphics/fonts/ttf-glyph-header.ts +0 -26
  94. package/dist/ts/implementation/graphics/fonts/ttf-glyph-info.ts +0 -35
  95. package/dist/ts/implementation/graphics/fonts/ttf-head-table.ts +0 -94
  96. package/dist/ts/implementation/graphics/fonts/ttf-horizontal-header-table.ts +0 -56
  97. package/dist/ts/implementation/graphics/fonts/ttf-loca-table.ts +0 -10
  98. package/dist/ts/implementation/graphics/fonts/ttf-long-hor-metric.ts +0 -14
  99. package/dist/ts/implementation/graphics/fonts/ttf-metrics.ts +0 -106
  100. package/dist/ts/implementation/graphics/fonts/ttf-microsoft-cmap-sub-table.ts +0 -58
  101. package/dist/ts/implementation/graphics/fonts/ttf-name-record.ts +0 -33
  102. package/dist/ts/implementation/graphics/fonts/ttf-name-table.ts +0 -22
  103. package/dist/ts/implementation/graphics/fonts/ttf-post-table.ts +0 -42
  104. package/dist/ts/implementation/graphics/fonts/ttf-reader.ts +0 -1254
  105. package/dist/ts/implementation/graphics/fonts/ttf-table-info.ts +0 -26
  106. package/dist/ts/implementation/graphics/fonts/ttf-trimmed-cmap-sub-table.ts +0 -26
  107. package/dist/ts/implementation/graphics/fonts/unicode-true-type-font.ts +0 -577
  108. package/dist/ts/implementation/graphics/images/byte-array.ts +0 -137
  109. package/dist/ts/implementation/graphics/images/image-decoder.ts +0 -437
  110. package/dist/ts/implementation/graphics/images/pdf-bitmap.ts +0 -110
  111. package/dist/ts/implementation/graphics/images/pdf-image.ts +0 -132
  112. package/dist/ts/implementation/graphics/pdf-color.ts +0 -478
  113. package/dist/ts/implementation/graphics/pdf-graphics.ts +0 -2424
  114. package/dist/ts/implementation/graphics/pdf-margins.ts +0 -124
  115. package/dist/ts/implementation/graphics/pdf-pen.ts +0 -370
  116. package/dist/ts/implementation/graphics/pdf-resources.ts +0 -300
  117. package/dist/ts/implementation/graphics/pdf-transformation-matrix.ts +0 -246
  118. package/dist/ts/implementation/graphics/pdf-transparency.ts +0 -93
  119. package/dist/ts/implementation/graphics/unit-convertor.ts +0 -96
  120. package/dist/ts/implementation/input-output/big-endian-writer.ts +0 -121
  121. package/dist/ts/implementation/input-output/cross-table.ts +0 -21
  122. package/dist/ts/implementation/input-output/enum.ts +0 -16
  123. package/dist/ts/implementation/input-output/pdf-cross-table.ts +0 -524
  124. package/dist/ts/implementation/input-output/pdf-dictionary-properties.ts +0 -515
  125. package/dist/ts/implementation/input-output/pdf-main-object-collection.ts +0 -194
  126. package/dist/ts/implementation/input-output/pdf-operators.ts +0 -363
  127. package/dist/ts/implementation/input-output/pdf-stream-writer.ts +0 -681
  128. package/dist/ts/implementation/input-output/pdf-writer.ts +0 -88
  129. package/dist/ts/implementation/pages/enum.ts +0 -201
  130. package/dist/ts/implementation/pages/page-added-event-arguments.ts +0 -39
  131. package/dist/ts/implementation/pages/pdf-document-page-collection.ts +0 -180
  132. package/dist/ts/implementation/pages/pdf-page-base.ts +0 -181
  133. package/dist/ts/implementation/pages/pdf-page-layer-collection.ts +0 -348
  134. package/dist/ts/implementation/pages/pdf-page-layer.ts +0 -271
  135. package/dist/ts/implementation/pages/pdf-page-settings.ts +0 -192
  136. package/dist/ts/implementation/pages/pdf-page-size.ts +0 -162
  137. package/dist/ts/implementation/pages/pdf-page-template-element.ts +0 -659
  138. package/dist/ts/implementation/pages/pdf-page.ts +0 -235
  139. package/dist/ts/implementation/pages/pdf-section-collection.ts +0 -187
  140. package/dist/ts/implementation/pages/pdf-section-page-collection.ts +0 -61
  141. package/dist/ts/implementation/pages/pdf-section-templates.ts +0 -96
  142. package/dist/ts/implementation/pages/pdf-section.ts +0 -644
  143. package/dist/ts/implementation/primitives/pdf-array.ts +0 -386
  144. package/dist/ts/implementation/primitives/pdf-boolean.ts +0 -119
  145. package/dist/ts/implementation/primitives/pdf-dictionary.ts +0 -513
  146. package/dist/ts/implementation/primitives/pdf-name.ts +0 -218
  147. package/dist/ts/implementation/primitives/pdf-number.ts +0 -165
  148. package/dist/ts/implementation/primitives/pdf-reference.ts +0 -430
  149. package/dist/ts/implementation/primitives/pdf-stream.ts +0 -336
  150. package/dist/ts/implementation/primitives/pdf-string.ts +0 -397
  151. package/dist/ts/implementation/structured-elements/grid/layout/grid-layouter.ts +0 -1998
  152. package/dist/ts/implementation/structured-elements/grid/pdf-grid-cell.ts +0 -1189
  153. package/dist/ts/implementation/structured-elements/grid/pdf-grid-column.ts +0 -206
  154. package/dist/ts/implementation/structured-elements/grid/pdf-grid-row.ts +0 -468
  155. package/dist/ts/implementation/structured-elements/grid/pdf-grid.ts +0 -839
  156. package/dist/ts/implementation/structured-elements/grid/styles/pdf-borders.ts +0 -240
  157. package/dist/ts/implementation/structured-elements/grid/styles/style.ts +0 -424
  158. package/dist/ts/implementation/structured-elements/tables/light-tables/enum.ts +0 -16
  159. package/dist/ts/interfaces/i-pdf-cache.ts +0 -23
  160. package/dist/ts/interfaces/i-pdf-changable.ts +0 -17
  161. package/dist/ts/interfaces/i-pdf-clonable.ts +0 -12
  162. package/dist/ts/interfaces/i-pdf-primitives.ts +0 -45
  163. package/dist/ts/interfaces/i-pdf-true-type-font.ts +0 -48
  164. package/dist/ts/interfaces/i-pdf-wrapper.ts +0 -13
  165. package/dist/ts/interfaces/i-pdf-writer.ts +0 -29
@@ -1,1998 +0,0 @@
1
- /**
2
- * PdfGridLayouter.ts class for EJ2-PDF
3
- */
4
- import { PdfFont } from './../../../graphics/fonts/pdf-font';
5
- import { PdfGrid } from '../pdf-grid';
6
- import { PdfStringFormat } from './../../../graphics/fonts/pdf-string-format';
7
- import { SizeF, RectangleF, PointF } from './../../../drawing/pdf-drawing';
8
- import { PdfBorders } from '../styles/pdf-borders';
9
- import { PdfLayoutType, PdfLayoutBreakType } from './../../../graphics/figures/enum';
10
- import { PdfLayoutResult, PdfLayoutParams, PdfLayoutFormat, ElementLayouter } from './../../../graphics/figures/base/element-layouter';
11
- import { PdfLayoutElement } from './../../../graphics/figures/layout-element';
12
- import { PdfGraphics } from './../../../graphics/pdf-graphics';
13
- import { PdfPage } from './../../../pages/pdf-page';
14
- import { PdfPageBase } from './../../../pages/pdf-page-base';
15
- import { PdfGridColumnCollection } from '../pdf-grid-column';
16
- import { PdfGridCell } from '../pdf-grid-cell';
17
- import { PdfGridRow } from '../pdf-grid-row';
18
- import { PdfGridStyle, PdfGridCellStyle } from '../styles/style';
19
- import { PdfGridRowCollection, PdfGridHeaderCollection } from '../pdf-grid-row';
20
- import { PdfHorizontalOverflowType } from '../styles/style';
21
- import { TemporaryDictionary } from './../../../collections/object-object-pair/dictionary';
22
- import { PdfStringLayoutResult, PdfStringLayouter } from './../../../graphics/fonts/string-layouter';
23
- import { PdfDocument } from './../../../document/pdf-document';
24
- import { PdfSection } from './../../../pages/pdf-section';
25
- /**
26
- * Class `lay outing the text`.
27
- *
28
- */
29
- export class PdfGridLayouter extends ElementLayouter {
30
- // Fields
31
- /**
32
- * `Text` data.
33
- * @private
34
- */
35
- private text : string;
36
- // private layoutElement : PdfLayoutElement;
37
- /**
38
- * Pdf `font`.
39
- * @private
40
- */
41
- private font : PdfFont;
42
- /**
43
- * String `format`.
44
- * @private
45
- */
46
- private format : PdfStringFormat;
47
- /**
48
- * `Size` of the text.
49
- * @private
50
- */
51
- private gridColumns : PdfGridColumnCollection;
52
- /**
53
- * @hidden
54
- * @private
55
- */
56
- private gridRows : PdfGridRowCollection;
57
- /**
58
- * @hidden
59
- * @private
60
- */
61
- private gridHeaders : PdfGridHeaderCollection;
62
- /**
63
- * @hidden
64
- * @private
65
- */
66
- private gridInitialWidth : number = 0;
67
- /**
68
- * @hidden
69
- * @private
70
- */
71
- public isComplete : boolean;
72
- /**
73
- * @hidden
74
- * @private
75
- */
76
- private gridSize : SizeF = new SizeF(0, 0);
77
- private parentCell : PdfGridCell;
78
- private parentCellIndex : number = 0;
79
- public tempWidth : number = 0;
80
- private childheight : number = 0;
81
- /**
82
- * The event raised on `starting cell drawing`.
83
- * @event
84
- * @private
85
- */
86
- public beginCellDraw : Function;
87
- /**
88
- * The event raised on `ending cell drawing`.
89
- * @event
90
- * @private
91
- */
92
- public endCellDraw : Function;
93
- /**
94
- * The event raised on `begin cell lay outing`.
95
- * @event
96
- * @private
97
- */
98
- public beginPageLayout : Function;
99
- /**
100
- * The event raised on `end cell lay outing`.
101
- * @event
102
- * @private
103
- */
104
- public endPageLayout : Function;
105
-
106
- /**
107
- * @hidden
108
- * @private
109
- */
110
- /**
111
- * @hidden
112
- * @private
113
- */
114
- private gridLocation : RectangleF;
115
- /**
116
- * @hidden
117
- * @private
118
- */
119
- private gridStyle : PdfGridStyle;
120
- /**
121
- * @hidden
122
- * @private
123
- */
124
- private pageWidth : boolean;
125
- /**
126
- * Check weather it is `child grid or not`.
127
- * @private
128
- */
129
- private isChildGrid : boolean = false;
130
- /**
131
- * @hidden
132
- * @private
133
- */
134
- public rowLayoutBoundsWidth : number;
135
- /**
136
- * @hidden
137
- * @private
138
- */
139
- public hasRowSpanSpan : boolean = false;
140
- /**
141
- * @hidden
142
- * @private
143
- */
144
- public isRearranged : boolean = false;
145
- /**
146
- * @hidden
147
- * @private
148
- */
149
- private bRepeatHeader : boolean;
150
- /**
151
- * @hidden
152
- * @private
153
- */
154
- private pageBounds : RectangleF = new RectangleF();
155
- //GridLayouter-Fields
156
- /**
157
- * @hidden
158
- * @private
159
- */
160
- private currentPage : PdfPage;
161
- /**
162
- * @hidden
163
- * @private
164
- */
165
- private currentPageBounds : SizeF;
166
- /**
167
- * @hidden
168
- * @private
169
- */
170
- private currentBounds : RectangleF;
171
- /**
172
- * @hidden
173
- * @private
174
- */
175
- private listOfNavigatePages : number[] = [];
176
- /**
177
- * @hidden
178
- * @private
179
- */
180
- private startLocation : PointF;
181
- /**
182
- * @hidden
183
- * @private
184
- */
185
- private hType : PdfHorizontalOverflowType;
186
- /**
187
- * @hidden
188
- * @private
189
- */
190
- private flag : boolean = true;
191
- /**
192
- * @hidden
193
- * @private
194
- */
195
- private columnRanges : number[][] = [];
196
- /**
197
- * @hidden
198
- * @private
199
- */
200
- private cellStartIndex : number;
201
- /**
202
- * @hidden
203
- * @private
204
- */
205
- private cellEndIndex : number;
206
- /**
207
- * @hidden
208
- * @private
209
- */
210
- private currentRowIndex : number;
211
- /**
212
- * @hidden
213
- * @private
214
- */
215
- public static repeatRowIndex : number = -1;
216
- /**
217
- * @hidden
218
- * @private
219
- */
220
- private isChanged : boolean;
221
- /**
222
- * @hidden
223
- * @private
224
- */
225
- private currentLocation : PointF = new PointF(0, 0);
226
- /**
227
- * @hidden
228
- * @private
229
- */
230
- private breakRow : boolean = true;
231
- /**
232
- * @hidden
233
- * @private
234
- */
235
- private rowBreakPageHeightCellIndex : number;
236
- private slr: PdfStringLayoutResult = null;
237
- private remainderText: string = null;
238
- private isPaginate: boolean = false;
239
- //constructor
240
- /**
241
- * Initialize a new instance for `PdfGrid` class.
242
- * @private
243
- */
244
- public constructor(baseFormat : PdfGrid) {
245
- super(baseFormat);
246
- }
247
- //Properties
248
- public get Grid() : PdfGrid {
249
- return (this.elements as PdfGrid);
250
- }
251
- /**
252
- * `Bounds` of the text.
253
- * @private
254
- */
255
- private rectangle : RectangleF;
256
- /**
257
- * Pdf page `height`.
258
- * @private
259
- */
260
- private gridHeight : number;
261
- /**
262
- * Specifies if [`isTabReplaced`].
263
- * @private
264
- */
265
- private isTabReplaced : boolean;
266
- /**
267
- * `currentGraphics` of the text.
268
- * @private
269
- */
270
- private currentGraphics : PdfGraphics;
271
- /**
272
- * Count of tab `occurance`.
273
- * @private
274
- */
275
- private tabOccuranceCount : number;
276
- /**
277
- * Checks whether the x co-ordinate is need to set as client size or not.
278
- * @hidden
279
- * @private
280
- */
281
- private isOverloadWithPosition : boolean = false;
282
- /**
283
- * Stores client size of the page if the layout method invoked with `PointF` overload.
284
- * @hidden
285
- * @private
286
- */
287
- private clientSize : SizeF;
288
- private gridLayoutFormat : PdfGridLayoutFormat;
289
- private isHeader: boolean;
290
- // Constructors
291
- /**
292
- * Initializes a new instance of the `StringLayouter` class.
293
- * @private
294
- */
295
- //Public methods
296
- /**
297
- * `Layouts` the text.
298
- * @private
299
- */
300
- /**
301
- * `Layouts` the specified graphics.
302
- * @private
303
- */
304
- /**
305
- * `Layouts` the specified graphics.
306
- * @private
307
- */
308
- /*public layout(graphics : PdfLayoutParams) : PdfLayoutResult
309
- public layout(graphics : PdfGraphics, bounds : RectangleF) : void
310
- public layout(graphics : PdfGraphics, bounds : PointF) : void
311
- public layout(graphics ?: PdfGraphics | PdfLayoutParams, bounds ?: PointF | RectangleF) : void | PdfLayoutResult {
312
- if (graphics instanceof PdfGraphics) {
313
- if (bounds instanceof PointF) {
314
- if (bounds.x === 0) {
315
- bounds.x = PdfBorders.default.right.width / 2;
316
- }
317
- if (bounds.y === 0) {
318
- bounds.y = PdfBorders.default.top.width / 2;
319
- }
320
- let boundaries : RectangleF = new RectangleF(bounds, new SizeF(0, 0));
321
- this.layout(graphics, boundaries);
322
- } else {
323
- let width : number = graphics.clientSize.width;
324
- let parameter : PdfLayoutParams = new PdfLayoutParams();
325
- parameter.bounds = bounds;
326
- this.currentGraphics = graphics;
327
- if (graphics.layer != null) {
328
- let index : number = 0;
329
- if (this.currentGraphics.page instanceof PdfPage) {
330
- index = (this.currentGraphics.page as PdfPage).section.indexOf(this.currentGraphics.page as PdfPage);
331
- } else {
332
- index = (this.currentGraphics.page as PdfPageBase).defaultLayerIndex;
333
- }
334
- } else {
335
- this.layoutInternal(parameter);
336
- }
337
- }
338
- }
339
- }*/
340
- /**
341
- * Gets the `format`.
342
- * @private
343
- */
344
- private getFormat(format : PdfLayoutFormat) : PdfGridLayoutFormat {
345
- let f : PdfGridLayoutFormat = format as PdfGridLayoutFormat;
346
- return f;
347
- }
348
- /**
349
- * `Layouts` the element.
350
- * @private
351
- */
352
- protected layoutInternal(param : PdfLayoutParams) : PdfLayoutResult {
353
- let format : PdfGridLayoutFormat = this.getFormat(param.format);
354
- this.gridLayoutFormat = this.getFormat(param.format);
355
- this.currentPage = param.page;
356
- if (this.currentPage !== null) {
357
- let pageHeight : number = this.currentPage.getClientSize().height;
358
- let pageWidth : number = this.currentPage.getClientSize().width;
359
- this.currentPageBounds = this.currentPage.getClientSize();
360
- } else {
361
- throw Error('Can not set page as null');
362
- //this.currentPageBounds = this.currentGraphics.clientSize;
363
- }
364
- this.currentGraphics = this.currentPage.graphics;
365
- //this.currentGraphics = (this.currentPage != null ) ? this.currentPage.graphics : this.currentGraphics;
366
- // if (this.currentGraphics.layer !== null) {
367
- // let index : number = 0;
368
- // if (this.currentGraphics.page instanceof PdfPage) {
369
- // index = (this.currentGraphics.page as PdfPage).section.indexOf(this.currentGraphics.page as PdfPage);
370
- // } else {
371
- // index = (this.currentGraphics.page as PdfPageBase).defaultLayerIndex;
372
- // }
373
- // this.listOfNavigatePages.push(index);
374
- // }
375
- let index : number = 0;
376
- index = (this.currentGraphics.page as PdfPage).section.indexOf(this.currentGraphics.page as PdfPage);
377
- this.listOfNavigatePages.push(index);
378
- if (format != null && format.break === PdfLayoutBreakType.FitColumnsToPage) {
379
- this.currentBounds = new RectangleF(new PointF(param.bounds.x, param.bounds.y),
380
- new SizeF(this.Grid.columns.width, this.currentGraphics.clientSize.height));
381
- } else {
382
- this.currentBounds = new RectangleF(new PointF(param.bounds.x, param.bounds.y), this.currentGraphics.clientSize);
383
- }
384
- //this.currentBounds = new RectangleF(new PointF(param.bounds.x, param.bounds.y), this.currentGraphics.clientSize);
385
- if (this.Grid.rows.count !== 0 ) {
386
- this.currentBounds.width = (param.bounds.width > 0) ? param.bounds.width :
387
- (this.currentBounds.width - this.Grid.rows.getRow(0).cells.getCell(0).style.borders.left.width / 2);
388
- } else if (this.Grid.headers.count !== 0) {
389
- // this.currentBounds.width = (param.bounds.width > 0) ? param.bounds.width : (this.currentBounds.width -
390
- // this.Grid.headers.getHeader(0).cells.getCell(0).style.borders.left.width / 2);
391
- this.currentBounds.width = param.bounds.width;
392
- } else {
393
- throw Error('Please add row or header into grid');
394
- }
395
- this.startLocation = new PointF(param.bounds.x, param.bounds.y);
396
- // if (this.Grid.style.allowHorizontalOverflow && this.currentBounds.width > this.currentGraphics.clientSize.width) {
397
- // this.currentBounds.width = this.currentGraphics.clientSize.width;
398
- // this.currentBounds.width -= this.currentBounds.x;
399
- // }
400
- // if (this.Grid.isChildGrid) {
401
- // this.childheight = param.bounds.height;
402
- // }
403
- // if (param.format !== null && param.format.usePaginateBounds) {
404
- // if (param.format.paginateBounds.height > 0) {
405
- // this.currentBounds.height = param.format.paginateBounds.height;
406
- // }
407
- //} else
408
- if (param.bounds.height > 0 && !this.Grid.isChildGrid) {
409
- this.currentBounds.height = param.bounds.height;
410
- }
411
- if (!this.Grid.isChildGrid) {
412
- this.hType = this.Grid.style.horizontalOverflowType;
413
- }
414
- if (!this.Grid.style.allowHorizontalOverflow) {
415
- this.columnRanges = [];
416
- this.Grid.measureColumnsWidth(this.currentBounds);
417
- this.columnRanges.push([ 0, this.Grid.columns.count - 1 ]);
418
- } else {
419
- this.Grid.measureColumnsWidth();
420
- this.determineColumnDrawRanges();
421
- }
422
- if (this.Grid.hasRowSpanSpan) {
423
- for ( let i: number = 0; i < this.Grid.rows.count; i++) {
424
- if (this.Grid.rows.getRow(i).height !== -1 && !this.Grid.rows.getRow(i).isRowHeightSet) {
425
- this.Grid.rows.getRow(i).isRowHeightSet = true;
426
- }
427
- }
428
- }
429
- let result : PdfGridLayoutResult = this.layoutOnPage(param);
430
- return result;
431
- }
432
- // /* tslint:enable */
433
- /**
434
- * `Determines the column draw ranges`.
435
- * @private
436
- */
437
- private determineColumnDrawRanges() : void {
438
- let startColumn : number = 0;
439
- let endColumn : number = 0;
440
- let cellWidths : number = 0;
441
- let availableWidth : number = this.currentGraphics.clientSize.width - this.currentBounds.x;
442
- for (let i : number = 0; i < this.Grid.columns.count; i++) {
443
- cellWidths += this.Grid.columns.getColumn(i).width;
444
- if (cellWidths >= availableWidth) {
445
- let subWidths : number = 0;
446
- for (let j : number = startColumn; j <= i; j++) {
447
- subWidths += this.Grid.columns.getColumn(j).width;
448
- if (subWidths > availableWidth) {
449
- break;
450
- }
451
- endColumn = j;
452
- }
453
- this.columnRanges.push([startColumn, endColumn]);
454
- startColumn = endColumn + 1;
455
- endColumn = startColumn;
456
- cellWidths = (endColumn <= i) ? this.Grid.columns.getColumn(i).width : 0;
457
- }
458
- }
459
- // if (startColumn !== this.columns.Count) {
460
- this.columnRanges.push([startColumn, this.Grid.columns.count - 1 ]);
461
- // }
462
- }
463
- /**
464
- * `Layouts the on page`.
465
- * @private
466
- */
467
- private layoutOnPage(param : PdfLayoutParams) : PdfGridLayoutResult {
468
- /* tslint:disable */
469
- this.pageBounds.x = param.bounds.x;
470
- this.pageBounds.y = param.bounds.y;
471
- this.pageBounds.height = param.bounds.height;
472
- let format : PdfGridLayoutFormat = this.getFormat(param.format);
473
- let endArgs : PdfGridEndPageLayoutEventArgs = null;
474
- let result : PdfGridLayoutResult = null;
475
- let layoutedPages : TemporaryDictionary<PdfPage, number[]> = new TemporaryDictionary<PdfPage, number[]>();
476
- let startPage : PdfPage = param.page;
477
- let isParentCell : boolean = false;
478
- let cellBounds : number[] = [];
479
- for (let index : number = 0; index < this.columnRanges.length; index++) {
480
- let range : number[] = this.columnRanges[index];
481
- this.cellStartIndex = range[0];
482
- this.cellEndIndex = range[1];
483
- let returnObject : {returnValue : boolean, currentBounds : RectangleF, currentRowIndex : number }
484
- = this.raiseBeforePageLayout(this.currentPage, this.currentBounds, this.currentRowIndex);
485
- this.currentBounds = returnObject.currentBounds;
486
- this.currentRowIndex = returnObject.currentRowIndex;
487
- // if (returnObject.returnValue) {
488
- // result = new PdfGridLayoutResult(this.currentPage, this.currentBounds);
489
- // break;
490
- // }
491
- //Draw Headers.
492
- let drawHeader : boolean;
493
- for (let i : number = 0; i < this.Grid.headers.count; i++) {
494
- let row : PdfGridRow = this.Grid.headers.getHeader(i);
495
- let headerHeight : number = this.currentBounds.y;
496
- this.isHeader = true;
497
- if (startPage != this.currentPage) {
498
- for (let k: number = this.cellStartIndex; k <= this.cellEndIndex; k++) {
499
- if (row.cells.getCell(k).isCellMergeContinue) {
500
- row.cells.getCell(k).isCellMergeContinue = false;
501
- row.cells.getCell(k).value = "";
502
- }
503
- }
504
- }
505
- // RowLayoutResult
506
- let headerResult: RowLayoutResult = this.drawRow(row);
507
- if (headerHeight === this.currentBounds.y) {
508
- drawHeader = true;
509
- if (PdfGridLayouter.repeatRowIndex === -1) {
510
- PdfGridLayouter.repeatRowIndex = i;
511
- }
512
- } else {
513
- drawHeader = false;
514
- }
515
- if (!headerResult.isFinish && startPage !== null
516
- && format.layout !== PdfLayoutType.OnePage && drawHeader) {
517
- this.startLocation.x = this.currentBounds.x;
518
- this.currentPage = this.getNextPageformat(format);
519
- this.startLocation.y = this.currentBounds.y;
520
- if (typeof format.paginateBounds !== 'undefined' && format.paginateBounds.x === 0 && format.paginateBounds.y === 0 && format.paginateBounds.width === 0 && format.paginateBounds.height === 0)
521
- this.currentBounds.x += this.startLocation.x;
522
-
523
- this.drawRow(row);
524
- }
525
- this.isHeader = false;
526
- }
527
- let i : number = 0;
528
- let length : number = this.Grid.rows.count;
529
- let repeatRow : boolean;
530
- let startingHeight : number = 0;
531
- let flag : boolean = true;
532
- //Here is to draw parent Grid and Cells
533
- cellBounds = [];
534
- //Draw row by row with the specified cell range.
535
- for (let j : number = 0; j < this.Grid.rows.count; j++) {
536
- let row : PdfGridRow = this.Grid.rows.getRow(j);
537
- i++;
538
- this.currentRowIndex = i - 1;
539
- let originalHeight : number = this.currentBounds.y;
540
- startPage = this.currentPage;
541
- PdfGridLayouter.repeatRowIndex = -1;
542
- if(flag && row.grid.isChildGrid)
543
- {
544
- startingHeight = originalHeight;
545
- flag = false;
546
- }
547
- let rowResult : RowLayoutResult = null;
548
- ///rowResult = this.drawRow(row);
549
- /*if(!row.isrowFinish) {
550
- if(!row.grid.isgridSplit){
551
- rowResult = this.drawRow(row);
552
- row.isrowFinish = true;
553
- row.isrowDraw = true;
554
- } else {
555
- if(!row.isrowDraw){
556
- rowResult = this.drawRow(row);
557
- row.isrowFinish = true;
558
- row.isrowDraw = true;
559
- row.grid.isgridSplit = false;
560
- } else {
561
- rowResult = null;
562
- break;
563
- }
564
- }
565
- }
566
- else {
567
- //row.isrowFinish = false;
568
- //rowResult = this.drawRow(row);
569
- rowResult = null;
570
- break;
571
-
572
- } */
573
- if(this.Grid.splitChildRowIndex == -1){
574
- rowResult = this.drawRow(row);
575
- row.isrowFinish = true;
576
- }
577
- else {
578
- if(row.grid.ParentCell.row.grid.isGridSplit && this.Grid.splitChildRowIndex <= row.rowIndex){
579
- rowResult = this.drawRow(row);
580
- row.isrowFinish = true;
581
- } else if(row.isrowFinish) {
582
- continue;
583
- }else{
584
- break;
585
- }
586
-
587
- }
588
- //rowResult = this.drawRow(row);
589
- cellBounds.push(rowResult.bounds.width);
590
- /*if (row.isRowBreaksNextPage)
591
- {
592
- let x : number = 0;
593
- for (let l : number = 0; l < row.cells.count; l++)
594
- {
595
- let isNestedRowBreak : boolean = false;
596
- if (row.height == row.cells.getCell(l).height)
597
- {
598
- let n : number;
599
- let grid : PdfGrid = row.cells.getCell(l).value as PdfGrid;
600
- for (let m : number = grid.rows.count; 0 < m; m--)
601
- {
602
- if ((grid.rows.getRow(m - 1).rowBreakHeight > 0))
603
- {
604
- isNestedRowBreak = true;
605
- break;
606
- }
607
- if (grid.rows.getRow(m - 1).isRowBreaksNextPage)
608
- {
609
- row.rowBreakHeightValue = grid.rows.getRow(m - 1).rowBreakHeightValue;
610
- break;
611
- }
612
- row.rowBreakHeightValue += grid.rows.getRow(m - 1).height;
613
- }
614
- }
615
- if (isNestedRowBreak)
616
- break;
617
- }
618
- for (let j : number = 0; j < row.cells.count; j++)
619
- {
620
-
621
- if (row.height > row.cells.getCell(j).height)
622
- {
623
- row.cells.getCell(j).value = " ";
624
- let rect : RectangleF ;
625
- let page : PdfPage = this.getNextPage(this.currentPage);
626
- let section : PdfSection = this.currentPage.section;
627
- let index : number = section.indexOf(page);
628
- for (let k : number = 0; k < (section.count - 1) - index; k++)
629
- {
630
- rect = new RectangleF(x, 0, row.grid.columns.getColumn(j).width, page.getClientSize().height);
631
- PdfGridLayouter.repeatRowIndex = -1;
632
- row.cells.getCell(j).draw(page.graphics, rect, false);
633
- page = this.getNextPage(page);
634
- }
635
- rect = new RectangleF(x, 0, row.grid.columns.getColumn(j).width, row.rowBreakHeightValue);
636
-
637
- row.cells.getCell(j).draw(page.graphics, rect, false);
638
- }
639
- x += row.grid.columns.getColumn(j).width;
640
- }
641
- }*/
642
- //if height remains same, it is understood that row is not drawn in the page
643
- if (originalHeight === this.currentBounds.y) {
644
- repeatRow = true;
645
- PdfGridLayouter.repeatRowIndex = this.Grid.rows.rowCollection.indexOf(row);
646
- } else {
647
- repeatRow = false;
648
- PdfGridLayouter.repeatRowIndex = -1;
649
- }
650
- while (!rowResult.isFinish && startPage != null)
651
- {
652
- let tempResult : PdfGridLayoutResult = this.getLayoutResult();
653
- /*if (startPage != this.currentPage)
654
- {
655
- if (row.grid.isChildGrid && row.grid.ParentCell != null)
656
- {
657
- let bounds : RectangleF= new RectangleF(new PointF(format.paginateBounds.x,format.paginateBounds.y), new SizeF(param.bounds.width, tempResult.bounds.height));
658
- bounds.x += param.bounds.x;
659
- if (row.grid.ParentCell.row.grid.style.cellPadding != null)
660
- {
661
- bounds.y += row.grid.ParentCell.row.grid.style.cellPadding.top;
662
- if (bounds.height > this.currentPageBounds.height)
663
- {
664
- bounds.height = this.currentPageBounds.height - bounds.y;
665
- bounds.height -= (row.grid.ParentCell.row.grid.style.cellPadding.bottom);
666
- }
667
- }
668
- // Draw border for cells in the nested grid cell's row.
669
- for (let c : number = 0; c < row.cells.count; c++)
670
- {
671
- let cell : PdfGridCell = row.cells.getCell(c);
672
- let cellWidth : number= 0;
673
- if (cell.columnSpan > 1)
674
- {
675
- for (; c < cell.columnSpan; c++)
676
- cellWidth += row.grid.columns.getColumn(c).width;
677
- }
678
- else
679
- cellWidth = Math.max(cell.width, row.grid.columns.getColumn(c).width);
680
- cell.drawCellBorders(this.currentGraphics, new RectangleF(new PointF(bounds.x,bounds.y), new SizeF(cellWidth, bounds.height)));
681
- bounds.x += cellWidth;
682
- c += (cell.columnSpan - 1);
683
- }
684
- }
685
- }
686
- */
687
- endArgs = this.raisePageLayouted(tempResult);
688
- if (endArgs.cancel || repeatRow)
689
- break;
690
- else if (this.Grid.allowRowBreakAcrossPages )
691
- {
692
- //If there is no space in the current page, add new page and then draw the remaining row.
693
- this.currentPage = this.getNextPageformat(format);
694
- originalHeight = this.currentBounds.y;
695
- let location : PointF = new PointF(PdfBorders.default.right.width / 2, PdfBorders.default.top.width / 2);
696
- if ((format.paginateBounds.x === 0 && format.paginateBounds.y === 0 && format.paginateBounds.width === 0 &&
697
- format.paginateBounds.height === 0 ) && (this.startLocation.x === location.x && this.startLocation.y === location.y)) {
698
- this.currentBounds.x += this.startLocation.x;
699
- this.currentBounds.y += this.startLocation.y;
700
- }
701
- if (this.isPaginate) {
702
- this.startLocation.y = this.currentBounds.y;
703
- this.isPaginate = false;
704
- }
705
- if (this.Grid.isChildGrid && row.grid.ParentCell != null)
706
- {
707
- if (this.Grid.ParentCell.row.grid.style.cellPadding != null)
708
- {
709
- if (row.rowBreakHeight + this.Grid.ParentCell.row.grid.style.cellPadding.top < this.currentBounds.height)
710
- {
711
- this.currentBounds.y = this.Grid.ParentCell.row.grid.style.cellPadding.top;
712
- }
713
- }
714
- }
715
-
716
- if (row.grid.ParentCell != null)
717
- {
718
- row.grid.ParentCell.row.isRowBreaksNextPage = true;
719
- row.grid.ParentCell.row.rowBreakHeightValue = row.rowBreakHeight + this.Grid.ParentCell.row.grid.style.cellPadding.top + this.Grid.ParentCell.row.grid.style.cellPadding.bottom;
720
-
721
- for ( let i : number = row.rowIndex + 1; i<row.grid.rows.count;i++){
722
- row.grid.ParentCell.row.rowBreakHeightValue += row.grid.rows.getRow(i).height;
723
- }
724
- //row.rowBreakHeight = row.grid.ParentCell.row.rowBreakHeightValue;
725
- }
726
-
727
- /*if (row.noOfPageCount > 1)
728
- {
729
- let temp : number = row.rowBreakHeightValue;
730
- for (let j : number = 1; j < row.noOfPageCount; j++)
731
- {
732
- row.rowBreakHeightValue = 0;
733
- row.height = ((row.noOfPageCount - 1) * this.currentPage.getClientSize().height);
734
- this.drawRow(row);
735
- this.currentPage = this.getNextPageformat(format);
736
- startPage = this.currentPage;
737
- }
738
- row.rowBreakHeightValue = temp;
739
- row.noOfPageCount = 1;
740
- rowResult = this.drawRow(row);
741
- } else {
742
- rowResult = this.drawRow(row);
743
- }
744
- /*if(row.grid.isChildGrid){
745
- row.isrowFinish = false;
746
- row.isrowDraw = false;
747
- row.grid.isgridSplit = true;
748
- row.grid.ParentCell.row.grid.isgridSplit = true;
749
- //rowResult.isFinish = false;
750
- break;
751
- }*/
752
-
753
- if(row.grid.isChildGrid){
754
- //row.grid.isgridSplit = true;
755
- row.isrowFinish = false;
756
- //row.grid.ParentCell.row.grid.isgridSplit = true;
757
- row.grid.splitChildRowIndex = row.rowIndex;
758
- row.grid.ParentCell.row.grid.splitChildRowIndex = row.grid.ParentCell.row.rowIndex;
759
- if(row.grid.ParentCell.row.grid.isGridSplit)
760
- {
761
- row.grid.ParentCell.row.noOfPageCount+= 1;
762
- row.grid.ParentCell.row.grid.isGridSplit = false;
763
- }
764
- break;
765
- }
766
- if (row.noOfPageCount <1)
767
- {
768
- if(row.grid.splitChildRowIndex != -1){
769
- row.grid.isGridSplit = true;
770
- }
771
- if (row.style.border != null && ((row.style.border.left != null && row.style.border.left.width !== 1)
772
- || (row.style.border.top != null && row.style.border.top.width !== 1))) {
773
- let x : number = row.style.border.left.width / 2;
774
- let y : number = row.style.border.top.width / 2;
775
- if (this.currentBounds.x === PdfBorders.default.right.width / 2 && this.currentBounds.y === PdfBorders.default.right.width / 2) {
776
- let newBound : RectangleF = new RectangleF(x, y, this.currentBounds.width, this.currentBounds.height);
777
- this.currentBounds = newBound;
778
- }
779
- }
780
- if (this.Grid.repeatHeader) {
781
- for (let j : number = 0; j < this.Grid.headers.count; j++) {
782
- let headerRepeat : PdfGridRow = this.Grid.headers.getHeader(j);
783
- this.drawRow(headerRepeat);
784
- }
785
- }
786
- rowResult = this.drawRow(row);
787
- if(row.noOfPageCount >= 1){
788
- let temp : number = row.rowBreakHeightValue;
789
- for (let j : number = 0; j < row.noOfPageCount; j++)
790
- {
791
- //this.currentPage.section.add();
792
- let tempResult1 : PdfGridLayoutResult = this.getLayoutResult();
793
- endArgs = this.raisePageLayouted(tempResult1);
794
-
795
- this.currentPage = this.getNextPageformat(format);
796
- originalHeight = this.currentBounds.y;
797
- //row.rowBreakHeightValue = 0;
798
- if(row.grid.splitChildRowIndex != -1){
799
- row.grid.isGridSplit = true;
800
- }
801
- this.currentBounds.y = 0.5;
802
- if (this.Grid.repeatHeader) {
803
- for (let i : number = 0; i < this.Grid.headers.count; i++) {
804
- let header : PdfGridRow = this.Grid.headers.getHeader(i);
805
- this.drawRow(header);
806
- }
807
- }
808
- //row.height = ((row.noOfPageCount - 1) * this.currentPage.getClientSize().height);
809
- this.drawRow(row);
810
-
811
- }
812
- // row.rowBreakHeight = temp;
813
- // row.noOfPageCount = 1;
814
- // rowResult = this.drawRow(row);
815
- }
816
- row.grid.splitChildRowIndex = -1;
817
- row.grid.isGridSplit = false;
818
- rowResult.isFinish = true;
819
- //row.NestedGridLayoutResult.bounds.height = row.rowBreakHeightValue;
820
- //this.currentBounds.y = rowResult.bounds.y;
821
- for(let i : number = 0; i<row.cells.count;i++){
822
- if(row.cells.getCell(i).value instanceof PdfGrid){
823
- (row.cells.getCell(i).value as PdfGrid).splitChildRowIndex = -1; }
824
- }
825
- }
826
-
827
- }
828
- // else if (!this.Grid.allowRowBreakAcrossPages && i < length)
829
- // {
830
- // this.currentPage = this.getNextPageformat(format);
831
- // break;
832
- // }
833
- // else if (i >= length)
834
- // break;
835
- }
836
- if (!rowResult.isFinish && startPage !== null && format.layout !== PdfLayoutType.OnePage && repeatRow) {
837
- // During pagination, cell position is maintained here.
838
- this.startLocation.x = this.currentBounds.x;
839
- let isAddNextPage : boolean = false;
840
- this.currentPage = this.getNextPageformat(format);
841
- /*if (!this.Grid.isSingleGrid)
842
- {
843
- for ( let j : number= 0; j < this.Grid.rows.count; j++)
844
- {
845
- let isWidthGreaterthanParent : boolean = false;
846
- for (let k : number = 0; k < this.Grid.rows.getRow(j).cells.count; k++)
847
- {
848
- if (this.Grid.rows.getRow(j).cells.getCell(k).width > this.currentPageBounds.width)
849
- isWidthGreaterthanParent = true;
850
- }
851
- if (isWidthGreaterthanParent && this.Grid.rows.getRow(j).cells.getCell(this.rowBreakPageHeightCellIndex).pageCount > 0)
852
- {
853
- isAddNextPage = true;
854
- }
855
- }
856
- }
857
- if (!this.Grid.isRearranged && isAddNextPage)
858
- {
859
- let section : PdfSection = this.currentPage.section;
860
-
861
- //this.currentPage = section.add();
862
-
863
- this.currentGraphics = this.currentPage.graphics;
864
- this.currentBounds = new RectangleF(new PointF(0,0), this.currentPage.getClientSize());
865
-
866
- let pageindex : number = (this.currentGraphics.page as PdfPage).section.indexOf(this.currentGraphics.page as PdfPage);
867
- }
868
- else
869
- {
870
- this.currentPage = this.getNextPageformat(format);
871
- }
872
- if (format.paginateBounds.y == 0)
873
- this.currentBounds.y = PdfBorders.default.top.width/2;
874
- else
875
- {
876
- this.currentBounds.y = format == null ? 0 : format.paginateBounds.y;
877
-
878
- }
879
- if (this.raiseBeforePageLayout(this.currentPage, this.currentBounds, this.currentRowIndex))
880
- break;*/
881
- if ((param.format !== null) && !param.format.usePaginateBounds && param.bounds !== null &&
882
- param.bounds.height > 0 && !this.Grid.isChildGrid) {
883
- this.currentBounds.height = param.bounds.height;
884
- }
885
- if (typeof param.format !== 'undefined' && param.format != null && typeof param.format.usePaginateBounds !== 'undefined' && !param.format.usePaginateBounds && !(param.format.paginateBounds.x === 0 && param.format.paginateBounds.y === 0 && param.format.paginateBounds.width === 0 && param.format.paginateBounds.height === 0) && param.format.paginateBounds.y === 0) {
886
- this.currentBounds.y = PdfBorders.default.top.width / 2;
887
- } else {
888
- this.currentBounds.y = format == null ? 0 : format.paginateBounds.y;
889
- }
890
- if (typeof param.format !== 'undefined' && (param.format !== null) && typeof param.format.usePaginateBounds !== 'undefined' && !param.format.usePaginateBounds && param.bounds !== null &&
891
- param.bounds.y > 0 && !this.Grid.isChildGrid) {
892
- this.currentBounds.y = param.bounds.y;
893
- }
894
- this.startLocation.y = this.currentBounds.y;
895
- if ((format.paginateBounds.x === format.paginateBounds.y) &&
896
- (format.paginateBounds.y === format.paginateBounds.height) &&
897
- (format.paginateBounds.height === format.paginateBounds.width) && (format.paginateBounds.width === 0)) {
898
- this.currentBounds.x += this.startLocation.x;
899
- }
900
- if (this.currentBounds.x === PdfBorders.default.left.width / 2 ) {
901
- this.currentBounds.y += this.startLocation.x;
902
- }
903
- if (this.Grid.repeatHeader) {
904
- for (let i : number = 0; i < this.Grid.headers.count; i++) {
905
- let header : PdfGridRow = this.Grid.headers.getHeader(i);
906
- this.drawRow(header);
907
- }
908
- }
909
- this.drawRow(row);
910
- if (this.currentPage !== null && !layoutedPages.containsKey(this.currentPage)) {
911
- layoutedPages.add(this.currentPage, range);
912
- }
913
- }
914
- if (row.NestedGridLayoutResult != null)
915
- {
916
- // Position for next row in the grid.
917
- this.currentPage = row.NestedGridLayoutResult.page;
918
- this.currentGraphics = this.currentPage.graphics; //If not, next row will not be drawn in the layouted page.
919
- this.startLocation = new PointF(row.NestedGridLayoutResult.bounds.x,row.NestedGridLayoutResult.bounds.y);
920
- let recalHeight : number = this.ReCalculateHeight(row,row.NestedGridLayoutResult.bounds.height);
921
- this.currentBounds.y = recalHeight;
922
- //this.currentBounds.y = row.NestedGridLayoutResult.bounds.height;
923
- if (startPage != this.currentPage)
924
- {
925
- let secion : PdfSection= this.currentPage.section;
926
- let startIndex : number = secion.indexOf(startPage) + 1;
927
- let endIndex : number = secion.indexOf(this.currentPage);
928
-
929
- for (let page : number = startIndex; page < endIndex + 1; page++)
930
- {
931
- let pageGraphics : PdfGraphics = this.currentPage.graphics;
932
- let location : PointF = new PointF(format.paginateBounds.x,format.paginateBounds.y);
933
-
934
- let height : number = page == endIndex ? (row.NestedGridLayoutResult.bounds.height-param.bounds.y) :
935
- (this.currentBounds.height - location.y);
936
- if (height <= pageGraphics.clientSize.height)
937
- height += param.bounds.y;
938
- // if (row.grid.isChildGrid && row.grid.ParentCell != null)
939
- // location.x += param.bounds.x;
940
- location.y = format == null ? 0.5 : format.paginateBounds.y;
941
-
942
- // Draw border for last paginated row containing nested grid.
943
- for (let c : number = 0; c < row.cells.count; c++)
944
- {
945
- let cell : PdfGridCell = row.cells.getCell(c);
946
- let cellWidth : number = 0;
947
- let totalwidth : number = 0;
948
- if (cell.value instanceof PdfGrid)
949
- {
950
- for(let i : number =0 ; i < cell.value.columns.count; i++)
951
- {
952
- totalwidth += cell.value.columns.getColumn(i).columnWidth;
953
- }
954
- } else {
955
- totalwidth = cell.width;
956
- }
957
- // if (cell.columnSpan > 1)
958
- // {
959
- // for (; c < cell.columnSpan; c++)
960
- // cellWidth += row.grid.columns.getColumn(c).width;
961
- // }
962
- // else
963
- cellWidth = Math.max(totalwidth, row.grid.columns.getColumn(c).width);
964
-
965
- cell.drawCellBorders(pageGraphics, new RectangleF(location, new SizeF(cellWidth, height)));
966
- location.x += cellWidth;
967
- c += (cell.columnSpan - 1);
968
- }
969
- }
970
-
971
- // So, nested grid drawing is completed for the current row. Update page.
972
- // Otherwise, the next nested grid of the parent will draw borders from start.
973
- startPage = this.currentPage;
974
- }
975
- }
976
- }
977
- let isPdfGrid : boolean = false;
978
- let maximumCellBoundsWidth : number = 0;
979
- if (cellBounds.length > 0) {
980
- maximumCellBoundsWidth = cellBounds[0];
981
- }
982
- let largeNavigatePage : number[][] = [[1, 2]];
983
- for ( let c:number = 0; c < this.Grid.rows.count; c++)
984
- {
985
-
986
- if (this.cellEndIndex != -1 && this.Grid.rows.getRow(c).cells.getCell(this.cellEndIndex).value instanceof PdfGrid)
987
- {
988
- let grid: PdfGrid = this.Grid.rows.getRow(c).cells.getCell(this.cellEndIndex).value as PdfGrid;
989
- this.rowLayoutBoundsWidth= grid.rowLayoutBoundsWidth;
990
- isPdfGrid = true;
991
- // if (largeNavigatePage[0][0] < grid.listOfNavigatePages.length)
992
- // {
993
- // largeNavigatePage[0][0] = grid.listOfNavigatePages.length;
994
- // largeNavigatePage[0][1] = cellBounds[c];
995
- // }
996
- // else if ((largeNavigatePage[0][0] == grid.listOfNavigatePages.length) && (largeNavigatePage[0][1] < cellBounds[c]))
997
- // {
998
- // largeNavigatePage[0][1] = cellBounds[c];
999
- // }
1000
-
1001
- }
1002
- }
1003
- if (!isPdfGrid && cellBounds.length > 0) {
1004
- for (let c : number = 0; c < i - 1; c++) {
1005
- if (maximumCellBoundsWidth < cellBounds[c]) {
1006
- maximumCellBoundsWidth = cellBounds[c];
1007
- }
1008
- }
1009
- this.rowLayoutBoundsWidth = maximumCellBoundsWidth;
1010
- } else {
1011
- this.rowLayoutBoundsWidth = largeNavigatePage[0][1];
1012
- }
1013
- if (this.columnRanges.indexOf(range) < this.columnRanges.length - 1
1014
- && startPage != null && format.layout != PdfLayoutType.OnePage) {
1015
- isParentCell = this.Grid.isChildGrid;
1016
-
1017
- if ((largeNavigatePage[0] [0] as Number )!= 0)
1018
- {
1019
- let section : PdfSection = this.currentPage.section;
1020
- let pageIndex : number = section.indexOf(this.currentPage);
1021
-
1022
- this.currentGraphics = this.currentPage.graphics;
1023
- this.currentBounds = new RectangleF(new PointF(0,0), this.currentPage.getClientSize());
1024
- let pageindex : Number = (this.currentGraphics.page as PdfPage).section.indexOf(this.currentGraphics.page as PdfPage);
1025
- }
1026
- else
1027
- {
1028
- this.currentPage = this.getNextPageformat(format);
1029
- }
1030
-
1031
- // let locationGrid : PointF= new PointF(PdfBorders.default.right.width / 2, PdfBorders.default.top.width / 2);
1032
- // if (format.paginateBounds == new RectangleF(0,0,0,0) && this.startLocation == locationGrid)
1033
- // {
1034
- // this.currentBounds.x += this.startLocation.x;
1035
- // this.currentBounds.y += this.startLocation.y;
1036
- // }
1037
- }
1038
- if (this.columnRanges.length-1 !== index && this.columnRanges.length > 1 && format.layout !== PdfLayoutType.OnePage) {
1039
- this.currentPage = this.getNextPageformat(format);
1040
- if ((format.paginateBounds.x === format.paginateBounds.y) && (format.paginateBounds.y === format.paginateBounds.height)
1041
- && (format.paginateBounds.height === format.paginateBounds.width) && (format.paginateBounds.width === 0)) {
1042
- this.currentBounds.x += this.startLocation.x;
1043
- this.currentBounds.y += this.startLocation.y;
1044
- //this.currentBounds.height = this.pageBounds.height;
1045
- }
1046
- }
1047
-
1048
- }
1049
- result = this.getLayoutResult();
1050
- if (this.Grid.style.allowHorizontalOverflow && this.Grid.style.horizontalOverflowType == PdfHorizontalOverflowType.NextPage) {
1051
- this.reArrangePages(layoutedPages);
1052
- }
1053
- this.raisePageLayouted(result);
1054
- return result;
1055
- }
1056
- /* tslint:enable */
1057
- /**
1058
- * Gets the `next page`.
1059
- * @private
1060
- */
1061
- public getNextPageformat(format : PdfLayoutFormat) : PdfPage {
1062
- let section : PdfSection = this.currentPage.section;
1063
- let nextPage : PdfPage = null;
1064
- let index : number = section.indexOf(this.currentPage);
1065
- this.flag = false;
1066
- if (index === section.count - 1) {
1067
- nextPage = (section.add() as PdfPage);
1068
- } else {
1069
- nextPage = (section.getPages()[index + 1] as PdfPage);
1070
- }
1071
- this.currentGraphics = nextPage.graphics;
1072
- let pageindex : number = (this.currentGraphics.page as PdfPage).section.indexOf(this.currentGraphics.page as PdfPage);
1073
- if (!(this.listOfNavigatePages.indexOf(pageindex) !== -1)) {
1074
- this.listOfNavigatePages.push(pageindex);
1075
- }
1076
- this.currentBounds = new RectangleF(new PointF(0, 0), nextPage.getClientSize());
1077
- if ((typeof format !== 'undefined') && format != null && format.usePaginateBounds && (typeof format.paginateBounds !== 'undefined') && format.paginateBounds != null && (format.paginateBounds.x !== format.paginateBounds.y) && (format.paginateBounds.y !== format.paginateBounds.height)
1078
- && (format.paginateBounds.height !== format.paginateBounds.width) && (format.paginateBounds.width !== 0)) {
1079
- this.currentBounds.x = format.paginateBounds.x;
1080
- this.currentBounds.y = format.paginateBounds.y;
1081
- this.currentBounds.height = format.paginateBounds.height;
1082
- }
1083
- return nextPage;
1084
- }
1085
- private CheckIfDefaultFormat(format : PdfStringFormat) : boolean {
1086
- let defaultFormat : PdfStringFormat = new PdfStringFormat();
1087
- return (format.alignment === defaultFormat.alignment && format.characterSpacing === defaultFormat.characterSpacing &&
1088
- format.clipPath === defaultFormat.clipPath && format.firstLineIndent === defaultFormat.firstLineIndent &&
1089
- format.horizontalScalingFactor === defaultFormat.horizontalScalingFactor &&
1090
- format.lineAlignment === defaultFormat.lineAlignment
1091
- && format.lineLimit === defaultFormat.lineLimit && format.lineSpacing === defaultFormat.lineSpacing &&
1092
- format.measureTrailingSpaces === defaultFormat.measureTrailingSpaces && format.noClip === defaultFormat.noClip &&
1093
- format.paragraphIndent === defaultFormat.paragraphIndent && format.rightToLeft === defaultFormat.rightToLeft &&
1094
- format.subSuperScript === defaultFormat.subSuperScript && format.wordSpacing === defaultFormat.wordSpacing &&
1095
- format.wordWrap === defaultFormat.wordWrap);
1096
- }
1097
- /**
1098
- * `Raises BeforeCellDraw event`.
1099
- * @private
1100
- */
1101
- private RaiseBeforeCellDraw(graphics : PdfGraphics, rowIndex : number, cellIndex : number, bounds : RectangleF,
1102
- value : string, style : PdfGridCellStyle ) : PdfGridCellStyle {
1103
- let args : PdfGridBeginCellDrawEventArgs = null;
1104
- if (this.Grid.raiseBeginCellDraw) {
1105
- args = new PdfGridBeginCellDrawEventArgs(graphics, rowIndex, cellIndex, bounds, value, style);
1106
- this.Grid.onBeginCellDraw(args);
1107
- style = args.style;
1108
- }
1109
- return style;
1110
- }
1111
- /**
1112
- * `Raises AfterCellDraw event`.
1113
- * @private
1114
- */
1115
- private raiseAfterCellDraw(graphics : PdfGraphics, rowIndex : number, cellIndex : number,
1116
- bounds : RectangleF, value : string, cellstyle : PdfGridCellStyle) : void {
1117
- let args : PdfGridEndCellDrawEventArgs = null;
1118
- if (this.Grid.raiseEndCellDraw) {
1119
- args = new PdfGridEndCellDrawEventArgs(graphics, rowIndex, cellIndex, bounds, value, cellstyle);
1120
- this.Grid.onEndCellDraw(args);
1121
- }
1122
- }
1123
- private reArrangePages(layoutedPages : TemporaryDictionary<PdfPage, number[]>) : void {
1124
- let document : PdfDocument = this.currentPage.document;
1125
- let pages : PdfPage[] = [];
1126
- let keys : PdfPage[] = layoutedPages.keys();
1127
- let values : number[][] = layoutedPages.values();
1128
- for (let i : number = 0; i < keys.length; i++) {
1129
- let page : PdfPage = keys[i] as PdfPage;
1130
- page.section = null;
1131
- pages.push(page);
1132
- document.pages.remove(page);
1133
- }
1134
- /* tslint:disable */
1135
- for (let i : number = 0; i < layoutedPages.size(); i++) {
1136
- let count : number = 0;
1137
- for (let j : number = i, count = (layoutedPages.size() / this.columnRanges.length); j < layoutedPages.size(); j += count) {
1138
- let page : PdfPage = pages[j];
1139
- if (document.pages.indexOf(page) === -1) {
1140
- document.pages.add(page);
1141
- }
1142
- }
1143
- }
1144
- /* tslint:enable */
1145
- }
1146
- /**
1147
- * Gets the `layout result`.
1148
- * @private
1149
- */
1150
- private getLayoutResult() : PdfGridLayoutResult {
1151
- if (this.Grid.isChildGrid && this.Grid.allowRowBreakAcrossPages) {
1152
- for (let i : number = 0; i < this.Grid.rows.count; i++) {
1153
- let row : PdfGridRow = this.Grid.rows.getRow(i);
1154
- if (row.rowBreakHeight > 0 && row.repeatFlag) {
1155
- this.startLocation.y = this.currentPage.origin.y;
1156
- }
1157
- }
1158
- }
1159
- let bounds : RectangleF;
1160
- if (!this.isChanged) {
1161
- bounds = new RectangleF(this.startLocation, new SizeF(this.currentBounds.width, this.currentBounds.y -
1162
- this.startLocation.y));
1163
- }
1164
- // else {
1165
- // bounds = new RectangleF(this.currentLocation, new SizeF(this.currentBounds.width, this.currentBounds.y -
1166
- // this.currentLocation.y));
1167
- // }
1168
- /* tslint:enable */
1169
- return new PdfGridLayoutResult(this.currentPage, bounds);
1170
- }
1171
- /**
1172
- * `Recalculate row height` for the split cell to be drawn.
1173
- * @private
1174
- */
1175
- public ReCalculateHeight(row : PdfGridRow, height : number) : number {
1176
- let newHeight : number = 0.0;
1177
- for (let i : number = this.cellStartIndex; i <= this.cellEndIndex; i++) {
1178
- if (!(row.cells.getCell(i).remainingString === null || row.cells.getCell(i).remainingString === '' ||
1179
- typeof row.cells.getCell(i).remainingString === 'undefined')) {
1180
- newHeight = Math.max(newHeight, row.cells.getCell(i).measureHeight());
1181
- }
1182
- }
1183
- return Math.max(height, newHeight);
1184
- }
1185
- /**
1186
- * `Raises BeforePageLayout event`.
1187
- * @private
1188
- */
1189
- private raiseBeforePageLayout(currentPage : PdfPage, currentBounds : RectangleF,
1190
- currentRow : number) : { returnValue : boolean, currentBounds : RectangleF,
1191
- currentRowIndex : number } {
1192
- let cancel : boolean = false;
1193
- if (this.Grid.raiseBeginPageLayout) {
1194
- let args : PdfGridBeginPageLayoutEventArgs = new PdfGridBeginPageLayoutEventArgs( currentBounds, currentPage, currentRow);
1195
- this.Grid.onBeginPageLayout(args);
1196
- // if (currentBounds !== args.Bounds) {
1197
- // this.isChanged = true;
1198
- // this.currentLocation = new PointF(args.Bounds.x, args.Bounds.y);
1199
- // this.measureColumnsWidth(new RectangleF(new PointF(args.Bounds.x, args.Bounds.y) ,
1200
- // new SizeF(args.Bounds.width + args.Bounds.x ,
1201
- // args.Bounds.height)));
1202
- // }
1203
- cancel = args.cancel;
1204
- currentBounds = args.bounds;
1205
- currentRow = args.startRowIndex;
1206
- }
1207
- return {returnValue : cancel, currentBounds : currentBounds, currentRowIndex : currentRow };
1208
- }
1209
- /**
1210
- * `Raises PageLayout event` if needed.
1211
- * @private
1212
- */
1213
- private raisePageLayouted(result : PdfLayoutResult) : PdfGridEndPageLayoutEventArgs {
1214
- let args : PdfGridEndPageLayoutEventArgs = new PdfGridEndPageLayoutEventArgs(result);
1215
- if (this.Grid.raiseEndPageLayout) {
1216
- this.Grid.onEndPageLayout(args);
1217
- }
1218
- return args;
1219
- }
1220
- private drawRow(row : PdfGridRow) : RowLayoutResult
1221
- /**
1222
- * `Draws row`
1223
- * @private
1224
- */
1225
- private drawRow(row : PdfGridRow, result : RowLayoutResult, height : number) : void
1226
- private drawRow(row : PdfGridRow, result ?: RowLayoutResult, height ?: number) : RowLayoutResult|void {
1227
- if (typeof result === 'undefined') {
1228
- //.. Check if required space available.
1229
- //.....If the row conains spans which falls through more than one page, then draw the row to next page.
1230
- let result : RowLayoutResult = new RowLayoutResult();
1231
- let rowHeightWithSpan : number = 0;
1232
- let location : PointF = new PointF(0, 0);
1233
- let size : SizeF = new SizeF(0, 0);
1234
- let isHeader : boolean = false;
1235
- if (row.rowSpanExists) {
1236
- let maxSpan : number = 0;
1237
- let currRowIndex : number = this.Grid.rows.rowCollection.indexOf(row);
1238
- if (currRowIndex === -1) {
1239
- currRowIndex = this.Grid.headers.indexOf(row);
1240
- if (currRowIndex !== -1) {
1241
- isHeader = true;
1242
- }
1243
- }
1244
- for (let i : number = 0; i < row.cells.count; i++) {
1245
- let cell : PdfGridCell = row.cells.getCell(i);
1246
- maxSpan = Math.max(maxSpan, cell.rowSpan);
1247
- }
1248
- for (let i : number = currRowIndex; i < currRowIndex + maxSpan; i++) {
1249
- rowHeightWithSpan += (isHeader ? this.Grid.headers.getHeader(i).height : this.Grid.rows.getRow(i).height);
1250
- }
1251
- // let rowMaxHeight : number = rowHeightWithSpan;
1252
- // for (let i : number = 0; i < row.cells.count; i++ ) {
1253
- // rowMaxHeight = rowMaxHeight > row.cells.getCell(i).height ? rowMaxHeight : row.cells.getCell(i).height;
1254
- // }
1255
- // let flag : boolean = true;
1256
- // let nextRow : PdfGridRow = this.Grid.headers.getHeader(this.Grid.headers.indexOf(row) + 1);
1257
- // for (let i : number = 0; i < nextRow.cells.count; i++ ) {
1258
- // if (nextRow.cells.getCell(i).value !== '' && nextRow.cells.getCell(i).value !== undefined) {
1259
- // flag = false;
1260
- // break;
1261
- // }
1262
- // }
1263
- // if ((rowMaxHeight > rowHeightWithSpan) && flag) {
1264
- // row.height += (rowMaxHeight - rowHeightWithSpan);
1265
- // }
1266
- }
1267
- let calculatedHeight : number = row.rowBreakHeight > 0.0 ? row.rowBreakHeight : row.height;
1268
- if (this.Grid.isChildGrid && this.Grid.ParentCell != null) {
1269
- //Split row only if row height exceeds page height and AllowRowBreakAcrossPages is true.
1270
- // if (calculatedHeight + this.Grid.ParentCell.row.grid.style.cellPadding.bottom +
1271
- // this.Grid.ParentCell.row.grid.style.cellPadding.top > this.currentPageBounds.height) {
1272
- // if (this.Grid.allowRowBreakAcrossPages) {
1273
- // result.isFinish = true;
1274
- // if ( this.Grid.isChildGrid && row.rowBreakHeight > 0 ) {
1275
- // if (this.Grid.ParentCell.row.grid.style.cellPadding !== null) {
1276
- // this.currentBounds.y += this.Grid.ParentCell.row.grid.style.cellPadding.top;
1277
- // }
1278
- // this.currentBounds.x = this.startLocation.x;
1279
- // }
1280
- // result.bounds = this.currentBounds ;
1281
- // this.drawRowWithBreak(result, row, calculatedHeight);
1282
- // } else {
1283
- // //If AllowRowBreakAcrossPages is not true, draw the row till it fits the page.
1284
-
1285
- // if (this.Grid.ParentCell.row.grid.style.cellPadding != null) {
1286
- // this.currentBounds.y += this.Grid.ParentCell.row.grid.style.cellPadding.top;
1287
- // calculatedHeight = this.currentBounds.height - this.currentBounds.y -
1288
- // this.Grid.ParentCell.row.grid.style.cellPadding.bottom;
1289
- // }
1290
- // result.isFinish = false;
1291
- // this.drawRow( row, result, calculatedHeight);
1292
- // }
1293
- // } else
1294
- if (this.currentBounds.y + this.Grid.ParentCell.row.grid.style.cellPadding.bottom + calculatedHeight >
1295
- this.currentPageBounds.height || this.currentBounds.y + this.Grid.ParentCell.row.grid.style.cellPadding.bottom
1296
- + calculatedHeight > this.currentBounds.height || this.currentBounds.y +
1297
- this.Grid.ParentCell.row.grid.style.cellPadding.bottom + rowHeightWithSpan > this.currentPageBounds.height) {
1298
- //If a row is repeated and still cannot fit in page, proceed draw.
1299
- if (this.Grid.ParentCell.row.grid.LayoutFormat.break === PdfLayoutBreakType.FitPage ) {
1300
- PdfGridLayouter.repeatRowIndex = this.Grid.rows.rowCollection.indexOf(row);
1301
- this.Grid.splitChildRowIndex = this.Grid.rows.rowCollection.indexOf(row);
1302
- }
1303
- if (PdfGridLayouter.repeatRowIndex > -1 && PdfGridLayouter.repeatRowIndex === row.rowIndex) {
1304
- if (this.Grid.allowRowBreakAcrossPages) {
1305
- result.isFinish = true;
1306
- // if (this.Grid.isChildGrid && row.rowBreakHeightValue > 0) {
1307
- // // if (this.Grid.ParentCell.row.grid.style.cellPadding != null) {
1308
- // // this.currentBounds.y += this.Grid.ParentCell.row.grid.style.cellPadding.top;
1309
- // // }
1310
- // this.currentBounds.x = this.startLocation.x;
1311
- // }
1312
- result.bounds = this.currentBounds;
1313
- this.drawRowWithBreak(result, row, calculatedHeight);
1314
- row.repeatFlag = true;
1315
- row.repeatRowNumber = PdfGridLayouter.repeatRowIndex;
1316
- }
1317
- // else {
1318
- // result.isFinish = false;
1319
- // row.repeatFlag = false;
1320
- // this.drawRow( row, result, calculatedHeight);
1321
- // }
1322
- }
1323
- // else {
1324
- // result.isFinish = false;
1325
- // }
1326
- } else {
1327
- result.isFinish = true;
1328
- if (row.grid.ParentCell.row.rowBreakHeightValue > 0 ) {
1329
- row.repeatFlag = true;
1330
- } else {
1331
- row.repeatFlag = false;
1332
- calculatedHeight = row.height;
1333
- }
1334
- if (this.Grid.isChildGrid && row.rowBreakHeight > 0) {
1335
- if (this.Grid.ParentCell.row.grid.style.cellPadding != null) {
1336
- calculatedHeight += this.Grid.ParentCell.row.grid.style.cellPadding.bottom;
1337
- }
1338
- }
1339
- this.drawRow( row, result, calculatedHeight);
1340
- }
1341
- } else {
1342
- //Split row only if row height exceeds page height and AllowRowBreakAcrossPages is true.
1343
- if (calculatedHeight > this.currentPageBounds.height) {
1344
- if (this.Grid.allowRowBreakAcrossPages) {
1345
- result.isFinish = true;
1346
- //result.bounds = this.currentBounds;
1347
- this.drawRowWithBreak(result, row, calculatedHeight);
1348
- row.isrowFinish = true;
1349
- row.repeatFlag = true;
1350
- if (row.grid.splitChildRowIndex !== -1) {
1351
- result.isFinish = false;
1352
- }
1353
- }
1354
- // else {
1355
- // //If AllowRowBreakAcrossPages is not true, draw the row till it fits the page.
1356
- // result.isFinish = false;
1357
- // this.drawRow( row, result, calculatedHeight);
1358
- // }
1359
- } else if (this.currentBounds.y + calculatedHeight > this.currentPageBounds.height ||
1360
- this.currentBounds.y + calculatedHeight > (this.currentBounds.height + this.startLocation.y) ||
1361
- this.currentBounds.y + rowHeightWithSpan > this.currentPageBounds.height) {
1362
- // If a row is repeated and still cannot fit in page, proceed draw.
1363
- let isFit: boolean = false;
1364
- if ((this.Grid.allowRowBreakAcrossPages && !this.Grid.repeatHeader && !row.isRowHeightSet && !row.rowMergeComplete)) {
1365
- if (this.Grid.LayoutFormat !== null && this.Grid.LayoutFormat.paginateBounds.height > 0 && typeof this.Grid.ParentCell !== 'undefined' && this.Grid.ParentCell !== null && (this.currentBounds.y + this.Grid.ParentCell.row.grid.style.cellPadding.bottom + calculatedHeight) > this.currentBounds.height) {
1366
- isFit = this.isFitToCell((this.currentBounds.height + this.startLocation.y) - this.currentBounds.y, this.Grid, row);
1367
- }
1368
- else
1369
- isFit = this.isFitToCell(this.currentPageBounds.height - this.currentBounds.y, this.Grid, row);
1370
- if (isFit) {
1371
- this.isPaginate = true;
1372
- }
1373
- }
1374
- else if (this.Grid.allowRowBreakAcrossPages && this.Grid.LayoutFormat != null && this.Grid.LayoutFormat.layout == PdfLayoutType.Paginate && this.Grid.LayoutFormat.break != PdfLayoutBreakType.FitElement && row.isRowHeightSet && this.currentBounds.y + height > this.currentPageBounds.height) {
1375
- isFit = this.isFitToCell(this.currentPageBounds.height - this.currentBounds.y, this.Grid, row);
1376
- if (!isFit)
1377
- isFit = !(this.slr !== null && this.slr.actualSize.height == 0 && this.slr.remainder != null && this.slr.remainder.length > 0 && this.remainderText == this.slr.remainder);
1378
-
1379
- if (isFit && this.slr != null && this.slr.lineCount > 1) {
1380
- //It may text cutoff issue
1381
- isFit = false;
1382
- }
1383
- this.remainderText = null;
1384
- }
1385
- if (PdfGridLayouter.repeatRowIndex > -1 && PdfGridLayouter.repeatRowIndex === row.rowIndex || isFit) {
1386
- if (this.Grid.allowRowBreakAcrossPages) {
1387
- result.isFinish = true;
1388
- this.drawRowWithBreak(result, row, calculatedHeight);
1389
- row.repeatFlag = true;
1390
- row.repeatRowNumber = PdfGridLayouter.repeatRowIndex;
1391
- if (row.grid.splitChildRowIndex !== -1) {
1392
- result.isFinish = false;
1393
- }
1394
- }
1395
- else {
1396
- result.isFinish = false;
1397
- this.drawRow(row, result, calculatedHeight);
1398
- }
1399
- } else {
1400
- result.isFinish = false;
1401
- }
1402
- } else {
1403
- result.isFinish = true;
1404
- this.drawRow(row, result, calculatedHeight);
1405
- row.repeatFlag = false;
1406
- }
1407
- }
1408
- return result;
1409
- } else {
1410
- let skipcell : boolean = false;
1411
- let location : PointF = new PointF(this.currentBounds.x, this.currentBounds.y);
1412
- // if (row.grid.isChildGrid && row.grid.allowRowBreakAcrossPages && this.startLocation.x !== this.currentBounds.x && row.width <
1413
- // this.currentPage.getClientSize().width) {
1414
- // location.x = this.startLocation.x;
1415
- // }
1416
- result.bounds = new RectangleF(location, new SizeF(0, 0));
1417
- height = this.ReCalculateHeight(row, height);
1418
- for (let i : number = this.cellStartIndex; i <= this.cellEndIndex; i++) {
1419
- let cancelSpans : boolean = ((i > this.cellEndIndex + 1) && (row.cells.getCell(i).columnSpan > 1));
1420
- // let cancelSpans : boolean = false;
1421
- if (!cancelSpans) {
1422
- for (let j : number = 1; j < row.cells.getCell(i).columnSpan; j++) {
1423
- row.cells.getCell(i + j).isCellMergeContinue = true;
1424
- }
1425
- }
1426
- let size : SizeF = new SizeF(this.Grid.columns.getColumn(i).width, height);
1427
- // if (size.width > this.currentGraphics.clientSize.width) {
1428
- // size.width = this.currentGraphics.clientSize.width;
1429
- // }
1430
- // if (this.Grid.isChildGrid && this.Grid.style.allowHorizontalOverflow) {
1431
- // if (size.width >= this.currentGraphics.clientSize.width) {
1432
- // size.width -= 2 * this.currentBounds.x;
1433
- // }
1434
- // }
1435
- /* tslint:disable */
1436
- if (!this.CheckIfDefaultFormat(this.Grid.columns.getColumn(i).format) &&
1437
- this.CheckIfDefaultFormat(row.cells.getCell(i).stringFormat)) {
1438
- row.cells.getCell(i).stringFormat = this.Grid.columns.getColumn(i).format;
1439
- }
1440
- let cellstyle : PdfGridCellStyle = row.cells.getCell(i).style;
1441
- let tempValue : string = ((typeof row.cells.getCell(i).value === 'string' &&
1442
- row.cells.getCell(i).value !== null) ? row.cells.getCell(i).value : '') as string;
1443
-
1444
- row.cells.getCell(i).style = this.RaiseBeforeCellDraw(this.currentGraphics, this.currentRowIndex, i,
1445
- new RectangleF(location, size), tempValue, cellstyle);
1446
- //row.cells.getCell(i).style = cellstyle;
1447
- if (!skipcell) {
1448
- if (row.cells.getCell(i).value instanceof PdfGrid)
1449
- {
1450
- let grid :PdfGrid = row.cells.getCell(i).value as PdfGrid;
1451
- grid.parentCellIndex = i;
1452
- }
1453
- let stringResult : PdfStringLayoutResult = row.cells.getCell(i).draw(this.currentGraphics,
1454
- new RectangleF(location, size), cancelSpans);
1455
- if (row.grid.style.allowHorizontalOverflow && (row.cells.getCell(i).columnSpan > this.cellEndIndex ||
1456
- i + row.cells.getCell(i).columnSpan > this.cellEndIndex + 1) && this.cellEndIndex < row.cells.count - 1) {
1457
- row.rowOverflowIndex = this.cellEndIndex;
1458
- }
1459
- if (row.grid.style.allowHorizontalOverflow && (row.rowOverflowIndex > 0 && (row.cells.getCell(i).columnSpan >
1460
- this.cellEndIndex || i + row.cells.getCell(i).columnSpan > this.cellEndIndex + 1)) &&
1461
- row.cells.getCell(i).columnSpan - this.cellEndIndex + i - 1 > 0) {
1462
- row.cells.getCell(row.rowOverflowIndex + 1).value = stringResult !== null ? (stringResult.remainder !== undefined) ?
1463
- stringResult.remainder : '' : '';
1464
- row.cells.getCell(row.rowOverflowIndex + 1).stringFormat = row.cells.getCell(i).stringFormat;
1465
- row.cells.getCell(row.rowOverflowIndex + 1).style = row.cells.getCell(i).style;
1466
- row.cells.getCell(row.rowOverflowIndex + 1).columnSpan = row.cells.getCell(i).columnSpan - this.cellEndIndex + i - 1;
1467
- }
1468
- }
1469
- /* tslint:enable */
1470
- tempValue = ((typeof row.cells.getCell(i).value === 'string' &&
1471
- row.cells.getCell(i).value !== null) ? row.cells.getCell(i).value : '') as string;
1472
- if (!cancelSpans) {
1473
- this.raiseAfterCellDraw(this.currentGraphics, this.currentRowIndex, i,
1474
- new RectangleF(location, size), tempValue, row.cells.getCell(i).style);
1475
- }
1476
- if (row.cells.getCell(i).value instanceof PdfGrid) {
1477
- let grid : PdfGrid = row.cells.getCell(i).value as PdfGrid;
1478
- if (this.Grid.columns.getColumn(i).width >= this.currentGraphics.clientSize.width) {
1479
- location.x = grid.rowLayoutBoundsWidth;
1480
- location.x += grid.style.cellSpacing;
1481
- } else {
1482
- location.x += this.Grid.columns.getColumn(i).width;
1483
- }
1484
- } else {
1485
- location.x += this.Grid.columns.getColumn(i).width;
1486
- }
1487
- }
1488
- if (!row.rowMergeComplete || row.isRowHeightSet) {
1489
- this.currentBounds.y += height;
1490
- }
1491
- result.bounds = new RectangleF(new PointF(result.bounds.x, result.bounds.y), new SizeF(location.x, location.y));
1492
- }
1493
- }
1494
-
1495
- private isFitToCell(currentHeight: number, grid: PdfGrid, gridRow: PdfGridRow): boolean {
1496
- let isFit: boolean = false;
1497
- let layouter: PdfStringLayouter = new PdfStringLayouter();
1498
- for (let i: number = 0; i < gridRow.cells.count; i++) {
1499
- let cell: PdfGridCell = gridRow.cells.getCell(i);
1500
- if (typeof cell.value !== 'undefined' && cell.value !== null && typeof cell.value === 'string') {
1501
- let font: PdfFont = null;
1502
- if (typeof cell.style.font !== 'undefined' && cell.style.font != null) {
1503
- font = cell.style.font;
1504
- } else if (typeof cell.row.style.font !== 'undefined' && cell.row.style.font != null) {
1505
- font = cell.row.style.font;
1506
- } else if (typeof cell.row.grid.style.font !== 'undefined' && cell.row.grid.style.font != null) {
1507
- font = cell.row.grid.style.font;
1508
- } else {
1509
- font = PdfDocument.defaultFont;
1510
- }
1511
- this.remainderText = gridRow.cells.getCell(i).value as string;
1512
- let width: number = gridRow.cells.getCell(i).width;
1513
- if (grid.columns.getColumn(i).isCustomWidth && gridRow.cells.getCell(i).width > grid.columns.getColumn(i).width) {
1514
- width = grid.columns.getColumn(i).width;
1515
- }
1516
- this.slr = layouter.layout(gridRow.cells.getCell(i).value as string, font, gridRow.cells.getCell(i).stringFormat, new SizeF(width, currentHeight), false, this.currentPageBounds);
1517
- let height: number = this.slr.actualSize.height;
1518
- if (height == 0) {
1519
- isFit = false;
1520
- break;
1521
- }
1522
- else if (currentHeight > height || (typeof this.slr.remainder !== 'undefined' && this.slr.remainder !== null)) {
1523
- isFit = true;
1524
- break;
1525
- }
1526
- }
1527
- }
1528
- return isFit;
1529
- }
1530
- /**
1531
- * `Draws row`
1532
- * @private
1533
- */
1534
- private drawRowWithBreak(result : RowLayoutResult, row : PdfGridRow, calculateHeight : number) : void
1535
- private drawRowWithBreak(result ?: RowLayoutResult, row ?: PdfGridRow, calculateHeight ?: number) : RowLayoutResult|void {
1536
- let location : PointF = new PointF(this.currentBounds.x, this.currentBounds.y);
1537
- if (row.grid.isChildGrid && row.grid.allowRowBreakAcrossPages && this.startLocation.x !== this.currentBounds.x) {
1538
- location.x = this.startLocation.x;
1539
- }
1540
- result.bounds = new RectangleF(location, new SizeF(0, 0));
1541
- this.gridHeight = row.rowBreakHeight > 0 ? this.currentPageBounds.height : 0;
1542
- // Calculate the remaining height.
1543
- if (row.grid.style.cellPadding.top + this.currentBounds.y + row.grid.style.cellPadding.bottom < this.currentPageBounds.height) {
1544
- row.rowBreakHeight = this.currentBounds.y + calculateHeight - this.currentPageBounds.height;
1545
- }
1546
- // else {
1547
- // row.rowBreakHeight = calculateHeight;
1548
- // result.isFinish = false;
1549
- // return;
1550
- // }
1551
- // No need to explicit break if the row height is equal to grid height.
1552
- for (let i : number = 0; i < row.cells.count; i++) {
1553
- let cell : PdfGridCell = row.cells.getCell(i);
1554
- let cellHeight : number = cell.measureHeight();
1555
- if (cellHeight === calculateHeight && cell.value instanceof PdfGrid) {
1556
- row.rowBreakHeight = 0;
1557
- }
1558
- // else if (cellHeight === calculateHeight && (cell.value as PdfGrid) === null) {
1559
- // row.rowBreakHeight = this.currentBounds.y + calculateHeight - this.currentPageBounds.height;
1560
- // }
1561
- }
1562
- for (let i : number = this.cellStartIndex; i <= this.cellEndIndex; i++) {
1563
- let cancelSpans : boolean = ((row.cells.getCell(i).columnSpan + i > this.cellEndIndex + 1) &&
1564
- (row.cells.getCell(i).columnSpan > 1));
1565
- // if (!cancelSpans) {
1566
- // for (let k : number = 1; k < row.cells.getCell(i).columnSpan; k++) {
1567
- // row.cells.getCell(i + k).isCellMergeContinue = true;
1568
- // }
1569
- //}
1570
- let size : SizeF = new SizeF(this.Grid.columns.getColumn(i).width, this.gridHeight > 0.0 ? this.gridHeight :
1571
- this.currentPageBounds.height);
1572
- // if (size.width === 0) {
1573
- // size = new SizeF(row.cells.getCell(i).width, size.height);
1574
- // }
1575
- // if (!this.CheckIfDefaultFormat(this.Grid.columns.getColumn(i).format) &&
1576
- // this.CheckIfDefaultFormat((row.cells.getCell(i).stringFormat))) {
1577
- // row.cells.getCell(i).stringFormat = this.Grid.columns.getColumn(i).format;
1578
- // }
1579
- let cellstyle1 : PdfGridCellStyle = row.cells.getCell(i).style;
1580
- row.cells.getCell(i).style = cellstyle1;
1581
- let skipcell : boolean = false;
1582
- let stringResult : PdfStringLayoutResult = null;
1583
- if (!skipcell) {
1584
- stringResult = row.cells.getCell(i).draw(this.currentGraphics, new RectangleF(location, size), cancelSpans);
1585
- }
1586
- //If still row is to be drawn, set cell finished drawing cell as false and update the text to be drawn.
1587
- if (row.rowBreakHeight > 0.0) {
1588
- if (stringResult != null && typeof stringResult.remainder !== 'undefined') {
1589
- row.cells.getCell(i).FinishedDrawingCell = false;
1590
- row.cells.getCell(i).remainingString = stringResult.remainder == null ? ' ' : stringResult.remainder;
1591
- if (row.grid.isChildGrid) {
1592
- row.rowBreakHeight = calculateHeight - stringResult.actualSize.height;
1593
- }
1594
- }
1595
- }
1596
- result.isFinish = (!result.isFinish) ? result.isFinish : row.cells.getCell(i).FinishedDrawingCell;
1597
- // let tempValue : string = ((typeof row.cells.getCell(i).value === 'string' &&
1598
- //row.cells.getCell(i).value !== null) ? row.cells.getCell(i).value : '') as string;
1599
- // if (!cancelSpans) {
1600
- // // this.raiseAfterCellDraw(this.currentGraphics, this.currentRowIndex, i,
1601
- // // new RectangleF(location, size), tempValue, row.cells.getCell(i).style);
1602
- // this.raiseAfterCellDraw(this.currentGraphics, this.currentRowIndex, i, new RectangleF(location, size),
1603
- // (row.cells.getCell(i).value as string) ? row.cells.getCell(i).value.toString() : ' ',
1604
- // row.cells.getCell(i).style);
1605
- // }
1606
- if (row.cells.getCell(i).value instanceof PdfGrid) {
1607
- let grid : PdfGrid = row.cells.getCell(i).value as PdfGrid;
1608
- this.rowBreakPageHeightCellIndex = i;
1609
- // row.cells.getCell(i).pageCount = grid.listOfNavigatePages.length;
1610
- // for (let j : number = 0;j<grid.listOfNavigatePages.length;j++){
1611
- // let pageIndex : number =grid.listOfNavigatePages.indexOf(j);
1612
- // this.Grid.listOfNavigatePages.push(pageIndex);
1613
- // }
1614
- if (this.Grid.columns.getColumn(i).width >= this.currentGraphics.clientSize.width) {
1615
- location.x = this.rowLayoutBoundsWidth;
1616
- location.x += grid.style.cellSpacing;
1617
- } else {
1618
- location.x += this.Grid.columns.getColumn(i).width;
1619
- }
1620
- } else {
1621
- location.x += this.Grid.columns.getColumn(i).width;
1622
- }
1623
- }
1624
- this.currentBounds.y += this.gridHeight > 0.0 ? this.gridHeight : calculateHeight;
1625
- result.bounds = new RectangleF(new PointF(result.bounds.x, result.bounds.y), new SizeF(location.x, location.y));
1626
- }
1627
- }
1628
- // recalculateBounds : boolean, clientSize : SizeF
1629
- //Implementation
1630
- /**
1631
- * `Initializes` internal data.
1632
- * @private
1633
- */
1634
- //Internal declaration
1635
- export class PdfGridLayoutResult extends PdfLayoutResult {
1636
- /**
1637
- * Constructor
1638
- * @private
1639
- */
1640
- public constructor(page : PdfPage, bounds : RectangleF) {
1641
- super(page, bounds);
1642
- }
1643
- }
1644
- /**
1645
- * `PdfGridLayoutFormat` class represents a flexible grid that consists of columns and rows.
1646
- */
1647
- export class PdfGridLayoutFormat extends PdfLayoutFormat {
1648
- // Constructors
1649
- /**
1650
- * Initializes a new instance of the `PdfGridLayoutFormat` class.
1651
- * @private
1652
- */
1653
- public constructor()
1654
- /**
1655
- * Initializes a new instance of the `PdfGridLayoutFormat` class.
1656
- * @private
1657
- */
1658
- public constructor(baseFormat : PdfLayoutFormat)
1659
- /**
1660
- * Initializes a new instance of the `PdfGridLayoutFormat` class.
1661
- * @private
1662
- */
1663
- public constructor(baseFormat ?: PdfLayoutFormat) {
1664
- super(baseFormat);
1665
- }
1666
- }
1667
- export abstract class GridCellEventArgs {
1668
- // Fields
1669
- /**
1670
- * @hidden
1671
- * @private
1672
- */
1673
- private gridRowIndex : number;
1674
- /**
1675
- * @hidden
1676
- * @private
1677
- */
1678
- private gridCellIndex : number;
1679
- /**
1680
- * @hidden
1681
- * @private
1682
- */
1683
- private internalValue : string;
1684
- /**
1685
- * @hidden
1686
- * @private
1687
- */
1688
- private gridBounds : RectangleF;
1689
- /**
1690
- * @hidden
1691
- * @private
1692
- */
1693
- private pdfGraphics : PdfGraphics;
1694
- // Properties
1695
- /**
1696
- * Gets the value of current `row index`.
1697
- * @private
1698
- */
1699
- public get rowIndex() : number {
1700
- return this.gridRowIndex;
1701
- }
1702
- /**
1703
- * Gets the value of current `cell index`.
1704
- * @private
1705
- */
1706
- public get cellIndex() : number {
1707
- return this.gridCellIndex;
1708
- }
1709
- /**
1710
- * Gets the actual `value` of current cell.
1711
- * @private
1712
- */
1713
- public get value() : string {
1714
- return this.internalValue;
1715
- }
1716
- /**
1717
- * Gets the `bounds` of current cell.
1718
- * @private
1719
- */
1720
- public get bounds() : RectangleF {
1721
- return this.gridBounds;
1722
- }
1723
- /**
1724
- * Gets the instance of `current graphics`.
1725
- * @private
1726
- */
1727
- public get graphics() : PdfGraphics {
1728
- return this.pdfGraphics;
1729
- }
1730
- // Constructors
1731
- /**
1732
- * Initialize a new instance for `GridCellEventArgs` class.
1733
- * @private
1734
- */
1735
- public constructor(graphics : PdfGraphics, rowIndex : number, cellIndex : number, bounds : RectangleF, value : string) {
1736
- this.gridRowIndex = rowIndex;
1737
- this.gridCellIndex = cellIndex;
1738
- this.internalValue = value;
1739
- this.gridBounds = bounds;
1740
- this.pdfGraphics = graphics;
1741
- }
1742
- }
1743
- export class PdfGridBeginCellDrawEventArgs extends GridCellEventArgs {
1744
- // Fields
1745
- /**
1746
- * @hidden
1747
- * @private
1748
- */
1749
- private bSkip : boolean;
1750
- /**
1751
- * @hidden
1752
- * @private
1753
- */
1754
- private cellStyle : PdfGridCellStyle;
1755
- // Properties
1756
- /**
1757
- * Gets or sets a value indicating whether the value of this cell should be `skipped`.
1758
- * @private
1759
- */
1760
- public get skip() : boolean {
1761
- return this.bSkip;
1762
- }
1763
- public set skip(value : boolean) {
1764
- this.bSkip = value;
1765
- }
1766
- /**
1767
- * Gets or sets a `style` value of the cell.
1768
- * @private
1769
- */
1770
- public get style() : PdfGridCellStyle {
1771
- return this.cellStyle;
1772
- }
1773
- public set style(value : PdfGridCellStyle) {
1774
- this.cellStyle = value;
1775
- }
1776
- // Constructors
1777
- /**
1778
- * Initializes a new instance of the `StartCellLayoutEventArgs` class.
1779
- * @private
1780
- */
1781
- public constructor(graphics : PdfGraphics, rowIndex : number, cellIndex : number, bounds : RectangleF,
1782
- value : string, style : PdfGridCellStyle) {
1783
- super(graphics, rowIndex, cellIndex, bounds, value);
1784
- this.style = style;
1785
- }
1786
- }
1787
- export class PdfGridEndCellDrawEventArgs extends GridCellEventArgs {
1788
- // Field
1789
- /**
1790
- * @hidden
1791
- * @private
1792
- */
1793
- private cellStyle : PdfGridCellStyle;
1794
- // Propertise
1795
- /**
1796
- * Get the `PdfGridCellStyle`.
1797
- * @private
1798
- */
1799
- public get style() : PdfGridCellStyle {
1800
- return this.cellStyle;
1801
- }
1802
- // Constructors
1803
- /**
1804
- * Initializes a new instance of the `PdfGridEndCellLayoutEventArgs` class.
1805
- * @private
1806
- */
1807
- public constructor(graphics : PdfGraphics, rowIndex : number, cellIndex : number, bounds : RectangleF,
1808
- value : string, style : PdfGridCellStyle) {
1809
- super(graphics, rowIndex, cellIndex, bounds, value);
1810
- this.cellStyle = style;
1811
- }
1812
- }
1813
-
1814
- export class PdfCancelEventArgs {
1815
- // Fields
1816
- /**
1817
- * @hidden
1818
- * @private
1819
- */
1820
- private isCancel : boolean;
1821
- // Properties
1822
- /**
1823
- * Gets and Sets the value of `cancel`.
1824
- * @private
1825
- */
1826
- public get cancel() : boolean {
1827
- return this.isCancel;
1828
- }
1829
- public set cancel(value : boolean) {
1830
- this.isCancel = value;
1831
- }
1832
- }
1833
- export class BeginPageLayoutEventArgs extends PdfCancelEventArgs {
1834
- // Fields
1835
- /**
1836
- * The `bounds` of the lay outing on the page.
1837
- * @private
1838
- */
1839
- private cellBounds : RectangleF;
1840
- /**
1841
- * `Page` where the lay outing should start.
1842
- * @private
1843
- */
1844
- private pdfPage : PdfPage;
1845
- // Properties
1846
- /**
1847
- * Gets or sets value that indicates the lay outing `bounds` on the page.
1848
- * @private
1849
- */
1850
- public get bounds() : RectangleF {
1851
- return this.cellBounds;
1852
- }
1853
- public set bounds(value : RectangleF) {
1854
- this.cellBounds = value;
1855
- }
1856
- /**
1857
- * Gets the `page` where the lay outing should start.
1858
- * @private
1859
- */
1860
- public get page() : PdfPage {
1861
- return this.pdfPage;
1862
- }
1863
- // Constructors
1864
- /**
1865
- * Initializes a new instance of the `BeginPageLayoutEventArgs` class with the specified rectangle and page.
1866
- * @private
1867
- */
1868
- public constructor(bounds : RectangleF, page : PdfPage) {
1869
- super();
1870
- this.bounds = bounds;
1871
- this.pdfPage = page;
1872
- }
1873
- }
1874
- /**
1875
- * `EndPageLayoutEventArgs` class is alternate for end page layout events.
1876
- */
1877
-
1878
- export class EndPageLayoutEventArgs extends PdfCancelEventArgs {
1879
- // Fields
1880
- /**
1881
- * `Layout result`.
1882
- * @private
1883
- */
1884
- private layoutResult : PdfLayoutResult;
1885
- /**
1886
- * The `next page` for lay outing.
1887
- * @private
1888
- */
1889
- private nextPdfPage : PdfPage;
1890
- // Properties
1891
- /**
1892
- * Gets the lay outing `result` of the page.
1893
- * @private
1894
- */
1895
- public get result() : PdfLayoutResult {
1896
- return this.layoutResult;
1897
- }
1898
- /**
1899
- * Gets or sets a value indicating the `next page` where the element should be layout.
1900
- * @private
1901
- */
1902
- public get nextPage() : PdfPage {
1903
- return this.nextPdfPage;
1904
- }
1905
- public set nextPage(value : PdfPage) {
1906
- this.nextPdfPage = value;
1907
- }
1908
- // Constructors
1909
- /**
1910
- * Initializes a new instance of the `EndPageLayoutEventArgs` class. with the specified 'PdfLayoutResult'.
1911
- * @private
1912
- */
1913
- public constructor(result : PdfLayoutResult) {
1914
- super();
1915
- this.layoutResult = result;
1916
- }
1917
- }
1918
- /**
1919
- * `PdfGridBeginPageLayoutEventArgs` class is alternate for begin page layout events.
1920
- */
1921
- export class PdfGridBeginPageLayoutEventArgs extends BeginPageLayoutEventArgs {
1922
- // Fields
1923
- /**
1924
- * @hidden
1925
- * @private
1926
- */
1927
- private startRow : number;
1928
- // Properties
1929
- /**
1930
- * Gets the `start row index`.
1931
- * @private
1932
- */
1933
- public get startRowIndex() : number {
1934
- return this.startRow;
1935
- }
1936
- // Constructors
1937
- /**
1938
- * Initialize a new instance of `PdfGridBeginPageLayoutEventArgs` class.
1939
- * @private
1940
- */
1941
- public constructor(bounds : RectangleF, page : PdfPage, startRow : number) {
1942
- super(bounds, page);
1943
- this.startRow = startRow;
1944
- }
1945
- }
1946
- /**
1947
- * `PdfGridEndPageLayoutEventArgs` class is alternate for begin page layout events.
1948
- */
1949
- export class PdfGridEndPageLayoutEventArgs extends EndPageLayoutEventArgs {
1950
- // Constructors
1951
- /**
1952
- * Initialize a new instance of `PdfGridEndPageLayoutEventArgs` class.
1953
- * @private
1954
- */
1955
- public constructor(result : PdfLayoutResult) {
1956
- super(result);
1957
- }
1958
- }
1959
- export class RowLayoutResult {
1960
- /**
1961
- * @hidden
1962
- * @private
1963
- */
1964
- private bIsFinished : boolean;
1965
- /**
1966
- * @hidden
1967
- * @private
1968
- */
1969
- private layoutedBounds : RectangleF;
1970
- /**
1971
- * Gets or sets a value indicating whether this instance `is finish`.
1972
- * @private
1973
- */
1974
- public get isFinish() : boolean {
1975
- return this.bIsFinished;
1976
- }
1977
- public set isFinish(value : boolean) {
1978
- this.bIsFinished = value;
1979
- }
1980
- /**
1981
- * Gets or sets the `bounds`.
1982
- * @private
1983
- */
1984
- public get bounds() : RectangleF {
1985
- return this.layoutedBounds;
1986
- }
1987
- public set bounds(value : RectangleF) {
1988
- this.layoutedBounds = value;
1989
- }
1990
- //Constructors
1991
- /**
1992
- * Initializes a new instance of the `RowLayoutResult` class.
1993
- * @private
1994
- */
1995
- public constructor() {
1996
- this.layoutedBounds = new RectangleF(0, 0, 0, 0);
1997
- }
1998
- }