FileFormatUtil

FileFormatUtil

Overview

FileFormatUtil is a class in Aspose.Words FOSS for .NET.

Provides utility methods for working with file formats, such as detecting file format or converting file extensions to/from file format enums.

This class provides 10 methods for working with FileFormatUtil objects in .NET programs. Available methods include: ContentTypeToLoadFormat, ContentTypeToSaveFormat, DetectFileFormat, ExtensionToSaveFormat, ImageTypeToExtension, LoadFormatToExtension, LoadFormatToSaveFormat, SaveFormatToExtension, SaveFormatToLoadFormat. All public members are accessible to any .NET application after installing the Aspose.Words FOSS for .NET package.

Methods

SignatureDescription
DetectFileFormat(fileName: string)Detects and returns the information about a format of a document.
DetectFileFormat(stream: Stream)Calls DetectFileFormat(stream) on this FileFormatUtil instance.
ContentTypeToLoadFormat(contentType: string)Converts IANA content type into a load format enumerated value.
ContentTypeToSaveFormat(contentType: string)Converts IANA content type into a save format enumerated value.
LoadFormatToExtension(loadFormat: LoadFormat)Converts a load format enumerated value into a file extension.
SaveFormatToLoadFormat(saveFormat: SaveFormat)Converts a SaveFormat value to a LoadFormat value if possible.
LoadFormatToSaveFormat(loadFormat: LoadFormat)Converts a LoadFormat value to a SaveFormat value if possible.
SaveFormatToExtension(saveFormat: SaveFormat)Converts a save format enumerated value into a file extension.
ExtensionToSaveFormat(extension: string)Converts a file name extension into a SaveFormat value.
ImageTypeToExtension(imageType: ImageType)Converts an Aspose.Words image type enumerated value into a file extension.

See Also