Current page number.
Object.defineProperty(DocumentViewer.prototype, 'currentPageNumber',
get: function()
)
currentPageNumber: number; // read-only
The 1-based number of the current page.
The CurrentPageNumber is the page with the largest area currently visible in the View.
This is obtained by calling View.ImageViewer.GetLargestVisibleItemIndex.
The value changes when the user scrolls the view or zooms in or out and should not be saved. Instead, use CurrentPageNumber every time the "largest visible page" is needed. For example, the application can have a "Find text in this page" or "Find text in the whole document" operations. When the user runs the "Find text in this page", they are referring to the largest page in the viewer, and the application should call CurrentPageNumber to get this value when the action is invoked.
Start with the example created in DocumentViewer, remove all the code in the Example function and add the code below.
When the user clicks the Example button, We will intercept when the user changes the page number, show the current page in the label.
// Disable the example button, this should only run once
var _this = this;
$("#exampleButton").prop("disabled", true);
this._documentViewer.operation.add(function(sender, e) {
if (e.operation == lt.Documents.UI.DocumentViewerOperation.gotoPage && e.isPostOperation) {
var pageNumber = _this._documentViewer.currentPageNumber;
$("#infoLabel").text("Current page number is " + pageNumber);
}
});
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.