@syncfusion/ej2-pdf-export 31.1.17 → 31.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ej2-pdf-export.min.js +3 -3
- package/dist/ej2-pdf-export.umd.min.js +3 -3
- package/dist/ej2-pdf-export.umd.min.js.map +1 -1
- package/dist/es6/ej2-pdf-export.es2015.js +142 -23
- package/dist/es6/ej2-pdf-export.es2015.js.map +1 -1
- package/dist/es6/ej2-pdf-export.es5.js +148 -21
- package/dist/es6/ej2-pdf-export.es5.js.map +1 -1
- package/dist/global/ej2-pdf-export.min.js +3 -3
- package/dist/global/ej2-pdf-export.min.js.map +1 -1
- package/dist/global/index.d.ts +2 -2
- package/package.json +8 -45
- package/src/implementation/input-output/pdf-cross-table.js +2 -1
- package/src/implementation/input-output/pdf-writer.d.ts +77 -14
- package/src/implementation/input-output/pdf-writer.js +146 -20
- 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 -227
- package/dist/ts/implementation/graphics/fonts/ttf-reader.ts +0 -1267
- 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 -592
- 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 -583
- package/dist/ts/implementation/input-output/pdf-dictionary-properties.ts +0 -586
- 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,644 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* PdfSection.ts class for EJ2-PDF
|
|
3
|
-
*/
|
|
4
|
-
import { PdfDocument } from './../document/pdf-document';
|
|
5
|
-
import { PdfDocumentBase } from './../document/pdf-document-base';
|
|
6
|
-
import { PdfPageSettings } from './pdf-page-settings';
|
|
7
|
-
import { PdfPage } from './pdf-page';
|
|
8
|
-
import { PageAddedEventArgs } from './page-added-event-arguments';
|
|
9
|
-
import { PdfPageBase } from './pdf-page-base';
|
|
10
|
-
import { PdfPageOrientation, PdfPageRotateAngle } from './enum';
|
|
11
|
-
import { PdfReferenceHolder } from './../primitives/pdf-reference';
|
|
12
|
-
import { PdfArray } from './../primitives/pdf-array';
|
|
13
|
-
import { PdfNumber } from './../primitives/pdf-number';
|
|
14
|
-
import { PdfName } from './../primitives/pdf-name';
|
|
15
|
-
import { PdfDictionary } from './../primitives/pdf-dictionary';
|
|
16
|
-
import { SaveSectionEventHandler } from './../primitives/pdf-dictionary';
|
|
17
|
-
import { DictionaryProperties } from './../input-output/pdf-dictionary-properties';
|
|
18
|
-
import { IPdfWrapper } from './../../interfaces/i-pdf-wrapper';
|
|
19
|
-
import { IPdfPrimitive } from './../../interfaces/i-pdf-primitives';
|
|
20
|
-
import { IPdfWriter } from './../../interfaces/i-pdf-writer';
|
|
21
|
-
import { PdfSectionCollection } from './pdf-section-collection';
|
|
22
|
-
import { PdfSectionPageCollection } from './pdf-section-page-collection';
|
|
23
|
-
import { PointF, RectangleF, SizeF } from './../drawing/pdf-drawing';
|
|
24
|
-
import { PdfSectionTemplate } from './pdf-section-templates';
|
|
25
|
-
import { PdfPageTemplateElement } from './pdf-page-template-element';
|
|
26
|
-
import { PdfPageLayer } from './pdf-page-layer';
|
|
27
|
-
/**
|
|
28
|
-
* Represents a `section` entity. A section it's a set of the pages with similar page settings.
|
|
29
|
-
*/
|
|
30
|
-
export class PdfSection implements IPdfWrapper {
|
|
31
|
-
//Fields
|
|
32
|
-
//public PageAdded() : PageAddedEventArgs.PageAddedEventHandler = new PageAddedEventArgs.PageAddedEventHandler(Object,args)
|
|
33
|
-
/**
|
|
34
|
-
* @hidden
|
|
35
|
-
* @private
|
|
36
|
-
*/
|
|
37
|
-
private pageAdded : PageAddedEventArgs = new PageAddedEventArgs();
|
|
38
|
-
/**
|
|
39
|
-
* the parent `document`.
|
|
40
|
-
* @private
|
|
41
|
-
*/
|
|
42
|
-
private pdfDocument : PdfDocument;
|
|
43
|
-
/**
|
|
44
|
-
* Page `settings` of the pages in the section.
|
|
45
|
-
* @private
|
|
46
|
-
*/
|
|
47
|
-
private settings : PdfPageSettings;
|
|
48
|
-
/**
|
|
49
|
-
* Internal variable to store `initial page settings`.
|
|
50
|
-
* @private
|
|
51
|
-
*/
|
|
52
|
-
public initialSettings : PdfPageSettings;
|
|
53
|
-
/**
|
|
54
|
-
* @hidden
|
|
55
|
-
* @private
|
|
56
|
-
*/
|
|
57
|
-
public pagesReferences : PdfArray;
|
|
58
|
-
/**
|
|
59
|
-
* @hidden
|
|
60
|
-
* @private
|
|
61
|
-
*/
|
|
62
|
-
private section : PdfDictionary;
|
|
63
|
-
/**
|
|
64
|
-
* @hidden
|
|
65
|
-
* @private
|
|
66
|
-
*/
|
|
67
|
-
private pageCount : PdfNumber;
|
|
68
|
-
/**
|
|
69
|
-
* @hidden
|
|
70
|
-
* @private
|
|
71
|
-
*/
|
|
72
|
-
private sectionCollection : PdfSectionCollection;
|
|
73
|
-
/**
|
|
74
|
-
* @hidden
|
|
75
|
-
* @private
|
|
76
|
-
*/
|
|
77
|
-
private pdfPages : PdfPageBase[] = [];
|
|
78
|
-
/**
|
|
79
|
-
* Indicates if the `progress is turned on`.
|
|
80
|
-
* @private
|
|
81
|
-
*/
|
|
82
|
-
private isProgressOn : boolean;
|
|
83
|
-
/**
|
|
84
|
-
* Page `template` for the section.
|
|
85
|
-
* @private
|
|
86
|
-
*/
|
|
87
|
-
private pageTemplate : PdfSectionTemplate;
|
|
88
|
-
/**
|
|
89
|
-
* @hidden
|
|
90
|
-
* @private
|
|
91
|
-
*/
|
|
92
|
-
private dictionaryProperties : DictionaryProperties = new DictionaryProperties();
|
|
93
|
-
/**
|
|
94
|
-
* A virtual `collection of pages`.
|
|
95
|
-
* @private
|
|
96
|
-
*/
|
|
97
|
-
private pagesCollection : PdfSectionPageCollection;
|
|
98
|
-
/**
|
|
99
|
-
* Stores the information about the page settings of the current section.
|
|
100
|
-
* @private
|
|
101
|
-
*/
|
|
102
|
-
private state : PageSettingsState;
|
|
103
|
-
//constructor
|
|
104
|
-
/**
|
|
105
|
-
* Initializes a new instance of the `PdfSection` class.
|
|
106
|
-
* @private
|
|
107
|
-
*/
|
|
108
|
-
constructor(document : PdfDocument)
|
|
109
|
-
/**
|
|
110
|
-
* Initializes a new instance of the `PdfSection` class.
|
|
111
|
-
* @private
|
|
112
|
-
*/
|
|
113
|
-
constructor(document : PdfDocument, pageSettings : PdfPageSettings)
|
|
114
|
-
constructor(document : PdfDocument, pageSettings? : PdfPageSettings) {
|
|
115
|
-
this.pdfDocument = document;
|
|
116
|
-
if (typeof pageSettings === 'undefined') {
|
|
117
|
-
this.settings = document.pageSettings.clone();
|
|
118
|
-
this.initialSettings = this.settings.clone();
|
|
119
|
-
} else {
|
|
120
|
-
this.settings = pageSettings.clone();
|
|
121
|
-
this.initialSettings = this.settings.clone();
|
|
122
|
-
}
|
|
123
|
-
this.initialize();
|
|
124
|
-
}
|
|
125
|
-
//Property
|
|
126
|
-
/**
|
|
127
|
-
* Gets or sets the `parent`.
|
|
128
|
-
* @private
|
|
129
|
-
*/
|
|
130
|
-
public get parent() : PdfSectionCollection {
|
|
131
|
-
return this.sectionCollection;
|
|
132
|
-
}
|
|
133
|
-
public set parent(value : PdfSectionCollection) {
|
|
134
|
-
this.sectionCollection = value;
|
|
135
|
-
this.section.items.setValue(this.dictionaryProperties.parent, new PdfReferenceHolder(value));
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* Gets the `parent document`.
|
|
139
|
-
* @private
|
|
140
|
-
*/
|
|
141
|
-
public get parentDocument() : PdfDocumentBase {
|
|
142
|
-
return this.pdfDocument;
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* Gets or sets the `page settings` of the section.
|
|
146
|
-
* @private
|
|
147
|
-
*/
|
|
148
|
-
public get pageSettings() : PdfPageSettings {
|
|
149
|
-
return this.settings;
|
|
150
|
-
}
|
|
151
|
-
public set pageSettings(value : PdfPageSettings) {
|
|
152
|
-
if (value != null) {
|
|
153
|
-
this.settings = value;
|
|
154
|
-
} else {
|
|
155
|
-
throw Error('Value can not be null.');
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Gets the wrapped `element`.
|
|
160
|
-
* @private
|
|
161
|
-
*/
|
|
162
|
-
public get element() : IPdfPrimitive {
|
|
163
|
-
return this.section;
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* Gets the `count` of the pages in the section.
|
|
167
|
-
* @private
|
|
168
|
-
*/
|
|
169
|
-
public get count() : number {
|
|
170
|
-
return this.pagesReferences.count;
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* Gets or sets a `template` for the pages in the section.
|
|
174
|
-
* @private
|
|
175
|
-
*/
|
|
176
|
-
public get template() : PdfSectionTemplate {
|
|
177
|
-
if (this.pageTemplate == null) {
|
|
178
|
-
this.pageTemplate = new PdfSectionTemplate();
|
|
179
|
-
}
|
|
180
|
-
return this.pageTemplate;
|
|
181
|
-
}
|
|
182
|
-
public set template(value : PdfSectionTemplate) {
|
|
183
|
-
this.pageTemplate = value;
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* Gets the `document`.
|
|
187
|
-
* @private
|
|
188
|
-
*/
|
|
189
|
-
public get document() : PdfDocument {
|
|
190
|
-
return this.sectionCollection.document;
|
|
191
|
-
}
|
|
192
|
-
/**
|
|
193
|
-
* Gets the collection of `pages` in a section (Read only)
|
|
194
|
-
* @private
|
|
195
|
-
*/
|
|
196
|
-
public get pages() : PdfSectionPageCollection {
|
|
197
|
-
if (this.pagesCollection == null || typeof this.pagesCollection === 'undefined') {
|
|
198
|
-
this.pagesCollection = new PdfSectionPageCollection(this);
|
|
199
|
-
}
|
|
200
|
-
return this.pagesCollection;
|
|
201
|
-
}
|
|
202
|
-
//methods
|
|
203
|
-
/**
|
|
204
|
-
* `Return the page collection` of current section.
|
|
205
|
-
* @private
|
|
206
|
-
*/
|
|
207
|
-
public getPages() : PdfPageBase[] {
|
|
208
|
-
return this.pdfPages;
|
|
209
|
-
}
|
|
210
|
-
/**
|
|
211
|
-
* `Translates` point into native coordinates of the page.
|
|
212
|
-
* @private
|
|
213
|
-
*/
|
|
214
|
-
public pointToNativePdf(page : PdfPage, point : PointF) : PointF {
|
|
215
|
-
let bounds : RectangleF = this.getActualBounds(page, true);
|
|
216
|
-
point.x += bounds.x;
|
|
217
|
-
point.y = this.pageSettings.height - (point.y);
|
|
218
|
-
return point;
|
|
219
|
-
}
|
|
220
|
-
/**
|
|
221
|
-
* Sets the page setting of the current section.
|
|
222
|
-
* @public
|
|
223
|
-
* @param settings Instance of `PdfPageSettings`
|
|
224
|
-
*/
|
|
225
|
-
public setPageSettings(settings : PdfPageSettings) : void {
|
|
226
|
-
this.settings = settings;
|
|
227
|
-
this.state.orientation = settings.orientation;
|
|
228
|
-
this.state.rotate = settings.rotate;
|
|
229
|
-
this.state.size = settings.size;
|
|
230
|
-
this.state.origin = settings.origin;
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* `Initializes` the object.
|
|
234
|
-
* @private
|
|
235
|
-
*/
|
|
236
|
-
private initialize() : void {
|
|
237
|
-
this.pagesReferences = new PdfArray();
|
|
238
|
-
this.section = new PdfDictionary();
|
|
239
|
-
this.state = new PageSettingsState(this.pdfDocument);
|
|
240
|
-
this.section.sectionBeginSave = new SaveSectionEventHandler(this, this.state);
|
|
241
|
-
this.pageCount = new PdfNumber(0);
|
|
242
|
-
this.section.items.setValue(this.dictionaryProperties.count, this.pageCount);
|
|
243
|
-
this.section.items.setValue(this.dictionaryProperties.type, new PdfName(this.dictionaryProperties.pages));
|
|
244
|
-
this.section.items.setValue(this.dictionaryProperties.kids, this.pagesReferences);
|
|
245
|
-
}
|
|
246
|
-
/**
|
|
247
|
-
* Checks whether any template should be printed on this layer.
|
|
248
|
-
* @private
|
|
249
|
-
* @param document The parent document.
|
|
250
|
-
* @param page The parent page.
|
|
251
|
-
* @param foreground Layer z-order.
|
|
252
|
-
* @returns True - if some content should be printed on the layer, False otherwise.
|
|
253
|
-
*/
|
|
254
|
-
public containsTemplates(document : PdfDocument, page : PdfPage, foreground : boolean) : boolean {
|
|
255
|
-
let documentHeaders : PdfPageTemplateElement[] = this.getDocumentTemplates(document, page, foreground);
|
|
256
|
-
let sectionTemplates : PdfPageTemplateElement[] = this.getSectionTemplates(page, foreground);
|
|
257
|
-
return (documentHeaders.length > 0 || sectionTemplates.length > 0);
|
|
258
|
-
}
|
|
259
|
-
/**
|
|
260
|
-
* Returns array of the document templates.
|
|
261
|
-
* @private
|
|
262
|
-
* @param document The parent document.
|
|
263
|
-
* @param page The parent page.
|
|
264
|
-
* @param headers If true - return headers/footers, if false - return simple templates.
|
|
265
|
-
* @param foreground If true - return foreground templates, if false - return background templates.
|
|
266
|
-
* @returns Returns array of the document templates.
|
|
267
|
-
*/
|
|
268
|
-
/* tslint:disable */
|
|
269
|
-
private getDocumentTemplates(document : PdfDocument, page : PdfPage, foreground : boolean) : PdfPageTemplateElement[] {
|
|
270
|
-
let templates : PdfPageTemplateElement[] = [];
|
|
271
|
-
if (this.template.applyDocumentTopTemplate && document.template.getTop(page) != null) {
|
|
272
|
-
if ((!(document.template.getTop(page).foreground || foreground)) || (document.template.getTop(page).foreground && foreground)) {
|
|
273
|
-
templates.push(document.template.getTop(page));
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
if (this.template.applyDocumentBottomTemplate && document.template.getBottom(page) != null) {
|
|
277
|
-
if ((!(document.template.getBottom(page).foreground || foreground)) || (document.template.getBottom(page).foreground && foreground)) {
|
|
278
|
-
templates.push(document.template.getBottom(page));
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
if (this.template.applyDocumentLeftTemplate && document.template.getLeft(page) != null) {
|
|
282
|
-
if ((!(document.template.getLeft(page).foreground || foreground)) || (document.template.getLeft(page).foreground && foreground)) {
|
|
283
|
-
templates.push(document.template.getLeft(page));
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
if (this.template.applyDocumentRightTemplate && document.template.getRight(page) != null) {
|
|
287
|
-
if ((!(document.template.getRight(page).foreground || foreground)) || (document.template.getRight(page).foreground && foreground)) {
|
|
288
|
-
templates.push(document.template.getRight(page));
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
return templates;
|
|
292
|
-
}
|
|
293
|
-
/**
|
|
294
|
-
* Returns array of the section templates.
|
|
295
|
-
* @private
|
|
296
|
-
* @param page The parent page.
|
|
297
|
-
* @param foreground If true - return foreground templates, if false - return background templates.
|
|
298
|
-
* @returns Returns array of the section templates.
|
|
299
|
-
*/
|
|
300
|
-
/* tslint:disable */
|
|
301
|
-
private getSectionTemplates(page : PdfPage, foreground : boolean) : PdfPageTemplateElement[] {
|
|
302
|
-
let templates : PdfPageTemplateElement[] = [];
|
|
303
|
-
if (this.template.getTop(page) != null) {
|
|
304
|
-
let pageTemplate : PdfPageTemplateElement = this.template.getTop(page);
|
|
305
|
-
if ((!(pageTemplate.foreground || foreground)) || (pageTemplate.foreground && foreground)) {
|
|
306
|
-
templates.push(pageTemplate);
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
if (this.template.getBottom(page) != null) {
|
|
310
|
-
let pageTemplate : PdfPageTemplateElement = this.template.getBottom(page);
|
|
311
|
-
if ((!(pageTemplate.foreground || foreground)) || (pageTemplate.foreground && foreground)) {
|
|
312
|
-
templates.push(pageTemplate);
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
if (this.template.getLeft(page) != null) {
|
|
316
|
-
let pageTemplate : PdfPageTemplateElement = this.template.getLeft(page);
|
|
317
|
-
if ((!(pageTemplate.foreground || foreground)) || (pageTemplate.foreground && foreground)) {
|
|
318
|
-
templates.push(pageTemplate);
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
if (this.template.getRight(page) != null) {
|
|
322
|
-
let pageTemplate : PdfPageTemplateElement = this.template.getRight(page);
|
|
323
|
-
if ((!(pageTemplate.foreground || foreground)) || (pageTemplate.foreground && foreground)) {
|
|
324
|
-
templates.push(pageTemplate);
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
return templates;
|
|
328
|
-
}
|
|
329
|
-
/* tslint:enable */
|
|
330
|
-
/**
|
|
331
|
-
* `Adds` the specified page.
|
|
332
|
-
* @private
|
|
333
|
-
*/
|
|
334
|
-
public add(page? : PdfPage) : void | PdfPage {
|
|
335
|
-
if (typeof page === 'undefined') {
|
|
336
|
-
let page : PdfPage = new PdfPage();
|
|
337
|
-
this.add(page);
|
|
338
|
-
return page;
|
|
339
|
-
} else {
|
|
340
|
-
let r : PdfReferenceHolder = this.checkPresence(page);
|
|
341
|
-
this.pdfPages.push(page);
|
|
342
|
-
this.pagesReferences.add(r);
|
|
343
|
-
page.setSection(this);
|
|
344
|
-
page.resetProgress();
|
|
345
|
-
this.pageAddedMethod(page);
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
/**
|
|
349
|
-
* `Checks the presence`.
|
|
350
|
-
* @private
|
|
351
|
-
*/
|
|
352
|
-
private checkPresence(page : PdfPage) : PdfReferenceHolder {
|
|
353
|
-
let rh : PdfReferenceHolder = new PdfReferenceHolder(page);
|
|
354
|
-
let contains : boolean = false;
|
|
355
|
-
let sc : PdfSectionCollection = this.parent;
|
|
356
|
-
for (let index : number = 0; index < sc.section.length; index++) {
|
|
357
|
-
let section : PdfSection = sc.section[index];
|
|
358
|
-
contains = contains || section.contains(page);
|
|
359
|
-
}
|
|
360
|
-
return rh;
|
|
361
|
-
}
|
|
362
|
-
/**
|
|
363
|
-
* `Determines` whether the page in within the section.
|
|
364
|
-
* @private
|
|
365
|
-
*/
|
|
366
|
-
public contains(page : PdfPage) : boolean {
|
|
367
|
-
let index : number = this.indexOf(page);
|
|
368
|
-
return (0 <= index);
|
|
369
|
-
}
|
|
370
|
-
/**
|
|
371
|
-
* Get the `index of` the page.
|
|
372
|
-
* @private
|
|
373
|
-
*/
|
|
374
|
-
public indexOf(page : PdfPage) : number {
|
|
375
|
-
for (let index : number = 0; index < this.pdfPages.length; index++) {
|
|
376
|
-
if (this.pdfPages[index] === page) {
|
|
377
|
-
return this.pdfPages.indexOf(page);
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
let r : PdfReferenceHolder = new PdfReferenceHolder(page);
|
|
381
|
-
return this.pagesReferences.indexOf(r);
|
|
382
|
-
}
|
|
383
|
-
/**
|
|
384
|
-
* Call two event's methods.
|
|
385
|
-
* @hidden
|
|
386
|
-
* @private
|
|
387
|
-
*/
|
|
388
|
-
private pageAddedMethod(page : PdfPage) : void {
|
|
389
|
-
//Create event's arguments
|
|
390
|
-
let args : PageAddedEventArgs = new PageAddedEventArgs(page);
|
|
391
|
-
this.onPageAdded(args);
|
|
392
|
-
let parent : PdfSectionCollection = this.parent;
|
|
393
|
-
parent.document.pages.onPageAdded(args);
|
|
394
|
-
this.pageCount.intValue = this.count;
|
|
395
|
-
}
|
|
396
|
-
/**
|
|
397
|
-
* Called when the page has been added.
|
|
398
|
-
* @hidden
|
|
399
|
-
* @private
|
|
400
|
-
*/
|
|
401
|
-
protected onPageAdded(args : PageAddedEventArgs) : void {
|
|
402
|
-
//
|
|
403
|
-
}
|
|
404
|
-
/**
|
|
405
|
-
* Calculates actual `bounds` of the page.
|
|
406
|
-
* @private
|
|
407
|
-
*/
|
|
408
|
-
public getActualBounds(page : PdfPage, includeMargins : boolean) : RectangleF
|
|
409
|
-
/**
|
|
410
|
-
* Calculates actual `bounds` of the page.
|
|
411
|
-
* @private
|
|
412
|
-
*/
|
|
413
|
-
public getActualBounds(document : PdfDocument, page : PdfPage, includeMargins : boolean) : RectangleF
|
|
414
|
-
public getActualBounds(arg1 : PdfDocument | PdfPage, arg2 : PdfPage|boolean, arg3 ?: boolean) : RectangleF {
|
|
415
|
-
if (arg1 instanceof PdfPage && typeof arg2 === 'boolean') {
|
|
416
|
-
let result : RectangleF;
|
|
417
|
-
let document : PdfDocument = this.parent.document;
|
|
418
|
-
result = this.getActualBounds(document, arg1, arg2);
|
|
419
|
-
return result;
|
|
420
|
-
} else {
|
|
421
|
-
arg1 = arg1 as PdfDocument;
|
|
422
|
-
arg2 = arg2 as PdfPage;
|
|
423
|
-
arg3 = arg3 as boolean;
|
|
424
|
-
let bounds : RectangleF = new RectangleF(0, 0, 0, 0);
|
|
425
|
-
bounds.height = (arg3) ? this.pageSettings.size.height : this.pageSettings.getActualSize().height;
|
|
426
|
-
bounds.width = (arg3) ? this.pageSettings.size.width : this.pageSettings.getActualSize().width;
|
|
427
|
-
let left : number = this.getLeftIndentWidth(arg1, arg2, arg3);
|
|
428
|
-
let top : number = this.getTopIndentHeight(arg1, arg2, arg3);
|
|
429
|
-
let right : number = this.getRightIndentWidth(arg1, arg2, arg3);
|
|
430
|
-
let bottom : number = this.getBottomIndentHeight(arg1, arg2, arg3);
|
|
431
|
-
bounds.x += left;
|
|
432
|
-
bounds.y += top;
|
|
433
|
-
bounds.width -= (left + right);
|
|
434
|
-
bounds.height -= (top + bottom);
|
|
435
|
-
return bounds;
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
/**
|
|
439
|
-
* Calculates width of the `left indent`.
|
|
440
|
-
* @private
|
|
441
|
-
*/
|
|
442
|
-
public getLeftIndentWidth(document : PdfDocument, page : PdfPage, includeMargins : boolean) : number {
|
|
443
|
-
if (document == null) {
|
|
444
|
-
throw new Error('ArgumentNullException:document');
|
|
445
|
-
}
|
|
446
|
-
if (page == null) {
|
|
447
|
-
throw new Error('ArgumentNullException:page');
|
|
448
|
-
}
|
|
449
|
-
let value : number = (includeMargins) ? this.pageSettings.margins.left : 0;
|
|
450
|
-
let templateWidth : number = (this.template.getLeft(page) != null) ? this.template.getLeft(page).width : 0;
|
|
451
|
-
let docTemplateWidth : number = (document.template.getLeft(page) != null) ? document.template.getLeft(page).width : 0;
|
|
452
|
-
value += (this.template.applyDocumentLeftTemplate) ? Math.max(templateWidth, docTemplateWidth) : templateWidth;
|
|
453
|
-
return value;
|
|
454
|
-
}
|
|
455
|
-
/**
|
|
456
|
-
* Calculates `Height` of the top indent.
|
|
457
|
-
* @private
|
|
458
|
-
*/
|
|
459
|
-
public getTopIndentHeight(document : PdfDocument, page : PdfPage, includeMargins : boolean) : number {
|
|
460
|
-
if (document == null) {
|
|
461
|
-
throw new Error('ArgumentNullException:document');
|
|
462
|
-
}
|
|
463
|
-
if (page == null) {
|
|
464
|
-
throw new Error('ArgumentNullException:page');
|
|
465
|
-
}
|
|
466
|
-
let value : number = (includeMargins) ? this.pageSettings.margins.top : 0;
|
|
467
|
-
let templateHeight : number = (this.template.getTop(page) != null) ? this.template.getTop(page).height : 0;
|
|
468
|
-
let docTemplateHeight : number = (document.template.getTop(page) != null) ? document.template.getTop(page).height : 0;
|
|
469
|
-
value += (this.template.applyDocumentTopTemplate) ? Math.max(templateHeight, docTemplateHeight) : templateHeight;
|
|
470
|
-
return value;
|
|
471
|
-
}
|
|
472
|
-
/**
|
|
473
|
-
* Calculates `width` of the right indent.
|
|
474
|
-
* @private
|
|
475
|
-
*/
|
|
476
|
-
public getRightIndentWidth(document : PdfDocument, page : PdfPage, includeMargins : boolean) : number {
|
|
477
|
-
if (document == null) {
|
|
478
|
-
throw new Error('ArgumentNullException:document');
|
|
479
|
-
}
|
|
480
|
-
if (page == null) {
|
|
481
|
-
throw new Error('ArgumentNullException:page');
|
|
482
|
-
}
|
|
483
|
-
let value : number = (includeMargins) ? this.pageSettings.margins.right : 0;
|
|
484
|
-
let templateWidth : number = (this.template.getRight(page) != null) ? this.template.getRight(page).width : 0;
|
|
485
|
-
let docTemplateWidth : number = (document.template.getRight(page) != null) ? document.template.getRight(page).width : 0;
|
|
486
|
-
value += (this.template.applyDocumentRightTemplate) ? Math.max(templateWidth, docTemplateWidth) : templateWidth;
|
|
487
|
-
return value;
|
|
488
|
-
}
|
|
489
|
-
/**
|
|
490
|
-
* Calculates `Height` of the bottom indent.
|
|
491
|
-
* @private
|
|
492
|
-
*/
|
|
493
|
-
public getBottomIndentHeight(document : PdfDocument, page : PdfPage, includeMargins : boolean) : number {
|
|
494
|
-
if (document == null) {
|
|
495
|
-
throw new Error('ArgumentNullException:document');
|
|
496
|
-
}
|
|
497
|
-
if (page == null) {
|
|
498
|
-
throw new Error('ArgumentNullException:page');
|
|
499
|
-
}
|
|
500
|
-
let value : number = (includeMargins) ? this.pageSettings.margins.bottom : 0;
|
|
501
|
-
let templateHeight : number = (this.template.getBottom(page) != null) ? this.template.getBottom(page).height : 0;
|
|
502
|
-
let docTemplateHeight : number = (document.template.getBottom(page) != null) ? document.template.getBottom(page).height : 0;
|
|
503
|
-
value += (this.template.applyDocumentBottomTemplate) ? Math.max(templateHeight, docTemplateHeight) : templateHeight;
|
|
504
|
-
return value;
|
|
505
|
-
}
|
|
506
|
-
/**
|
|
507
|
-
* `Removes` the page from the section.
|
|
508
|
-
* @private
|
|
509
|
-
*/
|
|
510
|
-
public remove(page : PdfPage) : void {
|
|
511
|
-
if (page == null) {
|
|
512
|
-
throw Error('ArgumentNullException("page")');
|
|
513
|
-
}
|
|
514
|
-
let index : number = this.pdfPages.indexOf(page);
|
|
515
|
-
this.pagesReferences.removeAt(index);
|
|
516
|
-
let temproaryPages : PdfPageBase[] = [];
|
|
517
|
-
for (let j : number = 0; j < index; j++) {
|
|
518
|
-
temproaryPages.push(this.pdfPages[j]);
|
|
519
|
-
}
|
|
520
|
-
for (let j : number = index + 1; j < this.pdfPages.length; j++) {
|
|
521
|
-
temproaryPages.push(this.pdfPages[j]);
|
|
522
|
-
}
|
|
523
|
-
this.pdfPages = temproaryPages;
|
|
524
|
-
}
|
|
525
|
-
/**
|
|
526
|
-
* In fills dictionary by the data from `Page settings`.
|
|
527
|
-
* @private
|
|
528
|
-
*/
|
|
529
|
-
private applyPageSettings(container : PdfDictionary, parentSettings : PdfPageSettings, state : PageSettingsState) : void {
|
|
530
|
-
let bounds : RectangleF = new RectangleF(state.origin, state.size);
|
|
531
|
-
container.items.setValue(this.dictionaryProperties.mediaBox, PdfArray.fromRectangle(bounds));
|
|
532
|
-
let rotate : number = 0;
|
|
533
|
-
rotate = PdfSectionCollection.rotateFactor * state.rotate;
|
|
534
|
-
let angle : PdfNumber = new PdfNumber(rotate);
|
|
535
|
-
container.items.setValue(this.dictionaryProperties.rotate, angle);
|
|
536
|
-
}
|
|
537
|
-
/**
|
|
538
|
-
* Catches the Save event of the dictionary.
|
|
539
|
-
* @hidden
|
|
540
|
-
* @private
|
|
541
|
-
*/
|
|
542
|
-
public beginSave(state : PageSettingsState, writer : IPdfWriter) : void {
|
|
543
|
-
let doc : PdfDocument = writer.document as PdfDocument;
|
|
544
|
-
this.applyPageSettings(this.section, doc.pageSettings, state);
|
|
545
|
-
}
|
|
546
|
-
/**
|
|
547
|
-
* Draws page templates on the page.
|
|
548
|
-
* @private
|
|
549
|
-
*/
|
|
550
|
-
public drawTemplates(page : PdfPage, layer : PdfPageLayer, document : PdfDocument, foreground : boolean) : void {
|
|
551
|
-
let documentHeaders : PdfPageTemplateElement[] = this.getDocumentTemplates(document, page, foreground);
|
|
552
|
-
let sectionHeaders : PdfPageTemplateElement[] = this.getSectionTemplates(page, foreground);
|
|
553
|
-
this.drawTemplatesHelper(layer, document, documentHeaders);
|
|
554
|
-
this.drawTemplatesHelper(layer, document, sectionHeaders);
|
|
555
|
-
}
|
|
556
|
-
/**
|
|
557
|
-
* Draws page templates on the page.
|
|
558
|
-
* @private
|
|
559
|
-
*/
|
|
560
|
-
private drawTemplatesHelper(layer : PdfPageLayer, document : PdfDocument, templates : PdfPageTemplateElement[]) : void {
|
|
561
|
-
if (templates != null && templates.length > 0) {
|
|
562
|
-
let len : number = templates.length;
|
|
563
|
-
for (let i : number = 0; i < len; i++) {
|
|
564
|
-
let template : PdfPageTemplateElement = templates[i];
|
|
565
|
-
template.draw(layer, document);
|
|
566
|
-
}
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
|
-
export class PageSettingsState {
|
|
571
|
-
//Private Fields
|
|
572
|
-
/**
|
|
573
|
-
* @hidden
|
|
574
|
-
* @private
|
|
575
|
-
*/
|
|
576
|
-
private pageOrientation : PdfPageOrientation;
|
|
577
|
-
/**
|
|
578
|
-
* @hidden
|
|
579
|
-
* @private
|
|
580
|
-
*/
|
|
581
|
-
private pageRotate : PdfPageRotateAngle;
|
|
582
|
-
/**
|
|
583
|
-
* @hidden
|
|
584
|
-
* @private
|
|
585
|
-
*/
|
|
586
|
-
private pageSize : SizeF;
|
|
587
|
-
/**
|
|
588
|
-
* @hidden
|
|
589
|
-
* @private
|
|
590
|
-
*/
|
|
591
|
-
private pageOrigin : PointF;
|
|
592
|
-
//public Properties
|
|
593
|
-
/**
|
|
594
|
-
* @hidden
|
|
595
|
-
* @private
|
|
596
|
-
*/
|
|
597
|
-
public get orientation() : PdfPageOrientation {
|
|
598
|
-
return this.pageOrientation;
|
|
599
|
-
}
|
|
600
|
-
public set orientation(value : PdfPageOrientation) {
|
|
601
|
-
this.pageOrientation = value;
|
|
602
|
-
}
|
|
603
|
-
/**
|
|
604
|
-
* @hidden
|
|
605
|
-
* @private
|
|
606
|
-
*/
|
|
607
|
-
public get rotate() : PdfPageRotateAngle {
|
|
608
|
-
return this.pageRotate;
|
|
609
|
-
}
|
|
610
|
-
public set rotate(value : PdfPageRotateAngle) {
|
|
611
|
-
this.pageRotate = value;
|
|
612
|
-
}
|
|
613
|
-
/**
|
|
614
|
-
* @hidden
|
|
615
|
-
* @private
|
|
616
|
-
*/
|
|
617
|
-
public get size() : SizeF {
|
|
618
|
-
return this.pageSize;
|
|
619
|
-
}
|
|
620
|
-
public set size(value : SizeF) {
|
|
621
|
-
this.pageSize = value;
|
|
622
|
-
}
|
|
623
|
-
/**
|
|
624
|
-
* @hidden
|
|
625
|
-
* @private
|
|
626
|
-
*/
|
|
627
|
-
public get origin() : PointF {
|
|
628
|
-
return this.pageOrigin;
|
|
629
|
-
}
|
|
630
|
-
public set origin(value : PointF) {
|
|
631
|
-
this.pageOrigin = value;
|
|
632
|
-
}
|
|
633
|
-
//Public Constructor
|
|
634
|
-
/**
|
|
635
|
-
* New instance to store the `PageSettings`.
|
|
636
|
-
* @private
|
|
637
|
-
*/
|
|
638
|
-
public constructor(document : PdfDocument) {
|
|
639
|
-
this.pageOrientation = document.pageSettings.orientation;
|
|
640
|
-
this.pageRotate = document.pageSettings.rotate;
|
|
641
|
-
this.pageSize = document.pageSettings.size;
|
|
642
|
-
this.pageOrigin = document.pageSettings.origin;
|
|
643
|
-
}
|
|
644
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Primitives classes
|
|
3
|
-
* @hidden
|
|
4
|
-
*/
|
|
5
|
-
export * from './pdf-array';
|
|
6
|
-
export * from './pdf-dictionary';
|
|
7
|
-
export * from './pdf-name';
|
|
8
|
-
export * from './pdf-number';
|
|
9
|
-
export * from './pdf-reference';
|
|
10
|
-
export * from './pdf-stream';
|
|
11
|
-
export * from './pdf-string';
|
|
12
|
-
export * from './pdf-boolean';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Primitives classes
|
|
3
|
-
* @hidden
|
|
4
|
-
*/
|
|
5
|
-
export * from './pdf-array';
|
|
6
|
-
export * from './pdf-dictionary';
|
|
7
|
-
export * from './pdf-name';
|
|
8
|
-
export * from './pdf-number';
|
|
9
|
-
export * from './pdf-reference';
|
|
10
|
-
export * from './pdf-stream';
|
|
11
|
-
export * from './pdf-string';
|
|
12
|
-
export * from './pdf-boolean';
|