WebDocumentThumbnailer

Atalasoft.Controls. WebDocumentThumbnailer

new WebDocumentThumbnailer(settingsopt, openCallbackopt) → {WebDocumentThumbnailer}

Control that shows thumbnails of document pages and annotations.

Parameters:
Name Type Description
[settings] WebThumbnailerConfig

Object of key value pairs representing initial settings

[openCallback] OpenUrlCallback

callback that is called when document load complete(if documenturl is specified).

Returns:

A new control with the given settings.

Type
WebDocumentThumbnailer

Extends

Members

Methods

activate()

Takes ownership over referenced viewer, i.e. if shared viewer is currently displaying other document, it's switched to display document from calling thumbnailer.

deselectThumb(index, callbackopt)

Resets the thumbnail highlight at the given index, and scrolls to the next selected thumbnail in the linked viewer, if possible.

This function does't deselect the given index in the single select mode, and in multi select mode, if one page is selected.

Parameters:
Name Type Description
index number | string

Index of the page to deselect. Can be passed as string representation of a number

[callback] NotificationCallback

function that is called when thumbnail has been deselected.

getSelectedPageIndex() → {number}

Gets the selected thumbnail index.

Gets the selected thumbnail index when Web Document Thumbnailer (WDT) setup to use singleselect. When WDT setup to use multiselect, then this method returns the first element of the selected page indices, with respect of selecteditemsorder parameter value.

Returns:
Type
number

getSelectedPagesIndices() → {Array.<number>}

Gets the selected thumbnails indices.

Gets the selected thumbnails indices with respect of selecteditemsorder parameter value.

Returns:
Type
Array.<number>

isActive() → {boolean}

Checks whether current thumbnailer is controlling referenced viewer.

If viewer is linked only to the current thumbnailer, this method always return true.

If thumbnailer is not linked to any viewer, this method always return false.

Returns:

true if current thumbnailer instance is controlling referenced viewer; false otherwise.

Type
boolean

scrollToThumb(index, callbackopt)

Scrolls the viewer to the given page number and executes the callback when finished

Parameters:
Name Type Description
index number

Index of the page to scroll to.

[callback] NotificationCallback

Function to execute after this operation is done.

selectThumb(index, appendopt, callbackopt)

Highlights the thumbnail at the given index, and scrolls to it in the linked viewer, if possible.

Parameters:
Name Type Description
index number | string

Index of the page to select. Can be passed as string representation of a number

[append] boolean

Append index to the already selected thumbs or not. Its value ignores in single select mode.

[callback] NotificationCallback

function that is called when thumbnail has been selected.

Events

beforehandlerrequest :BeforeHandlerRequestCallback

Triggers before a request is sent to the server.

Parameters:
Name Type Description
event Object

The event object.

Properties
Name Type Description
request Request

The request object.

This event could be used to override or extend request parameters which is exposed through event.request.data. Requests could be distinguished using event.request.type field. For supported request types see Request structure.

Inherited From:

documentinfochanged

Triggers when the document info has changed, usually after a new document is opened.

Parameters:
Name Type Description
event Object

The event object.

Properties
Name Type Description
info DocumentInfo

The event document info.

customData Object

The event customer data from server.

Inherited From:

documentloaded

Triggers when the document is done loading.

Parameters:
Name Type Description
event Object

The event object.

Properties
Name Type Description
customData Object

The event customer data from server.

Inherited From:

documentsaved

Triggers after a response from the server while saving the document.

Parameters:
Name Type Description
event Object

The event object.

Properties
Name Type Description
success boolean

Flag indicating whether or not save were successful.

fileName string

File path to the saved file. By default it represents a path to the file relative to application path. However, if 'DocumentStream' property was initialized or 'PreventDefaultSaving' flag is used on server-side, then this property contains a value of 'DocumentStreamName' property.

customData Object

The event customer data from server.

Inherited From:

documentunloaded :NotificationCallback

Triggers when the document has been unloaded from the control.

Inherited From:

error :ErrorCallback

Triggers when the control has encountered and error. Populated keys: e.name, e.message

Parameters:
Name Type Description
event Object

The event object.

Properties
Name Type Description
name string

The error type identifier.

message string

The error clarification message.

Inherited From:

fileaddedtoupload

Triggers when the file added to upload files through UI controls.

Parameters:
Name Type Description
event object

The event object.

Properties
Name Type Description
filename string

Name of the file for upload.

reason FileUploadRejectReason

The reason of why file was rejected from the adding to upload.

success boolean

Flag indicating whether or not file has passed filtering.

Inherited From:

fileuploaderror

Triggers when file upload has failed or was canceled.

Parameters:
Name Type Description
event Object

The event object.

Properties
Name Type Description
errorinfo UploadFileErrorInfo

The error information.

Inherited From:

fileuploadfinished

Triggers when file upload has finished successfully.

Parameters:
Name Type Description
event Object

The event object.

Properties
Name Type Description
filename string

Name of the file for upload.

filepath string

Relative path on server to the uploaded file.

customData Object

