IWarningCallback Interface

Wordize.IWarningCallback interface. Implement this interface if you want to have your own custom method called to capture loss of fidelity warnings that can occur during document loading or saving.

IWarningCallback interface

Implement this interface if you want to have your own custom method called to capture loss of fidelity warnings that can occur during document loading or saving.

public interface IWarningCallback

Methods

NameDescription
Warning(WarningInfo)Wordize invokes this method when it encounters some issue during document loading or saving that might result in loss of formatting or data fidelity.

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