Page Number in Footer with Proper Position from html to doc conversion

I am using a Html like


header…
body
footer below code
I want to put page no here


for conversion from html to doc I am using

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
PageSetup ps = builder.PageSetup;

builder.MoveToHeaderFooter(HeaderFooterType.FooterPrimary);
builder.InsertHtml(htmlString);

and for page numbering using…

var section = (Section)doc.FirstSection.Clone(false);
double tabPos = section.PageSetup.PageWidth - section.PageSetup.RightMargin - section.PageSetup.LeftMargin;
builder.CurrentParagraph.ParagraphFormat.TabStops.Add(new TabStop(tabPos, TabAlignment.Right, TabLeader.None));

// Move to the right hand side of the page and insert the page and page total.
builder.Write(ControlChar.Tab);
builder.InsertField(“PAGE”);
builder.Write(" of ");
builder.InsertField(“NUMPAGES”);


page no is generated but it insert one extra tr in footer I want to put in above said html tr position .Please suggest how do I implement it.


Regards,
Goutam Roy
Cognizant Tecnology Solutions
Mob:+91-9836765816

Hi Goutamax,

Thanks for your inquiry. We have tested the scenario and have noticed that there is no extra table's row in footer of document. Could you please share your input html and expected output Word document here for our reference?

Please manually create your expected Word document using Microsoft Word. We will investigate how you want your final Word output be generated like. We will then provide you more information on this along with code.