We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to use loadOptions.WarningCallback in C#


Kindly provide me sample code in C# for loadOptions.WarningCallback and SaveOptions.WarningCallback.

You can refer the below link:

Srinivas M


Thanks for your inquiry. Please check the following code example. Hope this helps you.

Aspose.Words.LoadOptions loadOptions = new Aspose.Words.LoadOptions();
loadOptions.WarningCallback = new HandleDocumentWarnings();
Document doc = new Document(MyDir + "in.docx", loadOptions);

doc.WarningCallback = new HandleDocumentWarnings();  
doc.Save(MyDir + "18.10.pdf");

public class HandleDocumentWarnings : IWarningCallback
    public void Warning(WarningInfo info)
        Console.WriteLine(info.WarningType + " :: " + info.Description.ToString());

Many thanks.

Srinivas Mergu