Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

PdfPageBuilder

OfficeIMO.Pdf

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

Page-level configuration (size, margins, default styles) and content/footers.

Inheritance

  • object
  • PdfPageBuilder

Usage

Explore 60 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 58

Accepted by parameters 2

Methods

public PdfPageBuilder Background(OfficeColor? color) #

Sets or clears the page background color.

Parameters

color OfficeIMO.OfficeColor? required
public PdfPageBuilder BackgroundBottomBand(OfficeLength height, OfficeColor? fill = null, OfficeLength insetX = default, OfficeLength offsetY = default, OfficeLength cornerRadius = default, OfficeColor? stroke = null, OfficeLength strokeWidth = default, double? fillOpacity = null, double? strokeOpacity = null, OfficeLinearGradient? fillGradient = null) #

Adds a page-scoped bottom background band using the current page size.

Parameters

height OfficeIMO.OfficeLength required
fill OfficeIMO.OfficeColor? = null optional
insetX OfficeIMO.OfficeLength = default optional
offsetY OfficeIMO.OfficeLength = default optional
cornerRadius OfficeIMO.OfficeLength = default optional
stroke OfficeIMO.OfficeColor? = null optional
strokeWidth OfficeIMO.OfficeLength = default optional
fillOpacity double? = null optional
strokeOpacity double? = null optional
fillGradient OfficeIMO.Drawing.OfficeLinearGradient? = null optional
public PdfPageBuilder BackgroundEllipse(OfficeLength x, OfficeLength y, OfficeLength width, OfficeLength height, OfficeColor? fill = null, OfficeColor? stroke = null, OfficeLength strokeWidth = default, double? fillOpacity = null, double? strokeOpacity = null, OfficeLinearGradient? fillGradient = null) #

Adds a page-scoped ellipse background shape.

Parameters

x OfficeIMO.OfficeLength required
y OfficeIMO.OfficeLength required
width OfficeIMO.OfficeLength required
height OfficeIMO.OfficeLength required
fill OfficeIMO.OfficeColor? = null optional
stroke OfficeIMO.OfficeColor? = null optional
strokeWidth OfficeIMO.OfficeLength = default optional
fillOpacity double? = null optional
strokeOpacity double? = null optional
fillGradient OfficeIMO.Drawing.OfficeLinearGradient? = null optional
BackgroundImage 2 overloads
public PdfPageBuilder BackgroundImage(PdfPageBackgroundImage? image) #

Sets or clears the page-scoped background image.

Parameters

image OfficeIMO.Pdf.PdfPageBackgroundImage? required
public PdfPageBuilder BackgroundImage(byte[] imageBytes, OfficeImageFit fit = Cover, double? opacity = null) #

Sets a page-scoped background image.

Parameters

imageBytes byte[] required
fit OfficeIMO.Drawing.OfficeImageFit = Cover optional
opacity double? = null optional
public PdfPageBuilder BackgroundLeftBand(OfficeLength width, OfficeColor? fill = null, OfficeLength insetY = default, OfficeLength offsetX = default, OfficeLength cornerRadius = default, OfficeColor? stroke = null, OfficeLength strokeWidth = default, double? fillOpacity = null, double? strokeOpacity = null, OfficeLinearGradient? fillGradient = null) #

Adds a page-scoped left background band using the current page size.

Parameters

width OfficeIMO.OfficeLength required
fill OfficeIMO.OfficeColor? = null optional
insetY OfficeIMO.OfficeLength = default optional
offsetX OfficeIMO.OfficeLength = default optional
cornerRadius OfficeIMO.OfficeLength = default optional
stroke OfficeIMO.OfficeColor? = null optional
strokeWidth OfficeIMO.OfficeLength = default optional
fillOpacity double? = null optional
strokeOpacity double? = null optional
fillGradient OfficeIMO.Drawing.OfficeLinearGradient? = null optional
public PdfPageBuilder BackgroundRectangle(OfficeLength x, OfficeLength y, OfficeLength width, OfficeLength height, OfficeColor? fill = null, OfficeColor? stroke = null, OfficeLength strokeWidth = default, double? fillOpacity = null, double? strokeOpacity = null, OfficeLinearGradient? fillGradient = null) #

