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
floatthe leading
Paragraph(float, string)
Constructs a Paragraph with a certain string and a certain leading.
public Paragraph(float leading, string str)
Parameters
Paragraph(float, string, Font)
Constructs a Paragraph with a certain leading, string and Font.
public Paragraph(float leading, string str, Font font)
Parameters
Paragraph(float, Chunk)
Constructs a Paragraph with a certain Chunk and a certain leading.
public Paragraph(float leading, Chunk chunk)
Parameters
Paragraph(string)
Constructs a Paragraph with a certain string.
public Paragraph(string str)
Parameters
str
stringa string
Paragraph(string, Font)
Constructs a Paragraph with a certain string and a certain Font.
public Paragraph(string str, Font font)
Parameters
Paragraph(Chunk)
Constructs a Paragraph with a certain Chunk.
public Paragraph(Chunk chunk)
Parameters
chunk
Chunka Chunk
Paragraph(Phrase)
Constructs a Paragraph with a certain Phrase.
public Paragraph(Phrase phrase)
Parameters
phrase
Phrasea Phrase
Fields
Keeptogether
Does the paragraph has to be kept together on 1 page.
protected bool Keeptogether
Field Value
alignment
membervariables
protected int alignment
Field Value
indentationLeft
The indentation of this paragraph on the left side.
protected float indentationLeft
Field Value
indentationRight
The indentation of this paragraph on the right side.
protected float indentationRight
Field Value
multipliedLeading
The text leading that is multiplied by the biggest font size in the line.
protected float multipliedLeading
Field Value
spacingAfter
The spacing after the paragraph.
protected float spacingAfter
Field Value
spacingBefore
The spacing before the paragraph.
protected float spacingBefore
Field Value
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
FirstLineIndent
Holds value of property firstLineIndent.
public float FirstLineIndent { get; set; }
Property Value
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
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
SpacingAfter
public float SpacingAfter { get; set; }
Property Value
SpacingBefore
public float SpacingBefore { get; set; }
Property Value
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
IElementthe object to add
Returns
- bool
a bool
IsTag(string)
methods
public static bool IsTag(string tag)
Parameters
tag
stringthe given tag
Returns
- bool
true if the tag corresponds
SetAlignment(string)
setting the membervariables
public void SetAlignment(string alignment)
Parameters
alignment
stringthe 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)