Click or drag to resize

DocumentViewerDocumentFormat Property

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.

Namespace:  GleamTech.DocumentUltimate.AspNet.UI
Assembly:  GleamTech.DocumentUltimate (in GleamTech.DocumentUltimate.dll) Version: 5.4.2
Syntax
public DocumentFormat DocumentFormat { get; set; }

Property Value

Type: DocumentFormat
Examples

Specify/override the document format:

documentViewer.Document = @"c:\SomeFolder\Document";
//Specify format for extensionless file "Document"
documentViewer.DocumentFormat = DocumentFormat.Docx;

documentViewer.Document = @"c:\SomeFolder\Document.xml";
//Force "Document.xml" to be treated as DocumentFormat.Txt
documentViewer.DocumentFormat = DocumentFormat.Txt;
See Also