We have few documents (attached) which could not be opened by Aspose API and we get an exception.
<div style=“box-sizing: border-box; color: rgb(34, 34, 34); font-family: “Segoe UI”, “Helvetica Neue”, Helvetica, Arial, Verdana; font-size: 12px; background-color: rgb(255, 255, 255);”>Exception thrown: ‘System.InvalidCastException’ in Aspose.Words.dll
Additional information: Unable to cast object of type ‘Aspose.Words.Markup.StructuredDocumentTag’ to type ‘Aspose.Words.Paragraph’. (Also see attached screenshot)
{
“Depth”: 1,
“ClassName”: “System.InvalidCastException”,
“Message”: “Unable to cast object of type ‘Aspose.Words.Markup.StructuredDocumentTag’ to type ‘Aspose.Words.Paragraph’.”,
“Source”: “Aspose.Words”,
“StackTraceString”: " at Aspose.Words.Document.\u0003(Stream \u0002, LoadOptions \u0003)\r\n at Aspose.Words.Document.\u0002(Stream \u0002, LoadOptions \u0003)\r\n at Rrd.ActiveDocument.DocumentProcessing.Services.WordDocumentPreprocessor.AcceptAllRevisions(Stream openXmlStream) in C:\vNextAgents\Agent_02\_work\19\s\Backend\Core\Rrd.ActiveDocument.DocumentProcessing\Services\WordDocumentPreprocessor.cs:line 123\r\n at Rrd.ActiveDocument.DocumentProcessing.Services.WordDocumentPreprocessor.ProcessDocument(IBlobData rawData) in C:\vNextAgents\Agent_02\_work\19\s\Backend\Core\Rrd.ActiveDocument.DocumentProcessing\Services\WordDocumentPreprocessor.cs:line 85",
“RemoteStackTraceString”: null,
“RemoteStackIndex”: 0,
“ExceptionMethod”: {
“Name”: “\u0003”,
“AssemblyName”: “Aspose.Words”,
“AssemblyVersion”: “17.2.0.0”,
“AssemblyCulture”: “”,
“ClassName”: “Aspose.Words.Document”,
“Signature”: “Void \u0003(System.IO.Stream, Aspose.Words.LoadOptions)”,
“MemberType”: 8
},
“HResult”: -2147467262,
“HelpURL”: null
}
Please take a look what is wrong.