Global

Type Definitions

AnnotationCallback(event)

Parameters:
Name Type Description
event Object

Event data object.

Properties
Name Type Description
annotation AnnotationData

Annotation object related to the event.

AnnotationContextMenu

Properties:
Name Type Description
[...menuItemTitle] AnnotationHandler

Menu item handlers. All own properties of the menu object will be translated to menu items.

AnnotationContextMenuCallback(event, annotation, menu)

Callback signature for contextmenu event.

Parameters:
Name Type Description
event Object

Event data object.

annotation AnnotationData

The data of the annotationon which context menu were activated.

menu AnnotationContextMenu

The menu configuration. Keys of this object is treated as menu titles and values under those keys are handler functions. This object could be modified by application to extend or modify current menu instance.

AnnotationFill

Represents annotation fill configuration.

Properties:
Name Type Default Description
[color] string 'white'

Fill color.

[opacity] number 1

Opacity level.

AnnotationHandler(annotation)

Parameters:
Name Type Description
annotation AnnotationData

annotation data object on which action is performed.

AnnotationLineCap

Properties:
Name Type Description
[style] string

Style of the cap. Valid values are 'block', 'open', 'oval', 'diamond', and 'none'.

[width] string

Width of the cap. Valid values are 'wide', 'narrow', and 'medium'

[height] string

Height of the cap. Valid values are 'long', 'short', and 'medium'.

AnnotationOutline

Represents annotation outline configuration.

Properties:
Name Type Default Description
[color] string 'black'

Outline color.

[opacity] number 1

Opacity level.

[width] number 2

Line width.

startcap AnnotationLineCap

Starting point arrow cap configuration for the line annotation.

endcap AnnotationLineCap

End point arrow cap configuration for the line annotation.

AnnotationsConfig

Represents default configuration for various types of annotations.

Properties:
Name Type Description
[defaults] Array.<AnnotationData>

Pre defined annotations to be drawn with the mouse.

[stamps] Array.<AnnotationData>

Pre defined stamp annotations to be drawn with the mouse.

[images] Array.<AnnotationData>

Pre defined image annotations to be drawn with the mouse.

[saveusername] boolean

Indicates whether the server handler will save the username property when saving all

AnnotationTextConfig

Represents configuration for text based annotations like 'text' or 'stamp'.

Properties:
Name Type Default Description
[value] string

Displayed annotation text.

[align] string 'left'

Text align. Allowed values are 'left', 'center', or 'right'.

[font] Object

Annotation text font configuration.

Properties
Name Type Default Description
[bold] boolean false

Indicates whether annotation text is bold.

[italic] boolean false

Indicates whether annotation text is italic.

[strike] boolean false

Indicates whether annotation text is strike.

[underline] boolean false

Indicates whether annotation text is underline.

[color] string 'black'

Annotation text color.

[family] string 'Arial'

Annotation text font family.

[size] number 12

Annotation text font size.

[readonly] boolean false

Indicates whether annotation text could be changed.

[autoscale] boolean

Indicates whether text should be scaled to the size of the bounding box for the Stamp and Text annotations.

This could be useful to make Stamp annotation looks similar to its representation burned into image or opened in different Atalasoft viewers.

BeforeHandlerRequestCallback(event)

Callback signature for

Parameters:
Name Type Description
event Object

The event object.

Properties
Name Type Description
request Request

The request object.

DocumentInfo

Properties:
Name Type Description
count number

The document pages count.

dpi number

The document pages dpi.

size Object

The document pages size.

Properties
Name Type Description
height number

The document pages height.

width number

The document pages width.

vector boolean

Flag indicating whether or not document is vector graphic.

DocumentPageReference

Document page descriptor.

Properties:
Name Type Description
uri string

Identifier of the document containing the page.

index number

Index of the referenced page in current document.

ErrorCallback(event)

Callback signature for Atalasoft.Controls.WebDocumentViewer#event:error event.

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.

FileUploadConfig

