Table of Contents

DocumentCacheOptions.Format Property

Definition

Namespace
GleamTech.DocumentUltimate.Caching
Assembly
GleamTech.DocumentUltimate.dll

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.

public DocumentFormat Format { get; set; }

Property Value

DocumentFormat

Examples

Specify/override the document format:

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;
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