PDFiumInitOptions
Defined in: src/core/types.ts:268
Options for initialising the PDFium library.
Properties
Section titled “Properties”forceWasm?
Section titled “forceWasm?”
readonlyoptionalforceWasm:boolean
Defined in: src/core/types.ts:309
Force WASM backend even when native addon is available.
When true, native addon loading is skipped entirely. Useful for:
- Testing/debugging the WASM code path
- Ensuring consistent behaviour across environments
- Benchmarking WASM without native interference
Cannot be used with useNative: true (throws InitialisationError).
Default: false.
limits?
Section titled “limits?”
readonlyoptionallimits:PDFiumLimits
Defined in: src/core/types.ts:311
Resource limits for security and stability
logger?
Section titled “logger?”
readonlyoptionallogger:Logger
Defined in: src/core/types.ts:313
Custom logger instance.
useNative?
Section titled “useNative?”
readonlyoptionaluseNative:boolean
Defined in: src/core/types.ts:296
Try to use the native PDFium binding instead of WASM (Node.js only).
When true, PDFium.init() will attempt to load the platform-specific
native addon. If unavailable, it falls back to WASM transparently.
Default: false (WASM is used unless explicitly opted in).
useWorker?
Section titled “useWorker?”
readonlyoptionaluseWorker:boolean
Defined in: src/core/types.ts:279
Enable high-level worker mode for off-main-thread processing.
When true, PDFium.init() returns a worker-backed instance that exposes
ergonomic document/page APIs without manual worker protocol management.
wasmBinary?
Section titled “wasmBinary?”
readonlyoptionalwasmBinary:ArrayBuffer
Defined in: src/core/types.ts:272
Pre-loaded WASM binary
wasmUrl?
Section titled “wasmUrl?”
readonlyoptionalwasmUrl:string
Defined in: src/core/types.ts:270
Path or URL to the WASM binary
workerDestroyTimeout?
Section titled “workerDestroyTimeout?”
readonlyoptionalworkerDestroyTimeout:number
Defined in: src/core/types.ts:287
Worker destroy timeout in milliseconds (default: 5000).
workerRenderTimeout?
Section titled “workerRenderTimeout?”
readonlyoptionalworkerRenderTimeout:number
Defined in: src/core/types.ts:285
Worker render timeout in milliseconds (default: 120000).
workerTimeout?
Section titled “workerTimeout?”
readonlyoptionalworkerTimeout:number
Defined in: src/core/types.ts:283
Worker request timeout in milliseconds (default: 30000).
workerUrl?
Section titled “workerUrl?”
readonlyoptionalworkerUrl:string|URL
Defined in: src/core/types.ts:281
Custom worker script URL (only if useWorker is true).