Table of Contents

Class Paragraph

Namespace
iTextSharp.text
Assembly
iTextSharp.LGPLv2.Core.dll

A Paragraph is a series of Chunks and/or Phrases.

public class Paragraph : Phrase, IList<IElement>, ICollection<IElement>, IList, ICollection, IReadOnlyList<IElement>, IReadOnlyCollection<IElement>, IEnumerable<IElement>, IEnumerable, ITextElementArray, IElement
Inheritance
Paragraph
Implements
Derived
Inherited Members
Extension Methods

Examples

Paragraph p = new Paragraph("This is a paragraph", FontFactory.GetFont(FontFactory.HELVETICA, 18, Font.BOLDITALIC, new Color(0, 0, 255)));

Remarks

A Paragraph has the same qualities of a Phrase, but also some additional layout-parameters: the indentation the alignment of the text

Constructors

Paragraph()

constructors

public Paragraph()

Paragraph(float)

Constructs a Paragraph with a certain leading.

public Paragraph(float leading)

Parameters

leading float

the leading

Paragraph(float, string)

Constructs a Paragraph with a certain string and a certain leading.

public Paragraph(float leading, string str)

Parameters

leading float

the leading

str string

a string

Paragraph(float, string, Font)

Constructs a Paragraph with a certain leading, string and Font.

public Paragraph(float leading, string str, Font font)

Parameters

leading float

the leading

str string

a string

font Font

a Font

Paragraph(float, Chunk)

Constructs a Paragraph with a certain Chunk and a certain leading.

public Paragraph(float leading, Chunk chunk)

Parameters

leading float

the leading

chunk Chunk

a Chunk

Paragraph(string)

Constructs a Paragraph with a certain string.

public Paragraph(string str)

Parameters

str string

a string

Paragraph(string, Font)

Constructs a Paragraph with a certain string and a certain Font.

public Paragraph(string str, Font font)

Parameters

str string

a string

font Font

a Font

Paragraph(Chunk)

Constructs a Paragraph with a certain Chunk.

public Paragraph(Chunk chunk)

Parameters

chunk Chunk

a Chunk

Paragraph(Phrase)

Constructs a Paragraph with a certain Phrase.

public Paragraph(Phrase phrase)

Parameters

phrase Phrase

a Phrase

Fields

Keeptogether

Does the paragraph has to be kept together on 1 page.

protected bool Keeptogether

Field Value

bool

alignment

membervariables

protected int alignment

Field Value

int

indentationLeft

The indentation of this paragraph on the left side.

protected float indentationLeft

Field Value

float

indentationRight

The indentation of this paragraph on the right side.

protected float indentationRight

Field Value

float

multipliedLeading

The text leading that is multiplied by the biggest font size in the line.

protected float multipliedLeading

Field Value

float

spacingAfter

The spacing after the paragraph.

protected float spacingAfter

Field Value

float

spacingBefore

The spacing before the paragraph.

protected float spacingBefore

Field Value

float

Properties

Alignment

implementation of the Element-methods

public int Alignment { get; set; }

Property Value

int

a integer

ExtraParagraphSpace

Holds value of property extraParagraphSpace.

public float ExtraParagraphSpace { get; set; }

Property Value

float

FirstLineIndent

Holds value of property firstLineIndent.

public float FirstLineIndent { get; set; }

Property Value

float

IndentationLeft

Get/set the indentation of this paragraph on the left side.

public float IndentationLeft { get; set; }

Property Value

float

a float

IndentationRight

Get/set the indentation of this paragraph on the right side.

public float IndentationRight { get; set; }

Property Value

float

a float

KeepTogether

Set/get if this paragraph has to be kept together on one page.

public bool KeepTogether { get; set; }

Property Value

bool

a bool

Leading

public override float Leading { set; }

Property Value

float

MultipliedLeading

Sets the variable leading. The resultant leading will be multipliedLeading*maxFontSize where maxFontSize is the size of the bigest font in the line.

public float MultipliedLeading { get; set; }

Property Value

float

SpacingAfter

public float SpacingAfter { get; set; }

Property Value

float

SpacingBefore

public float SpacingBefore { get; set; }

Property Value

float

TotalLeading

Gets the total leading. This method is based on the assumption that the font of the Paragraph is the font of all the elements that make part of the paragraph. This isn't necessarily true.

public float TotalLeading { get; }

Property Value

float

the total leading (fixed and multiplied)

Type

Gets the type of the text element.

public override int Type { get; }

Property Value

int

a type

Methods

Add(IElement)

Adds an Object to the Paragraph.

public override bool Add(IElement o)

Parameters

o IElement

the object to add

Returns

bool

a bool

IsTag(string)

methods

public static bool IsTag(string tag)

Parameters

tag string

the given tag

Returns

bool

true if the tag corresponds

SetAlignment(string)

setting the membervariables

public void SetAlignment(string alignment)

Parameters

alignment string

the new alignment as a string

SetLeading(float, float)

Sets the leading fixed and variable. The resultant leading will be fixedLeading+multipliedLeading*maxFontSize where maxFontSize is the size of the bigest font in the line.

public void SetLeading(float fixedLeading, float multipliedLeading)

Parameters

fixedLeading float

the fixed leading

multipliedLeading float

the variable leading