@syncfusion/ej2-pdf-export 25.2.3 → 26.2.4

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 +7 -7
  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 -57
  372. package/dist/ej2-pdf-export.min.js +0 -10
@@ -0,0 +1,1194 @@
1
+ /**
2
+ * `PdfGridCell.ts` class for EJ2-PDF
3
+ */
4
+ import { PdfGridRow } from './pdf-grid-row';
5
+ import { PdfGrid } from './pdf-grid';
6
+ import { PdfGridCellStyle } from './styles/style';
7
+ import { PdfStringLayouter, PdfStringLayoutResult } from './../../graphics/fonts/string-layouter';
8
+ import { PdfDocument } from './../../document/pdf-document';
9
+ import { PdfFont } from './../../graphics/fonts/pdf-font';
10
+ import { PdfBrush } from './../../graphics/brushes/pdf-brush';
11
+ import { PdfPen } from './../../graphics/pdf-pen';
12
+ import { PdfStringFormat } from './../../graphics/fonts/pdf-string-format';
13
+ import { RectangleF, PointF, SizeF } from './../../drawing/pdf-drawing';
14
+ import { PdfGraphics } from './../../graphics/pdf-graphics';
15
+ import { PdfDashStyle, PdfLineCap } from './../../graphics/enum';
16
+ import { PdfBorderOverlapStyle } from './../tables/light-tables/enum';
17
+ import { PdfSolidBrush } from './../../graphics/brushes/pdf-solid-brush';
18
+ import { PdfColor } from './../../graphics/pdf-color';
19
+ import { PdfImage } from './../../graphics/images/pdf-image';
20
+ import { PdfBitmap } from './../../graphics/images/pdf-bitmap';
21
+ import { PdfTextWebLink } from './../../annotations/pdf-text-web-link';
22
+ import { PdfPage } from './../../pages/pdf-page';
23
+ import { PdfLayoutType } from './../../graphics/figures/enum';
24
+ import { PdfGridLayouter , PdfGridLayoutFormat } from './../../structured-elements/grid/layout/grid-layouter';
25
+ import { PdfLayoutParams, PdfLayoutResult, PdfLayoutFormat } from '../../../implementation/graphics/figures/base/element-layouter';
26
+ /**
27
+ * `PdfGridCell` class represents the schema of a cell in a 'PdfGrid'.
28
+ */
29
+ export class PdfGridCell {
30
+ //Fields
31
+ _rowHeight: number;
32
+ /**
33
+ * The `row span`.
34
+ * @private
35
+ */
36
+ private gridRowSpan : number;
37
+ /**
38
+ * The `column span`.
39
+ * @private
40
+ */
41
+ private colSpan : number;
42
+ /**
43
+ * Specifies the current `row`.
44
+ * @private
45
+ */
46
+ private gridRow : PdfGridRow;
47
+ /**
48
+ * The actual `value` of the cell.
49
+ * @private
50
+ */
51
+ private objectValue : Object;
52
+ /**
53
+ * Current cell `style`.
54
+ * @private
55
+ */
56
+ private cellStyle : PdfGridCellStyle;
57
+ /**
58
+ * `Width` of the cell.
59
+ * @default 0
60
+ * @private
61
+ */
62
+ private cellWidth : number = 0;
63
+ /**
64
+ * `Height` of the cell.
65
+ * @default 0
66
+ * @private
67
+ */
68
+ private cellHeight : number = 0;
69
+ /**
70
+ * `tempval`to stores current width .
71
+ * @default 0
72
+ * @private
73
+ */
74
+ private tempval : number = 0;
75
+ private fontSpilt : boolean = false;
76
+ /**
77
+ * The `remaining string`.
78
+ * @private
79
+ */
80
+ private remaining : string;
81
+ /**
82
+ * Specifies weather the `cell is drawn`.
83
+ * @default true
84
+ * @private
85
+ */
86
+ private finsh : boolean = true;
87
+ /**
88
+ * 'parent ' of the grid cell.
89
+ * @private
90
+ */
91
+ private parent : PdfGridCell ;
92
+ /**
93
+ * `StringFormat` of the cell.
94
+ * @private
95
+ */
96
+ private format : PdfStringFormat;
97
+ /**
98
+ * The `remaining height` of row span.
99
+ * @default 0
100
+ * @private
101
+ */
102
+ public rowSpanRemainingHeight : number = 0;
103
+ private internalIsCellMergeContinue : boolean;
104
+ private internalIsRowMergeContinue : boolean;
105
+ private internalIsCellMergeStart : boolean;
106
+ private internalIsRowMergeStart : boolean;
107
+ public hasRowSpan : boolean = false;
108
+ public hasColSpan : boolean = false;
109
+ /**
110
+ * the 'isFinish' is set to page finish
111
+ */
112
+ private isFinish : boolean = true;
113
+ /**
114
+ * The `present' to store the current cell.
115
+ * @default false
116
+ * @private
117
+ */
118
+ public present : boolean = false;
119
+ /**
120
+ * The `Count` of the page.
121
+ * @private
122
+ */
123
+ public pageCount : number ;
124
+ //constructor
125
+ /**
126
+ * Initializes a new instance of the `PdfGridCell` class.
127
+ * @private
128
+ */
129
+ public constructor()
130
+ /**
131
+ * Initializes a new instance of the `PdfGridCell` class.
132
+ * @private
133
+ */
134
+ public constructor(row : PdfGridRow)
135
+ public constructor(row ?: PdfGridRow) {
136
+ this.gridRowSpan = 1;
137
+ this.colSpan = 1;
138
+ if (typeof row !== 'undefined') {
139
+ this.gridRow = row;
140
+ }
141
+ }
142
+ //Properties
143
+ public get isCellMergeContinue() : boolean {
144
+ return this.internalIsCellMergeContinue;
145
+ }
146
+ public set isCellMergeContinue(value : boolean) {
147
+ this.internalIsCellMergeContinue = value;
148
+ }
149
+ public get isRowMergeContinue() : boolean {
150
+ return this.internalIsRowMergeContinue;
151
+ }
152
+ public set isRowMergeContinue(value : boolean) {
153
+ this.internalIsRowMergeContinue = value;
154
+ }
155
+ public get isCellMergeStart() : boolean {
156
+ return this.internalIsCellMergeStart;
157
+ }
158
+ public set isCellMergeStart(value : boolean) {
159
+ this.internalIsCellMergeStart = value;
160
+ }
161
+ public get isRowMergeStart() : boolean {
162
+ return this.internalIsRowMergeStart;
163
+ }
164
+ public set isRowMergeStart(value : boolean) {
165
+ this.internalIsRowMergeStart = value;
166
+ }
167
+ /**
168
+ * Gets or sets the `remaining string` after the row split between pages.
169
+ * @private
170
+ */
171
+ public get remainingString() : string {
172
+ return this.remaining;
173
+ }
174
+ public set remainingString(value : string) {
175
+ this.remaining = value;
176
+ }
177
+ /**
178
+ * Gets or sets the `FinishedDrawingCell` .
179
+ * @private
180
+ */
181
+ public get FinishedDrawingCell() : boolean {
182
+ return this.isFinish;
183
+ }
184
+ public set FinishedDrawingCell(value : boolean) {
185
+ this.isFinish = value;
186
+ }
187
+ /**
188
+ * Gets or sets the `string format`.
189
+ * @private
190
+ */
191
+ public get stringFormat() : PdfStringFormat {
192
+ if (this.format == null) {
193
+ this.format = new PdfStringFormat();
194
+ }
195
+ return this.format;
196
+ }
197
+ public set stringFormat(value : PdfStringFormat) {
198
+ this.format = value;
199
+ }
200
+ /**
201
+ * Gets or sets the parent `row`.
202
+ * @private
203
+ */
204
+ public get row() : PdfGridRow {
205
+ return this.gridRow;
206
+ }
207
+ public set row(value : PdfGridRow) {
208
+ this.gridRow = value;
209
+ }
210
+ /**
211
+ * Gets or sets the `value` of the cell.
212
+ * @private
213
+ */
214
+ public get value() : Object {
215
+ return this.objectValue;
216
+ }
217
+ public set value(value : Object) {
218
+ this.objectValue = value;
219
+ if (this.objectValue instanceof PdfGrid) {
220
+ this.row.grid.isSingleGrid = false;
221
+ let grid : PdfGrid = this.objectValue as PdfGrid;
222
+ grid.ParentCell = this;
223
+ (this.objectValue as PdfGrid).isChildGrid = true;
224
+ let rowCount : number = this.row.grid.rows.count;
225
+ for (let i : number = 0; i < rowCount; i++) {
226
+ let row : PdfGridRow = this.row.grid.rows.getRow(i);
227
+ let colCount : number = row.cells.count;
228
+ for (let j : number = 0; j < colCount; j++) {
229
+ let cell : PdfGridCell = row.cells.getCell(j);
230
+ cell.parent = this;
231
+ }
232
+ }
233
+ }
234
+ }
235
+ /**
236
+ * Gets or sets a value that indicates the total number of rows that cell `spans` within a PdfGrid.
237
+ * @private
238
+ */
239
+ public get rowSpan() : number {
240
+ return this.gridRowSpan;
241
+ }
242
+ public set rowSpan(value : number) {
243
+ if (value < 1) {
244
+ throw new Error('ArgumentException : Invalid span specified, must be greater than or equal to 1');
245
+ } else {
246
+ this.gridRowSpan = value;
247
+ this.row.rowSpanExists = true;
248
+ this.row.grid.hasRowSpanSpan = true;
249
+ }
250
+ }
251
+ /**
252
+ * Gets or sets the cell `style`.
253
+ * @private
254
+ */
255
+ public get style() : PdfGridCellStyle {
256
+ if (this.cellStyle == null) {
257
+ this.cellStyle = new PdfGridCellStyle();
258
+ }
259
+ return this.cellStyle;
260
+ }
261
+ public set style(value : PdfGridCellStyle) {
262
+ this.cellStyle = value;
263
+ }
264
+ /**
265
+ * Gets the `height` of the PdfGrid cell.[Read-Only].
266
+ * @private
267
+ */
268
+ public get height() : number {
269
+ if (this.cellHeight === 0) {
270
+ this.cellHeight = this.measureHeight();
271
+ }
272
+ return this.cellHeight;
273
+ }
274
+ public set height(value : number) {
275
+ this.cellHeight = value;
276
+ }
277
+ /**
278
+ * Gets or sets a value that indicates the total number of columns that cell `spans` within a PdfGrid.
279
+ * @private
280
+ */
281
+ public get columnSpan() : number {
282
+ return this.colSpan;
283
+ }
284
+ public set columnSpan(value : number) {
285
+ if (value < 1) {
286
+ throw Error('Invalid span specified, must be greater than or equal to 1');
287
+ } else {
288
+ this.colSpan = value;
289
+ this.row.columnSpanExists = true;
290
+ }
291
+ }
292
+ /**
293
+ * Gets the `width` of the PdfGrid cell.[Read-Only].
294
+ * @private
295
+ */
296
+ public get width() : number {
297
+ if (this.cellWidth === 0 || this.row.grid.isComplete) {
298
+ this.cellWidth = this.measureWidth();
299
+ }
300
+ return Math.round(this.cellWidth);
301
+ }
302
+ public set width(value : number) {
303
+ this.cellWidth = value;
304
+ }
305
+ //Implementation
306
+ /**
307
+ * `Calculates the width`.
308
+ * @private
309
+ */
310
+ private measureWidth() : number {
311
+ // .. Calculate the cell text width.
312
+ // .....Add border widths, cell spacings and paddings to the width.
313
+ let width : number = 0;
314
+ let layouter : PdfStringLayouter = new PdfStringLayouter();
315
+ if (typeof this.objectValue === 'string') {
316
+ /* tslint:disable */
317
+ let slr : PdfStringLayoutResult = layouter.layout((this.objectValue as string), this.getTextFont(), this.stringFormat, new SizeF(Number.MAX_VALUE, Number.MAX_VALUE), false, new SizeF(0, 0));
318
+ width += slr.actualSize.width;
319
+ width += (this.style.borders.left.width + this.style.borders.right.width) * 2;
320
+ } else if (this.objectValue instanceof PdfGrid) {
321
+ width = (this.objectValue as PdfGrid).size.width;
322
+ //width += this.objectValue.style.cellSpacing;
323
+ } else if (this.objectValue instanceof PdfImage || this.objectValue instanceof PdfBitmap) {
324
+ width += (this.objectValue as PdfImage).width;
325
+ } else if (this.objectValue instanceof PdfTextWebLink) {
326
+ let webLink : PdfTextWebLink = this.objectValue as PdfTextWebLink;
327
+ let result : PdfStringLayoutResult = layouter.layout(webLink.text, webLink.font, webLink.stringFormat, new SizeF(0, 0), false, new SizeF(0, 0));
328
+ /* tslint:enable */
329
+ width += result.actualSize.width;
330
+ width += (this.style.borders.left.width + this.style.borders.right.width) * 2;
331
+ }
332
+ if (!(this.objectValue instanceof PdfGrid)) {
333
+ if (this.style.cellPadding != null) {
334
+ width += (this.style.cellPadding.left + this.style.cellPadding.right);
335
+ } else {
336
+ width += (this.row.grid.style.cellPadding.left + this.row.grid.style.cellPadding.right);
337
+ }
338
+ } else {
339
+ if (this.style.cellPadding != null || typeof this.style.cellPadding !== 'undefined') {
340
+ if (typeof this.style.cellPadding.left !== 'undefined' && this.style.cellPadding.hasLeftPad) {
341
+ width += this.style.cellPadding.left;
342
+ }
343
+ if (typeof this.style.cellPadding.right !== 'undefined' && this.style.cellPadding.hasRightPad) {
344
+ width += this.style.cellPadding.right;
345
+ }
346
+ } else {
347
+ if (typeof this.row.grid.style.cellPadding.left !== 'undefined' && this.row.grid.style.cellPadding.hasLeftPad) {
348
+ width += this.row.grid.style.cellPadding.left;
349
+ }
350
+ if (typeof this.row.grid.style.cellPadding.right !== 'undefined' && this.row.grid.style.cellPadding.hasRightPad) {
351
+ width += this.row.grid.style.cellPadding.right;
352
+ }
353
+ }
354
+ }
355
+ width += this.row.grid.style.cellSpacing;
356
+ return width;
357
+ }
358
+ /**
359
+ * Draw the `cell background`.
360
+ * @private
361
+ */
362
+ public drawCellBackground(graphics : PdfGraphics, bounds : RectangleF) : void {
363
+ let backgroundBrush : PdfBrush = this.getBackgroundBrush();
364
+ //graphics.isTemplateGraphics = true;
365
+ if (backgroundBrush != null) {
366
+ graphics.save();
367
+ graphics.drawRectangle(backgroundBrush, bounds.x, bounds.y, bounds.width, bounds.height);
368
+ graphics.restore();
369
+ }
370
+ if (this.style.backgroundImage != null) {
371
+ let image : PdfImage = this.getBackgroundImage();
372
+ graphics.drawImage(this.style.backgroundImage, bounds.x, bounds.y, bounds.width, bounds.height);
373
+ }
374
+ }
375
+ /**
376
+ * `Adjusts the text layout area`.
377
+ * @private
378
+ */
379
+ /* tslint:disable */
380
+ private adjustContentLayoutArea(bounds : RectangleF) : RectangleF {
381
+ //Add Padding value to its Cell Bounds
382
+ let returnBounds : RectangleF = new RectangleF(bounds.x, bounds.y, bounds.width, bounds.height);
383
+ if (!(this.objectValue instanceof PdfGrid))
384
+ {
385
+ if (typeof this.style.cellPadding === 'undefined' || this.style.cellPadding == null) {
386
+ returnBounds.x += this.gridRow.grid.style.cellPadding.left + this.cellStyle.borders.left.width;
387
+ returnBounds.y += this.gridRow.grid.style.cellPadding.top + this.cellStyle.borders.top.width;
388
+ returnBounds.width -= (this.gridRow.grid.style.cellPadding.right + this.gridRow.grid.style.cellPadding.left);
389
+ returnBounds.height -= (this.gridRow.grid.style.cellPadding.bottom + this.gridRow.grid.style.cellPadding.top);
390
+ returnBounds.height -= (this.cellStyle.borders.top.width + this.cellStyle.borders.bottom.width);
391
+ } else {
392
+ returnBounds.x += this.style.cellPadding.left + this.cellStyle.borders.left.width;
393
+ returnBounds.y += this.style.cellPadding.top + this.cellStyle.borders.top.width;
394
+ returnBounds.width -= (this.style.cellPadding.right + this.style.cellPadding.left);
395
+ returnBounds.width -= (this.cellStyle.borders.left.width + this.cellStyle.borders.right.width);
396
+ returnBounds.height -= (this.style.cellPadding.bottom + this.style.cellPadding.top);
397
+ returnBounds.height -= (this.cellStyle.borders.top.width + this.cellStyle.borders.bottom.width);
398
+ if (this.rowSpan === 1) {
399
+ returnBounds.width -= (this.style.borders.left.width);
400
+ }
401
+ }
402
+ }
403
+ else{
404
+ if (this.style.cellPadding == null || typeof this.style.cellPadding === 'undefined')
405
+ {
406
+ if(typeof this.gridRow.grid.style.cellPadding.left !== 'undefined' && this.gridRow.grid.style.cellPadding.hasLeftPad){
407
+ returnBounds.x += this.gridRow.grid.style.cellPadding.left + this.cellStyle.borders.left.width;
408
+ returnBounds.width -= this.gridRow.grid.style.cellPadding.left;
409
+ }
410
+ if(typeof this.gridRow.grid.style.cellPadding.top !== 'undefined' && this.gridRow.grid.style.cellPadding.hasTopPad){
411
+ returnBounds.y += this.gridRow.grid.style.cellPadding.top + this.cellStyle.borders.top.width;
412
+ returnBounds.height -= this.gridRow.grid.style.cellPadding.top;
413
+ }
414
+ if(typeof this.gridRow.grid.style.cellPadding.right !== 'undefined' && this.gridRow.grid.style.cellPadding.hasRightPad){
415
+ returnBounds.width -= this.gridRow.grid.style.cellPadding.right;
416
+ }
417
+ if(typeof this.gridRow.grid.style.cellPadding.bottom !== 'undefined' && this.gridRow.grid.style.cellPadding.hasBottomPad){
418
+ returnBounds.height -= this.gridRow.grid.style.cellPadding.bottom;
419
+ }
420
+ }
421
+ else
422
+ {
423
+ if(typeof this.style.cellPadding.left !== 'undefined' && this.style.cellPadding.hasLeftPad) {
424
+ returnBounds.x += this.style.cellPadding.left + this.cellStyle.borders.left.width;
425
+ returnBounds.width -= this.style.cellPadding.left;
426
+ }
427
+ if(typeof this.style.cellPadding.top !== 'undefined' && this.style.cellPadding.hasTopPad) {
428
+ returnBounds.y += this.style.cellPadding.top + this.cellStyle.borders.top.width;
429
+ returnBounds.height -= this.style.cellPadding.top;
430
+ }
431
+ if(typeof this.style.cellPadding.right !== 'undefined' && this.style.cellPadding.hasRightPad){
432
+ returnBounds.width -= this.style.cellPadding.right;
433
+ }
434
+ if(typeof this.style.cellPadding.bottom !== 'undefined' && this.style.cellPadding.hasBottomPad){
435
+ returnBounds.height -= this.style.cellPadding.bottom;
436
+ }
437
+ }
438
+ returnBounds.width -= (this.cellStyle.borders.left.width + this.cellStyle.borders.right.width);
439
+ returnBounds.height -= (this.cellStyle.borders.top.width + this.cellStyle.borders.bottom.width);
440
+ }
441
+ return returnBounds;
442
+ }
443
+ /**
444
+ * `Draws` the specified graphics.
445
+ * @private
446
+ */
447
+ public draw(graphics : PdfGraphics, bounds : RectangleF, cancelSubsequentSpans : boolean) : PdfStringLayoutResult {
448
+ let isrowbreak : boolean = false;
449
+ /*if (!this.row.grid.isSingleGrid)
450
+ {
451
+ //Check whether the Grid Span to Nextpage
452
+ if ((this.remainingString != null) || (PdfGridLayouter.repeatRowIndex != -1))
453
+ {
454
+ this.DrawParentCells(graphics, bounds, true);
455
+ }
456
+ else if (this.row.grid.rows.count > 1)
457
+ {
458
+ for (let i : number = 0; i < this.row.grid.rows.count; i++)
459
+ {
460
+ if (this.row == this.row.grid.rows.getRow(i))
461
+ {
462
+ if (this.row.grid.rows.getRow(i).rowBreakHeight > 0)
463
+ isrowbreak = true;
464
+ if ((i > 0) && (isrowbreak))
465
+ this.DrawParentCells(graphics, bounds, false);
466
+ }
467
+ }
468
+ }
469
+ } */
470
+ let result : PdfStringLayoutResult = null;
471
+ /*if (cancelSubsequentSpans)
472
+ {
473
+ //..Cancel all subsequent cell spans, if no space exists.
474
+ let currentCellIndex : number = this.row.cells.indexOf(this);
475
+ for (let i : number = currentCellIndex + 1; i <= currentCellIndex + this.colSpan; i++)
476
+ {
477
+ this.row.cells.getCell(i).isCellMergeContinue = false;
478
+ this.row.cells.getCell(i).isRowMergeContinue = false;
479
+ }
480
+ this.colSpan = 1;
481
+ }*/
482
+ //..Skip cells which were already covered by spanmap.
483
+ if (this.internalIsCellMergeContinue || this.internalIsRowMergeContinue) {
484
+ if (this.internalIsCellMergeContinue && this.row.grid.style.allowHorizontalOverflow) {
485
+ if ((this.row.rowOverflowIndex > 0 && (this.row.cells.indexOf(this) != this.row.rowOverflowIndex + 1)) || (this.row.rowOverflowIndex == 0 && this.internalIsCellMergeContinue)) {
486
+ return result;
487
+ }
488
+ }
489
+ else {
490
+ return result;
491
+ }
492
+ }
493
+ //Adjust bounds with Row and Column Spacing
494
+ bounds = this.adjustOuterLayoutArea(bounds, graphics);
495
+ this.drawCellBackground(graphics, bounds);
496
+ let textPen : PdfPen = this.getTextPen();
497
+ let textBrush : PdfBrush = this.getTextBrush();
498
+ if (typeof textPen === 'undefined' && typeof textBrush === 'undefined') {
499
+ textBrush = new PdfSolidBrush(new PdfColor(0, 0, 0));
500
+ }
501
+ let font : PdfFont = this.getTextFont();
502
+ let strFormat : PdfStringFormat = this.getStringFormat();
503
+ let innerLayoutArea : RectangleF = bounds;
504
+ if (innerLayoutArea.height >= graphics.clientSize.height)
505
+ {
506
+ // If to break row to next page.
507
+ if (this.row.grid.allowRowBreakAcrossPages)
508
+ {
509
+ innerLayoutArea.height -= innerLayoutArea.y;
510
+ if (typeof this._rowHeight !== 'undefined' && this._rowHeight !== null && innerLayoutArea.height > this._rowHeight) {
511
+ innerLayoutArea.height = this._rowHeight;
512
+ }
513
+ //bounds.height -= bounds.y;
514
+ // if(this.row.grid.isChildGrid)
515
+ // {
516
+ // innerLayoutArea.height -= this.row.grid.ParentCell.row.grid.style.cellPadding.bottom;
517
+ // }
518
+ }
519
+ // if user choose to cut the row whose height is more than page height.
520
+ // else
521
+ // {
522
+ // innerLayoutArea.height = graphics.clientSize.height;
523
+ // bounds.height = graphics.clientSize.height;
524
+ // }
525
+ }
526
+ innerLayoutArea = this.adjustContentLayoutArea(innerLayoutArea);
527
+ if (typeof this.objectValue === 'string' || typeof this.remaining === 'string') {
528
+ let temp : string;
529
+ let layoutRectangle : RectangleF;
530
+ if (innerLayoutArea.height < font.height)
531
+ layoutRectangle = new RectangleF(innerLayoutArea.x, innerLayoutArea.y, innerLayoutArea.width, font.height);
532
+ else
533
+ layoutRectangle = innerLayoutArea;
534
+ if (innerLayoutArea.height < font.height && this.row.grid.isChildGrid && this.row.grid.ParentCell != null)
535
+ {
536
+ let height : number = layoutRectangle.height - this.row.grid.ParentCell.row.grid.style.cellPadding.bottom - this.row.grid.style.cellPadding.bottom;
537
+ if(this.row.grid.splitChildRowIndex != -1){
538
+ this.fontSpilt = true;
539
+ this.row.rowFontSplit = true;
540
+ }
541
+ if (height > 0 && height < font.height)
542
+ layoutRectangle.height = height;
543
+ // else if (height + this.row.grid.style.cellPadding.bottom > 0 && height + this.row.grid.style.cellPadding.bottom < font.height)
544
+ // layoutRectangle.height = height + this.row.grid.style.cellPadding.bottom;
545
+ // else if (bounds.height < font.height)
546
+ // layoutRectangle.height = bounds.height;
547
+ // else if (bounds.height - this.row.grid.ParentCell.row.grid.style.cellPadding.bottom < font.height)
548
+ // layoutRectangle.height = bounds.height - this.row.grid.ParentCell.row.grid.style.cellPadding.bottom;
549
+ }
550
+
551
+ if(this.gridRow.grid.style.cellSpacing != 0) {
552
+ layoutRectangle.width -= this.gridRow.grid.style.cellSpacing;
553
+ bounds.width -= this.gridRow.grid.style.cellSpacing;
554
+ }
555
+
556
+ if (this.isFinish) {
557
+ // if (this.row.grid.splitChildRowIndex != -1 && !this.row.grid.isChildGrid && typeof this.remaining === 'undefined'){
558
+ // this.remaining = '';
559
+ // graphics.drawString(this.remaining, font, textPen, textBrush, layoutRectangle.x, layoutRectangle.y, layoutRectangle.width, layoutRectangle.height, strFormat);
560
+ // } else {
561
+ temp = this.remaining === '' ? this.remaining : (this.objectValue as string);
562
+ graphics.drawString(temp, font, textPen, textBrush, layoutRectangle.x, layoutRectangle.y, layoutRectangle.width, layoutRectangle.height, strFormat);
563
+ if (this.row.grid.splitChildRowIndex != -1 && !this.row.grid.isChildGrid && typeof this.remaining === 'undefined'){
564
+ this.remaining = '';
565
+ //graphics.drawString(this.remaining, font, textPen, textBrush, layoutRectangle.x, layoutRectangle.y, layoutRectangle.width, layoutRectangle.height, strFormat);
566
+ }
567
+ }
568
+ else {
569
+ if(typeof this.remaining == 'undefined' ||this.remaining === null){
570
+ this.remaining = '';
571
+ }
572
+ if (this.row.repeatFlag) {
573
+ graphics.drawString((this.remaining as string), font, textPen, textBrush, layoutRectangle.x, layoutRectangle.y, layoutRectangle.width, layoutRectangle.height, strFormat);
574
+ }
575
+ // else {
576
+ // if(this.row.grid.ParentCell.row.repeatFlag) {
577
+ // graphics.drawString((this.remaining as string), font, textPen, textBrush, layoutRectangle.x, layoutRectangle.y, layoutRectangle.width, layoutRectangle.height, strFormat);
578
+ // } else {
579
+ // layoutRectangle.height = this.row.height;
580
+ // graphics.drawString((this.objectValue as string), font, textPen, textBrush, layoutRectangle.x, layoutRectangle.y, layoutRectangle.width, layoutRectangle.height, strFormat);
581
+ // bounds.height = this.row.height;
582
+
583
+ // }
584
+
585
+ // }
586
+ this.isFinish = true;
587
+ //graphics.drawString((this.remaining as string), font, textPen, textBrush, layoutRectangle.x, layoutRectangle.y, layoutRectangle.width, layoutRectangle.height, strFormat);
588
+ }
589
+ result = graphics.stringLayoutResult;
590
+ // if(this.row.grid.isChildGrid && this.row.rowBreakHeight > 0 && result !=null) {
591
+ // bounds.height -= this.row.grid.ParentCell.row.grid.style.cellPadding.bottom;
592
+ // }
593
+ } else if (this.objectValue instanceof PdfGrid ) {
594
+ let childGrid : PdfGrid = this.objectValue as PdfGrid;
595
+ childGrid.isChildGrid = true;
596
+ childGrid.ParentCell = this;
597
+ let layoutRect : RectangleF;
598
+ layoutRect = innerLayoutArea;
599
+
600
+ if(this.gridRow.grid.style.cellSpacing != 0){
601
+ bounds.width -= this.gridRow.grid.style.cellSpacing;
602
+ }
603
+ // layoutRect = bounds;
604
+ // if (this.style.cellPadding != null){
605
+ // layoutRect = bounds;
606
+ // } else if((this.row.grid.style.cellPadding != null) && (childGrid.style.cellPadding.bottom === 0.5) && (childGrid.style.cellPadding.top === 0.5)
607
+ // && (childGrid.style.cellPadding.left === 5.76) && (childGrid.style.cellPadding.right === 5.76)
608
+ // && (this.gridRow.grid.style.cellSpacing === 0) && (childGrid.style.cellSpacing === 0)) {
609
+ // layoutRect = innerLayoutArea;
610
+ // }
611
+ // if(this.objectValue.style.cellPadding != null && typeof this.objectValue.style.cellPadding !== 'undefined'){
612
+ // layoutRect = bounds;
613
+ // }
614
+ let layouter : PdfGridLayouter= new PdfGridLayouter(childGrid);
615
+ let format : PdfLayoutFormat = new PdfGridLayoutFormat();
616
+ if (this.row.grid.LayoutFormat != null)
617
+ format = this.row.grid.LayoutFormat;
618
+ else
619
+ format.layout = PdfLayoutType.Paginate;
620
+
621
+ let param : PdfLayoutParams = new PdfLayoutParams();
622
+ if (graphics.layer != null)
623
+ {
624
+ // Define layout parameters.
625
+ param.page = graphics.page as PdfPage;
626
+ param.bounds = layoutRect;
627
+ param.format = format;
628
+ //Set the span
629
+ childGrid.setSpan();
630
+ childGrid.checkSpan();
631
+ // Draw the child grid.
632
+ let childGridResult : PdfLayoutResult = layouter.Layouter(param);
633
+
634
+ //let childGridResult : PdfLayoutResult = layouter.innerLayout(param);
635
+ this.value = childGrid;
636
+ if(this.row.grid.splitChildRowIndex !== -1){
637
+ this.height = this.row.rowBreakHeightValue;
638
+ }
639
+ if (param.page != childGridResult.page) //&& (isWidthGreaterthanParent != true))
640
+ {
641
+ if (this.row.rowBreakHeightValue !== null && typeof this.row.rowBreakHeightValue !== 'undefined')
642
+ childGridResult.bounds.height = this.row.rowBreakHeightValue;
643
+ if(this.row.rowBreakHeight == 0)
644
+ this.row.NestedGridLayoutResult = childGridResult;
645
+ else
646
+ this.row.rowBreakHeight = this.row.rowBreakHeightValue;
647
+ //bounds.height = this.row.rowBreakHeight;
648
+
649
+
650
+ //After drawing paginated nested grid, the bounds of the parent grid in start page should be corrected for borders.
651
+ //bounds.height = graphics.clientSize.height - bounds.y;
652
+
653
+ }
654
+ }
655
+
656
+ } else if (this.objectValue instanceof PdfImage || this.objectValue instanceof PdfBitmap) {
657
+ let imageBounds : RectangleF;
658
+ if ((this.objectValue as PdfImage).width <= innerLayoutArea.width) {
659
+ imageBounds = new RectangleF(innerLayoutArea.x, innerLayoutArea.y, (this.objectValue as PdfImage).width, innerLayoutArea.height);
660
+ } else {
661
+ imageBounds = innerLayoutArea;
662
+ }
663
+ graphics.drawImage(this.objectValue as PdfImage, imageBounds.x, imageBounds.y, imageBounds.width, imageBounds.height);
664
+ } else if (this.objectValue instanceof PdfTextWebLink) {
665
+ (this.objectValue as PdfTextWebLink).draw(graphics.currentPage, innerLayoutArea);
666
+ } else if (typeof this.objectValue === 'undefined') {
667
+ this.objectValue = "";
668
+ graphics.drawString(this.objectValue as string, font, textPen, textBrush, innerLayoutArea.x, innerLayoutArea.y,innerLayoutArea.width, innerLayoutArea.height,strFormat);
669
+ if (this.style.cellPadding != null && this.style.cellPadding.bottom == 0 && this.style.cellPadding.left == 0 && this.style.cellPadding.right == 0 && this.style.cellPadding.top == 0) {
670
+ bounds.width -= (this.style.borders.left.width + this.style.borders.right.width);
671
+ }
672
+ if (this.gridRow.grid.style.cellSpacing != 0) {
673
+ bounds.width -= this.gridRow.grid.style.cellSpacing;
674
+ }
675
+ }
676
+ if (this.style.borders != null) {
677
+ if(!this.fontSpilt)
678
+ this.drawCellBorders(graphics, bounds);
679
+ else {
680
+ if(this.row.grid.ParentCell.row.grid.splitChildRowIndex != -1){
681
+ this.row.rowFontSplit = false;
682
+ this.drawCellBorders(graphics, bounds);
683
+ }
684
+ }
685
+ }
686
+ return result;
687
+ }
688
+ /* tslint:enable */
689
+ /**
690
+ * Draws the `cell border` constructed by drawing lines.
691
+ * @private
692
+ */
693
+ public drawCellBorders(graphics : PdfGraphics, bounds : RectangleF) : void {
694
+ if (this.row.grid.style.borderOverlapStyle === PdfBorderOverlapStyle.Inside) {
695
+ bounds.x += this.style.borders.left.width;
696
+ bounds.y += this.style.borders.top.width;
697
+ bounds.width -= this.style.borders.right.width;
698
+ bounds.height -= this.style.borders.bottom.width;
699
+ }
700
+ let p1 : PointF = new PointF(bounds.x, bounds.y + bounds.height);
701
+ let p2 : PointF = new PointF(bounds.x, bounds.y);
702
+ let pen : PdfPen = this.cellStyle.borders.left;
703
+ if (this.cellStyle.borders.left.dashStyle === PdfDashStyle.Solid) {
704
+ pen.lineCap = PdfLineCap.Square;
705
+ }
706
+ // SetTransparency(ref graphics, pen);
707
+ if (pen.width !== 0) {
708
+ graphics.drawLine(pen, p1, p2);
709
+ }
710
+ p1 = new PointF(bounds.x + bounds.width, bounds.y);
711
+ p2 = new PointF(bounds.x + bounds.width, bounds.y + bounds.height);
712
+ pen = this.cellStyle.borders.right;
713
+ if ((bounds.x + bounds.width) > (graphics.clientSize.width - (pen.width / 2))) {
714
+ p1 = new PointF(graphics.clientSize.width - (pen.width / 2), bounds.y);
715
+ p2 = new PointF(graphics.clientSize.width - (pen.width / 2), bounds.y + bounds.height);
716
+ }
717
+ if (this.cellStyle.borders.right.dashStyle === PdfDashStyle.Solid) {
718
+ pen.lineCap = PdfLineCap.Square;
719
+ }
720
+ if (pen.width !== 0) {
721
+ graphics.drawLine(pen, p1, p2);
722
+ }
723
+ p1 = new PointF(bounds.x, bounds.y);
724
+ p2 = new PointF(bounds.x + bounds.width, bounds.y);
725
+ pen = this.cellStyle.borders.top;
726
+ if (this.cellStyle.borders.top.dashStyle === PdfDashStyle.Solid) {
727
+ pen.lineCap = PdfLineCap.Square;
728
+ }
729
+ if (pen.width !== 0) {
730
+ graphics.drawLine(pen, p1, p2);
731
+ }
732
+ p1 = new PointF(bounds.x + bounds.width, bounds.y + bounds.height);
733
+ p2 = new PointF(bounds.x, bounds.y + bounds.height);
734
+ pen = this.cellStyle.borders.bottom;
735
+ if ((bounds.y + bounds.height) > (graphics.clientSize.height - (pen.width / 2))) {
736
+ p1 = new PointF((bounds.x + bounds.width), (graphics.clientSize.height - (pen.width / 2)));
737
+ p2 = new PointF(bounds.x, (graphics.clientSize.height - (pen.width / 2)));
738
+ }
739
+ if (this.cellStyle.borders.bottom.dashStyle === PdfDashStyle.Solid) {
740
+ pen.lineCap = PdfLineCap.Square;
741
+ }
742
+ if (pen.width !== 0) {
743
+ graphics.drawLine(pen, p1, p2);
744
+ }
745
+ }
746
+ // private setTransparency(graphics : PdfGraphics, pen : PdfPen) : void {
747
+ // let alpha : number = (pen.color.a / 255) as number;
748
+ // graphics.save();
749
+ // graphics.setTransparency(alpha);
750
+ // }
751
+ /**
752
+ * `Adjusts the outer layout area`.
753
+ * @private
754
+ */
755
+ /* tslint:disable */
756
+ private adjustOuterLayoutArea(bounds : RectangleF, g : PdfGraphics) : RectangleF {
757
+ let isHeader : boolean = false;
758
+ let cellSpacing : number = this.row.grid.style.cellSpacing;
759
+ if (cellSpacing > 0) {
760
+ bounds = new RectangleF(bounds.x + cellSpacing, bounds.y + cellSpacing,
761
+ bounds.width - cellSpacing, bounds.height - cellSpacing);
762
+ }
763
+ let currentColIndex : number = this.row.cells.indexOf(this);
764
+ if (this.columnSpan > 1|| (this.row.rowOverflowIndex > 0 && (currentColIndex == this.row.rowOverflowIndex + 1) && this.isCellMergeContinue)) {
765
+ let span : number = this.columnSpan;
766
+ if (span == 1 && this.isCellMergeContinue) {
767
+ for (let j : number = currentColIndex + 1; j < this.row.grid.columns.count; j++)
768
+ {
769
+ if (this.row.cells.getCell(j).isCellMergeContinue)
770
+ span++;
771
+ else
772
+ break;
773
+ }
774
+ }
775
+ let totalWidth : number = 0;
776
+ for (let i : number = currentColIndex; i < currentColIndex + span; i++) {
777
+ if (this.row.grid.style.allowHorizontalOverflow) {
778
+ let width : number;
779
+ let compWidth : number = this.row.grid.size.width < g.clientSize.width ? this.row.grid.size.width : g.clientSize.width;
780
+ if(this.row.grid.size.width > g.clientSize.width) {
781
+ width = bounds.x + totalWidth + this.row.grid.columns.getColumn(i).width;
782
+ } else {
783
+ width = totalWidth + this.row.grid.columns.getColumn(i).width;
784
+ }
785
+ if (width > compWidth) {
786
+ break;
787
+ }
788
+ }
789
+ totalWidth += this.row.grid.columns.getColumn(i).width;
790
+ }
791
+ totalWidth -= this.row.grid.style.cellSpacing;
792
+ bounds.width = totalWidth;
793
+ }
794
+ if (this.rowSpan > 1 || this.row.rowSpanExists) {
795
+ let span : number = this.rowSpan;
796
+ let currentRowIndex : number = this.row.grid.rows.rowCollection.indexOf(this.row);
797
+ if (currentRowIndex == -1) {
798
+ currentRowIndex = this.row.grid.headers.indexOf(this.row);
799
+ if (currentRowIndex != -1) {
800
+ isHeader = true;
801
+ }
802
+ }
803
+ // if (span == 1 && this.isCellMergeContinue) {
804
+ // for (let j : number = currentRowIndex + 1; j < this.row.grid.rows.count; j++)
805
+ // {
806
+ // let flag : boolean = (isHeader ? this.row.grid.headers.getHeader(j).cells.getCell(currentColIndex).isCellMergeContinue : this.row.grid.rows.getRow(j).cells.getCell(currentColIndex).isCellMergeContinue);
807
+ // if (flag)
808
+ // span++;
809
+ // else
810
+ // break;
811
+ // }
812
+ // }
813
+ let totalHeight : number = 0;
814
+ let max : number = 0;
815
+ for (let i : number = currentRowIndex; i < currentRowIndex + span; i++) {
816
+ totalHeight += (isHeader ? this.row.grid.headers.getHeader(i).height : this.row.grid.rows.getRow(i).height);
817
+ let row : PdfGridRow = this.row.grid.rows.getRow(i);
818
+ let rowIndex : number = this.row.grid.rows.rowCollection.indexOf(row);
819
+ /*if (this.rowSpan > 1)
820
+ {
821
+ for (let k : number = 0; k < this.row.cells.count; k++) {
822
+ let cell : PdfGridCell = this.row.cells.getCell(k);
823
+ if(cell.rowSpan>1)
824
+ {
825
+ let tempHeight : number =0;
826
+
827
+ for (let j :number = i; j < i +cell.rowSpan; j++)
828
+ {
829
+ if (!this.row.grid.rows.getRow(j).isRowSpanRowHeightSet)
830
+ this.row.grid.rows.getRow(j).isRowHeightSet = false;
831
+ tempHeight += this.row.grid.rows.getRow(j).height;
832
+ if (!this.row.grid.rows.getRow(j).isRowSpanRowHeightSet)
833
+ this.row.grid.rows.getRow(j).isRowHeightSet = true;
834
+ }
835
+ //To check the Row spanned cell height is greater than the total spanned row height.
836
+ if(cell.height>tempHeight)
837
+ {
838
+ if (max < (cell.height - tempHeight))
839
+ {
840
+ max = cell.height - tempHeight;
841
+ if (this.rowSpanRemainingHeight != 0 && max > this.rowSpanRemainingHeight)
842
+ {
843
+ max += this.rowSpanRemainingHeight;
844
+ }
845
+ let index :number = row.cells.indexOf(cell);
846
+ //set the m_rowspanRemainingHeight to last rowspanned row.
847
+ this.row.grid.rows.getRow((rowIndex +cell.rowSpan) - 1).cells.getCell(index).rowSpanRemainingHeight = max;
848
+ this.rowSpanRemainingHeight = this.row.grid.rows.getRow((rowIndex + cell.rowSpan) - 1).cells.getCell(index).rowSpanRemainingHeight;
849
+ }
850
+ }
851
+ }
852
+ }
853
+ }
854
+ if (!this.row.grid.rows.getRow(i).isRowSpanRowHeightSet)
855
+ this.row.grid.rows.getRow(i).isRowHeightSet = true;*/
856
+ }
857
+ let cellIndex = this.row.cells.indexOf(this);
858
+ totalHeight -= this.row.grid.style.cellSpacing;
859
+ // if (this.row.cells.getCell(cellIndex).height > totalHeight && (!this.row.grid.rows.getRow((currentRowIndex + span) - 1).isRowHeightSet)) {
860
+ // this.row.grid.rows.getRow((currentRowIndex + span) - 1).cells.getCell(cellIndex).rowSpanRemainingHeight = this.row.cells.getCell(cellIndex).height - totalHeight;
861
+ // totalHeight = this.row.cells.getCell(cellIndex).height;
862
+ // bounds.height = totalHeight;
863
+ // } else {
864
+ bounds.height = totalHeight;
865
+ // }
866
+ if (!this.row.rowMergeComplete) {
867
+ bounds.height = totalHeight;
868
+ }
869
+ }
870
+ return bounds;
871
+ }
872
+ /* tslint:enable */
873
+ /**
874
+ * Gets the `text font`.
875
+ * @private
876
+ */
877
+ private getTextFont() : PdfFont {
878
+ if (typeof this.style.font !== 'undefined' && this.style.font != null) {
879
+ return this.style.font;
880
+ } else if (typeof this.row.style.font !== 'undefined' && this.row.style.font != null) {
881
+ return this.row.style.font;
882
+ } else if (typeof this.row.grid.style.font !== 'undefined' && this.row.grid.style.font != null) {
883
+ return this.row.grid.style.font;
884
+ } else {
885
+ return PdfDocument.defaultFont;
886
+ }
887
+ }
888
+ /**
889
+ * Gets the `text brush`.
890
+ * @private
891
+ */
892
+ private getTextBrush() : PdfBrush {
893
+ if (typeof this.style.textBrush !== 'undefined' && this.style.textBrush != null) {
894
+ return this.style.textBrush;
895
+ } else if (typeof this.row.style.textBrush !== 'undefined' && this.row.style.textBrush != null) {
896
+ return this.row.style.textBrush;
897
+ } else {
898
+ return this.row.grid.style.textBrush;
899
+ }
900
+ }
901
+ /**
902
+ * Gets the `text pen`.
903
+ * @private
904
+ */
905
+ private getTextPen() : PdfPen {
906
+ if (typeof this.style.textPen !== 'undefined' && this.style.textPen != null) {
907
+ return this.style.textPen;
908
+ } else if (typeof this.row.style.textPen !== 'undefined' && this.row.style.textPen != null) {
909
+ return this.row.style.textPen;
910
+ } else {
911
+ return this.row.grid.style.textPen;
912
+ }
913
+ }
914
+ /**
915
+ * Gets the `background brush`.
916
+ * @private
917
+ */
918
+ private getBackgroundBrush() : PdfBrush {
919
+ if (typeof this.style.backgroundBrush !== 'undefined' && this.style.backgroundBrush != null) {
920
+ return this.style.backgroundBrush;
921
+ } else if (typeof this.row.style.backgroundBrush !== 'undefined' && this.row.style.backgroundBrush != null) {
922
+ return this.row.style.backgroundBrush;
923
+ } else {
924
+ return this.row.grid.style.backgroundBrush;
925
+ }
926
+ }
927
+ /**
928
+ * Gets the `background image`.
929
+ * @private
930
+ */
931
+ private getBackgroundImage() : PdfImage {
932
+ if (typeof this.style.backgroundImage !== 'undefined' && this.style.backgroundImage != null) {
933
+ return this.style.backgroundImage;
934
+ } else if (typeof this.row.style.backgroundImage !== 'undefined' && this.row.style.backgroundImage != null) {
935
+ return this.row.style.backgroundImage;
936
+ } else {
937
+ return this.row.grid.style.backgroundImage;
938
+ }
939
+ }
940
+ /**
941
+ * Gets the current `StringFormat`.
942
+ * @private
943
+ */
944
+ private getStringFormat() : PdfStringFormat {
945
+ if (typeof this.style.stringFormat !== 'undefined' && this.style.stringFormat != null) {
946
+ return this.style.stringFormat;
947
+ } else {
948
+ return this.stringFormat;
949
+ }
950
+ }
951
+ /**
952
+ * Calculates the `height`.
953
+ * @private
954
+ */
955
+ public measureHeight() : number {
956
+ // .. Calculate the cell text height.
957
+ // .....Add border widths, cell spacings and paddings to the height.
958
+ let width : number = this.calculateWidth();
959
+ // //check whether the Current PdfGridCell has padding
960
+ if (this.style.cellPadding == null || typeof this.style.cellPadding === 'undefined') {
961
+ width -= (this.gridRow.grid.style.cellPadding.right + this.gridRow.grid.style.cellPadding.left);
962
+ //width -= (this.style.borders.left.width + this.style.borders.right.width);
963
+ } else {
964
+ width -= (this.style.cellPadding.right + this.style.cellPadding.left);
965
+ width -= (this.style.borders.left.width + this.style.borders.right.width);
966
+ }
967
+ let height : number = 0;
968
+ let layouter : PdfStringLayouter = new PdfStringLayouter();
969
+ if (typeof this.objectValue === 'string' || typeof this.remaining === 'string') {
970
+ let currentValue : string = this.objectValue as string;
971
+ /* tslint:disable */
972
+ if (!this.isFinish)
973
+ currentValue = !(this.remaining === null || this.remaining === '' ||
974
+ typeof this.remaining === 'undefined') ? this.remaining : (this.objectValue as string);
975
+ let slr : PdfStringLayoutResult = null;
976
+ let cellIndex : number = this.row.cells.indexOf(this);
977
+
978
+ if (this.gridRow.grid.style.cellSpacing != 0){
979
+ width -= this.gridRow.grid.style.cellSpacing * 2;
980
+ }
981
+ if(!this.row.cells.getCell(cellIndex).hasColSpan && !this.row.cells.getCell(cellIndex).hasRowSpan) {
982
+ if(this.gridRow.grid.isChildGrid) {
983
+ if (width < 0) {
984
+ this.tempval = width;
985
+ if (this.style.cellPadding == null || typeof this.style.cellPadding === 'undefined') {
986
+ this.tempval += (this.gridRow.grid.style.cellPadding.right + this.gridRow.grid.style.cellPadding.left);
987
+ } else {
988
+ this.tempval += (this.style.cellPadding.right + this.style.cellPadding.left);
989
+ this.tempval += (this.style.borders.left.width + this.style.borders.right.width);
990
+ }
991
+ } else {
992
+ this.tempval = width;
993
+ }
994
+ slr = layouter.layout(currentValue, this.getTextFont(), this.stringFormat, new SizeF(this.tempval, 0), false, new SizeF(0, 0));
995
+ height += slr.actualSize.height;
996
+ } else {
997
+ slr = layouter.layout(currentValue, this.getTextFont(), this.stringFormat, new SizeF(width, 0), false, new SizeF(0, 0));
998
+ height += slr.actualSize.height;
999
+ }
1000
+ }
1001
+ /* tslint:enable */
1002
+ height += (this.style.borders.top.width + this.style.borders.bottom.width) * 2;
1003
+ } else if (this.objectValue instanceof PdfGrid) {
1004
+ let cellIndex : number = this.row.cells.indexOf(this);
1005
+ let internalWidth : number = 0;
1006
+ if ((this.style.cellPadding != null || typeof this.style.cellPadding !== 'undefined' )) {
1007
+ internalWidth = this.calculateWidth();
1008
+ if (typeof this.style.cellPadding.left !== 'undefined' && this.style.cellPadding.hasLeftPad) {
1009
+ internalWidth -= this.style.cellPadding.left;
1010
+ }
1011
+ if (typeof this.style.cellPadding.right !== 'undefined' && this.style.cellPadding.hasRightPad) {
1012
+ internalWidth -= this.style.cellPadding.right;
1013
+ }
1014
+ } else if ((this.row.grid.style.cellPadding != null || typeof this.row.grid.style.cellPadding !== 'undefined')) {
1015
+ internalWidth = this.calculateWidth();
1016
+ if (typeof this.row.grid.style.cellPadding.left !== 'undefined' && this.row.grid.style.cellPadding.hasLeftPad) {
1017
+ internalWidth -= this.row.grid.style.cellPadding.left;
1018
+ }
1019
+ if (typeof this.row.grid.style.cellPadding.right !== 'undefined' && this.row.grid.style.cellPadding.hasRightPad) {
1020
+ internalWidth -= this.row.grid.style.cellPadding.right;
1021
+ }
1022
+ } else {
1023
+ internalWidth = this.calculateWidth();
1024
+ }
1025
+ (this.objectValue as PdfGrid).tempWidth = internalWidth;
1026
+ if (!this.row.cells.getCell(cellIndex).hasColSpan && !this.row.cells.getCell(cellIndex).hasRowSpan) {
1027
+ height = (this.objectValue as PdfGrid).size.height;
1028
+ } else {
1029
+ height += (this.style.borders.top.width + this.style.borders.bottom.width) * 2;
1030
+ }
1031
+ if (this.gridRow.grid.style.cellSpacing !== 0 ) {
1032
+ width -= this.gridRow.grid.style.cellSpacing * 2;
1033
+ //height += (this.row.grid.style.cellPadding.top + this.row.grid.style.cellPadding.bottom);
1034
+ }
1035
+ if (this.style.cellPadding != null || typeof this.style.cellPadding !== 'undefined') {
1036
+ if (typeof this.row.grid.style.cellPadding.top !== 'undefined' && this.row.grid.style.cellPadding.hasTopPad) {
1037
+ height += this.row.grid.style.cellPadding.top;
1038
+ }
1039
+ if (this.row.grid.style.cellPadding.hasBottomPad && typeof this.row.grid.style.cellPadding.bottom !== 'undefined') {
1040
+ height += this.row.grid.style.cellPadding.bottom;
1041
+ }
1042
+ }
1043
+ height += this.objectValue.style.cellSpacing;
1044
+ } else if (this.objectValue instanceof PdfImage || this.objectValue instanceof PdfBitmap) {
1045
+ height += (this.objectValue as PdfImage).height;
1046
+ } else if (this.objectValue instanceof PdfTextWebLink) {
1047
+ let webLink : PdfTextWebLink = this.objectValue as PdfTextWebLink;
1048
+ /* tslint:disable */
1049
+ let slr : PdfStringLayoutResult = layouter.layout(webLink.text, webLink.font, webLink.stringFormat, new SizeF(width, 0), false, new SizeF(0, 0));
1050
+ /* tslint:enable */
1051
+ height += slr.actualSize.height;
1052
+ height += (this.style.borders.top.width + this.style.borders.bottom.width) * 2;
1053
+ } else if (typeof this.objectValue === 'undefined') {
1054
+ if (this.style.cellPadding == null || typeof this.style.cellPadding === 'undefined') {
1055
+ width -= (this.gridRow.grid.style.cellPadding.right + this.gridRow.grid.style.cellPadding.left);
1056
+ } else {
1057
+ width -= (this.style.cellPadding.right + this.style.cellPadding.left);
1058
+ width -= (this.style.borders.left.width + this.style.borders.right.width);
1059
+ }
1060
+ height += (this.style.borders.top.width + this.style.borders.bottom.width) * 2;
1061
+ }
1062
+ //Add padding top and bottom value to height
1063
+ if (!(this.objectValue instanceof PdfGrid)) {
1064
+ if (this.style.cellPadding == null || typeof this.style.cellPadding === 'undefined') {
1065
+ height += (this.row.grid.style.cellPadding.top + this.row.grid.style.cellPadding.bottom);
1066
+ } else {
1067
+ height += (this.style.cellPadding.top + this.style.cellPadding.bottom);
1068
+ }
1069
+ } else {
1070
+ if (this.style.cellPadding == null || typeof this.style.cellPadding === 'undefined') {
1071
+ if (typeof this.row.grid.style.cellPadding.top !== 'undefined' && this.row.grid.style.cellPadding.hasTopPad) {
1072
+ height += this.row.grid.style.cellPadding.top;
1073
+ }
1074
+ if (typeof this.row.grid.style.cellPadding.bottom !== 'undefined' && this.row.grid.style.cellPadding.hasBottomPad) {
1075
+ height += this.row.grid.style.cellPadding.bottom;
1076
+ }
1077
+ } else {
1078
+ if (typeof this.style.cellPadding.top !== 'undefined' && this.style.cellPadding.hasTopPad) {
1079
+ height += this.style.cellPadding.top;
1080
+ }
1081
+ if (typeof this.style.cellPadding.bottom !== 'undefined' && this.style.cellPadding.hasBottomPad) {
1082
+ height += this.style.cellPadding.bottom;
1083
+ }
1084
+ }
1085
+ }
1086
+ height += this.row.grid.style.cellSpacing;
1087
+ return height;
1088
+ }
1089
+ /**
1090
+ * return the calculated `width` of the cell.
1091
+ * @private
1092
+ */
1093
+ private calculateWidth() : number {
1094
+ let cellIndex : number = this.row.cells.indexOf(this);
1095
+ let rowindex : number = this.row.grid.rows.rowCollection.indexOf(this.row);
1096
+ let columnSpan : number = this.columnSpan;
1097
+ let width : number = 0;
1098
+ if (columnSpan === 1) {
1099
+ for (let i : number = 0; i < columnSpan; i++) {
1100
+ width += this.row.grid.columns.getColumn(cellIndex + i).width;
1101
+ }
1102
+ } else if (columnSpan > 1) {
1103
+ for (let i : number = 0; i < columnSpan; i++) {
1104
+ width += this.row.grid.columns.getColumn(cellIndex + i).width;
1105
+ if ( (i + 1) < columnSpan) {
1106
+ this.row.cells.getCell(cellIndex + i + 1).hasColSpan = true;
1107
+ }
1108
+ }
1109
+ }
1110
+
1111
+ if (this.parent != null && this.parent.row.width > 0) {
1112
+ if ((this.row.grid.isChildGrid) && this.parent != null && (this.row.width > this.parent.row.width)) {
1113
+ width = 0;
1114
+ for (let j : number = 0; j < this.parent.columnSpan; j++) {
1115
+ width += this.parent.row.grid.columns.getColumn(j).width;
1116
+ }
1117
+ width = width / this.row.cells.count;
1118
+ }
1119
+ }
1120
+ return width;
1121
+ }
1122
+ }
1123
+ /**
1124
+ * `PdfGridCellCollection` class provides access to an ordered,
1125
+ * strongly typed collection of 'PdfGridCell' objects.
1126
+ * @private
1127
+ */
1128
+ export class PdfGridCellCollection {
1129
+ //Fields
1130
+ /**
1131
+ * @hidden
1132
+ * @private
1133
+ */
1134
+ private gridRow : PdfGridRow;
1135
+ /**
1136
+ * @hidden
1137
+ * @private
1138
+ */
1139
+ private cells : PdfGridCell[] = [];
1140
+ //Constructor
1141
+ /**
1142
+ * Initializes a new instance of the `PdfGridCellCollection` class with the row.
1143
+ * @private
1144
+ */
1145
+ public constructor(row : PdfGridRow) {
1146
+ this.gridRow = row;
1147
+ }
1148
+ //Properties
1149
+ /**
1150
+ * Gets the current `cell`.
1151
+ * @private
1152
+ */
1153
+ public getCell(index : number) : PdfGridCell {
1154
+ if (index < 0 || index >= this.count) {
1155
+ throw new Error('IndexOutOfRangeException');
1156
+ }
1157
+ return this.cells[index];
1158
+ }
1159
+ /**
1160
+ * Gets the cells `count`.[Read-Only].
1161
+ * @private
1162
+ */
1163
+ public get count() : number {
1164
+ return this.cells.length;
1165
+ }
1166
+ //Implementation
1167
+ /**
1168
+ * `Adds` this instance.
1169
+ * @private
1170
+ */
1171
+ public add() : PdfGridCell
1172
+ /**
1173
+ * `Adds` this instance.
1174
+ * @private
1175
+ */
1176
+ public add(cell : PdfGridCell) : void
1177
+ public add(cell ?: PdfGridCell) : PdfGridCell|void {
1178
+ if (typeof cell === 'undefined') {
1179
+ let tempcell : PdfGridCell = new PdfGridCell();
1180
+ this.add(tempcell);
1181
+ return cell;
1182
+ } else {
1183
+ cell.row = this.gridRow;
1184
+ this.cells.push(cell);
1185
+ }
1186
+ }
1187
+ /**
1188
+ * Returns the `index of` a particular cell in the collection.
1189
+ * @private
1190
+ */
1191
+ public indexOf(cell : PdfGridCell) : number {
1192
+ return this.cells.indexOf(cell);
1193
+ }
1194
+ }