Properties:
Name Type Description
[enabled] boolean

a flag indicating whether or not upload functionality should be enabled. Provides a possibility to explicitly disable upload functionality even if upload section is presented.

uploadpath string

represents a relative path where an uploaded file should be saved. This path must be a path to an application subfolder, otherwise upload operation will not work correctly and exception about incorrect path will be returned to the client.

allowedfiletypes string

represents a comma-separated list of file types and MIME-types that are allowed to be selected and uploaded.

allowedmaxfilesize number

represents a file size in bytes.

allowmultiplefiles boolean

a flag inidicating whether or not it is allowed to perform multiple files upload.

allowdragdrop boolean

a flag indicating whether or not it is allowed to upload files using drag-and-drop.

filesuploadconcurrency number

represents a number of concurrent uploading files, by default all files loads sequentially. Note, this property doesn't affect on maximum allowed connections per host, that defined by each browser internally. If this value is bigger than number of default persistent connections per server/proxy, than WDV puts the request in queue and fires event fileuploadstarted, but the real file upload stats only when browser allow this request to be sent.

closeuiafterupload boolean

a flag indicating whether or not UI will be closed automatically right after upload finished. By default this flag set to true value.

Example

Upload section of Web Document Viewer config

upload: {
  uploadpath: 'Upload/Viewer',
  allowedfiletypes: '.jpg,.raw,image/tiff', // Allowed JPG, RAW and TIFF files.
  allowedmaxfilesize: 10 * 1024 * 1024, // 10MB
  allowmultiplefiles: true,
  allowdragdrop: true
}

GetPageTextCallback(text)

Parameters:
Name Type Description
text string

The returned text.

MouseToolConfig

Properties:
Name Type Default Description
[type] MouseToolType Pan

default mouse tool. This tool is enabled each time new document is loaded.

[text] TextMouseToolConfig

Text selection behavior configuration.

NotificationCallback()

Notification callback signature. The callback function that is called without parameters.

OpenUrlCallback(error)

Callback signature for openUrl method.

Parameters:
Name Type Description
error string

If present, provides error description. If undefined, operation were successful.

Point

Represents point structure.

Properties:
Name Type Description
x number

X axis coordinate.

y number

Y axis coordinate.

ReloadPageTextCallback(index)

Callback signature for reloadPageText method.

Parameters:
Name Type Description
index number

Index of the page for which operation has been performed.

Request

Properties:
Name Type Description
method string

The request HTTP method.

data Object

The request parameters that will be send to server.

type string

The request type identifier. Supported request types are:

Identifier Description
docinfo Document info request. Maps to DocumentInfoRequested server event.
docpage Document page request. Could be issued multiple times - it's expected that page will be served from browser cache for the same query. Maps to ImageRequested server event.
docsave Document save request. Maps to DocumentSave server event.
annodata Annotation data request. Maps to AnnotationDataRequested server event.
formdata Forms data request. Maps to PdfFormRequested server event.
pagetextdata Maps to PageTextRequested server event.
fileupload User file upload. Maps to FileUpload and FileUploaded server events.

TextMouseToolConfig

Properties:
Name Type Default Description
[scrolltriggerarea] ScrollArea Normal

Specifies the percentage of type of scroll trigger area. When selecting text in that area around page bounds scrolling will be triggered for corresponding direction.

[throttlingtreshold] number 40

Milliseconds throttling threshold for text selection UI operations. 0 performs selection without throttling barrier, most CPU intensive. I.e. setting this to 0 causes selection calculation on each corresponding browser mouse event.

[selection] Object

Specifies the text selection highlight settings.

Properties
Name Type Default Description
[color] string 'blue'

Specifies the fill color for selected text.

[alpha] number 0.25

Specifies the selected text highlighting transparency level.

[highlight] Object

Specifies the search results highlight settings.

Properties
Name Type Default Description
[color] string 'yellow'

Specifies the fill color for search results highlight.

[alpha] number 0.7

Specifies the transparency level for search results highlight.

