pdf-oxide-wasm 0.3.39 → 0.3.41

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.
@@ -60,6 +60,10 @@ export class StreamingTable {
60
60
  private constructor();
61
61
  free(): void;
62
62
  [Symbol.dispose](): void;
63
+ /**
64
+ * Number of fully-completed batches waiting for finish().
65
+ */
66
+ batchCount(): number;
63
67
  /**
64
68
  * Number of columns configured on this streaming table.
65
69
  */
@@ -71,15 +75,25 @@ export class StreamingTable {
71
75
  * throws.
72
76
  */
73
77
  finish(): void;
78
+ /**
79
+ * Explicitly flush the current batch to `completed_batches`.
80
+ * Called automatically when `batch_size` rows accumulate.
81
+ */
82
+ flush(): void;
83
+ /**
84
+ * Number of rows in the current (not-yet-flushed) batch.
85
+ */
86
+ pendingRowCount(): number;
74
87
  /**
75
88
  * Push one row as an array of cell strings (all rowspan=1). Returns an
76
89
  * error if the table has already been finished or if the row's cell count
77
- * does not match the column count.
90
+ * does not match the column count. Auto-flushes the batch when full.
78
91
  */
79
92
  pushRow(cells: string[]): void;
80
93
  /**
81
94
  * Push one row with per-cell rowspan values. `cells` is a JS array of
82
95
  * `[text, rowspan]` two-element arrays. `rowspan == 1` is a normal cell.
96
+ * Auto-flushes the batch when full.
83
97
  */
84
98
  pushRowSpan(cells: any): void;
85
99
  }
@@ -450,10 +464,18 @@ export class WasmFluentPageBuilder {
450
464
  * Draw a straight line with explicit stroke width and RGB colour.
451
465
  */
452
466
  strokeLine(x1: number, y1: number, x2: number, y2: number, width: number, r: number, g: number, b: number): void;
467
+ /**
468
+ * Draw a dashed line. `dash` is alternating on/off lengths in points; `phase` is the starting offset.
469
+ */
470
+ strokeLineDashed(x1: number, y1: number, x2: number, y2: number, width: number, r: number, g: number, b: number, dash: Float32Array, phase: number): void;
453
471
  /**
454
472
  * Draw a stroked rectangle with explicit stroke width and RGB colour.
455
473
  */
456
474
  strokeRect(x: number, y: number, w: number, h: number, width: number, r: number, g: number, b: number): void;
475
+ /**
476
+ * Draw a dashed rectangle border. `dash` is alternating on/off lengths in points; `phase` is the starting offset.
477
+ */
478
+ strokeRectDashed(x: number, y: number, w: number, h: number, width: number, r: number, g: number, b: number, dash: Float32Array, phase: number): void;
457
479
  /**
458
480
  * Render a buffered table from a JS object:
459
481
  *
@@ -700,6 +722,13 @@ export class WasmPdfDocument {
700
722
  * Clear all pending erase operations for a page.
701
723
  */
702
724
  clearEraseRegions(page_index: number): void;
725
+ /**
726
+ * Convert the document to PDF/A compliance.
727
+ *
728
+ * Level must be one of: `"1a"`, `"1b"`, `"2a"`, `"2b"`, `"2u"`, `"3a"`, `"3b"`, `"3u"`.
729
+ * Returns a JS object with `success`, `level`, `actions`, and `errors` fields.
730
+ */
731
+ convertToPdfA(level: string): any;
703
732
  /**
704
733
  * Crop margins from all pages.
705
734
  */
@@ -899,6 +928,12 @@ export class WasmPdfDocument {
899
928
  * Flatten annotations on a page into the page content.
900
929
  */
901
930
  flattenPageAnnotations(page_index: number): void;
931
+ /**
932
+ * Create a flattened PDF where each page is rendered as an image.
933
+ * Burns in all annotations, form fields, and overlays.
934
+ * Returns the flattened PDF as bytes.
935
+ */
936
+ flattenToImages(dpi?: number | null): Uint8Array;
902
937
  /**
903
938
  * Return warnings collected during the last form-flattening save.
904
939
  *
@@ -1031,6 +1066,16 @@ export class WasmPdfDocument {
1031
1066
  * @param threshold - Fraction of pages (0.0-1.0) where text must repeat (heuristic mode)
1032
1067
  */
1033
1068
  removeHeaders(threshold: number): number;
1069
+ /**
1070
+ * Render a page to an image (PNG).
1071
+ *
1072
+ * Requires the `rendering` feature.
1073
+ *
1074
+ * @param page_index - Zero-based page number
1075
+ * @param dpi - Dots per inch (default: 150)
1076
+ * @returns Uint8Array containing the PNG image data
1077
+ */
1078
+ renderPage(page_index: number, dpi?: number | null): Uint8Array;
1034
1079
  /**
1035
1080
  * Reposition an image on a page.
1036
1081
  */
@@ -1254,10 +1299,9 @@ export class WasmPdfPageRegion {
1254
1299
 
1255
1300
  /**
1256
1301
  * A single existing PDF signature surfaced by
1257
- * `WasmPdfDocument.signatures()`. `verify()` runs the RSA-PKCS#1 v1.5
1258
- * signer-attributes check; `verifyDetached()` adds the
1259
- * `messageDigest` content-hash check. RSA-PSS / ECDSA signers still
1260
- * throw an `UnsupportedFeature`-mapped JS error.
1302
+ * `WasmPdfDocument.signatures()`. `verify()` runs the signer-attributes
1303
+ * check; `verifyDetached()` adds the `messageDigest` content-hash check.
1304
+ * Supported: RSA-PKCS#1 v1.5, RSA-PSS, ECDSA P-256/P-384.
1261
1305
  */
1262
1306
  export class WasmSignature {
1263
1307
  private constructor();
@@ -1335,7 +1379,11 @@ export class WasmTimestamp {
1335
1379
  */
1336
1380
  static parse(data: Uint8Array): WasmTimestamp;
1337
1381
  /**
1338
- * Cryptographic verify not yet implemented.
1382
+ * Cryptographically verify this TimeStampToken.
1383
+ *
1384
+ * Returns `true` when the TSA's signature and `messageDigest` both pass.
1385
+ * Returns `false` when a crypto check fails (tampered token or wrong key).
1386
+ * Throws when the token is not CMS-wrapped or uses an unsupported algorithm.
1339
1387
  */
1340
1388
  verify(): boolean;
1341
1389
  /**
@@ -1371,6 +1419,20 @@ export class WasmTimestamp {
1371
1419
  */
1372
1420
  export function disableLogging(): void;
1373
1421
 
1422
+ /**
1423
+ * Generate a 1D barcode as an SVG string.
1424
+ *
1425
+ * `barcodeType`: 0=Code128, 1=Code39, 2=EAN13, 3=EAN8, 4=UPCA, 5=ITF, 6=Code93, 7=Codabar.
1426
+ */
1427
+ export function generateBarcodeSvg(barcode_type: number, data: string): string;
1428
+
1429
+ /**
1430
+ * Generate a QR code as an SVG string.
1431
+ *
1432
+ * `errorCorrection`: 0=Low, 1=Medium, 2=Quartile, 3=High. `size`: advisory pixel size.
1433
+ */
1434
+ export function generateQrSvg(data: string, error_correction: number, size: number): string;
1435
+
1374
1436
  /**
1375
1437
  * Set the maximum log level for pdf_oxide messages.
1376
1438
  *
@@ -5,5 +5,5 @@ import { __wbg_set_wasm } from "./pdf_oxide_bg.js";
5
5
  __wbg_set_wasm(wasm);
6
6
 
7
7
  export {
8
- Align, ArtifactStyle, StreamingTable, WasmArtifact, WasmCertificate, WasmDocumentBuilder, WasmEmbeddedFont, WasmFluentPageBuilder, WasmFooter, WasmHeader, WasmOcrConfig, WasmOcrEngine, WasmPageTemplate, WasmPdf, WasmPdfDocument, WasmPdfPageRegion, WasmSignature, WasmTimestamp, disableLogging, setLogLevel, signPdfBytes
8
+ Align, ArtifactStyle, StreamingTable, WasmArtifact, WasmCertificate, WasmDocumentBuilder, WasmEmbeddedFont, WasmFluentPageBuilder, WasmFooter, WasmHeader, WasmOcrConfig, WasmOcrEngine, WasmPageTemplate, WasmPdf, WasmPdfDocument, WasmPdfPageRegion, WasmSignature, WasmTimestamp, disableLogging, generateBarcodeSvg, generateQrSvg, setLogLevel, signPdfBytes
9
9
  } from "./pdf_oxide_bg.js";
@@ -115,6 +115,14 @@ export class StreamingTable {
115
115
  const ptr = this.__destroy_into_raw();
116
116
  wasm.__wbg_streamingtable_free(ptr, 0);
117
117
  }
118
+ /**
119
+ * Number of fully-completed batches waiting for finish().
120
+ * @returns {number}
121
+ */
122
+ batchCount() {
123
+ const ret = wasm.streamingtable_batchCount(this.__wbg_ptr);
124
+ return ret >>> 0;
125
+ }
118
126
  /**
119
127
  * Number of columns configured on this streaming table.
120
128
  * @returns {number}
@@ -142,10 +150,25 @@ export class StreamingTable {
142
150
  wasm.__wbindgen_add_to_stack_pointer(16);
143
151
  }
144
152
  }
153
+ /**
154
+ * Explicitly flush the current batch to `completed_batches`.
155
+ * Called automatically when `batch_size` rows accumulate.
156
+ */
157
+ flush() {
158
+ wasm.streamingtable_flush(this.__wbg_ptr);
159
+ }
160
+ /**
161
+ * Number of rows in the current (not-yet-flushed) batch.
162
+ * @returns {number}
163
+ */
164
+ pendingRowCount() {
165
+ const ret = wasm.streamingtable_pendingRowCount(this.__wbg_ptr);
166
+ return ret >>> 0;
167
+ }
145
168
  /**
146
169
  * Push one row as an array of cell strings (all rowspan=1). Returns an
147
170
  * error if the table has already been finished or if the row's cell count
148
- * does not match the column count.
171
+ * does not match the column count. Auto-flushes the batch when full.
149
172
  * @param {string[]} cells
150
173
  */
151
174
  pushRow(cells) {
@@ -166,6 +189,7 @@ export class StreamingTable {
166
189
  /**
167
190
  * Push one row with per-cell rowspan values. `cells` is a JS array of
168
191
  * `[text, rowspan]` two-element arrays. `rowspan == 1` is a normal cell.
192
+ * Auto-flushes the batch when full.
169
193
  * @param {any} cells
170
194
  */
171
195
  pushRowSpan(cells) {
@@ -1943,6 +1967,34 @@ export class WasmFluentPageBuilder {
1943
1967
  wasm.__wbindgen_add_to_stack_pointer(16);
1944
1968
  }
1945
1969
  }
1970
+ /**
1971
+ * Draw a dashed line. `dash` is alternating on/off lengths in points; `phase` is the starting offset.
1972
+ * @param {number} x1
1973
+ * @param {number} y1
1974
+ * @param {number} x2
1975
+ * @param {number} y2
1976
+ * @param {number} width
1977
+ * @param {number} r
1978
+ * @param {number} g
1979
+ * @param {number} b
1980
+ * @param {Float32Array} dash
1981
+ * @param {number} phase
1982
+ */
1983
+ strokeLineDashed(x1, y1, x2, y2, width, r, g, b, dash, phase) {
1984
+ try {
1985
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1986
+ const ptr0 = passArrayF32ToWasm0(dash, wasm.__wbindgen_export);
1987
+ const len0 = WASM_VECTOR_LEN;
1988
+ wasm.wasmfluentpagebuilder_strokeLineDashed(retptr, this.__wbg_ptr, x1, y1, x2, y2, width, r, g, b, ptr0, len0, phase);
1989
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1990
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1991
+ if (r1) {
1992
+ throw takeObject(r0);
1993
+ }
1994
+ } finally {
1995
+ wasm.__wbindgen_add_to_stack_pointer(16);
1996
+ }
1997
+ }
1946
1998
  /**
1947
1999
  * Draw a stroked rectangle with explicit stroke width and RGB colour.
1948
2000
  * @param {number} x
@@ -1967,6 +2019,34 @@ export class WasmFluentPageBuilder {
1967
2019
  wasm.__wbindgen_add_to_stack_pointer(16);
1968
2020
  }
1969
2021
  }
2022
+ /**
2023
+ * Draw a dashed rectangle border. `dash` is alternating on/off lengths in points; `phase` is the starting offset.
2024
+ * @param {number} x
2025
+ * @param {number} y
2026
+ * @param {number} w
2027
+ * @param {number} h
2028
+ * @param {number} width
2029
+ * @param {number} r
2030
+ * @param {number} g
2031
+ * @param {number} b
2032
+ * @param {Float32Array} dash
2033
+ * @param {number} phase
2034
+ */
2035
+ strokeRectDashed(x, y, w, h, width, r, g, b, dash, phase) {
2036
+ try {
2037
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2038
+ const ptr0 = passArrayF32ToWasm0(dash, wasm.__wbindgen_export);
2039
+ const len0 = WASM_VECTOR_LEN;
2040
+ wasm.wasmfluentpagebuilder_strokeRectDashed(retptr, this.__wbg_ptr, x, y, w, h, width, r, g, b, ptr0, len0, phase);
2041
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2042
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2043
+ if (r1) {
2044
+ throw takeObject(r0);
2045
+ }
2046
+ } finally {
2047
+ wasm.__wbindgen_add_to_stack_pointer(16);
2048
+ }
2049
+ }
1970
2050
  /**
1971
2051
  * Render a buffered table from a JS object:
1972
2052
  *
@@ -2813,6 +2893,31 @@ export class WasmPdfDocument {
2813
2893
  wasm.__wbindgen_add_to_stack_pointer(16);
2814
2894
  }
2815
2895
  }
2896
+ /**
2897
+ * Convert the document to PDF/A compliance.
2898
+ *
2899
+ * Level must be one of: `"1a"`, `"1b"`, `"2a"`, `"2b"`, `"2u"`, `"3a"`, `"3b"`, `"3u"`.
2900
+ * Returns a JS object with `success`, `level`, `actions`, and `errors` fields.
2901
+ * @param {string} level
2902
+ * @returns {any}
2903
+ */
2904
+ convertToPdfA(level) {
2905
+ try {
2906
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2907
+ const ptr0 = passStringToWasm0(level, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2908
+ const len0 = WASM_VECTOR_LEN;
2909
+ wasm.wasmpdfdocument_convertToPdfA(retptr, this.__wbg_ptr, ptr0, len0);
2910
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2911
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2912
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2913
+ if (r2) {
2914
+ throw takeObject(r1);
2915
+ }
2916
+ return takeObject(r0);
2917
+ } finally {
2918
+ wasm.__wbindgen_add_to_stack_pointer(16);
2919
+ }
2920
+ }
2816
2921
  /**
2817
2922
  * Crop margins from all pages.
2818
2923
  * @param {number} left
@@ -3539,6 +3644,31 @@ export class WasmPdfDocument {
3539
3644
  wasm.__wbindgen_add_to_stack_pointer(16);
3540
3645
  }
3541
3646
  }
3647
+ /**
3648
+ * Create a flattened PDF where each page is rendered as an image.
3649
+ * Burns in all annotations, form fields, and overlays.
3650
+ * Returns the flattened PDF as bytes.
3651
+ * @param {number | null} [dpi]
3652
+ * @returns {Uint8Array}
3653
+ */
3654
+ flattenToImages(dpi) {
3655
+ try {
3656
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3657
+ wasm.wasmpdfdocument_flattenToImages(retptr, this.__wbg_ptr, isLikeNone(dpi) ? 0x100000001 : (dpi) >>> 0);
3658
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3659
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3660
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
3661
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
3662
+ if (r3) {
3663
+ throw takeObject(r2);
3664
+ }
3665
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
3666
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
3667
+ return v1;
3668
+ } finally {
3669
+ wasm.__wbindgen_add_to_stack_pointer(16);
3670
+ }
3671
+ }
3542
3672
  /**
3543
3673
  * Return warnings collected during the last form-flattening save.
3544
3674
  *
@@ -3977,6 +4107,36 @@ export class WasmPdfDocument {
3977
4107
  wasm.__wbindgen_add_to_stack_pointer(16);
3978
4108
  }
3979
4109
  }
4110
+ /**
4111
+ * Render a page to an image (PNG).
4112
+ *
4113
+ * Requires the `rendering` feature.
4114
+ *
4115
+ * @param page_index - Zero-based page number
4116
+ * @param dpi - Dots per inch (default: 150)
4117
+ * @returns Uint8Array containing the PNG image data
4118
+ * @param {number} page_index
4119
+ * @param {number | null} [dpi]
4120
+ * @returns {Uint8Array}
4121
+ */
4122
+ renderPage(page_index, dpi) {
4123
+ try {
4124
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
4125
+ wasm.wasmpdfdocument_renderPage(retptr, this.__wbg_ptr, page_index, isLikeNone(dpi) ? 0x100000001 : (dpi) >>> 0);
4126
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
4127
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
4128
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
4129
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
4130
+ if (r3) {
4131
+ throw takeObject(r2);
4132
+ }
4133
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
4134
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
4135
+ return v1;
4136
+ } finally {
4137
+ wasm.__wbindgen_add_to_stack_pointer(16);
4138
+ }
4139
+ }
3980
4140
  /**
3981
4141
  * Reposition an image on a page.
3982
4142
  * @param {number} page_index
@@ -5025,10 +5185,9 @@ if (Symbol.dispose) WasmPdfPageRegion.prototype[Symbol.dispose] = WasmPdfPageReg
5025
5185
 
5026
5186
  /**
5027
5187
  * A single existing PDF signature surfaced by
5028
- * `WasmPdfDocument.signatures()`. `verify()` runs the RSA-PKCS#1 v1.5
5029
- * signer-attributes check; `verifyDetached()` adds the
5030
- * `messageDigest` content-hash check. RSA-PSS / ECDSA signers still
5031
- * throw an `UnsupportedFeature`-mapped JS error.
5188
+ * `WasmPdfDocument.signatures()`. `verify()` runs the signer-attributes
5189
+ * check; `verifyDetached()` adds the `messageDigest` content-hash check.
5190
+ * Supported: RSA-PKCS#1 v1.5, RSA-PSS, ECDSA P-256/P-384.
5032
5191
  */
5033
5192
  export class WasmSignature {
5034
5193
  static __wrap(ptr) {
@@ -5359,7 +5518,11 @@ export class WasmTimestamp {
5359
5518
  }
5360
5519
  }
5361
5520
  /**
5362
- * Cryptographic verify not yet implemented.
5521
+ * Cryptographically verify this TimeStampToken.
5522
+ *
5523
+ * Returns `true` when the TSA's signature and `messageDigest` both pass.
5524
+ * Returns `false` when a crypto check fails (tampered token or wrong key).
5525
+ * Throws when the token is not CMS-wrapped or uses an unsupported algorithm.
5363
5526
  * @returns {boolean}
5364
5527
  */
5365
5528
  verify() {
@@ -5388,6 +5551,77 @@ export function disableLogging() {
5388
5551
  wasm.disableLogging();
5389
5552
  }
5390
5553
 
5554
+ /**
5555
+ * Generate a 1D barcode as an SVG string.
5556
+ *
5557
+ * `barcodeType`: 0=Code128, 1=Code39, 2=EAN13, 3=EAN8, 4=UPCA, 5=ITF, 6=Code93, 7=Codabar.
5558
+ * @param {number} barcode_type
5559
+ * @param {string} data
5560
+ * @returns {string}
5561
+ */
5562
+ export function generateBarcodeSvg(barcode_type, data) {
5563
+ let deferred3_0;
5564
+ let deferred3_1;
5565
+ try {
5566
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
5567
+ const ptr0 = passStringToWasm0(data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
5568
+ const len0 = WASM_VECTOR_LEN;
5569
+ wasm.generateBarcodeSvg(retptr, barcode_type, ptr0, len0);
5570
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
5571
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
5572
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
5573
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
5574
+ var ptr2 = r0;
5575
+ var len2 = r1;
5576
+ if (r3) {
5577
+ ptr2 = 0; len2 = 0;
5578
+ throw takeObject(r2);
5579
+ }
5580
+ deferred3_0 = ptr2;
5581
+ deferred3_1 = len2;
5582
+ return getStringFromWasm0(ptr2, len2);
5583
+ } finally {
5584
+ wasm.__wbindgen_add_to_stack_pointer(16);
5585
+ wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
5586
+ }
5587
+ }
5588
+
5589
+ /**
5590
+ * Generate a QR code as an SVG string.
5591
+ *
5592
+ * `errorCorrection`: 0=Low, 1=Medium, 2=Quartile, 3=High. `size`: advisory pixel size.
5593
+ * @param {string} data
5594
+ * @param {number} error_correction
5595
+ * @param {number} size
5596
+ * @returns {string}
5597
+ */
5598
+ export function generateQrSvg(data, error_correction, size) {
5599
+ let deferred3_0;
5600
+ let deferred3_1;
5601
+ try {
5602
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
5603
+ const ptr0 = passStringToWasm0(data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
5604
+ const len0 = WASM_VECTOR_LEN;
5605
+ wasm.generateQrSvg(retptr, ptr0, len0, error_correction, size);
5606
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
5607
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
5608
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
5609
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
5610
+ var ptr2 = r0;
5611
+ var len2 = r1;
5612
+ if (r3) {
5613
+ ptr2 = 0; len2 = 0;
5614
+ throw takeObject(r2);
5615
+ }
5616
+ deferred3_0 = ptr2;
5617
+ deferred3_1 = len2;
5618
+ return getStringFromWasm0(ptr2, len2);
5619
+ } finally {
5620
+ wasm.__wbindgen_add_to_stack_pointer(16);
5621
+ wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
5622
+ }
5623
+ }
5624
+
5391
5625
  /**
5392
5626
  * Set the maximum log level for pdf_oxide messages.
5393
5627
  *
Binary file
@@ -15,10 +15,15 @@ export const __wbg_wasmpdfdocument_free: (a: number, b: number) => void;
15
15
  export const __wbg_wasmpdfpageregion_free: (a: number, b: number) => void;
16
16
  export const __wbg_wasmsignature_free: (a: number, b: number) => void;
17
17
  export const __wbg_wasmtimestamp_free: (a: number, b: number) => void;
18
+ export const generateBarcodeSvg: (a: number, b: number, c: number, d: number) => void;
19
+ export const generateQrSvg: (a: number, b: number, c: number, d: number, e: number) => void;
18
20
  export const setLogLevel: (a: number, b: number, c: number) => void;
19
21
  export const signPdfBytes: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
22
+ export const streamingtable_batchCount: (a: number) => number;
20
23
  export const streamingtable_columnCount: (a: number) => number;
21
24
  export const streamingtable_finish: (a: number, b: number) => void;
25
+ export const streamingtable_flush: (a: number) => void;
26
+ export const streamingtable_pendingRowCount: (a: number) => number;
22
27
  export const streamingtable_pushRow: (a: number, b: number, c: number, d: number) => void;
23
28
  export const streamingtable_pushRowSpan: (a: number, b: number, c: number) => void;
24
29
  export const wasmartifact_center: (a: number, b: number) => number;
@@ -106,7 +111,9 @@ export const wasmfluentpagebuilder_stickyNoteAt: (a: number, b: number, c: numbe
106
111
  export const wasmfluentpagebuilder_streamingTable: (a: number, b: number, c: number) => void;
107
112
  export const wasmfluentpagebuilder_strikeout: (a: number, b: number, c: number, d: number, e: number) => void;
108
113
  export const wasmfluentpagebuilder_strokeLine: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
114
+ export const wasmfluentpagebuilder_strokeLineDashed: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number) => void;
109
115
  export const wasmfluentpagebuilder_strokeRect: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
116
+ export const wasmfluentpagebuilder_strokeRectDashed: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number) => void;
110
117
  export const wasmfluentpagebuilder_table: (a: number, b: number, c: number) => void;
111
118
  export const wasmfluentpagebuilder_text: (a: number, b: number, c: number, d: number) => void;
112
119
  export const wasmfluentpagebuilder_textField: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
@@ -135,6 +142,7 @@ export const wasmpdfdocument_applyAllRedactions: (a: number, b: number) => void;
135
142
  export const wasmpdfdocument_applyPageRedactions: (a: number, b: number, c: number) => void;
136
143
  export const wasmpdfdocument_authenticate: (a: number, b: number, c: number, d: number) => void;
137
144
  export const wasmpdfdocument_clearEraseRegions: (a: number, b: number, c: number) => void;
145
+ export const wasmpdfdocument_convertToPdfA: (a: number, b: number, c: number, d: number) => void;
138
146
  export const wasmpdfdocument_cropMargins: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
139
147
  export const wasmpdfdocument_deletePage: (a: number, b: number, c: number) => void;
140
148
  export const wasmpdfdocument_editFooter: (a: number, b: number, c: number) => void;
@@ -165,6 +173,7 @@ export const wasmpdfdocument_flattenAllAnnotations: (a: number, b: number) => vo
165
173
  export const wasmpdfdocument_flattenForms: (a: number, b: number) => void;
166
174
  export const wasmpdfdocument_flattenFormsOnPage: (a: number, b: number, c: number) => void;
167
175
  export const wasmpdfdocument_flattenPageAnnotations: (a: number, b: number, c: number) => void;
176
+ export const wasmpdfdocument_flattenToImages: (a: number, b: number, c: number) => void;
168
177
  export const wasmpdfdocument_flattenWarnings: (a: number, b: number) => void;
169
178
  export const wasmpdfdocument_getAnnotations: (a: number, b: number, c: number) => void;
170
179
  export const wasmpdfdocument_getFormFieldValue: (a: number, b: number, c: number, d: number) => void;
@@ -184,6 +193,7 @@ export const wasmpdfdocument_pageRotation: (a: number, b: number, c: number) =>
184
193
  export const wasmpdfdocument_removeArtifacts: (a: number, b: number, c: number) => void;
185
194
  export const wasmpdfdocument_removeFooters: (a: number, b: number, c: number) => void;
186
195
  export const wasmpdfdocument_removeHeaders: (a: number, b: number, c: number) => void;
196
+ export const wasmpdfdocument_renderPage: (a: number, b: number, c: number, d: number) => void;
187
197
  export const wasmpdfdocument_repositionImage: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
188
198
  export const wasmpdfdocument_resizeImage: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
189
199
  export const wasmpdfdocument_rotateAllPages: (a: number, b: number, c: number) => void;
@@ -254,8 +264,8 @@ export const wasmfooter_new: () => number;
254
264
  export const wasmheader_new: () => number;
255
265
  export const __wbg_wasmocrengine_free: (a: number, b: number) => void;
256
266
  export const disableLogging: () => void;
257
- export const __wbg_wasmheader_free: (a: number, b: number) => void;
258
267
  export const __wbg_wasmfooter_free: (a: number, b: number) => void;
268
+ export const __wbg_wasmheader_free: (a: number, b: number) => void;
259
269
  export const lut_inverse_interp16: (a: number, b: number, c: number) => number;
260
270
  export const qcms_profile_precache_output_transform: (a: number) => void;
261
271
  export const lut_interp_linear16: (a: number, b: number, c: number) => number;
@@ -60,6 +60,10 @@ export class StreamingTable {
60
60
  private constructor();
61
61
  free(): void;
62
62
  [Symbol.dispose](): void;
63
+ /**
64
+ * Number of fully-completed batches waiting for finish().
65
+ */
66
+ batchCount(): number;
63
67
  /**
64
68
  * Number of columns configured on this streaming table.
65
69
  */
@@ -71,15 +75,25 @@ export class StreamingTable {
71
75
  * throws.
72
76
  */
73
77
  finish(): void;
78
+ /**
79
+ * Explicitly flush the current batch to `completed_batches`.
80
+ * Called automatically when `batch_size` rows accumulate.
81
+ */
82
+ flush(): void;
83
+ /**
84
+ * Number of rows in the current (not-yet-flushed) batch.
85
+ */
86
+ pendingRowCount(): number;
74
87
  /**
75
88
  * Push one row as an array of cell strings (all rowspan=1). Returns an
76
89
  * error if the table has already been finished or if the row's cell count
77
- * does not match the column count.
90
+ * does not match the column count. Auto-flushes the batch when full.
78
91
  */
79
92
  pushRow(cells: string[]): void;
80
93
  /**
81
94
  * Push one row with per-cell rowspan values. `cells` is a JS array of
82
95
  * `[text, rowspan]` two-element arrays. `rowspan == 1` is a normal cell.
96
+ * Auto-flushes the batch when full.
83
97
  */
84
98
  pushRowSpan(cells: any): void;
85
99
  }
@@ -450,10 +464,18 @@ export class WasmFluentPageBuilder {
450
464
  * Draw a straight line with explicit stroke width and RGB colour.
451
465
  */
452
466
  strokeLine(x1: number, y1: number, x2: number, y2: number, width: number, r: number, g: number, b: number): void;
467
+ /**
468
+ * Draw a dashed line. `dash` is alternating on/off lengths in points; `phase` is the starting offset.
469
+ */
470
+ strokeLineDashed(x1: number, y1: number, x2: number, y2: number, width: number, r: number, g: number, b: number, dash: Float32Array, phase: number): void;
453
471
  /**
454
472
  * Draw a stroked rectangle with explicit stroke width and RGB colour.
455
473
  */
456
474
  strokeRect(x: number, y: number, w: number, h: number, width: number, r: number, g: number, b: number): void;
475
+ /**
476
+ * Draw a dashed rectangle border. `dash` is alternating on/off lengths in points; `phase` is the starting offset.
477
+ */
478
+ strokeRectDashed(x: number, y: number, w: number, h: number, width: number, r: number, g: number, b: number, dash: Float32Array, phase: number): void;
457
479
  /**
458
480
  * Render a buffered table from a JS object:
459
481
  *
@@ -700,6 +722,13 @@ export class WasmPdfDocument {
700
722
  * Clear all pending erase operations for a page.
701
723
  */
702
724
  clearEraseRegions(page_index: number): void;
725
+ /**
726
+ * Convert the document to PDF/A compliance.
727
+ *
728
+ * Level must be one of: `"1a"`, `"1b"`, `"2a"`, `"2b"`, `"2u"`, `"3a"`, `"3b"`, `"3u"`.
729
+ * Returns a JS object with `success`, `level`, `actions`, and `errors` fields.
730
+ */
731
+ convertToPdfA(level: string): any;
703
732
  /**
704
733
  * Crop margins from all pages.
705
734
  */
@@ -899,6 +928,12 @@ export class WasmPdfDocument {
899
928
  * Flatten annotations on a page into the page content.
900
929
  */
901
930
  flattenPageAnnotations(page_index: number): void;
931
+ /**
932
+ * Create a flattened PDF where each page is rendered as an image.
933
+ * Burns in all annotations, form fields, and overlays.
934
+ * Returns the flattened PDF as bytes.
935
+ */
936
+ flattenToImages(dpi?: number | null): Uint8Array;
902
937
  /**
903
938
  * Return warnings collected during the last form-flattening save.
904
939
  *
@@ -1031,6 +1066,16 @@ export class WasmPdfDocument {
1031
1066
  * @param threshold - Fraction of pages (0.0-1.0) where text must repeat (heuristic mode)
1032
1067
  */
1033
1068
  removeHeaders(threshold: number): number;
1069
+ /**
1070
+ * Render a page to an image (PNG).
1071
+ *
1072
+ * Requires the `rendering` feature.
1073
+ *
1074
+ * @param page_index - Zero-based page number
1075
+ * @param dpi - Dots per inch (default: 150)
1076
+ * @returns Uint8Array containing the PNG image data
1077
+ */
1078
+ renderPage(page_index: number, dpi?: number | null): Uint8Array;
1034
1079
  /**
1035
1080
  * Reposition an image on a page.
1036
1081
  */
@@ -1254,10 +1299,9 @@ export class WasmPdfPageRegion {
1254
1299
 
1255
1300
  /**
1256
1301
  * A single existing PDF signature surfaced by
1257
- * `WasmPdfDocument.signatures()`. `verify()` runs the RSA-PKCS#1 v1.5
1258
- * signer-attributes check; `verifyDetached()` adds the
1259
- * `messageDigest` content-hash check. RSA-PSS / ECDSA signers still
1260
- * throw an `UnsupportedFeature`-mapped JS error.
1302
+ * `WasmPdfDocument.signatures()`. `verify()` runs the signer-attributes
1303
+ * check; `verifyDetached()` adds the `messageDigest` content-hash check.
1304
+ * Supported: RSA-PKCS#1 v1.5, RSA-PSS, ECDSA P-256/P-384.
1261
1305
  */
1262
1306
  export class WasmSignature {
1263
1307
  private constructor();
@@ -1335,7 +1379,11 @@ export class WasmTimestamp {
1335
1379
  */
1336
1380
  static parse(data: Uint8Array): WasmTimestamp;
1337
1381
  /**
1338
- * Cryptographic verify not yet implemented.
1382
+ * Cryptographically verify this TimeStampToken.
1383
+ *
1384
+ * Returns `true` when the TSA's signature and `messageDigest` both pass.
1385
+ * Returns `false` when a crypto check fails (tampered token or wrong key).
1386
+ * Throws when the token is not CMS-wrapped or uses an unsupported algorithm.
1339
1387
  */
1340
1388
  verify(): boolean;
1341
1389
  /**
@@ -1371,6 +1419,20 @@ export class WasmTimestamp {
1371
1419
  */
1372
1420
  export function disableLogging(): void;
1373
1421
 
1422
+ /**
1423
+ * Generate a 1D barcode as an SVG string.
1424
+ *
1425
+ * `barcodeType`: 0=Code128, 1=Code39, 2=EAN13, 3=EAN8, 4=UPCA, 5=ITF, 6=Code93, 7=Codabar.
1426
+ */
1427
+ export function generateBarcodeSvg(barcode_type: number, data: string): string;
1428
+
1429
+ /**
1430
+ * Generate a QR code as an SVG string.
1431
+ *
1432
+ * `errorCorrection`: 0=Low, 1=Medium, 2=Quartile, 3=High. `size`: advisory pixel size.
1433
+ */
1434
+ export function generateQrSvg(data: string, error_correction: number, size: number): string;
1435
+
1374
1436
  /**
1375
1437
  * Set the maximum log level for pdf_oxide messages.
1376
1438
  *