Represents WebDocumentViewer configuration.

Name Type Default Description
parent Object

jQuery object that the control will contain the control.

serverurl string

Url location to the server handler.

[allowannotations] boolean false

Turns annotation support on or off. This affects both UI annotations toolbar appearance and corresponding API methods behavior. If set to false, WebDocumentViewer.annotations will be set to null and annotation-related methods of WebDocumentViewer will throw errors.

[allowforms] boolean false

Turns forms support on or off.

[allowtext] boolean false

Turns text selection support on or off.

[annotations] AnnotationsConfig

Annotations specific config options, including predefined configurations for particular annotation types.

[annotationsurl] string

Identifier of the annotation data (an .xmp file on the server) that should be displayed along with the displayed document.

By default annotationsurl is treated as an url to the serialized annotations data file on server(usually .xmp). Application could customize server behavior and in this case annotationsurl could contain arbitrary string.

This property on the viewer.config is updated internally each time new document is opened.

[columns] number

Number of columns to show when displaying tabular pages, -1 is automatic.

[direction] ScrollDirection Vertical

Scroll direction of the viewer.

i.e. controls whether document pages positioned in vertical or horizontal direction.

[documenturl] string

Identifier of the document (that is on the server) to be displayed when the document is first opened.

By default documenturl is treated as an url to the image file on server. Application could customize server behavior and in this case documenturl could contain arbitrary string. If this parameter is specified, document will be opened right after viewer initialization completes. Otherwise document should be opened using openUrl method.

This property on the viewer.config is updated internally each time new document is opened.

[fitting] Fitting Width

Specifies the initial page image fit when document is opened in the viewer.

Usually it makes sense to set initial fit to viewer width for vertical scrolling direction and to height for horizontal.

[forcepagefit] boolean false

Specifies whether document pages should be unified basing on the expected document page size.

Expected page size is sent by server when opening new document. By default it's the size of the first page in document, but any values could be provided when default behavior is overridden by application.

It's recommended to set this option to true for most documents.

Setting this property to true have following benefits:

  • Pages looks similar even for documents containing pages with having different sizes(or different DPI). Aspect ratio is preserved when calculating unification zoom ratio, so pages are not completely same. But in most cases they would have same width or height.

  • Pages are requested on demand, so size of each individual page is not known until it's loaded from server. Thus when pages having different sizes are inserted into DOM, their sizes are different from expected. This would cause resizing of the DOM elements and thus cause visual shifts of the images. Especially such effect could be noticeable on big images, when rendering and load time is bigger then usual.

Setting this option to false is helpful when document having pages both "small" and "big" pages and those pages should be displayed as is, without additional zoom. For example, when driver license and scanned pages are displayed as a single document.

[formurl] string

Identifier of the annotation data PDF form data (.pdf file on the server) that should be displayed along with the displayed document.

In most cases this option should be omitted, so forms will be loaded from the PDF document specified by documenturl

This property on the viewer.config is updated internally each time new document is opened.

[jpeg] boolean false

Allows page images to be returned as jpeg instead of png.

[localization] LocalizationStrings

this object provides a translation table for all potentially user-visible strings used by Atalasoft Web Document Viewer. See Atalasoft.Utils.LocalizationStrings for all possible strings.

Default value: {} - which selects the default American English localization.

[pagebuffersize] number

The maximum number of pages to keep in memory while scrolling. Should be greater then pagebuffersize value. It can helps to avoid loading too many pages if automatically calculated value is big. It is not recommended to set small values (less then viewer can fit).

[maxwidth] number 3000

Specifies the maximum amount of pixel width allowed for zooming in.

This property is intended to limit size of the images data transferred over the wire on big zoom values.

[memorythreshold] number 500000000

Maximum number of bytes in memory before larger memory objects are recycled.

DOM image objects are cached internally. This option allows to control memory usage on the browser page. Note, that estimated image sizes are not exactly match actual values - estimation is based on the expected document images color format and size. So actual memory usage in browser process could differ from the configured value.

[minwidth] number 150

