Converting document to PDF

Hi,
When I try to convert the .ods format file to pdf it throws me an exception, but when i save the same file as .xls it produce me a pdf file.

below is the code that I am using to convert it to PDF (java)

Workbook workbook = new Workbook();
workbook.open(“abc.ods”);
workbook.save(“abc.pdf”,FileFormatType.PDF);

Also can you please let me know all the formats that can be converted to pdf.

Thanks,
Saumil

Hi,


Please attach your sample ods file, so that we could check your issue on our end.

Thank you.

Attached is the ods file ,
below is the exception that I am getting

Exception in thread “main” java.lang.NoSuchMethodError: org.dom4j.io.SAXReader.resetHandlers()V
at com.aspose.cells.fX.d(Unknown Source)
at com.aspose.cells.fX.a(Unknown Source)
at com.aspose.cells.fX.a(Unknown Source)
at com.aspose.cells.iG.a(Unknown Source)
at com.aspose.cells.iG.a(Unknown Source)
at com.aspose.cells.Workbook.open(Unknown Source)
at com.amazon.adriveworker.document.ExcelDocumentProcessor.generatePDF(ExcelDocumentProcessor.java:16)
at AsposeTest.main(AsposeTest.java:8)

Hi,


Well, I have tested your case and it works fine. The ods file is converted to pdf just fine. I think you are not setting dom4j jar file into your classpath, so you are getting this error.
There are certain features that demand other jar files (dependencies) to be used or set into the class path with main Aspose.Cells’s jar file. You should deploy all these JAR files to make Aspose.Cells work properly in all scenarios with all the features.

Below is a complete list of these other jar files,
dom4j-1.6.1.jar
jsr173_1.0_api.jar
stax2-api-3.0.2.jar
woodstox-core-asl-4.0.8.jar

You may download the additional files from here:

Thank you.

My bad,

Thanks for your prompt reply