【问题标题】:VerifyError when Converting .odt to .pdf using xdocReport使用 xdocReport 将 .odt 转换为 .pdf 时的验证错误
【发布时间】:2013-09-12 12:00:31
【问题描述】:

我必须将 odt 文件转换为 pdf 文件。为此,我正在使用 XdocReport。

我的代码是这样的:

public static void convertOdtToPdf(String inputFilename , String outputFilename) throws Exception{


        InputStream in= new FileInputStream(new File(inputFilename));
        OdfTextDocument document = OdfTextDocument.loadDocument(in);


        PdfOptions options = PdfOptions.create();

        OutputStream out = new FileOutputStream(new File(outputFilename));
        PdfConverter.getInstance().convert(document, out, options);
    }

但是在运行这个之后,我得到了类似的错误

 java.lang.VerifyError: (class: org/odftoolkit/odfdom/pkg/OdfPackage, method: getDom signature: (Ljava/lang/String;)Lorg/w3c/dom/Document;) Incompatible object argument for function call
    2013-09-12 11:47:06,767 ERROR [STDERR] (WorkManager(2)-68)  at org.odftoolkit.odfdom.doc.OdfDocument.loadDocument(OdfDocument.java:219)

我已经添加了所有的罐子。但没有得到任何结果。

【问题讨论】:

    标签: java pdf odt xdocreport odfdom


    【解决方案1】:

    可能是 ODFDOM 版本的问题。我建议您仅使用 odt.converters-*-sample.zip 提供的 JAR 来尝试您的代码,您可以在 https://code.google.com/p/xdocreport/downloads/list 下载它

    【讨论】:

    猜你喜欢
    • 2014-03-03
    • 2020-03-25
    • 2014-06-28
    • 1970-01-01
    • 2016-07-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-03-08
    相关资源
    最近更新 更多