@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,1049 @@
|
|
|
1
|
+
import { _PdfStream } from './base-stream';
|
|
2
|
+
import { _PdfDictionary, _PdfReferenceSet, _isCommand, _PdfReference, _PdfName } from './pdf-primitives';
|
|
3
|
+
import { BaseException, FormatError, _escapePdfName, _bytesToString, ParserEndOfFileException, _numberToString, _stringToPdfString } from './utils';
|
|
4
|
+
import { _PdfParser, _PdfLexicalOperator } from './pdf-parser';
|
|
5
|
+
import { _PdfBaseStream } from './base-stream';
|
|
6
|
+
import { PdfCrossReferenceType } from './enumerator';
|
|
7
|
+
import { _MD5, _PdfEncryptor } from './security/encryptor';
|
|
8
|
+
import { CompressedStreamWriter } from '@syncfusion/ej2-compression';
|
|
9
|
+
var _PdfCrossReference = /** @class */ (function () {
|
|
10
|
+
function _PdfCrossReference(document, password) {
|
|
11
|
+
this._version = '';
|
|
12
|
+
this._newLine = '\r\n';
|
|
13
|
+
this._password = password;
|
|
14
|
+
this._document = document;
|
|
15
|
+
this._stream = document._stream;
|
|
16
|
+
this._entries = [];
|
|
17
|
+
this._crossReferencePosition = Object.create(null);
|
|
18
|
+
this._cacheMap = new Map(); // eslint-disable-line
|
|
19
|
+
this._pendingRefs = new _PdfReferenceSet();
|
|
20
|
+
}
|
|
21
|
+
_PdfCrossReference.prototype._setStartXRef = function (startXRef) {
|
|
22
|
+
this._startXRefQueue = [startXRef];
|
|
23
|
+
this._prevStartXref = startXRef;
|
|
24
|
+
};
|
|
25
|
+
_PdfCrossReference.prototype._parse = function (recoveryMode) {
|
|
26
|
+
var trailerDictionary;
|
|
27
|
+
if (!recoveryMode) {
|
|
28
|
+
trailerDictionary = this._readXRef();
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
trailerDictionary = this._indexObjects();
|
|
32
|
+
}
|
|
33
|
+
trailerDictionary.assignXref(this);
|
|
34
|
+
this._nextReferenceNumber = trailerDictionary.get('Size');
|
|
35
|
+
this._trailer = trailerDictionary;
|
|
36
|
+
var encrypt = trailerDictionary.get('Encrypt');
|
|
37
|
+
if (encrypt) {
|
|
38
|
+
this._document._isEncrypted = true;
|
|
39
|
+
this._ids = trailerDictionary.get('ID');
|
|
40
|
+
this._permissionFlags = encrypt.get('P');
|
|
41
|
+
var fileId = this._ids && this._ids.length ? this._ids[0] : '';
|
|
42
|
+
encrypt.suppressEncryption = true;
|
|
43
|
+
this._encrypt = new _PdfEncryptor(encrypt, fileId, this._password);
|
|
44
|
+
this._document._fileStructure._crossReferenceType = PdfCrossReferenceType.stream;
|
|
45
|
+
this._document._isUserPassword = this._encrypt._isUserPassword;
|
|
46
|
+
this._document._encryptOnlyAttachment = this._encrypt._encryptOnlyAttachment;
|
|
47
|
+
if (this._encrypt._encryptOnlyAttachment) {
|
|
48
|
+
this._document._hasUserPasswordOnly = true;
|
|
49
|
+
this._document._encryptMetaData = false;
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
this._document._hasUserPasswordOnly = this._encrypt._hasUserPasswordOnly;
|
|
53
|
+
this._document._encryptMetaData = encrypt.has('EncryptMetadata') ? encrypt.get('EncryptMetadata') : true;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
var hasRoot = false;
|
|
57
|
+
try {
|
|
58
|
+
var root = trailerDictionary.get('Root');
|
|
59
|
+
if (root) {
|
|
60
|
+
var pagesEntry = root.get('Pages');
|
|
61
|
+
if (pagesEntry) {
|
|
62
|
+
this._root = root;
|
|
63
|
+
hasRoot = true;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
catch (ex) {
|
|
68
|
+
throw new BaseException('Invalid cross reference', 'InvalidXRef');
|
|
69
|
+
}
|
|
70
|
+
if (!hasRoot) {
|
|
71
|
+
if (!recoveryMode) {
|
|
72
|
+
throw new BaseException('Invalid cross reference', 'XRefParseException');
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
throw new BaseException('Invalid cross reference', 'InvalidXRef');
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
_PdfCrossReference.prototype._getEntry = function (i) {
|
|
80
|
+
var xrefEntry = this._entries[i]; // eslint-disable-line
|
|
81
|
+
if (xrefEntry && !xrefEntry.free && xrefEntry.offset) {
|
|
82
|
+
return xrefEntry;
|
|
83
|
+
}
|
|
84
|
+
return null;
|
|
85
|
+
};
|
|
86
|
+
_PdfCrossReference.prototype._fetch = function (ref, suppressEncryption) {
|
|
87
|
+
var entry; // eslint-disable-line
|
|
88
|
+
if (!(ref instanceof _PdfReference)) {
|
|
89
|
+
throw new Error('ref object is not a reference');
|
|
90
|
+
}
|
|
91
|
+
var objectNumber = ref.objectNumber;
|
|
92
|
+
var cacheEntry = this._cacheMap.get(ref); // eslint-disable-line
|
|
93
|
+
if (typeof cacheEntry !== 'undefined') {
|
|
94
|
+
if (cacheEntry instanceof _PdfDictionary && !cacheEntry.objId) {
|
|
95
|
+
cacheEntry.objId = objectNumber;
|
|
96
|
+
}
|
|
97
|
+
return cacheEntry;
|
|
98
|
+
}
|
|
99
|
+
var xrefEntry = this._getEntry(objectNumber);
|
|
100
|
+
if (xrefEntry === null) {
|
|
101
|
+
this._cacheMap.set(ref, xrefEntry);
|
|
102
|
+
return xrefEntry;
|
|
103
|
+
}
|
|
104
|
+
if (this._pendingRefs.has(ref)) {
|
|
105
|
+
this._pendingRefs.remove(ref);
|
|
106
|
+
throw new Error('circular reference');
|
|
107
|
+
}
|
|
108
|
+
this._pendingRefs.put(ref);
|
|
109
|
+
try {
|
|
110
|
+
if (xrefEntry.uncompressed) {
|
|
111
|
+
entry = this._fetchUncompressed(ref, xrefEntry, suppressEncryption);
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
entry = this._fetchCompressed(ref, xrefEntry);
|
|
115
|
+
}
|
|
116
|
+
this._pendingRefs.remove(ref);
|
|
117
|
+
}
|
|
118
|
+
catch (ex) {
|
|
119
|
+
this._pendingRefs.remove(ref);
|
|
120
|
+
throw ex;
|
|
121
|
+
}
|
|
122
|
+
return entry;
|
|
123
|
+
};
|
|
124
|
+
_PdfCrossReference.prototype._fetchUncompressed = function (reference, xrefEntry, suppressEncryption) {
|
|
125
|
+
var generationNumber = reference.generationNumber;
|
|
126
|
+
var objectNumber = reference.objectNumber;
|
|
127
|
+
if (xrefEntry.gen !== generationNumber) {
|
|
128
|
+
throw new BaseException("Inconsistent generation in XRef: " + reference, 'XRefEntryException');
|
|
129
|
+
}
|
|
130
|
+
var stream = this._stream.makeSubStream(xrefEntry.offset + this._stream.start, undefined);
|
|
131
|
+
var parser = new _PdfParser(new _PdfLexicalOperator(stream), this, true);
|
|
132
|
+
var obj1 = parser.getObject();
|
|
133
|
+
var obj2 = parser.getObject();
|
|
134
|
+
var obj3 = parser.getObject();
|
|
135
|
+
if (obj1 !== objectNumber || obj2 !== generationNumber || typeof obj3 === 'undefined') {
|
|
136
|
+
throw new BaseException("Bad (uncompressed) XRef entry: " + reference, 'XRefEntryException');
|
|
137
|
+
}
|
|
138
|
+
var entry; // eslint-disable-line
|
|
139
|
+
if (this._encrypt && !suppressEncryption) {
|
|
140
|
+
entry = parser.getObject(this._encrypt._createCipherTransform(reference.objectNumber, reference.generationNumber));
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
entry = parser.getObject();
|
|
144
|
+
}
|
|
145
|
+
if (!(entry instanceof _PdfBaseStream)) {
|
|
146
|
+
this._cacheMap.set(reference, entry);
|
|
147
|
+
}
|
|
148
|
+
if (entry instanceof _PdfDictionary) {
|
|
149
|
+
entry.objId = reference.toString();
|
|
150
|
+
}
|
|
151
|
+
else if (entry instanceof _PdfBaseStream) {
|
|
152
|
+
entry.dictionary.objId = reference.toString();
|
|
153
|
+
}
|
|
154
|
+
return entry;
|
|
155
|
+
};
|
|
156
|
+
_PdfCrossReference.prototype._fetchCompressed = function (ref, xrefEntry) {
|
|
157
|
+
var tableOffset = xrefEntry.offset;
|
|
158
|
+
var stream = this._fetch(_PdfReference.get(tableOffset, 0));
|
|
159
|
+
if (typeof stream === 'undefined') {
|
|
160
|
+
throw new FormatError('bad ObjStm stream');
|
|
161
|
+
}
|
|
162
|
+
var first = stream.dictionary.get('First');
|
|
163
|
+
var n = stream.dictionary.get('N');
|
|
164
|
+
var gen = ref.generationNumber;
|
|
165
|
+
if (!Number.isInteger(first) || !Number.isInteger(n)) {
|
|
166
|
+
throw new FormatError('invalid first and n parameters for ObjStm stream');
|
|
167
|
+
}
|
|
168
|
+
var parser = new _PdfParser(new _PdfLexicalOperator(stream), this, true);
|
|
169
|
+
var nums = new Array(n);
|
|
170
|
+
var offsets = new Array(n);
|
|
171
|
+
for (var i = 0; i < n; ++i) {
|
|
172
|
+
var value = parser.getObject();
|
|
173
|
+
if (!Number.isInteger(value)) {
|
|
174
|
+
throw new FormatError("invalid object number in the ObjStm stream: " + value);
|
|
175
|
+
}
|
|
176
|
+
var offset = parser.getObject();
|
|
177
|
+
if (!Number.isInteger(offset)) {
|
|
178
|
+
throw new FormatError("invalid object offset in the ObjStm stream: " + offset);
|
|
179
|
+
}
|
|
180
|
+
nums[i] = value; // eslint-disable-line
|
|
181
|
+
offsets[i] = offset; // eslint-disable-line
|
|
182
|
+
}
|
|
183
|
+
var start = (stream.start || 0) + first;
|
|
184
|
+
var entries = new Array(n); // eslint-disable-line
|
|
185
|
+
for (var i = 0; i < n; ++i) {
|
|
186
|
+
var length_1 = (i < n - 1 ? (offsets[i + 1] - offsets[i]) : undefined); // eslint-disable-line
|
|
187
|
+
if (length_1 < 0) {
|
|
188
|
+
throw new FormatError('Invalid offset in the ObjStm stream.');
|
|
189
|
+
}
|
|
190
|
+
parser = new _PdfParser(new _PdfLexicalOperator(stream.makeSubStream(start + offsets[i], length_1, stream.dictionary)), this, true); // eslint-disable-line
|
|
191
|
+
var obj = parser.getObject(); // eslint-disable-line
|
|
192
|
+
entries[i] = obj; // eslint-disable-line
|
|
193
|
+
if (obj instanceof _PdfBaseStream) {
|
|
194
|
+
continue;
|
|
195
|
+
}
|
|
196
|
+
var value = nums[i]; // eslint-disable-line
|
|
197
|
+
var entry = this._entries[value]; // eslint-disable-line
|
|
198
|
+
if (entry && entry.offset === tableOffset && entry.gen === i) {
|
|
199
|
+
var objId = value + " " + gen;
|
|
200
|
+
this._cacheMap.set(_PdfReference.get(value, gen), obj);
|
|
201
|
+
if (obj instanceof _PdfDictionary) {
|
|
202
|
+
obj.objId = objId;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
var result = entries[xrefEntry.gen]; // eslint-disable-line
|
|
207
|
+
if (typeof result === 'undefined') {
|
|
208
|
+
throw new BaseException("Bad (compressed) XRef entry: " + ref, 'XRefEntryException');
|
|
209
|
+
}
|
|
210
|
+
return result;
|
|
211
|
+
};
|
|
212
|
+
_PdfCrossReference.prototype._readXRef = function (recoveryMode) {
|
|
213
|
+
if (recoveryMode === void 0) { recoveryMode = false; }
|
|
214
|
+
var stream = this._stream;
|
|
215
|
+
var startXRefParsedCache = new Set();
|
|
216
|
+
try {
|
|
217
|
+
while (this._startXRefQueue.length) {
|
|
218
|
+
var startXRef = this._startXRefQueue[0];
|
|
219
|
+
if (this._prevStartXref < startXRef) {
|
|
220
|
+
this._prevStartXref = startXRef;
|
|
221
|
+
}
|
|
222
|
+
if (startXRefParsedCache.has(startXRef)) {
|
|
223
|
+
this._startXRefQueue.shift();
|
|
224
|
+
continue;
|
|
225
|
+
}
|
|
226
|
+
startXRefParsedCache.add(startXRef);
|
|
227
|
+
stream.position = startXRef + stream.start;
|
|
228
|
+
var parser = new _PdfParser(new _PdfLexicalOperator(stream), this, true);
|
|
229
|
+
var obj = parser.getObject(); // eslint-disable-line
|
|
230
|
+
var dictionary = void 0;
|
|
231
|
+
if (_isCommand(obj, 'xref')) {
|
|
232
|
+
if (typeof this._document._fileStructure._crossReferenceType === 'undefined') {
|
|
233
|
+
this._document._fileStructure._crossReferenceType = PdfCrossReferenceType.table;
|
|
234
|
+
}
|
|
235
|
+
dictionary = this._processXRefTable(parser);
|
|
236
|
+
if (!this._topDictionary) {
|
|
237
|
+
this._topDictionary = dictionary;
|
|
238
|
+
}
|
|
239
|
+
obj = dictionary.get('XRefStm');
|
|
240
|
+
if (Number.isInteger(obj)) {
|
|
241
|
+
var position = obj; // eslint-disable-line
|
|
242
|
+
if (!(position in this._crossReferencePosition)) {
|
|
243
|
+
this._crossReferencePosition[position] = 1; // eslint-disable-line
|
|
244
|
+
this._startXRefQueue.push(position);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
else if (Number.isInteger(obj)) {
|
|
249
|
+
if (typeof this._document._fileStructure._crossReferenceType === 'undefined') {
|
|
250
|
+
this._document._fileStructure._crossReferenceType = PdfCrossReferenceType.stream;
|
|
251
|
+
}
|
|
252
|
+
var gen = parser.getObject();
|
|
253
|
+
var command = parser.getObject();
|
|
254
|
+
obj = parser.getObject();
|
|
255
|
+
if (typeof gen === 'undefined' ||
|
|
256
|
+
!Number.isInteger(gen) ||
|
|
257
|
+
!_isCommand(command, 'obj') ||
|
|
258
|
+
!(obj instanceof _PdfBaseStream)) {
|
|
259
|
+
throw new FormatError('Invalid cross reference stream');
|
|
260
|
+
}
|
|
261
|
+
dictionary = this._processXRefStream(obj);
|
|
262
|
+
if (!this._topDictionary) {
|
|
263
|
+
this._topDictionary = dictionary;
|
|
264
|
+
}
|
|
265
|
+
if (!dictionary) {
|
|
266
|
+
throw new FormatError('Failed to read XRef stream');
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
else {
|
|
270
|
+
throw new FormatError('Invalid XRef stream header');
|
|
271
|
+
}
|
|
272
|
+
obj = dictionary.get('Prev');
|
|
273
|
+
if (Number.isInteger(obj)) {
|
|
274
|
+
this._startXRefQueue.push(obj);
|
|
275
|
+
}
|
|
276
|
+
else if (obj instanceof _PdfReference) {
|
|
277
|
+
this._startXRefQueue.push(obj.objectNumber);
|
|
278
|
+
}
|
|
279
|
+
this._startXRefQueue.shift();
|
|
280
|
+
}
|
|
281
|
+
return this._topDictionary;
|
|
282
|
+
}
|
|
283
|
+
catch (e) {
|
|
284
|
+
this._startXRefQueue.shift();
|
|
285
|
+
}
|
|
286
|
+
if (recoveryMode) {
|
|
287
|
+
return undefined;
|
|
288
|
+
}
|
|
289
|
+
throw new BaseException('Invalid cross reference', 'XRefParseException');
|
|
290
|
+
};
|
|
291
|
+
_PdfCrossReference.prototype._readToken = function (data, offset) {
|
|
292
|
+
var lf = 0xa;
|
|
293
|
+
var cr = 0xd;
|
|
294
|
+
var lt = 0x3c;
|
|
295
|
+
var token = '';
|
|
296
|
+
var ch = data[offset]; // eslint-disable-line
|
|
297
|
+
while (ch !== lf && ch !== cr && ch !== lt) {
|
|
298
|
+
if (++offset >= data.length) {
|
|
299
|
+
break;
|
|
300
|
+
}
|
|
301
|
+
token += String.fromCharCode(ch);
|
|
302
|
+
ch = data[offset]; // eslint-disable-line
|
|
303
|
+
}
|
|
304
|
+
return token;
|
|
305
|
+
};
|
|
306
|
+
_PdfCrossReference.prototype._skipUntil = function (data, offset, what) {
|
|
307
|
+
var length = what.length;
|
|
308
|
+
var dataLength = data.length;
|
|
309
|
+
var skipped = 0;
|
|
310
|
+
while (offset < dataLength) {
|
|
311
|
+
var i = 0;
|
|
312
|
+
while (i < length && data[offset + i] === what[i]) { // eslint-disable-line
|
|
313
|
+
++i;
|
|
314
|
+
}
|
|
315
|
+
if (i >= length) {
|
|
316
|
+
break;
|
|
317
|
+
}
|
|
318
|
+
offset++;
|
|
319
|
+
skipped++;
|
|
320
|
+
}
|
|
321
|
+
return skipped;
|
|
322
|
+
};
|
|
323
|
+
_PdfCrossReference.prototype._indexObjects = function () {
|
|
324
|
+
var tab = 0x9;
|
|
325
|
+
var lf = 0xa;
|
|
326
|
+
var cr = 0xd;
|
|
327
|
+
var space = 0x20;
|
|
328
|
+
var percent = 0x25;
|
|
329
|
+
var objRegExp = /^(\d+)\s+(\d+)\s+obj\b/;
|
|
330
|
+
var endobjRegExp = /\bendobj[\b\s]$/;
|
|
331
|
+
var nestedObjRegExp = /\s+(\d+\s+\d+\s+obj[\b\s<])$/;
|
|
332
|
+
var checkContentLength = 25;
|
|
333
|
+
var trailerBytes = new Uint8Array([116, 114, 97, 105, 108, 101, 114]);
|
|
334
|
+
var startxrefBytes = new Uint8Array([115, 116, 97, 114, 116, 120, 114, 101, 102]);
|
|
335
|
+
var objBytes = new Uint8Array([111, 98, 106]);
|
|
336
|
+
var xrefBytes = new Uint8Array([47, 88, 82, 101, 102]);
|
|
337
|
+
this._entries.length = 0;
|
|
338
|
+
this._cacheMap.clear();
|
|
339
|
+
var stream = this._stream;
|
|
340
|
+
stream.position = 0;
|
|
341
|
+
var buffer = stream.getBytes();
|
|
342
|
+
var length = buffer.length;
|
|
343
|
+
var position = stream.start;
|
|
344
|
+
var trailers = [];
|
|
345
|
+
var crossReferencePosition = [];
|
|
346
|
+
while (position < length) {
|
|
347
|
+
var ch = buffer[position]; // eslint-disable-line
|
|
348
|
+
if (ch === tab || ch === lf || ch === cr || ch === space) {
|
|
349
|
+
++position;
|
|
350
|
+
continue;
|
|
351
|
+
}
|
|
352
|
+
if (ch === percent) {
|
|
353
|
+
do {
|
|
354
|
+
++position;
|
|
355
|
+
if (position >= length) {
|
|
356
|
+
break;
|
|
357
|
+
}
|
|
358
|
+
ch = buffer[position]; // eslint-disable-line
|
|
359
|
+
} while (ch !== lf && ch !== cr);
|
|
360
|
+
continue;
|
|
361
|
+
}
|
|
362
|
+
var token = this._readToken(buffer, position);
|
|
363
|
+
var m = void 0; // eslint-disable-line
|
|
364
|
+
if (token.startsWith('xref') && (token.length === 4 || /\s/.test(token[4]))) {
|
|
365
|
+
position += this._skipUntil(buffer, position, trailerBytes);
|
|
366
|
+
trailers.push(position);
|
|
367
|
+
position += this._skipUntil(buffer, position, startxrefBytes);
|
|
368
|
+
}
|
|
369
|
+
else {
|
|
370
|
+
m = objRegExp.exec(token);
|
|
371
|
+
if (m) {
|
|
372
|
+
var objectNumber = Number.parseInt(m[1]) | 0; // eslint-disable-line
|
|
373
|
+
var gen = Number.parseInt(m[2]) | 0; // eslint-disable-line
|
|
374
|
+
var contentLength = void 0;
|
|
375
|
+
var startPos = position + token.length;
|
|
376
|
+
var updateEntries = false;
|
|
377
|
+
if (!this._entries[objectNumber]) { // eslint-disable-line
|
|
378
|
+
updateEntries = true;
|
|
379
|
+
}
|
|
380
|
+
else if (this._entries[objectNumber].gen === gen) { // eslint-disable-line
|
|
381
|
+
try {
|
|
382
|
+
var subStream = stream.makeSubStream(startPos, stream.length - startPos);
|
|
383
|
+
var lexicalOperator = new _PdfLexicalOperator(subStream);
|
|
384
|
+
var parser = new _PdfParser(lexicalOperator, null);
|
|
385
|
+
parser.getObject();
|
|
386
|
+
updateEntries = true;
|
|
387
|
+
}
|
|
388
|
+
catch (ex) {
|
|
389
|
+
updateEntries = !(ex instanceof ParserEndOfFileException);
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
if (updateEntries) {
|
|
393
|
+
var info = new _PdfObjectInformation();
|
|
394
|
+
info.offset = position - stream.start;
|
|
395
|
+
info.gen = gen;
|
|
396
|
+
info.uncompressed = true;
|
|
397
|
+
this._entries[objectNumber] = info; // eslint-disable-line
|
|
398
|
+
}
|
|
399
|
+
while (startPos < buffer.length) {
|
|
400
|
+
var endPos = startPos + this._skipUntil(buffer, startPos, objBytes) + 4;
|
|
401
|
+
contentLength = endPos - position;
|
|
402
|
+
var checkPos = Math.max(endPos - checkContentLength, startPos);
|
|
403
|
+
var tokenStr = _bytesToString(buffer.subarray(checkPos, endPos));
|
|
404
|
+
if (endobjRegExp.test(tokenStr)) {
|
|
405
|
+
break;
|
|
406
|
+
}
|
|
407
|
+
else {
|
|
408
|
+
var objToken = nestedObjRegExp.exec(tokenStr); // eslint-disable-line
|
|
409
|
+
if (objToken && objToken[1]) {
|
|
410
|
+
contentLength -= objToken[1].length;
|
|
411
|
+
break;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
startPos = endPos;
|
|
415
|
+
}
|
|
416
|
+
var content = buffer.subarray(position, position + contentLength);
|
|
417
|
+
var xrefTagOffset = this._skipUntil(content, 0, xrefBytes);
|
|
418
|
+
if (xrefTagOffset < contentLength && content[xrefTagOffset + 5] < 64) {
|
|
419
|
+
crossReferencePosition.push(position - stream.start);
|
|
420
|
+
this._crossReferencePosition[position - stream.start] = 1;
|
|
421
|
+
}
|
|
422
|
+
position += contentLength;
|
|
423
|
+
}
|
|
424
|
+
else if (token.startsWith('trailer') && (token.length === 7 || /\s/.test(token[7]))) {
|
|
425
|
+
trailers.push(position);
|
|
426
|
+
position += this._skipUntil(buffer, position, startxrefBytes);
|
|
427
|
+
}
|
|
428
|
+
else {
|
|
429
|
+
position += token.length + 1;
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
for (var i = 0; i < crossReferencePosition.length; ++i) {
|
|
434
|
+
this._startXRefQueue.push(crossReferencePosition[i]); // eslint-disable-line
|
|
435
|
+
this._readXRef(true);
|
|
436
|
+
}
|
|
437
|
+
var trailerDict;
|
|
438
|
+
for (var i = 0; i < trailers.length; ++i) {
|
|
439
|
+
stream.position = trailers[i]; // eslint-disable-line
|
|
440
|
+
var parser = new _PdfParser(new _PdfLexicalOperator(stream), this, true, true);
|
|
441
|
+
var obj = parser.getObject(); // eslint-disable-line
|
|
442
|
+
if (!_isCommand(obj, 'trailer')) {
|
|
443
|
+
continue;
|
|
444
|
+
}
|
|
445
|
+
var dictionary = parser.getObject(); // eslint-disable-line
|
|
446
|
+
if (!(dictionary instanceof _PdfDictionary)) {
|
|
447
|
+
continue;
|
|
448
|
+
}
|
|
449
|
+
try {
|
|
450
|
+
var rootDict = dictionary.get('Root'); // eslint-disable-line
|
|
451
|
+
if (!(rootDict instanceof _PdfDictionary)) {
|
|
452
|
+
continue;
|
|
453
|
+
}
|
|
454
|
+
var pagesDict = rootDict.get('Pages'); // eslint-disable-line
|
|
455
|
+
if (!(pagesDict instanceof _PdfDictionary)) {
|
|
456
|
+
continue;
|
|
457
|
+
}
|
|
458
|
+
var pagesCount = pagesDict.get('Count');
|
|
459
|
+
if (typeof pagesCount === 'undefined' || !Number.isInteger(pagesCount)) {
|
|
460
|
+
continue;
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
catch (ex) {
|
|
464
|
+
continue;
|
|
465
|
+
}
|
|
466
|
+
if (dictionary.has('ID')) {
|
|
467
|
+
return dictionary;
|
|
468
|
+
}
|
|
469
|
+
trailerDict = dictionary;
|
|
470
|
+
}
|
|
471
|
+
if (trailerDict) {
|
|
472
|
+
return trailerDict;
|
|
473
|
+
}
|
|
474
|
+
if (this._topDictionary) {
|
|
475
|
+
return this._topDictionary;
|
|
476
|
+
}
|
|
477
|
+
throw new BaseException('Invalid PDF structure.', 'InvalidPDFException');
|
|
478
|
+
};
|
|
479
|
+
_PdfCrossReference.prototype._processXRefTable = function (parser) {
|
|
480
|
+
if (typeof this._tableState === 'undefined') {
|
|
481
|
+
var tableState = new _PdfCrossTableState();
|
|
482
|
+
tableState.entryNum = 0;
|
|
483
|
+
tableState.streamPos = parser.lexicalOperator.stream.position;
|
|
484
|
+
tableState.parserBuf1 = parser.first;
|
|
485
|
+
tableState.parserBuf2 = parser.second;
|
|
486
|
+
this._tableState = tableState;
|
|
487
|
+
}
|
|
488
|
+
var obj = this._readXRefTable(parser);
|
|
489
|
+
if (!_isCommand(obj, 'trailer')) {
|
|
490
|
+
throw new FormatError('Invalid XRef table: could not find trailer dictionary');
|
|
491
|
+
}
|
|
492
|
+
var topDictionary = parser.getObject(); // eslint-disable-line
|
|
493
|
+
var dictionary;
|
|
494
|
+
if (topDictionary) {
|
|
495
|
+
if (topDictionary instanceof _PdfDictionary) {
|
|
496
|
+
dictionary = topDictionary;
|
|
497
|
+
}
|
|
498
|
+
else if (topDictionary instanceof _PdfBaseStream && topDictionary.dictionary) {
|
|
499
|
+
dictionary = topDictionary.dictionary;
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
if (!dictionary) {
|
|
503
|
+
throw new FormatError('Invalid cross reference: could not parse trailer dictionary');
|
|
504
|
+
}
|
|
505
|
+
this._tableState = undefined;
|
|
506
|
+
return dictionary;
|
|
507
|
+
};
|
|
508
|
+
_PdfCrossReference.prototype._readXRefTable = function (parser) {
|
|
509
|
+
var stream = parser.lexicalOperator.stream;
|
|
510
|
+
stream.position = this._tableState.streamPos;
|
|
511
|
+
parser.first = this._tableState.parserBuf1;
|
|
512
|
+
parser.second = this._tableState.parserBuf2;
|
|
513
|
+
var obj; // eslint-disable-line
|
|
514
|
+
while (true) { // eslint-disable-line
|
|
515
|
+
if (typeof this._tableState.firstEntryNum === 'undefined' || typeof this._tableState.entryCount === 'undefined') {
|
|
516
|
+
obj = parser.getObject();
|
|
517
|
+
if (_isCommand(obj, 'trailer')) {
|
|
518
|
+
break;
|
|
519
|
+
}
|
|
520
|
+
this._tableState.firstEntryNum = obj;
|
|
521
|
+
this._tableState.entryCount = parser.getObject();
|
|
522
|
+
}
|
|
523
|
+
var first = this._tableState.firstEntryNum;
|
|
524
|
+
var count = this._tableState.entryCount;
|
|
525
|
+
if (!Number.isInteger(first) || !Number.isInteger(count)) {
|
|
526
|
+
throw new FormatError('Invalid cross reference: wrong types in subsection header');
|
|
527
|
+
}
|
|
528
|
+
for (var i = this._tableState.entryNum; i < count; i++) {
|
|
529
|
+
this._tableState.streamPos = stream.position;
|
|
530
|
+
this._tableState.entryNum = i;
|
|
531
|
+
this._tableState.parserBuf1 = parser.first;
|
|
532
|
+
this._tableState.parserBuf2 = parser.second;
|
|
533
|
+
var entry = new _PdfObjectInformation();
|
|
534
|
+
entry.offset = parser.getObject();
|
|
535
|
+
entry.gen = parser.getObject();
|
|
536
|
+
var type = parser.getObject();
|
|
537
|
+
if (type) {
|
|
538
|
+
switch (type.command) {
|
|
539
|
+
case 'f':
|
|
540
|
+
entry.free = true;
|
|
541
|
+
break;
|
|
542
|
+
case 'n':
|
|
543
|
+
entry.uncompressed = true;
|
|
544
|
+
break;
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
if (!Number.isInteger(entry.offset) || !Number.isInteger(entry.gen) || !(entry.free || entry.uncompressed)) {
|
|
548
|
+
throw new FormatError("Invalid entry in cross reference subsection: " + first + ", " + count);
|
|
549
|
+
}
|
|
550
|
+
if (i === 0 && entry.free && first === 1) {
|
|
551
|
+
first = 0;
|
|
552
|
+
}
|
|
553
|
+
if (!this._entries[i + first]) {
|
|
554
|
+
this._entries[i + first] = entry;
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
this._tableState.entryNum = 0;
|
|
558
|
+
this._tableState.streamPos = stream.position;
|
|
559
|
+
this._tableState.parserBuf1 = parser.first;
|
|
560
|
+
this._tableState.parserBuf2 = parser.second;
|
|
561
|
+
this._tableState.firstEntryNum = undefined;
|
|
562
|
+
this._tableState.entryCount = undefined;
|
|
563
|
+
}
|
|
564
|
+
if (this._entries[0] && !this._entries[0].free) {
|
|
565
|
+
throw new FormatError('Invalid XRef table: unexpected first object');
|
|
566
|
+
}
|
|
567
|
+
return obj;
|
|
568
|
+
};
|
|
569
|
+
_PdfCrossReference.prototype._processXRefStream = function (stream) {
|
|
570
|
+
if (typeof this._streamState === 'undefined') {
|
|
571
|
+
var streamParameters = stream.dictionary;
|
|
572
|
+
var streamState = new _PdfStreamState();
|
|
573
|
+
var index = streamParameters.getArray('Index');
|
|
574
|
+
if (!index) {
|
|
575
|
+
index = [0, streamParameters.get('Size')];
|
|
576
|
+
}
|
|
577
|
+
streamState.entryRanges = index;
|
|
578
|
+
streamState.byteWidths = streamParameters.getArray('W');
|
|
579
|
+
streamState.entryNum = 0;
|
|
580
|
+
streamState.streamPos = stream.position;
|
|
581
|
+
this._streamState = streamState;
|
|
582
|
+
}
|
|
583
|
+
this._readXRefStream(stream);
|
|
584
|
+
this._streamState = undefined;
|
|
585
|
+
return stream.dictionary;
|
|
586
|
+
};
|
|
587
|
+
_PdfCrossReference.prototype._readXRefStream = function (stream) {
|
|
588
|
+
stream.position = this._streamState.streamPos;
|
|
589
|
+
var typeFieldWidth = this._streamState.byteWidths[0];
|
|
590
|
+
var offsetFieldWidth = this._streamState.byteWidths[1];
|
|
591
|
+
var generationFieldWidth = this._streamState.byteWidths[2];
|
|
592
|
+
var entryRanges = this._streamState.entryRanges;
|
|
593
|
+
while (entryRanges.length > 0) {
|
|
594
|
+
var first = entryRanges[0];
|
|
595
|
+
var n = entryRanges[1];
|
|
596
|
+
if (!Number.isInteger(first) || !Number.isInteger(n)) {
|
|
597
|
+
throw new FormatError("Invalid XRef range fields: " + first + ", " + n);
|
|
598
|
+
}
|
|
599
|
+
if (!Number.isInteger(typeFieldWidth) || !Number.isInteger(offsetFieldWidth) || !Number.isInteger(generationFieldWidth)) {
|
|
600
|
+
throw new FormatError("Invalid XRef entry fields length: " + first + ", " + n);
|
|
601
|
+
}
|
|
602
|
+
for (var i = this._streamState.entryNum; i < n; ++i) {
|
|
603
|
+
this._streamState.entryNum = i;
|
|
604
|
+
this._streamState.streamPos = stream.position;
|
|
605
|
+
var type = 0;
|
|
606
|
+
var offset = 0;
|
|
607
|
+
var generation = 0;
|
|
608
|
+
for (var j = 0; j < typeFieldWidth; ++j) {
|
|
609
|
+
var typeByte = stream.getByte();
|
|
610
|
+
if (typeByte === -1) {
|
|
611
|
+
throw new FormatError('invalid cross reference byte width type.');
|
|
612
|
+
}
|
|
613
|
+
type = (type << 8) | typeByte;
|
|
614
|
+
}
|
|
615
|
+
if (typeFieldWidth === 0) {
|
|
616
|
+
type = 1;
|
|
617
|
+
}
|
|
618
|
+
for (var j = 0; j < offsetFieldWidth; ++j) {
|
|
619
|
+
var offsetByte = stream.getByte();
|
|
620
|
+
if (offsetByte === -1) {
|
|
621
|
+
throw new FormatError('invalid cross reference byte width offset.');
|
|
622
|
+
}
|
|
623
|
+
offset = (offset << 8) | offsetByte;
|
|
624
|
+
}
|
|
625
|
+
for (var j = 0; j < generationFieldWidth; ++j) {
|
|
626
|
+
var generationByte = stream.getByte();
|
|
627
|
+
if (generationByte === -1) {
|
|
628
|
+
throw new FormatError('invalid cross reference byte width generation.');
|
|
629
|
+
}
|
|
630
|
+
generation = (generation << 8) | generationByte;
|
|
631
|
+
}
|
|
632
|
+
var entry = new _PdfObjectInformation();
|
|
633
|
+
entry.offset = offset;
|
|
634
|
+
entry.gen = generation;
|
|
635
|
+
switch (type) {
|
|
636
|
+
case 0:
|
|
637
|
+
entry.free = true;
|
|
638
|
+
break;
|
|
639
|
+
case 1:
|
|
640
|
+
entry.uncompressed = true;
|
|
641
|
+
break;
|
|
642
|
+
case 2:
|
|
643
|
+
break;
|
|
644
|
+
default:
|
|
645
|
+
throw new FormatError("Invalid XRef entry type: " + type);
|
|
646
|
+
}
|
|
647
|
+
if (!this._entries[first + i]) {
|
|
648
|
+
this._entries[first + i] = entry;
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
this._streamState.entryNum = 0;
|
|
652
|
+
this._streamState.streamPos = stream.position;
|
|
653
|
+
entryRanges.splice(0, 2);
|
|
654
|
+
}
|
|
655
|
+
};
|
|
656
|
+
_PdfCrossReference.prototype._getCatalogObj = function () {
|
|
657
|
+
return this._root;
|
|
658
|
+
};
|
|
659
|
+
_PdfCrossReference.prototype._save = function () {
|
|
660
|
+
var _this = this;
|
|
661
|
+
var currentLength = this._stream.length;
|
|
662
|
+
var buffer = [this._newLine.charCodeAt(0), this._newLine.charCodeAt(1), 37, 80, 68, 70, 45];
|
|
663
|
+
this._writeString("" + this._version + this._newLine, buffer);
|
|
664
|
+
buffer.push(0x25, 0x83, 0x92, 0xfa, 0xfe);
|
|
665
|
+
this._writeString(this._newLine, buffer);
|
|
666
|
+
var updatedCount = 0;
|
|
667
|
+
var uncompressedCount = 0;
|
|
668
|
+
if (this._document._fileStructure._crossReferenceType === PdfCrossReferenceType.stream) {
|
|
669
|
+
var data = [];
|
|
670
|
+
var updatedStream_1 = [];
|
|
671
|
+
var archiveXRef_1 = '';
|
|
672
|
+
var indexes_1 = [];
|
|
673
|
+
indexes_1.push(0, 1);
|
|
674
|
+
var collection_1 = [];
|
|
675
|
+
var uncompressedOffsets_1 = [];
|
|
676
|
+
this._cacheMap.forEach(function (value, key) {
|
|
677
|
+
var dictionary;
|
|
678
|
+
if (value instanceof _PdfBaseStream) {
|
|
679
|
+
dictionary = value.dictionary;
|
|
680
|
+
}
|
|
681
|
+
if (dictionary && dictionary._updated && (!dictionary.isCatalog || _this._allowCatalog)) {
|
|
682
|
+
indexes_1.push(key.objectNumber, 1);
|
|
683
|
+
uncompressedOffsets_1.push(currentLength + buffer.length);
|
|
684
|
+
var cipher_1;
|
|
685
|
+
if (_this._encrypt) {
|
|
686
|
+
cipher_1 = _this._encrypt._createCipherTransform(key.objectNumber, key.generationNumber);
|
|
687
|
+
}
|
|
688
|
+
_this._writeObject(value, buffer, key, cipher_1);
|
|
689
|
+
uncompressedCount++;
|
|
690
|
+
dictionary._updated = false;
|
|
691
|
+
}
|
|
692
|
+
});
|
|
693
|
+
this._cacheMap.forEach(function (value, key) {
|
|
694
|
+
if (value instanceof _PdfDictionary) {
|
|
695
|
+
if (value._updated && (!value.isCatalog || _this._allowCatalog)) {
|
|
696
|
+
archiveXRef_1 += key.objectNumber + " " + updatedStream_1.length + _this._newLine;
|
|
697
|
+
collection_1.push(key.objectNumber, 1);
|
|
698
|
+
updatedCount++;
|
|
699
|
+
_this._writeObject(value, updatedStream_1);
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
else if (value instanceof _PdfBaseStream) {
|
|
703
|
+
var dictionary = value.dictionary;
|
|
704
|
+
if (dictionary && dictionary._updated && (!dictionary.isCatalog || _this._allowCatalog)) {
|
|
705
|
+
indexes_1.push(key.objectNumber, 1);
|
|
706
|
+
uncompressedOffsets_1.push(currentLength + buffer.length);
|
|
707
|
+
_this._writeObject(value, buffer, key);
|
|
708
|
+
uncompressedCount++;
|
|
709
|
+
dictionary._updated = false;
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
});
|
|
713
|
+
for (var i = 0; i < collection_1.length; i++) {
|
|
714
|
+
indexes_1.push(collection_1[parseInt(i.toString(), 10)]);
|
|
715
|
+
}
|
|
716
|
+
var archiveOffset = void 0;
|
|
717
|
+
var archiveRef = void 0;
|
|
718
|
+
if (updatedCount > 0) {
|
|
719
|
+
archiveRef = this._getNextReference();
|
|
720
|
+
indexes_1.push(archiveRef.objectNumber, 2);
|
|
721
|
+
this._writeString(archiveXRef_1, data);
|
|
722
|
+
this._writeBytes(updatedStream_1, data);
|
|
723
|
+
var newDict = new _PdfDictionary(this);
|
|
724
|
+
newDict.set('Type', _PdfName.get('ObjStm'));
|
|
725
|
+
newDict.set('N', updatedCount);
|
|
726
|
+
newDict.set('First', archiveXRef_1.length);
|
|
727
|
+
newDict.set('Length', data.length);
|
|
728
|
+
var archiveStream = new _PdfStream(data, newDict, 0, data.length);
|
|
729
|
+
archiveOffset = currentLength + buffer.length;
|
|
730
|
+
var cipher_2;
|
|
731
|
+
if (this._encrypt) {
|
|
732
|
+
cipher_2 = this._encrypt._createCipherTransform(archiveRef.objectNumber, archiveRef.generationNumber);
|
|
733
|
+
}
|
|
734
|
+
this._writeObject(archiveStream, buffer, archiveRef, cipher_2);
|
|
735
|
+
}
|
|
736
|
+
var newRef = this._getNextReference();
|
|
737
|
+
var newStartXref = currentLength + buffer.length;
|
|
738
|
+
var newXref = new _PdfDictionary(this);
|
|
739
|
+
newXref.set('Type', _PdfName.get('XRef'));
|
|
740
|
+
newXref.set('Index', indexes_1);
|
|
741
|
+
newXref.set('W', [1, 3, 1]);
|
|
742
|
+
this._copyTrailer(newXref);
|
|
743
|
+
if (this._ids && this._ids.length > 0) {
|
|
744
|
+
newXref.update('ID', [this._ids[0], this._computeMessageDigest(newStartXref)]);
|
|
745
|
+
}
|
|
746
|
+
var newXrefData = [];
|
|
747
|
+
this._writeLong(0, 1, newXrefData);
|
|
748
|
+
this._writeLong(1, 3, newXrefData);
|
|
749
|
+
this._writeLong(-1, 1, newXrefData);
|
|
750
|
+
if (uncompressedCount > 0) {
|
|
751
|
+
for (var index = 0; index < uncompressedCount; index++) {
|
|
752
|
+
this._writeLong(1, 1, newXrefData);
|
|
753
|
+
this._writeLong(uncompressedOffsets_1[index], 3, newXrefData); // eslint-disable-line
|
|
754
|
+
this._writeLong(0, 1, newXrefData);
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
if (updatedCount > 0) {
|
|
758
|
+
for (var index = 0; index < updatedCount; index++) {
|
|
759
|
+
this._writeLong(2, 1, newXrefData);
|
|
760
|
+
this._writeLong(archiveRef.objectNumber, 3, newXrefData);
|
|
761
|
+
this._writeLong(index, 1, newXrefData);
|
|
762
|
+
}
|
|
763
|
+
this._writeLong(1, 1, newXrefData);
|
|
764
|
+
this._writeLong(archiveOffset, 3, newXrefData);
|
|
765
|
+
this._writeLong(0, 1, newXrefData);
|
|
766
|
+
}
|
|
767
|
+
this._writeLong(1, 1, newXrefData);
|
|
768
|
+
this._writeLong(newStartXref, 3, newXrefData);
|
|
769
|
+
this._writeLong(0, 1, newXrefData);
|
|
770
|
+
newXref.set('Length', newXrefData.length);
|
|
771
|
+
var newXrefStream = new _PdfStream(newXrefData, newXref, 0, newXrefData.length);
|
|
772
|
+
var cipher = void 0;
|
|
773
|
+
if (this._encrypt) {
|
|
774
|
+
cipher = this._encrypt._createCipherTransform(newRef.objectNumber, newRef.generationNumber);
|
|
775
|
+
}
|
|
776
|
+
this._writeObject(newXrefStream, buffer, newRef, cipher, true);
|
|
777
|
+
this._writeString("startxref" + this._newLine + newStartXref + this._newLine + "%%EOF" + this._newLine, buffer);
|
|
778
|
+
}
|
|
779
|
+
else {
|
|
780
|
+
var tempBuffer_1 = '';
|
|
781
|
+
this._cacheMap.forEach(function (value, key) {
|
|
782
|
+
var dictionary;
|
|
783
|
+
if (value instanceof _PdfDictionary) {
|
|
784
|
+
dictionary = value;
|
|
785
|
+
}
|
|
786
|
+
else if (value instanceof _PdfBaseStream) {
|
|
787
|
+
dictionary = value.dictionary;
|
|
788
|
+
}
|
|
789
|
+
if (dictionary && dictionary._updated && (!dictionary.isCatalog || _this._allowCatalog)) {
|
|
790
|
+
var offsetString = (currentLength + buffer.length).toString();
|
|
791
|
+
while (offsetString.length < 10) {
|
|
792
|
+
offsetString = '0' + offsetString;
|
|
793
|
+
}
|
|
794
|
+
var genString = key.generationNumber.toString();
|
|
795
|
+
while (genString.length < 5) {
|
|
796
|
+
genString = '0' + genString;
|
|
797
|
+
}
|
|
798
|
+
tempBuffer_1 += key.objectNumber + " 1" + _this._newLine + offsetString + " " + genString + " n" + _this._newLine;
|
|
799
|
+
updatedCount++;
|
|
800
|
+
_this._writeObject(value, buffer, key);
|
|
801
|
+
}
|
|
802
|
+
});
|
|
803
|
+
var newStartXref = buffer.length + currentLength;
|
|
804
|
+
this._writeString("xref" + this._newLine + "0 1" + this._newLine + "0000000000 65535 f" + this._newLine, buffer);
|
|
805
|
+
if (updatedCount > 0) {
|
|
806
|
+
this._writeString(tempBuffer_1, buffer);
|
|
807
|
+
}
|
|
808
|
+
this._writeString("trailer" + this._newLine, buffer);
|
|
809
|
+
var newXref = new _PdfDictionary(this);
|
|
810
|
+
this._copyTrailer(newXref);
|
|
811
|
+
this._writeDictionary(newXref, buffer, this._newLine);
|
|
812
|
+
this._writeString("startxref" + this._newLine + newStartXref + this._newLine + "%%EOF" + this._newLine, buffer);
|
|
813
|
+
}
|
|
814
|
+
var array = new Uint8Array(this._stream.length + buffer.length);
|
|
815
|
+
array.set(this._stream.bytes);
|
|
816
|
+
array.set(buffer, this._stream.length);
|
|
817
|
+
return array;
|
|
818
|
+
};
|
|
819
|
+
_PdfCrossReference.prototype._copyTrailer = function (newXref) {
|
|
820
|
+
newXref.set('Size', this._nextReferenceNumber);
|
|
821
|
+
newXref.set('Prev', this._prevStartXref);
|
|
822
|
+
var root = this._trailer.getRaw('Root'); // eslint-disable-line
|
|
823
|
+
if (typeof root !== 'undefined' && root !== null) {
|
|
824
|
+
newXref.set('Root', root);
|
|
825
|
+
}
|
|
826
|
+
var info = this._trailer.getRaw('Info'); // eslint-disable-line
|
|
827
|
+
if (typeof info !== 'undefined' && info !== null) {
|
|
828
|
+
newXref.set('Info', info);
|
|
829
|
+
}
|
|
830
|
+
var encrypt = this._trailer.getRaw('Encrypt'); // eslint-disable-line
|
|
831
|
+
if (typeof encrypt !== 'undefined' && encrypt !== null) {
|
|
832
|
+
newXref.set('Encrypt', encrypt);
|
|
833
|
+
}
|
|
834
|
+
};
|
|
835
|
+
_PdfCrossReference.prototype._computeMessageDigest = function (size) {
|
|
836
|
+
var _this = this;
|
|
837
|
+
var time = Math.floor(Date.now() / 1000);
|
|
838
|
+
var buffer = [time.toString(), '', size.toString()];
|
|
839
|
+
var info = this._trailer.getRaw('Info');
|
|
840
|
+
var crossReferenceInfo = new _PdfDictionary();
|
|
841
|
+
if (info && info instanceof _PdfDictionary) {
|
|
842
|
+
info.forEach(function (key, value) {
|
|
843
|
+
if (value && typeof value === 'string') {
|
|
844
|
+
crossReferenceInfo.set(key, _stringToPdfString(value));
|
|
845
|
+
}
|
|
846
|
+
});
|
|
847
|
+
}
|
|
848
|
+
crossReferenceInfo.forEach(function (key, value) {
|
|
849
|
+
buffer.push(value);
|
|
850
|
+
});
|
|
851
|
+
var array = [];
|
|
852
|
+
buffer.forEach(function (str) {
|
|
853
|
+
_this._writeString(str, array);
|
|
854
|
+
});
|
|
855
|
+
return _bytesToString((new _MD5().hash(new Uint8Array(array))));
|
|
856
|
+
};
|
|
857
|
+
_PdfCrossReference.prototype._getNextReference = function () {
|
|
858
|
+
var reference = new _PdfReference(this._nextReferenceNumber++, 0);
|
|
859
|
+
reference._isNew = true;
|
|
860
|
+
return reference;
|
|
861
|
+
};
|
|
862
|
+
_PdfCrossReference.prototype._writeObject = function (obj, buffer, reference, transform, isCrossReference) {
|
|
863
|
+
if (reference && reference instanceof _PdfReference) {
|
|
864
|
+
this._writeString(reference.objectNumber + " " + reference.generationNumber + " obj" + this._newLine, buffer);
|
|
865
|
+
}
|
|
866
|
+
if (obj instanceof _PdfDictionary) {
|
|
867
|
+
this._writeDictionary(obj, buffer, this._newLine, transform, isCrossReference);
|
|
868
|
+
}
|
|
869
|
+
else if (obj instanceof _PdfBaseStream) {
|
|
870
|
+
this._writeStream(obj, buffer, transform, isCrossReference);
|
|
871
|
+
}
|
|
872
|
+
if (reference && reference instanceof _PdfReference) {
|
|
873
|
+
this._writeString("endobj" + this._newLine, buffer);
|
|
874
|
+
}
|
|
875
|
+
};
|
|
876
|
+
_PdfCrossReference.prototype._writeDictionary = function (dictionary, buffer, spaceChar, transform, isCrossReference) {
|
|
877
|
+
var _this = this;
|
|
878
|
+
if (dictionary._currentObj) {
|
|
879
|
+
dictionary._currentObj._beginSave();
|
|
880
|
+
}
|
|
881
|
+
if (dictionary._isFont) {
|
|
882
|
+
this._writeFontDictionary(dictionary);
|
|
883
|
+
}
|
|
884
|
+
this._writeString("<<" + spaceChar, buffer);
|
|
885
|
+
dictionary.forEach(function (key, value) {
|
|
886
|
+
_this._writeString("/" + _escapePdfName(key) + " ", buffer);
|
|
887
|
+
_this._writeValue(value, buffer, transform, isCrossReference);
|
|
888
|
+
_this._writeString(spaceChar, buffer);
|
|
889
|
+
});
|
|
890
|
+
this._writeString(">>" + this._newLine, buffer);
|
|
891
|
+
};
|
|
892
|
+
_PdfCrossReference.prototype._writeFontDictionary = function (dictionary) {
|
|
893
|
+
if (dictionary.has('DescendantFonts')) {
|
|
894
|
+
var fonts = dictionary.get('DescendantFonts'); // eslint-disable-line
|
|
895
|
+
var reference = this._getNextReference();
|
|
896
|
+
this._cacheMap.set(reference, fonts);
|
|
897
|
+
dictionary.update('DescendantFonts', [reference]);
|
|
898
|
+
}
|
|
899
|
+
if (dictionary.has('ToUnicode')) {
|
|
900
|
+
var fonts = dictionary.get('ToUnicode'); // eslint-disable-line
|
|
901
|
+
var reference = this._getNextReference();
|
|
902
|
+
this._cacheMap.set(reference, fonts);
|
|
903
|
+
dictionary.update('ToUnicode', reference);
|
|
904
|
+
}
|
|
905
|
+
if (dictionary.has('FontFile2')) {
|
|
906
|
+
var fonts = dictionary.get('FontFile2'); // eslint-disable-line
|
|
907
|
+
var reference = this._getNextReference();
|
|
908
|
+
this._cacheMap.set(reference, fonts);
|
|
909
|
+
dictionary.update('FontFile2', reference);
|
|
910
|
+
}
|
|
911
|
+
if (dictionary.has('FontDescriptor')) {
|
|
912
|
+
var fonts = dictionary.get('FontDescriptor'); // eslint-disable-line
|
|
913
|
+
var reference = this._getNextReference();
|
|
914
|
+
this._cacheMap.set(reference, fonts);
|
|
915
|
+
dictionary.update('FontDescriptor', reference);
|
|
916
|
+
}
|
|
917
|
+
};
|
|
918
|
+
_PdfCrossReference.prototype._writeStream = function (stream, buffer, transform, isCrossReference) {
|
|
919
|
+
var streamBuffer = [];
|
|
920
|
+
var value = stream.getString();
|
|
921
|
+
if (!isCrossReference) {
|
|
922
|
+
var byteArray = [];
|
|
923
|
+
for (var i = 0; i < value.length; i++) {
|
|
924
|
+
byteArray.push(value.charCodeAt(i));
|
|
925
|
+
}
|
|
926
|
+
if (stream._isCompress) {
|
|
927
|
+
var dataArray = new Uint8Array(byteArray);
|
|
928
|
+
var sw = new CompressedStreamWriter();
|
|
929
|
+
sw.write(dataArray, 0, dataArray.length);
|
|
930
|
+
sw.close();
|
|
931
|
+
value = sw.getCompressedString;
|
|
932
|
+
stream.dictionary.update('Filter', _PdfName.get('FlateDecode'));
|
|
933
|
+
}
|
|
934
|
+
if (transform) {
|
|
935
|
+
value = transform.encryptString(value);
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
this._writeString(value, streamBuffer);
|
|
939
|
+
stream.dictionary.update('Length', streamBuffer.length);
|
|
940
|
+
this._writeDictionary(stream.dictionary, buffer, this._newLine, transform, isCrossReference);
|
|
941
|
+
this._writeString("stream" + this._newLine, buffer);
|
|
942
|
+
this._writeBytes(streamBuffer, buffer);
|
|
943
|
+
this._writeString(this._newLine + "endstream" + this._newLine, buffer);
|
|
944
|
+
};
|
|
945
|
+
_PdfCrossReference.prototype._writeValue = function (value, buffer, transform, isCrossReference) {
|
|
946
|
+
if (value instanceof _PdfName) {
|
|
947
|
+
this._writeString("/" + value.name, buffer);
|
|
948
|
+
}
|
|
949
|
+
else if (value instanceof _PdfReference) {
|
|
950
|
+
this._writeString(value.toString() + " R", buffer);
|
|
951
|
+
}
|
|
952
|
+
else if (Array.isArray(value)) {
|
|
953
|
+
this._writeString('[', buffer);
|
|
954
|
+
var first = true;
|
|
955
|
+
for (var _i = 0, value_1 = value; _i < value_1.length; _i++) {
|
|
956
|
+
var val = value_1[_i];
|
|
957
|
+
if (!first) {
|
|
958
|
+
this._writeString(' ', buffer);
|
|
959
|
+
}
|
|
960
|
+
else {
|
|
961
|
+
first = false;
|
|
962
|
+
}
|
|
963
|
+
this._writeValue(val, buffer, transform, isCrossReference);
|
|
964
|
+
}
|
|
965
|
+
this._writeString(']', buffer);
|
|
966
|
+
}
|
|
967
|
+
else if (typeof value === 'string') {
|
|
968
|
+
if (!isCrossReference && transform) {
|
|
969
|
+
value = transform.encryptString(value);
|
|
970
|
+
}
|
|
971
|
+
this._writeString("(" + this._escapeString(value) + ")", buffer);
|
|
972
|
+
}
|
|
973
|
+
else if (typeof value === 'number') {
|
|
974
|
+
this._writeString(_numberToString(value), buffer);
|
|
975
|
+
}
|
|
976
|
+
else if (typeof value === 'boolean') {
|
|
977
|
+
this._writeString(value.toString(), buffer);
|
|
978
|
+
}
|
|
979
|
+
else if (value instanceof _PdfDictionary) {
|
|
980
|
+
this._writeDictionary(value, buffer, this._newLine, transform, isCrossReference);
|
|
981
|
+
}
|
|
982
|
+
else if (value instanceof _PdfBaseStream) {
|
|
983
|
+
this._writeStream(value, buffer, transform, isCrossReference);
|
|
984
|
+
}
|
|
985
|
+
else if (value === null) {
|
|
986
|
+
this._writeString('null', buffer);
|
|
987
|
+
}
|
|
988
|
+
};
|
|
989
|
+
_PdfCrossReference.prototype._writeString = function (value, buffer) {
|
|
990
|
+
for (var i = 0; i < value.length; i++) {
|
|
991
|
+
buffer.push(value.charCodeAt(i) & 0xff);
|
|
992
|
+
}
|
|
993
|
+
};
|
|
994
|
+
_PdfCrossReference.prototype._writeBytes = function (data, buffer) {
|
|
995
|
+
for (var i = 0; i < data.length; i++) {
|
|
996
|
+
buffer.push(data[i]); // eslint-disable-line
|
|
997
|
+
}
|
|
998
|
+
};
|
|
999
|
+
_PdfCrossReference.prototype._writeLong = function (value, count, buffer) {
|
|
1000
|
+
for (var i = count - 1; i >= 0; --i) {
|
|
1001
|
+
buffer.push(value >> (i << 3) & 0xff);
|
|
1002
|
+
}
|
|
1003
|
+
};
|
|
1004
|
+
_PdfCrossReference.prototype._escapeString = function (value) {
|
|
1005
|
+
return value.replace(/([()\\\n\r])/g, function (substring) {
|
|
1006
|
+
if (substring === '\n') {
|
|
1007
|
+
return '\\n';
|
|
1008
|
+
}
|
|
1009
|
+
else if (substring === '\r') {
|
|
1010
|
+
return '\\r';
|
|
1011
|
+
}
|
|
1012
|
+
return "\\" + substring;
|
|
1013
|
+
});
|
|
1014
|
+
};
|
|
1015
|
+
_PdfCrossReference.prototype._destroy = function () {
|
|
1016
|
+
this._entries = undefined;
|
|
1017
|
+
this._pendingRefs.clear();
|
|
1018
|
+
this._pendingRefs = undefined;
|
|
1019
|
+
this._cacheMap.clear();
|
|
1020
|
+
this._pendingRefs = undefined;
|
|
1021
|
+
this._root = undefined;
|
|
1022
|
+
this._startXRefQueue = [];
|
|
1023
|
+
this._startXRefQueue = undefined;
|
|
1024
|
+
this._stream = undefined;
|
|
1025
|
+
this._streamState = undefined;
|
|
1026
|
+
this._tableState = undefined;
|
|
1027
|
+
this._topDictionary = undefined;
|
|
1028
|
+
this._trailer = undefined;
|
|
1029
|
+
this._version = undefined;
|
|
1030
|
+
this._crossReferencePosition = undefined;
|
|
1031
|
+
};
|
|
1032
|
+
return _PdfCrossReference;
|
|
1033
|
+
}());
|
|
1034
|
+
export { _PdfCrossReference };
|
|
1035
|
+
var _PdfObjectInformation = /** @class */ (function () {
|
|
1036
|
+
function _PdfObjectInformation() {
|
|
1037
|
+
}
|
|
1038
|
+
return _PdfObjectInformation;
|
|
1039
|
+
}());
|
|
1040
|
+
var _PdfCrossTableState = /** @class */ (function () {
|
|
1041
|
+
function _PdfCrossTableState() {
|
|
1042
|
+
}
|
|
1043
|
+
return _PdfCrossTableState;
|
|
1044
|
+
}());
|
|
1045
|
+
var _PdfStreamState = /** @class */ (function () {
|
|
1046
|
+
function _PdfStreamState() {
|
|
1047
|
+
}
|
|
1048
|
+
return _PdfStreamState;
|
|
1049
|
+
}());
|