@syncfusion/ej2-pdf 1.0.22 → 23.1.36
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 +260 -0
- package/.gitleaksignore +1 -0
- package/CHANGELOG.md +17 -0
- package/README.md +17 -0
- package/dist/ej2-pdf.umd.min.js +3 -13
- package/dist/ej2-pdf.umd.min.js.map +1 -11
- package/dist/es6/ej2-pdf.es2015.js +48245 -0
- package/dist/es6/ej2-pdf.es2015.js.map +1 -0
- package/dist/es6/ej2-pdf.es5.js +50124 -0
- package/dist/es6/ej2-pdf.es5.js.map +1 -0
- package/dist/global/ej2-pdf.min.js +11 -0
- package/dist/global/ej2-pdf.min.js.map +1 -0
- package/dist/global/index.d.ts +14 -0
- package/index.js +4 -8
- package/license +10 -3
- package/package.json +57 -15
- package/pdf.d.ts +4 -0
- package/pdf.js +4 -0
- package/src/global.js +1 -0
- package/src/index.d.ts +45 -98
- package/src/index.js +45 -96
- package/src/pdf/core/annotations/annotation-collection.d.ts +289 -0
- package/src/pdf/core/annotations/annotation-collection.js +744 -0
- package/src/pdf/core/annotations/annotation.d.ts +5845 -0
- package/src/pdf/core/annotations/annotation.js +14195 -0
- package/src/pdf/core/annotations/index.d.ts +4 -0
- package/src/pdf/core/annotations/index.js +4 -0
- package/src/pdf/core/annotations/pdf-appearance.d.ts +102 -0
- package/src/pdf/core/annotations/pdf-appearance.js +124 -0
- package/src/pdf/core/annotations/pdf-paddings.d.ts +8 -0
- package/src/pdf/core/annotations/pdf-paddings.js +22 -0
- package/src/pdf/core/base-stream.d.ts +86 -0
- package/src/pdf/core/base-stream.js +332 -0
- package/src/pdf/core/content-parser.d.ts +38 -0
- package/src/pdf/core/content-parser.js +359 -0
- package/src/pdf/core/decode-stream.d.ts +21 -0
- package/src/pdf/core/decode-stream.js +120 -0
- package/src/pdf/core/decrypt-stream.d.ts +11 -0
- package/src/pdf/core/decrypt-stream.js +53 -0
- package/src/pdf/core/enumerator.d.ts +1668 -0
- package/src/pdf/core/enumerator.js +1717 -0
- package/src/pdf/core/flate-stream.d.ts +13 -0
- package/src/pdf/core/flate-stream.js +329 -0
- package/src/pdf/core/fonts/index.d.ts +7 -0
- package/{dist/es6/implementation/graphics → src/pdf/core}/fonts/index.js +3 -4
- package/src/pdf/core/fonts/pdf-font-metrics.d.ts +66 -0
- package/src/pdf/core/fonts/pdf-font-metrics.js +192 -0
- package/src/pdf/core/fonts/pdf-standard-font.d.ts +1023 -0
- package/src/pdf/core/fonts/pdf-standard-font.js +1682 -0
- package/src/pdf/core/fonts/pdf-string-format.d.ts +236 -0
- package/src/pdf/core/fonts/pdf-string-format.js +213 -0
- package/src/pdf/core/fonts/string-layouter.d.ts +68 -0
- package/src/pdf/core/fonts/string-layouter.js +437 -0
- package/src/pdf/core/fonts/ttf-reader.d.ts +167 -0
- package/src/pdf/core/fonts/ttf-reader.js +1150 -0
- package/src/pdf/core/fonts/ttf-table.d.ts +132 -0
- package/src/pdf/core/fonts/ttf-table.js +74 -0
- package/src/pdf/core/fonts/unicode-true-type-font.d.ts +50 -0
- package/src/pdf/core/fonts/unicode-true-type-font.js +289 -0
- package/src/pdf/core/form/field.d.ts +3011 -0
- package/src/pdf/core/form/field.js +6828 -0
- package/src/pdf/core/form/form.d.ts +279 -0
- package/src/pdf/core/form/form.js +782 -0
- package/src/pdf/core/form/index.d.ts +2 -0
- package/src/pdf/core/form/index.js +2 -0
- package/src/pdf/core/graphics/images/image-decoder.d.ts +31 -0
- package/src/pdf/core/graphics/images/image-decoder.js +130 -0
- package/src/{implementation → pdf/core}/graphics/images/index.d.ts +0 -5
- package/{dist/es6/implementation → src/pdf/core}/graphics/images/index.js +0 -1
- package/src/pdf/core/graphics/images/pdf-bitmap.d.ts +73 -0
- package/src/pdf/core/graphics/images/pdf-bitmap.js +68 -0
- package/src/pdf/core/graphics/images/pdf-image.d.ts +201 -0
- package/src/pdf/core/graphics/images/pdf-image.js +201 -0
- package/src/pdf/core/graphics/index.d.ts +10 -0
- package/src/pdf/core/graphics/index.js +10 -0
- package/src/pdf/core/graphics/pdf-graphics.d.ts +956 -0
- package/src/pdf/core/graphics/pdf-graphics.js +1860 -0
- package/src/pdf/core/graphics/pdf-path.d.ts +34 -0
- package/src/pdf/core/graphics/pdf-path.js +177 -0
- package/src/pdf/core/graphics/pdf-stream-writer.d.ts +56 -0
- package/src/pdf/core/graphics/pdf-stream-writer.js +231 -0
- package/src/pdf/core/graphics/pdf-template.d.ts +79 -0
- package/src/pdf/core/graphics/pdf-template.js +100 -0
- package/src/pdf/core/graphics/rightToLeft/bidirectional.d.ts +69 -0
- package/src/pdf/core/graphics/rightToLeft/bidirectional.js +831 -0
- package/src/pdf/core/graphics/rightToLeft/index.d.ts +3 -0
- package/src/pdf/core/graphics/rightToLeft/index.js +3 -0
- package/src/pdf/core/graphics/rightToLeft/text-renderer.d.ts +13 -0
- package/src/pdf/core/graphics/rightToLeft/text-renderer.js +116 -0
- package/src/pdf/core/graphics/rightToLeft/text-shape.d.ts +48 -0
- package/src/pdf/core/graphics/rightToLeft/text-shape.js +289 -0
- package/src/pdf/core/import-export/fdf-document.d.ts +37 -0
- package/src/pdf/core/import-export/fdf-document.js +667 -0
- package/src/pdf/core/import-export/index.d.ts +5 -0
- package/src/pdf/core/import-export/index.js +5 -0
- package/src/pdf/core/import-export/json-document.d.ts +47 -0
- package/src/pdf/core/import-export/json-document.js +1547 -0
- package/src/pdf/core/import-export/xfdf-document.d.ts +146 -0
- package/src/pdf/core/import-export/xfdf-document.js +2920 -0
- package/src/pdf/core/import-export/xml-document.d.ts +14 -0
- package/src/pdf/core/import-export/xml-document.js +166 -0
- package/src/pdf/core/import-export/xml-writer.d.ts +69 -0
- package/src/pdf/core/import-export/xml-writer.js +494 -0
- package/src/pdf/core/pdf-catalog.d.ts +18 -0
- package/src/pdf/core/pdf-catalog.js +166 -0
- package/src/pdf/core/pdf-cross-reference.d.ts +80 -0
- package/src/pdf/core/pdf-cross-reference.js +1049 -0
- package/src/pdf/core/pdf-document.d.ts +821 -0
- package/src/pdf/core/pdf-document.js +1022 -0
- package/src/pdf/core/pdf-file-structure.d.ts +54 -0
- package/src/pdf/core/pdf-file-structure.js +65 -0
- package/src/pdf/core/pdf-outline.d.ts +362 -0
- package/src/pdf/core/pdf-outline.js +860 -0
- package/src/pdf/core/pdf-page.d.ts +589 -0
- package/src/pdf/core/pdf-page.js +1049 -0
- package/src/pdf/core/pdf-parser.d.ts +62 -0
- package/src/pdf/core/pdf-parser.js +1035 -0
- package/src/pdf/core/pdf-primitives.d.ts +87 -0
- package/src/pdf/core/pdf-primitives.js +305 -0
- package/src/pdf/core/predictor-stream.d.ts +15 -0
- package/src/pdf/core/predictor-stream.js +214 -0
- package/src/pdf/core/security/encryptor.d.ts +140 -0
- package/src/pdf/core/security/encryptor.js +1616 -0
- package/src/pdf/core/security/index.d.ts +1 -0
- package/src/pdf/core/security/index.js +1 -0
- package/src/pdf/core/utils.d.ts +678 -0
- package/src/pdf/core/utils.js +3607 -0
- package/src/pdf/index.d.ts +44 -0
- package/src/pdf/index.js +44 -0
- package/tslint.json +111 -0
- package/ReadMe.md +0 -17
- package/dist/es6/implementation/actions/action.js +0 -44
- package/dist/es6/implementation/actions/index.js +0 -2
- package/dist/es6/implementation/actions/uri-action.js +0 -38
- package/dist/es6/implementation/annotations/action-link-annotation.js +0 -29
- package/dist/es6/implementation/annotations/annotation-collection.js +0 -93
- package/dist/es6/implementation/annotations/annotation.js +0 -156
- package/dist/es6/implementation/annotations/document-link-annotation.js +0 -48
- package/dist/es6/implementation/annotations/index.js +0 -7
- package/dist/es6/implementation/annotations/link-annotation.js +0 -31
- package/dist/es6/implementation/annotations/pdf-text-web-link.js +0 -178
- package/dist/es6/implementation/annotations/uri-annotation.js +0 -64
- package/dist/es6/implementation/collections/dictionary.js +0 -71
- package/dist/es6/implementation/collections/index.js +0 -3
- package/dist/es6/implementation/collections/object-object-pair/dictionary.js +0 -84
- package/dist/es6/implementation/collections/object-object-pair/index.js +0 -1
- package/dist/es6/implementation/collections/utils.js +0 -8
- package/dist/es6/implementation/document/automatic-fields/automatic-field-info-collection.js +0 -17
- package/dist/es6/implementation/document/automatic-fields/automatic-field-info.js +0 -68
- package/dist/es6/implementation/document/automatic-fields/automatic-field.js +0 -145
- package/dist/es6/implementation/document/automatic-fields/composite-field.js +0 -61
- package/dist/es6/implementation/document/automatic-fields/index.js +0 -7
- package/dist/es6/implementation/document/automatic-fields/multiple-value-field.js +0 -36
- package/dist/es6/implementation/document/automatic-fields/page-count-field.js +0 -53
- package/dist/es6/implementation/document/automatic-fields/pdf-numbers-convertor.js +0 -91
- package/dist/es6/implementation/document/automatic-fields/pdf-page-number-field.js +0 -56
- package/dist/es6/implementation/document/automatic-fields/pdf-template-value-pair.js +0 -34
- package/dist/es6/implementation/document/automatic-fields/single-value-field.js +0 -47
- package/dist/es6/implementation/document/index.js +0 -11
- package/dist/es6/implementation/document/pdf-catalog.js +0 -38
- package/dist/es6/implementation/document/pdf-document-base.js +0 -71
- package/dist/es6/implementation/document/pdf-document-template.js +0 -204
- package/dist/es6/implementation/document/pdf-document.js +0 -175
- package/dist/es6/implementation/drawing/index.js +0 -1
- package/dist/es6/implementation/drawing/pdf-drawing.js +0 -80
- package/dist/es6/implementation/general/enum.js +0 -6
- package/dist/es6/implementation/general/index.js +0 -3
- package/dist/es6/implementation/general/pdf-cache-collection.js +0 -24
- package/dist/es6/implementation/general/pdf-collection.js +0 -26
- package/dist/es6/implementation/general/pdf-destination.js +0 -107
- package/dist/es6/implementation/graphics/brushes/index.js +0 -2
- package/dist/es6/implementation/graphics/brushes/pdf-brush.js +0 -6
- package/dist/es6/implementation/graphics/brushes/pdf-solid-brush.js +0 -53
- package/dist/es6/implementation/graphics/constants.js +0 -11
- package/dist/es6/implementation/graphics/enum.js +0 -100
- package/dist/es6/implementation/graphics/figures/base/element-layouter.js +0 -154
- package/dist/es6/implementation/graphics/figures/base/graphics-element.js +0 -18
- package/dist/es6/implementation/graphics/figures/base/index.js +0 -3
- package/dist/es6/implementation/graphics/figures/base/pdf-shape-element.js +0 -32
- package/dist/es6/implementation/graphics/figures/base/shape-layouter.js +0 -55
- package/dist/es6/implementation/graphics/figures/base/text-layouter.js +0 -123
- package/dist/es6/implementation/graphics/figures/enum.js +0 -11
- package/dist/es6/implementation/graphics/figures/index.js +0 -5
- package/dist/es6/implementation/graphics/figures/layout-element.js +0 -41
- package/dist/es6/implementation/graphics/figures/pdf-template.js +0 -110
- package/dist/es6/implementation/graphics/figures/text-element.js +0 -298
- package/dist/es6/implementation/graphics/fonts/enum.js +0 -45
- package/dist/es6/implementation/graphics/fonts/pdf-font-metrics.js +0 -122
- package/dist/es6/implementation/graphics/fonts/pdf-font.js +0 -159
- package/dist/es6/implementation/graphics/fonts/pdf-standard-font-metrics-factory.js +0 -357
- package/dist/es6/implementation/graphics/fonts/pdf-standard-font.js +0 -124
- package/dist/es6/implementation/graphics/fonts/pdf-string-format.js +0 -239
- package/dist/es6/implementation/graphics/fonts/string-layouter.js +0 -335
- package/dist/es6/implementation/graphics/fonts/string-tokenizer.js +0 -162
- package/dist/es6/implementation/graphics/images/byte-array.js +0 -82
- package/dist/es6/implementation/graphics/images/image-decoder.js +0 -167
- package/dist/es6/implementation/graphics/images/pdf-bitmap.js +0 -41
- package/dist/es6/implementation/graphics/images/pdf-image.js +0 -68
- package/dist/es6/implementation/graphics/index.js +0 -20
- package/dist/es6/implementation/graphics/pdf-color.js +0 -205
- package/dist/es6/implementation/graphics/pdf-graphics.js +0 -1034
- package/dist/es6/implementation/graphics/pdf-margins.js +0 -75
- package/dist/es6/implementation/graphics/pdf-pen.js +0 -180
- package/dist/es6/implementation/graphics/pdf-resources.js +0 -223
- package/dist/es6/implementation/graphics/pdf-transformation-matrix.js +0 -134
- package/dist/es6/implementation/graphics/pdf-transparency.js +0 -22
- package/dist/es6/implementation/graphics/unit-convertor.js +0 -33
- package/dist/es6/implementation/index.js +0 -85
- package/dist/es6/implementation/input-output/cross-table.js +0 -6
- package/dist/es6/implementation/input-output/enum.js +0 -5
- package/dist/es6/implementation/input-output/index.js +0 -8
- package/dist/es6/implementation/input-output/pdf-cross-table.js +0 -346
- package/dist/es6/implementation/input-output/pdf-dictionary-properties.js +0 -60
- package/dist/es6/implementation/input-output/pdf-main-object-collection.js +0 -115
- package/dist/es6/implementation/input-output/pdf-operators.js +0 -75
- package/dist/es6/implementation/input-output/pdf-stream-writer.js +0 -364
- package/dist/es6/implementation/input-output/pdf-writer.js +0 -44
- package/dist/es6/implementation/pages/enum.js +0 -51
- package/dist/es6/implementation/pages/index.js +0 -13
- package/dist/es6/implementation/pages/page-added-event-arguments.js +0 -19
- package/dist/es6/implementation/pages/pdf-document-page-collection.js +0 -120
- package/dist/es6/implementation/pages/pdf-page-base.js +0 -104
- package/dist/es6/implementation/pages/pdf-page-layer-collection.js +0 -115
- package/dist/es6/implementation/pages/pdf-page-layer.js +0 -160
- package/dist/es6/implementation/pages/pdf-page-settings.js +0 -126
- package/dist/es6/implementation/pages/pdf-page-size.js +0 -36
- package/dist/es6/implementation/pages/pdf-page-template-element.js +0 -510
- package/dist/es6/implementation/pages/pdf-page.js +0 -130
- package/dist/es6/implementation/pages/pdf-section-collection.js +0 -95
- package/dist/es6/implementation/pages/pdf-section-page-collection.js +0 -30
- package/dist/es6/implementation/pages/pdf-section-templates.js +0 -71
- package/dist/es6/implementation/pages/pdf-section.js +0 -388
- package/dist/es6/implementation/primitives/index.js +0 -8
- package/dist/es6/implementation/primitives/pdf-array.js +0 -199
- package/dist/es6/implementation/primitives/pdf-boolean.js +0 -66
- package/dist/es6/implementation/primitives/pdf-dictionary.js +0 -220
- package/dist/es6/implementation/primitives/pdf-name.js +0 -102
- package/dist/es6/implementation/primitives/pdf-number.js +0 -94
- package/dist/es6/implementation/primitives/pdf-reference.js +0 -195
- package/dist/es6/implementation/primitives/pdf-stream.js +0 -149
- package/dist/es6/implementation/primitives/pdf-string.js +0 -143
- package/dist/es6/implementation/structured-elements/grid/index.js +0 -1
- package/dist/es6/implementation/structured-elements/grid/pdf-grid-cell.js +0 -512
- package/dist/es6/implementation/structured-elements/grid/pdf-grid-column.js +0 -125
- package/dist/es6/implementation/structured-elements/grid/pdf-grid-row.js +0 -244
- package/dist/es6/implementation/structured-elements/grid/pdf-grid.js +0 -989
- package/dist/es6/implementation/structured-elements/grid/styles/index.js +0 -2
- package/dist/es6/implementation/structured-elements/grid/styles/pdf-borders.js +0 -145
- package/dist/es6/implementation/structured-elements/grid/styles/style.js +0 -267
- package/dist/es6/implementation/structured-elements/index.js +0 -1
- package/dist/es6/implementation/structured-elements/tables/light-tables/enum.js +0 -5
- package/dist/es6/index.js +0 -89
- package/dist/es6/interfaces/i-pdf-cache.js +0 -1
- package/dist/es6/interfaces/i-pdf-changable.js +0 -1
- package/dist/es6/interfaces/i-pdf-primitives.js +0 -1
- package/dist/es6/interfaces/i-pdf-wrapper.js +0 -1
- package/dist/es6/interfaces/i-pdf-writer.js +0 -1
- package/dist/es6/interfaces/index.js +0 -1
- package/dist//global//ej2-pdf.js +0 -15979
- package/implementation.d.ts +0 -4
- package/implementation.js +0 -8
- package/interfaces.d.ts +0 -4
- package/interfaces.js +0 -4
- package/src/implementation/actions/action.d.ts +0 -50
- package/src/implementation/actions/action.js +0 -44
- package/src/implementation/actions/index.d.ts +0 -6
- package/src/implementation/actions/index.js +0 -9
- package/src/implementation/actions/uri-action.d.ts +0 -33
- package/src/implementation/actions/uri-action.js +0 -39
- package/src/implementation/annotations/action-link-annotation.d.ts +0 -30
- package/src/implementation/annotations/action-link-annotation.js +0 -32
- package/src/implementation/annotations/annotation-collection.d.ts +0 -77
- package/src/implementation/annotations/annotation-collection.js +0 -91
- package/src/implementation/annotations/annotation.d.ts +0 -152
- package/src/implementation/annotations/annotation.js +0 -146
- package/src/implementation/annotations/document-link-annotation.d.ts +0 -89
- package/src/implementation/annotations/document-link-annotation.js +0 -51
- package/src/implementation/annotations/index.d.ts +0 -11
- package/src/implementation/annotations/index.js +0 -14
- package/src/implementation/annotations/link-annotation.d.ts +0 -23
- package/src/implementation/annotations/link-annotation.js +0 -33
- package/src/implementation/annotations/pdf-text-web-link.d.ts +0 -118
- package/src/implementation/annotations/pdf-text-web-link.js +0 -173
- package/src/implementation/annotations/uri-annotation.d.ts +0 -48
- package/src/implementation/annotations/uri-annotation.js +0 -65
- package/src/implementation/collections/dictionary.d.ts +0 -76
- package/src/implementation/collections/dictionary.js +0 -74
- package/src/implementation/collections/index.d.ts +0 -7
- package/src/implementation/collections/index.js +0 -10
- package/src/implementation/collections/object-object-pair/dictionary.d.ts +0 -62
- package/src/implementation/collections/object-object-pair/dictionary.js +0 -88
- package/src/implementation/collections/object-object-pair/index.d.ts +0 -5
- package/src/implementation/collections/object-object-pair/index.js +0 -8
- package/src/implementation/collections/utils.d.ts +0 -27
- package/src/implementation/collections/utils.js +0 -13
- package/src/implementation/document/automatic-fields/automatic-field-info-collection.d.ts +0 -31
- package/src/implementation/document/automatic-fields/automatic-field-info-collection.js +0 -21
- package/src/implementation/document/automatic-fields/automatic-field-info.d.ts +0 -67
- package/src/implementation/document/automatic-fields/automatic-field-info.js +0 -70
- package/src/implementation/document/automatic-fields/automatic-field.d.ts +0 -41
- package/src/implementation/document/automatic-fields/automatic-field.js +0 -143
- package/src/implementation/document/automatic-fields/composite-field.d.ts +0 -46
- package/src/implementation/document/automatic-fields/composite-field.js +0 -64
- package/src/implementation/document/automatic-fields/index.d.ts +0 -11
- package/src/implementation/document/automatic-fields/index.js +0 -14
- package/src/implementation/document/automatic-fields/multiple-value-field.d.ts +0 -18
- package/src/implementation/document/automatic-fields/multiple-value-field.js +0 -35
- package/src/implementation/document/automatic-fields/page-count-field.d.ts +0 -44
- package/src/implementation/document/automatic-fields/page-count-field.js +0 -53
- package/src/implementation/document/automatic-fields/pdf-numbers-convertor.d.ts +0 -53
- package/src/implementation/document/automatic-fields/pdf-numbers-convertor.js +0 -94
- package/src/implementation/document/automatic-fields/pdf-page-number-field.d.ts +0 -51
- package/src/implementation/document/automatic-fields/pdf-page-number-field.js +0 -56
- package/src/implementation/document/automatic-fields/pdf-template-value-pair.d.ts +0 -38
- package/src/implementation/document/automatic-fields/pdf-template-value-pair.js +0 -38
- package/src/implementation/document/automatic-fields/single-value-field.d.ts +0 -15
- package/src/implementation/document/automatic-fields/single-value-field.js +0 -46
- package/src/implementation/document/index.d.ts +0 -15
- package/src/implementation/document/index.js +0 -18
- package/src/implementation/document/pdf-catalog.d.ts +0 -32
- package/src/implementation/document/pdf-catalog.js +0 -38
- package/src/implementation/document/pdf-document-base.d.ts +0 -117
- package/src/implementation/document/pdf-document-base.js +0 -72
- package/src/implementation/document/pdf-document-template.d.ts +0 -166
- package/src/implementation/document/pdf-document-template.js +0 -207
- package/src/implementation/document/pdf-document.d.ts +0 -206
- package/src/implementation/document/pdf-document.js +0 -166
- package/src/implementation/drawing/index.d.ts +0 -5
- package/src/implementation/drawing/index.js +0 -8
- package/src/implementation/drawing/pdf-drawing.d.ts +0 -93
- package/src/implementation/drawing/pdf-drawing.js +0 -84
- package/src/implementation/general/enum.d.ts +0 -21
- package/src/implementation/general/enum.js +0 -10
- package/src/implementation/general/index.d.ts +0 -7
- package/src/implementation/general/index.js +0 -10
- package/src/implementation/general/pdf-cache-collection.d.ts +0 -33
- package/src/implementation/general/pdf-cache-collection.js +0 -27
- package/src/implementation/general/pdf-collection.d.ts +0 -26
- package/src/implementation/general/pdf-collection.js +0 -30
- package/src/implementation/general/pdf-destination.d.ts +0 -103
- package/src/implementation/general/pdf-destination.js +0 -103
- package/src/implementation/graphics/brushes/index.d.ts +0 -6
- package/src/implementation/graphics/brushes/index.js +0 -9
- package/src/implementation/graphics/brushes/pdf-brush.d.ts +0 -55
- package/src/implementation/graphics/brushes/pdf-brush.js +0 -10
- package/src/implementation/graphics/brushes/pdf-solid-brush.d.ts +0 -77
- package/src/implementation/graphics/brushes/pdf-solid-brush.js +0 -54
- package/src/implementation/graphics/constants.d.ts +0 -31
- package/src/implementation/graphics/constants.js +0 -15
- package/src/implementation/graphics/enum.d.ts +0 -392
- package/src/implementation/graphics/enum.js +0 -104
- package/src/implementation/graphics/figures/base/element-layouter.d.ts +0 -160
- package/src/implementation/graphics/figures/base/element-layouter.js +0 -156
- package/src/implementation/graphics/figures/base/graphics-element.d.ts +0 -16
- package/src/implementation/graphics/figures/base/graphics-element.js +0 -22
- package/src/implementation/graphics/figures/base/index.d.ts +0 -7
- package/src/implementation/graphics/figures/base/index.js +0 -10
- package/src/implementation/graphics/figures/base/pdf-shape-element.d.ts +0 -28
- package/src/implementation/graphics/figures/base/pdf-shape-element.js +0 -34
- package/src/implementation/graphics/figures/base/shape-layouter.d.ts +0 -80
- package/src/implementation/graphics/figures/base/shape-layouter.js +0 -57
- package/src/implementation/graphics/figures/base/text-layouter.d.ts +0 -107
- package/src/implementation/graphics/figures/base/text-layouter.js +0 -121
- package/src/implementation/graphics/figures/enum.d.ts +0 -37
- package/src/implementation/graphics/figures/enum.js +0 -15
- package/src/implementation/graphics/figures/index.d.ts +0 -9
- package/src/implementation/graphics/figures/index.js +0 -12
- package/src/implementation/graphics/figures/layout-element.d.ts +0 -57
- package/src/implementation/graphics/figures/layout-element.js +0 -43
- package/src/implementation/graphics/figures/pdf-template.d.ts +0 -113
- package/src/implementation/graphics/figures/pdf-template.js +0 -106
- package/src/implementation/graphics/figures/text-element.d.ts +0 -213
- package/src/implementation/graphics/figures/text-element.js +0 -289
- package/src/implementation/graphics/fonts/enum.d.ts +0 -179
- package/src/implementation/graphics/fonts/enum.js +0 -49
- package/src/implementation/graphics/fonts/index.d.ts +0 -12
- package/src/implementation/graphics/fonts/index.js +0 -15
- package/src/implementation/graphics/fonts/pdf-font-metrics.d.ts +0 -160
- package/src/implementation/graphics/fonts/pdf-font-metrics.js +0 -123
- package/src/implementation/graphics/fonts/pdf-font.d.ts +0 -187
- package/src/implementation/graphics/fonts/pdf-font.js +0 -158
- package/src/implementation/graphics/fonts/pdf-standard-font-metrics-factory.d.ts +0 -301
- package/src/implementation/graphics/fonts/pdf-standard-font-metrics-factory.js +0 -359
- package/src/implementation/graphics/fonts/pdf-standard-font.d.ts +0 -143
- package/src/implementation/graphics/fonts/pdf-standard-font.js +0 -121
- package/src/implementation/graphics/fonts/pdf-string-format.d.ts +0 -319
- package/src/implementation/graphics/fonts/pdf-string-format.js +0 -241
- package/src/implementation/graphics/fonts/string-layouter.d.ts +0 -255
- package/src/implementation/graphics/fonts/string-layouter.js +0 -336
- package/src/implementation/graphics/fonts/string-tokenizer.d.ts +0 -107
- package/src/implementation/graphics/fonts/string-tokenizer.js +0 -166
- package/src/implementation/graphics/images/byte-array.d.ts +0 -68
- package/src/implementation/graphics/images/byte-array.js +0 -86
- package/src/implementation/graphics/images/image-decoder.d.ts +0 -227
- package/src/implementation/graphics/images/image-decoder.js +0 -164
- package/src/implementation/graphics/images/index.js +0 -11
- package/src/implementation/graphics/images/pdf-bitmap.d.ts +0 -90
- package/src/implementation/graphics/images/pdf-bitmap.js +0 -41
- package/src/implementation/graphics/images/pdf-image.d.ts +0 -88
- package/src/implementation/graphics/images/pdf-image.js +0 -69
- package/src/implementation/graphics/index.d.ts +0 -24
- package/src/implementation/graphics/index.js +0 -27
- package/src/implementation/graphics/pdf-color.d.ts +0 -170
- package/src/implementation/graphics/pdf-color.js +0 -204
- package/src/implementation/graphics/pdf-graphics.d.ts +0 -1085
- package/src/implementation/graphics/pdf-graphics.js +0 -1017
- package/src/implementation/graphics/pdf-margins.d.ts +0 -82
- package/src/implementation/graphics/pdf-margins.js +0 -79
- package/src/implementation/graphics/pdf-pen.d.ts +0 -237
- package/src/implementation/graphics/pdf-pen.js +0 -181
- package/src/implementation/graphics/pdf-resources.d.ts +0 -147
- package/src/implementation/graphics/pdf-resources.js +0 -215
- package/src/implementation/graphics/pdf-transformation-matrix.d.ts +0 -143
- package/src/implementation/graphics/pdf-transformation-matrix.js +0 -136
- package/src/implementation/graphics/pdf-transparency.d.ts +0 -34
- package/src/implementation/graphics/pdf-transparency.js +0 -22
- package/src/implementation/graphics/unit-convertor.d.ts +0 -72
- package/src/implementation/graphics/unit-convertor.js +0 -37
- package/src/implementation/index.d.ts +0 -89
- package/src/implementation/index.js +0 -92
- package/src/implementation/input-output/cross-table.d.ts +0 -21
- package/src/implementation/input-output/cross-table.js +0 -10
- package/src/implementation/input-output/enum.d.ts +0 -16
- package/src/implementation/input-output/enum.js +0 -9
- package/src/implementation/input-output/index.d.ts +0 -12
- package/src/implementation/input-output/index.js +0 -15
- package/src/implementation/input-output/pdf-cross-table.d.ts +0 -249
- package/src/implementation/input-output/pdf-cross-table.js +0 -340
- package/src/implementation/input-output/pdf-dictionary-properties.d.ts +0 -283
- package/src/implementation/input-output/pdf-dictionary-properties.js +0 -64
- package/src/implementation/input-output/pdf-main-object-collection.d.ts +0 -120
- package/src/implementation/input-output/pdf-main-object-collection.js +0 -117
- package/src/implementation/input-output/pdf-operators.d.ts +0 -352
- package/src/implementation/input-output/pdf-operators.js +0 -79
- package/src/implementation/input-output/pdf-stream-writer.d.ts +0 -314
- package/src/implementation/input-output/pdf-stream-writer.js +0 -363
- package/src/implementation/input-output/pdf-writer.d.ts +0 -68
- package/src/implementation/input-output/pdf-writer.js +0 -48
- package/src/implementation/pages/enum.d.ts +0 -201
- package/src/implementation/pages/enum.js +0 -55
- package/src/implementation/pages/index.d.ts +0 -17
- package/src/implementation/pages/index.js +0 -20
- package/src/implementation/pages/page-added-event-arguments.d.ts +0 -30
- package/src/implementation/pages/page-added-event-arguments.js +0 -23
- package/src/implementation/pages/pdf-document-page-collection.d.ts +0 -92
- package/src/implementation/pages/pdf-document-page-collection.js +0 -121
- package/src/implementation/pages/pdf-page-base.d.ts +0 -121
- package/src/implementation/pages/pdf-page-base.js +0 -104
- package/src/implementation/pages/pdf-page-layer-collection.d.ts +0 -99
- package/src/implementation/pages/pdf-page-layer-collection.js +0 -113
- package/src/implementation/pages/pdf-page-layer.d.ts +0 -160
- package/src/implementation/pages/pdf-page-layer.js +0 -159
- package/src/implementation/pages/pdf-page-settings.d.ts +0 -111
- package/src/implementation/pages/pdf-page-settings.js +0 -126
- package/src/implementation/pages/pdf-page-size.d.ts +0 -159
- package/src/implementation/pages/pdf-page-size.js +0 -39
- package/src/implementation/pages/pdf-page-template-element.d.ts +0 -230
- package/src/implementation/pages/pdf-page-template-element.js +0 -509
- package/src/implementation/pages/pdf-page.d.ts +0 -153
- package/src/implementation/pages/pdf-page.js +0 -127
- package/src/implementation/pages/pdf-section-collection.d.ts +0 -109
- package/src/implementation/pages/pdf-section-collection.js +0 -91
- package/src/implementation/pages/pdf-section-page-collection.d.ts +0 -41
- package/src/implementation/pages/pdf-section-page-collection.js +0 -34
- package/src/implementation/pages/pdf-section-templates.d.ts +0 -64
- package/src/implementation/pages/pdf-section-templates.js +0 -74
- package/src/implementation/pages/pdf-section.d.ts +0 -319
- package/src/implementation/pages/pdf-section.js +0 -379
- package/src/implementation/primitives/index.d.ts +0 -12
- package/src/implementation/primitives/index.js +0 -15
- package/src/implementation/primitives/pdf-array.d.ts +0 -186
- package/src/implementation/primitives/pdf-array.js +0 -201
- package/src/implementation/primitives/pdf-boolean.d.ts +0 -84
- package/src/implementation/primitives/pdf-boolean.js +0 -70
- package/src/implementation/primitives/pdf-dictionary.d.ts +0 -311
- package/src/implementation/primitives/pdf-dictionary.js +0 -220
- package/src/implementation/primitives/pdf-name.d.ts +0 -121
- package/src/implementation/primitives/pdf-name.js +0 -106
- package/src/implementation/primitives/pdf-number.d.ts +0 -104
- package/src/implementation/primitives/pdf-number.js +0 -98
- package/src/implementation/primitives/pdf-reference.d.ts +0 -222
- package/src/implementation/primitives/pdf-reference.js +0 -192
- package/src/implementation/primitives/pdf-stream.d.ts +0 -111
- package/src/implementation/primitives/pdf-stream.js +0 -146
- package/src/implementation/primitives/pdf-string.d.ts +0 -212
- package/src/implementation/primitives/pdf-string.js +0 -147
- package/src/implementation/structured-elements/grid/index.d.ts +0 -0
- package/src/implementation/structured-elements/grid/index.js +0 -1
- package/src/implementation/structured-elements/grid/pdf-grid-cell.d.ts +0 -248
- package/src/implementation/structured-elements/grid/pdf-grid-cell.js +0 -504
- package/src/implementation/structured-elements/grid/pdf-grid-column.d.ts +0 -108
- package/src/implementation/structured-elements/grid/pdf-grid-column.js +0 -127
- package/src/implementation/structured-elements/grid/pdf-grid-row.d.ts +0 -207
- package/src/implementation/structured-elements/grid/pdf-grid-row.js +0 -246
- package/src/implementation/structured-elements/grid/pdf-grid.d.ts +0 -678
- package/src/implementation/structured-elements/grid/pdf-grid.js +0 -982
- package/src/implementation/structured-elements/grid/styles/index.d.ts +0 -5
- package/src/implementation/structured-elements/grid/styles/index.js +0 -9
- package/src/implementation/structured-elements/grid/styles/pdf-borders.d.ts +0 -126
- package/src/implementation/structured-elements/grid/styles/pdf-borders.js +0 -146
- package/src/implementation/structured-elements/grid/styles/style.d.ts +0 -250
- package/src/implementation/structured-elements/grid/styles/style.js +0 -269
- package/src/implementation/structured-elements/index.d.ts +0 -0
- package/src/implementation/structured-elements/index.js +0 -1
- package/src/implementation/structured-elements/tables/light-tables/enum.d.ts +0 -16
- package/src/implementation/structured-elements/tables/light-tables/enum.js +0 -9
- package/src/interfaces/i-pdf-cache.d.ts +0 -23
- package/src/interfaces/i-pdf-cache.js +0 -4
- package/src/interfaces/i-pdf-changable.d.ts +0 -17
- package/src/interfaces/i-pdf-changable.js +0 -4
- package/src/interfaces/i-pdf-primitives.d.ts +0 -45
- package/src/interfaces/i-pdf-primitives.js +0 -4
- package/src/interfaces/i-pdf-wrapper.d.ts +0 -13
- package/src/interfaces/i-pdf-wrapper.js +0 -4
- package/src/interfaces/i-pdf-writer.d.ts +0 -29
- package/src/interfaces/i-pdf-writer.js +0 -4
- package/src/interfaces/index.d.ts +0 -9
- package/src/interfaces/index.js +0 -4
|
@@ -1,336 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "./../../drawing/pdf-drawing", "./enum", "./string-tokenizer"], function (require, exports, pdf_drawing_1, enum_1, string_tokenizer_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
var PdfStringLayouter = (function () {
|
|
5
|
-
function PdfStringLayouter() {
|
|
6
|
-
this.isOverloadWithPosition = false;
|
|
7
|
-
}
|
|
8
|
-
PdfStringLayouter.prototype.layout = function (arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
|
|
9
|
-
if (arg4 instanceof pdf_drawing_1.RectangleF) {
|
|
10
|
-
this.initialize(arg1, arg2, arg3, arg4, arg5);
|
|
11
|
-
this.isOverloadWithPosition = arg6;
|
|
12
|
-
this.clientSize = arg7;
|
|
13
|
-
var result = this.doLayout();
|
|
14
|
-
this.clear();
|
|
15
|
-
return result;
|
|
16
|
-
}
|
|
17
|
-
else {
|
|
18
|
-
this.initialize(arg1, arg2, arg3, arg4);
|
|
19
|
-
this.isOverloadWithPosition = arg5;
|
|
20
|
-
this.clientSize = arg6;
|
|
21
|
-
var result = this.doLayout();
|
|
22
|
-
this.clear();
|
|
23
|
-
return result;
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
PdfStringLayouter.prototype.initialize = function (text, font, format, rectSize, pageHeight) {
|
|
27
|
-
if (typeof pageHeight === 'number') {
|
|
28
|
-
if (text == null) {
|
|
29
|
-
throw new Error('ArgumentNullException:text');
|
|
30
|
-
}
|
|
31
|
-
if (font == null) {
|
|
32
|
-
throw new Error('ArgumentNullException:font');
|
|
33
|
-
}
|
|
34
|
-
this.text = text;
|
|
35
|
-
this.font = font;
|
|
36
|
-
this.format = format;
|
|
37
|
-
this.size = new pdf_drawing_1.SizeF(rectSize.width, rectSize.height);
|
|
38
|
-
this.rectangle = rectSize;
|
|
39
|
-
this.pageHeight = pageHeight;
|
|
40
|
-
this.reader = new string_tokenizer_1.StringTokenizer(text);
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
this.initialize(text, font, format, new pdf_drawing_1.RectangleF(new pdf_drawing_1.PointF(0, 0), rectSize), 0);
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
PdfStringLayouter.prototype.clear = function () {
|
|
47
|
-
this.font = null;
|
|
48
|
-
this.format = null;
|
|
49
|
-
this.reader.close();
|
|
50
|
-
this.reader = null;
|
|
51
|
-
this.text = null;
|
|
52
|
-
};
|
|
53
|
-
PdfStringLayouter.prototype.doLayout = function () {
|
|
54
|
-
var result = new PdfStringLayoutResult();
|
|
55
|
-
var lineResult = new PdfStringLayoutResult();
|
|
56
|
-
var lines = [];
|
|
57
|
-
var line = this.reader.peekLine();
|
|
58
|
-
var lineIndent = this.getLineIndent(true);
|
|
59
|
-
while (line != null) {
|
|
60
|
-
lineResult = this.layoutLine(line, lineIndent);
|
|
61
|
-
var numSymbolsInserted = 0;
|
|
62
|
-
var returnedValue = this.copyToResult(result, lineResult, lines, numSymbolsInserted);
|
|
63
|
-
var success = returnedValue.success;
|
|
64
|
-
numSymbolsInserted = returnedValue.numInserted;
|
|
65
|
-
this.reader.readLine();
|
|
66
|
-
line = this.reader.peekLine();
|
|
67
|
-
lineIndent = this.getLineIndent(false);
|
|
68
|
-
}
|
|
69
|
-
this.finalizeResult(result, lines);
|
|
70
|
-
return result;
|
|
71
|
-
};
|
|
72
|
-
PdfStringLayouter.prototype.getLineIndent = function (firstLine) {
|
|
73
|
-
var lineIndent = 0;
|
|
74
|
-
if (this.format != null) {
|
|
75
|
-
lineIndent = (firstLine) ? this.format.firstLineIndent : this.format.paragraphIndent;
|
|
76
|
-
lineIndent = (this.size.width > 0) ? Math.min(this.size.width, lineIndent) : lineIndent;
|
|
77
|
-
}
|
|
78
|
-
return lineIndent;
|
|
79
|
-
};
|
|
80
|
-
PdfStringLayouter.prototype.getLineHeight = function () {
|
|
81
|
-
var height = this.font.height;
|
|
82
|
-
if (this.format != null && this.format.lineSpacing !== 0) {
|
|
83
|
-
height = this.format.lineSpacing + this.font.height;
|
|
84
|
-
}
|
|
85
|
-
return height;
|
|
86
|
-
};
|
|
87
|
-
PdfStringLayouter.prototype.getLineWidth = function (line) {
|
|
88
|
-
var width = this.font.getLineWidth(line, this.format);
|
|
89
|
-
return width;
|
|
90
|
-
};
|
|
91
|
-
PdfStringLayouter.prototype.layoutLine = function (line, lineIndent) {
|
|
92
|
-
var lineResult = new PdfStringLayoutResult();
|
|
93
|
-
lineResult.layoutLineHeight = this.getLineHeight();
|
|
94
|
-
var lines = [];
|
|
95
|
-
var maxWidth = this.size.width;
|
|
96
|
-
var lineWidth = this.getLineWidth(line) + lineIndent;
|
|
97
|
-
var lineType = LineType.FirstParagraphLine;
|
|
98
|
-
var readWord = true;
|
|
99
|
-
if (maxWidth <= 0 || Math.round(lineWidth) <= Math.round(maxWidth)) {
|
|
100
|
-
this.addToLineResult(lineResult, lines, line, lineWidth, LineType.NewLineBreak | lineType);
|
|
101
|
-
}
|
|
102
|
-
else {
|
|
103
|
-
var builder = '';
|
|
104
|
-
var curLine = '';
|
|
105
|
-
lineWidth = lineIndent;
|
|
106
|
-
var curIndent = lineIndent;
|
|
107
|
-
var reader = new string_tokenizer_1.StringTokenizer(line);
|
|
108
|
-
var word = reader.peekWord();
|
|
109
|
-
var isSingleWord = false;
|
|
110
|
-
while (word != null) {
|
|
111
|
-
curLine = curLine + word;
|
|
112
|
-
var curLineWidth = this.getLineWidth(curLine.toString()) + curIndent;
|
|
113
|
-
if (curLineWidth > maxWidth) {
|
|
114
|
-
if (this.getWrapType() == enum_1.PdfWordWrapType.None)
|
|
115
|
-
break;
|
|
116
|
-
if (this.getWrapType() != enum_1.PdfWordWrapType.Character || !readWord) {
|
|
117
|
-
var ln = builder.toString();
|
|
118
|
-
if (ln.indexOf(' ') === -1) {
|
|
119
|
-
isSingleWord = true;
|
|
120
|
-
this.addToLineResult(lineResult, lines, curLine, lineWidth, LineType.LayoutBreak | lineType);
|
|
121
|
-
}
|
|
122
|
-
else {
|
|
123
|
-
this.addToLineResult(lineResult, lines, ln, lineWidth, LineType.LayoutBreak | lineType);
|
|
124
|
-
}
|
|
125
|
-
if (this.isOverloadWithPosition) {
|
|
126
|
-
maxWidth = this.clientSize.width;
|
|
127
|
-
}
|
|
128
|
-
curLine = '';
|
|
129
|
-
builder = '';
|
|
130
|
-
lineWidth = 0;
|
|
131
|
-
curIndent = 0;
|
|
132
|
-
curLineWidth = 0;
|
|
133
|
-
lineType = LineType.None;
|
|
134
|
-
if (isSingleWord) {
|
|
135
|
-
reader.readWord();
|
|
136
|
-
readWord = false;
|
|
137
|
-
}
|
|
138
|
-
word = (readWord) ? word : reader.peekWord();
|
|
139
|
-
isSingleWord = false;
|
|
140
|
-
readWord = true;
|
|
141
|
-
}
|
|
142
|
-
else {
|
|
143
|
-
readWord = false;
|
|
144
|
-
curLine = curLine + builder.toString();
|
|
145
|
-
word = reader.peek().toString();
|
|
146
|
-
}
|
|
147
|
-
continue;
|
|
148
|
-
}
|
|
149
|
-
builder = builder + word;
|
|
150
|
-
lineWidth = curLineWidth;
|
|
151
|
-
if (readWord) {
|
|
152
|
-
reader.readWord();
|
|
153
|
-
word = reader.peekWord();
|
|
154
|
-
isSingleWord = false;
|
|
155
|
-
}
|
|
156
|
-
else {
|
|
157
|
-
reader.read();
|
|
158
|
-
word = reader.peek().toString();
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
if (builder.length > 0) {
|
|
162
|
-
var ln = builder.toString();
|
|
163
|
-
this.addToLineResult(lineResult, lines, ln, lineWidth, LineType.NewLineBreak | LineType.LastParagraphLine);
|
|
164
|
-
}
|
|
165
|
-
reader.close();
|
|
166
|
-
}
|
|
167
|
-
lineResult.layoutLines = [];
|
|
168
|
-
for (var index = 0; index < lines.length; index++) {
|
|
169
|
-
lineResult.layoutLines.push(lines[index]);
|
|
170
|
-
}
|
|
171
|
-
lines = [];
|
|
172
|
-
return lineResult;
|
|
173
|
-
};
|
|
174
|
-
PdfStringLayouter.prototype.addToLineResult = function (lineResult, lines, line, lineWidth, breakType) {
|
|
175
|
-
var info = new LineInfo();
|
|
176
|
-
info.text = line;
|
|
177
|
-
info.width = lineWidth;
|
|
178
|
-
info.lineType = breakType;
|
|
179
|
-
lines.push(info);
|
|
180
|
-
var size = lineResult.actualSize;
|
|
181
|
-
size.height += this.getLineHeight();
|
|
182
|
-
size.width = Math.max(size.width, lineWidth);
|
|
183
|
-
lineResult.size = size;
|
|
184
|
-
};
|
|
185
|
-
PdfStringLayouter.prototype.copyToResult = function (result, lineResult, lines, numInserted) {
|
|
186
|
-
var success = true;
|
|
187
|
-
var allowPartialLines = (this.format != null && !this.format.lineLimit);
|
|
188
|
-
var height = result.actualSize.height;
|
|
189
|
-
var maxHeight = this.size.height;
|
|
190
|
-
if ((this.pageHeight > 0) && (maxHeight + this.rectangle.y > this.pageHeight)) {
|
|
191
|
-
maxHeight = this.rectangle.y - this.pageHeight;
|
|
192
|
-
maxHeight = Math.max(maxHeight, -maxHeight);
|
|
193
|
-
}
|
|
194
|
-
numInserted = 0;
|
|
195
|
-
for (var i = 0, len = lineResult.lines.length; i < len; i++) {
|
|
196
|
-
var expHeight = height + lineResult.lineHeight;
|
|
197
|
-
var info = lineResult.lines[i];
|
|
198
|
-
numInserted += info.text.length;
|
|
199
|
-
info = this.trimLine(info, (lines.length === 0));
|
|
200
|
-
lines.push(info);
|
|
201
|
-
var size_1 = result.actualSize;
|
|
202
|
-
size_1.width = Math.max(size_1.width, info.width);
|
|
203
|
-
result.size = size_1;
|
|
204
|
-
height = expHeight;
|
|
205
|
-
}
|
|
206
|
-
var size = result.actualSize;
|
|
207
|
-
size.height = height;
|
|
208
|
-
result.size = size;
|
|
209
|
-
return { success: success, numInserted: numInserted };
|
|
210
|
-
};
|
|
211
|
-
PdfStringLayouter.prototype.finalizeResult = function (result, lines) {
|
|
212
|
-
result.layoutLines = [];
|
|
213
|
-
for (var index = 0; index < lines.length; index++) {
|
|
214
|
-
result.layoutLines.push(lines[index]);
|
|
215
|
-
}
|
|
216
|
-
result.layoutLineHeight = this.getLineHeight();
|
|
217
|
-
lines = [];
|
|
218
|
-
};
|
|
219
|
-
PdfStringLayouter.prototype.trimLine = function (info, firstLine) {
|
|
220
|
-
var line = info.text;
|
|
221
|
-
var lineWidth = info.width;
|
|
222
|
-
var start = (this.format == null || !this.format.rightToLeft);
|
|
223
|
-
var spaces = string_tokenizer_1.StringTokenizer.spaces;
|
|
224
|
-
line = (start) ? line.trim() : line.trim();
|
|
225
|
-
if (line.length !== info.text.length) {
|
|
226
|
-
lineWidth = this.getLineWidth(line);
|
|
227
|
-
lineWidth += this.getLineIndent(firstLine);
|
|
228
|
-
}
|
|
229
|
-
info.text = line;
|
|
230
|
-
info.width = lineWidth;
|
|
231
|
-
return info;
|
|
232
|
-
};
|
|
233
|
-
PdfStringLayouter.prototype.getWrapType = function () {
|
|
234
|
-
var wrapType = (this.format != null) ? this.format.wordWrap : enum_1.PdfWordWrapType.Word;
|
|
235
|
-
return wrapType;
|
|
236
|
-
};
|
|
237
|
-
return PdfStringLayouter;
|
|
238
|
-
}());
|
|
239
|
-
exports.PdfStringLayouter = PdfStringLayouter;
|
|
240
|
-
var PdfStringLayoutResult = (function () {
|
|
241
|
-
function PdfStringLayoutResult() {
|
|
242
|
-
}
|
|
243
|
-
Object.defineProperty(PdfStringLayoutResult.prototype, "remainder", {
|
|
244
|
-
get: function () {
|
|
245
|
-
return this.textRemainder;
|
|
246
|
-
},
|
|
247
|
-
enumerable: true,
|
|
248
|
-
configurable: true
|
|
249
|
-
});
|
|
250
|
-
Object.defineProperty(PdfStringLayoutResult.prototype, "actualSize", {
|
|
251
|
-
get: function () {
|
|
252
|
-
if (typeof this.size === 'undefined') {
|
|
253
|
-
this.size = new pdf_drawing_1.SizeF(0, 0);
|
|
254
|
-
}
|
|
255
|
-
return this.size;
|
|
256
|
-
},
|
|
257
|
-
enumerable: true,
|
|
258
|
-
configurable: true
|
|
259
|
-
});
|
|
260
|
-
Object.defineProperty(PdfStringLayoutResult.prototype, "lines", {
|
|
261
|
-
get: function () {
|
|
262
|
-
return this.layoutLines;
|
|
263
|
-
},
|
|
264
|
-
enumerable: true,
|
|
265
|
-
configurable: true
|
|
266
|
-
});
|
|
267
|
-
Object.defineProperty(PdfStringLayoutResult.prototype, "lineHeight", {
|
|
268
|
-
get: function () {
|
|
269
|
-
return this.layoutLineHeight;
|
|
270
|
-
},
|
|
271
|
-
enumerable: true,
|
|
272
|
-
configurable: true
|
|
273
|
-
});
|
|
274
|
-
Object.defineProperty(PdfStringLayoutResult.prototype, "empty", {
|
|
275
|
-
get: function () {
|
|
276
|
-
return (this.layoutLines == null || this.layoutLines.length === 0);
|
|
277
|
-
},
|
|
278
|
-
enumerable: true,
|
|
279
|
-
configurable: true
|
|
280
|
-
});
|
|
281
|
-
Object.defineProperty(PdfStringLayoutResult.prototype, "lineCount", {
|
|
282
|
-
get: function () {
|
|
283
|
-
var count = (!this.empty) ? this.layoutLines.length : 0;
|
|
284
|
-
return count;
|
|
285
|
-
},
|
|
286
|
-
enumerable: true,
|
|
287
|
-
configurable: true
|
|
288
|
-
});
|
|
289
|
-
return PdfStringLayoutResult;
|
|
290
|
-
}());
|
|
291
|
-
exports.PdfStringLayoutResult = PdfStringLayoutResult;
|
|
292
|
-
var LineInfo = (function () {
|
|
293
|
-
function LineInfo() {
|
|
294
|
-
}
|
|
295
|
-
Object.defineProperty(LineInfo.prototype, "lineType", {
|
|
296
|
-
get: function () {
|
|
297
|
-
return this.type;
|
|
298
|
-
},
|
|
299
|
-
set: function (value) {
|
|
300
|
-
this.type = value;
|
|
301
|
-
},
|
|
302
|
-
enumerable: true,
|
|
303
|
-
configurable: true
|
|
304
|
-
});
|
|
305
|
-
Object.defineProperty(LineInfo.prototype, "text", {
|
|
306
|
-
get: function () {
|
|
307
|
-
return this.content;
|
|
308
|
-
},
|
|
309
|
-
set: function (value) {
|
|
310
|
-
this.content = value;
|
|
311
|
-
},
|
|
312
|
-
enumerable: true,
|
|
313
|
-
configurable: true
|
|
314
|
-
});
|
|
315
|
-
Object.defineProperty(LineInfo.prototype, "width", {
|
|
316
|
-
get: function () {
|
|
317
|
-
return this.lineWidth;
|
|
318
|
-
},
|
|
319
|
-
set: function (value) {
|
|
320
|
-
this.lineWidth = value;
|
|
321
|
-
},
|
|
322
|
-
enumerable: true,
|
|
323
|
-
configurable: true
|
|
324
|
-
});
|
|
325
|
-
return LineInfo;
|
|
326
|
-
}());
|
|
327
|
-
exports.LineInfo = LineInfo;
|
|
328
|
-
var LineType;
|
|
329
|
-
(function (LineType) {
|
|
330
|
-
LineType[LineType["None"] = 0] = "None";
|
|
331
|
-
LineType[LineType["NewLineBreak"] = 1] = "NewLineBreak";
|
|
332
|
-
LineType[LineType["LayoutBreak"] = 2] = "LayoutBreak";
|
|
333
|
-
LineType[LineType["FirstParagraphLine"] = 4] = "FirstParagraphLine";
|
|
334
|
-
LineType[LineType["LastParagraphLine"] = 8] = "LastParagraphLine";
|
|
335
|
-
})(LineType = exports.LineType || (exports.LineType = {}));
|
|
336
|
-
});
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* StringTokenizer.ts class for EJ2-PDF
|
|
3
|
-
* Utility class for working with strings.
|
|
4
|
-
* @private
|
|
5
|
-
*/
|
|
6
|
-
export declare class StringTokenizer {
|
|
7
|
-
/**
|
|
8
|
-
* `Whitespace` symbol.
|
|
9
|
-
* @private
|
|
10
|
-
*/
|
|
11
|
-
static readonly whiteSpace: string;
|
|
12
|
-
/**
|
|
13
|
-
* `tab` symbol.
|
|
14
|
-
* @private
|
|
15
|
-
*/
|
|
16
|
-
static readonly tab: string;
|
|
17
|
-
/**
|
|
18
|
-
* Array of `spaces`.
|
|
19
|
-
* @private
|
|
20
|
-
*/
|
|
21
|
-
static readonly spaces: string[];
|
|
22
|
-
/**
|
|
23
|
-
* `Pattern` for WhiteSpace.
|
|
24
|
-
* @private
|
|
25
|
-
*/
|
|
26
|
-
private static readonly whiteSpacePattern;
|
|
27
|
-
/**
|
|
28
|
-
* `Text` data.
|
|
29
|
-
* @private
|
|
30
|
-
*/
|
|
31
|
-
private text;
|
|
32
|
-
/**
|
|
33
|
-
* Current `position`.
|
|
34
|
-
* @private
|
|
35
|
-
*/
|
|
36
|
-
private currentPosition;
|
|
37
|
-
/**
|
|
38
|
-
* Initializes a new instance of the `StringTokenizer` class.
|
|
39
|
-
* @private
|
|
40
|
-
*/
|
|
41
|
-
constructor(textValue: string);
|
|
42
|
-
/**
|
|
43
|
-
* Gets text `length`.
|
|
44
|
-
* @private
|
|
45
|
-
*/
|
|
46
|
-
readonly length: number;
|
|
47
|
-
/**
|
|
48
|
-
* Gets or sets the position.
|
|
49
|
-
* @private
|
|
50
|
-
*/
|
|
51
|
-
position: number;
|
|
52
|
-
/**
|
|
53
|
-
* Returns number of symbols occurred in the text.
|
|
54
|
-
* @private
|
|
55
|
-
*/
|
|
56
|
-
static getCharsCount(text: string, symbols: string): number;
|
|
57
|
-
/**
|
|
58
|
-
* Returns number of symbols occurred in the text.
|
|
59
|
-
* @private
|
|
60
|
-
*/
|
|
61
|
-
static getCharsCount(text: string, symbols: string[]): number;
|
|
62
|
-
/**
|
|
63
|
-
* Reads line of the text.
|
|
64
|
-
* @private
|
|
65
|
-
*/
|
|
66
|
-
readLine(): string;
|
|
67
|
-
/**
|
|
68
|
-
* Reads line of the text.
|
|
69
|
-
* @private
|
|
70
|
-
*/
|
|
71
|
-
peekLine(): string;
|
|
72
|
-
/**
|
|
73
|
-
* Reads a word from the text.
|
|
74
|
-
* @private
|
|
75
|
-
*/
|
|
76
|
-
readWord(): string;
|
|
77
|
-
/**
|
|
78
|
-
* Peeks a word from the text.
|
|
79
|
-
* @private
|
|
80
|
-
*/
|
|
81
|
-
peekWord(): string;
|
|
82
|
-
/**
|
|
83
|
-
* Reads char form the data.
|
|
84
|
-
* @private
|
|
85
|
-
*/
|
|
86
|
-
read(): string;
|
|
87
|
-
/**
|
|
88
|
-
* Reads count of the symbols.
|
|
89
|
-
* @private
|
|
90
|
-
*/
|
|
91
|
-
read(count: number): string;
|
|
92
|
-
/**
|
|
93
|
-
* Peeks char form the data.
|
|
94
|
-
* @private
|
|
95
|
-
*/
|
|
96
|
-
peek(): string;
|
|
97
|
-
/**
|
|
98
|
-
* Closes a reader.
|
|
99
|
-
* @private
|
|
100
|
-
*/
|
|
101
|
-
close(): void;
|
|
102
|
-
/**
|
|
103
|
-
* Checks whether array contains a symbol.
|
|
104
|
-
* @private
|
|
105
|
-
*/
|
|
106
|
-
private static contains(array, symbol);
|
|
107
|
-
}
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
define(["require", "exports"], function (require, exports) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
var StringTokenizer = (function () {
|
|
5
|
-
function StringTokenizer(textValue) {
|
|
6
|
-
this.currentPosition = 0;
|
|
7
|
-
if (textValue == null) {
|
|
8
|
-
throw new Error('ArgumentNullException:text');
|
|
9
|
-
}
|
|
10
|
-
this.text = textValue;
|
|
11
|
-
}
|
|
12
|
-
Object.defineProperty(StringTokenizer.prototype, "length", {
|
|
13
|
-
get: function () {
|
|
14
|
-
return this.text.length;
|
|
15
|
-
},
|
|
16
|
-
enumerable: true,
|
|
17
|
-
configurable: true
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(StringTokenizer.prototype, "position", {
|
|
20
|
-
get: function () {
|
|
21
|
-
return this.currentPosition;
|
|
22
|
-
},
|
|
23
|
-
set: function (value) {
|
|
24
|
-
this.currentPosition = value;
|
|
25
|
-
},
|
|
26
|
-
enumerable: true,
|
|
27
|
-
configurable: true
|
|
28
|
-
});
|
|
29
|
-
StringTokenizer.getCharsCount = function (text, symbols) {
|
|
30
|
-
if (typeof symbols === 'string') {
|
|
31
|
-
if (text == null) {
|
|
32
|
-
throw new Error('ArgumentNullException:wholeText');
|
|
33
|
-
}
|
|
34
|
-
var numSymbols = 0;
|
|
35
|
-
var curIndex = 0;
|
|
36
|
-
for (;;) {
|
|
37
|
-
curIndex = text.indexOf(symbols, curIndex);
|
|
38
|
-
if (curIndex === -1) {
|
|
39
|
-
break;
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
numSymbols++;
|
|
43
|
-
curIndex++;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return numSymbols;
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
if (text == null) {
|
|
50
|
-
throw new Error('ArgumentNullException:text');
|
|
51
|
-
}
|
|
52
|
-
if (symbols == null) {
|
|
53
|
-
throw new Error('ArgumentNullException:symbols');
|
|
54
|
-
}
|
|
55
|
-
var count = 0;
|
|
56
|
-
for (var i = 0, len = text.length; i < len; i++) {
|
|
57
|
-
var ch = text[i];
|
|
58
|
-
if (this.contains(symbols, ch)) {
|
|
59
|
-
count++;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
return count;
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
StringTokenizer.prototype.readLine = function () {
|
|
66
|
-
var pos = this.currentPosition;
|
|
67
|
-
while (pos < this.length) {
|
|
68
|
-
var ch = this.text[pos];
|
|
69
|
-
switch (ch) {
|
|
70
|
-
case '\r':
|
|
71
|
-
case '\n': {
|
|
72
|
-
var text = this.text.substring(this.currentPosition, pos - this.currentPosition);
|
|
73
|
-
this.currentPosition = pos + 1;
|
|
74
|
-
this.currentPosition++;
|
|
75
|
-
return text;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
pos++;
|
|
79
|
-
}
|
|
80
|
-
if (pos > this.currentPosition) {
|
|
81
|
-
var text2 = this.text.substring(this.currentPosition, pos - this.currentPosition);
|
|
82
|
-
this.currentPosition = pos;
|
|
83
|
-
return text2;
|
|
84
|
-
}
|
|
85
|
-
return null;
|
|
86
|
-
};
|
|
87
|
-
StringTokenizer.prototype.peekLine = function () {
|
|
88
|
-
var pos = this.currentPosition;
|
|
89
|
-
var line = this.readLine();
|
|
90
|
-
this.currentPosition = pos;
|
|
91
|
-
return line;
|
|
92
|
-
};
|
|
93
|
-
StringTokenizer.prototype.readWord = function () {
|
|
94
|
-
var pos = this.currentPosition;
|
|
95
|
-
while (pos < this.length) {
|
|
96
|
-
var ch = this.text[pos];
|
|
97
|
-
switch (ch) {
|
|
98
|
-
case '\r':
|
|
99
|
-
case '\n':
|
|
100
|
-
var textValue = this.text.substr(this.currentPosition, pos - this.currentPosition);
|
|
101
|
-
this.currentPosition = pos + 1;
|
|
102
|
-
if (((ch === '\r') && (this.currentPosition < this.length)) && (this.text[this.currentPosition] === '\n')) {
|
|
103
|
-
this.currentPosition++;
|
|
104
|
-
}
|
|
105
|
-
return textValue;
|
|
106
|
-
case ' ':
|
|
107
|
-
case '\t': {
|
|
108
|
-
if (pos === this.currentPosition) {
|
|
109
|
-
pos++;
|
|
110
|
-
}
|
|
111
|
-
var text = this.text.substr(this.currentPosition, pos - this.currentPosition);
|
|
112
|
-
this.currentPosition = pos;
|
|
113
|
-
return text;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
pos++;
|
|
117
|
-
}
|
|
118
|
-
if (pos > this.currentPosition) {
|
|
119
|
-
var text2 = this.text.substr(this.currentPosition, pos - this.currentPosition);
|
|
120
|
-
this.currentPosition = pos;
|
|
121
|
-
return text2;
|
|
122
|
-
}
|
|
123
|
-
return null;
|
|
124
|
-
};
|
|
125
|
-
StringTokenizer.prototype.peekWord = function () {
|
|
126
|
-
var pos = this.currentPosition;
|
|
127
|
-
var word = this.readWord();
|
|
128
|
-
this.currentPosition = pos;
|
|
129
|
-
return word;
|
|
130
|
-
};
|
|
131
|
-
StringTokenizer.prototype.read = function (count) {
|
|
132
|
-
if (typeof count === 'undefined') {
|
|
133
|
-
var ch = '0';
|
|
134
|
-
return ch;
|
|
135
|
-
}
|
|
136
|
-
else {
|
|
137
|
-
var num = 0;
|
|
138
|
-
var builder = '';
|
|
139
|
-
return builder;
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
StringTokenizer.prototype.peek = function () {
|
|
143
|
-
var ch = '0';
|
|
144
|
-
return ch;
|
|
145
|
-
};
|
|
146
|
-
StringTokenizer.prototype.close = function () {
|
|
147
|
-
this.text = null;
|
|
148
|
-
};
|
|
149
|
-
StringTokenizer.contains = function (array, symbol) {
|
|
150
|
-
var contains = false;
|
|
151
|
-
for (var i = 0; i < array.length; i++) {
|
|
152
|
-
if (array[i] === symbol) {
|
|
153
|
-
contains = true;
|
|
154
|
-
break;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
return contains;
|
|
158
|
-
};
|
|
159
|
-
return StringTokenizer;
|
|
160
|
-
}());
|
|
161
|
-
StringTokenizer.whiteSpace = ' ';
|
|
162
|
-
StringTokenizer.tab = '\t';
|
|
163
|
-
StringTokenizer.spaces = [StringTokenizer.whiteSpace, StringTokenizer.tab];
|
|
164
|
-
StringTokenizer.whiteSpacePattern = '^[ \t]+$';
|
|
165
|
-
exports.StringTokenizer = StringTokenizer;
|
|
166
|
-
});
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ByteArray class
|
|
3
|
-
* Used to keep information about image stream as byte array.
|
|
4
|
-
* @private
|
|
5
|
-
*/
|
|
6
|
-
export declare class ByteArray {
|
|
7
|
-
/**
|
|
8
|
-
* Current stream `position`.
|
|
9
|
-
* @default 0
|
|
10
|
-
* @private
|
|
11
|
-
*/
|
|
12
|
-
private mPosition;
|
|
13
|
-
/**
|
|
14
|
-
* Uint8Array for returing `buffer`.
|
|
15
|
-
* @hidden
|
|
16
|
-
* @private
|
|
17
|
-
*/
|
|
18
|
-
private buffer;
|
|
19
|
-
/**
|
|
20
|
-
* Specifies the `data view`.
|
|
21
|
-
* @hidden
|
|
22
|
-
* @private
|
|
23
|
-
*/
|
|
24
|
-
private dataView;
|
|
25
|
-
/**
|
|
26
|
-
* Initialize the new instance for `byte-array` class
|
|
27
|
-
* @hidden
|
|
28
|
-
* @private
|
|
29
|
-
*/
|
|
30
|
-
constructor(length: number);
|
|
31
|
-
/**
|
|
32
|
-
* Gets and Sets a current `position` of byte array.
|
|
33
|
-
* @hidden
|
|
34
|
-
* @private
|
|
35
|
-
*/
|
|
36
|
-
position: number;
|
|
37
|
-
/**
|
|
38
|
-
* `Read` from current stream position.
|
|
39
|
-
* @default 0
|
|
40
|
-
* @hidden
|
|
41
|
-
* @private
|
|
42
|
-
*/
|
|
43
|
-
read(buffer: ByteArray, offset: number, count: number): void;
|
|
44
|
-
/**
|
|
45
|
-
* @hidden
|
|
46
|
-
*/
|
|
47
|
-
getBuffer(index: number): number;
|
|
48
|
-
/**
|
|
49
|
-
* @hidden
|
|
50
|
-
*/
|
|
51
|
-
writeFromBase64String(base64: string): void;
|
|
52
|
-
/**
|
|
53
|
-
* @hidden
|
|
54
|
-
*/
|
|
55
|
-
encodedString(input: string): Uint8Array;
|
|
56
|
-
/**
|
|
57
|
-
* @hidden
|
|
58
|
-
*/
|
|
59
|
-
readByte(offset: number): number;
|
|
60
|
-
/**
|
|
61
|
-
* @hidden
|
|
62
|
-
*/
|
|
63
|
-
readonly internalBuffer: Uint8Array;
|
|
64
|
-
/**
|
|
65
|
-
* @hidden
|
|
66
|
-
*/
|
|
67
|
-
readonly count: number;
|
|
68
|
-
}
|