# Class: PDFDocumentLoadingTask

## PDFDocumentLoadingTask

#### new PDFDocumentLoadingTask()

PDF document loading operation.

Source:
  - display/api.js, line 338

### Members

#### destroyed :boolean

Shows if loading task is destroyed.

##### Type:

- boolean

Source:
  - display/api.js, line 357

#### docId :string

Unique document loading task id -- used in MessageHandlers.

##### Type:

- string

Source:
  - display/api.js, line 351

#### onPassword

Callback to request a password if wrong or no password was provided. The callback receives two parameters: function that needs to be called with new password and reason (see {PasswordResponses}).

Source:
  - display/api.js, line 364

#### onProgress

Callback to be able to monitor the loading progress of the PDF file (necessary to implement e.g. a loading bar). The callback receives an {Object} with the properties: {number} loaded and {number} total.

Source:
  - display/api.js, line 371

#### onUnsupportedFeature

Callback to when unsupported feature is used. The callback receives an {UNSUPPORTED_FEATURES} argument.

Source:
  - display/api.js, line 377

#### promise

Source:
  - display/api.js, line 385

### Methods

#### destroy() → {Promise}

Aborts all network requests and destroys worker.

Source:
  - display/api.js, line 394

##### Returns:

A promise that is resolved after destruction activity is completed.

Type
  Promise

#### then(onFulfilled, onRejected) → {Promise}

Registers callbacks to indicate the document loading completion.

##### Parameters:

Name | Type | Description
--- | --- | ---
`onFulfilled` | function | The callback for the loading completion.
`onRejected` | function | The callback for the loading failure.

Source:
  - display/api.js, line 416

##### Returns:

A promise that is resolved after the onFulfilled or onRejected callback.

Type
  Promise

## PDFDocumentLoadingTask

#### new PDFDocumentLoadingTask()

Source:
  - display/api.js, line 342

### Members

#### destroyed :boolean

Shows if loading task is destroyed.

##### Type:

- boolean

Source:
  - display/api.js, line 357

#### docId :string

Unique document loading task id -- used in MessageHandlers.

##### Type:

- string

Source:
  - display/api.js, line 351

#### onPassword

Callback to request a password if wrong or no password was provided. The callback receives two parameters: function that needs to be called with new password and reason (see {PasswordResponses}).

Source:
  - display/api.js, line 364

#### onProgress

Callback to be able to monitor the loading progress of the PDF file (necessary to implement e.g. a loading bar). The callback receives an {Object} with the properties: {number} loaded and {number} total.

Source:
  - display/api.js, line 371

#### onUnsupportedFeature

Callback to when unsupported feature is used. The callback receives an {UNSUPPORTED_FEATURES} argument.

Source:
  - display/api.js, line 377

#### promise

Source:
  - display/api.js, line 385

### Methods

#### destroy() → {Promise}

Aborts all network requests and destroys worker.

Source:
  - display/api.js, line 394

##### Returns:

A promise that is resolved after destruction activity is completed.

Type
  Promise

#### then(onFulfilled, onRejected) → {Promise}

Registers callbacks to indicate the document loading completion.

##### Parameters:

Name | Type | Description
--- | --- | ---
`onFulfilled` | function | The callback for the loading completion.
`onRejected` | function | The callback for the loading failure.

Source:
  - display/api.js, line 416

##### Returns:

A promise that is resolved after the onFulfilled or onRejected callback.

Type
  Promise