Adds a page-scoped rectangle background shape.

Parameters

x OfficeIMO.OfficeLength required
y OfficeIMO.OfficeLength required
width OfficeIMO.OfficeLength required
height OfficeIMO.OfficeLength required
fill OfficeIMO.OfficeColor? = null optional
stroke OfficeIMO.OfficeColor? = null optional
strokeWidth OfficeIMO.OfficeLength = default optional
fillOpacity double? = null optional
strokeOpacity double? = null optional
fillGradient OfficeIMO.Drawing.OfficeLinearGradient? = null optional
public PdfPageBuilder BackgroundRightBand(OfficeLength width, OfficeColor? fill = null, OfficeLength insetY = default, OfficeLength offsetX = default, OfficeLength cornerRadius = default, OfficeColor? stroke = null, OfficeLength strokeWidth = default, double? fillOpacity = null, double? strokeOpacity = null, OfficeLinearGradient? fillGradient = null) #

Adds a page-scoped right background band using the current page size.

Parameters

width OfficeIMO.OfficeLength required
fill OfficeIMO.OfficeColor? = null optional
insetY OfficeIMO.OfficeLength = default optional
offsetX OfficeIMO.OfficeLength = default optional
cornerRadius OfficeIMO.OfficeLength = default optional
stroke OfficeIMO.OfficeColor? = null optional
strokeWidth OfficeIMO.OfficeLength = default optional
fillOpacity double? = null optional
strokeOpacity double? = null optional
fillGradient OfficeIMO.Drawing.OfficeLinearGradient? = null optional
public PdfPageBuilder BackgroundRoundedRectangle(OfficeLength x, OfficeLength y, OfficeLength width, OfficeLength height, OfficeLength cornerRadius, OfficeColor? fill = null, OfficeColor? stroke = null, OfficeLength strokeWidth = default, double? fillOpacity = null, double? strokeOpacity = null, OfficeLinearGradient? fillGradient = null) #

Adds a page-scoped rounded rectangle background shape.

Parameters

x OfficeIMO.OfficeLength required
y OfficeIMO.OfficeLength required
width OfficeIMO.OfficeLength required
height OfficeIMO.OfficeLength required
cornerRadius OfficeIMO.OfficeLength required
fill OfficeIMO.OfficeColor? = null optional
stroke OfficeIMO.OfficeColor? = null optional
strokeWidth OfficeIMO.OfficeLength = default optional
fillOpacity double? = null optional
strokeOpacity double? = null optional
fillGradient OfficeIMO.Drawing.OfficeLinearGradient? = null optional
public PdfPageBuilder BackgroundShape(PdfPageBackgroundShape shape) #

Adds a page-scoped background shape rendered behind page content.

Parameters

shape OfficeIMO.Pdf.PdfPageBackgroundShape required
public PdfPageBuilder BackgroundShapes(IEnumerable<PdfPageBackgroundShape>? shapes) #

Replaces or clears page-scoped background shapes.

Parameters

shapes System.Collections.Generic.IEnumerable<OfficeIMO.Pdf.PdfPageBackgroundShape>? required
public PdfPageBuilder BackgroundTopBand(OfficeLength height, OfficeColor? fill = null, OfficeLength insetX = default, OfficeLength offsetY = default, OfficeLength cornerRadius = default, OfficeColor? stroke = null, OfficeLength strokeWidth = default, double? fillOpacity = null, double? strokeOpacity = null, OfficeLinearGradient? fillGradient = null) #

Adds a page-scoped top background band using the current page size.

Parameters

