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

A Cell is a Rectangle containing other Elements. More...

Inheritance diagram for iTextSharp.text.Cell:
iTextSharp.text.Rectangle iTextSharp.text.ITextElementArray iTextSharp.text.Element iTextSharp.text.IElement iTextSharp.text.IElement iTextSharp.text.rtf.table.RtfCell

Public Member Functions

 Cell ()
 Constructs an empty Cell. More...
 
 Cell (bool dummy)
 Constructs an empty Cell (for internal use only). More...
 
 Cell (string content)
 Constructs a Cell with a certain content. More...
 
 Cell (IElement element)
 Constructs a Cell with a certain Element. More...
 
override bool Process (IElementListener listener)
 Processes the element by adding it (or the different parts) to an IElementListener. More...
 
void AddElement (IElement element)
 Adds an element to this Cell. More...
 
bool Add (Object o)
 Add an Object to this cell. More...
 
void SetHorizontalAlignment (string alignment)
 Sets the alignment of this cell. More...
 
void SetVerticalAlignment (string alignment)
 Sets the alignment of this paragraph. More...
 
void SetWidth (String value)
 
String GetWidthAsString ()
 
bool IsEmpty ()
 Checks if the Cell is empty. More...
 
bool IsTable ()
 Checks if the Cell is empty. More...
 
void Clear ()
 Clears all the Elements of this Cell. More...
 
float GetTop (int margin)
 This method throws an Exception. More...
 
float GetBottom (int margin)
 This method throws an Exception. More...
 
float GetLeft (int margin)
 This method throws an Exception. More...
 
float GetRight (int margin)
 This method throws an Exception. More...
 
PdfPCell CreatePdfPCell ()
 
- Public Member Functions inherited from iTextSharp.text.Rectangle
 Rectangle (float llx, float lly, float urx, float ury)
 Constructs a Rectangle-object. More...
 
 Rectangle (float urx, float ury)
 Constructs a Rectangle-object starting from the origin (0, 0). More...
 
 Rectangle (Rectangle rect)
 Constructs a Rectangle-object. More...
 
virtual void CloneNonPositionParameters (Rectangle rect)
 
virtual void SoftCloneNonPositionParameters (Rectangle rect)
 
bool IsContent ()
 
virtual bool IsNestable ()
 
virtual void Normalize ()
 
Rectangle GetRectangle (float top, float bottom)
 Gets a Rectangle that is altered to fit on the page. More...
 
Rectangle Rotate ()
 Swaps the values of urx and ury and of lly and llx in order to rotate the rectangle. More...
 
virtual void EnableBorderSide (int side)
 
virtual void DisableBorderSide (int side)
 
virtual float GetLeft (float margin)
 Returns the lower left x-coordinate, considering a given margin. More...
 
virtual float GetRight (float margin)
 Returns the upper right x-coordinate, considering a given margin. More...
 
virtual float GetTop (float margin)
 Returns the upper right y-coordinate, considering a given margin. More...
 
virtual float GetBottom (float margin)
 Returns the lower left y-coordinate, considering a given margin. More...
 
bool HasBorders ()
 Indicates if the table has borders. More...
 
bool HasBorder (int type)
 Indicates if the table has a some type of border. More...
 
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...
 

Protected Attributes

ArrayList arrayList = null
 This is the ArrayList of Elements. More...
 
int horizontalAlignment = Element.ALIGN_UNDEFINED
 summary> This is the vertical Element. More...
 
int verticalAlignment = Element.ALIGN_UNDEFINED
 summary> This is the vertical Element. More...
 
float width
 
bool percentage = false
 summary> This is the colspan. More...
 
int colspan = 1
 summary> This is the rowspan. More...
 
int rowspan = 1
 summary> This is the leading. More...
 
bool header
 
bool useAscender = false
 Indicates that the largest ascender height should be used to determine the height of the first line. Note that this only has an effect when rendered to PDF. Setting this to true can help with vertical alignment problems. More...
 
