I need some help to manage content in the footer (footer content spacing)

Hi, I have to create a document which has several sections and each section must have

  • the “section name” in the header
  • the overall document page numbering in the footer

I created a new Section for each section, setting the section name in the section header, and I have no issues in the header

but I don’t know how to space the footer content from the footer top margin, so that it is somewhat separated from the above page content

this is what I managed to obtain now and what I’d like to achieve

Can someone point me in the right direction, please? Thanks!

Hi,

So let’s say this is your footer content:

var headersFooters = section.HeadersFooters;
var footer = new HeaderFooter(document, HeaderFooterType.FooterDefault);
var paragraph = new Paragraph(document);
var field = new Field(document, FieldType.Page);

headersFooters.Add(footer);
footer.Blocks.Add(paragraph);
paragraph.Inlines.Add(field);

One way how you could increase that spacing is to set the space before on that Paragraph:

paragraph.ParagraphFormat.SpaceBefore = 48;

Another way would be to increase the bottom margin on that Section:

section.PageSetup.PageMargins.Bottom = 90;

I hope this helps.

Regards,
Mario