DocumentCacheOptionsFormat Property

Gets or sets the document format to use for the document. 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).

Note that changes in this property change CachePdfKey.

Definition

Namespace: GleamTech.DocumentUltimate.Caching
Assembly: GleamTech.DocumentUltimate (in GleamTech.DocumentUltimate.dll) Version: 7.2.0
C#
public DocumentFormat Format { get; set; }

Property Value

DocumentFormat

Example

Specify/override the document format:

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

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

See Also