Specifies the minimum amount of pixel width allowed for zooming out.

[mousetool] MouseToolConfig | MouseToolType

Specifies the mouse tools settings. Could be set to Atalasoft.Utils.MouseToolType if no advanced settings specified.

Mouse tool identifies how user mouse or touch actions ar interpreted. For example, this could be Pan tool to scroll pages, Zoom-Area tool to select image region and zoom to it, Text tool to select and copy document text, etc.

Active mouse tool could be changed using setMouseTool method.

[pageborderwidth] number 1

Specifies the pixel border width around each page in a document.

[pagebuffersize] number

The number of pages to keep in memory while scrolling. Negative values will automatically calculate the optimal number based on available screen space. Values lower than can be displayed will be ignored, and higher values will cause a degradation in performance.

[pageselectlocation] PageSelection

Specifies the location to determine the current page number.

Current page number is displayed on the document toolbar, and also current page is used in some operation in default UI, like page rotation is applied to the current page or in next, previous, showPage methods.

[pagespacing] number 4

Specifies the distance (in pixels) between pages displayed.

[allowflick] boolean true

Turns flick scrolling support on or off.

[persistrotation] boolean true

Specifies whether to persist page rotation on document save.

I.e of set to false, rotation applied in 'view-only' mode and ignored when document is saved.

[savefileformat] string

Specifies the default file format for the document that will be used when saving multipage document to the server.

The following formats are supported: pdf, tiff (or tif), jpeg (or jpg), png, bmp, tga, pcx, psd, tla, wbmp, emf, wmf.

If set, this value is used when document save is performed using default UI or when save is called without save format parameter passed.

If not specified, document is saved in it's own format. Note that it's not possible to save multipage documents(for example when document pages was added using JavaScript API) to the single page image format by default. Server behavior on save could be highly customized.

[savepath] string

Specifies the path that the document, annotation data, and form data will be saved to on the server.

[savepreviouslysigneddocument] boolean false

If set to true and the opened document is signed, calling Save will not throw an exception, but will create an invalid PDF which may still render correctly.

[scripturl] string

Url location to the server where all JavaScript files are put when not in the default location.

[showbookmarks] boolean false

Specifies whether native PDF bookmarks should be shown.

[showbuttontext] boolean true

If the toolbar is displayed, this can be used to hide or show the button text for the toolbar items.

[showerrors] boolean false

Specifies whether error messages are allowed to show up in the console instead of being caught.

[showpageborder] boolean true

Specifies whether a black border will be added around each page in the displayed document.

[showpagenumber] boolean true

Specifies whether a page number will be added to the bottom left of each page.

[showpagenumbertooltip] boolean true

Specifies whether a tooltip containing estimated current page number should be shown during fast scrolling.

[showrotatetools] boolean true

Specifies whether page and annotations rotation UI handles and buttons are shown.

Annotation rotation could be explicitly enabled or disabled for individual types of annotations using annotations.defaults.

[showscrollbars] boolean true

Specifies whether scrollbars will be shown.

[showselecttools] boolean false

Specifies whether rubberband selection tools are shown in the toolbar.

[showstatus] boolean false

Specifies whether status messages will be output to an area in the toolbar.

[singlepage] boolean false

Specifies whether pages should be displayed in a single page fashion, rather than one row or column. Takes precedence over tabular flag.

[tabular] boolean false

Specifies whether pages should be displayed in a tabular(grid) fashion, rather than one row or column. Ignored if singlepage flag is set.

[tiling] boolean false

Specifies whether the PDF document pages should be loading using tiling

[toolbarbuttons] Array.<ToolbarButtonConfig>

Specifies the custom toolbar buttons that should be added at the beginning of the main toolbar.

[toolbarparent] Object

Specifies the jQuery object where the toolbar will be created.

[upload] FileUploadConfig

Specifies the file upload settings. If this section is not specified, the upload functionality is disabled.

[zoom] number

Sets the initial zoom level of the document. Ignored when fitting set to anything besides Fitting.None.