height OfficeIMO.OfficeLength required
fill OfficeIMO.OfficeColor? = null optional
insetX OfficeIMO.OfficeLength = default optional
offsetY OfficeIMO.OfficeLength = default optional
cornerRadius OfficeIMO.OfficeLength = default optional
stroke OfficeIMO.OfficeColor? = null optional
strokeWidth OfficeIMO.OfficeLength = default optional
fillOpacity double? = null optional
strokeOpacity double? = null optional
fillGradient OfficeIMO.Drawing.OfficeLinearGradient? = null optional
public PdfPageBuilder Canvas(Action<PdfPageCanvas> build) #

Adds foreground page content at absolute top-left page coordinates.

Parameters

build System.Action<OfficeIMO.Pdf.PdfPageCanvas> required
public PdfPageBuilder ClearBackgroundShapes() #

Clears page-scoped background shapes.

public PdfPageBuilder Content(Action<PdfContentBuilder> build) #

Builds the page content through the universal content receiver.

Parameters

build System.Action<OfficeIMO.Pdf.PdfContentBuilder> required
public PdfPageBuilder DefaultDrawingStyle(PdfDrawingStyle style) #

Configures the default placement style for page drawing objects.

Parameters

style OfficeIMO.Pdf.PdfDrawingStyle required
public PdfPageBuilder DefaultHeadingStyle(int level, PdfHeadingStyle style) #

Configures the default style for a built-in heading level on the page.

Parameters

level int required
style OfficeIMO.Pdf.PdfHeadingStyle required
public PdfPageBuilder DefaultHorizontalRuleStyle(PdfHorizontalRuleStyle style) #

Configures the default style for page horizontal rules.

Parameters

style OfficeIMO.Pdf.PdfHorizontalRuleStyle required
public PdfPageBuilder DefaultImageStyle(PdfImageStyle style) #

Configures the default style for page images.

Parameters

style OfficeIMO.Pdf.PdfImageStyle required
public PdfPageBuilder DefaultListStyle(PdfListStyle style) #

Configures the default style for page bullet and numbered lists.

Parameters

style OfficeIMO.Pdf.PdfListStyle required
public PdfPageBuilder DefaultPanelStyle(PdfPanelStyle style) #

Configures the default style for page panel paragraphs.

Parameters

style OfficeIMO.Pdf.PdfPanelStyle required
public PdfPageBuilder DefaultParagraphStyle(PdfParagraphStyle style) #

Configures the default paragraph style for page paragraphs that do not provide an explicit style.

Parameters

style OfficeIMO.Pdf.PdfParagraphStyle required
public PdfPageBuilder DefaultRowStyle(PdfRowStyle style) #

Configures the default row/column layout style for the page.

Parameters

style OfficeIMO.Pdf.PdfRowStyle required
DefaultTableStyle 2 overloads
public PdfPageBuilder DefaultTableStyle(PdfTableStyle style) #

Configures the default table style for page tables that do not provide an explicit style.

Parameters

style OfficeIMO.Pdf.PdfTableStyle required
public PdfPageBuilder DefaultTableStyle(string wordTableStyleName) #

Configures the default table style for the page from a supported Word table style name.

Parameters

wordTableStyleName string required
DefaultTextStyle 2 overloads
public PdfPageBuilder DefaultTextStyle(Action<PdfTextStyleBuilder> style) #

Configures default text style for the page.

Parameters

style System.Action<OfficeIMO.Pdf.PdfTextStyleBuilder> required
public PdfPageBuilder DefaultTextStyle(PdfTextStyle style) #

Configures default text style for the page from a reusable text style object.

Parameters

style OfficeIMO.Pdf.PdfTextStyle required
EvenPagesImageWatermark 2 overloads
public PdfPageBuilder EvenPagesImageWatermark(PdfImageWatermark? watermark) #

Sets or clears the even-page image watermark rendered behind page content.

Parameters

watermark OfficeIMO.Pdf.PdfImageWatermark? required
public PdfPageBuilder EvenPagesImageWatermark(byte[] imageBytes, OfficeLength width, OfficeLength height, double? opacity = null, double? rotationAngle = null) #

Sets an even-page image watermark rendered behind page content.

Parameters

