Skip to main content
Version: Version 5 beta

Class: DocumentViewPage

Represents a page in the document view, containing multiple layers for rendering page images, search results, and interactive elements.

Constructors

new DocumentViewPage()

new DocumentViewPage(documentView, pageNumber): DocumentViewPage

Creates an instance of DocumentViewPage.

Parameters

documentView: DocumentView

The parent document view.

pageNumber: number

The page number.

Returns

DocumentViewPage

Accessors

accessibilityLayer

get accessibilityLayer(): AccessibilityLayer

Retrieves the accessibility layer. This layer contains invisible HTML elements aligned with the text fragments for accessibility purposes.

Returns

AccessibilityLayer


container

get container(): HTMLDivElement

Gets the container element.

Returns

HTMLDivElement


documentView

get documentView(): DocumentView

Gets the associated document view.

Returns

DocumentView


image

set image(v): void

Sets the page image data for the page and updates the image layer.

Parameters

v: Image

The new image data.


interactiveLayers

get interactiveLayers(): Layer<LayerNativeElementType>[]

Gets the array of interactive layers.

set interactiveLayers(v): void

Sets the interactive layers, updating their placement within the container. Each layer's size is updated to match the page size and the container is refreshed to maintain the correct layer stacking order.

Parameters

v: Layer<LayerNativeElementType>[]

Returns

Layer<LayerNativeElementType>[]


origin

get origin(): DocumentViewPoint

Gets the origin point of the page.

set origin(v): void

Sets the origin of the page and updates its position within the document view.

Parameters

v: DocumentViewPoint

The new origin point.

Returns

DocumentViewPoint


pageImageLayer

get pageImageLayer(): PageImageLayer

Gets the page image layer.

Returns

PageImageLayer


pageNumber

get pageNumber(): number

Gets the page number.

Returns

number


searchResultsLayer

get searchResultsLayer(): SearchResultsLayer

Gets the search results layer.

set searchResultsLayer(v): void

Sets the search results layer and updates its size.

Parameters

v: SearchResultsLayer

Returns

SearchResultsLayer


size

get size(): Size

Gets the size of the page.

set size(v): void

Sets the size of the page and updates the dimensions of associated layers.

Parameters

v: Size

The new size of the page.

Returns

Size

Methods

appendAllLayers()

appendAllLayers(): void

Appends the various layers (page image, search results, interactive, and accessibility layers) to the container element of the document view page.

This method ensures that the layers are added in the correct order:

  1. The page image layer is added first, as it serves as the base layer.
  2. The search results layer is added on top of the page image layer.
  3. The interactive layers, if present, are added next to handle user interactions.
  4. The accessibility layer, if enabled, is added last to provide accessibility features.

Returns

void