PdfHeaderFooter
OfficeIMO.Pdf
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.
Returned or exposed by 6
- Property PdfPageSetup.EvenPageFooter
- Property PdfPageSetup.EvenPageHeader
- Property PdfPageSetup.FirstPageFooter
- Property PdfPageSetup.FirstPageHeader
- Property PdfPageSetup.Footer
- Property PdfPageSetup.Header
Methods
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
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?
- center string?
- right string?
Inherited Methods
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.