Hi,
In our product we are enhancing the HTML and because of the nature of the report is hierarchical we need to display the data hierarchically as shown in the attached htm(Sample.htm) file. If you view this file in any of standard browsers the data is displaying hierarchically and also the print preview also is as per expected and same we expect when converted to Word/PDF using your Aspose.Words to display in the same manner. The only difference we change from regular "table " to unordered list tags as below mentioned to achieve the report hierarchically and please let us know is there any settings that can be done programmatically/upgrading to Aspose.Words version to resolve this issue. Please let us know your solution/feedback and also attached(sample.doc,sample.pdf) how the output file looks after converted using the current version(2016.06.30) of Aspose.Words.
System Requirements on client production machine for your reference,
1. Windows Server 2008/ Windows 7, 64-bit operating system.
2..NET Framework 4.6 or above.
3.Application: ASP.NET (Code behind : C#)
4. Aspose.Words.dll(File Version:16.6.0.0 Product version:2016.06.30) from Aspose.Words\net4.0.
5. Any standard browser like Chrome, IE 11 and above.
C# Sample Program for your reference,
WordTemplateBuilder objWordTemplateBuilder = WordTemplateBuilder.GetManagedObject();//Where the Aspose.Words.license is set in this object.
string filetype = "DOC";
bool isPaperOrient = true;
string paperSize = "A4";
Document objDocument = new Document("Sample.htm");
SaveFormat sf = (filetype == "DOC" ? SaveFormat.Doc : SaveFormat.Pdf);
if (!string.IsNullOrEmpty(paperSize))
{
for (int iSectCount = 0; iSectCount <= objDocument.Sections.Count - 1; iSectCount++)
{
objDocument.Sections[iSectCount].PageSetup.Orientation = isPaperOrient ? Aspose.Words.Orientation.Landscape : Aspose.Words.Orientation.Portrait;
objDocument.Sections[iSectCount].PageSetup.PaperSize = (PaperSize)Enum.Parse(typeof(PaperSize), paperSize, true);
}
}
DocSaveOptions sDOCOption = null;
PdfSaveOptions sPDFOption = null;
if (sf.Equals(SaveFormat.Doc))
{
Aspose.Words.DocumentBuilder abc = new Aspose.Words.DocumentBuilder(objDocument);
sDOCOption = new DocSaveOptions(sf);
sDOCOption.DmlEffectsRenderingMode = DmlEffectsRenderingMode.None;
sDOCOption.SaveFormat = SaveFormat.Doc;
}
else
{
sPDFOption = new PdfSaveOptions();
sPDFOption.TextCompression = PdfTextCompression.None;
sPDFOption.PreserveFormFields = true;
sPDFOption.SaveFormat = Aspose.Words.SaveFormat.Pdf;
sPDFOption.EmbedFullFonts = true;
sPDFOption.FontEmbeddingMode = PdfFontEmbeddingMode.EmbedAll;
sPDFOption.PrettyFormat = true;
sPDFOption.UseCoreFonts = true;
//sPDFOption.OutlineOptions.HeadingsOutlineLevels = 3;
}
List saveOutput = new List();
string asposeDoc = @"C:\temp\Sample.doc"
SaveOutputParameters sv = null;
if (sf.Equals(SaveFormat.Doc))
{
sv = objDocument.Save(asposeDoc, sDOCOption);
}
else
{
sv = objDocument.Save(asposeDoc, sPDFOption);
}
Response.ContentType = sv.ContentType;
Response.WriteFile(asposeDoc);
Regards,
Somashekar M