Error processing SSI file
LEADTOOLS Leadtools.Documents.UI (Leadtools.Documents.UI assembly)

PreferredItemType Property

Show in webframe
Example 
The preferred mode to use when viewing the image data of the pages.
Syntax
get_preferredItemType();
set_preferredItemType(value);
Object.defineProperty('preferredItemType');

Property Value

TypeDescription
DocumentViewerItemTypeThe preferred mode to use when viewing the image of a page. Default value is DocumentViewerItemType.Image.
Remarks

ImageViewer supports using raster or SVG images.

When DocumentViewerItemType.Image is set, the document viewer will use DocumentPage.GetImage to get the image data of a page and use it for viewing. This is supported by all document types.

When DocumentViewerItemType.Svg is set, the document viewer will check IsSvgViewingPreferred the property of the current Document set. If SVG is supported, then it use use DocumentPage.GetSvg to get the SVG data of a page and use it for viewing. This is supported by all document formats but not by most raster file formats.

Use PreferredItemType property to set the preferred mode to use. In other words, when you set it as DocumentViewerItemType.Image, then raster images will always be used. If you set it to DocumentViewerItemType.Svg, then SVG documents is used if supported, otherwise, use raster images.

The ItemType property returns the actual value being used currently based on the document type.

Example

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 switch between SVG and Image viewing showing information on what happened.

// Switch between SVG and Raster image viewer
var view = this._documentViewer.view;
if (view.preferredItemType == lt.Documents.UI.DocumentViewerItemType.Svg) {
   view.preferredItemType = lt.Documents.UI.DocumentViewerItemType.image;
} else {
   view.preferredItemType = lt.Documents.UI.DocumentViewerItemType.svg;
}
// When we set the preferred, ItemType gets updated accordingly with
// the actual value supported by the document format
// Formats such as PDF and DOCX support both
// Formats such as TIF and JPEG support only raster
See Also

Reference

DocumentViewerView Object
DocumentViewerView Members

Error processing SSI file
  Leadtools.Documents.UI requires a Document or Medical toolkit license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features