Skip to content

ProgressivePDFLoader

@scaryterry/pdfium


Defined in: src/document/progressive.ts:54

Progressive PDF loader for linearised documents.

Allows checking linearisation status and loading documents using PDFium’s availability API. Supports both complete buffers and incremental data feeds.

using loader = ProgressivePDFLoader.fromBuffer(pdfBytes, module, memory);
if (loader.isLinearised) {
console.log('Document is linearised');
}
using document = loader.getDocument();

get disposed(): boolean

Defined in: src/core/disposable.ts:73

Whether this resource has been disposed.

boolean

Disposable.disposed


get firstPageNumber(): number

Defined in: src/document/progressive.ts:182

Get the first available page number (useful for linearised documents). Returns -1 if no document is available yet.

number


get isDocumentAvailable(): boolean

Defined in: src/document/progressive.ts:155

Check whether the full document data is available.

boolean


get isLinearised(): boolean

Defined in: src/document/progressive.ts:148

Convenience check for whether the document is linearised.

boolean


get linearisationStatus(): LinearisationStatus

Defined in: src/document/progressive.ts:137

Check if the document is linearised.

LinearisationStatus

The linearisation status

[dispose](): void

Defined in: src/core/disposable.ts:148

Dispose of this resource, freeing WASM memory.

This method is idempotent - calling it multiple times has no effect after the first call.

void

Disposable.[dispose]


dispose(): void

Defined in: src/core/disposable.ts:164

Alias for Symbol.dispose for explicit calls.

void

document.dispose();

Disposable.dispose


getDocument(password?): PDFiumDocument

Defined in: src/document/progressive.ts:205

Get the document once enough data is available.

ParameterTypeDescription
password?stringOptional password for encrypted documents

PDFiumDocument

The loaded document

If the document is not yet available or cannot be loaded


isPageAvailable(pageIndex): boolean

Defined in: src/document/progressive.ts:169

Check whether a specific page is available.

ParameterTypeDescription
pageIndexnumberZero-based page index

boolean