saveFormatToLoadFormat method

saveFormatToLoadFormat(saveFormat)

Converts a SaveFormat value to a LoadFormat value if possible.

saveFormatToLoadFormat(saveFormat: Aspose.Words.SaveFormat)
ParameterTypeDescription
saveFormatSaveFormat

Exceptions

exceptioncondition
RuntimeError (Proxy error(ArgumentException))Throws when cannot convert.

Examples

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

expect(aw.FileFormatUtil.saveFormatToLoadFormat(aw.SaveFormat.Html)).toEqual(aw.LoadFormat.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.
expect(() => aw.FileFormatUtil.saveFormatToLoadFormat(aw.SaveFormat.Jpeg)).toThrow("Cannot convert this save format to a load format.");

See Also