Hi Team,
I am using aspose-words-19.6-jdk17 version to parse the .doc/docx files. but i am landing always on below exception trace.
**Exception in thread "main" com.aspose.words.FileCorruptedException: The document appears to be corrupted and cannot be loaded**.
at com.aspose.words.FileFormatUtil.zzZ(Unknown Source)
at com.aspose.words.Document.zzY(Unknown Source)
at com.aspose.words.Document.zzZ(Unknown Source)
at com.aspose.words.Document.<init>(Unknown Source)
at com.aspose.words.Document.<init>(Unknown Source)
at AsposeTest.main(AsposeTest.java:10)
Caused by: java.lang.NullPointerException
at com.aspose.words.zzZDU.zzB(Unknown Source)
at com.aspose.words.zzZDU.zzY(Unknown Source)
at com.aspose.words.zz7J.zzH(Unknown Source)
at com.aspose.words.zz74.zzK(Unknown Source)
at com.aspose.words.zz74.zzL(Unknown Source)
at com.aspose.words.zzZE7.zzR(Unknown Source)
at com.aspose.words.zz7T.zzU(Unknown Source)
at com.aspose.words.zz77.zzZ(Unknown Source)
at com.aspose.words.zzZDK.zzY(Unknown Source)
at com.aspose.words.zzZE7.zzTb(Unknown Source)
at com.aspose.words.zz88.zzK(Unknown Source)
at com.aspose.words.zz89.zzZMz(Unknown Source)
at com.aspose.words.zz89.zzZMA(Unknown Source)
at com.aspose.words.zz88.read(Unknown Source)
at com.aspose.words.zz7H.zzZMz(Unknown Source)
at com.aspose.words.zz7H.read(Unknown Source)
at com.aspose.words.zzZ7H.read(Unknown Source)
at com.aspose.words.Document.zzY(Unknown Source)
... 4 more
Below is the code snippet
import com.aspose.words.Document;
import com.aspose.words.NodeCollection;
import com.aspose.words.NodeType;
import com.aspose.words.Run;
public class AsposeTest {
public static void main(String[] args) throws Exception {
String fileName = "D:\01.Test.docx";
Document document = new Document(fileName);
NodeCollection<Run> runs = document.getChildNodes(NodeType.RUN, true);
for(Run run : runs) {
System.out.print(run.getText());
// System.out.println(run.getFont().getName());
}
}
}
Can you please help me out.
Thanks in Advance…
@Pintutrnt,
Thanks for your inquiry. Have you tried the latest version of Aspose.Words for Java i.e. 19.7 on your end? In case the problem still remains, please ZIP and upload your input Word document you are getting this problem with here for testing. We will then investigate the issue on our end and provide you more information.
@awais.hafeez
I tried with the latest version as well but no luck. As requested, have attached the file.8K_Miles_extract-11-Mar-2018.zip (6.2 KB)
@Pintutrnt,
We tested the scenario and have managed to reproduce the same problem on our end. For the sake of correction, we have logged this problem in our issue tracking system. The ID of this issue is WORDSNET-18984. We will further look into the details of this problem and will keep you updated on the status of correction. We apologize for your inconvenience.
Hi Hafeez,
can you please let me know the status of WORDSNET-18984 issue. Or let me know the link to track the issue…
Thank you…
@Pintutrnt,
I am afraid, your issue (WORDSNET-18984) is currently ‘pending for analysis’ and is in the queue. We will inform you via this thread as soon as this issue will be resolved in future. We apologize for any inconvenience.
P.S. Unfortunately, there is no direct way that you can use to track issues by yourself. But, you are welcome to ask your issue status via forum threads. We will verify the status from our internal issue tracking system and reply you back.
Hi Team,
I am using Aspose word java to generate a word file and convert the same to PDF using below code:
PdfSaveOptions options = new PdfSaveOptions();
options.getOutlineOptions().setDefaultBookmarksOutlineLevel(1);
document.save(“D:/test.pdf”,options);
but when i am generating PDF 2nd time and parsing using 3rd party library , at that i am getting below exception:
java.io.IOException: Page tree root must be a dictionary
although at 1st time , its working fine( able to parse the same pdf).
Any help will be very helpful.
Thank you…
@Pintutrnt,
To ensure a timely and accurate response, please ZIP and attach the following resources here for testing:
- Your simplified input Word document
- Aspose.Words generated output document
- What third party API are you using and from where can we download it for testing?
- Please also list the complete steps that we can follow on our end to reproduce this issue
- Please also create a simplified standalone Java application (source code without compilation errors) that helps us to reproduce your current problem on our end and attach it here for testing.
As soon as you get these pieces of information ready, we will start further investigation into your scenario and provide you more information. Thanks for your cooperation.
P.S. You can also upload the ZIP file to Dropbox and share the Download link here for testing.
The issues you have found earlier (filed as WORDSNET-18984) have been fixed in this Aspose.Words for .NET 19.10 update and this Aspose.Words for Java 19.10 update.
Hi Team,
Thank you.After upgrading to 19.10 version , It resolved the file issue but I am getting below exception when saving into PDF format :
Caused by: java.lang.IllegalStateException: Infinite loop detected.
at com.aspose.words.zzYU4.zzpE(Unknown Source)
at com.aspose.words.zzYU4.zza(Unknown Source)
at com.aspose.words.zz8J.zzG(Unknown Source)
at com.aspose.words.zz8K.zzZHa(Unknown Source)
at com.aspose.words.zzZ5M.zzYU2(Unknown Source)
at com.aspose.words.Document.updatePageLayout(Unknown Source)
at com.aspose.words.Document.zzWK(Unknown Source)
at com.aspose.words.Document.getPageCount(Unknown Source)
at com.aspose.words.zzZZO.zzY(Unknown Source)
at com.aspose.words.zzZZO.zzZ(Unknown Source)
at com.aspose.words.zzZF1.zzZ(Unknown Source)
at com.aspose.words.Document.zzZ(Unknown Source)
at com.aspose.words.Document.zzZ(Unknown Source)
at com.aspose.words.Document.save(Unknown Source)
Hence again , i have degraded Aspose word java version to 19.2. (so issue still persist).
@Pintutrnt,
After an initial test with the licensed latest version of Aspose.Words for Java i.e. 19.10, we were unable to reproduce this issue on our end.
Please see the following output PDF file that we generated from your ‘8K_Miles_extract-11-Mar-2018.docx’ file by using the following simple code of Aspose.Words:
Document doc = new Document("E:\\8K_Miles_extract-11-Mar-2018\\8K_Miles_extract-11-Mar-2018.docx");
doc.save("E:\\8K_Miles_extract-11-Mar-2018\\awjava-19.10.pdf");