PDF 生成模板编辑器
开源可视化 PDF 生成引擎,支持自定义模板,并提供面向开发者的 API,灵活构建文档生成流程。
ComPDF Conversion SDK 通过回调函数的方式获取转换进度,以下示例演示了如何获取执行 PDF 转 Word 任务时的转换进度:
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);