VerifyError when Converting .odt to .pdf using xdocReport

1.4k views Asked by At

I have to convert odt file to pdf file. for that I am using XdocReport.

My code is like this :

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);
    }

but after running this,I am getting error like

 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)

I have added all the jars. but not getting any result.

1

There are 1 answers

2
Angelo On

Perhaps it's a problem with ODFDOM version. I suggest you to try your code with only JARs provided from odt.converters-*-sample.zip that you can download at https://code.google.com/p/xdocreport/downloads/list