We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

com.aspose.pdf.exceptions.InvalidPdfFileFormatException: Startxref not found

here is my demo codes , does anyone tell me why system report error as below:

com.aspose.pdf.exceptions.InvalidPdfFileFormatException: Startxref not found at com.aspose.pdf.internal.p471.z17.m16(Unknown Source) at com.aspose.pdf.internal.p471.z17.(Unknown Source) at com.aspose.pdf.internal.p471.z17.(Unknown Source) at com.aspose.pdf.internal.p445.z2.m5(Unknown Source) at com.aspose.pdf.internal.p471.z16.(Unknown Source) at com.aspose.pdf.internal.p445.z2.m8(Unknown Source) at com.aspose.pdf.internal.p390.z8.m1(Unknown Source) at com.aspose.pdf.internal.p390.z8.(Unknown Source) at com.aspose.pdf.ADocument.m1(Unknown Source) at com.aspose.pdf.ADocument.(Unknown Source) at com.aspose.pdf.Document.(Unknown Source) at aspose.Test.main(Test.java:15)

public static void main(String[] args) {
try {
Document doc = new Document("C:\\testConvert\\haha.doc");
} catch (Exception e) {
// TODO: handle exception

Hi James,

Thanks for contacting support.

Aspose.Pdf for Java provides the feature to create as well as manipulate existing PDF files. However as per my understanding, you are trying to load an existing MS Word file into com.aspose.pdf.Document object. Please note that in order to create/manipulate MS Word files, you need to try using com.aspose.words.Document object of Aspose.Words for Java.

hi ,

My intention is to convert a existing complicated word to PDF file, does your product support it?
If so , could you please give a sample code for my reference?


Hi James,

Thanks for your inquiry.

With Aspose.Words, you can easily render any Microsoft Word document (e.g. DOC, DOCX, RTF etc) to PDF format. I would suggest you please read the following article for more details:

Best regards,