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