Articles in this section
Category / Section

How to preserve different headers in even/odd pages?

1 min read

You can add different headers in odd and even pages by using the BeginPageLayoutEventHandler. You can apply headers alternatively in the pages by using EvenTop and OddTop templates. Refer to the following code.


//Raise begin page event to draw the graphic elements for each page.
element.BeginPageLayout += new BeginPageLayoutEventHandler(BeginPageLayout);
//Add the different  headers in  even and odd pages.
private void BeginPageLayout(object sender, BeginPageLayoutEventArgs e)
if (index % 2 == 0)
e.Page.Section.Template.EvenTop = AddHeader(document, true);
e.Page.Section.Template.OddTop = AddHeader(document, false);

Sample Link:

Did you find this information helpful?
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment