Free Support Forum - aspose.com

Cannot convert Word to PDF

Hello,


I’m using Aspose.Words trial version & repeatedly getting the error “com.aspose.words.UnsupportedFileFormatException: Unknown file format” for both .doc & .docx files created by me. But when the .docx file was created using Aspose library, it worked well. Can someone help me? Here is the code:

import com.aspose.words.*;
class WordToPdf {
public static void main(String[] args) throws Exception {
Document doc = new Document(“E:/input.doc”);
doc.save(“E:/output.pdf”);
}
}

Thanks in advance!

Hi Dhruv,


Thanks for your inquiry. Please check my reply at this link.