We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

HeaderFooterType.FooterEven

It seems that FooterEven doesn’t point to any pages (not odd or even) while FooterPrimary points to every page.

Using the following code with FooterEven, it doesn’t print anything on the even pages, let alone any of the pages:

builder.MoveToHeaderFooter(HeaderFooterType.FooterEven);
HeaderFooter footer;
footer = section.HeadersFooters[HeaderFooterType.FooterEven];
if (footer != null)
{
builder.Write("Page ");
builder.InsertField(“PAGE”, “”);
}

prints absolutely nothing.


However, if I use this code (using HeaderFooterType.FooterPrimary), it prints on every page (both odd and even).

builder.MoveToHeaderFooter(HeaderFooterType.FooterPrimary);

HeaderFooter footer;

footer = section.HeadersFooters[HeaderFooterType.FooterPrimary];

if (footer != null)

{

builder.Write("Page ");

builder.InsertField(“PAGE”, “”);

}

I actually want one thing written on odd pages and a totally separate thing written on even pages. It seems as if I only have an option to print on every page (primary) or on no pages at all (even).




Hi there,


Thanks for your inquiry.

You first need to set the OddAndEventPagesHeaderFooter property to true before the even header and footer will take effect. When this property is true the FooterEven will be displayed for all even pages and FooterPrimary is displayed for all odd pages.

Please see the following API reference along with the code sample for details: http://www.aspose.com/documentation/.net-components/aspose.words-for-.net/aspose.words.pagesetup.oddandevenpagesheaderfooter.html

Thanks,

Okay thanks so much.