The full file path of the specified document. If the specified file does not exist, the returned format is unknown.
Example





In This Topic

GetDocumentFormat(String) Method

In This Topic
Determines the document format in accordance with the specified file path of that document.

Be aware that this method uses the file itself to obtain the known document format either from the file extension or the document content. If the file does not exist on the specified file path, the returned format is unknown.

Please refer to the GetDocumentFormatFromFileName method to obtain the document format based only on the file name.

Syntax
'Declaration
 
Public Overloads Shared Function GetDocumentFormat( _
   ByVal FilePath As String _
) As DocumentFormat
public static DocumentFormat GetDocumentFormat( 
   string FilePath
)
public function GetDocumentFormat( 
    FilePath: String
): DocumentFormat; static; 
public static function GetDocumentFormat( 
   FilePath : String
) : DocumentFormat;
public: static DocumentFormat GetDocumentFormat( 
   string* FilePath
) 
public:
static DocumentFormat GetDocumentFormat( 
   String^ FilePath
) 

Parameters

FilePath
The full file path of the specified document. If the specified file does not exist, the returned format is unknown.

Return Value

A member of the DocumentFormat enumeration. The format of the specified document.
Remarks
The method firstly favors popular formats by their extension. Secondly, it validates the file content to find the proper document format.
Example
How to properly retrieve the document format of a specified file.
Dim documentFormat As GdPicture14.DocumentFormat = GdPictureDocumentUtilities.GetDocumentFormat("d:\\documents\\document.docx")
GdPicture14.DocumentFormat documentFormat = GdPictureDocumentUtilities.GetDocumentFormat("d:\\documents\\document.docx");
See Also