java.lang.Objectcom.aspose.words.WarningInfo
public class WarningInfo
You do not create instances of this class. Objects of this class are created
and passed by Aspose.Words to the Example:
public static class HandleDocumentWarnings implements IWarningCallback {
/**
* 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.
*/
public void warning(final WarningInfo info) {
// We are only interested in fonts being substituted
if (info.getWarningType() == WarningType.FONT_SUBSTITUTION) {
System.out.println("Font substitution: " + info.getDescription());
}
}
}
Property Getters/Setters Summary | ||
---|---|---|
java.lang.String | getDescription() | |
Returns the description of the warning. | ||
int | getSource() | |
Returns the source of the warning. The value of the property is WarningSource integer constant. | ||
int | getWarningType() | |
Returns the type of the warning. The value of the property is WarningType integer constant. |
Property Getters/Setters Detail |
---|
getDescription | |
public java.lang.String getDescription() |
Example:
Shows how to implement the IWarningCallback to be notified of any font substitution during document save.public static class HandleDocumentWarnings implements IWarningCallback { /** * 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. */ public void warning(final WarningInfo info) { // We are only interested in fonts being substituted if (info.getWarningType() == WarningType.FONT_SUBSTITUTION) { System.out.println("Font substitution: " + info.getDescription()); } } }
getSource | |
public int getSource() |
getWarningType | |
public int getWarningType() |
Example:
Shows how to implement the IWarningCallback to be notified of any font substitution during document save.public static class HandleDocumentWarnings implements IWarningCallback { /** * 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. */ public void warning(final WarningInfo info) { // We are only interested in fonts being substituted if (info.getWarningType() == WarningType.FONT_SUBSTITUTION) { System.out.println("Font substitution: " + info.getDescription()); } } }