[hookcopy] boolean false

Control subscribes to ctrl+c key combination. If so, selected text will be copied to clipboard when uses press ctrl+c.

Alternatively application could apply it's own logic for ctrl+c - for example, grab selected text using {Atalasoft.Controls.WebDocumentViewer~TextController#getSelected| getSelected} method and let user to edit it before copying.

[allowsearch] boolean true

Specifies whether to show default search UI.

[wrapsearch] boolean true

Specifies whether default text search is wrapped.

[searchdelay] number 400

Specifies the milliseconds timeout before triggering text search when text is modified in search textbox.

This allows to delay potentially search operation start while user still types query text.

TextSearchCallback(iterator, matchopt)

Callback signature for text.searchOnPages, next, prev methods.

Parameters:
Name Type Description
iterator TextSearchIterator

Current iterator instance.

It's recommended to call isValid method when callback is called, to check whether iterator is still active. In case if search is cancelled(new search started), callback on the obsolete iterator will be called once to indicate that search is finished for particular query.

[match] TextSearchResult

Current search query match descriptor. If match argument is null, no subsequent result are found.

TextSearchResult

Represents single search result descriptor.

Properties:
Name Type Description
page number

Page index of the match.

region number

Index of the text region where match is occurred.

line number

Index of the text line within region where match is occurred.

word number

Index of the word within text line where match is occurred.

ThumbDragCompleteEventArgs

Properties:
Name Type Description
dragindex number

The index of the page being dragged.

dragindices Array.<number>

The indices of pages being dragged.

dropindex number

The index where the page was dropped in the target document.

source WebDocumentThumbnailer

The source thumbnailer control.

target WebDocumentThumbnailer

The target thumbnailer control.

ThumbDragEndCallback(event, args)

Callback signature for WebDocumentThumbnailer.thumbdragend event.

Parameters:
Name Type Description
event Object

The event object.

args ThumbDragEndEventArgs

The event data.

ThumbDragEndEventArgs

Properties:
Name Type Default Description
dragindex number

The index of the page being dragged.

dragindices Array.<number>

The indices of pages being dragged.

dropindex number

The index where the page was dropped in the target document.

sourcedocument string

The identifier of the source document. Corresponds to config.documenturl

source WebDocumentThumbnailer

The source thumbnailer control.

target WebDocumentThumbnailer

The target thumbnailer control.

external boolean

Indicates whether page is being dropped into external document(not the one dragged page originally belong to).

pageref DocumentPageReference

Reference to the page in the source document. See document.insertPage for usage sample.

pagerefs Array.<DocumentPageReference>

References to pages in the source document. See document.insertPage for usage sample.

[cancel] boolean false

Flag indicating whether default behavior should be cancelled. If set by the application, page want be moved to the new position by the WebDocumentThumbnailer.

[copyannotations] boolean true

Flag indicating whether source page annotations should be copied to the inserted page. This could be used by the application to inject additional logic, for example used confirmation dialog and move the page using API after that.

UploadFileErrorInfo

The upload error information structure.

Properties:
Name Type Description
filename string

Name of the file for upload.

error string

Error message contains the cause why file upload has failed.

canceled boolean

Flag indicating whether or not upload was canceled by the client or server.

event.customData Object

The event customer data from server. This property is set in case when error has occurred on server or file was rejected on server-side.

UploadFileInfo

The upload file information structure.

Properties:
Name Type Description
filename string

Name of the file for upload.

size number

Size of the file for upload in bytes.

cancel boolean

Flag indicating whether or not upload should be canceled by the client.

UploadingFileInfo

The uploading file information structure.

Properties:
Name Type Description
filename string

Name of the file for upload.

uploadedbytes number

Uploaded bytes count.

totalbytes number

Total bytes count.

cancel boolean

Flag indicating whether or not upload should be canceled by the client.

UploadStartInfo

The upload start infromation structure.

Properties:
Name Type Description
cancel boolean

Flag indicating whether or not upload should be canceled by the client.