@pdfluent/sdk-wasm 1.0.0-beta.17.5 → 1.0.0
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/LICENSE +661 -249
- package/LICENSE-COMMERCIAL +212 -0
- package/LICENSE-OFFER +45 -0
- package/NOTICE +143 -0
- package/README.md +23 -54
- package/THIRD_PARTY_LICENSES.txt +736 -0
- package/package.json +19 -4
- package/xfa_wasm.d.ts +23 -72
- package/xfa_wasm.js +77 -169
- package/xfa_wasm_bg.wasm +0 -0
- package/xfa_wasm_bg.wasm.d.ts +3 -8
- package/snippets/xfa-wasm-f07fc2bb4f3d6191/inline0.js +0 -19
- /package/snippets/{xfa-wasm-1b4411ed25cdb886 → xfa-wasm-df2db187f9a0e994}/inline0.js +0 -0
package/package.json
CHANGED
|
@@ -2,14 +2,23 @@
|
|
|
2
2
|
"name": "@pdfluent/sdk-wasm",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"description": "PDFluent browser SDK — find and replace PDF text programmatically while preserving fonts and layout, plus edit, annotate, redact, sign and validate PDFs (including XFA), entirely client-side via WASM.",
|
|
5
|
-
"version": "1.0.0
|
|
6
|
-
"license": "SEE LICENSE IN LICENSE",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"license": "SEE LICENSE IN LICENSE-OFFER",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/pdfluent/pdfluent-sdk"
|
|
10
|
+
},
|
|
7
11
|
"files": [
|
|
8
12
|
"xfa_wasm_bg.wasm",
|
|
9
13
|
"xfa_wasm.js",
|
|
10
14
|
"xfa_wasm.d.ts",
|
|
11
15
|
"snippets",
|
|
12
|
-
"xfa_wasm_bg.wasm.d.ts"
|
|
16
|
+
"xfa_wasm_bg.wasm.d.ts",
|
|
17
|
+
"LICENSE",
|
|
18
|
+
"LICENSE-COMMERCIAL",
|
|
19
|
+
"LICENSE-OFFER",
|
|
20
|
+
"NOTICE",
|
|
21
|
+
"THIRD_PARTY_LICENSES.txt"
|
|
13
22
|
],
|
|
14
23
|
"main": "xfa_wasm.js",
|
|
15
24
|
"types": "xfa_wasm.d.ts",
|
|
@@ -34,5 +43,11 @@
|
|
|
34
43
|
"redact"
|
|
35
44
|
],
|
|
36
45
|
"homepage": "https://pdfluent.com",
|
|
37
|
-
"author": "Innovation Trigger BV <team@pdfluent.com>"
|
|
46
|
+
"author": "Innovation Trigger BV <team@pdfluent.com>",
|
|
47
|
+
"bugs": {
|
|
48
|
+
"url": "https://github.com/pdfluent/pdfluent-sdk/issues"
|
|
49
|
+
},
|
|
50
|
+
"publishConfig": {
|
|
51
|
+
"access": "public"
|
|
52
|
+
}
|
|
38
53
|
}
|
package/xfa_wasm.d.ts
CHANGED
|
@@ -23,27 +23,6 @@ export enum ChromaSampling {
|
|
|
23
23
|
Cs400 = 3,
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
/**
|
|
27
|
-
* Status of the currently-active license.
|
|
28
|
-
*/
|
|
29
|
-
export class LicenseStatus {
|
|
30
|
-
private constructor();
|
|
31
|
-
free(): void;
|
|
32
|
-
[Symbol.dispose](): void;
|
|
33
|
-
/**
|
|
34
|
-
* Whether output is marked via `/Producer` metadata (Trial tier).
|
|
35
|
-
*/
|
|
36
|
-
readonly outputIsMarked: boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Source: `"Default" | "EnvVar" | "Explicit"`.
|
|
39
|
-
*/
|
|
40
|
-
readonly source: string;
|
|
41
|
-
/**
|
|
42
|
-
* Tier name: `"Trial" | "Developer" | "Team" | "Business" | "Enterprise"`.
|
|
43
|
-
*/
|
|
44
|
-
readonly tier: string;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
26
|
/**
|
|
48
27
|
* PDF document handle for analysis and text extraction.
|
|
49
28
|
*
|
|
@@ -308,6 +287,25 @@ export class PdfDoc {
|
|
|
308
287
|
* extraction fails.
|
|
309
288
|
*/
|
|
310
289
|
text(page_index: number): string;
|
|
290
|
+
/**
|
|
291
|
+
* Convert this PDF to a Word `.docx` package.
|
|
292
|
+
*
|
|
293
|
+
* Returns the package as a `Uint8Array`.
|
|
294
|
+
*
|
|
295
|
+
* The browser SDK could not do this until 23-08-2026: the conversion
|
|
296
|
+
* crates were excluded from wasm32 by a comment that applied to the
|
|
297
|
+
* renderer, not to them.
|
|
298
|
+
*/
|
|
299
|
+
toDocx(): Uint8Array;
|
|
300
|
+
/**
|
|
301
|
+
* Convert this PDF to a PowerPoint `.pptx` deck, one slide per page.
|
|
302
|
+
* See [`Self::to_docx`].
|
|
303
|
+
*/
|
|
304
|
+
toPptx(): Uint8Array;
|
|
305
|
+
/**
|
|
306
|
+
* Convert this PDF to an Excel `.xlsx` workbook. See [`Self::to_docx`].
|
|
307
|
+
*/
|
|
308
|
+
toXlsx(): Uint8Array;
|
|
311
309
|
/**
|
|
312
310
|
* Validate against a PDF/A level. Returns compliance report as JSON.
|
|
313
311
|
*/
|
|
@@ -503,7 +501,7 @@ export class PdfDocMut {
|
|
|
503
501
|
}
|
|
504
502
|
|
|
505
503
|
/**
|
|
506
|
-
* Find-and-replace editor over a PDF document (SDK surface
|
|
504
|
+
* Find-and-replace editor over a PDF document (SDK surface).
|
|
507
505
|
*/
|
|
508
506
|
export class TextEditor {
|
|
509
507
|
private constructor();
|
|
@@ -663,62 +661,14 @@ export class XfaEngine {
|
|
|
663
661
|
static version(): string;
|
|
664
662
|
}
|
|
665
663
|
|
|
666
|
-
/**
|
|
667
|
-
* Activate the process-global license from a key string.
|
|
668
|
-
*
|
|
669
|
-
* Throws on invalid key or if the process has already been activated to a
|
|
670
|
-
* different tier this session.
|
|
671
|
-
*/
|
|
672
|
-
export function activateLicenseKey(key: string): void;
|
|
673
|
-
|
|
674
|
-
/**
|
|
675
|
-
* Return the current license status. Always succeeds; defaults to Trial.
|
|
676
|
-
*/
|
|
677
|
-
export function licenseStatus(): LicenseStatus;
|
|
678
|
-
|
|
679
|
-
/**
|
|
680
|
-
* Activate a signed license payload (Ed25519-verified JSON).
|
|
681
|
-
*
|
|
682
|
-
* Mirrors the Node binding `setLicensePayload` and the Rust core
|
|
683
|
-
* [`pdfluent::set_license_payload`]. Verifies the signature against the key
|
|
684
|
-
* set via [`set_license_public_key`], checks `expires_at > now`, and stores
|
|
685
|
-
* the resolved tier process-wide so [`license_status`] surfaces it.
|
|
686
|
-
*
|
|
687
|
-
* Throws `E-LICENSE-INVALID` (no public key configured, malformed JSON,
|
|
688
|
-
* unrecognised tier, or already set to a different tier),
|
|
689
|
-
* `E-LICENSE-INVALID-SIGNATURE` (signature does not verify), or
|
|
690
|
-
* `E-LICENSE-EXPIRED` (payload expired). On any error the process-global
|
|
691
|
-
* tier is **not** modified.
|
|
692
|
-
*/
|
|
693
|
-
export function setLicensePayload(payload_json: string): void;
|
|
694
|
-
|
|
695
|
-
/**
|
|
696
|
-
* Inject the Ed25519 public verification key for signed license payloads.
|
|
697
|
-
*
|
|
698
|
-
* Mirrors the Node binding `setLicensePublicKey` and the Rust core
|
|
699
|
-
* [`pdfluent::set_license_public_key`]. Must be called **before**
|
|
700
|
-
* [`set_license_payload`]. `public_key` must be exactly 32 bytes.
|
|
701
|
-
*
|
|
702
|
-
* Calling twice with the same key bytes is idempotent; calling with a
|
|
703
|
-
* different key throws (`E-LICENSE-INVALID`) — restart the worker/page to
|
|
704
|
-
* swap keys.
|
|
705
|
-
*/
|
|
706
|
-
export function setLicensePublicKey(public_key: Uint8Array): void;
|
|
707
|
-
|
|
708
664
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
709
665
|
|
|
710
666
|
export interface InitOutput {
|
|
711
667
|
readonly memory: WebAssembly.Memory;
|
|
712
|
-
readonly __wbg_licensestatus_free: (a: number, b: number) => void;
|
|
713
668
|
readonly __wbg_pdfdoc_free: (a: number, b: number) => void;
|
|
714
669
|
readonly __wbg_pdfdocmut_free: (a: number, b: number) => void;
|
|
715
670
|
readonly __wbg_texteditor_free: (a: number, b: number) => void;
|
|
716
671
|
readonly __wbg_xfaengine_free: (a: number, b: number) => void;
|
|
717
|
-
readonly activateLicenseKey: (a: number, b: number, c: number) => void;
|
|
718
|
-
readonly licenseStatus: () => number;
|
|
719
|
-
readonly licensestatus_outputIsMarked: (a: number) => number;
|
|
720
|
-
readonly licensestatus_source: (a: number, b: number) => void;
|
|
721
|
-
readonly licensestatus_tier: (a: number, b: number) => void;
|
|
722
672
|
readonly pdfdoc_addFreeText: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
723
673
|
readonly pdfdoc_addHighlight: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
724
674
|
readonly pdfdoc_addStickyNote: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
@@ -751,6 +701,9 @@ export interface InitOutput {
|
|
|
751
701
|
readonly pdfdoc_setFormFields: (a: number, b: number, c: number, d: number) => void;
|
|
752
702
|
readonly pdfdoc_signatures: (a: number, b: number) => void;
|
|
753
703
|
readonly pdfdoc_text: (a: number, b: number, c: number) => void;
|
|
704
|
+
readonly pdfdoc_toDocx: (a: number, b: number) => void;
|
|
705
|
+
readonly pdfdoc_toPptx: (a: number, b: number) => void;
|
|
706
|
+
readonly pdfdoc_toXlsx: (a: number, b: number) => void;
|
|
754
707
|
readonly pdfdoc_validatePdfA: (a: number, b: number, c: number, d: number) => void;
|
|
755
708
|
readonly pdfdoc_verifySignatures: (a: number, b: number) => void;
|
|
756
709
|
readonly pdfdocmut_addFreeText: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
@@ -775,8 +728,6 @@ export interface InitOutput {
|
|
|
775
728
|
readonly pdfdocmut_setFormFields: (a: number, b: number, c: number, d: number) => void;
|
|
776
729
|
readonly pdfdocmut_setMultiSelect: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
777
730
|
readonly pdfdocmut_setTextRunStyle: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
778
|
-
readonly setLicensePayload: (a: number, b: number, c: number) => void;
|
|
779
|
-
readonly setLicensePublicKey: (a: number, b: number, c: number) => void;
|
|
780
731
|
readonly texteditor_findText: (a: number, b: number, c: number, d: number) => void;
|
|
781
732
|
readonly texteditor_open: (a: number, b: number, c: number) => void;
|
|
782
733
|
readonly texteditor_pageCount: (a: number) => number;
|
package/xfa_wasm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* @ts-self-types="./xfa_wasm.d.ts" */
|
|
2
|
-
import { __pdfluent_error_ctor } from './snippets/xfa-wasm-
|
|
2
|
+
import { __pdfluent_error_ctor } from './snippets/xfa-wasm-df2db187f9a0e994/inline0.js';
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -25,77 +25,6 @@ export const ChromaSampling = Object.freeze({
|
|
|
25
25
|
Cs400: 3, "3": "Cs400",
|
|
26
26
|
});
|
|
27
27
|
|
|
28
|
-
/**
|
|
29
|
-
* Status of the currently-active license.
|
|
30
|
-
*/
|
|
31
|
-
export class LicenseStatus {
|
|
32
|
-
static __wrap(ptr) {
|
|
33
|
-
const obj = Object.create(LicenseStatus.prototype);
|
|
34
|
-
obj.__wbg_ptr = ptr;
|
|
35
|
-
LicenseStatusFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
36
|
-
return obj;
|
|
37
|
-
}
|
|
38
|
-
__destroy_into_raw() {
|
|
39
|
-
const ptr = this.__wbg_ptr;
|
|
40
|
-
this.__wbg_ptr = 0;
|
|
41
|
-
LicenseStatusFinalization.unregister(this);
|
|
42
|
-
return ptr;
|
|
43
|
-
}
|
|
44
|
-
free() {
|
|
45
|
-
const ptr = this.__destroy_into_raw();
|
|
46
|
-
wasm.__wbg_licensestatus_free(ptr, 0);
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Whether output is marked via `/Producer` metadata (Trial tier).
|
|
50
|
-
* @returns {boolean}
|
|
51
|
-
*/
|
|
52
|
-
get outputIsMarked() {
|
|
53
|
-
const ret = wasm.licensestatus_outputIsMarked(this.__wbg_ptr);
|
|
54
|
-
return ret !== 0;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Source: `"Default" | "EnvVar" | "Explicit"`.
|
|
58
|
-
* @returns {string}
|
|
59
|
-
*/
|
|
60
|
-
get source() {
|
|
61
|
-
let deferred1_0;
|
|
62
|
-
let deferred1_1;
|
|
63
|
-
try {
|
|
64
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
65
|
-
wasm.licensestatus_source(retptr, this.__wbg_ptr);
|
|
66
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
67
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
68
|
-
deferred1_0 = r0;
|
|
69
|
-
deferred1_1 = r1;
|
|
70
|
-
return getStringFromWasm0(r0, r1);
|
|
71
|
-
} finally {
|
|
72
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
73
|
-
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Tier name: `"Trial" | "Developer" | "Team" | "Business" | "Enterprise"`.
|
|
78
|
-
* @returns {string}
|
|
79
|
-
*/
|
|
80
|
-
get tier() {
|
|
81
|
-
let deferred1_0;
|
|
82
|
-
let deferred1_1;
|
|
83
|
-
try {
|
|
84
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
85
|
-
wasm.licensestatus_tier(retptr, this.__wbg_ptr);
|
|
86
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
87
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
88
|
-
deferred1_0 = r0;
|
|
89
|
-
deferred1_1 = r1;
|
|
90
|
-
return getStringFromWasm0(r0, r1);
|
|
91
|
-
} finally {
|
|
92
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
93
|
-
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
if (Symbol.dispose) LicenseStatus.prototype[Symbol.dispose] = LicenseStatus.prototype.free;
|
|
98
|
-
|
|
99
28
|
/**
|
|
100
29
|
* PDF document handle for analysis and text extraction.
|
|
101
30
|
*
|
|
@@ -959,6 +888,79 @@ export class PdfDoc {
|
|
|
959
888
|
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
960
889
|
}
|
|
961
890
|
}
|
|
891
|
+
/**
|
|
892
|
+
* Convert this PDF to a Word `.docx` package.
|
|
893
|
+
*
|
|
894
|
+
* Returns the package as a `Uint8Array`.
|
|
895
|
+
*
|
|
896
|
+
* The browser SDK could not do this until 23-08-2026: the conversion
|
|
897
|
+
* crates were excluded from wasm32 by a comment that applied to the
|
|
898
|
+
* renderer, not to them.
|
|
899
|
+
* @returns {Uint8Array}
|
|
900
|
+
*/
|
|
901
|
+
toDocx() {
|
|
902
|
+
try {
|
|
903
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
904
|
+
wasm.pdfdoc_toDocx(retptr, this.__wbg_ptr);
|
|
905
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
906
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
907
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
908
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
909
|
+
if (r3) {
|
|
910
|
+
throw takeObject(r2);
|
|
911
|
+
}
|
|
912
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
913
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
914
|
+
return v1;
|
|
915
|
+
} finally {
|
|
916
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
/**
|
|
920
|
+
* Convert this PDF to a PowerPoint `.pptx` deck, one slide per page.
|
|
921
|
+
* See [`Self::to_docx`].
|
|
922
|
+
* @returns {Uint8Array}
|
|
923
|
+
*/
|
|
924
|
+
toPptx() {
|
|
925
|
+
try {
|
|
926
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
927
|
+
wasm.pdfdoc_toPptx(retptr, this.__wbg_ptr);
|
|
928
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
929
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
930
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
931
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
932
|
+
if (r3) {
|
|
933
|
+
throw takeObject(r2);
|
|
934
|
+
}
|
|
935
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
936
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
937
|
+
return v1;
|
|
938
|
+
} finally {
|
|
939
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
/**
|
|
943
|
+
* Convert this PDF to an Excel `.xlsx` workbook. See [`Self::to_docx`].
|
|
944
|
+
* @returns {Uint8Array}
|
|
945
|
+
*/
|
|
946
|
+
toXlsx() {
|
|
947
|
+
try {
|
|
948
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
949
|
+
wasm.pdfdoc_toXlsx(retptr, this.__wbg_ptr);
|
|
950
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
951
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
952
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
953
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
954
|
+
if (r3) {
|
|
955
|
+
throw takeObject(r2);
|
|
956
|
+
}
|
|
957
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
958
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
959
|
+
return v1;
|
|
960
|
+
} finally {
|
|
961
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
962
|
+
}
|
|
963
|
+
}
|
|
962
964
|
/**
|
|
963
965
|
* Validate against a PDF/A level. Returns compliance report as JSON.
|
|
964
966
|
* @param {string} level
|
|
@@ -1630,7 +1632,7 @@ export class PdfDocMut {
|
|
|
1630
1632
|
if (Symbol.dispose) PdfDocMut.prototype[Symbol.dispose] = PdfDocMut.prototype.free;
|
|
1631
1633
|
|
|
1632
1634
|
/**
|
|
1633
|
-
* Find-and-replace editor over a PDF document (SDK surface
|
|
1635
|
+
* Find-and-replace editor over a PDF document (SDK surface).
|
|
1634
1636
|
*/
|
|
1635
1637
|
export class TextEditor {
|
|
1636
1638
|
static __wrap(ptr) {
|
|
@@ -2107,101 +2109,10 @@ export class XfaEngine {
|
|
|
2107
2109
|
}
|
|
2108
2110
|
}
|
|
2109
2111
|
if (Symbol.dispose) XfaEngine.prototype[Symbol.dispose] = XfaEngine.prototype.free;
|
|
2110
|
-
|
|
2111
|
-
/**
|
|
2112
|
-
* Activate the process-global license from a key string.
|
|
2113
|
-
*
|
|
2114
|
-
* Throws on invalid key or if the process has already been activated to a
|
|
2115
|
-
* different tier this session.
|
|
2116
|
-
* @param {string} key
|
|
2117
|
-
*/
|
|
2118
|
-
export function activateLicenseKey(key) {
|
|
2119
|
-
try {
|
|
2120
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2121
|
-
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2122
|
-
const len0 = WASM_VECTOR_LEN;
|
|
2123
|
-
wasm.activateLicenseKey(retptr, ptr0, len0);
|
|
2124
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2125
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2126
|
-
if (r1) {
|
|
2127
|
-
throw takeObject(r0);
|
|
2128
|
-
}
|
|
2129
|
-
} finally {
|
|
2130
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2131
|
-
}
|
|
2132
|
-
}
|
|
2133
|
-
|
|
2134
|
-
/**
|
|
2135
|
-
* Return the current license status. Always succeeds; defaults to Trial.
|
|
2136
|
-
* @returns {LicenseStatus}
|
|
2137
|
-
*/
|
|
2138
|
-
export function licenseStatus() {
|
|
2139
|
-
const ret = wasm.licenseStatus();
|
|
2140
|
-
return LicenseStatus.__wrap(ret);
|
|
2141
|
-
}
|
|
2142
|
-
|
|
2143
|
-
/**
|
|
2144
|
-
* Activate a signed license payload (Ed25519-verified JSON).
|
|
2145
|
-
*
|
|
2146
|
-
* Mirrors the Node binding `setLicensePayload` and the Rust core
|
|
2147
|
-
* [`pdfluent::set_license_payload`]. Verifies the signature against the key
|
|
2148
|
-
* set via [`set_license_public_key`], checks `expires_at > now`, and stores
|
|
2149
|
-
* the resolved tier process-wide so [`license_status`] surfaces it.
|
|
2150
|
-
*
|
|
2151
|
-
* Throws `E-LICENSE-INVALID` (no public key configured, malformed JSON,
|
|
2152
|
-
* unrecognised tier, or already set to a different tier),
|
|
2153
|
-
* `E-LICENSE-INVALID-SIGNATURE` (signature does not verify), or
|
|
2154
|
-
* `E-LICENSE-EXPIRED` (payload expired). On any error the process-global
|
|
2155
|
-
* tier is **not** modified.
|
|
2156
|
-
* @param {string} payload_json
|
|
2157
|
-
*/
|
|
2158
|
-
export function setLicensePayload(payload_json) {
|
|
2159
|
-
try {
|
|
2160
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2161
|
-
const ptr0 = passStringToWasm0(payload_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2162
|
-
const len0 = WASM_VECTOR_LEN;
|
|
2163
|
-
wasm.setLicensePayload(retptr, ptr0, len0);
|
|
2164
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2165
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2166
|
-
if (r1) {
|
|
2167
|
-
throw takeObject(r0);
|
|
2168
|
-
}
|
|
2169
|
-
} finally {
|
|
2170
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2171
|
-
}
|
|
2172
|
-
}
|
|
2173
|
-
|
|
2174
|
-
/**
|
|
2175
|
-
* Inject the Ed25519 public verification key for signed license payloads.
|
|
2176
|
-
*
|
|
2177
|
-
* Mirrors the Node binding `setLicensePublicKey` and the Rust core
|
|
2178
|
-
* [`pdfluent::set_license_public_key`]. Must be called **before**
|
|
2179
|
-
* [`set_license_payload`]. `public_key` must be exactly 32 bytes.
|
|
2180
|
-
*
|
|
2181
|
-
* Calling twice with the same key bytes is idempotent; calling with a
|
|
2182
|
-
* different key throws (`E-LICENSE-INVALID`) — restart the worker/page to
|
|
2183
|
-
* swap keys.
|
|
2184
|
-
* @param {Uint8Array} public_key
|
|
2185
|
-
*/
|
|
2186
|
-
export function setLicensePublicKey(public_key) {
|
|
2187
|
-
try {
|
|
2188
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2189
|
-
const ptr0 = passArray8ToWasm0(public_key, wasm.__wbindgen_export);
|
|
2190
|
-
const len0 = WASM_VECTOR_LEN;
|
|
2191
|
-
wasm.setLicensePublicKey(retptr, ptr0, len0);
|
|
2192
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2193
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2194
|
-
if (r1) {
|
|
2195
|
-
throw takeObject(r0);
|
|
2196
|
-
}
|
|
2197
|
-
} finally {
|
|
2198
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2199
|
-
}
|
|
2200
|
-
}
|
|
2201
2112
|
function __wbg_get_imports() {
|
|
2202
2113
|
const import0 = {
|
|
2203
2114
|
__proto__: null,
|
|
2204
|
-
|
|
2115
|
+
__wbg___pdfluent_error_ctor_e55fae67914d7975: function() {
|
|
2205
2116
|
const ret = __pdfluent_error_ctor();
|
|
2206
2117
|
return addHeapObject(ret);
|
|
2207
2118
|
},
|
|
@@ -2259,7 +2170,7 @@ function __wbg_get_imports() {
|
|
|
2259
2170
|
const ret = getObject(arg0).getContext(getStringFromWasm0(arg1, arg2));
|
|
2260
2171
|
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
2261
2172
|
}, arguments); },
|
|
2262
|
-
|
|
2173
|
+
__wbg_getRandomValues_76dfc69825c9c552: function() { return handleError(function (arg0, arg1) {
|
|
2263
2174
|
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
2264
2175
|
}, arguments); },
|
|
2265
2176
|
__wbg_instanceof_CanvasRenderingContext2d_d4be74cff7165c1e: function(arg0) {
|
|
@@ -2398,9 +2309,6 @@ function __wbg_get_imports() {
|
|
|
2398
2309
|
}
|
|
2399
2310
|
|
|
2400
2311
|
const __wbindgen_enum_CanvasWindingRule = ["nonzero", "evenodd"];
|
|
2401
|
-
const LicenseStatusFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2402
|
-
? { register: () => {}, unregister: () => {} }
|
|
2403
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_licensestatus_free(ptr, 1));
|
|
2404
2312
|
const PdfDocFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2405
2313
|
? { register: () => {}, unregister: () => {} }
|
|
2406
2314
|
: new FinalizationRegistry(ptr => wasm.__wbg_pdfdoc_free(ptr, 1));
|
package/xfa_wasm_bg.wasm
CHANGED
|
Binary file
|
package/xfa_wasm_bg.wasm.d.ts
CHANGED
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export const __wbg_licensestatus_free: (a: number, b: number) => void;
|
|
5
4
|
export const __wbg_pdfdoc_free: (a: number, b: number) => void;
|
|
6
5
|
export const __wbg_pdfdocmut_free: (a: number, b: number) => void;
|
|
7
6
|
export const __wbg_texteditor_free: (a: number, b: number) => void;
|
|
8
7
|
export const __wbg_xfaengine_free: (a: number, b: number) => void;
|
|
9
|
-
export const activateLicenseKey: (a: number, b: number, c: number) => void;
|
|
10
|
-
export const licenseStatus: () => number;
|
|
11
|
-
export const licensestatus_outputIsMarked: (a: number) => number;
|
|
12
|
-
export const licensestatus_source: (a: number, b: number) => void;
|
|
13
|
-
export const licensestatus_tier: (a: number, b: number) => void;
|
|
14
8
|
export const pdfdoc_addFreeText: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
15
9
|
export const pdfdoc_addHighlight: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
16
10
|
export const pdfdoc_addStickyNote: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
@@ -43,6 +37,9 @@ export const pdfdoc_setFormField: (a: number, b: number, c: number, d: number, e
|
|
|
43
37
|
export const pdfdoc_setFormFields: (a: number, b: number, c: number, d: number) => void;
|
|
44
38
|
export const pdfdoc_signatures: (a: number, b: number) => void;
|
|
45
39
|
export const pdfdoc_text: (a: number, b: number, c: number) => void;
|
|
40
|
+
export const pdfdoc_toDocx: (a: number, b: number) => void;
|
|
41
|
+
export const pdfdoc_toPptx: (a: number, b: number) => void;
|
|
42
|
+
export const pdfdoc_toXlsx: (a: number, b: number) => void;
|
|
46
43
|
export const pdfdoc_validatePdfA: (a: number, b: number, c: number, d: number) => void;
|
|
47
44
|
export const pdfdoc_verifySignatures: (a: number, b: number) => void;
|
|
48
45
|
export const pdfdocmut_addFreeText: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
@@ -67,8 +64,6 @@ export const pdfdocmut_setFormField: (a: number, b: number, c: number, d: number
|
|
|
67
64
|
export const pdfdocmut_setFormFields: (a: number, b: number, c: number, d: number) => void;
|
|
68
65
|
export const pdfdocmut_setMultiSelect: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
69
66
|
export const pdfdocmut_setTextRunStyle: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
70
|
-
export const setLicensePayload: (a: number, b: number, c: number) => void;
|
|
71
|
-
export const setLicensePublicKey: (a: number, b: number, c: number) => void;
|
|
72
67
|
export const texteditor_findText: (a: number, b: number, c: number, d: number) => void;
|
|
73
68
|
export const texteditor_open: (a: number, b: number, c: number) => void;
|
|
74
69
|
export const texteditor_pageCount: (a: number) => number;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
export function __pdfluent_error_ctor() {
|
|
3
|
-
if (globalThis.__PdfluentError) {
|
|
4
|
-
return globalThis.__PdfluentError;
|
|
5
|
-
}
|
|
6
|
-
class PdfluentError extends Error {
|
|
7
|
-
constructor(message, code, operation, help, docsUrl, legacyCode) {
|
|
8
|
-
super(message);
|
|
9
|
-
this.name = "PdfluentError";
|
|
10
|
-
this.code = code;
|
|
11
|
-
this.operation = operation;
|
|
12
|
-
this.help = help;
|
|
13
|
-
this.docsUrl = docsUrl;
|
|
14
|
-
this.legacyCode = legacyCode;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
globalThis.__PdfluentError = PdfluentError;
|
|
18
|
-
return PdfluentError;
|
|
19
|
-
}
|
|
File without changes
|