VegaRise.NET
Back to DOM

DocumentHeaderFooterPartClass

Definition

Namespace
DOM.Abstracts
Assembly
DOM.dll

Base class for document header and footer parts.

Remarks

Header and footer parts provide a place to host flow content (paragraphs, images, shapes, etc.) and expose layout properties such as borders and height constraints. Concrete implementations should populate the children collection and respect the height and border settings when rendering or serializing header/footer content. The concrete and classes derive from this type and are created through the section-level / methods. DocumentHeader DocumentFooter AddHeader AddFooter

Examples

csharp
1// 1. Add a simple text footer
2var doc = new VDocs();
3doc.Footer.AddParagraph().AddText("Internal Use Only");
4
csharp
1// 2. Configure a fixed-height header with borders
2var header = doc.AddHeader(HeaderFooterType.Default);
3header.FixedHeight = true;
4header.MinHeight = new DocumentUnit(0.5, Units.inch);
5header.Borders = new RectBorder { Bottom = new BorderStyle { BorderValue = BorderValues.single } };
6
csharp
1// 3. Attach a page number field to the footer
2doc.Footer.PageNumber = new PageNumber { Alignment = HorizontalAlignmentValues.Center };
3
csharp
1// 4. Add mixed content to a footer
2var footer = doc.AddFooter(HeaderFooterType.Default);
3footer.AddParagraph().AddText("Confidential");
4footer.AddImage("logo.png").SetDimensions(60, 20, Units.pt);
5
csharp
1// 5. Configure min and max heights
2header.MinHeight = new DocumentUnit(0.3, Units.inch);
3header.MaxHeight = new DocumentUnit(1.0, Units.inch);
4

Properties

Gets or sets the rectangular border settings for this header/footer part.

FixedHeight

Gets or sets a value indicating whether the header/footer should use a fixed height.

MaxHeightDocumentUnit

Gets or sets the maximum height of the header/footer region.

MinHeightDocumentUnit

Gets or sets the minimum height of the header/footer region.

PageNumberIPageNumber

Gets or sets the page number field associated with this header/footer part.

Gets or sets the type of this header/footer part.

Methods

Adds a text node to the section by creating a new paragraph and appending the text to it.

VegaRiseVDocs.NET

Reset Password

Enter your email and we'll send you a link to reset your password.

Remember your password? Sign in