bool useDescender = false
 Indicates that the largest descender height should be added to the height of the last line (so characters like y don't dip into the border). Note that this only has an effect when rendered to PDF. More...
 
bool useBorderPadding
 Adjusts the cell contents to compensate for border widths. Note that this only has an effect when rendered to PDF. More...
 
bool noWrap
 
bool groupChange = true
 
int maxLines = int.MaxValue
 Maximum number of lines allowed in the cell.
The default value of this property is not to limit the maximum number of lines (contributed by dpere.nosp@m.zcar.nosp@m.@fcc..nosp@m.es) More...
 
- Protected Attributes inherited from iTextSharp.text.Rectangle
float llx
 the lower left x-coordinate. More...
 
float lly
 summary> the upper right x-coordinate. More...
 
float urx
 summary> the upper right y-coordinate. More...
 
float ury
 summary> This represents the status of the 4 sides of the rectangle. More...
 
int border = UNDEFINED
 summary> This is the width of the border around this rectangle. More...
 
float borderWidth = UNDEFINED
 summary> This is the color of the border of this rectangle. More...
 
Color borderColor = null
 
Color borderColorLeft = null
 
Color borderColorRight = null
 
Color borderColorTop = null
 
Color borderColorBottom = null
 
float borderWidthLeft = UNDEFINED
 
float borderWidthRight = UNDEFINED
 
float borderWidthTop = UNDEFINED
 
float borderWidthBottom = UNDEFINED
 
bool useVariableBorders = false
 summary> This is the color of the background of this rectangle. More...
 
Color backgroundColor = null
 summary> This is the rotation value of this rectangle. More...
 
int rotation = 0
 

Properties

static Cell DummyCell [get]
 
override int Type [get]
 Gets the type of the text element. More...
 
override ArrayList Chunks [get]
 Gets all the chunks in this element. More...
 
override float Width [get, set]
 Sets the width. More...
 
int Size [get]
 Gets the number of Elements in the Cell. More...
 
ArrayList Elements [get]
 Gets Elements. More...
 
int HorizontalAlignment [get, set]
 Gets/Sets the horizontal Element. More...
 
int VerticalAlignment [get, set]
 Gets/sets the vertical Element. More...
 
int Colspan [get, set]
 Gets/sets the colspan. More...
 
int Rowspan [get, set]
 Gets/sets the rowspan. More...
 
float Leading [get, set]
 Gets/sets the leading. More...
 
bool Header [get, set]
 Gets/sets header More...
 
bool NoWrap [get, set]
 Get/set nowrap. More...
 
override float Top [get, set]
 This property throws an Exception. More...
 
override float Bottom [get, set]
 This property throws an Exception. More...
 
override float Left [get, set]
 This property throws an Exception. More...
 
override float Right [get, set]
 This property throws an Exception. More...
 
bool GroupChange [get, set]
 Does this More...
 
int MaxLines [get, set]
 get/set maxLines value More...
 
string ShowTruncation [get, set]
 get/set showTruncation value More...
 
bool UseAscender [get, set]
 get/set useAscender value More...
 
bool UseDescender [get, set]
 get/set useDescender value More...
 
bool UseBorderPadding [get, set]
 get/set useBorderPadding value More...
 
- Properties inherited from iTextSharp.text.Rectangle
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 Top [get, set]
 Get/set the upper right y-coordinate. More...
 
virtual int Border [get, set]
 Get/set the border More...
 
virtual float GrayFill [get, set]
 Get/set the grayscale of the rectangle. More...
 
virtual float Left [get, set]
 Get/set the lower left x-coordinate. More...
 
virtual float Right [get, set]
 Get/set the upper right x-coordinate. More...
 
virtual float Bottom [get, set]
 Get/set the lower left y-coordinate. More...
 
virtual Color BorderColorBottom [get, set]
 
virtual Color BorderColorTop [get, set]
 
virtual Color BorderColorLeft [get, set]
 
virtual Color BorderColorRight [get, set]
 
virtual float Width [get, set]
 Returns the width of the rectangle. More...
 
float Height [get]
 Returns the height of the rectangle. More...
 
virtual float BorderWidth [get, set]
 Get/set the borderwidth. More...
 
virtual Color BorderColor [get, set]
 Get/set the color of the border. More...
 
virtual Color BackgroundColor [get, set]
 Get/set the backgroundcolor. More...
 
int Rotation [get]
 Returns the rotation More...
 
virtual float BorderWidthLeft [get, set]
 
virtual float BorderWidthRight [get, set]
 
virtual float BorderWidthTop [get, set]
 
virtual float BorderWidthBottom [get, set]
 
virtual bool UseVariableBorders [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...
 

Additional Inherited Members

- Static Public Attributes inherited from iTextSharp.text.Rectangle
const int UNDEFINED = -1
 This is the value that will be used as undefined. More...
 
const int TOP_BORDER = 1
 summary> This represents one side of the border of the Rectangle. More...
 
const int BOTTOM_BORDER = 2
 summary> This represents one side of the border of the Rectangle. More...
 
const int LEFT_BORDER = 4
 summary> This represents one side of the border of the Rectangle. More...
 
const int RIGHT_BORDER = 8
 summary> This represents a rectangle without borders. More...
 
const int NO_BORDER = 0
 summary> This represents a type of border. More...
 
const int BOX = TOP_BORDER + BOTTOM_BORDER + LEFT_BORDER + RIGHT_BORDER
 
- Static Public Attributes inherited from iTextSharp.text.Element
const int HEADER = 0
 This is a possible type of Element. More...
 
const int TITLE = 1
 This is a possible type of Element. More...
 
const int SUBJECT = 2
 This is a possible type of Element. More...
 
const int KEYWORDS = 3
 This is a possible type of Element. More...
 
const int AUTHOR = 4
 This is a possible type of Element. More...
 
const int PRODUCER = 5
 This is a possible type of Element. More...
 
const int CREATIONDATE = 6
 This is a possible type of Element. More...
 
const int CREATOR = 7
 This is a possible type of Element. More...
 
const int CHUNK = 10
 This is a possible type of Element. More...
 
const int PHRASE = 11
 This is a possible type of Element. More...
 
const int PARAGRAPH = 12
 This is a possible type of Element. More...
 
const int SECTION = 13
 This is a possible type of Element More...
 
const int LIST = 14
 This is a possible type of Element More...
 
const int LISTITEM = 15
 This is a possible type of Element More...
 
const int CHAPTER = 16
 This is a possible type of Element More...
 
const int ANCHOR = 17
 This is a possible type of Element More...
 
const int CELL = 20
 This is a possible type of Element. More...
 
const int ROW = 21
 This is a possible type of Element. More...
 
const int TABLE = 22
 This is a possible type of Element. More...
 
const int PTABLE = 23
 This is a possible type of Element. More...
 
const int ANNOTATION = 29
 This is a possible type of Element. More...
 
const int RECTANGLE = 30
 This is a possible type of Element. More...
 
const int JPEG = 32
 This is a possible type of Element. More...
 
const int JPEG2000 = 33
 
const int IMGRAW = 34
 This is a possible type of Element. More...
 
const int IMGTEMPLATE = 35
 This is a possible type of Element. More...
 
const int JBIG2 = 36
 
const int MULTI_COLUMN_TEXT = 40
 This is a possible type of More...
 
const int MARKED = 50
 
const int YMARK = 55
 
const int ALIGN_UNDEFINED = -1
 A possible value for paragraph Element. This specifies that the text is aligned to the left indent and extra whitespace should be placed on the right. More...
 
const int ALIGN_LEFT = 0
 A possible value for paragraph Element. This specifies that the text is aligned to the left indent and extra whitespace should be placed on the right. More...
 
const int ALIGN_CENTER = 1
 A possible value for paragraph Element. This specifies that the text is aligned to the center and extra whitespace should be placed equally on the left and right. More...
 
const int ALIGN_RIGHT = 2
 A possible value for paragraph Element. This specifies that the text is aligned to the right indent and extra whitespace should be placed on the left. More...
 
const int ALIGN_JUSTIFIED = 3
 A possible value for paragraph Element. This specifies that extra whitespace should be spread out through the rows of the paragraph with the text lined up with the left and right indent except on the last line which should be aligned to the left. More...
 
const int ALIGN_TOP = 4
 A possible value for vertical Element. More...
 
const int ALIGN_MIDDLE = 5
 A possible value for vertical Element. More...
 
const int ALIGN_BOTTOM = 6
 A possible value for vertical Element. More...
 
const int ALIGN_BASELINE = 7
 A possible value for vertical Element. More...
 
const int ALIGN_JUSTIFIED_ALL = 8
 Does the same as ALIGN_JUSTIFIED but the last line is also spread out. More...
 
const int CCITTG4 = 0x100
 Pure two-dimensional encoding (Group 4) More...
 
const int CCITTG3_1D = 0x101
 Pure one-dimensional encoding (Group 3, 1-D) More...
 
const int CCITTG3_2D = 0x102
 Mixed one- and two-dimensional encoding (Group 3, 2-D) More...
 
const int CCITT_BLACKIS1 = 1
 A flag indicating whether 1-bits are to be interpreted as black pixels and 0-bits as white pixels, More...
 
const int CCITT_ENCODEDBYTEALIGN = 2
 A flag indicating whether the filter expects extra 0-bits before each encoded line so that the line begins on a byte boundary. More...
 
const int CCITT_ENDOFLINE = 4
 A flag indicating whether end-of-line bit patterns are required to be present in the encoding. More...
 
const int CCITT_ENDOFBLOCK = 8
 A flag indicating whether the filter expects the encoded data to be terminated by an end-of-block pattern, overriding the Rows parameter. The use of this flag will set the key /EndOfBlock to false. More...
 

Detailed Description

A Cell is a Rectangle containing other Elements.

A Cell is a Rectangle containing other Elements.

A Cell must be added to a Table. The Table will place the Cell in a Row.

Table table = new Table(3);
table.SetBorderWidth(1);
table.SetBorderColor(new Color(0, 0, 255));
table.SetCellpadding(5);
table.SetCellspacing(5);
<strong>Cell cell = new Cell("header");
cell.SetHeader(true);
cell.SetColspan(3);</strong>
table.AddCell(cell);
<strong>cell = new Cell("example cell with colspan 1 and rowspan 2");
cell.SetRowspan(2);
cell.SetBorderColor(new Color(255, 0, 0));</strong>
table.AddCell(cell);
table.AddCell("1.1");
table.AddCell("2.1");
table.AddCell("1.2");
table.AddCell("2.2");
Cell()
Constructs an empty Cell.
Definition: Cell.cs:170
See also
T:iTextSharp.text.Rectangle, T:iTextSharp.text.Element, T:iTextSharp.text.Table, T:iTextSharp.text.Row

Constructor & Destructor Documentation

◆ Cell() [1/4]

iTextSharp.text.Cell.Cell ( )

Constructs an empty Cell.

Constructs an empty Cell.

<overloads> Has five overloads. </overloads>

◆ Cell() [2/4]

iTextSharp.text.Cell.Cell ( bool  dummy)

Constructs an empty Cell (for internal use only).

Parameters
dummya dummy value

◆ Cell() [3/4]

iTextSharp.text.Cell.Cell ( string  content)

Constructs a Cell with a certain content.

The string will be converted into a Paragraph.

Parameters
contenta string

◆ Cell() [4/4]

iTextSharp.text.Cell.Cell ( IElement  element)

Constructs a Cell with a certain Element.

if the element is a ListItem, Row or Cell, an exception will be thrown.

Parameters
elementthe element

Member Function Documentation

◆ Add()

bool iTextSharp.text.Cell.Add ( Object  o)

Add an Object to this cell.

Parameters
othe object to add
Returns
always true

Implements iTextSharp.text.ITextElementArray.

◆ AddElement()

void iTextSharp.text.Cell.AddElement ( IElement  element)

Adds an element to this Cell.

Adds an element to this Cell.

Remark: you can't add ListItems, Rows, Cells, JPEGs, GIFs or PNGs to a Cell.

Parameters
elementThe Element to add
Exceptions
BadElementExceptionif the method was called with a ListItem, Row or Cell

You can't add ListItems, Rows, Cells, JPEGs, GIFs or PNGs to a Cell.

Parameters
elementthe Element to add

◆ Clear()

void iTextSharp.text.Cell.Clear ( )

Clears all the Elements of this Cell.

◆ CreatePdfPCell()

PdfPCell iTextSharp.text.Cell.CreatePdfPCell ( )

Creates a PdfPCell based on this Cell object.

Returns
a PdfPCell
Exceptions
BadElementException

◆ GetBottom()

float iTextSharp.text.Cell.GetBottom ( int  margin)

This method throws an Exception.

Parameters
marginnew value
Returns
none

◆ GetLeft()

float iTextSharp.text.Cell.GetLeft ( int  margin)

This method throws an Exception.

Parameters
marginnew value
Returns
none

◆ GetRight()

float iTextSharp.text.Cell.GetRight ( int  margin)

This method throws an Exception.

Parameters
marginnew value
Returns
none

◆ GetTop()

float iTextSharp.text.Cell.GetTop ( int  margin)

This method throws an Exception.

Parameters
marginnew value
Returns
none

◆ GetWidthAsString()

String iTextSharp.text.Cell.GetWidthAsString ( )

Gets the width as a String.

Returns
a value

◆ IsEmpty()

bool iTextSharp.text.Cell.IsEmpty ( )

Checks if the Cell is empty.

Returns
false if there are non-empty Elements in the Cell.

◆ IsTable()

bool iTextSharp.text.Cell.IsTable ( )

Checks if the Cell is empty.

Returns
false if there are non-empty Elements in the Cell.

◆ IsTag()

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

Checks if a given tag corresponds with this object.

Parameters
tagthe given tag
Returns
true if the tag corresponds

summary>Does this

Cell</CODE> force a group change?
</summary>
a
Definition: glyphlist.txt:744

◆ Process()

override bool iTextSharp.text.Cell.Process ( IElementListener  listener)
virtual

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

Parameters
listeneran IElementListener
Returns
true if the element was processed successfully

Reimplemented from iTextSharp.text.Rectangle.

◆ SetHorizontalAlignment()

void iTextSharp.text.Cell.SetHorizontalAlignment ( string  alignment)

Sets the alignment of this cell.

Parameters
alignmentthe new alignment as a string

◆ SetVerticalAlignment()

void iTextSharp.text.Cell.SetVerticalAlignment ( string  alignment)

Sets the alignment of this paragraph.

Parameters
alignmentthe new alignment as a string

◆ SetWidth()

void iTextSharp.text.Cell.SetWidth ( String  value)

Sets the width. It can be an absolute value "100" or a percentage "20%"

Parameters
valuethe new value

Member Data Documentation

◆ arrayList

ArrayList iTextSharp.text.Cell.arrayList = null
protected

This is the ArrayList of Elements.

summary> This is the horizontal Element.

◆ colspan

int iTextSharp.text.Cell.colspan = 1
protected

summary> This is the rowspan.

◆ groupChange

bool iTextSharp.text.Cell.groupChange = true
protected

◆ header

bool iTextSharp.text.Cell.header
protected

◆ horizontalAlignment

int iTextSharp.text.Cell.horizontalAlignment = Element.ALIGN_UNDEFINED
protected

summary> This is the vertical Element.

◆ maxLines

int iTextSharp.text.Cell.maxLines = int.MaxValue
protected

Maximum number of lines allowed in the cell.
The default value of this property is not to limit the maximum number of lines (contributed by dpere.nosp@m.zcar.nosp@m.@fcc..nosp@m.es)

◆ noWrap

bool iTextSharp.text.Cell.noWrap
protected

◆ percentage

bool iTextSharp.text.Cell.percentage = false
protected

summary> This is the colspan.

◆ rowspan

int iTextSharp.text.Cell.rowspan = 1
protected

summary> This is the leading.

◆ useAscender

bool iTextSharp.text.Cell.useAscender = false
protected

Indicates that the largest ascender height should be used to determine the height of the first line. Note that this only has an effect when rendered to PDF. Setting this to true can help with vertical alignment problems.

◆ useBorderPadding

bool iTextSharp.text.Cell.useBorderPadding
protected

Adjusts the cell contents to compensate for border widths. Note that this only has an effect when rendered to PDF.

summary> Will the element have to be wrapped?

◆ useDescender

bool iTextSharp.text.Cell.useDescender = false
protected

Indicates that the largest descender height should be added to the height of the last line (so characters like y don't dip into the border). Note that this only has an effect when rendered to PDF.

◆ verticalAlignment

int iTextSharp.text.Cell.verticalAlignment = Element.ALIGN_UNDEFINED
protected

summary> This is the vertical Element.

◆ width

float iTextSharp.text.Cell.width
protected

Property Documentation

◆ Bottom

override float iTextSharp.text.Cell.Bottom
getset

This property throws an Exception.

none

◆ Chunks

override ArrayList iTextSharp.text.Cell.Chunks
get

Gets all the chunks in this element.

an ArrayList

◆ Colspan

int iTextSharp.text.Cell.Colspan
getset

Gets/sets the colspan.

Gets the colspan.

Returns
a value

a value

◆ DummyCell

Cell iTextSharp.text.Cell.DummyCell
staticget

◆ Elements

ArrayList iTextSharp.text.Cell.Elements
get

Gets Elements.

an ArrayList

◆ GroupChange

bool iTextSharp.text.Cell.GroupChange
getset

Does this

Cell force a group change?

◆ Header

bool iTextSharp.text.Cell.Header
getset

Gets/sets header

a value

◆ HorizontalAlignment

int iTextSharp.text.Cell.HorizontalAlignment
getset

Gets/Sets the horizontal Element.

a value

◆ Leading

float iTextSharp.text.Cell.Leading
getset

Gets/sets the leading.

a value

◆ Left

override float iTextSharp.text.Cell.Left
getset

This property throws an Exception.

none

◆ MaxLines

int iTextSharp.text.Cell.MaxLines
getset

get/set maxLines value

◆ NoWrap

bool iTextSharp.text.Cell.NoWrap
getset

Get/set nowrap.

Get nowrap.

Returns
a value

a value

◆ Right

override float iTextSharp.text.Cell.Right
getset

This property throws an Exception.

none

◆ Rowspan

int iTextSharp.text.Cell.Rowspan
getset

Gets/sets the rowspan.

a value

◆ ShowTruncation

string iTextSharp.text.Cell.ShowTruncation
getset

get/set showTruncation value

◆ Size

int iTextSharp.text.Cell.Size
get

Gets the number of Elements in the Cell.

a size

◆ Top

override float iTextSharp.text.Cell.Top
getset

This property throws an Exception.

none

◆ Type

override int iTextSharp.text.Cell.Type
get

Gets the type of the text element.

a type

◆ UseAscender

bool iTextSharp.text.Cell.UseAscender
getset

get/set useAscender value

◆ UseBorderPadding

bool iTextSharp.text.Cell.UseBorderPadding
getset

get/set useBorderPadding value

◆ UseDescender

bool iTextSharp.text.Cell.UseDescender
getset

get/set useDescender value

◆ VerticalAlignment

int iTextSharp.text.Cell.VerticalAlignment
getset

Gets/sets the vertical Element.

a value

◆ Width

override float iTextSharp.text.Cell.Width
getset

Sets the width.

the new value


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