Skip to content
Lamina PDF
0.9.0
GitHub
Open the web app

ExtractJob

Defined in: packages/sdk/src/extract-job.ts:117

An extraction in progress, from Document.extractJob. It holds WebAssembly memory and is freed with its document, or earlier with free() or using.

0.2.0

  • Handle<BaseGlue>

F extends ExtractFormat = ExtractFormat

[dispose](): void;

Defined in: packages/sdk/src/internal/handle.ts:124

Frees the handle at the end of a using block (an alias of free()).

void

Handle.[dispose]


cancel(): void;

Defined in: packages/sdk/src/extract-job.ts:162

Stops the job: its next step fails with cancelled.

void

0.2.0


free(): void;

Defined in: packages/sdk/src/internal/handle.ts:115

Frees the handle’s memory now; without it, the garbage collector frees it later. A second call does nothing, and any other call afterwards throws disposed. Prefer using, which calls this at the end of the block.

void

Handle.free


provide(result): void;

Defined in: packages/sdk/src/extract-job.ts:153

Hands the job the result of its open request.

ModelResult

void

LaminaPdfError model-result-unexpected when nothing was asked for or result is the other model’s; invalid-argument / unknown-option for a malformed result.

0.2.0


step(budget?): ExtractStep<F>;

Defined in: packages/sdk/src/extract-job.ts:138

Extracts up to budget pages. While a model’s result is awaited, the step returns { state: "progress", phase: "model", request } and does nothing more until provide answers it.

number = 1

ExtractStep<F>

progress, or { state: "done", output } with the output in the job’s format.

LaminaPdfError cancelled, document-changed, job-finished, the reading errors.

0.2.0