Hi team,
When we download the document from blob and loading that document in stream for further process below error we are facing
ArgumentNullException: Value cannot be null. (Parameter ‘fontData’)
Aspose.Words.FileCorruptedException: ‘The document appears to be corrupted and cannot be loaded.’
Could you please help us out to resolve this error
Thank you!
@cpai.sachin
The error you are encountering, ArgumentNullException: Value cannot be null. (Parameter 'fontData')
and Aspose.Words.FileCorruptedException: 'The document appears to be corrupted and cannot be loaded.'
, typically indicates that there is an issue with the document you are trying to load. Here are some steps you can take to troubleshoot and resolve this issue:
-
Check Document Integrity: Ensure that the document you are downloading from the blob storage is not corrupted. You can try opening the document in a word processor to verify that it opens without errors.
-
Update Aspose.Words: If you are using an older version of Aspose.Words, consider updating to the latest version. There have been improvements and bug fixes in newer releases that might resolve your issue. For instance, a user reported that the issue was not present in version 20.9 of Aspose.Words for .NET, so upgrading might help.
-
Stream Handling: Make sure that the stream you are using to load the document is properly initialized and not null. If you are reading from a blob, ensure that the stream is correctly set up to read the document data.
-
LoadOptions: If you are using any specific LoadOptions
, ensure that they are correctly configured. Sometimes, incorrect options can lead to loading issues.
-
Error Handling: Implement error handling to catch exceptions and log detailed information about the document and the loading process. This can help you identify the root cause of the problem.
If the problem persists after trying these steps, consider sharing a minimal reproducible example of your code along with the document (if possible) for further assistance.
If you need more specific guidance, please provide additional details about your implementation and the version of Aspose.Words you are using.
Hi team,
We already have performed mentioned steps
As we check downloading the document from blob stoage and open in word it is opening as expected without any warning
Issue was not resolved. could you please help further
We are using Aspose.Words (21.6.0)
@cpai.sachin Could you please attach the problematic document here for testing? We will check the issue and provide you more information.
Hi @alexey.noskov Please prefer attached document for your test
Thank you!
Test Document (251.8 KB)
@cpai.sachin Thank you for additional information. The problem is not reproducible on my side using the latest 25.5 version of Aspose.Words. Please try using the latest version and let us know whether the problem still persists on your side.
Thanks @alexey.noskov
Will check and let you know.
1 Like
Hi @alexey.noskov
Could you please check same document on Aspose.Words Version 24.6
and confirmed.
Thank you!
@cpai.sachin The problem is not reproducible with 24.6 version of Aspose.Words on my side. If possible, could you please create a simple console application that will allow us to reproduce the problem on our side?
Sure let me check and revert you
thank you!
1 Like
Hi @alexey.noskov
We are able to process the document using 24.6 version of Aspose.Words
Thanks for your support.
1 Like