imageBytes byte[] required
width OfficeIMO.OfficeLength required
height OfficeIMO.OfficeLength required
opacity double? = null optional
rotationAngle double? = null optional
EvenPagesWatermark 2 overloads
public PdfPageBuilder EvenPagesWatermark(PdfTextWatermark? watermark) #

Sets or clears the even-page text watermark rendered behind page content.

Parameters

watermark OfficeIMO.Pdf.PdfTextWatermark? required
public PdfPageBuilder EvenPagesWatermark(string text, OfficeLength? fontSize = null, OfficeColor? color = null, double? opacity = null, double? rotationAngle = null, PdfStandardFont? font = null, bool bold = true, bool italic = false) #

Sets an even-page text watermark rendered behind page content.

Parameters

text string required
fontSize OfficeIMO.OfficeLength? = null optional
color OfficeIMO.OfficeColor? = null optional
opacity double? = null optional
rotationAngle double? = null optional
font OfficeIMO.Pdf.PdfStandardFont? = null optional
bold bool = true optional
italic bool = false optional
FirstPageImageWatermark 2 overloads
public PdfPageBuilder FirstPageImageWatermark(PdfImageWatermark? watermark) #

Sets or clears the first-page image watermark rendered behind page content.

Parameters

watermark OfficeIMO.Pdf.PdfImageWatermark? required
public PdfPageBuilder FirstPageImageWatermark(byte[] imageBytes, OfficeLength width, OfficeLength height, double? opacity = null, double? rotationAngle = null) #

Sets a first-page image watermark rendered behind page content.

Parameters

imageBytes byte[] required
width OfficeIMO.OfficeLength required
height OfficeIMO.OfficeLength required
opacity double? = null optional
rotationAngle double? = null optional
FirstPageWatermark 2 overloads
public PdfPageBuilder FirstPageWatermark(PdfTextWatermark? watermark) #

Sets or clears the first-page text watermark rendered behind page content.

Parameters

watermark OfficeIMO.Pdf.PdfTextWatermark? required
public PdfPageBuilder FirstPageWatermark(string text, OfficeLength? fontSize = null, OfficeColor? color = null, double? opacity = null, double? rotationAngle = null, PdfStandardFont? font = null, bool bold = true, bool italic = false) #

Sets a first-page text watermark rendered behind page content.

Parameters

text string required
fontSize OfficeIMO.OfficeLength? = null optional
color OfficeIMO.OfficeColor? = null optional
opacity double? = null optional
rotationAngle double? = null optional
font OfficeIMO.Pdf.PdfStandardFont? = null optional
bold bool = true optional
italic bool = false optional
public PdfPageBuilder Header(Action<PdfHeaderBuilder> build) #

Defines the header layout and content.

Parameters

build System.Action<OfficeIMO.Pdf.PdfHeaderBuilder> required
ImageWatermark 2 overloads
public PdfPageBuilder ImageWatermark(PdfImageWatermark? watermark) #

Sets or clears the page-scoped image watermark rendered behind page content.

Parameters

watermark OfficeIMO.Pdf.PdfImageWatermark? required
public PdfPageBuilder ImageWatermark(byte[] imageBytes, OfficeLength width, OfficeLength height, double? opacity = null, double? rotationAngle = null) #

Sets a page-scoped image watermark rendered behind page content.

Parameters

imageBytes byte[] required
width OfficeIMO.OfficeLength required
height OfficeIMO.OfficeLength required
opacity double? = null optional
rotationAngle double? = null optional
public PdfPageBuilder Landscape() #

Sets page orientation to landscape while preserving the current page size dimensions.

Margin 3 overloads
public PdfPageBuilder Margin(OfficeLength all) #

Sets uniform page margins (all sides in points).

Parameters

all OfficeIMO.OfficeLength required
public PdfPageBuilder Margin(PdfPageMargins margins) #

Sets page margins from a reusable margin value.

Parameters

