Hi all, I really need a timeout for all the APIs but it is still missing. Is that right? Do you plan to implement it?
Hi Diego,
Can you please further elaborate your requirement e.g. which input formats are you using and what are your desired output formats? Please attach some samples if Aspose takes longer time to convert them or extract text.
Best Regards,
Hi, actually I need to solve the problem for any kind of input and output managed by Aspose.Pdf, Aspose.Words, Aspose.Email, Aspose.Cells, and Aspose.Slides.In particualr, it is necessary that the conversion time for a document does not not exceed 1 sec. How can I do that?
Hi Diego,
This feature is not supported by any API. We will log these issues and share the IDs with you soon.
Best Regards,
Hi Diego,
I have observed your requirement and have added an issue with ID SLIDESNET-36244 as new feature request in our issue tracking system to investigate the possibility of implementing the requested support. This thread has been linked with the issue so that you may be automatically notified once the issue will be resolved.
Many Thanks,
Hi Diego,
Hi again,
class MTTest
{
private string _path;
private InterruptMonitor _monitor;
private Workbook _wb;
public MTTest(string path)
{
_path = path;
_monitor = new InterruptMonitor();
}
public void InterruptLoad()
{
_monitor.Interrupt();
}
public void Load()
{
LoadOptions opts = new LoadOptions();
opts.InterruptMonitor = _monitor;
Console.WriteLine(“Loading template file…”);
long t = DateTime.Now.ToFileTimeUtc();
try
{
_wb = new Workbook(_path, opts);
Console.WriteLine(“Template file has been loaded”);
}
catch (CellsException ce)
{
if (ce.Code == ExceptionType.Interrupted)
{
Console.WriteLine(“Load process has been interrupted.”);
}
else
{
throw ce;
}
}
}
}
MTTest tho = new MTTest(infile);
Thread th = new Thread(new ThreadStart(tho.Load));
th.Start();
Thread.Sleep(1000);
tho.InterruptLoad();
We suggest you to please try using following sample code on your end using latest Aspose.Slides for .NET 20.1 for setting TimeOut options.
public static void SavePresentationToPdf()
{
Action<IInterruptionToken> action = (IInterruptionToken token) =>
{
LoadOptions options = new LoadOptions { InterruptionToken = token };
using (Presentation presentation = new Presentation(pptxFileName, options))
{
presentation.Save(pdfFileName, SaveFormat.Pdf);
}
};
InterruptionTokenSource tokenSource = new InterruptionTokenSource();
Run(action, tokenSource.Token); // run action in a separate thread
Thread.Sleep(10000); // timeout
tokenSource.Interrupt(); // stop conversion
}
private static void Run(Action<IInterruptionToken> action, IInterruptionToken token)
{
Task.Run(() => { action(token); });
}
@diego.tosato,
This is to inform you that we have fixed your issue (logged earlier as “CELLSNET-43461”) now. We will soon provide you the fixed version after performing QA and incorporating other enhancements and fixes.