HiraokaHyperTools.iTextSharp-LGPL  0.2.5
iTextSharp.text.Phrase Class Reference

A Phrase is a series of Chunks. More...

Inheritance diagram for iTextSharp.text.Phrase:
iTextSharp.text.ITextElementArray iTextSharp.text.IElement iTextSharp.text.Anchor iTextSharp.text.Paragraph iTextSharp.text.ListItem

Public Member Functions

 Phrase ()
 Constructs a Phrase without specifying a leading. More...
 
 Phrase (Phrase phrase)
 
 Phrase (float leading)
 Constructs a Phrase with a certain leading. More...
 
 Phrase (Chunk chunk)
 Constructs a Phrase with a certain Chunk. More...
 
 Phrase (float leading, Chunk chunk)
 Constructs a Phrase with a certain Chunk and a certain leading. More...
 
 Phrase (string str)
 Constructs a Phrase with a certain string. More...
 
 Phrase (string str, Font font)
 Constructs a Phrase with a certain string and a certain Font. More...
 
 Phrase (float leading, string str)
 Constructs a Phrase with a certain leading and a certain string. More...
 
 Phrase (float leading, string str, Font font)
 
virtual bool Process (IElementListener listener)
 Processes the element by adding it (or the different parts) to an iTextSharp.text.IElementListener. More...
 
bool IsContent ()
 
bool IsNestable ()
 
virtual void Add (int index, Object o)
 Adds a Chunk, an Anchor or another Phrase to this Phrase. More...
 
virtual new bool Add (Object o)
 Adds a Chunk, Anchor or another Phrase to this Phrase. More...
 
bool AddAll (ICollection collection)
 Adds a collection of Chunks to this Phrase. More...
 
void AddSpecial (Object obj)
 Adds a Object to the Paragraph. More...
 
bool IsEmpty ()
 Checks is this Phrase contains no or 1 empty Chunk. More...
 
bool HasLeading ()
 
override string ToString ()
 Gets the content of the text element. More...
 

Static Public Member Functions

static bool IsTag (string tag)
 Checks if a given tag corresponds with this object. More...
 
static Phrase GetInstance (String str)
 
static Phrase GetInstance (int leading, String str)
 
static Phrase GetInstance (int leading, String str, Font font)
 

Protected Member Functions

bool AddChunk (Chunk chunk)
 Adds a Chunk. More...
 

Protected Attributes

Single leading = Single.NaN
 This is the leading of this phrase. More...
 
Font font
 
IHyphenationEvent hyphenation = null
 

Properties

virtual int Type [get]
 Gets the type of the text element. More...
 
virtual ArrayList Chunks [get]
 Gets all the chunks in this element. More...
 
virtual float Leading [get, set]
 Gets/sets the leading of this phrase. More...
 
Font Font [get, set]
 Gets the font of the first Chunk that appears in this Phrase. More...
 
String Content [get]
 
IHyphenationEvent Hyphenation [get, set]
 
- Properties inherited from iTextSharp.text.IElement
int Type [get]
 Gets the type of the text element. More...
 
ArrayList Chunks [get]
 Gets all the chunks in this element. More...
 

Detailed Description

A Phrase is a series of Chunks.

A Phrase has a main Font, but some chunks within the phrase can have a Font that differs from the main Font. All the Chunks in a Phrase have the same leading.

