The attached RTF file (originally generated via OCR) has been stripped down to isolate the problem, which is the negative value for the \pnstart tag. I believe the correct thing to do is ignore \pnstart when cases it has a negative value. Word processing apps (including Word and WordPad) open this file without reporting an error. WordPad has the unexpected behavior of interpreting “-1” as 65535.
Here’s the exception that occurs when loading this RTF with Aspose.Words .NET 8.0.0.0:
Aspose.Words.FileCorruptedException was caught
Message="The document appears to be corrupted and cannot be loaded."
Source="Aspose.Words"
StackTrace:
at Aspose.Words.Document.ԁ(Stream Ӿ, LoadFormat ӿ, String Ԁ)
at Aspose.Words.Document.ӽ(Stream Ӿ, LoadFormat ӿ, String Ԁ)
at Aspose.Words.Document... ctor(Stream stream, String baseUri, LoadFormat loadFormat, String password)
at DocumentConversion.DocumentConverter.ConverterThread2.DoConversion()
InnerException: System.ArgumentOutOfRangeException
Message = "Specified argument was out of the range of valid values.\r\nParameter name: value"
Source = "Aspose.Words"
ParamName="value"
StackTrace:
at Aspose.Words.Lists.ListLevel.set_StartAt(Int32 value)
at ⮻.⸅.⯇(ⲓ ⯈)
at ⮻.⮺.⯇(ⲓ ⯈)
at ⮻.⮺.࠽()
at Aspose.Words.Document.ԁ(Stream Ӿ, LoadFormat ӿ, String Ԁ)