Listening

In some cases there is the need to monitor conversion process and to receive update for start, progress and completion of a conversion. For such situations GroupDocs.Conversion expose extension point where the client application may hook up and receive updates.. 

To enable listening you have to:

Here is a code that demonstrates how to enable listening for GroupDocs.Conversion.

public class ConverterListener : IConverterListener
{
    public void Started()
    {
        Console.WriteLine("Conversion started...");
    }
    public void Progress(byte current)
    {
        Console.WriteLine($"... {current} % ...");
    }
    public void Completed()
    {
        Console.WriteLine("... conversion completed");
    }
}
IConverterListener listener = new ConverterListener();
Contracts.Func<ConverterSettings> settingsFactory = () => new ConverterSettings
{
    Listener = listener
};
using (Converter converter = new Converter("sample.docx", settingsFactory))
{
    PdfConvertOptions options = new PdfConvertOptions();
    converter.Convert("converted.pdf", options);
}

More resources

Examples and Demos

Please find more use-cases and complete C# sources of our backend and frontend examples and try them for free!