Skip to content
DemoFAQ

获取转换进度

ComPDF Conversion SDK 通过回调函数的方式获取转换进度,以下示例演示了如何获取执行 PDF 转 Word 任务时的转换进度:

c#
void GetProgress(int pageIndex, int total)
{
    // 在此位置添加回调函数的代码。
}

OnProgress getPorgress += GetProgress;
LibraryManager.SetProgress(Marshal.GetFunctionPointerForDelegate(getPorgress));

string inputFilePath = "***";
string password = "***";
string outputFileName = "***";

WordOptions wordOptions = new WordOptions();
wordOptions.ContainImage = true;
wordOptions.ContainAnnotation = true;
wordOptions.EnableAiLayout = true;
wordOptions.EnableOCR = false;

ErrorCode error = CPDFConversion.StartPDFToWord(inputFilePath, password, outputFileName, wordOptions);