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