Click or drag to resize

WarningType Enumeration

Specifies the type of a warning that is issued by Aspose.Words during document loading or saving.

Namespace:  Aspose.Words
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
[FlagsAttribute]
public enum WarningType
Members
  Member nameValueDescription
DataLossCategory255 Some text/char/image or other data will be missing from either the document tree following load, or from the created document following save.
DataLoss1 Generic data loss, no specific code.
MajorFormattingLossCategory65280 The resulting document or a particular location in it might look substantially different compared to the original document.
MajorFormattingLoss256 Generic major formatting loss, no specific code.
MinorFormattingLossCategory16711680 The resulting document or a particular location in it might look somewhat different compared to the original document.
MinorFormattingLoss65536 Generic minor formatting loss, no specific code.
FontSubstitution131072 Font has been substituted.
FontEmbedding262144 Loss of embedded font information during document saving.
UnexpectedContentCategory251658240 Some content in the source document could not be recognized (i.e. is unsupported), this may or may not cause issues or result in data/formatting loss.
UnexpectedContent16777216 Generic unexpected content, no specific code.
Hint268435456 Advises of a potential problem or suggests an improvement.
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