The actual error i am getting is below stack trace
Aspose.Words.FileCorruptedException: The document appears to be corrupted and cannot be loaded. —> System.ArgumentOutOfRangeException: Non-negative number required. Parameter name: count
And things to observe that removing a portaion of data Chunk [Remove from " {*\datastore " till end ] from the file attached “UneditableChunk_MakeItWork.txt” and upload in Aspose.word online portal documents viewd successfully but with keeping same data portion in other doucments it works without issue then why only some documents is having issue ?
There are other documents for which Aspose gives error and attached is one of them.
Please let us know if the reason or if you need any other information from me.
For the sake of any correction in Aspose.Words API, we have logged this problem in our issue tracking system with ID WORDSNET-22374. We will further look into the details of this problem and will keep you updated on the status of linked issue. We apologize for any inconvenience.
So, it looks like to be an RTF document. When MS Word 2019 tries to open this RTF document, it reports several errors and cannot display the document text: (see WORDSNET-22374 Analysis 1.png (16.4 KB)). Aspose.Words can currently not import this RTF document either. We think that we can add resilience in code to be able to load this file with Aspose.Words. We will inform you via this forum thread as soon as this issue will get resolved in future.
We tried with two different version of Aspose.Word DLL and found that with Aspose version 21, if we remove entire “*\datastore” portion till end, the errored documents appears successfully whereas with Aspose verion 17 , if we remove “*\datastore” portion till end the errored documents does not appears.
Yes, it’s RTF document and we tried above with visual studio with Aspose verion 17 and 21 and both version have diffrent behaviour.
Please let us know asap the reason of issue and fix as well.
Thanks for the additional information. We have good news for you i.e. WORDSNET-22374 has now been resolved. The fix of this issue will be included in the next 21.7 version of Aspose.Words. We will inform you via this forum thread as soon as the next version containing the fix of this issue will be released at the start of next month.
We can definitely consume Aspose 21.7 version in the major release of our product can you please direct me to the 21.7 release notes.
In the interim, is there any workaround solution that you can suggest us for the consumption of Aspose version “17.12.0.0”. and make it work.
Here is the sample code snippet which we are using to create the document based on the attached RTF file
string rtf = System.IO.File.ReadAllText(@"C:\test_Data\UneditableChunk_MakeItWork.txt"); // physical path location of the attached file
MemoryStream stream = new MemoryStream();
StreamWriter writer = new StreamWriter(stream);
writer.Write(rtf);
writer.Flush();
stream.Position = 0;
Aspose.Words.Document doc = new Aspose.Words.Document(stream);// This line throws error at present
Could you please confirm the below details as well -
Release date of 21.7 Aspose.Word ?
As there is still a time for release 21.7. so meanwhile can we get any prerelease draft of 21.7 Aspose.Word DLL, which we can use for our DEV testing ?
Next 21.7 version of Aspose.Words for .NET API will be published within the first two weeks of July 2021. You will be notified here as soon as the next 21.7 version will be released.
Secondly, I am afraid, only Enterprise Support customers are eligible for a ‘hotfix’ (interim) build. So, if this issue is extremely urgent, and you have Enterprise Support account, then you can request a hotfix by using the Paid Support helpdesk.