# Global

##

### Type Definitions

#### DocumentInitParameters

  Document initialization / loading parameters object.

  ##### Type:

  - Object

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `url` | string | The URL of the PDF.
  `data` | TypedArray | Array | string | Binary PDF data. Use typed arrays (Uint8Array) to improve the memory usage. If PDF data is BASE64-encoded, use atob() to convert it to a binary string first.
  `httpHeaders` | Object | Basic authentication headers.
  `withCredentials` | boolean | Indicates whether or not cross-site Access-Control requests should be made using credentials such as cookies or authorization headers. The default is false.
  `password` | string | For decrypting password-protected PDFs.
  `initialData` | TypedArray | A typed array with the first portion or all of the pdf data. Used by the extension since some data is already loaded before the switch to range requests.
  `length` | number | The PDF file length. It's used for progress reports and range requests operations.
  `range` | PDFDataRangeTransport |

  Source:
    - display/api.js, line 180

#### PDFDocumentStats

  ##### Type:

  - Object

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `streamTypes` | Array | Used stream types in the document (an item is set to true if specific stream ID was used in the document).
  `fontTypes` | Array | Used font type in the document (an item is set to true if specific font ID was used in the document).

  Source:
    - display/api.js, line 201

#### PDFOperatorList

  PDF page operator list.

  ##### Type:

  - Object

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `fnArray` | Array | Array containing the operator functions.
  `argsArray` | Array | Array containing the arguments of the functions.

  Source:
    - display/api.js, line 620

#### PromiseCapability

  Promise Capability object.

  ##### Type:

  - Object

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `promise` | Promise | A promise object.
  `resolve` | function | Fullfills the promise.
  `reject` | function | Rejects the promise.

  Source:
    - shared/util.js, line 1014

#### RenderParameters

  Page render parameters.

  ##### Type:

  - Object

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `canvasContext` | Object | A 2D context of a DOM Canvas object.
  `viewport` | PDFJS.PageViewport | Rendering viewport obtained by calling of PDFPage.getViewport method.
  `intent` | string | Rendering intent, can be 'display' or 'print' (default value is 'display').
  `imageLayer` | Object | (optional) An object that has beginLayout, endLayout and appendImage functions.
  `continueCallback` | function | (deprecated) A function that will be called each time the rendering is paused. To continue rendering call the function that is the first argument to the callback.

  Source:
    - display/api.js, line 603

#### TextContent

  Page text content.

  ##### Type:

  - Object

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `items` | array | array of TextItem
  `styles` | Object | TextStyles objects, indexed by font name.

  Source:
    - display/api.js, line 572

#### TextItem

  Page text content part.

  ##### Type:

  - Object

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `str` | string | text content.
  `dir` | string | text direction: 'ttb', 'ltr' or 'rtl'.
  `transform` | array | transformation matrix.
  `width` | number | width in device space.
  `height` | number | height in device space.
  `fontName` | string | font name used by pdf.js for converted font.

  Source:
    - display/api.js, line 581

#### TextStyle

  Text style.

  ##### Type:

  - Object

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `ascent` | number | font ascent.
  `descent` | number | font descent.
  `vertical` | boolean | text is in vertical mode.
  `fontFamily` | string | possible font family

  Source:
    - display/api.js, line 593