I am working with converting a .docx file to a pdf file. The docx file contains text, images, charts. which must be converted to a pdf file. So I used the code below for my task. But it shows that "Converting to Dalvik format ended with error 1" . I used 15 cans, so for.
try {
long start = System.currentTimeMillis();
InputStream is = new FileInputStream(new File(
"/mnt/sdcard/HelloWorld.docx"));
XWPFDocument document = new XWPFDocument(is);
PdfOptions options = PdfOptions.create();
OutputStream out = new FileOutputStream(new File(
"/mnt/sdcard/HelloWorld.pdf"));
PdfConverter.getInstance().convert(document, out, options);
System.err.println("Generate pdf/HelloWorld.pdf with "
+ (System.currentTimeMillis() - start) + "ms");
} catch (Throwable e) {
e.printStackTrace();
}
I was more searching google, I had a lot of suggestions like project β clean, editing eclipse.ini, changing proguard in sdk, .. everything I tried but no one can help. Can anyone help me or any solution? Thanks.