Aspose Words Unknown File Format

Hi There,

Using latest version of Aspose.Word( 14.12.0.0) library throwing exception “Aspose.Words.UnsupportedFileFormatException”. I collect exception detail like:
Exception Type:
Aspose.Words.UnsupportedFileFormatException
<span style=“font-size:12.0pt;font-family:“Times New Roman”,“serif”;
mso-fareast-font-family:“Times New Roman”;mso-ansi-language:EN-NZ;mso-fareast-language:
EN-NZ;mso-bidi-language:AR-SA”>Stack Trace : at Aspose.Words.Document.(Stream ,
LoadOptions ) at Aspose.Words.Document.(Stream , LoadOptions ) at UserDocument.methodname

I notice it happening to only .doc extension file not .docx file.

I am reading .doc as stream and converting to .pdf format for viewer.
here is my code

public Document LoadDocument()
{
try{
using (var docStream = new MemoryStream(filecontent))
{
var document = new Document(docStream);
if (document != null)
{
foreach (Section section in document.Sections)
section.PageSetup.Borders.ClearFormatting();
return document;
}
}
}
catch(Exception e){}
}
public void TestPDFConversion()
{
MemoryStream tempStream = new MemoryStream();

Document document = LoadDocument();
if (document != null)
{
PdfSaveOptions saveOptions = new PdfSaveOptions();
try
{
document.Save(tempStream, saveOptions);
}
catch(Exception){}
}
}

Hi Kulwinder,

Thanks for your inquiry. I have tested the scenario using latest version of Aspose.Words for .NET 15.1.0 and have not found the shared issue. Please use Aspose.Words for .NET 15.1.0. I have attached the output Pdf with this post for your kind reference.