I am getting error in page numbering
we have a word template document, we are replacing ‘Keys’ (which are in template) with ‘values’
in some cases we re repeating Sections, Paragraphs based on condition.
after generating document the page numbers should not be repeat in proper way.
please help to solve this issue.
i am using the following code to append section, append repeating paragraph in section.
Section tempSection = ParaRepeat(Inputdoc, section);
//here we are appending section in a word docuement
private Section ParaRepeat(Document Inputdoc, Section section)
{
NodeCollection paragraphs = section.GetChildNodes(NodeType.Paragraph, true);
if (paragraphs.Count > 0)
{
var paraKeys = KyesSet.GetKeyValues(“RepeatedParaKey”);
for (int i = 0; i < paragraphs.Count; i++)
{
string paraText = paragraphs[i].Range.Text;
if (paraText.Contains("[Signatuer]")
{
Paragraph para = (Paragraph)paragraphs[i].Clone(true);
para.Range.Replace(new Regex(“Signature”), “Value”);//, false, true);
((Paragraph)paragraphs[i]).ParentNode.InsertAfter(para, paragraphs[i]);
((Paragraph)paragraphs[i]).Remove();
((Paragraph)paragraphs[i]).ParentNode.InsertAfter(para, paragraphs[i]);
((Paragraph)paragraphs[i]).Remove();
}
}
}
Section sec = section.Clone();
return sec;
}