Resetting Page Numbering

Resetting Page Numbering

Forum member · Dec 15, 2006
I am creating a dynamic PDF report by adding pages sometimes hiding the page numbers (such as the title page), but when I create several reports into one PDF the page numbers are sequential. How do I restart the page numbering? I had a wild guess by using: ' Ensures template set to nothing MyDocument.Sections.Begin.Template = Nothing MyDocument.Sections.Begin.StartingPageNumber = 0

Re: Resetting Page Numbering

Support · Dec 15, 2006
Hello, There is no direct method to reset the page numbering label. However, you can use Sections and control the resetting of the page number. Each section can begin with any desired page number. Following is the link to the Help Documentation on our web site that talks about Document Sectioning . So in your case, every time you want to reset the page number, end the section and start with a new section. Thanks, ceTe Software Support Team

Re: Resetting Page Numbering

Forum member · Dec 15, 2006
Thanks for your feedback! How do I end a section as the page you posted doens't specifically end a section? Thanks

Re: Resetting Page Numbering

Support · Dec 15, 2006
Hello, I am sorry but there is no way to end a section. You will always have to start a new section when you want to reset the page number without ending the prior section. Thanks, ceTe Software Support Team

Re: Resetting Page Numbering

Forum member · Dec 15, 2006
Okay I understand. However, I do start a new section and page numbering isnt started from page 1 again. This is the routine that gets called when I wish to create a new section/report: Private Sub SetPageFormat(ByVal MyDocument As Document, ByVal PageLayout As String) ' Ensures template set to nothing MyDocument.Sections.Begin.Template = Nothing If UCase(PageLayout) = "PORTRAIT" Then MyPageDimensions = New PageDimensions(PageSize.Letter, PageOrientation.Portrait, Margin) PageWidth = 540 PageHeight = 720 Else MyPageDimensions = New PageDimensions(PageSize.Letter, PageOrientation.Landscape, Margin) PageWidth = 720 PageHeight = 540 End If 'Bottom Y coordinate for the body of the report BodyBottom = MyPageDimensions.Height - (Margin * 2) - FooterHeight End Sub

Re: Resetting Page Numbering

Support · Dec 15, 2006
Hello, Below is the sample code that would reset the page numbering for every section of the document: Dim MyDocument As Document = New Document() // Begin the first section MyDocument.Sections.Begin( NumberingStyle.Numeric ) ' Add two pages MyDocument.Pages.Add( new Page() ) 'Page 1 MyDocument.Pages.Add( new Page() ) 'Page 2 ' Begin the second section MyDocument.Sections.Begin( NumberingStyle.Numeric ) ' Add three pages MyDocument.Pages.Add( new Page() ) 'Page 3 MyDocument.Pages.Add( new Page() ) 'page 4 MyDocument.Pages.Add( new Page() ) 'page 5 ' Begin the third section MyDocument.Sections.Begin( NumberingStyle.Numeric ) ' Add two pages MyDocument.Pages.Add( new Page() ) 'page 6 MyDocument.Pages.Add( new Page() ) 'page 7 MyDocument.DrawToWeb( "MyDocument.pdf" ) Thanks, ceTe Software Support Team

Re: Resetting Page Numbering

Forum member · Jul 12, 2007
I tried this code and didnt get any page numbers!

Re: Resetting Page Numbering

Support · Jul 12, 2007
Hello, The reason you do not see any page numbers is because in the code above no page numbers are getting added. The sample is only code snippet and not full working code. Following is the link to the Help Documentation on our web site that shows full example for adding Page Numbering Label using Document Sectioning . Thanks, ceTe Software Support Team