// When no parameters are passed, the default leading = 16
<strong>Phrase phrase0 = new Phrase();
Phrase phrase1 = new Phrase("this is a phrase");</strong>
// In this example the leading is passed as a parameter
<strong>Phrase phrase2 = new Phrase(16, "this is a phrase with leading 16");</strong>
// When a Font is passed (explicitely or embedded in a chunk), the default leading = 1.5 * size of the font
<strong>Phrase phrase3 = new Phrase("this is a phrase with a red, normal font Courier, size 12", FontFactory.GetFont(FontFactory.COURIER, 12, Font.NORMAL, new Color(255, 0, 0)));
Phrase phrase4 = new Phrase(new Chunk("this is a phrase"));
Phrase phrase5 = new Phrase(18, new Chunk("this is a phrase", FontFactory.GetFont(FontFactory.HELVETICA, 16, Font.BOLD, new Color(255, 0, 0)));</strong>
const int NORMAL
this is a possible style.
Definition: Font.cs:89
const int BOLD
this is a possible style.
Definition: Font.cs:92
Font Font
Gets the font of the first Chunk that appears in this Phrase.
Definition: Phrase.cs:395
Phrase()
Constructs a Phrase without specifying a leading.
Definition: Phrase.cs:55

Constructor & Destructor Documentation

◆ Phrase() [1/9]

iTextSharp.text.Phrase.Phrase ( )

Constructs a Phrase without specifying a leading.

<overloads> Has nine overloads. </overloads>

◆ Phrase() [2/9]

iTextSharp.text.Phrase.Phrase ( Phrase  phrase)

Copy constructor for Phrase.

◆ Phrase() [3/9]

iTextSharp.text.Phrase.Phrase ( float  leading)

Constructs a Phrase with a certain leading.

Parameters
leadingthe leading

◆ Phrase() [4/9]

iTextSharp.text.Phrase.Phrase ( Chunk  chunk)

Constructs a Phrase with a certain Chunk.

Parameters
chunka Chunk

◆ Phrase() [5/9]

iTextSharp.text.Phrase.Phrase ( float  leading,
Chunk  chunk 
)

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

Parameters
leadingthe leading
chunka Chunk

◆ Phrase() [6/9]

iTextSharp.text.Phrase.Phrase ( string  str)

Constructs a Phrase with a certain string.

Parameters
stra string

◆ Phrase() [7/9]

iTextSharp.text.Phrase.Phrase ( string  str,
Font  font 
)

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

Parameters
stra string
fonta Font

◆ Phrase() [8/9]

iTextSharp.text.Phrase.Phrase ( float  leading,
string  str 
)

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

Parameters
leadingthe leading
stra string

◆ Phrase() [9/9]

iTextSharp.text.Phrase.Phrase ( float  leading,
string  str,
Font  font 
)

Member Function Documentation

◆ Add() [1/2]

virtual void iTextSharp.text.Phrase.Add ( int  index,
Object  o 
)
virtual

Adds a Chunk, an Anchor or another Phrase to this Phrase.

Parameters
indexindex at which the specified element is to be inserted
oan object of type Chunk, Anchor, or Phrase

◆ Add() [2/2]

virtual new bool iTextSharp.text.Phrase.Add ( Object  o)
virtual

Adds a Chunk, Anchor or another Phrase to this Phrase.

Parameters
oan object of type Chunk, Anchor or Phrase
Returns
a bool

Implements iTextSharp.text.ITextElementArray.

Reimplemented in iTextSharp.text.Paragraph.

◆ AddAll()

bool iTextSharp.text.Phrase.AddAll ( ICollection  collection)

Adds a collection of Chunks to this Phrase.

Parameters
collectiona collection of Chunks, Anchors and Phrases.
Returns
true if the action succeeded, false if not.

◆ AddChunk()

bool iTextSharp.text.Phrase.AddChunk ( Chunk  chunk)
protected

Adds a Chunk.

This method is a hack to solve a problem I had with phrases that were split between chunks in the wrong place.

Parameters
chunka Chunk
Returns
a bool

◆ AddSpecial()

void iTextSharp.text.Phrase.AddSpecial ( Object  obj)

Adds a Object to the Paragraph.

Parameters
objthe object to add.

◆ GetInstance() [1/3]

static Phrase iTextSharp.text.Phrase.GetInstance ( int  leading,
String  str 
)
static

Gets a special kind of Phrase that changes some characters into corresponding symbols.

Parameters
leading
string
Returns
a newly constructed Phrase

◆ GetInstance() [2/3]

static Phrase iTextSharp.text.Phrase.GetInstance ( int  leading,
String  str,
Font  font 
)
static

Gets a special kind of Phrase that changes some characters into corresponding symbols.

Parameters
leading
string
font
Returns
a newly constructed Phrase

◆ GetInstance() [3/3]

static Phrase iTextSharp.text.Phrase.GetInstance ( String  str)
static

Gets a special kind of Phrase that changes some characters into corresponding symbols.

Parameters
string
Returns
a newly constructed Phrase

◆ HasLeading()

bool iTextSharp.text.Phrase.HasLeading ( )

◆ IsContent()

bool iTextSharp.text.Phrase.IsContent ( )
See also
com.lowagie.text.Element::isContent()
Since
iText 2.0.8

Implements iTextSharp.text.IElement.

◆ IsEmpty()

bool iTextSharp.text.Phrase.IsEmpty ( )

Checks is this Phrase contains no or 1 empty Chunk.

Returns
false if the Phrase contains more than one or more non-emptyChunks.

◆ IsNestable()

bool iTextSharp.text.Phrase.IsNestable ( )
See also
com.lowagie.text.Element::isNestable()
Since
iText 2.0.8

Implements iTextSharp.text.IElement.

◆ IsTag()

static bool iTextSharp.text.Phrase.IsTag ( string  tag)
static

Checks if a given tag corresponds with this object.

Parameters
tagthe given tag
Returns
true if the tag corresponds

◆ Process()

virtual bool iTextSharp.text.Phrase.Process ( IElementListener  listener)
virtual

Processes the element by adding it (or the different parts) to an iTextSharp.text.IElementListener.

Parameters
listeneran IElementListener
Returns
true if the element was processed successfully

Implements iTextSharp.text.IElement.

Reimplemented in iTextSharp.text.Anchor.

◆ ToString()

override string iTextSharp.text.Phrase.ToString ( )

Gets the content of the text element.

Returns
the content of the text element

Implements iTextSharp.text.IElement.

Member Data Documentation

◆ font

Font iTextSharp.text.Phrase.font
protected

◆ hyphenation

IHyphenationEvent iTextSharp.text.Phrase.hyphenation = null
protected

Null, unless the Phrase has to be hyphenated.

Since
2.1.2

◆ leading

Single iTextSharp.text.Phrase.leading = Single.NaN
protected

This is the leading of this phrase.

summary> This is the font of this phrase.

Property Documentation

◆ Chunks

virtual ArrayList iTextSharp.text.Phrase.Chunks
get

Gets all the chunks in this element.

an ArrayList

◆ Content

String iTextSharp.text.Phrase.Content
get

Returns the content as a String object. This method differs from toString because toString will return an ArrayList with the toString value of the Chunks in this Phrase.

◆ Font

Font iTextSharp.text.Phrase.Font
getset

Gets the font of the first Chunk that appears in this Phrase.

a Font

◆ Hyphenation

IHyphenationEvent iTextSharp.text.Phrase.Hyphenation
getset

Setter/getter for the hyphenation.

Parameters
hyphenationa HyphenationEvent instance
Since
2.1.2

◆ Leading

virtual float iTextSharp.text.Phrase.Leading
getset

Gets/sets the leading of this phrase.

the linespacing

◆ Type

virtual int iTextSharp.text.Phrase.Type
get

Gets the type of the text element.

a type


The documentation for this class was generated from the following file: