@syncfusion/ej2-pdf 1.0.23 → 23.1.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +260 -0
- package/.gitleaksignore +1 -0
- package/CHANGELOG.md +28 -0
- package/README.md +17 -0
- package/dist/ej2-pdf.umd.min.js +4 -14
- package/dist/ej2-pdf.umd.min.js.map +1 -11
- package/dist/es6/ej2-pdf.es2015.js +48372 -0
- package/dist/es6/ej2-pdf.es2015.js.map +1 -0
- package/dist/es6/ej2-pdf.es5.js +50250 -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 +58 -16
- 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 +755 -0
- package/src/pdf/core/annotations/annotation.d.ts +5865 -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 +38 -0
- package/src/pdf/core/graphics/images/image-decoder.js +227 -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 +686 -0
- package/src/pdf/core/utils.js +3625 -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 -13
- 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-export.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
|
@@ -0,0 +1,667 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
extendStatics(d, b);
|
|
10
|
+
function __() { this.constructor = d; }
|
|
11
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12
|
+
};
|
|
13
|
+
})();
|
|
14
|
+
import { _PdfDictionary, _PdfName, _PdfReference } from './../pdf-primitives';
|
|
15
|
+
import { _PdfParser, _PdfLexicalOperator } from '../pdf-parser';
|
|
16
|
+
import { _PdfStream } from '../base-stream';
|
|
17
|
+
import { _PdfCommand } from './../pdf-primitives';
|
|
18
|
+
import { _ExportHelper } from './xfdf-document';
|
|
19
|
+
import { PdfUriAnnotation, PdfRubberStampAnnotation, PdfFileLinkAnnotation, PdfTextWebLinkAnnotation, PdfRectangleAnnotation, PdfDocumentLinkAnnotation } from './../annotations/annotation';
|
|
20
|
+
import { _bytesToString, _getNewGuidString, _byteArrayToHexString, _stringToBytes } from './../utils';
|
|
21
|
+
import { PdfCheckBoxField, PdfComboBoxField, PdfListBoxField, PdfRadioButtonListField, PdfTextBoxField } from './../form/field';
|
|
22
|
+
import { _StringTokenizer } from './../fonts/string-layouter';
|
|
23
|
+
import { _PdfFlateStream } from '../flate-stream';
|
|
24
|
+
import { CompressedStreamWriter } from '@syncfusion/ej2-compression';
|
|
25
|
+
var _FdfDocument = /** @class */ (function (_super) {
|
|
26
|
+
__extends(_FdfDocument, _super);
|
|
27
|
+
function _FdfDocument(fileName) {
|
|
28
|
+
var _this = _super.call(this) || this;
|
|
29
|
+
_this._annotationObjects = new Map(); // eslint-disable-line
|
|
30
|
+
_this._specialCharacters = 'âãÏÓ';
|
|
31
|
+
if (fileName !== null && typeof fileName !== 'undefined') {
|
|
32
|
+
_this._fileName = fileName;
|
|
33
|
+
}
|
|
34
|
+
return _this;
|
|
35
|
+
}
|
|
36
|
+
_FdfDocument.prototype._exportAnnotations = function (document) {
|
|
37
|
+
this._document = document;
|
|
38
|
+
this._crossReference = document._crossReference;
|
|
39
|
+
this._isAnnotationExport = true;
|
|
40
|
+
this._exportAnnotationData(document, document.pageCount);
|
|
41
|
+
return this._save();
|
|
42
|
+
};
|
|
43
|
+
_FdfDocument.prototype._exportFormFields = function (document) {
|
|
44
|
+
this._document = document;
|
|
45
|
+
this._crossReference = document._crossReference;
|
|
46
|
+
this._isAnnotationExport = false;
|
|
47
|
+
this._key = _getNewGuidString();
|
|
48
|
+
return this._save();
|
|
49
|
+
};
|
|
50
|
+
_FdfDocument.prototype._save = function () {
|
|
51
|
+
var _this = this;
|
|
52
|
+
var objectID = 0;
|
|
53
|
+
var objectArray = [];
|
|
54
|
+
if (!this._isAnnotationExport) {
|
|
55
|
+
if (this._asPerSpecification) {
|
|
56
|
+
this.fdfString += '%FDF-1.2\n%' + this._specialCharacters + '\r\n1 0 obj\r<</FDF<</F(';
|
|
57
|
+
this.fdfString += this._fileName + ')';
|
|
58
|
+
this.fdfString += '/Fields[';
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
this.fdfString += '%FDF-1.2\n';
|
|
62
|
+
}
|
|
63
|
+
var form = this._document.form;
|
|
64
|
+
if (form !== null && typeof form !== 'undefined') {
|
|
65
|
+
this._exportEmptyFields = form.exportEmptyFields;
|
|
66
|
+
var count = this._document.form.count;
|
|
67
|
+
for (var i = 0; i < count; i++) {
|
|
68
|
+
var field = this._document.form.fieldAt(i);
|
|
69
|
+
var value = this._exportFormFieldsData(field);
|
|
70
|
+
if (field instanceof PdfTextBoxField || field instanceof PdfListBoxField || field instanceof PdfComboBoxField
|
|
71
|
+
|| field instanceof PdfRadioButtonListField || field instanceof PdfCheckBoxField) {
|
|
72
|
+
objectID++;
|
|
73
|
+
}
|
|
74
|
+
if (!this._asPerSpecification) {
|
|
75
|
+
if (field instanceof PdfTextBoxField || field instanceof PdfListBoxField || field instanceof PdfComboBoxField) {
|
|
76
|
+
objectArray.push(objectID);
|
|
77
|
+
this.fdfString += objectID + ' 0 obj<</T <' + this._stringToHexString(field.name) + '> /V ';
|
|
78
|
+
if (typeof value === 'string' || (Array.isArray(value) && value.length === 1)) {
|
|
79
|
+
this.fdfString += '<' + this._stringToHexString((Array.isArray(value) ? value[0] : value)) + '>';
|
|
80
|
+
}
|
|
81
|
+
else if (Array.isArray(value)) {
|
|
82
|
+
this.fdfString += '[';
|
|
83
|
+
for (var j = 0; j < value.length; j++) {
|
|
84
|
+
this.fdfString += '<' + this._stringToHexString(value[Number.parseInt(j.toString(), 10)]) + '>';
|
|
85
|
+
if (j !== value.length - 1) {
|
|
86
|
+
this.fdfString += ' ';
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
this.fdfString += ']';
|
|
90
|
+
}
|
|
91
|
+
this.fdfString += ' >>endobj\n';
|
|
92
|
+
}
|
|
93
|
+
else if (field instanceof PdfRadioButtonListField || field instanceof PdfCheckBoxField) {
|
|
94
|
+
objectArray.push(objectID);
|
|
95
|
+
this.fdfString += objectID + ' 0 obj<</T <' + this._stringToHexString(field.name) + '> /V /';
|
|
96
|
+
this.fdfString += value + ' >>endobj\n';
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
if (field instanceof PdfTextBoxField || field instanceof PdfListBoxField || field instanceof PdfComboBoxField) {
|
|
101
|
+
objectArray.push(objectID);
|
|
102
|
+
this.fdfString += '<</T(' + field.name + ')/V';
|
|
103
|
+
if (typeof value === 'string' || (Array.isArray(value) && value.length === 1)) {
|
|
104
|
+
this.fdfString += '(' + (Array.isArray(value) ? value[0] : value) + ')';
|
|
105
|
+
}
|
|
106
|
+
else if (Array.isArray(value)) {
|
|
107
|
+
this.fdfString += '[';
|
|
108
|
+
for (var j = 0; j < value.length; j++) {
|
|
109
|
+
this.fdfString += '(' + value[Number.parseInt(j.toString(), 10)] + ')';
|
|
110
|
+
if (j !== value.length - 1) {
|
|
111
|
+
this.fdfString += ' ';
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
this.fdfString += ']';
|
|
115
|
+
}
|
|
116
|
+
this.fdfString += '>>';
|
|
117
|
+
}
|
|
118
|
+
else if (field instanceof PdfRadioButtonListField || field instanceof PdfCheckBoxField) {
|
|
119
|
+
objectArray.push(objectID);
|
|
120
|
+
this.fdfString += '<</T(' + field.name + ')/V/' + value + '>>';
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
if (this._asPerSpecification) {
|
|
126
|
+
this.fdfString += ']';
|
|
127
|
+
this.fdfString += '/ID[]/UF(' + this._fileName + ')>>/Type/Catalog>>\rendobj\rtrailer\r\n<</Root 1 0 R>>\r\n';
|
|
128
|
+
this.fdfString += '%%EOF\r\n';
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
this.fdfString += (this._table.size + 1) + ' 0 obj<</F <' + this._stringToHexString(this._fileName) + '> /Fields [';
|
|
132
|
+
for (var i = 0; i < this._table.size; i++) {
|
|
133
|
+
var field = this._document.form.fieldAt(i);
|
|
134
|
+
if (field !== null && typeof field !== 'undefined' && field.export) {
|
|
135
|
+
this.fdfString += objectArray[Number.parseInt(i.toString(), 10)] + ' 0 R ';
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
this.fdfString += ']>>endobj\n';
|
|
139
|
+
this.fdfString += (objectArray.length + 2) + ' 0 obj<</Version /1.4 /FDF ' + (objectArray.length + 1) + ' 0 R>>endobj\n';
|
|
140
|
+
this.fdfString += 'trailer\n<</Root ' + (objectArray.length + 2) + ' 0 R>>';
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
var arrayBuffer = new ArrayBuffer(this.fdfString.length * 1);
|
|
144
|
+
var result = new Uint8Array(arrayBuffer);
|
|
145
|
+
result.forEach(function (val, i) {
|
|
146
|
+
result[i] = _this.fdfString.charCodeAt(i); // eslint-disable-line
|
|
147
|
+
});
|
|
148
|
+
return result;
|
|
149
|
+
};
|
|
150
|
+
_FdfDocument.prototype._importAnnotations = function (document, data) {
|
|
151
|
+
this._document = document;
|
|
152
|
+
this._crossReference = document._crossReference;
|
|
153
|
+
this._isAnnotationExport = false;
|
|
154
|
+
this._checkFdf(_bytesToString(data));
|
|
155
|
+
var stream = new _PdfStream(data);
|
|
156
|
+
this._isAnnotationImport = true;
|
|
157
|
+
var parser = new _PdfParser(new _PdfLexicalOperator(stream), null, true, false);
|
|
158
|
+
this._readFdfData(parser);
|
|
159
|
+
if (this._annotationObjects !== null && typeof this._annotationObjects !== 'undefined' && this._annotationObjects.size > 0) {
|
|
160
|
+
this._annotationObjects.clear();
|
|
161
|
+
}
|
|
162
|
+
if (this._table !== null && typeof this._table !== 'undefined' && this._table.size > 0) {
|
|
163
|
+
this._table.clear();
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
_FdfDocument.prototype._importFormData = function (document, data) {
|
|
167
|
+
this._document = document;
|
|
168
|
+
this._crossReference = document._crossReference;
|
|
169
|
+
this._isAnnotationExport = false;
|
|
170
|
+
this._checkFdf(_bytesToString(data));
|
|
171
|
+
var stream = new _PdfStream(data);
|
|
172
|
+
var parser = new _PdfParser(new _PdfLexicalOperator(stream), null, false, false);
|
|
173
|
+
this._readFdfData(parser);
|
|
174
|
+
};
|
|
175
|
+
_FdfDocument.prototype._readFdfData = function (parser) {
|
|
176
|
+
var _this = this;
|
|
177
|
+
var token = parser.getObject(); // eslint-disable-line
|
|
178
|
+
if (this._isAnnotationImport) {
|
|
179
|
+
var key = '';
|
|
180
|
+
while (token !== null && typeof token !== 'undefined' && token !== 'EOF') {
|
|
181
|
+
if (token instanceof _PdfDictionary) {
|
|
182
|
+
this._table.set(key, token);
|
|
183
|
+
key = '';
|
|
184
|
+
}
|
|
185
|
+
else if (token instanceof _PdfStream || token instanceof _PdfFlateStream) {
|
|
186
|
+
this._table.set(key, token);
|
|
187
|
+
key = '';
|
|
188
|
+
}
|
|
189
|
+
else if (token !== null && Number.isInteger(token) && token !== 0) {
|
|
190
|
+
if (parser.first >= 0) {
|
|
191
|
+
key = token.toString() + ' ' + parser.first.toString();
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
else if (token instanceof _PdfCommand && token.command !== null && typeof token.command !== 'undefined' &&
|
|
195
|
+
token.command === 'trailer') {
|
|
196
|
+
key = token.command;
|
|
197
|
+
}
|
|
198
|
+
token = parser.getObject();
|
|
199
|
+
}
|
|
200
|
+
this._annotationObjects = this._parseAnnotationData();
|
|
201
|
+
this._annotationObjects.forEach(function (value, key) {
|
|
202
|
+
var dictionary = value;
|
|
203
|
+
dictionary._crossReference = _this._crossReference;
|
|
204
|
+
dictionary._updated = true;
|
|
205
|
+
if (dictionary !== null && typeof dictionary !== 'undefined' && dictionary.has('Page')) {
|
|
206
|
+
var pageNumber = dictionary.get('Page');
|
|
207
|
+
if (pageNumber !== null && typeof pageNumber !== 'undefined') {
|
|
208
|
+
var pageIndex = pageNumber;
|
|
209
|
+
if (pageIndex < _this._document.pageCount) {
|
|
210
|
+
var page = _this._document.getPage(pageIndex);
|
|
211
|
+
var pageDictionary = page._pageDictionary;
|
|
212
|
+
if (pageDictionary !== null && typeof pageDictionary !== 'undefined') {
|
|
213
|
+
var annotations = page.annotations;
|
|
214
|
+
var annotation = annotations._parseAnnotation(dictionary);
|
|
215
|
+
if (annotation !== null && typeof annotation !== 'undefined') {
|
|
216
|
+
annotation._isImported = true;
|
|
217
|
+
var reference = _this._crossReference._getNextReference();
|
|
218
|
+
_this._crossReference._cacheMap.set(reference, dictionary);
|
|
219
|
+
if (dictionary.has('NM') || dictionary.has('IRT')) {
|
|
220
|
+
_this._addReferenceToGroup(reference, dictionary);
|
|
221
|
+
}
|
|
222
|
+
annotation._ref = reference;
|
|
223
|
+
var index = annotations._annotations.length;
|
|
224
|
+
annotations._annotations.push(reference);
|
|
225
|
+
pageDictionary.set('Annots', annotations._annotations);
|
|
226
|
+
pageDictionary._updated = true;
|
|
227
|
+
annotations._parsedAnnotations.set(index, annotation);
|
|
228
|
+
_this._handlePopup(annotations, reference, dictionary, pageDictionary);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
else {
|
|
237
|
+
token = parser.getObject();
|
|
238
|
+
if (!this._asPerSpecification) {
|
|
239
|
+
token = parser.getObject();
|
|
240
|
+
if (token instanceof _PdfCommand && token.command !== null) {
|
|
241
|
+
token = token.command;
|
|
242
|
+
}
|
|
243
|
+
while (token !== null && typeof token !== 'undefined' && token !== 'EOF') {
|
|
244
|
+
if (token instanceof _PdfDictionary) {
|
|
245
|
+
var t = token.getArray('T');
|
|
246
|
+
var v = void 0;
|
|
247
|
+
if (token._map.V instanceof _PdfName) {
|
|
248
|
+
v = token.getArray('V').name;
|
|
249
|
+
}
|
|
250
|
+
else {
|
|
251
|
+
v = token.getArray('V');
|
|
252
|
+
}
|
|
253
|
+
if (t !== null && t !== undefined && t.length > 0) {
|
|
254
|
+
this._table.set(t, v);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
token = parser.getObject();
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
else {
|
|
261
|
+
while (token !== null && typeof token !== 'undefined' && token !== 'EOF') {
|
|
262
|
+
if (token instanceof _PdfDictionary && token !== null && token._map.FDF !== null && token._map.FDF !== undefined) {
|
|
263
|
+
token = token._map.FDF;
|
|
264
|
+
if (token instanceof _PdfDictionary && token._map.Fields !== null && token._map.Fields !== undefined) {
|
|
265
|
+
token = token._map.Fields;
|
|
266
|
+
if (token !== null && token !== undefined) {
|
|
267
|
+
for (var i = 0; i < token.length; i++) {
|
|
268
|
+
var field = token[Number.parseInt(i.toString(), 10)];
|
|
269
|
+
if (field instanceof _PdfDictionary && field !== null && field !== undefined) {
|
|
270
|
+
var t = field.getArray('T');
|
|
271
|
+
var v = void 0;
|
|
272
|
+
if (field._map.V instanceof _PdfName) {
|
|
273
|
+
v = field.getArray('V').name;
|
|
274
|
+
}
|
|
275
|
+
else {
|
|
276
|
+
v = field.getArray('V');
|
|
277
|
+
}
|
|
278
|
+
if (t !== null && t !== undefined && t.length > 0) {
|
|
279
|
+
this._table.set(t, v);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
token = parser.getObject();
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
this._importField();
|
|
290
|
+
}
|
|
291
|
+
};
|
|
292
|
+
_FdfDocument.prototype._parseAnnotationData = function () {
|
|
293
|
+
var objects = new Map(); // eslint-disable-line
|
|
294
|
+
var mappedObjects = new Map(); // eslint-disable-line
|
|
295
|
+
objects = this._table;
|
|
296
|
+
if (objects !== null && typeof objects !== 'undefined' && objects.size > 0 && objects.has('trailer')) {
|
|
297
|
+
var trailer = objects.get('trailer');
|
|
298
|
+
if (trailer instanceof _PdfDictionary && trailer !== null && typeof trailer !== 'undefined' && trailer.has('Root')) {
|
|
299
|
+
var holder = trailer.getRaw('Root');
|
|
300
|
+
if (holder !== null && typeof holder !== 'undefined') {
|
|
301
|
+
var rootKey = holder.objectNumber.toString() + ' ' + holder.generationNumber.toString();
|
|
302
|
+
if (objects.has(rootKey)) {
|
|
303
|
+
var root = objects.get(rootKey);
|
|
304
|
+
if (root !== null && typeof root !== 'undefined' && root.has('FDF')) {
|
|
305
|
+
var fdf = root.get('FDF');
|
|
306
|
+
if (fdf !== null && typeof fdf !== 'undefined' && fdf.has('Annots')) {
|
|
307
|
+
var annots = fdf.get('Annots');
|
|
308
|
+
if (annots !== null && typeof annots !== 'undefined' && annots.length > 0) {
|
|
309
|
+
for (var i = 0; i < annots.length; i++) {
|
|
310
|
+
var annot = annots[Number.parseInt(i.toString(), 10)];
|
|
311
|
+
var key = annot.objectNumber.toString() + ' ' + annot.generationNumber.toString();
|
|
312
|
+
if (objects.has(key)) {
|
|
313
|
+
annot = objects.get(key);
|
|
314
|
+
mappedObjects.set(key, annot);
|
|
315
|
+
objects.delete(key);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
objects.delete(rootKey);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
objects.delete('trailer');
|
|
326
|
+
}
|
|
327
|
+
return mappedObjects;
|
|
328
|
+
};
|
|
329
|
+
_FdfDocument.prototype._importField = function () {
|
|
330
|
+
var _this = this;
|
|
331
|
+
var form = this._document.form;
|
|
332
|
+
var count = form.count;
|
|
333
|
+
if (count) {
|
|
334
|
+
this._table.forEach(function (value, key) {
|
|
335
|
+
var textValue;
|
|
336
|
+
if (_this._table.size > 0 && _this._table.has(key)) {
|
|
337
|
+
textValue = _this._table.get(key);
|
|
338
|
+
}
|
|
339
|
+
var index = form._getFieldIndex(key);
|
|
340
|
+
if (index !== -1 && index < count) {
|
|
341
|
+
var field = form.fieldAt(index);
|
|
342
|
+
if (field) {
|
|
343
|
+
if (textValue && textValue !== '') {
|
|
344
|
+
field._dictionary.update('RV', textValue);
|
|
345
|
+
}
|
|
346
|
+
var param = [];
|
|
347
|
+
if (Array.isArray(value)) {
|
|
348
|
+
param = value;
|
|
349
|
+
}
|
|
350
|
+
else {
|
|
351
|
+
param.push(value);
|
|
352
|
+
}
|
|
353
|
+
_this._importFieldData(field, param);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
};
|
|
359
|
+
//#region Export Annotations
|
|
360
|
+
_FdfDocument.prototype._exportAnnotationData = function (document, pageCount) {
|
|
361
|
+
var genNumber = _StringTokenizer._whiteSpace + '0' + _StringTokenizer._whiteSpace;
|
|
362
|
+
var startDictionary = '<<' + '/';
|
|
363
|
+
this.fdfString += '%FDF-1.2' + '\r\n';
|
|
364
|
+
var index = 2;
|
|
365
|
+
var annot = new Array();
|
|
366
|
+
var appearance = this.exportAppearance;
|
|
367
|
+
for (var i = 0; i < pageCount; i++) {
|
|
368
|
+
var page = document.getPage(i);
|
|
369
|
+
if (page !== null && typeof page !== 'undefined' && page.annotations.count > 0) {
|
|
370
|
+
for (var k = 0; k < page.annotations.count; k++) {
|
|
371
|
+
var annotation = page.annotations.at(k);
|
|
372
|
+
if (annotation !== null && typeof annotation !== 'undefined' && !(annotation instanceof PdfFileLinkAnnotation ||
|
|
373
|
+
annotation instanceof PdfTextWebLinkAnnotation || annotation instanceof PdfDocumentLinkAnnotation ||
|
|
374
|
+
annotation instanceof PdfUriAnnotation)) {
|
|
375
|
+
if (annotation instanceof PdfRubberStampAnnotation || annotation instanceof PdfRectangleAnnotation) {
|
|
376
|
+
var value = this._exportAnnotation(annotation, this.fdfString, index, annot, i, true);
|
|
377
|
+
index = value.index;
|
|
378
|
+
annot = value.annot;
|
|
379
|
+
}
|
|
380
|
+
else {
|
|
381
|
+
var value = this._exportAnnotation(annotation, this.fdfString, index, annot, i, appearance);
|
|
382
|
+
index = value.index;
|
|
383
|
+
annot = value.annot;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
if (index !== 2) {
|
|
390
|
+
var root = '1' + genNumber;
|
|
391
|
+
this.fdfString += root + 'obj' + '\r\n' + startDictionary + 'FDF' + startDictionary + 'Annots' + '[';
|
|
392
|
+
for (var i = 0; i < annot.length - 1; i++) {
|
|
393
|
+
this.fdfString += annot[Number.parseInt(i.toString(), 10)] + genNumber + 'R' + ' ';
|
|
394
|
+
}
|
|
395
|
+
this.fdfString += annot[annot.length - 1] + genNumber + 'R' + ']' + '/' + 'F' + '(' + this._fileName + ')' + '/' + 'UF' + '(';
|
|
396
|
+
this.fdfString += this._fileName + ')>>' + '/' + 'Type' + '/' + 'Catalog' + '>>' + '\r\n' + 'endobj' + '\r\n';
|
|
397
|
+
this.fdfString += 'trailer' + '\r\n' + startDictionary + 'Root' + ' ' + root + 'R' + '>>' + '\r\n' + '%%EOF' + '\r\n';
|
|
398
|
+
}
|
|
399
|
+
};
|
|
400
|
+
_FdfDocument.prototype._exportAnnotation = function (annotation, fdfString, index, annot, pageIndex, appearance) {
|
|
401
|
+
this.fdfString = fdfString;
|
|
402
|
+
var helper = new _FdfHelper();
|
|
403
|
+
var dictionary = annotation._dictionary;
|
|
404
|
+
var startObject = _StringTokenizer._whiteSpace + '0' + _StringTokenizer._whiteSpace + 'obj' + '\r\n';
|
|
405
|
+
var endObject = '\r\n' + 'endobj' + '\r\n';
|
|
406
|
+
this._annotationID = index.toString();
|
|
407
|
+
this.fdfString += index + startObject + '<<';
|
|
408
|
+
var list = new Map(); // eslint-disable-line
|
|
409
|
+
var streamReference = new Array();
|
|
410
|
+
annot.push(this._annotationID);
|
|
411
|
+
dictionary.set('Page', pageIndex);
|
|
412
|
+
var annotValue = this._getEntries(list, streamReference, index, dictionary, this.fdfString, appearance);
|
|
413
|
+
index = annotValue.index;
|
|
414
|
+
list = annotValue.list;
|
|
415
|
+
streamReference = annotValue.streamReference;
|
|
416
|
+
delete dictionary._map.Page;
|
|
417
|
+
this.fdfString += '>>' + endObject;
|
|
418
|
+
var _loop_1 = function () {
|
|
419
|
+
var keys = Array();
|
|
420
|
+
list.forEach(function (key, value) {
|
|
421
|
+
keys.push(value);
|
|
422
|
+
});
|
|
423
|
+
for (var i = 0; i < keys.length; i++) {
|
|
424
|
+
var key = keys[Number.parseInt(i.toString(), 10)];
|
|
425
|
+
if (list.get(key) instanceof _PdfDictionary || list.get(key) instanceof _PdfStream ||
|
|
426
|
+
list.get(key) instanceof _PdfFlateStream) {
|
|
427
|
+
if (list.get(key) instanceof _PdfDictionary) {
|
|
428
|
+
dictionary = list.get(key);
|
|
429
|
+
}
|
|
430
|
+
else {
|
|
431
|
+
dictionary = list.get(key).dictionary;
|
|
432
|
+
}
|
|
433
|
+
if (dictionary !== null && typeof dictionary !== 'undefined') {
|
|
434
|
+
if (dictionary instanceof _PdfDictionary && dictionary.has('Type')) {
|
|
435
|
+
var type = dictionary.get('Type');
|
|
436
|
+
if (type !== null && typeof type !== 'undefined' && type.name === 'Annot') {
|
|
437
|
+
annot.push(key.toString());
|
|
438
|
+
dictionary.set('Page', pageIndex);
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
this_1.fdfString += key + startObject + '<<';
|
|
442
|
+
var value = this_1._getEntries(list, streamReference, index, dictionary, this_1.fdfString, appearance);
|
|
443
|
+
list = value.list;
|
|
444
|
+
streamReference = value.streamReference;
|
|
445
|
+
index = value.index;
|
|
446
|
+
if (dictionary instanceof _PdfDictionary && dictionary.has('Page')) {
|
|
447
|
+
delete dictionary._map.Page;
|
|
448
|
+
}
|
|
449
|
+
this_1.fdfString += '>>';
|
|
450
|
+
if (streamReference !== null && typeof streamReference !== 'undefined' && streamReference.indexOf(key) !== -1) {
|
|
451
|
+
this_1._appendStream(list.get(key), this_1.fdfString);
|
|
452
|
+
}
|
|
453
|
+
this_1.fdfString += endObject;
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
list.delete(key);
|
|
457
|
+
}
|
|
458
|
+
};
|
|
459
|
+
var this_1 = this;
|
|
460
|
+
while (list.size > 0) {
|
|
461
|
+
_loop_1();
|
|
462
|
+
}
|
|
463
|
+
index++;
|
|
464
|
+
helper.index = index;
|
|
465
|
+
helper.annot = annot;
|
|
466
|
+
return helper;
|
|
467
|
+
};
|
|
468
|
+
_FdfDocument.prototype._appendStream = function (value, fdfString) {
|
|
469
|
+
var stream = value; // eslint-disable-line
|
|
470
|
+
this.fdfString = fdfString;
|
|
471
|
+
if (value instanceof _PdfFlateStream || value instanceof _PdfStream) {
|
|
472
|
+
if (value instanceof _PdfFlateStream) {
|
|
473
|
+
stream = value.stream;
|
|
474
|
+
}
|
|
475
|
+
else {
|
|
476
|
+
stream = value;
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
if (value instanceof _PdfFlateStream || value instanceof _PdfStream) {
|
|
480
|
+
var byteArray = stream.getBytes();
|
|
481
|
+
var dataArray = new Uint8Array(byteArray);
|
|
482
|
+
var sw = new CompressedStreamWriter();
|
|
483
|
+
sw.write(dataArray, 0, dataArray.length);
|
|
484
|
+
sw.close();
|
|
485
|
+
var compressString = sw.getCompressedString;
|
|
486
|
+
this.fdfString += 'stream' + '\r\n';
|
|
487
|
+
this.fdfString += compressString;
|
|
488
|
+
this.fdfString += '\r\n' + 'endstream';
|
|
489
|
+
}
|
|
490
|
+
};
|
|
491
|
+
_FdfDocument.prototype._getEntries = function (list, // eslint-disable-line
|
|
492
|
+
streamReference, index, dictionary, fdfString, hasAppearance) {
|
|
493
|
+
var _this = this;
|
|
494
|
+
var flag = false;
|
|
495
|
+
var helper = new _FdfHelper();
|
|
496
|
+
this.fdfString = fdfString;
|
|
497
|
+
var listDictionary = list; // eslint-disable-line
|
|
498
|
+
dictionary.forEach(function (key, value) {
|
|
499
|
+
if (!((!hasAppearance && key === 'AP'))) {
|
|
500
|
+
if (key !== 'P') {
|
|
501
|
+
_this.fdfString += '/' + key;
|
|
502
|
+
}
|
|
503
|
+
if (key === 'Sound' || key === 'F' || hasAppearance) {
|
|
504
|
+
flag = true;
|
|
505
|
+
}
|
|
506
|
+
var primitive = value; // eslint-disable-line
|
|
507
|
+
if (typeof primitive === 'string') {
|
|
508
|
+
_this.fdfString += '(' + _this._getFormattedString(primitive) + ')';
|
|
509
|
+
}
|
|
510
|
+
else if (primitive instanceof _PdfName) {
|
|
511
|
+
_this.fdfString += '/' + primitive.name;
|
|
512
|
+
}
|
|
513
|
+
else if (primitive instanceof Array) {
|
|
514
|
+
primitive = primitive; // eslint-disable-line
|
|
515
|
+
var value_1 = _this._appendArray(primitive, _this.fdfString, index, flag, listDictionary, streamReference);
|
|
516
|
+
listDictionary = value_1.list;
|
|
517
|
+
streamReference = value_1.streamReference;
|
|
518
|
+
index = value_1.index;
|
|
519
|
+
}
|
|
520
|
+
else if (typeof primitive === 'number') {
|
|
521
|
+
_this.fdfString += ' ' + primitive.toString();
|
|
522
|
+
}
|
|
523
|
+
else if (typeof primitive === 'boolean') {
|
|
524
|
+
_this.fdfString += ' ' + ((primitive) ? 'true' : 'false');
|
|
525
|
+
}
|
|
526
|
+
else if (primitive instanceof _PdfDictionary) {
|
|
527
|
+
_this.fdfString += '<<';
|
|
528
|
+
primitive = primitive;
|
|
529
|
+
var value_2 = _this._getEntries(listDictionary, streamReference, index, primitive, _this.fdfString, hasAppearance);
|
|
530
|
+
listDictionary = value_2.list;
|
|
531
|
+
streamReference = value_2.streamReference;
|
|
532
|
+
index = value_2.index;
|
|
533
|
+
_this.fdfString += '>>';
|
|
534
|
+
}
|
|
535
|
+
else if (primitive instanceof _PdfReference) {
|
|
536
|
+
var pageNumber = dictionary.get('Page');
|
|
537
|
+
if (key === 'Parent') {
|
|
538
|
+
_this.fdfString += ' ' + _this._annotationID + ' 0 R';
|
|
539
|
+
_this.fdfString += '/Page ' + pageNumber;
|
|
540
|
+
}
|
|
541
|
+
else if (key === 'IRT') {
|
|
542
|
+
if (dictionary.has('NM')) {
|
|
543
|
+
var name_1 = dictionary.get('NM');
|
|
544
|
+
if (name_1 !== null) {
|
|
545
|
+
_this.fdfString += '(' + _this._getFormattedString(name_1) + ')';
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
else if (key !== 'P') {
|
|
550
|
+
var holder = primitive;
|
|
551
|
+
if (holder !== null && typeof holder !== 'undefined') {
|
|
552
|
+
index++;
|
|
553
|
+
_this.fdfString += ' ' + index + ' 0 R';
|
|
554
|
+
if (flag) {
|
|
555
|
+
streamReference.push(index);
|
|
556
|
+
}
|
|
557
|
+
listDictionary.set(index, dictionary.get(key));
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
flag = false;
|
|
562
|
+
}
|
|
563
|
+
});
|
|
564
|
+
helper.list = listDictionary;
|
|
565
|
+
helper.streamReference = streamReference;
|
|
566
|
+
helper.index = index;
|
|
567
|
+
return helper;
|
|
568
|
+
};
|
|
569
|
+
_FdfDocument.prototype._appendArray = function (array, // eslint-disable-line
|
|
570
|
+
fdfString, index, flag, list, // eslint-disable-line
|
|
571
|
+
streamReference) {
|
|
572
|
+
this.fdfString = fdfString;
|
|
573
|
+
this.fdfString += '[';
|
|
574
|
+
var helper = new _FdfHelper();
|
|
575
|
+
var listDictionary = list; // eslint-disable-line
|
|
576
|
+
if (array !== null && array.length > 0) {
|
|
577
|
+
var count = array.length;
|
|
578
|
+
for (var i = 0; i < count; i++) {
|
|
579
|
+
var element = array[Number.parseInt(i.toString(), 10)]; // eslint-disable-line
|
|
580
|
+
if (i !== 0 && (typeof element === 'number' || element instanceof _PdfReference || typeof element === 'boolean')) {
|
|
581
|
+
this.fdfString += ' ';
|
|
582
|
+
}
|
|
583
|
+
var value = this._appendElement(element, this.fdfString, index, flag, listDictionary, streamReference);
|
|
584
|
+
listDictionary = value.list;
|
|
585
|
+
streamReference = value.streamReference;
|
|
586
|
+
index = value.index;
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
this.fdfString += ']';
|
|
590
|
+
helper.list = listDictionary;
|
|
591
|
+
helper.streamReference = streamReference;
|
|
592
|
+
helper.index = index;
|
|
593
|
+
return helper;
|
|
594
|
+
};
|
|
595
|
+
_FdfDocument.prototype._appendElement = function (element, // eslint-disable-line
|
|
596
|
+
fdfString, index, flag, list, // eslint-disable-line
|
|
597
|
+
streamReference) {
|
|
598
|
+
this.fdfString = fdfString;
|
|
599
|
+
var helper = new _FdfHelper();
|
|
600
|
+
var listDictionary = list; // eslint-disable-line
|
|
601
|
+
if (typeof element === 'number') {
|
|
602
|
+
this.fdfString += (element).toString();
|
|
603
|
+
}
|
|
604
|
+
else if (element instanceof _PdfName) {
|
|
605
|
+
this.fdfString += (element.name.toString());
|
|
606
|
+
}
|
|
607
|
+
else if (element instanceof Array) {
|
|
608
|
+
element = element; // eslint-disable-line
|
|
609
|
+
var value = this._appendArray(element, this.fdfString, index, flag, listDictionary, streamReference);
|
|
610
|
+
listDictionary = value.list;
|
|
611
|
+
streamReference = value.streamReference;
|
|
612
|
+
index = value.index;
|
|
613
|
+
}
|
|
614
|
+
else if (element instanceof _PdfDictionary) {
|
|
615
|
+
this.fdfString += '<<';
|
|
616
|
+
element = element;
|
|
617
|
+
var value = this._getEntries(listDictionary, streamReference, index, element, this.fdfString, flag);
|
|
618
|
+
listDictionary = value.list;
|
|
619
|
+
streamReference = value.streamReference;
|
|
620
|
+
index = value.index;
|
|
621
|
+
this.fdfString += '>>';
|
|
622
|
+
}
|
|
623
|
+
helper.list = listDictionary;
|
|
624
|
+
helper.streamReference = streamReference;
|
|
625
|
+
helper.index = index;
|
|
626
|
+
return helper;
|
|
627
|
+
};
|
|
628
|
+
_FdfDocument.prototype._getFormattedString = function (value) {
|
|
629
|
+
var result = '';
|
|
630
|
+
for (var i = 0; i < value.length; i++) {
|
|
631
|
+
var c = value.charCodeAt(i);
|
|
632
|
+
if (c === 40 || c === 41) {
|
|
633
|
+
result += '\'';
|
|
634
|
+
}
|
|
635
|
+
result += String.fromCharCode(c);
|
|
636
|
+
}
|
|
637
|
+
return result;
|
|
638
|
+
};
|
|
639
|
+
//#endregion
|
|
640
|
+
_FdfDocument.prototype._checkFdf = function (element) {
|
|
641
|
+
if (element.includes(this._specialCharacters) || element.includes('âãÃ\u008fÃ\u0093')) {
|
|
642
|
+
this._asPerSpecification = true;
|
|
643
|
+
}
|
|
644
|
+
if (element.startsWith('%')) {
|
|
645
|
+
var token = element.substring(1, 5);
|
|
646
|
+
if (token !== 'FDF-') { // eslint-disable-line
|
|
647
|
+
throw new Error('Invalid FDF file.');
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
};
|
|
651
|
+
_FdfDocument.prototype._stringToHexString = function (text) {
|
|
652
|
+
var hexString = '';
|
|
653
|
+
if (text !== null && typeof text !== 'undefined' && text.length > 0) {
|
|
654
|
+
var bytesValue = _stringToBytes(text);
|
|
655
|
+
hexString = _byteArrayToHexString(bytesValue);
|
|
656
|
+
}
|
|
657
|
+
return hexString;
|
|
658
|
+
};
|
|
659
|
+
return _FdfDocument;
|
|
660
|
+
}(_ExportHelper));
|
|
661
|
+
export { _FdfDocument };
|
|
662
|
+
var _FdfHelper = /** @class */ (function () {
|
|
663
|
+
function _FdfHelper() {
|
|
664
|
+
}
|
|
665
|
+
return _FdfHelper;
|
|
666
|
+
}());
|
|
667
|
+
export { _FdfHelper };
|