The event customer data from server.

Inherited From:

fileuploading

Triggers during file upload process. Can be used to track upload progress.

Parameters:
Name Type Description
event Object

The event object.

Properties
Name Type Description
uploadinfo UploadingFileInfo

The progress information.

Inherited From:

fileuploadstarted

Triggers when file upload is started

Parameters:
Name Type Description
event Object

The event object.

Properties
Name Type Description
fileinfo UploadFileInfo

The file information.

Inherited From:

initialized :NotificationCallback

Triggers when the control has completed asynchronous initialization.

Asynchronous initialization happens when some dependent scripts are not included to web page and control trying to load them on background. In case of synchronous initialization, this event won't be fired. isReady method could be used after construction to check whether control is initialized.

Inherited From:

pagenumberchanged

Triggers when the page number has changed. Populated keys: e.number

Parameters:
Name Type Description
event Object

The event object.

Inherited From:

pagerecycled

Triggers when the control has recycled a pageDiv object.

Parameters:
Name Type Description
event Object

The event object.

Properties
Name Type Description
index number

Index of the recycled page.

Inherited From:

pageresize

Triggers when the control has resized a pageDiv object.

Parameters:
Name Type Description
event Object

The event object.

Properties
Name Type Description
index number

Index of the resized page.

width number

Width of the page after resize.

height number

Height of the recycled page.

Inherited From:

pageshown

Triggers when the control has shown a page in the viewable area.

Parameters:
Name Type Description
event Object

The event object.

Properties
Name Type Description
index number

Index of the page.

Inherited From:

pagesizechanged

Triggers when the page size returned from the server is different than expected. The expected page size is the size returned from server along with other document info.

Parameters:
Name Type Description
event Object

The event object.

Properties
Name Type Description
index number

Index of the resized page.

width number

Width of the page after resize.

height number

Height of the recycled page.

dx number

Difference with the previous(expected) page width. Scaled images are compared.

dy number

Difference with the previous(expected) page height. Scaled images are compared.

Inherited From:

pagetextloaded :LoadPageTextCallback

Triggers when page text loaded.

Parameters:
Name Type Description
event Object

The event object.

Properties
Name Type Description
index number

index of the page for which text data has been loaded.

customData Object

The event customer data from server.

Inherited From:

scriptsloaded :NotificationCallback

Triggers when dependencies have finished loading.

Inherited From:

scroll

Triggers for every pixel movement registered by the scrollable area.

Parameters:
Name Type Description
event Object

The event object.

Properties
Name Type Description
x number

Horizontal scroll position.

y number

Vertical scroll position.

dx number

Distance scrolled horizontally.

dy number

Distance scrolled vertically.

Inherited From:

statusmessage

Triggers when the control has updated the status bar.

Parameters:
Name Type Description
event Object

The event object.

Properties
Name Type Description
message string

The status message.

Inherited From:

textselected :NotificationCallback

Triggers when UI text selection complete.

Inherited From:

thumbdeselected

Triggers when thumbnail is deselected.

Parameters:
Name Type Description
event Object

The event object.

Properties
Name Type Description
index number

Index of the page that was deselected.

thumbdragcomplete :ThumbDragCompleteEventArgs

Triggers after thumbnail drag & drop operation is complete.

Parameters:
Name Type Description
event Object

The event object.

args ThumbDragCompleteEventArgs

The event data.

thumbdragend :ThumbDragEndCallback

Triggers before thumbnail drag & drop operation is complete. This event could be triggered for either case when thumb was dropped within same document where it belongs or when thumb was dropped to the external document.

Parameters:
Name Type Description
event Object

The event object.

args ThumbDragEndEventArgs

The event data.

Note that args.cancel flag allows to prevent default drop handler behavior. If set by the application, page want be moved to the new position by the WebDocumentThumbnailer. This could be used by the application to inject additional logic, for example used confirmation dialog and move the page using API after that.

thumbdragstart

Triggers when thumbnail drag & drop operation is started.

Parameters:
Name Type Description
event Object

The event object.

Properties
Name Type Description
dragindex number

Index of the page being dragged.

dragindices Array.<number>

The indices of pages being dragged.

thumbselected

Triggers when thumbnail is selected.

Parameters:
Name Type Description
event Object

The event object.

Properties
Name Type Description
index number

Index of the page that was selected.

uploadfinished

Triggers when the files upload is finished

Parameters:
Name Type Description
event Object

The event object.

Properties
Name Type Description
success boolean

Flag indicating whether or not upload was completed without errors.

canceled boolean

Flag indicating whether or not upload was canceled.

Inherited From:

uploadstarted

Triggers when the files upload is started.

Parameters:
Name Type Description
event Object

The event object.

Properties
Name Type Description
info UploadStartInfo

The upload information.

Inherited From:

zoomchanged

Triggers when the zoom level of the control has changed.

Parameters:
Name Type Description
event Object

The event object.

zoom number

Current document zoom value.

Inherited From:

zoomstarted :NotificationCallback

Triggers when a zoom operation has been started.

Inherited From: