Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

PdfHeaderBuilder

OfficeIMO.Pdf

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

Header builder. Forwards to the header slots of PdfPageSetup.

Inheritance

  • object
  • PdfHeaderBuilder

Usage

Explore 27 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.

Accepted by parameters 1

Methods

public PdfHeaderBuilder Alignment(OfficeAlignment alignment) #

Sets PdfHeaderFooter.Alignment of the header text.

Parameters

alignment OfficeIMO.OfficeAlignment required
public PdfHeaderBuilder Color(OfficeColor color) #

Sets PdfHeaderFooter.Color of the header text.

Parameters

color OfficeIMO.OfficeColor required
Content 4 overloads
public PdfHeaderBuilder Content(Action<PdfContentBuilder> build, OfficeLength distanceFromEdge) #

Composes bounded header content without an additional gap from the body.

Parameters

build System.Action<OfficeIMO.Pdf.PdfContentBuilder> required
distanceFromEdge OfficeIMO.OfficeLength required
public PdfHeaderBuilder Content(Func<PdfRunningContentContext, Action<PdfContentBuilder>> build, OfficeLength distanceFromEdge) #

Composes bounded header content without an additional gap from the body.

Parameters

build System.Func<OfficeIMO.Pdf.PdfRunningContentContext, System.Action<OfficeIMO.Pdf.PdfContentBuilder>> required
distanceFromEdge OfficeIMO.OfficeLength required
public PdfHeaderBuilder Content(Action<PdfContentBuilder> build, OfficeLength distanceFromEdge, OfficeLength bodyGap) #

Replaces the default header with bounded document flow at a distance from the top page edge. Uses normal content-builder styles; content cannot create pages.

Parameters

build System.Action<OfficeIMO.Pdf.PdfContentBuilder> required
distanceFromEdge OfficeIMO.OfficeLength required
bodyGap OfficeIMO.OfficeLength required
public PdfHeaderBuilder Content(Func<PdfRunningContentContext, Action<PdfContentBuilder>> build, OfficeLength distanceFromEdge, OfficeLength bodyGap) #

Composes the default bounded header from final page information. The factory can run during pagination stabilization and must be deterministic.

Parameters

build System.Func<OfficeIMO.Pdf.PdfRunningContentContext, System.Action<OfficeIMO.Pdf.PdfContentBuilder>> required
distanceFromEdge OfficeIMO.OfficeLength required
bodyGap OfficeIMO.OfficeLength required
EvenPagesContent 4 overloads
public PdfHeaderBuilder EvenPagesContent(Action<PdfContentBuilder> build, OfficeLength distanceFromEdge) #

Composes bounded header content without an additional gap from the body.

Parameters

build System.Action<OfficeIMO.Pdf.PdfContentBuilder> required
distanceFromEdge OfficeIMO.OfficeLength required
public PdfHeaderBuilder EvenPagesContent(Func<PdfRunningContentContext, Action<PdfContentBuilder>> build, OfficeLength distanceFromEdge) #

Composes bounded header content without an additional gap from the body.

Parameters

build System.Func<OfficeIMO.Pdf.PdfRunningContentContext, System.Action<OfficeIMO.Pdf.PdfContentBuilder>> required
distanceFromEdge OfficeIMO.OfficeLength required
public PdfHeaderBuilder EvenPagesContent(Action<PdfContentBuilder> build, OfficeLength distanceFromEdge, OfficeLength bodyGap) #

Replaces even-page headers with bounded flow measured from the top page edge.

Parameters

build System.Action<OfficeIMO.Pdf.PdfContentBuilder> required
distanceFromEdge OfficeIMO.OfficeLength required
bodyGap OfficeIMO.OfficeLength required
public PdfHeaderBuilder EvenPagesContent(Func<PdfRunningContentContext, Action<PdfContentBuilder>> build, OfficeLength distanceFromEdge, OfficeLength bodyGap) #

Composes bounded even-page header flow from final page information.

Parameters

build System.Func<OfficeIMO.Pdf.PdfRunningContentContext, System.Action<OfficeIMO.Pdf.PdfContentBuilder>> required
distanceFromEdge OfficeIMO.OfficeLength required
bodyGap OfficeIMO.OfficeLength required
EvenPagesImage 3 overloads
public PdfHeaderBuilder EvenPagesImage(PdfHeaderFooterImage image) #

Adds an image with its reusable style to the even-page-only header.

Parameters

image OfficeIMO.Pdf.PdfHeaderFooterImage required
public PdfHeaderBuilder EvenPagesImage(byte[] data, OfficeLength width, OfficeLength height, string? alternativeText) #

Adds a meaningful image to the even-page-only header with alternate text.

Parameters

data byte[] required
width OfficeIMO.OfficeLength required
height OfficeIMO.OfficeLength required
alternativeText string? required
public PdfHeaderBuilder EvenPagesImage(byte[] data, OfficeLength width, OfficeLength height, OfficeAlignment align = Left, OfficeImageFit fit = Stretch, string? alternativeText = null) #

Adds an image to the even-page-only header.

Parameters

data byte[] required
width OfficeIMO.OfficeLength required
height OfficeIMO.OfficeLength required
align OfficeIMO.OfficeAlignment = Left optional
fit OfficeIMO.Drawing.OfficeImageFit = Stretch optional
alternativeText string? = null optional
public PdfHeaderBuilder EvenPagesShape(OfficeShape shape, OfficeAlignment align = Left) #

Adds a shape to the even-page-only header.

Parameters

shape OfficeIMO.Drawing.OfficeShape required
align OfficeIMO.OfficeAlignment = Left optional
public PdfHeaderBuilder EvenPagesStyledZones(Action<PdfHeaderTextBuilder>? left, Action<PdfHeaderTextBuilder>? center, Action<PdfHeaderTextBuilder>? right) #

Renders independently styled even-page-only header zones.

Parameters

left System.Action<OfficeIMO.Pdf.PdfHeaderTextBuilder>? required
center System.Action<OfficeIMO.Pdf.PdfHeaderTextBuilder>? required
right System.Action<OfficeIMO.Pdf.PdfHeaderTextBuilder>? required
EvenPagesText 2 overloads
public PdfHeaderBuilder EvenPagesText(string format) #

Renders an even-page-only header text format. Supports {page} and {pages}.

Parameters

format string required
public PdfHeaderBuilder EvenPagesText(Action<PdfHeaderTextBuilder> build) #

Builds an even-page-only header from text and page tokens.

Parameters

build System.Action<OfficeIMO.Pdf.PdfHeaderTextBuilder> required
Delegate to compose even-page header segments.
public PdfHeaderBuilder EvenPagesZones(string? left, string? center, string? right) #

Renders even-page-only left, center, and right header zones. Supports {page} and {pages}.

Parameters

left string? required
center string? required
right string? required
FirstPageContent 4 overloads
public PdfHeaderBuilder FirstPageContent(Action<PdfContentBuilder> build, OfficeLength distanceFromEdge) #

Composes bounded header content without an additional gap from the body.

Parameters

build System.Action<OfficeIMO.Pdf.PdfContentBuilder> required
distanceFromEdge OfficeIMO.OfficeLength required
public PdfHeaderBuilder FirstPageContent(Func<PdfRunningContentContext, Action<PdfContentBuilder>> build, OfficeLength distanceFromEdge) #

Composes bounded header content without an additional gap from the body.

Parameters

build System.Func<OfficeIMO.Pdf.PdfRunningContentContext, System.Action<OfficeIMO.Pdf.PdfContentBuilder>> required
distanceFromEdge OfficeIMO.OfficeLength required
public PdfHeaderBuilder FirstPageContent(Action<PdfContentBuilder> build, OfficeLength distanceFromEdge, OfficeLength bodyGap) #

Replaces the first-page header with bounded flow measured from the top page edge.

Parameters

build System.Action<OfficeIMO.Pdf.PdfContentBuilder> required
distanceFromEdge OfficeIMO.OfficeLength required
bodyGap OfficeIMO.OfficeLength required
public PdfHeaderBuilder FirstPageContent(Func<PdfRunningContentContext, Action<PdfContentBuilder>> build, OfficeLength distanceFromEdge, OfficeLength bodyGap) #

Composes bounded first-page header flow from final page information.

Parameters

build System.Func<OfficeIMO.Pdf.PdfRunningContentContext, System.Action<OfficeIMO.Pdf.PdfContentBuilder>> required
distanceFromEdge OfficeIMO.OfficeLength required
bodyGap OfficeIMO.OfficeLength required
FirstPageImage 3 overloads
public PdfHeaderBuilder FirstPageImage(PdfHeaderFooterImage image) #

Adds an image with its reusable style to the page-1-only header.

Parameters

image OfficeIMO.Pdf.PdfHeaderFooterImage required
public PdfHeaderBuilder FirstPageImage(byte[] data, OfficeLength width, OfficeLength height, string? alternativeText) #

Adds a meaningful image to the page-1-only header with alternate text.

Parameters

data byte[] required
width OfficeIMO.OfficeLength required
height OfficeIMO.OfficeLength required
alternativeText string? required
public PdfHeaderBuilder FirstPageImage(byte[] data, OfficeLength width, OfficeLength height, OfficeAlignment align = Left, OfficeImageFit fit = Stretch, string? alternativeText = null) #

Adds an image to the page-1-only header.

Parameters

data byte[] required
width OfficeIMO.OfficeLength required
height OfficeIMO.OfficeLength required
align OfficeIMO.OfficeAlignment = Left optional
fit OfficeIMO.Drawing.OfficeImageFit = Stretch optional
alternativeText string? = null optional
public PdfHeaderBuilder FirstPageShape(OfficeShape shape, OfficeAlignment align = Left) #

Adds a shape to the page-1-only header.

Parameters

shape OfficeIMO.Drawing.OfficeShape required
align OfficeIMO.OfficeAlignment = Left optional
public PdfHeaderBuilder FirstPageStyledZones(Action<PdfHeaderTextBuilder>? left, Action<PdfHeaderTextBuilder>? center, Action<PdfHeaderTextBuilder>? right) #

Renders independently styled page-1-only header zones.

Parameters

left System.Action<OfficeIMO.Pdf.PdfHeaderTextBuilder>? required
center System.Action<OfficeIMO.Pdf.PdfHeaderTextBuilder>? required
right System.Action<OfficeIMO.Pdf.PdfHeaderTextBuilder>? required
FirstPageText 2 overloads
public PdfHeaderBuilder FirstPageText(string format) #

Renders a page-1-only header text format. Supports {page} and {pages}.

Parameters

format string required
public PdfHeaderBuilder FirstPageText(Action<PdfHeaderTextBuilder> build) #

Builds a page-1-only header from text and page tokens.

Parameters

build System.Action<OfficeIMO.Pdf.PdfHeaderTextBuilder> required
Delegate to compose first-page header segments.
public PdfHeaderBuilder FirstPageZones(string? left, string? center, string? right) #

Renders page-1-only left, center, and right header zones. Supports {page} and {pages}.

Parameters

left string? required
center string? required
right string? required
public PdfHeaderBuilder FontFamily(string familyName) #

Sets PdfHeaderFooter.FontFamily to a registered named font family.

Parameters

familyName string required
public PdfHeaderBuilder FontSize(OfficeLength size) #

Sets PdfHeaderFooter.FontSize.

Parameters

size OfficeIMO.OfficeLength required
Image 3 overloads
public PdfHeaderBuilder Image(PdfHeaderFooterImage image) #

Adds an image to the running header.

Parameters

image OfficeIMO.Pdf.PdfHeaderFooterImage required
public PdfHeaderBuilder Image(byte[] data, OfficeLength width, OfficeLength height, string? alternativeText) #

Adds a meaningful image to the running header with alternate text.

Parameters

data byte[] required
width OfficeIMO.OfficeLength required
height OfficeIMO.OfficeLength required
alternativeText string? required
public PdfHeaderBuilder Image(byte[] data, OfficeLength width, OfficeLength height, OfficeAlignment align = Left, OfficeImageFit fit = Stretch, string? alternativeText = null) #

Adds an image to the running header.

Parameters

data byte[] required
width OfficeIMO.OfficeLength required
height OfficeIMO.OfficeLength required
align OfficeIMO.OfficeAlignment = Left optional
fit OfficeIMO.Drawing.OfficeImageFit = Stretch optional
alternativeText string? = null optional
public PdfHeaderBuilder Offset(OfficeLength offset) #

Sets PdfHeaderFooter.Offset, the baseline distance above the top margin.

Parameters

offset OfficeIMO.OfficeLength required
public PdfHeaderBuilder PageNumber() #

Renders the current page number in the header.

public PdfHeaderBuilder PageNumberWithTotal() #

Renders the current page number and total pages in the header.

public PdfHeaderBuilder Shape(OfficeShape shape, OfficeAlignment align = Left) #

Adds a shape to the running header.

Parameters

shape OfficeIMO.Drawing.OfficeShape required
align OfficeIMO.OfficeAlignment = Left optional
public PdfHeaderBuilder StandardFont(PdfStandardFont font) #

Sets PdfHeaderFooter.StandardFont and clears PdfHeaderFooter.FontFamily.

Parameters

font OfficeIMO.Pdf.PdfStandardFont required
public PdfHeaderBuilder StyledZones(Action<PdfHeaderTextBuilder>? left, Action<PdfHeaderTextBuilder>? center, Action<PdfHeaderTextBuilder>? right) #

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

Parameters

left System.Action<OfficeIMO.Pdf.PdfHeaderTextBuilder>? required
center System.Action<OfficeIMO.Pdf.PdfHeaderTextBuilder>? required
right System.Action<OfficeIMO.Pdf.PdfHeaderTextBuilder>? required
Text 2 overloads
public PdfHeaderBuilder Text(string format) #

Renders a literal header text format. Supports {page} and {pages}.

Parameters

format string required
public PdfHeaderBuilder Text(Action<PdfHeaderTextBuilder> build) #

Builds a custom header from text and page tokens.

Parameters

build System.Action<OfficeIMO.Pdf.PdfHeaderTextBuilder> required
Delegate to compose header segments.
public PdfHeaderBuilder Zones(string? left, string? center, string? right) #

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

Parameters

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