Table of Contents

Class PdfPCell

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

A cell in a PdfPTable.

public class PdfPCell : Rectangle, IElement
Inheritance
PdfPCell
Implements
Inherited Members

Constructors

PdfPCell()

Constructs an empty PdfPCell . The default padding is 2.

public PdfPCell()

PdfPCell(Image)

Constructs a PdfPCell with an Image . The default padding is 0.

public PdfPCell(Image image)

Parameters

image Image

the Image

PdfPCell(Image, bool)

Constructs a PdfPCell with an Image . The default padding is 0.25 for a border width of 0.5.

public PdfPCell(Image image, bool fit)

Parameters

image Image

the Image

fit bool

true to fit the image to the cell

PdfPCell(Phrase)

Constructs a PdfPCell with a Phrase . The default padding is 2.

public PdfPCell(Phrase phrase)

Parameters

phrase Phrase

the text

PdfPCell(PdfPCell)

Constructs a deep copy of a PdfPCell .

public PdfPCell(PdfPCell cell)

Parameters

cell PdfPCell

the PdfPCell to duplicate

PdfPCell(PdfPTable)

Constructs a PdfPCell with a PdfPtable . This constructor allows nested tables. The default padding is 0.

public PdfPCell(PdfPTable table)

Parameters

table PdfPTable

The PdfPTable

PdfPCell(PdfPTable, PdfPCell)

Constructs a PdfPCell with a PdfPtable . This constructor allows nested tables. @since 2.1.0

public PdfPCell(PdfPTable table, PdfPCell style)

Parameters

table PdfPTable

The PdfPTable

style PdfPCell

The style to apply to the cell (you could use getDefaultCell())

Fields

phrase

The text in the cell.

protected Phrase phrase

Field Value

Phrase

Properties

ArabicOptions

Gets the arabic shaping options.

public int ArabicOptions { get; set; }

Property Value

int

the arabic shaping options

CellEvent

Gets the cell event for this cell.

public IPdfPCellEvent CellEvent { get; set; }

Property Value

IPdfPCellEvent

the cell event

Colspan

Getter for property colspan.

public int Colspan { get; set; }

Property Value

int

Value of property colspan.

Column

Gets the ColumnText with the content of the cell.

public ColumnText Column { get; set; }

Property Value

ColumnText

a columntext object

CompositeElements

Returns the list of composite elements of the column. @since 2.1.1

public IList<IElement> CompositeElements { get; }

Property Value

IList<IElement>

a List object.

EffectivePaddingBottom

/** Gets the effective bottom padding. This will include the bottom border width if {@link #UseBorderPadding} is true.

public float EffectivePaddingBottom { get; }

Property Value

float

effective value of property paddingBottom.

EffectivePaddingLeft

Gets the effective left padding. This will include the left border width if {@link #UseBorderPadding} is true.

public float EffectivePaddingLeft { get; }

Property Value

float

effective value of property paddingLeft.

EffectivePaddingRight

Gets the effective right padding. This will include the right border width if {@link #UseBorderPadding} is true.

public float EffectivePaddingRight { get; }

Property Value

float

effective value of property paddingRight.

EffectivePaddingTop

Gets the effective top padding. This will include the top border width if {@link #isUseBorderPadding()} is true.

public float EffectivePaddingTop { get; }

Property Value

float

effective value of property paddingTop.

ExtraParagraphSpace

Gets the extra space between paragraphs.

public float ExtraParagraphSpace { get; set; }

Property Value

float

the extra space between paragraphs

FixedHeight

Getter for property fixedHeight.

public float FixedHeight { get; set; }

Property Value

float

Value of property fixedHeight.

FollowingIndent

Gets the following paragraph lines indent.

public float FollowingIndent { get; set; }

Property Value

float

the indent

HorizontalAlignment

Gets the horizontal alignment for the cell.

public int HorizontalAlignment { get; set; }

Property Value

int

the horizontal alignment for the cell

Image

Getter for property image.

public Image Image { get; set; }

Property Value

Image

Value of property image.

Indent

Gets the first paragraph line indent.

public float Indent { get; set; }

Property Value

float

the indent

Leading

Gets the fixed leading

public float Leading { get; }

Property Value

float

the leading

MinimumHeight

Getter for property minimumHeight.

public float MinimumHeight { get; set; }

Property Value

float

Value of property minimumHeight.

MultipliedLeading

Gets the variable leading

public float MultipliedLeading { get; }

Property Value

float

the leading

NoWrap

Setter for property noWrap.

public bool NoWrap { get; set; }

Property Value

bool

Padding

Sets the padding of the contents in the cell (space between content and border).

public float Padding { set; }

Property Value

float

PaddingBottom

Getter for property paddingBottom.

public float PaddingBottom { get; set; }

Property Value

float

Value of property paddingBottom.

PaddingLeft

public float PaddingLeft { get; set; }

Property Value

float

Value of property paddingLeft.

PaddingRight

Getter for property paddingRight.

public float PaddingRight { get; set; }

Property Value

float

Value of property paddingRight.

PaddingTop

Getter for property paddingTop.

public float PaddingTop { get; set; }

Property Value

float

Value of property paddingTop.

Phrase

Gets the Phrase from this cell.

public Phrase Phrase { get; set; }

Property Value

Phrase

the Phrase

RightIndent

Gets the right paragraph lines indent.

public float RightIndent { get; set; }

Property Value

float

the indent

Rotation

Sets the rotation of the cell. Possible values are 0, 90, 180 and 270.

public int Rotation { get; set; }

Property Value

int

Rowspan

Getter for property rowspan.

public int Rowspan { get; set; }

Property Value

int

Value of property rowspan.

RunDirection

Gets the run direction of the text content in the cell

public int RunDirection { get; set; }

Property Value

int

One of the following values: PdfWriter.RUN_DIRECTION_DEFAULT, PdfWriter.RUN_DIRECTION_NO_BIDI, PdfWriter.RUN_DIRECTION_LTR or PdfWriter.RUN_DIRECTION_RTL.

SpaceCharRatio

Gets the space/character extra spacing ratio for fully justified text.

public float SpaceCharRatio { get; set; }

Property Value

float

the space/character extra spacing ratio

Table

Getter for property table.

public PdfPTable Table { get; set; }

Property Value

PdfPTable

Value of property table.

UseAscender

Gets state of first line height based on max ascender

public bool UseAscender { get; set; }

Property Value

bool

true if an ascender is to be used.

UseBorderPadding

Adjusts effective padding to include border widths.

public bool UseBorderPadding { get; set; }

Property Value

bool

UseDescender

Getter for property useDescender.

public bool UseDescender { get; set; }

Property Value

bool

Value of property useDescender.

VerticalAlignment

Gets the vertical alignment for the cell.

public int VerticalAlignment { get; set; }

Property Value

int

the vertical alignment for the cell

Methods

AddElement(IElement)

Adds an iText element to the cell.

public void AddElement(IElement element)

Parameters

element IElement

GetMaxHeight()

Returns the height of the cell. @since 3.0.0

public float GetMaxHeight()

Returns

float

the height of the cell

HasFixedHeight()

Tells you whether the cell has a fixed height. @since 2.1.5

public bool HasFixedHeight()

Returns

bool

true is a fixed height was set.

HasMinimumHeight()

Tells you whether the cell has a minimum height. @since 2.1.5

public bool HasMinimumHeight()

Returns

bool

true if a minimum height was set.

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