margins OfficeIMO.Pdf.PdfPageMargins required
public PdfPageBuilder Margin(OfficeLength left, OfficeLength top, OfficeLength right, OfficeLength bottom) #

Sets page margins (left, top, right, bottom in points).

Parameters

left OfficeIMO.OfficeLength required
top OfficeIMO.OfficeLength required
right OfficeIMO.OfficeLength required
bottom OfficeIMO.OfficeLength required
public PdfPageBuilder MirrorMargins(bool enabled = true) #

Swaps left and right margins on even visible page numbers, including numbering restarts.

Parameters

enabled bool = true optional
public PdfPageBuilder Orientation(OfficePageOrientation orientation) #

Sets page orientation while preserving the current page size dimensions.

Parameters

orientation OfficeIMO.OfficePageOrientation required
PageBorder 2 overloads
public PdfPageBuilder PageBorder(PdfPageBorder? border) #

Sets or clears the page-scoped page border.

Parameters

border OfficeIMO.Pdf.PdfPageBorder? required
public PdfPageBuilder PageBorder(OfficeColor? color = null, OfficeLength? width = null, OfficeLength? inset = null, double? opacity = null, OfficeStrokeDashStyle dashStyle = Solid) #

Sets a page-scoped page border.

Parameters

color OfficeIMO.OfficeColor? = null optional
width OfficeIMO.OfficeLength? = null optional
inset OfficeIMO.OfficeLength? = null optional
opacity double? = null optional
dashStyle OfficeIMO.Drawing.OfficeStrokeDashStyle = Solid optional
public PdfPageBuilder PageNumberStart(int start) #

Sets the first visible page number for this page or section flow.

Parameters

start int required
public PdfPageBuilder PageNumberStyle(PdfPageNumberStyle style) #

Sets the visible page-number style for this page or section flow.

Parameters

style OfficeIMO.Pdf.PdfPageNumberStyle required
public PdfPageBuilder Portrait() #

Sets page orientation to portrait while preserving the current page size dimensions.

public PdfPageBuilder PrintProductionPageBoxes(PdfPrintProductionPageBoxes? boxes) #

Sets or clears page-scoped TrimBox and BleedBox geometry.

Parameters

boxes OfficeIMO.Pdf.PdfPrintProductionPageBoxes? required
public PdfPageBuilder RegisterEmbeddedFontFallbacks(PdfEmbeddedFontFallbackSet fallbackSet) #

Registers a planned embedded-font fallback set for generated rich text runs on this composed page or section.

Parameters

fallbackSet OfficeIMO.Pdf.PdfEmbeddedFontFallbackSet required
Size 2 overloads
public PdfPageBuilder Size(PdfPageSize size) #

Sets page size using a predefined PdfPageSize.

Parameters

size OfficeIMO.Pdf.PdfPageSize required
public PdfPageBuilder Size(OfficeLength width, OfficeLength height) #

Sets custom page size in points.

Parameters

width OfficeIMO.OfficeLength required
height OfficeIMO.OfficeLength required
public PdfPageBuilder StartOnPageParity(PdfPageParity? parity, bool useContinuingPageNumber = false) #

Sets or clears the parity required at the start of a later page group. Optionally uses the continuing page number before this group's numbering restart.

Parameters

parity OfficeIMO.Pdf.PdfPageParity? required
useContinuingPageNumber bool = false optional
public PdfPageBuilder SuppressEvenPagesImageWatermark() #

Suppresses the inherited image watermark on even pages.

public PdfPageBuilder SuppressEvenPagesTextWatermark() #

Suppresses the inherited text watermark on even pages.

public PdfPageBuilder SuppressEvenPagesWatermark() #

Suppresses inherited text and image watermarks on even pages.

public PdfPageBuilder SuppressFirstPageImageWatermark() #

Suppresses the inherited image watermark on the first page.

public PdfPageBuilder SuppressFirstPageTextWatermark() #

Suppresses the inherited text watermark on the first page.

public PdfPageBuilder SuppressFirstPageWatermark() #

