Hi Ali,
Thanks for Quick response could you please help me unit test case for the below
public class WordConverter : IFileConverter
{
MemoryStream outStream;
MemoryStream licenseStream;
public WordConverter()
{
String path = HttpContext.Current.Server.MapPath("~/App_Code1file/Asposefiles/Aspose.Total.lic");
if (File.Exists(path))
{
this.licenseStream = new MemoryStream(File.ReadAllBytes(path));
}
}
public WordConverter(MemoryStream license)
{
this.licenseStream = license;
}
public string Convert(byte[] content)
{
MemoryStream inStream = new MemoryStream(content);
outStream = new MemoryStream();
License licence = new License();
if (this.licenseStream != null)
{
licence.SetLicense(this.licenseStream);
}
Document doc = new Document(inStream);
HtmlSaveOptions options = new HtmlSaveOptions(SaveFormat.Html);
options.ExportImagesAsBase64 = true;
options.ImageSavingCallback = new HandleImageSaving();
NodeCollection nodes = doc.GetChildNodes(Aspose.Words.NodeType.Paragraph, true);
foreach (Paragraph node in nodes)
{
node.ParagraphFormat.SpaceAfterAuto = false;
node.ParagraphFormat.SpaceAfter = 0;
}
doc.Save(outStream, options);
StreamReader reader = new StreamReader(outStream);
string html = System.Text.Encoding.UTF8.GetString(outStream.ToArray());
return html;
}
}