@syncfusion/ej2-pdf-export 31.1.17 → 31.2.2

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