Suppresses inherited text and image watermarks on the first page.

public PdfPageBuilder TextHyphenation(PdfTextHyphenationCallback? callback) #

Sets or clears the page-scoped generated text hyphenation callback used for long unspaced tokens.

Parameters

callback OfficeIMO.Pdf.PdfTextHyphenationCallback? required
public PdfPageBuilder TextHyphenationDictionary(PdfHyphenationLexicon? dictionary) #

Uses or clears an immutable first-party word hyphenation dictionary.

Parameters

dictionary OfficeIMO.Pdf.PdfHyphenationLexicon? required
public PdfPageBuilder TextLineBreaks(Func<string, IReadOnlyList<int>>? callback) #

Sets or clears the page-scoped generated text line-break callback used for long unspaced tokens.

Parameters

callback System.Func<string, System.Collections.Generic.IReadOnlyList<int>>? required
public PdfPageBuilder Theme(PdfTheme theme) #

Applies reusable page-scoped default styles.

Parameters

theme OfficeIMO.Pdf.PdfTheme required
public PdfPageBuilder Typography(OfficeRenderingProfile profile, OfficeRenderingProfileApplyMode mode = Replace) #

Applies a shared, page-scoped font, fallback, language, and shaping profile.

Parameters

profile OfficeIMO.Drawing.OfficeRenderingProfile required
mode OfficeIMO.Drawing.OfficeRenderingProfileApplyMode = Replace optional
public PdfPageBuilder UseEmbeddedFontFallbacksFromSystem(string? familyNames, int maxFallbackFonts = 2) #

Registers generated-text fallback fonts from installed system font families without requiring callers to choose PDF font slots.

Parameters

familyNames string? required
maxFallbackFonts int = 2 optional
UseFontFamily 3 overloads
public PdfPageBuilder UseFontFamily(PdfEmbeddedFontFamily fontFamily) #

Uses a caller-supplied TrueType font family for this composed page or section.

Parameters

fontFamily OfficeIMO.Pdf.PdfEmbeddedFontFamily required
public PdfPageBuilder UseFontFamily(string familyName, byte[] regular, byte[]? bold = null, byte[]? italic = null, byte[]? boldItalic = null) #

Uses caller-supplied TrueType font files for this composed page or section.

Parameters

familyName string required
regular byte[] required
bold byte[]? = null optional
italic byte[]? = null optional
boldItalic byte[]? = null optional
public PdfPageBuilder UseFontFamily(string familyName, string regularPath, string? boldPath = null, string? italicPath = null, string? boldItalicPath = null) #

Uses caller-supplied TrueType font files for this composed page or section.

Parameters

familyName string required
regularPath string required
boldPath string? = null optional
italicPath string? = null optional
boldItalicPath string? = null optional
public PdfPageBuilder UseTextFallbacks(PdfTextFallbackFeatures features = Default) #

Applies OfficeIMO's built-in generated-text fallback groups for this composed page or section.

Parameters

features OfficeIMO.Pdf.PdfTextFallbackFeatures = Default optional
Watermark 2 overloads
public PdfPageBuilder Watermark(PdfTextWatermark? watermark) #

Sets or clears the page-scoped text watermark rendered behind page content.

Parameters

watermark OfficeIMO.Pdf.PdfTextWatermark? required
public PdfPageBuilder Watermark(string text, OfficeLength? fontSize = null, OfficeColor? color = null, double? opacity = null, double? rotationAngle = null, PdfStandardFont? font = null, bool bold = true, bool italic = false) #

Sets a page-scoped text watermark rendered behind page content.

Parameters

text string required
fontSize OfficeIMO.OfficeLength? = null optional
color OfficeIMO.OfficeColor? = null optional
opacity double? = null optional
rotationAngle double? = null optional
font OfficeIMO.Pdf.PdfStandardFont? = null optional
bold bool = true optional
italic bool = false optional

Properties

public PdfPageSetup PageSetup { get; } #

Page size, margins, orientation and running headers and footers of this page group's options snapshot.