Skip to content

PDF 生成模板编辑器

开源可视化 PDF 生成引擎,支持自定义模板,并提供面向开发者的 API,灵活构建文档生成流程。

查看 GitHub

获取转换进度

ComPDF Conversion SDK 通过 ProgressCallback 接口的方式获取转换进度,以下示例演示了如何获取执行 PDF 转 Word 任务时的转换进度。

java
class ProgressClass implements ConvertCallback {
    boolean cancelled = false;

    @Override
    public void onProgress(int current, int total) {
        System.out.printf("Current Progress: %d / %d%n", current, total);
    }

    @Override
    public boolean isCancelled() {
        return cancelled;
    }
}

CPDFConversion.startPDFToWord("word.pdf", "", "path/output.docx", new WordOptions(), new ProgressClass());