PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Jul 18, 2024 10:36 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Page Numbering
PostPosted: Wed May 26, 2010 10:07 am 
Offline

Joined: Wed May 26, 2010 9:14 am
Posts: 13
Hi,

I'm a newbie to MigraDoc. How do you keep the page numbers sequential from one section to the next. I'm getting them restarting to 1 for each section.

thanks

Dave


Top
 Profile  
Reply with quote  
 Post subject: Re: Page Numbering
PostPosted: Wed May 26, 2010 11:02 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3101
Location: Cologne, Germany
DaveR wrote:
How do you keep the page numbers sequential from one section to the next.

That's the default behaviour if you do nothing.
If you set the starting page number of a new section to 1, it will start at 1 again.

Don't use code like this:
Code:
section.PageSetup.StartingNumber = 1;

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
 Post subject: Re: Page Numbering
PostPosted: Wed May 26, 2010 11:04 am 
Offline

Joined: Wed May 26, 2010 9:14 am
Posts: 13
I only set the starting page number to 1 for the first section. I don't set it for following sections but they still start again at 1.


Top
 Profile  
Reply with quote  
 Post subject: Re: Page Numbering
PostPosted: Wed May 26, 2010 11:12 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3101
Location: Cologne, Germany
In our application we never set the starting page - and it works as intended.

Why set the starting page to 1 if that's the default?

Do all your sections share the same PageSetup? Maybe that's the problem.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
 Post subject: Re: Page Numbering
PostPosted: Wed May 26, 2010 11:18 am 
Offline

Joined: Wed May 26, 2010 9:14 am
Posts: 13
I don't want page numbering for the cover or the table of contents so I set startpage=1 for the next section i.e. the first actual page of content but the 3rd pysical page. I then use new sections after that because I want to have different headings for each section.


Top
 Profile  
Reply with quote  
 Post subject: Re: Page Numbering
PostPosted: Wed May 26, 2010 11:34 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3101
Location: Cologne, Germany
Use the PageSetup with "StartingNumber = 1" only for the section that shall have page number 1.
Use another PageSetup that doesn't set StartingNumber for the following section(s).

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
 Post subject: Re: Page Numbering
PostPosted: Wed May 26, 2010 11:47 am 
Offline

Joined: Wed May 26, 2010 9:14 am
Posts: 13
That fixed it.

Many thanks for your help.

Dave


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 46 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group