How to start page numbers with 1 in different sections

DocumentBuilder version: 7.4.0
OS:Linux
I want to generate word through builder API, generate multiple sections at the same time and insert page number in the footer, but the default inserted page number is continuous, I found a method that can be set from 1 on the page, but not found in builder API. Can the builder API achieve the same effect?

      var oDocument = Api.GetDocument();
      var oParagraph = oDocument.GetElement(0);
      oParagraph.AddText("This is a new paragraph.");
      oParagraph.AddLineBreak();
      oParagraph.AddText("Scroll down to see the new section.");
      oParagraph.AddPageNumber();
      var oSection = oDocument.CreateSection(oParagraph);
      oSection.SetType("nextPage");
      oParagraph.AddText("This is a paragraph in a new section");
      oParagraph.AddPageNumber();
      oDocument.Push(oParagraph);
      var oParagraph1 = Api.CreateParagraph();
      oParagraph1.AddText("This is a paragraph in a new section");
      oParagraph1.AddPageNumber();
      var oSection1 = oDocument.CreateSection(oParagraph);
      oSection1.SetType("nextPage");
      oDocument.Push(oParagraph1);

Hello @GGbeng1

We are checking the situation. I will provide a feedback as soon as we get any results.

Thanks for the reply. Reading through the source code I found a Set_PageNum_Start method on the Sections class that temporarily solved the problem, but created a new problem.
I want to insert (page number/total pages in the current Section) in the footer of the section
I can’t find a way to get the page number of the current section.
Do you know how to get it? Thank you very much

Please provide a link to this information for the reference.


I’d kindly ask you to create a separate thread for this question as it is not quite related to the original topic about the way to start page numbering for specific section. Thank you for understanding.

I wanted to let you know that we have registered suggestion to add new methods to set page number to custom page and to get index of the page on which numbering starts.