scanbot-web-sdk 6.0.0-dev.1 → 6.0.0-dev.3
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/@types/barcode-scanner-view.d.ts +10 -10
- package/@types/consume-type.d.ts +8 -0
- package/@types/core/bridge/common.d.ts +24 -0
- package/@types/core/bridge/compiled/BarcodeConfigs.d.ts +973 -0
- package/@types/core/bridge/compiled/BarcodeScannerTypes.d.ts +185 -0
- package/@types/core/bridge/compiled/BarcodeTypes.d.ts +183 -0
- package/@types/core/bridge/compiled/CheckRecognizerTypes.d.ts +29 -0
- package/@types/core/bridge/compiled/CommonFieldType.d.ts +59 -0
- package/@types/core/bridge/compiled/DocumentDetectorTypes.d.ts +196 -0
- package/@types/core/bridge/compiled/DocumentQualityAnalyzerTypes.d.ts +105 -0
- package/@types/core/bridge/compiled/EhicTypes.d.ts +218 -0
- package/@types/core/bridge/compiled/FrameUtilities.d.ts +18 -0
- package/@types/core/bridge/compiled/GDRTypes.d.ts +38 -0
- package/@types/core/bridge/compiled/GenericDocument.d.ts +236 -0
- package/@types/core/bridge/compiled/GenericDocumentRecognizerConfigs.d.ts +183 -0
- package/@types/core/bridge/compiled/GenericDocumentRecognizerTypes.d.ts +105 -0
- package/@types/core/bridge/compiled/GenericDocumentTypes.d.ts +38 -0
- package/@types/core/bridge/compiled/GenericTextLineScannerTypes.d.ts +165 -0
- package/@types/core/bridge/compiled/Geometry.d.ts +49 -0
- package/@types/core/bridge/compiled/ImageProcessorTypes.d.ts +13 -0
- package/@types/core/bridge/compiled/LicensePlateScannerTypes.d.ts +67 -0
- package/@types/core/bridge/compiled/MRZTypes.d.ts +52 -0
- package/@types/core/bridge/compiled/MedicalCertificateTypes.d.ts +306 -0
- package/@types/core/bridge/compiled/OcrElements.d.ts +129 -0
- package/@types/core/bridge/compiled/ParametricFilters.d.ts +188 -0
- package/@types/core/bridge/compiled/PdfConfig.d.ts +197 -0
- package/@types/core/bridge/compiled/TiffTypes.d.ts +183 -0
- package/@types/core/bridge/utils.d.ts +7 -0
- package/@types/core/bridge/worker-bridge.d.ts +920 -0
- package/@types/core/worker/ScanbotSDK.Core-simd-threads.d.ts +0 -0
- package/@types/core/worker/ScanbotSDK.Core-simd.d.ts +0 -0
- package/@types/core/worker/ScanbotSDK.Core.d.ts +86 -0
- package/@types/core-types.d.ts +25 -0
- package/@types/cropping-view.d.ts +4 -2
- package/@types/document-scanner-view.d.ts +7 -5
- package/@types/generic-document-recognizer-view.d.ts +22 -0
- package/@types/index.d.ts +49 -21
- package/@types/interfaces/i-document-scanner-handle.d.ts +2 -2
- package/@types/interfaces/i-generic-document-recognizer-scanner-handle.d.ts +3 -0
- package/@types/model/barcode/barcode-result.d.ts +16 -8
- package/@types/model/barcode/barcode.d.ts +4 -14
- package/@types/model/camera-info.d.ts +3 -2
- package/@types/model/configuration/barcode-scanner-configuration.d.ts +15 -8
- package/@types/model/configuration/cropping-view-configuration.d.ts +7 -1
- package/@types/model/configuration/document-scanner-configuration.d.ts +6 -27
- package/@types/model/configuration/generic-document-recognizer-configuration.d.ts +9 -0
- package/@types/model/configuration/initialization-options.d.ts +10 -1
- package/@types/model/configuration/mrz-scanner-configuration.d.ts +4 -3
- package/@types/model/configuration/scanner-configuration.d.ts +8 -0
- package/@types/model/configuration/selection-overlay-configuration.d.ts +4 -4
- package/@types/model/configuration/text-data-scanner-configuration.d.ts +3 -6
- package/@types/model/configuration/view-finder-scanner-configuration.d.ts +3 -2
- package/@types/model/configuration/vin-scanner-configuration.d.ts +2 -1
- package/@types/model/error/media-error.d.ts +1 -0
- package/@types/model/response/cropping-result.d.ts +2 -1
- package/@types/scanbot-sdk.d.ts +510 -28
- package/@types/service/document-quality-analyzer.d.ts +7 -5
- package/@types/service/generic-document-recognizer.d.ts +13 -0
- package/@types/service/ocr-engine.d.ts +8 -5
- package/@types/service/pdf-generator.d.ts +7 -95
- package/@types/service/public-utils.d.ts +1 -1
- package/@types/service/simple-mrz-recognizer.d.ts +7 -5
- package/@types/service/text-data-recognizer.d.ts +7 -4
- package/@types/service/tiff-generator.d.ts +12 -10
- package/@types/ui2/common.d.ts +8 -0
- package/@types/ui2/configuration/ActionBarConfiguration.d.ts +30 -30
- package/@types/ui2/configuration/ArTrackingOverlayConfiguration.d.ts +220 -220
- package/@types/ui2/configuration/BarcodeInfoMapping.d.ts +52 -52
- package/@types/ui2/configuration/BarcodeItemMapper.d.ts +2 -2
- package/@types/ui2/configuration/BarcodeRecognizerConfiguration.d.ts +38 -181
- package/@types/ui2/configuration/BarcodeScannerConfiguration.d.ts +172 -188
- package/@types/ui2/configuration/BarcodeScannerTypes.d.ts +1 -0
- package/@types/ui2/configuration/BarcodeScannerUIResult.d.ts +29 -0
- package/@types/ui2/configuration/BarcodeTextLocalization.d.ts +102 -107
- package/@types/ui2/configuration/BarcodeTypes.d.ts +1 -0
- package/@types/ui2/configuration/BarcodeUseCase.d.ts +5 -1
- package/@types/ui2/configuration/CameraConfiguration.d.ts +44 -45
- package/@types/ui2/configuration/CameraPermission.d.ts +33 -48
- package/@types/ui2/configuration/Common.d.ts +190 -227
- package/@types/ui2/configuration/CommonFieldType.d.ts +1 -0
- package/@types/ui2/configuration/FindAndPickScanningModeUseCase.d.ts +366 -14
- package/@types/ui2/configuration/GenericDocument.d.ts +1 -0
- package/@types/ui2/configuration/Geometry.d.ts +1 -0
- package/@types/ui2/configuration/MultipleScanningModeUseCase.d.ts +489 -489
- package/@types/ui2/configuration/ScanbotAlertDialog.d.ts +27 -27
- package/@types/ui2/configuration/SingleScanningModeUseCase.d.ts +170 -170
- package/@types/ui2/configuration/TopBarConfiguration.d.ts +36 -52
- package/@types/ui2/configuration/UserGuidanceConfiguration.d.ts +16 -16
- package/@types/ui2/configuration/ViewFinderConfiguration.d.ts +49 -46
- package/@types/ui2/configuration.d.ts +3 -2
- package/@types/ui2/controllers/barcode-scanner-controller.d.ts +2 -2
- package/@types/ui2/controllers/multiple-scanning-mode-controller.d.ts +6 -3
- package/@types/ui2/controllers/single-scanning-mode-controller.d.ts +6 -3
- package/@types/ui2/model/counted-barcodes.d.ts +17 -23
- package/@types/ui2/scanbot-sdk-ui.d.ts +2 -2
- package/@types/ui2/scanbot-ui-library.d.ts +3 -2
- package/@types/ui2/utils/barcode-mapper/expected-barcode-mapper.d.ts +13 -0
- package/@types/ui2/utils/barcode-mapper/i-barcode-mapper.d.ts +18 -0
- package/@types/ui2/utils/{barcode-mapper.d.ts → barcode-mapper/user-barcode-mapper.d.ts} +11 -11
- package/@types/ui2/utils/camera-config.d.ts +2 -2
- package/@types/ui2/utils/find-and-pick.ts/expected-barcode-counter.d.ts +7 -0
- package/@types/ui2/utils/styled-badge.d.ts +1 -1
- package/@types/ui2/utils/styled-input.d.ts +1 -1
- package/@types/ui2/views/action-button/action-button-container.d.ts +2 -0
- package/@types/ui2/views/ar/ar-badge.d.ts +18 -0
- package/@types/ui2/views/ar/ar-overlay-barcode-info.d.ts +5 -1
- package/@types/ui2/views/ar/vertical-positions.d.ts +12 -0
- package/@types/ui2/views/barcode-info/barcode-info.d.ts +3 -1
- package/@types/ui2/views/barcode-scanner.d.ts +6 -5
- package/@types/ui2/views/dialog/base/confirmation-dialog.d.ts +20 -0
- package/@types/ui2/views/dialog/find-and-pick-submit-dialog.d.ts +10 -0
- package/@types/ui2/views/drawer/barcode-result-drawer.d.ts +1 -1
- package/@types/ui2/views/drawer/counting-button.d.ts +1 -1
- package/@types/ui2/views/drawer/subviews/barcode-drawer-empty-state.d.ts +1 -1
- package/@types/ui2/views/drawer/subviews/barcode-list-item.d.ts +5 -4
- package/@types/ui2/views/drawer/subviews/barcode-list.d.ts +8 -1
- package/@types/ui2/views/drawer/subviews/drawer-header-content.d.ts +1 -1
- package/@types/ui2/views/form/dialog-button.d.ts +2 -2
- package/@types/utils/barcode-utils.d.ts +10 -0
- package/@types/utils/browser-cameras.d.ts +92 -0
- package/@types/utils/dto/MagneticLine.d.ts +4 -4
- package/@types/utils/dto/Point.d.ts +2 -2
- package/@types/utils/dto/Polygon.d.ts +2 -1
- package/@types/utils/image-utils.d.ts +1 -0
- package/@types/utils/react/usePromise.d.ts +3 -1
- package/@types/utils/stats.d.ts +4 -0
- package/@types/utils/utils.d.ts +1 -1
- package/@types/utils/video-stream.d.ts +4 -3
- package/@types/utils/video-to-image-data/two-d-video-to-image-data.d.ts +8 -0
- package/@types/utils/video-to-image-data/video-to-image-data.d.ts +5 -0
- package/@types/utils/video-to-image-data/webgl-video-to-image-data.d.ts +21 -0
- package/@types/view/action-bar/bottom-action-bar.d.ts +2 -2
- package/@types/view/barcode-calculation/barcode-calculation-popup-list.d.ts +2 -2
- package/@types/view/barcode-calculation/barcode-calculation-popup.d.ts +4 -4
- package/@types/view/barcode-calculation/scanned-image-with-overlay.d.ts +2 -2
- package/@types/view/barcode-polygon/animated-barcode-selection-overlay.d.ts +7 -5
- package/@types/view/barcode-polygon/barcode-overlay.d.ts +3 -3
- package/@types/view/barcode-polygon/barcode-polygon-label.d.ts +2 -2
- package/@types/view/cropping/draggable-base-container.d.ts +8 -2
- package/@types/view/cropping/draggable-handles-component.d.ts +9 -2
- package/@types/view/scanbot-camera-view.d.ts +9 -3
- package/@types/view/view-finder.d.ts +1 -0
- package/@types/worker/worker-bridge.d.ts +906 -5
- package/Libraries.txt +307 -174
- package/README.md +3 -3
- package/bundle/ScanbotSDK.min.js +5 -5
- package/bundle/ScanbotSDK.ui2.min.js +108 -161
- package/bundle/ScanbotSDK.ui2.min.js.LICENSE.txt +0 -18
- package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd-threads.js +1 -1
- package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd-threads.wasm +0 -0
- package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd.wasm +0 -0
- package/bundle/bin/barcode-scanner/ScanbotSDK.Asm.wasm +0 -0
- package/bundle/bin/barcode-scanner/ScanbotSDK.Core-simd-threads.js +1 -1
- package/bundle/bin/barcode-scanner/ScanbotSDK.Core-simd.js +1 -1
- package/bundle/bin/barcode-scanner/ScanbotSDK.Core.js +1 -1
- package/bundle/bin/complete/ScanbotSDK.Asm-simd-threads.js +1 -1
- package/bundle/bin/complete/ScanbotSDK.Asm-simd-threads.wasm +0 -0
- package/bundle/bin/complete/ScanbotSDK.Asm-simd.wasm +0 -0
- package/bundle/bin/complete/ScanbotSDK.Asm.wasm +0 -0
- package/bundle/bin/complete/ScanbotSDK.Core-simd-threads.js +1 -1
- package/bundle/bin/complete/ScanbotSDK.Core-simd.js +1 -1
- package/bundle/bin/complete/ScanbotSDK.Core.js +1 -1
- package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd-threads.js +1 -1
- package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd-threads.wasm +0 -0
- package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd.wasm +0 -0
- package/bundle/bin/document-scanner/ScanbotSDK.Asm.wasm +0 -0
- package/bundle/bin/document-scanner/ScanbotSDK.Core-simd-threads.js +1 -1
- package/bundle/bin/document-scanner/ScanbotSDK.Core-simd.js +1 -1
- package/bundle/bin/document-scanner/ScanbotSDK.Core.js +1 -1
- package/package.json +4 -3
- package/ui.d.ts +3 -0
- package/ui.js +2 -0
- package/webpack/fileLoader.js +3 -5
- package/@types/core/compiled/ParametricFilters.d.ts +0 -181
- package/@types/core/utils.d.ts +0 -1
- package/@types/core/worker-bridge.d.ts +0 -20
- package/@types/model/barcode/barcode-format.d.ts +0 -1
- package/@types/model/barcode/engine-mode.d.ts +0 -1
- package/@types/model/configuration/document-quality-analyzer-configuration.d.ts +0 -13
- package/@types/model/document/contour-detection-result.d.ts +0 -11
- package/@types/model/document/detection-status.d.ts +0 -11
- package/@types/model/document/document-detection-result.d.ts +0 -8
- package/@types/model/filter-types.d.ts +0 -6
- package/@types/model/generic-text-line-recognizer/text-data-scanner-result.d.ts +0 -6
- package/@types/model/mrz/mrz-result.d.ts +0 -41
- package/@types/model/response/document-quality-analyzer-result.d.ts +0 -8
- package/@types/service/image-processor.d.ts +0 -35
- package/@types/ui2/configuration/BarcodeItem.d.ts +0 -30
- package/@types/ui2/configuration/BarcodeResult.d.ts +0 -14
- package/@types/ui2/configuration/utils.d.ts +0 -6
- package/@types/utils/networking.d.ts +0 -7
- package/bundle/bin/barcode-scanner/ScanbotSDK.Asm.wasm-webpack-file-loader +0 -0
- package/bundle/bin/complete/ScanbotSDK.Asm-simd-threads.wasm-webpack-file-loader +0 -0
- package/bundle/bin/complete/ScanbotSDK.Asm-simd.wasm-webpack-file-loader +0 -0
- package/bundle/bin/complete/ScanbotSDK.Asm.wasm-webpack-file-loader +0 -0
- package/bundle/bin/document-scanner/ScanbotSDK.Asm.wasm-webpack-file-loader +0 -0
- /package/@types/ui2/views/dialog/{styled-dialog.d.ts → base/styled-dialog.d.ts} +0 -0
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { DeepPartial, PartiallyConstructible } from "../common";
|
|
2
|
+
/**
|
|
3
|
+
PDF attributes
|
|
4
|
+
*/
|
|
5
|
+
export declare class PdfAttributes extends PartiallyConstructible {
|
|
6
|
+
/**
|
|
7
|
+
Author
|
|
8
|
+
@defaultValue "Created with ❤️ with Scanbot SDK";
|
|
9
|
+
*/
|
|
10
|
+
readonly author: string;
|
|
11
|
+
/**
|
|
12
|
+
Creator
|
|
13
|
+
@defaultValue "";
|
|
14
|
+
*/
|
|
15
|
+
readonly creator: string;
|
|
16
|
+
/**
|
|
17
|
+
Title
|
|
18
|
+
@defaultValue "";
|
|
19
|
+
*/
|
|
20
|
+
readonly title: string;
|
|
21
|
+
/**
|
|
22
|
+
Subject
|
|
23
|
+
@defaultValue "";
|
|
24
|
+
*/
|
|
25
|
+
readonly subject: string;
|
|
26
|
+
/**
|
|
27
|
+
Keywords
|
|
28
|
+
@defaultValue "";
|
|
29
|
+
*/
|
|
30
|
+
readonly keywords: string;
|
|
31
|
+
/** @param source {@displayType `DeepPartial<PdfAttributes>`} */
|
|
32
|
+
constructor(source?: DeepPartial<PdfAttributes>);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
Page size
|
|
36
|
+
|
|
37
|
+
- `LETTER`:
|
|
38
|
+
8.5 x 11 (inches) 612 x 792 (pixels) at 72 DPI
|
|
39
|
+
- `LEGAL`:
|
|
40
|
+
8.5 x 14 (inches) 612 x 1008 (pixels) at 72 DPI
|
|
41
|
+
- `A3`:
|
|
42
|
+
297 x 420 (mm) 841.89 x 1199.551 (pixels) at 72 DPI
|
|
43
|
+
- `A4`:
|
|
44
|
+
210 x 297 (mm) 595.276 x 841.89 (pixels) at 72 DPI
|
|
45
|
+
- `A5`:
|
|
46
|
+
148 x 210 (mm) 419.528 x 595.276 (pixels) at 72 DPI
|
|
47
|
+
- `B4`:
|
|
48
|
+
250 x 353 (mm) 708.661 x 1000.63 (pixels) at 72 DPI
|
|
49
|
+
- `B5`:
|
|
50
|
+
176 x 250 (mm) 498.898 x 708.661 (pixels) at 72 DPI
|
|
51
|
+
- `EXECUTIVE`:
|
|
52
|
+
7.25 x 10.5 (inches) 522 x 756 (pixels) at 72 DPI
|
|
53
|
+
- `US4x6`:
|
|
54
|
+
4 x 6 (inches) 288 x 432 (pixels) at 72 DPI
|
|
55
|
+
- `US4x8`:
|
|
56
|
+
4 x 8 (inches) 288 x 576 (pixels) at 72 DPI
|
|
57
|
+
- `US5x7`:
|
|
58
|
+
5 x 7 (inches) 360 x 504 (pixels) at 72 DPI
|
|
59
|
+
- `COMM10`:
|
|
60
|
+
4.125 x 9.5 (inches) 297 x 684 (pixels) at 72 DPI
|
|
61
|
+
- `CUSTOM`:
|
|
62
|
+
physical size will be calculated from the image dimensions and the `dpi` parameter.
|
|
63
|
+
*/
|
|
64
|
+
export type PageSize = "LETTER" | "LEGAL" | "A3" | "A4" | "A5" | "B4" | "B5" | "EXECUTIVE" | "US4x6" | "US4x8" | "US5x7" | "COMM10" | "CUSTOM";
|
|
65
|
+
/**
|
|
66
|
+
Page direction
|
|
67
|
+
|
|
68
|
+
- `PORTRAIT`:
|
|
69
|
+
Portrait
|
|
70
|
+
- `LANDSCAPE`:
|
|
71
|
+
Landscape
|
|
72
|
+
- `AUTO`:
|
|
73
|
+
Decides based on image aspect ratio
|
|
74
|
+
*/
|
|
75
|
+
export type PageDirection = "PORTRAIT" | "LANDSCAPE" | "AUTO";
|
|
76
|
+
/**
|
|
77
|
+
Page fit
|
|
78
|
+
|
|
79
|
+
- `FIT_IN`:
|
|
80
|
+
Fit image into page. May leave white borders if the aspect ratio
|
|
81
|
+
of the image and the page don't match. Preserves image aspect ratio.
|
|
82
|
+
- `FILL_IN`:
|
|
83
|
+
Fill page with image. Will crop the image if the aspect ratio
|
|
84
|
+
of the image and the page don't match. Preserves image aspect ratio.
|
|
85
|
+
- `STRETCH`:
|
|
86
|
+
Stretch image to fill the entire page. The image will never be cropped
|
|
87
|
+
and there will never be any white borders left, but the image aspect ratio
|
|
88
|
+
will be made to match the page aspect ratio.
|
|
89
|
+
- `NONE`:
|
|
90
|
+
No resizing, centers the image on the page. The physical size of the image
|
|
91
|
+
will be determined by the `dpi` parameter.
|
|
92
|
+
*/
|
|
93
|
+
export type PageFit = "FIT_IN" | "FILL_IN" | "STRETCH" | "NONE";
|
|
94
|
+
/**
|
|
95
|
+
Resampling method
|
|
96
|
+
|
|
97
|
+
- `NONE`:
|
|
98
|
+
Always geometrically rescale the image to fit the page if necessary. Fast.
|
|
99
|
+
|
|
100
|
+
Otherwise, downscale the bitmap to match the `dpi` setting via the selected method before
|
|
101
|
+
adding it to the PDF if the calculated image DPI after stretching is greater than `dpi`.
|
|
102
|
+
Slower.
|
|
103
|
+
- `NEAREST`:
|
|
104
|
+
Nearest-neighbor interpolation. Lowest quality. Produces blocky images, especially when
|
|
105
|
+
upsampling.
|
|
106
|
+
- `LINEAR`:
|
|
107
|
+
Bi-linear interpolation. Better quality than nearest-neighbor, slower. Okay when the
|
|
108
|
+
target size is not too different from the source size.
|
|
109
|
+
- `CUBIC`:
|
|
110
|
+
Bi-cubic interpolation. Better quality than bi-linear, slower. Produces high-quality
|
|
111
|
+
results in a larger range than that of bi-linear.
|
|
112
|
+
- `LANCZOS4`:
|
|
113
|
+
Lanczos (Sinc) interpolation over 8x8 neighborhood. Produces very high quality results,
|
|
114
|
+
but slower than bi-cubic. Retains sharp edges like those of text when downsampling.
|
|
115
|
+
- `AREA`:
|
|
116
|
+
Accurate, produces moire-free results, but tends to produce blurrier images. When
|
|
117
|
+
upsampling, it is similar to nearest-neighbor.
|
|
118
|
+
*/
|
|
119
|
+
export type ResamplingMethod = "NONE" | "NEAREST" | "LINEAR" | "CUBIC" | "LANCZOS4" | "AREA";
|
|
120
|
+
/**
|
|
121
|
+
The parameters `pageSize`, `pageFit`, `dpi` and `resamplingMethod` interact in a complex way
|
|
122
|
+
when adding bitmap images (JPEG, PNG, or raw) to the PDF.
|
|
123
|
+
There are three cases to consider:
|
|
124
|
+
1. `pageSize` is `CUSTOM`:
|
|
125
|
+
in this case `dpi` is used as the conversion ratio to calculate both the physical page and
|
|
126
|
+
image sizes in inches from the bitmap dimensions. `resamplingMethod` is ignored.
|
|
127
|
+
2. `pageSize` is not `CUSTOM` AND `pageFit` is `NONE`:
|
|
128
|
+
in this case `dpi` is used as the conversion ratio to calculate only the physical image
|
|
129
|
+
size in inches from the bitmap dimensions. The image is centered onto the page.
|
|
130
|
+
`resamplingMethod` is ignored.
|
|
131
|
+
3. `pageSize` is not `CUSTOM` AND `pageFit` is not `NONE`:
|
|
132
|
+
in this case the page has a pre-determined physical size and we want to stretch the image to
|
|
133
|
+
fit the page in one of the ways described by `pageFit`. The image DPI is automatically
|
|
134
|
+
calculated for each image from the given physical page size, page fit setting and image
|
|
135
|
+
dimensions. There are two sub-cases to consider:
|
|
136
|
+
a. `resamplingMethod` is NONE OR the calculated DPI is less than or equal to `dpi`:
|
|
137
|
+
in this case the image is added to the PDF without resampling, which means that the image
|
|
138
|
+
rectangle is simply rescaled to fit into the page as specified by `pageFit` and
|
|
139
|
+
`pageSize`.
|
|
140
|
+
b. `resamplingMethod` is not NONE AND the calculated DPI is greater than `dpi`:
|
|
141
|
+
in this case the bitmap of the image is resampled to match `dpi` using the selected method
|
|
142
|
+
before adding it to the PDF. This will result in a bitmap that is smaller than the
|
|
143
|
+
original image and hence, the resulting PDF will be smaller in size.
|
|
144
|
+
|
|
145
|
+
*/
|
|
146
|
+
export declare class PdfConfig extends PartiallyConstructible {
|
|
147
|
+
/**
|
|
148
|
+
Attributes
|
|
149
|
+
@defaultValue new PdfAttributes({});
|
|
150
|
+
*/
|
|
151
|
+
readonly attributes: PdfAttributes;
|
|
152
|
+
/**
|
|
153
|
+
Physical size of the page. If CUSTOM, the page size will be set as the image size at given dpi.
|
|
154
|
+
@defaultValue "A4";
|
|
155
|
+
*/
|
|
156
|
+
readonly pageSize: PageSize;
|
|
157
|
+
/**
|
|
158
|
+
Page direction
|
|
159
|
+
@defaultValue "PORTRAIT";
|
|
160
|
+
*/
|
|
161
|
+
readonly pageDirection: PageDirection;
|
|
162
|
+
/**
|
|
163
|
+
How to fit the image into the page. Only used if `pageSize` is not `CUSTOM`.
|
|
164
|
+
The image can either be stretched to fill the page,
|
|
165
|
+
in one of three ways, or centered on the page without stretching.
|
|
166
|
+
@defaultValue "FIT_IN";
|
|
167
|
+
*/
|
|
168
|
+
readonly pageFit: PageFit;
|
|
169
|
+
/**
|
|
170
|
+
The `dpi` parameter has two different meanings depending on the value of `pageSize` and
|
|
171
|
+
`pageFit`. If pageSize is CUSTOM or pageFit is NONE, then `dpi` is the conversion ratio used
|
|
172
|
+
to convert from units of pixels to physical inches when adding bitmap images (JPEG, PNG, or
|
|
173
|
+
raw) to the PDF. Otherwise, if `resamplingMethod` is not NONE, then the image is downscaled
|
|
174
|
+
if necessary (if the image after being fit to the page has a higher calculated DPI than
|
|
175
|
+
`dpi`) to match `dpi` before adding it to the PDF. Otherwise, the setting is ignored and the
|
|
176
|
+
calculated image DPI is used instead.
|
|
177
|
+
@defaultValue 72;
|
|
178
|
+
*/
|
|
179
|
+
readonly dpi: number;
|
|
180
|
+
/**
|
|
181
|
+
JPEG quality for images.
|
|
182
|
+
Applies if an image is added as a cv::Mat and therefore needs to be encoded.
|
|
183
|
+
Also applies if `resamplingMethod` not NONE and the image being added needs to be
|
|
184
|
+
downscaled. Otherwise, when adding JPEG files to the PDF, the files are copied directly into
|
|
185
|
+
the PDF and not re-encoded, which is many times faster and also preserves the quality of the
|
|
186
|
+
original.
|
|
187
|
+
@defaultValue 80;
|
|
188
|
+
*/
|
|
189
|
+
readonly jpegQuality: number;
|
|
190
|
+
/**
|
|
191
|
+
Resampling method
|
|
192
|
+
@defaultValue "NONE";
|
|
193
|
+
*/
|
|
194
|
+
readonly resamplingMethod: ResamplingMethod;
|
|
195
|
+
/** @param source {@displayType `DeepPartial<PdfConfig>`} */
|
|
196
|
+
constructor(source?: DeepPartial<PdfConfig>);
|
|
197
|
+
}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { DeepPartial, PartiallyConstructible } from "../common";
|
|
2
|
+
import { ParametricFilter } from "./ParametricFilters";
|
|
3
|
+
/**
|
|
4
|
+
TIFF compression type
|
|
5
|
+
|
|
6
|
+
- `NONE`:
|
|
7
|
+
dump mode
|
|
8
|
+
- `CCITTRLE`:
|
|
9
|
+
CCITT modified Huffman RLE
|
|
10
|
+
- `CCITTFAX3`:
|
|
11
|
+
CCITT Group 3 fax encoding
|
|
12
|
+
- `CCITT_T4`:
|
|
13
|
+
CCITT T.4 (TIFF 6 name)
|
|
14
|
+
- `CCITTFAX4`:
|
|
15
|
+
CCITT Group 4 fax encoding
|
|
16
|
+
- `CCITT_T6`:
|
|
17
|
+
CCITT T.6 (TIFF 6 name)
|
|
18
|
+
- `LZW`:
|
|
19
|
+
Lempel-Ziv & Welch
|
|
20
|
+
- `OJPEG`:
|
|
21
|
+
!6.0 JPEG
|
|
22
|
+
- `JPEG`:
|
|
23
|
+
%JPEG DCT compression
|
|
24
|
+
- `T85`:
|
|
25
|
+
!TIFF/FX T.85 JBIG compression
|
|
26
|
+
- `T43`:
|
|
27
|
+
!TIFF/FX T.43 colour by layered JBIG compression
|
|
28
|
+
- `NEXT`:
|
|
29
|
+
NeXT 2-bit RLE
|
|
30
|
+
- `CCITTRLEW`:
|
|
31
|
+
#1 w/ word alignment
|
|
32
|
+
- `PACKBITS`:
|
|
33
|
+
Macintosh RLE
|
|
34
|
+
- `THUNDERSCAN`:
|
|
35
|
+
ThunderScan RLE
|
|
36
|
+
- `IT8CTPAD`:
|
|
37
|
+
IT8 CT w/padding
|
|
38
|
+
- `IT8LW`:
|
|
39
|
+
IT8 Linework RLE
|
|
40
|
+
- `IT8MP`:
|
|
41
|
+
IT8 Monochrome picture
|
|
42
|
+
- `IT8BL`:
|
|
43
|
+
IT8 Binary line art
|
|
44
|
+
- `PIXARFILM`:
|
|
45
|
+
Pixar companded 10bit LZW
|
|
46
|
+
- `PIXARLOG`:
|
|
47
|
+
Pixar companded 11bit ZIP
|
|
48
|
+
- `DEFLATE`:
|
|
49
|
+
Deflate compression
|
|
50
|
+
- `ADOBE_DEFLATE`:
|
|
51
|
+
Deflate compression, as recognized by Adobe
|
|
52
|
+
*/
|
|
53
|
+
export type CompressionMode = "NONE" | "CCITTRLE" | "CCITTFAX3" | "CCITT_T4" | "CCITTFAX4" | "CCITT_T6" | "LZW" | "OJPEG" | "JPEG" | "T85" | "T43" | "NEXT" | "CCITTRLEW" | "PACKBITS" | "THUNDERSCAN" | "IT8CTPAD" | "IT8LW" | "IT8MP" | "IT8BL" | "PIXARFILM" | "PIXARLOG" | "DEFLATE" | "ADOBE_DEFLATE";
|
|
54
|
+
/**
|
|
55
|
+
Binarization behavior to apply when adding pages to a TIFF
|
|
56
|
+
|
|
57
|
+
- `NO`:
|
|
58
|
+
Do not binarize the image. Image will be stored as a grayscale or color TIFF.
|
|
59
|
+
- `YES`:
|
|
60
|
+
Binarize the image. Image will be stored as a 1-bit TIFF. If the input image is not black-and-white, a simple thresholding is applied.
|
|
61
|
+
- `IF_BINARIZATION_FILTER_SET`:
|
|
62
|
+
Binarize the image (same behavior as YES) if a binarization filter (TIFFWriterParameters.binarizationFilter) is set. This is the default.
|
|
63
|
+
*/
|
|
64
|
+
export type Binarize = "NO" | "YES" | "IF_BINARIZATION_FILTER_SET";
|
|
65
|
+
/**
|
|
66
|
+
User-defined TIFF field value
|
|
67
|
+
*/
|
|
68
|
+
export type UserFieldValue = UserFieldDoubleValue | UserFieldStringValue | UserFieldIntValue;
|
|
69
|
+
/** @internal */
|
|
70
|
+
export declare namespace UserFieldValue {
|
|
71
|
+
/** @internal */
|
|
72
|
+
function From(source: {
|
|
73
|
+
[key: string]: any;
|
|
74
|
+
}): UserFieldValue;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
Double value (TIFF_DOUBLE)
|
|
78
|
+
*/
|
|
79
|
+
export declare class UserFieldDoubleValue extends PartiallyConstructible {
|
|
80
|
+
readonly _type: "UserFieldDoubleValue";
|
|
81
|
+
/**
|
|
82
|
+
Value
|
|
83
|
+
*/
|
|
84
|
+
readonly value: number;
|
|
85
|
+
/** @param source {@displayType `DeepPartial<UserFieldDoubleValue>`} */
|
|
86
|
+
constructor(source?: DeepPartial<UserFieldDoubleValue>);
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
ASCII string value (TIFF_ASCII)
|
|
90
|
+
*/
|
|
91
|
+
export declare class UserFieldStringValue extends PartiallyConstructible {
|
|
92
|
+
readonly _type: "UserFieldStringValue";
|
|
93
|
+
/**
|
|
94
|
+
Value
|
|
95
|
+
*/
|
|
96
|
+
readonly value: string;
|
|
97
|
+
/** @param source {@displayType `DeepPartial<UserFieldStringValue>`} */
|
|
98
|
+
constructor(source?: DeepPartial<UserFieldStringValue>);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
32-bit int value (TIFF_LONG)
|
|
102
|
+
*/
|
|
103
|
+
export declare class UserFieldIntValue extends PartiallyConstructible {
|
|
104
|
+
readonly _type: "UserFieldIntValue";
|
|
105
|
+
/**
|
|
106
|
+
Value
|
|
107
|
+
*/
|
|
108
|
+
readonly value: number;
|
|
109
|
+
/** @param source {@displayType `DeepPartial<UserFieldIntValue>`} */
|
|
110
|
+
constructor(source?: DeepPartial<UserFieldIntValue>);
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
User-defined TIFF field
|
|
114
|
+
*/
|
|
115
|
+
export declare class UserField extends PartiallyConstructible {
|
|
116
|
+
/**
|
|
117
|
+
Numeric tag
|
|
118
|
+
*/
|
|
119
|
+
readonly tag: number;
|
|
120
|
+
/**
|
|
121
|
+
Field name
|
|
122
|
+
*/
|
|
123
|
+
readonly name: string;
|
|
124
|
+
/**
|
|
125
|
+
Value
|
|
126
|
+
*/
|
|
127
|
+
readonly value: UserFieldValue;
|
|
128
|
+
/** @param source {@displayType `DeepPartial<UserField>`} */
|
|
129
|
+
constructor(source?: DeepPartial<UserField>);
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
TIFF writer parameters
|
|
133
|
+
*/
|
|
134
|
+
export declare class TIFFWriterParameters extends PartiallyConstructible {
|
|
135
|
+
/**
|
|
136
|
+
Compression
|
|
137
|
+
@defaultValue "LZW";
|
|
138
|
+
*/
|
|
139
|
+
compression: CompressionMode;
|
|
140
|
+
/**
|
|
141
|
+
JPEG quality (TIFFTAG_JPEGQUALITY). Values range from 0 to 100.
|
|
142
|
+
@defaultValue 80;
|
|
143
|
+
*/
|
|
144
|
+
jpegQuality: number;
|
|
145
|
+
/**
|
|
146
|
+
ZIP/Deflate compression level (TIFFTAG_ZIPQUALITY). Values range from 1 to 9.
|
|
147
|
+
@defaultValue 6;
|
|
148
|
+
*/
|
|
149
|
+
zipCompressionLevel: number;
|
|
150
|
+
/**
|
|
151
|
+
DPI value
|
|
152
|
+
@defaultValue 72;
|
|
153
|
+
*/
|
|
154
|
+
dpi: number;
|
|
155
|
+
/**
|
|
156
|
+
User-defined fields
|
|
157
|
+
@defaultValue [];
|
|
158
|
+
*/
|
|
159
|
+
userFields: UserField[];
|
|
160
|
+
/**
|
|
161
|
+
Filter to apply to the input image when adding pages with binarization.
|
|
162
|
+
If set, the filter is applied to the input image and the resulting image is stored as a 1-bit TIFF.
|
|
163
|
+
When storing documents it's typically best to use the BINARY_DOCUMENT_OPTIMIZED_COMPRESSION compression mode (CCITTFAX4)
|
|
164
|
+
instead of the default, as it tends to produce the smallest file sizes.
|
|
165
|
+
If not set, simple thresholding is applied to the image, instead.
|
|
166
|
+
@defaultValue null;
|
|
167
|
+
*/
|
|
168
|
+
binarizationFilter: ParametricFilter | null;
|
|
169
|
+
/** @param source {@displayType `DeepPartial<TIFFWriterParameters>`} */
|
|
170
|
+
constructor(source?: DeepPartial<TIFFWriterParameters>);
|
|
171
|
+
}
|
|
172
|
+
export declare namespace TIFFWriterParameters {
|
|
173
|
+
/**
|
|
174
|
+
Default compression
|
|
175
|
+
@defaultValue "LZW";
|
|
176
|
+
*/
|
|
177
|
+
const defaultCompression: CompressionMode;
|
|
178
|
+
/**
|
|
179
|
+
Compression mode typically producing the smallest file sizes for binary (1-bit) document images
|
|
180
|
+
@defaultValue "CCITTFAX4";
|
|
181
|
+
*/
|
|
182
|
+
const binaryDocumentOptimizedCompression: CompressionMode;
|
|
183
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function gatherTransferables(args: any, useCopy?: boolean): Transferable[];
|
|
2
|
+
export declare function isRemote(path: string): boolean;
|
|
3
|
+
export declare function areThreadsAvailable(): boolean;
|
|
4
|
+
export declare function getBuildType(options: {
|
|
5
|
+
allowSimd?: boolean;
|
|
6
|
+
allowThreads?: boolean;
|
|
7
|
+
}): string;
|