1

这是一个循环

有时 aPdf.Save 需要几分钟。

我想将时间限制设置为 60 秒。
如果需要更长的时间,只需设置 succUpdate = false; 并继续

try
{
    aPdf = new Aspose.Pdf.Document(docPathIn);
    // aPdf.Save will just hang some times and not throw an exception
    // if is runs more than 60 seconds I would like to give up and move to the next document
    aPdf.Save(MyDirOut + nativeXPSnew, Aspose.Pdf.SaveFormat.Xps);
    succUpdate = true;
}
catch (Exception Ex)
{
    Debug.WriteLine(Ex.Message);
    succUpdate = true;
}
finally
{
    aPdf = null;
}
4

0 回答 0