Class: DocumentViewPage
Represents a page in the document view, containing multiple layers for rendering page images, search results, and interactive elements.
Constructors
Constructor
new DocumentViewPage(
documentView,pageNumber):DocumentViewPage
Creates an instance of DocumentViewPage.
Parameters
documentView
The parent document view.
pageNumber
number
The page number.
Returns
DocumentViewPage
Accessors
accessibilityLayer
Get Signature
get accessibilityLayer():
AccessibilityLayer
Retrieves the accessibility layer. This layer contains invisible HTML elements aligned with the text fragments for accessibility purposes.
Returns
container
Get Signature
get container():
HTMLDivElement
Gets the container element.
Returns
HTMLDivElement
documentView
Get Signature
get documentView():
DocumentView
Gets the associated document view.
Returns
image
Set Signature
set image(
v):void
Sets the page image data for the page and updates the image layer.
Parameters
v
The new image data.
Returns
void
interactiveLayers
Get Signature
get interactiveLayers():
Layer<LayerNativeElementType>[]
Gets the array of interactive layers.
Returns
Layer<LayerNativeElementType>[]
Set Signature
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
void
origin
Get Signature
get origin():
DocumentViewPoint
Gets the origin point of the page.
Returns
DocumentViewPoint
Set Signature
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
void
pageImageLayer
Get Signature
get pageImageLayer():
PageImageLayer
Gets the page image layer.
Returns
pageNumber
Get Signature
get pageNumber():
number
Gets the page number.
Returns
number
searchResultsLayer
Get Signature
get searchResultsLayer():
SearchResultsLayer
Gets the search results layer.
Returns
Set Signature
set searchResultsLayer(
v):void
Sets the search results layer and updates its size.
Parameters
v
Returns
void
size
Get Signature
get size():
Size
Gets the size of the page.
Returns
Set Signature
set size(
v):void
Sets the size of the page and updates the dimensions of associated layers.
Parameters
v
The new size of the page.
Returns
void
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:
- The page image layer is added first, as it serves as the base layer.
- The search results layer is added on top of the page image layer.
- The interactive layers, if present, are added next to handle user interactions.
- The accessibility layer, if enabled, is added last to provide accessibility features.
Returns
void
dispose()
dispose():
void
Disposes of the document view page and all its layers. This method calls dispose on all layers to allow them to clean up resources, remove event listeners, or perform any necessary cleanup operations.
Returns
void