@syncfusion/ej2-pdf-export 25.1.38 → 26.1.35

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