Click or drag to resize

DocumentViewer Properties

The DocumentViewer type exposes the following members.

Properties
  NameDescription
Public propertyAllowedPermissions
Gets or sets a value that specifies the allowed permissions for the document viewer. The default is All. Denied permissions take precedence over allowed permissions. For instance, when AllowedPermissions is set to All and DeniedPermissions is set to Download and Print all permissions except Download and Print will be allowed. When combining permissions, they should be separated by comma in string and by bitwise 'or' operator in code (| in C# and OR in VB).
Public propertyClientEvents
Gets or sets the client-side event handlers.
Public propertyDebugMode
Gets or sets a value indicating whether to display detailed error messages for troubleshooting. Exceptions will be displayed with stack trace, inner exceptions and data.
(Inherited from StatefulComponent.)
Public propertyDeniedPermissions
Gets or sets a value that specifies the denied permissions for the document viewer. The default is None. Denied permissions take precedence over allowed permissions. For instance, when AllowedPermissions is set to All and DeniedPermissions is set to Download and Print all permissions except Download and Print will be allowed. When combining permissions, they should be separated by comma in string and by bitwise 'or' operator in code (| in C# and OR in VB).
Public propertyDisplayMode
Gets or sets a value indicating whether the component is rendered as InPlace (default), Panel, Window or Viewport.
(Inherited from Component.)
Public propertyDocument
Gets or sets the document to load and display. This is usually the path to the document to load. Both physical (eg. c:\document.docx) and virtual (eg. /document.docx or ~/document.docx) paths are supported. If a custom document handler is provided via DocumentHandlerType property, then this value will be passed to that handler which should open and return a readable stream according to this file identifier. So it can be any string value that your IDocumentHandler implementation understands.
Public propertyCode exampleDocumentFormat
Gets or sets the document format to use for the file specified in Document property. By default, the format is determined from the file extension but you can use this property when you don't have an extension or when you need to override the format determined from the extension (e.g. you want file.xml to be treated as Txt). This property is not effective when you use DocumentSource or DocumentHandlerType properties because those have their own way to specify/override the document format.
Public propertyCode exampleDocumentHandlerParameters
Gets or sets a name-value collection of parameters which will be passed to your IDocumentHandler implementation specified in DocumentHandlerType.
Public propertyCode exampleDocumentHandlerType
Gets or sets the document handler type which provides a custom way of loading the input files. This class should implement IDocumentHandler interface and should have a parameterless constructor so that it can be instantiated internally when necessary. Value of Document property will be passed to this handler which should open and return a readable stream according to that file identifier. So it can be any string value that your IDocumentHandler implementation understands.
Public propertyCode exampleDocumentLocation
Gets or sets the file system location for the file specified in Document property. By default, the file is considered on disk but you can use this property to load files from any of the supported file systems like UNC paths with password, Amazon S3 and Azure Blob. When specified Document property should be set to a relative path for this location. (e.g. "Document.docx" or "SomeFolder\Document.docx")
Public propertyCode exampleDocumentSource
Gets or sets the document source to load and display. This is an alternative to Document property. When you don't have a file on disk and implementing IDocumentHandler interface is not convenient, you can use this property to load documents from a stream or a byte array. Note that your stream or byte array will be copied to the cache folder if not already exists when you load via DocumentSource because DocumentViewer needs to access your document out of the context of the host page (i.e. serialization is needed).
Public propertyDownloadFileName
Gets or sets a value that specifies the custom file name used for downloading. This property will override the original file name specified in Document.
Public propertyDownloadUrl
Gets or sets a value that specifies the custom url that should be used for downloading. By default, when you click the download button, the download is handled internally by the document viewer. You can override the default behaviour by specifying your own url which handles the download.
Public propertyFitMode
Gets or sets a value that specifies the initial mode for fitting pages to the viewer. The default is FitWidth.
Public propertyHeight
Gets or sets the height of the component.
(Inherited from Component.)
Public propertyHidden
Gets or sets a value indicating whether the component is displayed when page is loaded. When set to false, the component can be displayed later on client-side manually. For example, the component can be displayed via a button's click event.
(Inherited from Component.)
Public propertyHighQualityEnabled
Gets or sets a value that specifies whether to render high quality within DocumentViewer. The default is false. For providing some guarantees regarding how quickly a page can be rendered on different systems such as mobile devices, by default some parts of a page that are very complex and would take really long to render in the browser, are rasterized to an image (flattened). However as a side effect, parts of some pages may look blurry when you zoom in. You can set this property to true to disable this possible flattening (if you observe it's happening with your specific document). This way you can ensure vector quality rendering for complex documents such as CAD drawings. If you have errors due to insufficient memory, keep it at false. This setting does not effect the first step of the conversion: Source -> PDF, it only effects the second step of the conversion: PDF -> XPZ.
Public propertyId
Gets or sets the HTML id of the component. Also a javascript variable with the same name is automatically defined and it can be used to access the client-side implementation of the component. If omitted, Id will be automatically set to the class name of this component (e.g camel-case className) and if there are other instances on the same page, to className2 ... classNameX.
(Inherited from Component.)
Public propertyInputOptions
Gets the collection of input options used when generating the displayed document. For example, when you add an instance of SpreadsheetInputOptions to this collection, it will be used only for spreadsheet input files.
Public propertyLanguage
Gets or sets the display language of the document viewer.
Public propertyLayoutMode
Gets or sets a value that specifies the initial mode for placing pages within the viewer. The default is Continuous.
Public propertyLoadingMessage
Gets or sets a value that specifies the message displayed while the document is being prepared for the first-time viewing. For example, you can override the default message for localization purpose.
Public propertyMobileMode
Gets or sets a value that specifies which mobile device type to use mobile document viewer on. The default is OnAny. Note that using full document viewer on mobile devices would cause performance issues (slow rendering), so you should prefer mobile document viewer which is optimized for mobile devices.
Public propertyPanelOptions
Gets or sets the panel options used for Panel mode.
(Inherited from Component.)
Public propertyPassword
Gets or sets the password which is used for loading a protected document.
Public propertyPrintOptions
Gets or sets the print options of the viewer. The options will be reflected as default values on the print dialog of the viewer.
Public propertyProductInfoRendered
Gets or sets a value indicating whether product info/copyright comment is rendered in html.
(Inherited from Component.)
Public propertyResizable
Gets or sets a value that specifies if the component can be resized when the user drags sides.
(Inherited from Component.)
Public propertyResizeHandles
Gets or sets a value that specifies the handles which can be used for resizing the component. Default is South, East and SouthEast. When using Window mode, set ResizeHandles which overrides this property.
(Inherited from Component.)
Public propertySearchOptions
Gets or sets the text search options of the viewer. If you specify the term, an automatic search will be done when the document is displayed, i.e. the specified term will be searched and results with clickable positions will be listed on the left pane and the term will be highlighted in the pages. For example, if you launch the document viewer from a search results page, you can pass the same search term to the viewer.
Public propertySidePaneTabsAtBottom
Gets or sets a value that specifies whether the top tabs of the left side pane should be placed at the bottom instead. The default is false.
Public propertySidePaneVisible
Gets or sets a value that specifies whether the left side pane is visible. The default is true.
Public propertySinglePageRotationEnabled
Gets or sets a value that specifies whether rotate buttons should only rotate the currently viewed page rather than all pages. The default is false.
Public propertyStateId
Gets or sets the state id of the component. This is determined automatically when state is saved to session.
(Inherited from StatefulComponent.)
Public propertyToolbarAtBottom
Gets or sets a value that specifies whether the top toolbar should be placed at the bottom instead. The default is false.
Public propertyToolbarVisible
Gets or sets a value that specifies whether the top toolbar is visible. The default is true.
Public propertyWatermarks
Gets the collection of the text or image watermarks to embed to the displayed document. Downloading as PDF will also include the same watermarks.
Public propertyWidth
Gets or sets the width of the component.
(Inherited from Component.)
Public propertyWindowOptions
Gets or sets the windows options used for Window mode.
(Inherited from Component.)
Public propertyZoomLevel
Gets or sets a value in percentage that specifies the initial zoom level of the document. The default is 100. For this property to be effective FitMode property should be set to Zoom.
Top
See Also