Skip to content

# PDFFlowHeadingContent

Namespace: O2S.Components.PDF4NET.FlowDocument

Defines a heading in a flow document.

    public class PDFFlowHeadingContent : PDFFlowTextContent

Inheritance Object → PDFFlowContent → PDFFlowTextContent → PDFFlowHeadingContent

Remarks

Headings are used for generation of document's outline tree and table of contents.

## Constructors

### PDFFlowHeadingContent(PDFFormattedContent)

Initializes a new PDFFlowHeadingContent object.

    public PDFFlowHeadingContent(PDFFormattedContent content)

Parameters

`content` PDFFormattedContent
Heading content.

## Properties

### AutoNumber

Gets or sets a value indicating whether the headings should be numbered automatically.

    public bool AutoNumber { get; set; }

Property Value

Boolean
If true the headings are numbered automatically based on their position in the document and relative to their parent heading.

Remarks

The heading number is generated in the format x.y.z, with one number for each level. Level 1 headings will have one number (x), level 2 headings will have 2 numbers (x.y) where the first number matches the number of parent level 1 heading. Level 3 headings will have 3 numbers (x.y.z) and so on.

### Background

Gets or sets the content background.

    public PDFBrush Background { get; set; }

Property Value

PDFBrush
The background of the flow content.

Remarks

The background that fills the flow content bounding rectangle.

### DestinationName

Gets or sets the destination name.

    public string DestinationName { get; set; }

Property Value

String
The name of the destination created at the location of the flow content.

Remarks

A named destination is created at the top of flow content when this property is not null or an empty string.

### InnerMargins

Gets or sets the content inner margins.

    public PDFFlowContentMargins InnerMargins { get; set; }

Property Value

PDFFlowContentMargins
A PDFFlowContentMargins object specifying the content inner margins.

Remarks

The inner margins are located inside the content's bounding rectangle. The margins are applied to content as a whole and not to parts of content when content is split across pages.

### Level

Gets or sets the heading level (1 to 8).

    public int Level { get; set; }

Property Value

Int32
An integer value greater than 0 and smaller than or equal to 8.

Remarks

Level 1 is the top most heading, level 2 headings are children of level 1 and so on.
The level information is used to build the document's outline tree and to generate correctly the heading number if PDFFlowHeadingContent.AutoNumber property is true.

### OuterMargins

Gets or sets the content outer margins.

    public PDFFlowContentMargins OuterMargins { get; set; }

Property Value

PDFFlowContentMargins
A PDFFlowContentMargins object specifying the content outer margins.

Remarks

The outer margins are located outside the content's bounding rectangle. The margins are applied to content as a whole and not to parts of content when content is split across pages.

### StructureElement

Gets or sets the structure element.

    public PDFStructureElement StructureElement { get; set; }

Property Value

PDFStructureElement
The PDFStructureElement object associated with this flow content object.

### Tag

Gets or sets an arbitrary object value that can be used to store custom information about this element.

    public object Tag { get; set; }

Property Value

Object
The intended value.

Remarks

This property is analogous to Tag properties in other Microsoft programming models. Tag is intended to provide a pre-existing property location where you can store some basic custom information about any PDFFlowContent without requiring you to subclass a content object.

## Events

### AfterContentDraw

Gets or sets the event that is fired after the flow content object is drawn on the page.

    public event EventHandler<PDFFlowContentDrawEventArgs> AfterContentDraw;

### BeforeContentDraw

Gets or sets the event that is fired before the flow content object is drawn on the page.

    public event EventHandler<PDFFlowContentDrawEventArgs> BeforeContentDraw;