PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

header
https://forum.pdfsharp.net/viewtopic.php?f=2&t=4049
Page 1 of 1

Author:  Jessica [ Sat Nov 09, 2019 12:11 am ]
Post subject:  header

Hi

Is it possible in MigraDoc to make headers that are different on EACH page? (I don't mean even/odd pages).
I want to set a header specific for each page.

Author:  TH-Soft [ Sat Nov 09, 2019 8:15 am ]
Post subject:  Re: header

Hi!
Jessica wrote:
I want to set a header specific for each page.
There are no pages when you create a MigraDoc document.
Start a new Section - Headers and Footers are set per section.

Author:  Jessica [ Sat Nov 09, 2019 7:09 pm ]
Post subject:  Re: header

thx this works!

But now my page number in the footer doesn't work. I do this code for each section I make:

Code:
// Create a paragraph with centered page number. See definition of style "Footer".
Paragraph paragraph = new Paragraph();
paragraph.AddTab();
paragraph.AddPageField();

// Add paragraph to footer
section.Footers.Primary.Add(paragraph);


Can you tell me please how to make page number work ?
I have page numbers but each page has page number "1"

Author:  Jessica [ Sat Nov 09, 2019 7:43 pm ]
Post subject:  Re: header

So to make a summary:

- I make a new section in order to make a header specific for that section => this works!

- but because I make new sections (to have different headers), the page numbers (in the footer) don't work anymore. They start at 1 again on each new section

How can I make page numbers (in the footer) work when creating new sections in the pdf?
If I don't create new sections, they work.

Author:  Thomas Hoevel [ Mon Nov 11, 2019 8:56 am ]
Post subject:  Re: header

You specify the starting page number when you start a new section. Leave the page number empty to get consecutive page numbers. This is the default behavior, so you just have to remove the line that always sets the start to 1.

For serial letters it makes sense to always start at 1.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/