pdf-oxide-wasm 0.3.19 → 0.3.21
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/package.json +1 -1
- package/pdf_oxide.d.ts +26 -1
- package/pdf_oxide.js +60 -1
- package/pdf_oxide_bg.wasm +0 -0
- package/pdf_oxide_bg.wasm.d.ts +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pdf-oxide-wasm",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.21",
|
|
4
4
|
"description": "Fast, zero-dependency PDF toolkit for Node.js, browsers, and edge runtimes — text extraction, markdown/HTML conversion, search, form filling, creation, and editing. Rust core compiled to WebAssembly.",
|
|
5
5
|
"license": "MIT OR Apache-2.0",
|
|
6
6
|
"repository": {
|
package/pdf_oxide.d.ts
CHANGED
|
@@ -698,7 +698,7 @@ export class WasmPdfDocument {
|
|
|
698
698
|
*
|
|
699
699
|
* @param page_index - Zero-based page number
|
|
700
700
|
* @param detect_headings - Whether to detect headings (default: true)
|
|
701
|
-
* @param include_images - Whether to include images (default:
|
|
701
|
+
* @param include_images - Whether to include images (default: false)
|
|
702
702
|
*/
|
|
703
703
|
toMarkdown(page_index: number, detect_headings?: boolean | null, include_images?: boolean | null, include_form_fields?: boolean | null): string;
|
|
704
704
|
/**
|
|
@@ -784,3 +784,28 @@ export class WasmPdfPageRegion {
|
|
|
784
784
|
*/
|
|
785
785
|
extractWords(): any;
|
|
786
786
|
}
|
|
787
|
+
|
|
788
|
+
/**
|
|
789
|
+
* Disable all pdf_oxide log output — convenience wrapper for
|
|
790
|
+
* `setLogLevel("off")`.
|
|
791
|
+
*/
|
|
792
|
+
export function disableLogging(): void;
|
|
793
|
+
|
|
794
|
+
/**
|
|
795
|
+
* Set the maximum log level for pdf_oxide messages.
|
|
796
|
+
*
|
|
797
|
+
* Accepts one of: `"off"`, `"error"`, `"warn"` / `"warning"`, `"info"`,
|
|
798
|
+
* `"debug"`, `"trace"`. Case-insensitive. Default is `"off"` — the library
|
|
799
|
+
* is silent unless explicitly enabled.
|
|
800
|
+
*
|
|
801
|
+
* Logs are forwarded to the browser console (`console.log`, `console.warn`,
|
|
802
|
+
* `console.error`, etc.). Fixes issue #280.
|
|
803
|
+
*
|
|
804
|
+
* @example
|
|
805
|
+
* ```javascript
|
|
806
|
+
* import init, { setLogLevel } from "pdf-oxide-wasm";
|
|
807
|
+
* await init();
|
|
808
|
+
* setLogLevel("warn");
|
|
809
|
+
* ```
|
|
810
|
+
*/
|
|
811
|
+
export function setLogLevel(level: string): void;
|
package/pdf_oxide.js
CHANGED
|
@@ -2398,7 +2398,7 @@ class WasmPdfDocument {
|
|
|
2398
2398
|
*
|
|
2399
2399
|
* @param page_index - Zero-based page number
|
|
2400
2400
|
* @param detect_headings - Whether to detect headings (default: true)
|
|
2401
|
-
* @param include_images - Whether to include images (default:
|
|
2401
|
+
* @param include_images - Whether to include images (default: false)
|
|
2402
2402
|
* @param {number} page_index
|
|
2403
2403
|
* @param {boolean | null} [detect_headings]
|
|
2404
2404
|
* @param {boolean | null} [include_images]
|
|
@@ -2851,6 +2851,50 @@ class WasmPdfPageRegion {
|
|
|
2851
2851
|
if (Symbol.dispose) WasmPdfPageRegion.prototype[Symbol.dispose] = WasmPdfPageRegion.prototype.free;
|
|
2852
2852
|
exports.WasmPdfPageRegion = WasmPdfPageRegion;
|
|
2853
2853
|
|
|
2854
|
+
/**
|
|
2855
|
+
* Disable all pdf_oxide log output — convenience wrapper for
|
|
2856
|
+
* `setLogLevel("off")`.
|
|
2857
|
+
*/
|
|
2858
|
+
function disableLogging() {
|
|
2859
|
+
wasm.disableLogging();
|
|
2860
|
+
}
|
|
2861
|
+
exports.disableLogging = disableLogging;
|
|
2862
|
+
|
|
2863
|
+
/**
|
|
2864
|
+
* Set the maximum log level for pdf_oxide messages.
|
|
2865
|
+
*
|
|
2866
|
+
* Accepts one of: `"off"`, `"error"`, `"warn"` / `"warning"`, `"info"`,
|
|
2867
|
+
* `"debug"`, `"trace"`. Case-insensitive. Default is `"off"` — the library
|
|
2868
|
+
* is silent unless explicitly enabled.
|
|
2869
|
+
*
|
|
2870
|
+
* Logs are forwarded to the browser console (`console.log`, `console.warn`,
|
|
2871
|
+
* `console.error`, etc.). Fixes issue #280.
|
|
2872
|
+
*
|
|
2873
|
+
* @example
|
|
2874
|
+
* ```javascript
|
|
2875
|
+
* import init, { setLogLevel } from "pdf-oxide-wasm";
|
|
2876
|
+
* await init();
|
|
2877
|
+
* setLogLevel("warn");
|
|
2878
|
+
* ```
|
|
2879
|
+
* @param {string} level
|
|
2880
|
+
*/
|
|
2881
|
+
function setLogLevel(level) {
|
|
2882
|
+
try {
|
|
2883
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2884
|
+
const ptr0 = passStringToWasm0(level, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2885
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2886
|
+
wasm.setLogLevel(retptr, ptr0, len0);
|
|
2887
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2888
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2889
|
+
if (r1) {
|
|
2890
|
+
throw takeObject(r0);
|
|
2891
|
+
}
|
|
2892
|
+
} finally {
|
|
2893
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2894
|
+
}
|
|
2895
|
+
}
|
|
2896
|
+
exports.setLogLevel = setLogLevel;
|
|
2897
|
+
|
|
2854
2898
|
function __wbg_get_imports() {
|
|
2855
2899
|
const import0 = {
|
|
2856
2900
|
__proto__: null,
|
|
@@ -2923,6 +2967,9 @@ function __wbg_get_imports() {
|
|
|
2923
2967
|
const ret = getObject(arg0).call(getObject(arg1));
|
|
2924
2968
|
return addHeapObject(ret);
|
|
2925
2969
|
}, arguments); },
|
|
2970
|
+
__wbg_debug_58754cc8dbfec7ec: function(arg0, arg1, arg2, arg3) {
|
|
2971
|
+
console.debug(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
2972
|
+
},
|
|
2926
2973
|
__wbg_done_547d467e97529006: function(arg0) {
|
|
2927
2974
|
const ret = getObject(arg0).done;
|
|
2928
2975
|
return ret;
|
|
@@ -2938,6 +2985,9 @@ function __wbg_get_imports() {
|
|
|
2938
2985
|
wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
|
|
2939
2986
|
}
|
|
2940
2987
|
},
|
|
2988
|
+
__wbg_error_f8d1622cb1d8c53c: function(arg0, arg1, arg2, arg3) {
|
|
2989
|
+
console.error(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
2990
|
+
},
|
|
2941
2991
|
__wbg_fromCodePoint_967e9ce245607f1b: function() { return handleError(function (arg0) {
|
|
2942
2992
|
const ret = String.fromCodePoint(arg0 >>> 0);
|
|
2943
2993
|
return addHeapObject(ret);
|
|
@@ -2969,6 +3019,9 @@ function __wbg_get_imports() {
|
|
|
2969
3019
|
const ret = getObject(arg0)[arg1 >>> 0];
|
|
2970
3020
|
return addHeapObject(ret);
|
|
2971
3021
|
},
|
|
3022
|
+
__wbg_info_8e80eb6c0f1d9449: function(arg0, arg1, arg2, arg3) {
|
|
3023
|
+
console.info(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
3024
|
+
},
|
|
2972
3025
|
__wbg_instanceof_ArrayBuffer_ff7c1337a5e3b33a: function(arg0) {
|
|
2973
3026
|
let result;
|
|
2974
3027
|
try {
|
|
@@ -3005,6 +3058,9 @@ function __wbg_get_imports() {
|
|
|
3005
3058
|
const ret = getObject(arg0).length;
|
|
3006
3059
|
return ret;
|
|
3007
3060
|
},
|
|
3061
|
+
__wbg_log_dafe9ed5100e3a8c: function(arg0, arg1, arg2, arg3) {
|
|
3062
|
+
console.log(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
3063
|
+
},
|
|
3008
3064
|
__wbg_new_0_bfa2ef4bc447daa2: function() {
|
|
3009
3065
|
const ret = new Date();
|
|
3010
3066
|
return addHeapObject(ret);
|
|
@@ -3077,6 +3133,9 @@ function __wbg_get_imports() {
|
|
|
3077
3133
|
const ret = getObject(arg0).value;
|
|
3078
3134
|
return addHeapObject(ret);
|
|
3079
3135
|
},
|
|
3136
|
+
__wbg_warn_b5013c1036317367: function(arg0, arg1, arg2, arg3) {
|
|
3137
|
+
console.warn(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
3138
|
+
},
|
|
3080
3139
|
__wbindgen_cast_0000000000000001: function(arg0) {
|
|
3081
3140
|
// Cast intrinsic for `F64 -> Externref`.
|
|
3082
3141
|
const ret = arg0;
|
package/pdf_oxide_bg.wasm
CHANGED
|
Binary file
|
package/pdf_oxide_bg.wasm.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export const __wbg_wasmpagetemplate_free: (a: number, b: number) => void;
|
|
|
8
8
|
export const __wbg_wasmpdf_free: (a: number, b: number) => void;
|
|
9
9
|
export const __wbg_wasmpdfdocument_free: (a: number, b: number) => void;
|
|
10
10
|
export const __wbg_wasmpdfpageregion_free: (a: number, b: number) => void;
|
|
11
|
+
export const setLogLevel: (a: number, b: number, c: number) => void;
|
|
11
12
|
export const wasmartifact_center: (a: number, b: number) => number;
|
|
12
13
|
export const wasmartifact_left: (a: number, b: number) => number;
|
|
13
14
|
export const wasmartifact_new: () => number;
|
|
@@ -128,6 +129,7 @@ export const wasmheader_left: (a: number, b: number) => number;
|
|
|
128
129
|
export const wasmheader_right: (a: number, b: number) => number;
|
|
129
130
|
export const wasmfooter_new: () => number;
|
|
130
131
|
export const wasmheader_new: () => number;
|
|
132
|
+
export const disableLogging: () => void;
|
|
131
133
|
export const __wbg_wasmocrengine_free: (a: number, b: number) => void;
|
|
132
134
|
export const wasmpdfdocument_saveToBytes: (a: number, b: number) => void;
|
|
133
135
|
export const wasmocrconfig_new: () => number;
|