Hi
I’m getting an exception while instantiating Document object. The below line of code causing the exception :
Document doc1 = new Document(inputstream, null, LoadFormat.DOC, null);
The exception message is:
java.io.IOException: End of file reached.
at com.aspose.words.b.c(Unknown Source)
at com.aspose.words.b.d(Unknown Source)
at com.aspose.words.b.f(Unknown Source)
at com.aspose.words.b.g(Unknown Source)
at com.aspose.words.c.(Unknown Source)
at com.aspose.words.jr.a(Unknown Source)
at com.aspose.words.jr.(Unknown Source)
at com.aspose.words.kx.a(Unknown Source)
at com.aspose.words.kx.(Unknown Source)
at com.aspose.words.eb.(Unknown Source)
at com.aspose.words.Document.a(Unknown Source)
at com.aspose.words.Document.a(Unknown Source)
at com.aspose.words.Document.(Unknown Source)
at com.templatesdisplay.TemplatesDisplay.applyTemplates(TemplatesDisplay.java: 386)
Yes, I agree with you but when I’m using SbmFileInputStream I’m getting the above exception. I believe that the below line of code causing the exception :
InputStream stream = new SbmFileInputStream(new SbmFile(fileUrl));
Document doc1 = new Document(stream, null, LoadFormat.DOC, null);
Could you please provide me the ASPOSE version which you are executed the above sample program?
Because we are getting the above exception with ASPOSE 2.0 but not with ASPOSE 3.0.
The code is working fine with ASPOSE 3.0.
From the above analysis it has been concluded that the issue is due to different version used. Please confirme the same from your end also.
Thank you for additional information. I used the latest version of Aspose.Words for testing. You can download the latest version from here: https://releases.aspose.com/words/java
There is no sense to test with older versions because issues are always fixed in newer versions.
Best regards.