Hi Tahir,
3 input file
- Input_Header
- Input_Body
- Input_Footer
Input_Header and Input_Footer are static but in Input_Body text
the number of table can be increase or decrease dynamically
headerHtml = content of Input_Header
bodyHtmlString = content of Input_Body
footerHtmlString= content of Input_Footer
The output should be in document file as Output.doc which I already generated except table not break properly .
using code like
public MemoryStream ConvertHtmlToDoc(string headerHtml, string bodyHtmlString, string footerHtmlString)
{
MemoryStream wordStream;
License license = new License();
string reportFile = string.Concat("Aspose.Total.lic");
license.SetLicense(reportFile);
DocumentBuilder builder = new DocumentBuilder();
PageSetup ps = builder.PageSetup;
ps.PageWidth = 800;
ps.RestartPageNumbering = true;
builder.MoveToHeaderFooter(HeaderFooterType.HeaderPrimary);
builder.InsertHtml(headerHtml);
builder.MoveToHeaderFooter(HeaderFooterType.FooterPrimary);
builder.InsertHtml(footerHtmlString);
// Add fields for current page number
builder.InsertField("PAGE", "");
// Add any custom text
builder.Write(" / ");
// Add field for total page numbers in document
builder.InsertField("NUMPAGES", "");
// Move back to the main story of the first section.
builder.MoveToDocumentStart();
builder.InsertHtml(bodyHtmlString);
wordStream = new MemoryStream();
builder.Document.Save(wordStream, SaveFormat.Doc);
return wordStream;
}
Please suggest not break table in two pages. and page number will align in same row in “Office Lease Transactions” word as in footer in output doc .
[Note: I am attaching Output.pdf which is generated properly using three input html text. I want to generate output.doc should be like Output.pdf]
Thanks in advance.you can also run three input text file as in html view.
Regards,
Goutam
Cognizant Technology Solutions