SaveFormatToLoadFormat

FileFormatUtil.SaveFormatToLoadFormat method

Converts a SaveFormat value to a LoadFormat value if possible.

public static LoadFormat SaveFormatToLoadFormat(SaveFormat saveFormat)

Exceptions

exceptioncondition
ArgumentExceptionThrows when cannot convert.

Examples

Shows how to convert a save format to its corresponding load format.

Assert.AreEqual(LoadFormat.Html, FileFormatUtil.SaveFormatToLoadFormat(SaveFormat.Html));

// Some file types can have documents saved to, but not loaded from using Aspose.Words.
// If we attempt to convert a save format of such a type to a load format, an exception will be thrown.
Assert.Throws<ArgumentException>(() => FileFormatUtil.SaveFormatToLoadFormat(SaveFormat.Jpeg));

See Also