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

Free Support Forum - aspose.com

TXT file with some symbols cause Document to throw exception


I was testing Aspose.Words for .NET with different types of documents, and found a TXT file which fails to load (attached). The “Aspose.Words.UnsupportedFileFormatException” exception is thrown in Document constructor when i try to open a file.
After some testing, I found that an “arrow” symbols in the document cause this exception: once they are deleted, the document opens just fine.

Is there a way to handle this? Or is it some sort of core limitation of the library?

TXT file and exception details are attached.
I am using Aspose.Words for .NET v16.12 (from NuGet), trial version.


Hi Mikhail,

Thanks for your inquiry. Please use LoadOptions class as shown below to avoid this exception.

Aspose.Words.LoadOptions options = new Aspose.Words.LoadOptions();
options.LoadFormat = LoadFormat.Text;
Document doc = new Document(MyDir + "test3.txt", options);

Works great, thank you!

Hi Mikhail,

Thanks for your feedback. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.