---
title: "ExtractJob"
version: "0.9.0"
url: "https://docs.laminapdf.com/reference/sdk/classes/extractjob/"
---

# ExtractJob

Defined in: [packages/sdk/src/extract-job.ts:117](https://github.com/laudebugs/laminapdf/blob/v0.9.0/packages/sdk/src/extract-job.ts#L117)

An extraction in progress, from [Document.extractJob](/reference/sdk/classes/document.md#extractjob). It holds WebAssembly memory and is
freed with its document, or earlier with `free()` or `using`.

## Since

0.2.0

## Extends

- `Handle`\<`BaseGlue`\>

## Type Parameters

### F

`F` *extends* [`ExtractFormat`](/reference/sdk/type-aliases/extractformat.md) = [`ExtractFormat`](/reference/sdk/type-aliases/extractformat.md)

## Methods

### \[dispose\]()

```ts
[dispose](): void;
```

Defined in: [packages/sdk/src/internal/handle.ts:124](https://github.com/laudebugs/laminapdf/blob/v0.9.0/packages/sdk/src/internal/handle.ts#L124)

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

#### Returns

`void`

#### Inherited from

`Handle.[dispose]`

***

### cancel()

```ts
cancel(): void;
```

Defined in: [packages/sdk/src/extract-job.ts:162](https://github.com/laudebugs/laminapdf/blob/v0.9.0/packages/sdk/src/extract-job.ts#L162)

Stops the job: its next step fails with `cancelled`.

#### Returns

`void`

#### Since

0.2.0

***

### free()

```ts
free(): void;
```

Defined in: [packages/sdk/src/internal/handle.ts:115](https://github.com/laudebugs/laminapdf/blob/v0.9.0/packages/sdk/src/internal/handle.ts#L115)

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.

#### Returns

`void`

#### Inherited from

`Handle.free`

***

### provide()

```ts
provide(result): void;
```

Defined in: [packages/sdk/src/extract-job.ts:153](https://github.com/laudebugs/laminapdf/blob/v0.9.0/packages/sdk/src/extract-job.ts#L153)

Hands the job the result of its open request.

#### Parameters

##### result

[`ModelResult`](/reference/sdk/type-aliases/modelresult.md)

#### Returns

`void`

#### Throws

[LaminaPdfError](/reference/sdk/classes/laminapdferror.md) `model-result-unexpected` when nothing was asked for or `result`
is the other model's; `invalid-argument` / `unknown-option` for a malformed result.

#### Since

0.2.0

***

### step()

```ts
step(budget?): ExtractStep<F>;
```

Defined in: [packages/sdk/src/extract-job.ts:138](https://github.com/laudebugs/laminapdf/blob/v0.9.0/packages/sdk/src/extract-job.ts#L138)

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](/reference/sdk/classes/extractjob.md#provide) answers it.

#### Parameters

##### budget?

`number` = `1`

#### Returns

[`ExtractStep`](/reference/sdk/type-aliases/extractstep.md)\<`F`\>

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

#### Throws

[LaminaPdfError](/reference/sdk/classes/laminapdferror.md) `cancelled`, `document-changed`, `job-finished`, the reading errors.

#### Since

0.2.0
