Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

PdfHeaderFooter

OfficeIMO.Pdf

Namespace
OfficeIMO.Pdf
Assembly
OfficeIMO.Pdf
Source revision
e163ccb36643 with working tree changes
Modifiers
sealed

One running header or footer slot of a PdfPageSetup: its text format, styled segments, three-zone text, images and shapes, plus the text style shared by every header (or every footer) variant.

Inheritance

  • object
  • PdfHeaderFooter

Remarks

PdfHeaderFooter.StandardFont, PdfHeaderFooter.FontFamily, PdfHeaderFooter.FontSize, PdfHeaderFooter.Color, PdfHeaderFooter.Alignment and PdfHeaderFooter.Offset belong to the header (or footer) as a whole: the first-page and even-page variants read and write the same values as the running header (or footer).

Usage

Explore 6 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Methods

public void AddImage(PdfHeaderFooterImage image) #

Adds an image to this slot.

Parameters

image OfficeIMO.Pdf.PdfHeaderFooterImage required
public void AddShape(PdfHeaderFooterShape shape) #

Adds a shape to this slot.

Parameters

shape OfficeIMO.Pdf.PdfHeaderFooterShape required
public void SetStyledZones(IEnumerable<PdfFooterSegment>? left, IEnumerable<PdfFooterSegment>? center, IEnumerable<PdfFooterSegment>? right) #

Renders independently styled left, center and right zones on one line.

Parameters

left System.Collections.Generic.IEnumerable<OfficeIMO.Pdf.PdfFooterSegment>? required
center System.Collections.Generic.IEnumerable<OfficeIMO.Pdf.PdfFooterSegment>? required
right System.Collections.Generic.IEnumerable<OfficeIMO.Pdf.PdfFooterSegment>? required
SetText 2 overloads
public void SetText(string format) #

Renders format in this slot, replacing segments and zones. Shows the running slot, or turns on the matching PdfPageSetup variant flag for a first-page or even-page slot.

Parameters

format string required
public void SetText(IEnumerable<PdfFooterSegment> segments) #

Renders styled segments in this slot, replacing its format text and zones.

Parameters

segments System.Collections.Generic.IEnumerable<OfficeIMO.Pdf.PdfFooterSegment> required
public void SetZones(string? left, string? center, string? right) #

Renders left, center and right text zones on one line. Supports {page} and {pages}.

Parameters

left string? required
center string? required
right string? required

Properties

public bool Show { get; set; } #

When true, renders PdfHeaderFooter.Format. The running header and footer start hidden; the first-page and even-page variants start shown and render whenever their format is not empty.

public string Format { get; set; } #

Text format with {page} and {pages} tokens. The running footer defaults to "Page {page} of {pages}"; other slots default to empty.

public IReadOnlyList<PdfFooterSegment>? Segments { get; set; } #

Styled text and page-token segments. When set, they replace PdfHeaderFooter.Format.

public PdfStandardFont StandardFont { get; set; } #

Header or footer standard font.

public string? FontFamily { get; set; } #

Optional registered named font family. When null, PdfHeaderFooter.StandardFont is used.

public OfficeLength FontSize { get; set; } #

Font size. Headers default to 9 points; footers follow the theme footer size.

public OfficeColor? Color { get; set; } #

Text color. When null, headers keep the current PDF fill color and footers follow the theme footer color.

public OfficeAlignment Alignment { get; set; } #

Horizontal alignment: left, center (default) or right.

public OfficeLength Offset { get; set; } #

Baseline distance from the margin: above the top margin for headers, below the bottom margin for footers. Default 18 points.