IWarningCallbackWarning Method

Aspose.Words invokes this method when it encounters some issue during document loading or saving that might result in loss of formatting or data fidelity.

Namespace:  Aspose.Words
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.4
Syntax
void Warning(
	WarningInfo info
)

Parameters

info
Type: Aspose.WordsWarningInfo
Examples
Shows how to implement the IWarningCallback to be notified of any font substitution during document save.
public class HandleDocumentWarnings : IWarningCallback
{
    /// <summary>
    /// Our callback only needs to implement the "Warning" method. This method is called whenever there is a
    /// potential issue during document processing. The callback can be set to listen for warnings generated during document
    /// load and/or document save.
    /// </summary>
    public void Warning(WarningInfo info)
    {
        // We are only interested in fonts being substituted
        if (info.WarningType == WarningType.FontSubstitution)
        {
            Console.WriteLine("Font substitution: " + info.Description);
        }
    }

}
See Also