WarningInfo.WarningType

WarningInfo WarningType property. Returns the type of the warning.

WarningInfo.WarningType property

Returns the type of the warning.

public WarningType WarningType { get; }

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