Skip to content

PDFFormattedParagraph

Namespace: O2S.Components.PDF4NET.Graphics.FormattedContent

Defines a formatted paragraph.

public class PDFFormattedParagraph

Inheritance ObjectPDFFormattedParagraph

Remarks

A paragraph contains one or more formatted blocks, each one with its formatting attributes.

Constructors

PDFFormattedParagraph()

Initializes a new PDFFormattedParagraph object.

public PDFFormattedParagraph()

PDFFormattedParagraph(String)

Initializes a new PDFFormattedParagraph object.

public PDFFormattedParagraph(string text)

Parameters

text String
Initial paragraph text.


PDFFormattedParagraph(String, PDFFont)

Initializes a new PDFFormattedParagraph object.

public PDFFormattedParagraph(string text, PDFFont font)

Parameters

text String
Initial paragraph text.

font PDFFont
Font used for displaying the text.


PDFFormattedParagraph(PDFFormattedBlock[])

Initializes a new PDFFormattedParagraph object.

public PDFFormattedParagraph(PDFFormattedBlock[] blocks)

Parameters

blocks PDFFormattedBlock[]


PDFFormattedParagraph(PDFFormattedParagraph)

Initializes a new PDFFormattedParagraph object.

public PDFFormattedParagraph(PDFFormattedParagraph source)

Parameters

source PDFFormattedParagraph
Source paragraph.


Properties

BackgroundBaselineOffset

Gets or sets the background baseline offset.

public double BackgroundBaselineOffset { get; set; }

Property Value

Double
Offset from text baseline for drawing the background.

Remarks

The offset is given in PDF points. By default the background baseline matches the text baseline. If you want to lower it so that it covers the descent part of the text, you can set it to a negative value.


BackgroundColor

Gets or sets the background color.

public PDFBrush BackgroundColor { get; set; }

Property Value

PDFBrush
The brush used to fill the paragraph background.


Blocks

Gets the list of formatted blocks that compose this paragraph.

public PDFFormattedBlockCollection Blocks { get; }

Property Value

PDFFormattedBlockCollection


Bullet

Gets or sets the bullet text.

public PDFFormattedBlock Bullet { get; set; }

Property Value

PDFFormattedBlock
The text to be used as bullet for the paragraph.

Remarks

If this property is set to a PDFFormattedBlock object then the paragraph is considered to be part of a bulleted list.


FirstLineIndent

Gets or sets the indentation of the first paragraph line.

public double FirstLineIndent { get; set; }

Property Value

Double
Value in points to indent the first line of the paragraph. If negative then it is left hanging indent.


ForceLongWordsWrap

Gets or sets a flag indicating whether long words should wrap if they do not fit entirely on a single line.

public bool ForceLongWordsWrap { get; set; }

Property Value

Boolean
True if long words are wrapped at character level if they do not fit entirely on a single line.


HorizontalAlign

Gets or sets the horizontal align.

public PDFStringHorizontalAlign HorizontalAlign { get; set; }

Property Value

PDFStringHorizontalAlign
The alignment of paragraph content on horizontal.


LeftIndentation

Gets or sets the left indentation.

public double LeftIndentation { get; set; }

Property Value

Double
Indentantion of the left side of the paragraph relative to the left margin of the drawing box.


LineSpacing

Gets or sets the line spacing in points.

public double LineSpacing { get; set; }

Property Value

Double
The line spacing value, depends on the PDFFormattedParagraph.LineSpacingMode property.

Remarks

When the PDFFormattedParagraph.LineSpacingMode property is set to PDFFormattedParagraphLineSpacing.Exact the value of the line spacing is specified in this property.
When the PDFFormattedParagraph.LineSpacingMode property is set to PDFFormattedParagraphLineSpacing.Multiple the value of the line spacing is computed by multiplying the current line height with the value specified in this property.


LineSpacingMode

Gets or sets the line spacing for the paragraph.

public PDFFormattedParagraphLineSpacing LineSpacingMode { get; set; }

Property Value

PDFFormattedParagraphLineSpacing
The line spacing for the paragraph.

Remarks

When this property is set to PDFFormattedParagraphLineSpacing.Exact the value of the line spacing is specified in PDFFormattedParagraph.LineSpacing property.
When this property is set to PDFFormattedParagraphLineSpacing.Multiple the value of the line spacing is computed by multiplying the current line height with the value specified in PDFFormattedParagraph.LineSpacing property.


RightIndentation

Gets or sets the right indentation.

public double RightIndentation { get; set; }

Property Value

Double
Indentantion of the right side of the paragraph relative to the right margin of the drawing box.


SpacingAfter

Gets or sets the spacing after the paragraph.

public double SpacingAfter { get; set; }

Property Value

Double
The space in points below the paragraph.


SpacingBefore

Gets or sets the spacing before the paragraph.

public double SpacingBefore { get; set; }

Property Value

Double
The space in points above the paragraph content.


StructureElement

Gets or sets the structure element.

public PDFStructureElement StructureElement { get; set; }

Property Value

PDFStructureElement
The PDFStructureElement object associated with this paragraph.

Remarks

When a paragraph has an associated structure element, the blocks within the paragraph should not have their own structure elements otherwise the content will be tagged incorrectly.
The structure element does not include the PDFFormattedParagraph.Bullet so a structure element needs to be set on it.


TextDirection

Gets or sets the text direction.

public PDFTextDirection TextDirection { get; set; }

Property Value

PDFTextDirection
The direction of the paragraph's text.


Methods

ToString()

Converts this object to string representation.

public string ToString()

Returns

String
This object as string.