pdf-oxide-wasm 0.3.49 → 0.3.51
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/bundler/pdf_oxide.d.ts +218 -0
- package/bundler/pdf_oxide.js +1 -1
- package/bundler/pdf_oxide_bg.js +711 -0
- package/bundler/pdf_oxide_bg.wasm +0 -0
- package/bundler/pdf_oxide_bg.wasm.d.ts +34 -1
- package/nodejs/pdf_oxide.d.ts +218 -0
- package/nodejs/pdf_oxide.js +724 -0
- package/nodejs/pdf_oxide_bg.wasm +0 -0
- package/nodejs/pdf_oxide_bg.wasm.d.ts +34 -1
- package/package.json +1 -1
- package/web/pdf_oxide.d.ts +252 -1
- package/web/pdf_oxide.js +711 -0
- package/web/pdf_oxide_bg.wasm +0 -0
- package/web/pdf_oxide_bg.wasm.d.ts +34 -1
|
Binary file
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
4
|
export const __wbg_artifactstyle_free: (a: number, b: number) => void;
|
|
5
|
+
export const __wbg_dss_free: (a: number, b: number) => void;
|
|
6
|
+
export const __wbg_revocationmaterial_free: (a: number, b: number) => void;
|
|
5
7
|
export const __wbg_streamingtable_free: (a: number, b: number) => void;
|
|
6
8
|
export const __wbg_wasmartifact_free: (a: number, b: number) => void;
|
|
7
9
|
export const __wbg_wasmcertificate_free: (a: number, b: number) => void;
|
|
@@ -15,10 +17,20 @@ export const __wbg_wasmpdfdocument_free: (a: number, b: number) => void;
|
|
|
15
17
|
export const __wbg_wasmpdfpageregion_free: (a: number, b: number) => void;
|
|
16
18
|
export const __wbg_wasmsignature_free: (a: number, b: number) => void;
|
|
17
19
|
export const __wbg_wasmtimestamp_free: (a: number, b: number) => void;
|
|
20
|
+
export const cryptoCbom: (a: number) => void;
|
|
21
|
+
export const cryptoInventory: (a: number) => void;
|
|
22
|
+
export const cryptoPolicy: (a: number) => void;
|
|
18
23
|
export const generateBarcodeSvg: (a: number, b: number, c: number, d: number) => void;
|
|
19
24
|
export const generateQrSvg: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
25
|
+
export const hasDocumentTimestamp: (a: number, b: number) => number;
|
|
26
|
+
export const modelManifest: (a: number) => void;
|
|
27
|
+
export const planSplitByBookmarks: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
28
|
+
export const prefetchAvailable: () => number;
|
|
29
|
+
export const setCryptoPolicy: (a: number, b: number, c: number) => void;
|
|
20
30
|
export const setLogLevel: (a: number, b: number, c: number) => void;
|
|
21
31
|
export const signPdfBytes: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
32
|
+
export const signPdfBytesPades: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => void;
|
|
33
|
+
export const splitByBookmarks: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
22
34
|
export const streamingtable_batchCount: (a: number) => number;
|
|
23
35
|
export const streamingtable_columnCount: (a: number) => number;
|
|
24
36
|
export const streamingtable_finish: (a: number, b: number) => void;
|
|
@@ -61,6 +73,11 @@ export const wasmdocumentbuilder_subject: (a: number, b: number, c: number, d: n
|
|
|
61
73
|
export const wasmdocumentbuilder_taggedPdfUa1: (a: number, b: number) => void;
|
|
62
74
|
export const wasmdocumentbuilder_title: (a: number, b: number, c: number, d: number) => void;
|
|
63
75
|
export const wasmdocumentbuilder_toBytesEncrypted: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
76
|
+
export const wasmdss_certCount: (a: number) => number;
|
|
77
|
+
export const wasmdss_getCert: (a: number, b: number, c: number) => void;
|
|
78
|
+
export const wasmdss_getCrl: (a: number, b: number, c: number) => void;
|
|
79
|
+
export const wasmdss_getOcsp: (a: number, b: number, c: number) => void;
|
|
80
|
+
export const wasmdss_vri: (a: number, b: number) => void;
|
|
64
81
|
export const wasmembeddedfont_fromBytes: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
65
82
|
export const wasmembeddedfont_name: (a: number, b: number) => void;
|
|
66
83
|
export const wasmfluentpagebuilder_at: (a: number, b: number, c: number, d: number) => void;
|
|
@@ -138,13 +155,18 @@ export const wasmpdf_fromText: (a: number, b: number, c: number, d: number, e: n
|
|
|
138
155
|
export const wasmpdf_merge: (a: number, b: number, c: number) => void;
|
|
139
156
|
export const wasmpdf_size: (a: number) => number;
|
|
140
157
|
export const wasmpdf_toBytes: (a: number, b: number) => void;
|
|
158
|
+
export const wasmpdfdocument_addRedaction: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
141
159
|
export const wasmpdfdocument_applyAllRedactions: (a: number, b: number) => void;
|
|
142
160
|
export const wasmpdfdocument_applyPageRedactions: (a: number, b: number, c: number) => void;
|
|
161
|
+
export const wasmpdfdocument_applyRedactionsDestructive: (a: number, b: number, c: number) => void;
|
|
143
162
|
export const wasmpdfdocument_authenticate: (a: number, b: number, c: number, d: number) => void;
|
|
163
|
+
export const wasmpdfdocument_classifyDocument: (a: number, b: number) => void;
|
|
164
|
+
export const wasmpdfdocument_classifyPage: (a: number, b: number, c: number) => void;
|
|
144
165
|
export const wasmpdfdocument_clearEraseRegions: (a: number, b: number, c: number) => void;
|
|
145
166
|
export const wasmpdfdocument_convertToPdfA: (a: number, b: number, c: number, d: number) => void;
|
|
146
167
|
export const wasmpdfdocument_cropMargins: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
147
168
|
export const wasmpdfdocument_deletePage: (a: number, b: number, c: number) => void;
|
|
169
|
+
export const wasmpdfdocument_dss: (a: number, b: number) => void;
|
|
148
170
|
export const wasmpdfdocument_editFooter: (a: number, b: number, c: number) => void;
|
|
149
171
|
export const wasmpdfdocument_editHeader: (a: number, b: number, c: number) => void;
|
|
150
172
|
export const wasmpdfdocument_embedFile: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
@@ -159,6 +181,7 @@ export const wasmpdfdocument_extractChars: (a: number, b: number, c: number, d:
|
|
|
159
181
|
export const wasmpdfdocument_extractImageBytes: (a: number, b: number, c: number) => void;
|
|
160
182
|
export const wasmpdfdocument_extractImages: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
161
183
|
export const wasmpdfdocument_extractLines: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
184
|
+
export const wasmpdfdocument_extractPageAuto: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
162
185
|
export const wasmpdfdocument_extractPageText: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
163
186
|
export const wasmpdfdocument_extractPages: (a: number, b: number, c: number, d: number) => void;
|
|
164
187
|
export const wasmpdfdocument_extractPaths: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
@@ -166,6 +189,7 @@ export const wasmpdfdocument_extractRects: (a: number, b: number, c: number, d:
|
|
|
166
189
|
export const wasmpdfdocument_extractSpans: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
167
190
|
export const wasmpdfdocument_extractTables: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
168
191
|
export const wasmpdfdocument_extractText: (a: number, b: number, c: number, d: number) => void;
|
|
192
|
+
export const wasmpdfdocument_extractTextAuto: (a: number, b: number, c: number) => void;
|
|
169
193
|
export const wasmpdfdocument_extractTextLines: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
170
194
|
export const wasmpdfdocument_extractTextOcr: (a: number, b: number, c: number, d: number) => void;
|
|
171
195
|
export const wasmpdfdocument_extractWords: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
@@ -193,6 +217,7 @@ export const wasmpdfdocument_pageImages: (a: number, b: number, c: number) => vo
|
|
|
193
217
|
export const wasmpdfdocument_pageLabels: (a: number, b: number) => void;
|
|
194
218
|
export const wasmpdfdocument_pageMediaBox: (a: number, b: number, c: number) => void;
|
|
195
219
|
export const wasmpdfdocument_pageRotation: (a: number, b: number, c: number) => void;
|
|
220
|
+
export const wasmpdfdocument_redactionCount: (a: number, b: number, c: number) => void;
|
|
196
221
|
export const wasmpdfdocument_removeArtifacts: (a: number, b: number, c: number) => void;
|
|
197
222
|
export const wasmpdfdocument_removeFooters: (a: number, b: number, c: number) => void;
|
|
198
223
|
export const wasmpdfdocument_removeHeaders: (a: number, b: number, c: number) => void;
|
|
@@ -201,6 +226,7 @@ export const wasmpdfdocument_repositionImage: (a: number, b: number, c: number,
|
|
|
201
226
|
export const wasmpdfdocument_resizeImage: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
202
227
|
export const wasmpdfdocument_rotateAllPages: (a: number, b: number, c: number) => void;
|
|
203
228
|
export const wasmpdfdocument_rotatePage: (a: number, b: number, c: number, d: number) => void;
|
|
229
|
+
export const wasmpdfdocument_sanitizeDocument: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
204
230
|
export const wasmpdfdocument_save: (a: number, b: number) => void;
|
|
205
231
|
export const wasmpdfdocument_saveEncryptedToBytes: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
|
|
206
232
|
export const wasmpdfdocument_saveWithOptions: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
@@ -242,9 +268,14 @@ export const wasmpdfpageregion_extractText: (a: number, b: number) => void;
|
|
|
242
268
|
export const wasmpdfpageregion_extractTextLines: (a: number, b: number) => void;
|
|
243
269
|
export const wasmpdfpageregion_extractTextOcr: (a: number, b: number, c: number) => void;
|
|
244
270
|
export const wasmpdfpageregion_extractWords: (a: number, b: number) => void;
|
|
271
|
+
export const wasmrevocationmaterial_addCert: (a: number, b: number, c: number) => void;
|
|
272
|
+
export const wasmrevocationmaterial_addCrl: (a: number, b: number, c: number) => void;
|
|
273
|
+
export const wasmrevocationmaterial_addOcsp: (a: number, b: number, c: number) => void;
|
|
274
|
+
export const wasmrevocationmaterial_new: () => number;
|
|
245
275
|
export const wasmsignature_contactInfo: (a: number, b: number) => void;
|
|
246
276
|
export const wasmsignature_coversWholeDocument: (a: number) => number;
|
|
247
277
|
export const wasmsignature_location: (a: number, b: number) => void;
|
|
278
|
+
export const wasmsignature_padesLevel: (a: number) => number;
|
|
248
279
|
export const wasmsignature_reason: (a: number, b: number) => void;
|
|
249
280
|
export const wasmsignature_signerName: (a: number, b: number) => void;
|
|
250
281
|
export const wasmsignature_signingTime: (a: number, b: number) => void;
|
|
@@ -258,6 +289,8 @@ export const wasmtimestamp_serial: (a: number, b: number) => void;
|
|
|
258
289
|
export const wasmtimestamp_time: (a: number) => bigint;
|
|
259
290
|
export const wasmtimestamp_tsaName: (a: number, b: number) => void;
|
|
260
291
|
export const wasmtimestamp_verify: (a: number, b: number) => void;
|
|
292
|
+
export const wasmdss_crlCount: (a: number) => number;
|
|
293
|
+
export const wasmdss_ocspCount: (a: number) => number;
|
|
261
294
|
export const wasmocrconfig_new: () => number;
|
|
262
295
|
export const wasmpdfdocument_saveToBytes: (a: number, b: number) => void;
|
|
263
296
|
export const wasmfooter_center: (a: number, b: number) => number;
|
|
@@ -270,8 +303,8 @@ export const wasmfooter_new: () => number;
|
|
|
270
303
|
export const wasmheader_new: () => number;
|
|
271
304
|
export const __wbg_wasmocrengine_free: (a: number, b: number) => void;
|
|
272
305
|
export const disableLogging: () => void;
|
|
273
|
-
export const __wbg_wasmfooter_free: (a: number, b: number) => void;
|
|
274
306
|
export const __wbg_wasmheader_free: (a: number, b: number) => void;
|
|
307
|
+
export const __wbg_wasmfooter_free: (a: number, b: number) => void;
|
|
275
308
|
export const lut_inverse_interp16: (a: number, b: number, c: number) => number;
|
|
276
309
|
export const qcms_profile_precache_output_transform: (a: number) => void;
|
|
277
310
|
export const lut_interp_linear16: (a: number, b: number, c: number) => number;
|
package/nodejs/pdf_oxide.d.ts
CHANGED
|
@@ -45,6 +45,93 @@ export class ArtifactStyle {
|
|
|
45
45
|
constructor();
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
/**
|
|
49
|
+
* A parsed Document Security Store (`/DSS`, ISO 32000-2 §12.8.4.3).
|
|
50
|
+
* Count + index accessors mirror `WasmCertificate`'s flat shape
|
|
51
|
+
* (wasm-bindgen cannot return `Uint8Array[]` directly).
|
|
52
|
+
*/
|
|
53
|
+
export class Dss {
|
|
54
|
+
private constructor();
|
|
55
|
+
free(): void;
|
|
56
|
+
[Symbol.dispose](): void;
|
|
57
|
+
/**
|
|
58
|
+
* The `i`-th DER certificate, or `undefined` if out of range.
|
|
59
|
+
*/
|
|
60
|
+
getCert(i: number): Uint8Array | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* The `i`-th DER CRL, or `undefined` if out of range.
|
|
63
|
+
*/
|
|
64
|
+
getCrl(i: number): Uint8Array | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* The `i`-th DER OCSP response, or `undefined` if out of range.
|
|
67
|
+
*/
|
|
68
|
+
getOcsp(i: number): Uint8Array | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* Number of DER X.509 certificates in the DSS.
|
|
71
|
+
*/
|
|
72
|
+
readonly certCount: number;
|
|
73
|
+
/**
|
|
74
|
+
* Number of DER CRLs in the DSS.
|
|
75
|
+
*/
|
|
76
|
+
readonly crlCount: number;
|
|
77
|
+
/**
|
|
78
|
+
* Number of DER OCSP responses in the DSS.
|
|
79
|
+
*/
|
|
80
|
+
readonly ocspCount: number;
|
|
81
|
+
/**
|
|
82
|
+
* Per-signature VRI keys (uppercase-hex SHA-1 of `/Contents`).
|
|
83
|
+
*/
|
|
84
|
+
readonly vri: string[];
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* PAdES baseline level. Frozen integer mapping (BB=0, BT=1, BLt=2,
|
|
89
|
+
* BLta=3) shared with the C ABI and every binding — never renumber.
|
|
90
|
+
*/
|
|
91
|
+
export enum PadesLevel {
|
|
92
|
+
/**
|
|
93
|
+
* B-B: signed attrs incl. the ESS signing-certificate-v2.
|
|
94
|
+
*/
|
|
95
|
+
BB = 0,
|
|
96
|
+
/**
|
|
97
|
+
* B-T: B-B + an RFC 3161 signature-time-stamp unsigned attr.
|
|
98
|
+
*/
|
|
99
|
+
BT = 1,
|
|
100
|
+
/**
|
|
101
|
+
* B-LT: B-T + a Document Security Store (DSS/VRI).
|
|
102
|
+
*/
|
|
103
|
+
BLt = 2,
|
|
104
|
+
/**
|
|
105
|
+
* B-LTA: B-LT + a document-scoped `/DocTimeStamp`.
|
|
106
|
+
*/
|
|
107
|
+
BLta = 3,
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Offline B-LT validation material (DER certs / CRLs / OCSP
|
|
112
|
+
* responses). Build with `new()` then `addCert`/`addCrl`/`addOcsp`.
|
|
113
|
+
*/
|
|
114
|
+
export class RevocationMaterial {
|
|
115
|
+
free(): void;
|
|
116
|
+
[Symbol.dispose](): void;
|
|
117
|
+
/**
|
|
118
|
+
* Add a DER X.509 certificate.
|
|
119
|
+
*/
|
|
120
|
+
addCert(der: Uint8Array): void;
|
|
121
|
+
/**
|
|
122
|
+
* Add a DER CRL.
|
|
123
|
+
*/
|
|
124
|
+
addCrl(der: Uint8Array): void;
|
|
125
|
+
/**
|
|
126
|
+
* Add a DER OCSP response.
|
|
127
|
+
*/
|
|
128
|
+
addOcsp(der: Uint8Array): void;
|
|
129
|
+
/**
|
|
130
|
+
* Create an empty revocation-material set.
|
|
131
|
+
*/
|
|
132
|
+
constructor();
|
|
133
|
+
}
|
|
134
|
+
|
|
48
135
|
/**
|
|
49
136
|
* WASM handle to a streaming-table building session. Created by
|
|
50
137
|
* `FluentPageBuilder.streamingTable()`; rows are pushed via `pushRow`,
|
|
@@ -703,6 +790,11 @@ export class WasmPdf {
|
|
|
703
790
|
export class WasmPdfDocument {
|
|
704
791
|
free(): void;
|
|
705
792
|
[Symbol.dispose](): void;
|
|
793
|
+
/**
|
|
794
|
+
* Queue an explicit destructive redaction rectangle on a page
|
|
795
|
+
* (page user space; `fill` is an optional DeviceRGB `[r,g,b]`).
|
|
796
|
+
*/
|
|
797
|
+
addRedaction(page: number, x0: number, y0: number, x1: number, y1: number, fill?: Float32Array | null): void;
|
|
706
798
|
/**
|
|
707
799
|
* Apply all redactions in the document.
|
|
708
800
|
*/
|
|
@@ -711,6 +803,11 @@ export class WasmPdfDocument {
|
|
|
711
803
|
* Apply redactions on a page (removes redacted content permanently).
|
|
712
804
|
*/
|
|
713
805
|
applyPageRedactions(page_index: number): void;
|
|
806
|
+
/**
|
|
807
|
+
* Destructively apply all queued redactions (true content removal,
|
|
808
|
+
* ISO 32000-1:2008 §12.5.6.23). Returns a `RedactionReport` object.
|
|
809
|
+
*/
|
|
810
|
+
applyRedactionsDestructive(scrub_metadata?: boolean | null): any;
|
|
714
811
|
/**
|
|
715
812
|
* Authenticate with a password to decrypt an encrypted PDF.
|
|
716
813
|
*
|
|
@@ -718,6 +815,15 @@ export class WasmPdfDocument {
|
|
|
718
815
|
* @returns true if authentication succeeded
|
|
719
816
|
*/
|
|
720
817
|
authenticate(password: string): boolean;
|
|
818
|
+
/**
|
|
819
|
+
* Cheap per-page text-vs-OCR classification → JSON
|
|
820
|
+
* `DocumentClassification`.
|
|
821
|
+
*/
|
|
822
|
+
classifyDocument(): string;
|
|
823
|
+
/**
|
|
824
|
+
* Cheap per-page classification → JSON `PageClassification`.
|
|
825
|
+
*/
|
|
826
|
+
classifyPage(page_index: number): string;
|
|
721
827
|
/**
|
|
722
828
|
* Clear all pending erase operations for a page.
|
|
723
829
|
*/
|
|
@@ -737,6 +843,11 @@ export class WasmPdfDocument {
|
|
|
737
843
|
* Delete a page by index (0-based).
|
|
738
844
|
*/
|
|
739
845
|
deletePage(index: number): void;
|
|
846
|
+
/**
|
|
847
|
+
* The document's Document Security Store (`/DSS`) as a `Dss`, or
|
|
848
|
+
* `undefined` if absent. Mirrors Rust `signatures::read_dss`.
|
|
849
|
+
*/
|
|
850
|
+
dss(): Dss | undefined;
|
|
740
851
|
/**
|
|
741
852
|
* Deprecated: Use eraseFooter instead.
|
|
742
853
|
*/
|
|
@@ -832,6 +943,12 @@ export class WasmPdfDocument {
|
|
|
832
943
|
* @returns Array of path objects
|
|
833
944
|
*/
|
|
834
945
|
extractLines(page_index: number, region?: Float32Array | null): any;
|
|
946
|
+
/**
|
|
947
|
+
* Rich per-page extraction → JSON `PageExtraction` (per-region
|
|
948
|
+
* bbox + typed reason). `optionsJson` is `{}`-tolerant
|
|
949
|
+
* `AutoExtractOptions`; undefined/empty → defaults.
|
|
950
|
+
*/
|
|
951
|
+
extractPageAuto(page_index: number, options_json?: string | null): string;
|
|
835
952
|
/**
|
|
836
953
|
* Extract complete page text data in a single call.
|
|
837
954
|
*
|
|
@@ -888,6 +1005,11 @@ export class WasmPdfDocument {
|
|
|
888
1005
|
* @param region - Optional [x, y, width, height] to filter by
|
|
889
1006
|
*/
|
|
890
1007
|
extractText(page_index: number, region: any): string;
|
|
1008
|
+
/**
|
|
1009
|
+
* One-shot auto text extraction — graceful native fallback (never
|
|
1010
|
+
* the opaque OCR error #513).
|
|
1011
|
+
*/
|
|
1012
|
+
extractTextAuto(page_index: number): string;
|
|
891
1013
|
/**
|
|
892
1014
|
* Extract text lines from a page.
|
|
893
1015
|
*
|
|
@@ -1051,6 +1173,10 @@ export class WasmPdfDocument {
|
|
|
1051
1173
|
* Get the rotation of a page in degrees (0, 90, 180, 270).
|
|
1052
1174
|
*/
|
|
1053
1175
|
pageRotation(page_index: number): number;
|
|
1176
|
+
/**
|
|
1177
|
+
* Number of redaction regions queued for `page`.
|
|
1178
|
+
*/
|
|
1179
|
+
redactionCount(page: number): number;
|
|
1054
1180
|
/**
|
|
1055
1181
|
* Identify and remove both headers and footers.
|
|
1056
1182
|
*
|
|
@@ -1104,6 +1230,12 @@ export class WasmPdfDocument {
|
|
|
1104
1230
|
* Rotate a page by the given degrees (adds to current rotation).
|
|
1105
1231
|
*/
|
|
1106
1232
|
rotatePage(page_index: number, degrees: number): void;
|
|
1233
|
+
/**
|
|
1234
|
+
* Standalone document sanitization (#231 T10): strip `/Info`,
|
|
1235
|
+
* catalog XMP `/Metadata`, document JavaScript and embedded files
|
|
1236
|
+
* without geometric redaction. Returns a `RedactionReport` object.
|
|
1237
|
+
*/
|
|
1238
|
+
sanitizeDocument(scrub_metadata?: boolean | null, remove_javascript?: boolean | null, remove_embedded_files?: boolean | null): any;
|
|
1107
1239
|
/**
|
|
1108
1240
|
* Save all edits and return the resulting PDF as bytes.
|
|
1109
1241
|
*
|
|
@@ -1374,6 +1506,12 @@ export class WasmSignature {
|
|
|
1374
1506
|
* `/Location` entry from the signature dictionary, if present.
|
|
1375
1507
|
*/
|
|
1376
1508
|
readonly location: string | undefined;
|
|
1509
|
+
/**
|
|
1510
|
+
* PAdES baseline level from this signature's CMS attributes alone
|
|
1511
|
+
* (`BB` vs `BT`). `BLt` additionally needs the document `/DSS` —
|
|
1512
|
+
* read it via `WasmPdfDocument.dss()` and re-classify there.
|
|
1513
|
+
*/
|
|
1514
|
+
readonly padesLevel: PadesLevel;
|
|
1377
1515
|
/**
|
|
1378
1516
|
* `/Reason` entry from the signature dictionary, if present.
|
|
1379
1517
|
*/
|
|
@@ -1437,6 +1575,23 @@ export class WasmTimestamp {
|
|
|
1437
1575
|
readonly tsaName: string;
|
|
1438
1576
|
}
|
|
1439
1577
|
|
|
1578
|
+
/**
|
|
1579
|
+
* A CycloneDX 1.6 Cryptographic Bill of Materials (JSON string) of the
|
|
1580
|
+
* algorithms exercised so far this process (#230 Phase F).
|
|
1581
|
+
*/
|
|
1582
|
+
export function cryptoCbom(): string;
|
|
1583
|
+
|
|
1584
|
+
/**
|
|
1585
|
+
* The cryptographic algorithm tokens exercised so far this process
|
|
1586
|
+
* (governance report), as a JSON string array.
|
|
1587
|
+
*/
|
|
1588
|
+
export function cryptoInventory(): any;
|
|
1589
|
+
|
|
1590
|
+
/**
|
|
1591
|
+
* The active crypto policy as its canonical grammar string.
|
|
1592
|
+
*/
|
|
1593
|
+
export function cryptoPolicy(): string;
|
|
1594
|
+
|
|
1440
1595
|
/**
|
|
1441
1596
|
* Disable all pdf_oxide log output — convenience wrapper for
|
|
1442
1597
|
* `setLogLevel("off")`.
|
|
@@ -1457,6 +1612,50 @@ export function generateBarcodeSvg(barcode_type: number, data: string): string;
|
|
|
1457
1612
|
*/
|
|
1458
1613
|
export function generateQrSvg(data: string, error_correction: number, size: number): string;
|
|
1459
1614
|
|
|
1615
|
+
/**
|
|
1616
|
+
* Whether `pdf_data` carries a document-scoped RFC 3161
|
|
1617
|
+
* `/DocTimeStamp` archival timestamp (PAdES-B-LTA). This is the
|
|
1618
|
+
* document-level reader signal; a `WasmSignature`'s `padesLevel`
|
|
1619
|
+
* getter is signature-scoped and tops out at B-LT by design.
|
|
1620
|
+
*/
|
|
1621
|
+
export function hasDocumentTimestamp(pdf_data: Uint8Array): boolean;
|
|
1622
|
+
|
|
1623
|
+
/**
|
|
1624
|
+
* #519: Air-gapped OCR model manifest — JSON (detector + every
|
|
1625
|
+
* supported language's cache filenames and source URLs).
|
|
1626
|
+
*
|
|
1627
|
+
* WASM provisioning is **host-side**: browser/WASM has no filesystem
|
|
1628
|
+
* or network-to-disk, so a download-to-cache prefetch cannot run
|
|
1629
|
+
* here. This manifest is informational — it lets the JS host learn
|
|
1630
|
+
* which model files/URLs to fetch and bundle (or ship out of band)
|
|
1631
|
+
* before driving OCR. There is intentionally no `prefetchModels` in
|
|
1632
|
+
* the WASM surface (see `prefetchAvailable`, which always returns
|
|
1633
|
+
* `false`).
|
|
1634
|
+
*/
|
|
1635
|
+
export function modelManifest(): string;
|
|
1636
|
+
|
|
1637
|
+
/**
|
|
1638
|
+
* Plan a bookmark split without producing PDFs. Returns a JSON array
|
|
1639
|
+
* of segment objects (`index, startPage…` shape from
|
|
1640
|
+
* `BookmarkSegment`). `level`: 0 = all depths, 1 = top-level.
|
|
1641
|
+
*/
|
|
1642
|
+
export function planSplitByBookmarks(src_bytes: Uint8Array, title_prefix: string | null | undefined, ignore_case: boolean, level: number, include_front_matter: boolean): any;
|
|
1643
|
+
|
|
1644
|
+
/**
|
|
1645
|
+
* #519: Whether this build can download OCR models to a local cache.
|
|
1646
|
+
* Always `false` in WASM — provisioning is host-side (see
|
|
1647
|
+
* `modelManifest`).
|
|
1648
|
+
*/
|
|
1649
|
+
export function prefetchAvailable(): boolean;
|
|
1650
|
+
|
|
1651
|
+
/**
|
|
1652
|
+
* Install the process-wide runtime crypto policy from its grammar
|
|
1653
|
+
* string (`"compat"|"strict"|"fips-strict"[;…]`). Fail-closed:
|
|
1654
|
+
* throws on an unparseable spec (policy NOT installed) or if a
|
|
1655
|
+
* policy is already set. Default (never set) is `compat`.
|
|
1656
|
+
*/
|
|
1657
|
+
export function setCryptoPolicy(spec: string): void;
|
|
1658
|
+
|
|
1460
1659
|
/**
|
|
1461
1660
|
* Set the maximum log level for pdf_oxide messages.
|
|
1462
1661
|
*
|
|
@@ -1483,3 +1682,22 @@ export function setLogLevel(level: string): void;
|
|
|
1483
1682
|
* `Certificate.loadPkcs12`).
|
|
1484
1683
|
*/
|
|
1485
1684
|
export function signPdfBytes(pdf_data: Uint8Array, cert: WasmCertificate, reason?: string | null, location?: string | null): Uint8Array;
|
|
1685
|
+
|
|
1686
|
+
/**
|
|
1687
|
+
* Sign raw PDF bytes at a PAdES baseline level and return the signed
|
|
1688
|
+
* PDF as a `Uint8Array`.
|
|
1689
|
+
*
|
|
1690
|
+
* `level` `BLTA` is reserved (→ error). For `BT`/`BLt` pass a
|
|
1691
|
+
* pre-fetched RFC 3161 `timestampToken` (DER): WASM intentionally
|
|
1692
|
+
* omits the online TSA client (same `ureq`-incompat carve-out as
|
|
1693
|
+
* v0.3.38) — without a token the core fail-closes with `Unsupported`.
|
|
1694
|
+
* `revocation` supplies the B-LT DSS material.
|
|
1695
|
+
*/
|
|
1696
|
+
export function signPdfBytesPades(pdf_data: Uint8Array, cert: WasmCertificate, level: PadesLevel, timestamp_token?: Uint8Array | null, revocation?: RevocationMaterial | null, reason?: string | null, location?: string | null): Uint8Array;
|
|
1697
|
+
|
|
1698
|
+
/**
|
|
1699
|
+
* Split at bookmark boundaries. Returns a JSON array of
|
|
1700
|
+
* `[segment, bytes]` pairs (bytes as a number array; source
|
|
1701
|
+
* unmodified).
|
|
1702
|
+
*/
|
|
1703
|
+
export function splitByBookmarks(src_bytes: Uint8Array, title_prefix: string | null | undefined, ignore_case: boolean, level: number, include_front_matter: boolean): any;
|