Skip to main content

DocumentFormatting Struct

Definition​

Assembly:Avalonia.Controls.Documents
Package:Avalonia.Controls.Documents

Document-level formatting snapshot. Value type for zero-reference safety.

public struct DocumentFormatting

Inheritance: ValueType -> DocumentFormatting

Implements: IEquatable<DocumentFormatting>

Remarks​

Contains format-agnostic page-level properties that apply to the entire document. Format-specific details (header/footer margins, gutter, etc.) are stored in format-specific metadata on the root Avalonia.Controls.Documents.Serialization.Snapshot.SnapshotNode.

All measurements are in device-independent pixels (DIPs) to match Avalonia conventions.

Methods​

NameDescription
Equals (2 overloads)No summary available.
GetHashCodeNo summary available.
ToStringNo summary available.

Equals overloads​

Equals Method​

public bool Equals(Avalonia.Controls.Documents.TextModel.Formatting.DocumentFormatting other)
Parameters​

other Avalonia.Controls.Documents.TextModel.Formatting.DocumentFormatting

Returns​

bool

Equals Method​

public bool Equals(object obj)
Parameters​

obj object

Returns​

bool

GetHashCode Method​

public int GetHashCode()

Returns​

int

ToString Method​

public string ToString()

Returns​

string

Properties​

NameDescription
DefaultDefault formatting with no explicit values set.
FootnoteNumberFormatHow the document numbers its footnotes. The anchor texts in the snapshot are already in this format. Maps to DOCX w:footnotePr/w:numFmt in the settings and to the RTF \ftnn* keywords.
IsPageHeightFixedTrue when Avalonia.Controls.Documents.TextModel.Formatting.DocumentFormatting.PageHeight is an explicit fixed value. False means height is auto/resolved from runtime view geometry.
IsPageWidthFixedTrue when Avalonia.Controls.Documents.TextModel.Formatting.DocumentFormatting.PageWidth is an explicit fixed value. False means width is auto/resolved from runtime view geometry.
PageBandDistanceDistance from the sheet edge to a page band in device-independent pixels: the header's top sits this far below the sheet top, the footer's bottom this far above the sheet bottom. Null means the document declares none and Avalonia.Controls.Documents.PageBandPolicy.DefaultDistance applies. Maps to DOCX w:pgMar/@w:header and @w:footer and to RTF \headery and \footery.
PageHeightPage height in device-independent pixels. Null means not explicitly known.
PagePaddingPage padding (content margins) in device-independent pixels. Maps to page margins in DOCX (w:pgMar) and RTF (\margl, \margr, \margt, \margb). Null means not explicitly set (use application defaults).
PageWidthPage width in device-independent pixels. Null means not explicitly known.

Default Property​

Default formatting with no explicit values set.

public Avalonia.Controls.Documents.TextModel.Formatting.DocumentFormatting Default { get; set; }

FootnoteNumberFormat Property​

How the document numbers its footnotes. The anchor texts in the snapshot are already in this format. Maps to DOCX w:footnotePr/w:numFmt in the settings and to the RTF \ftnn* keywords.

public Avalonia.Controls.Documents.FootnoteNumberFormat FootnoteNumberFormat { get; set; }

IsPageHeightFixed Property​

True when Avalonia.Controls.Documents.TextModel.Formatting.DocumentFormatting.PageHeight is an explicit fixed value. False means height is auto/resolved from runtime view geometry.

public bool IsPageHeightFixed { get; set; }

IsPageWidthFixed Property​

True when Avalonia.Controls.Documents.TextModel.Formatting.DocumentFormatting.PageWidth is an explicit fixed value. False means width is auto/resolved from runtime view geometry.

public bool IsPageWidthFixed { get; set; }

PageBandDistance Property​

Distance from the sheet edge to a page band in device-independent pixels: the header's top sits this far below the sheet top, the footer's bottom this far above the sheet bottom. Null means the document declares none and Avalonia.Controls.Documents.PageBandPolicy.DefaultDistance applies. Maps to DOCX w:pgMar/@w:header and @w:footer and to RTF \headery and \footery.

public Nullable<double> PageBandDistance { get; set; }

Remarks​

A band taller than the space this leaves pushes the body down, so the value decides where pages break. Screen, print and PDF all read it from here: a distance held by a view would break the same document on different lines.

PageHeight Property​

Page height in device-independent pixels. Null means not explicitly known.

public Nullable<double> PageHeight { get; set; }

PagePadding Property​

Page padding (content margins) in device-independent pixels. Maps to page margins in DOCX (w:pgMar) and RTF (\margl, \margr, \margt, \margb). Null means not explicitly set (use application defaults).

public Nullable<Avalonia.Thickness> PagePadding { get; set; }

PageWidth Property​

Page width in device-independent pixels. Null means not explicitly known.

public Nullable<double> PageWidth { get; set; }