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
Name | Value | Description |
---|---|---|
DataLossCategory | FF | Some text/char/image or other data will be missing from either the document tree following load, or from the created document following save. |
DataLoss | 1 | Generic data loss, no specific code. |
MajorFormattingLossCategory | FF00 | The resulting document or a particular location in it might look substantially different compared to the original document. |
MajorFormattingLoss | 100 | Generic major formatting loss, no specific code. |
MinorFormattingLossCategory | FF0000 | The resulting document or a particular location in it might look somewhat different compared to the original document. |
MinorFormattingLoss | 10000 | Generic minor formatting loss, no specific code. |
FontSubstitution | 20000 | Font has been substituted. |
FontEmbedding | 40000 | Loss of embedded font information during document saving. |
UnexpectedContentCategory | F000000 | 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. |
UnexpectedContent | 1000000 | Generic unexpected content, no specific code. |
Hint | 10000000 | Advises 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();