Skip to content

# PDFFlowTextContent

Namespace: O2S.Components.PDF4NET.FlowDocument

Defines a text content that can be added to a flow document.

    public class PDFFlowTextContent : PDFFlowContent

Inheritance Object → PDFFlowContent → PDFFlowTextContent

## Constructors

### PDFFlowTextContent(PDFFormattedContent)

Initializes a new PDFFlowTextContent object.

    public PDFFlowTextContent(PDFFormattedContent formattedContent)

Parameters

`formattedContent` PDFFormattedContent
Formatted content to be displayed.

### PDFFlowTextContent(String, PDFFont)

Initializes a new PDFFlowTextContent object.

    public PDFFlowTextContent(string text, PDFFont font)

Parameters

`text` String
Text to be displayed.

`font` PDFFont
The font used for displaying the text.

### PDFFlowTextContent(String, PDFFont, PDFTextDirection)

Initializes a new PDFFlowTextContent object.

    public PDFFlowTextContent(string text, PDFFont font, PDFTextDirection textDirection)

Parameters

`text` String
Text to be displayed.

`font` PDFFont
The font used for displaying the text.

`textDirection` PDFTextDirection
The direction of the text.

## Properties

### 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.

### 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.

## Methods

### GetContentHeight(Double)

Gets the content height.

    public double GetContentHeight(double width)

Parameters

`width` Double
The width for which the content height is computed.

Returns

Double
The height of the content for the specified width.

### ToString()

Converts the object to string.

    public string ToString()

Returns

String
The object as string.

## 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;