Hi @tahir.manzoor
The InterruptionToken class is marked as Obsolete in Aspose.Words v20.9.0, so it’s not a good idea to use it any more :-(. The suggested alternate is to use IPageLayoutCallback, but this doesn’t look to be a like-for-like replacement, and it also doesn’t look like it’s possible to use it in the following code:
var doc = new Aspose.Words.Document(sourceStream);
var saveOptions = new PdfSaveOptions();
using (var pdfStream = GetStream())
{
// Processing hangs in the call to Save below
doc.Save(pdfStream, saveOptions);
}
I’ve tried using the IPageSavingCallback as follows:
public class WordToPdf : Aspose.Words.Saving.IPageSavingCallback
{
public void DoConvert(Stream sourceStream)
{
var doc = new Aspose.Words.Document(sourceStream);
var saveOptions = new PdfSaveOptions();
saveOptions.PageSavingCallback = this;
using (var pdfStream = GetStream())
{
doc.Save(pdfStream, saveOptions);
}
}
void IPageSavingCallback.PageSaving(PageSavingArgs args)
{
// This method never gets called
}
}
…but the PageSaving method never gets called, and the process still hangs in the Save method.
Am I missing something?