WarningType Enum

Wordize.WarningType enum. Specifies the type of a warning that is issued by Wordize during document loading or saving.

WarningType enumeration

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

[Flags]
public enum WarningType

Values

NameValueDescription
DataLossCategoryFFSome text/char/image or other data will be missing from either the document tree following load, or from the created document following save.
DataLoss1Generic data loss, no specific code.
MajorFormattingLossCategoryFF00The resulting document or a particular location in it might look substantially different compared to the original document.
MajorFormattingLoss100Generic major formatting loss, no specific code.
MinorFormattingLossCategoryFF0000The resulting document or a particular location in it might look somewhat different compared to the original document.
MinorFormattingLoss10000Generic minor formatting loss, no specific code.
FontSubstitution20000Font has been substituted.
FontEmbedding40000Loss of embedded font information during document saving.
UnexpectedContentCategoryF000000Some 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.
UnexpectedContent1000000Generic unexpected content, no specific code.
Hint10000000Advises of a potential problem or suggests an improvement.

Examples

Implementation of IWarningCallback to get font substitution warnings.

private class FontSubstitutionWarningCallback : IWarningCallback
{
    public void Warning(WarningInfo info)
    {
        if (info.WarningType == WarningType.FontSubstitution)
        {
            Console.WriteLine(info.Description);
        }
    }
}

Demonstrates how to specify a fonts folder in the default font settings and use a warning callback to receive notifications about font substitution during document rendering.

Wordize.Settings.DefaultFontSettings.SetFontsFolder(MyDir + "MyFonts", true);

ConverterContext context = new ConverterContext();
context.WarningCallback = new FontSubstitutionWarningCallback();

Converter.Create(context)
    .From(MyDir + "Simple.docx")
    .To(ArtifactsDir + "FontSubstitution.pdf")
    .Execute();

See Also