Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.lowagie.text.pdf
Class PdfPCell

    java.lang.Object
      com.lowagie.text.Rectangle
          com.lowagie.text.pdf.PdfPCell

All Implemented Interfaces:
  Element

    public class PdfPCell

extends Rectangle

A cell in a PdfPTable.

Field Summary
`private PdfPCellEvent` | `cellEvent` Holds value of property cellEvent.
`private int` | `colspan` Holds value of property colspan.
`private ColumnText` | `column`
`private float` | `fixedHeight` Holds value of property fixedHeight.
`private Image` | `image` Holds value of property image.
`private float` | `minimumHeight` Holds value of property minimumHeight.
`private boolean` | `noWrap` Holds value of property noWrap.
`private float` | `paddingBottom` Holds value of property paddingBottom.
`private float` | `paddingLeft` Holds value of property paddingLeft.
`private float` | `paddingRight` Holds value of property paddingLeft.
`private float` | `paddingTop` Holds value of property paddingTop.
`protected Phrase` | `phrase` The text in the cell.
`private int` | `rotation` The rotation of the cell.
`private PdfPTable` | `table` Holds value of property table.
`private boolean` | `useBorderPadding` Increases padding to include border if true
`private boolean` | `useDescender` Holds value of property useDescender.
`private int` | `verticalAlignment` Holds value of property verticalAlignment.

Fields inherited from class com.lowagie.text.Rectangle
`backgroundColor, border, borderColor, borderColorBottom, borderColorLeft, borderColorRight, borderColorTop, borderWidth, borderWidthBottom, borderWidthLeft, borderWidthRight, borderWidthTop, BOTTOM, BOX, LEFT, llx, lly, NO_BORDER, RIGHT, TOP, UNDEFINED, urx, ury, useVariableBorders`

Fields inherited from interface com.lowagie.text.Element
`ALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_JUSTIFIED, ALIGN_JUSTIFIED_ALL, ALIGN_LEFT, ALIGN_MIDDLE, ALIGN_RIGHT, ALIGN_TOP, ALIGN_UNDEFINED, ANCHOR, ANNOTATION, AUTHOR, CCITT_BLACKIS1, CCITT_ENCODEDBYTEALIGN, CCITT_ENDOFBLOCK, CCITT_ENDOFLINE, CCITTG3_1D, CCITTG3_2D, CCITTG4, CELL, CHAPTER, CHUNK, CREATIONDATE, CREATOR, HEADER, IMGRAW, IMGTEMPLATE, JPEG, JPEG2000, KEYWORDS, LIST, LISTITEM, MARKED, MULTI_COLUMN_TEXT, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, ROW, SECTION, SUBJECT, TABLE, TITLE`

Constructor Summary
`PdfPCell()` Constructs an empty `PdfPCell`.
`PdfPCell(Image image)` Constructs a `PdfPCell` with an `Image`.
`PdfPCell(Image image, boolean fit)` Constructs a `PdfPCell` with an `Image`.
`PdfPCell(PdfPCell cell)` Constructs a deep copy of a `PdfPCell`.
`PdfPCell(PdfPTable table)` Constructs a `PdfPCell` with a `PdfPtable`.
`PdfPCell(Phrase phrase)` Constructs a `PdfPCell` with a `Phrase`.

Method Summary
`void` | `addElement(Element element)` Adds an iText element to the cell.
`int` | `getArabicOptions()` Gets the arabic shaping options.
`PdfPCellEvent` | `getCellEvent()` Gets the cell event for this cell.
`int` | `getColspan()` Getter for property colspan.
`ColumnText` | `getColumn()` Gets the ColumnText with the content of the cell.
`float` | `getEffectivePaddingBottom()` Gets the effective bottom padding.
`float` | `getEffectivePaddingLeft()` Gets the effective left padding.
`float` | `getEffectivePaddingRight()` Gets the effective right padding.
`float` | `getEffectivePaddingTop()` Gets the effective top padding.
`float` | `getExtraParagraphSpace()` Gets the extra space between paragraphs.
`float` | `getFixedHeight()` Getter for property fixedHeight.
`float` | `getFollowingIndent()` Gets the following paragraph lines indent.
`int` | `getHorizontalAlignment()` Gets the horizontal alignment for the cell.
`Image` | `getImage()` Getter for property image.
`float` | `getIndent()` Gets the first paragraph line indent.
`float` | `getLeading()` Gets the fixed leading
`float` | `getMinimumHeight()` Getter for property minimumHeight.
`float` | `getMultipliedLeading()` Gets the variable leading
`float` | `getPaddingBottom()` Getter for property paddingBottom.
`float` | `getPaddingLeft()`
`float` | `getPaddingRight()` Getter for property paddingRight.
`float` | `getPaddingTop()` Getter for property paddingTop.
`Phrase` | `getPhrase()` Gets the `Phrase` from this cell.
`float` | `getRightIndent()` Gets the right paragraph lines indent.
`int` | `getRotation()` Gets the rotation of the cell.
`int` | `getRunDirection()` Gets the run direction of the text content in the cell
`float` | `getSpaceCharRatio()` Gets the space/character extra spacing ratio for fully justified text.
`(package private) PdfPTable` | `getTable()` Getter for property table.
`int` | `getVerticalAlignment()` Gets the vertical alignment for the cell.
`boolean` | `isNoWrap()` Getter for property noWrap.
`boolean` | `isUseAscender()` Gets state of first line height based on max ascender
`boolean` | `isUseBorderPadding()` If true, then effective padding will include border widths
`boolean` | `isUseDescender()` Getter for property useDescender.
`void` | `setArabicOptions(int arabicOptions)` Sets the arabic shaping options.
`void` | `setCellEvent(PdfPCellEvent event)` Sets the cell event for this cell.
`void` | `setColspan(int colspan)` Setter for property colspan.
`void` | `setColumn(ColumnText column)` Sets the columntext in the cell.
`void` | `setExtraParagraphSpace(float extraParagraphSpace)` Sets the extra space between paragraphs.
`void` | `setFixedHeight(float fixedHeight)` Setter for property fixedHeight.
`void` | `setFollowingIndent(float indent)` Sets the following paragraph lines indent.
`void` | `setHorizontalAlignment(int horizontalAlignment)` Sets the horizontal alignment for the cell.
`void` | `setImage(Image image)` Setter for property image.
`void` | `setIndent(float indent)` Sets the first paragraph line indent.
`void` | `setLeading(float fixedLeading, float multipliedLeading)` Sets the leading fixed and variable.
`void` | `setMinimumHeight(float minimumHeight)` Setter for property minimumHeight.
`void` | `setNoWrap(boolean noWrap)` Setter for property noWrap.
`void` | `setPadding(float padding)` Sets the padding of the contents in the cell (space between content and border).
`void` | `setPaddingBottom(float paddingBottom)` Setter for property paddingBottom.
`void` | `setPaddingLeft(float paddingLeft)` Setter for property paddingLeft.
`void` | `setPaddingRight(float paddingRight)` Setter for property paddingRight.
`void` | `setPaddingTop(float paddingTop)` Setter for property paddingTop.
`void` | `setPhrase(Phrase phrase)` Sets the `Phrase` for this cell.
`void` | `setRightIndent(float indent)` Sets the right paragraph lines indent.
`void` | `setRotation(int rotation)` Sets the rotation of the cell.
`void` | `setRunDirection(int runDirection)` Sets the run direction of the text content in the cell (PdfWriter.RUN_DIRECTION_DEFAULT, PdfWriter.RUN_DIRECTION_NO_BIDI, PdfWriter.RUN_DIRECTION_LTR or PdfWriter.RUN_DIRECTION_RTL).
`void` | `setSpaceCharRatio(float spaceCharRatio)` Sets the ratio between the extra word spacing and the extra character spacing when the text is fully justified.
`(package private) void` | `setTable(PdfPTable table)`
`void` | `setUseAscender(boolean use)` Enables/ Disables adjustment of first line height based on max ascender.
`void` | `setUseBorderPadding(boolean use)` Adjusts effective padding to include border widths.
`void` | `setUseDescender(boolean useDescender)` Setter for property useDescender.
`void` | `setVerticalAlignment(int verticalAlignment)` Sets the vertical alignment for the cell.

Methods inherited from class com.lowagie.text.Rectangle
`backgroundColor, border, borderColor, borderWidth, bottom, bottom, cloneNonPositionParameters, disableBorderSide, enableBorderSide, getBackgroundColor, getBorder, getBorderColor, getBorderColorBottom, getBorderColorLeft, getBorderColorRight, getBorderColorTop, getBorderWidth, getBorderWidthBottom, getBorderWidthLeft, getBorderWidthRight, getBorderWidthTop, getBottom, getBottom, getChunks, getGrayFill, getHeight, getLeft, getLeft, getRight, getRight, getTop, getTop, getWidth, grayFill, hasBorder, hasBorders, height, isUseVariableBorders, left, left, normalize, process, rectangle, right, right, rotate, setBackgroundColor, setBorder, setBorderColor, setBorderColorBottom, setBorderColorLeft, setBorderColorRight, setBorderColorTop, setBorderWidth, setBorderWidthBottom, setBorderWidthLeft, setBorderWidthRight, setBorderWidthTop, setBottom, setGrayFill, setLeft, setRight, setTop, setUseVariableBorders, softCloneNonPositionParameters, top, top, toString, type, width`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### column

    private ColumnText column

### verticalAlignment

    private int verticalAlignment

  Holds value of property verticalAlignment.

### paddingLeft

    private float paddingLeft

  Holds value of property paddingLeft.

### paddingRight

    private float paddingRight

  Holds value of property paddingLeft.

### paddingTop

    private float paddingTop

  Holds value of property paddingTop.

### paddingBottom

    private float paddingBottom

  Holds value of property paddingBottom.

### fixedHeight

    private float fixedHeight

  Holds value of property fixedHeight.

### noWrap

    private boolean noWrap

  Holds value of property noWrap.

### table

    private PdfPTable table

  Holds value of property table.

### minimumHeight

    private float minimumHeight

  Holds value of property minimumHeight.

### colspan

    private int colspan

  Holds value of property colspan.

### image

    private Image image

  Holds value of property image.

### cellEvent

    private PdfPCellEvent cellEvent

  Holds value of property cellEvent.

### useDescender

    private boolean useDescender

  Holds value of property useDescender.

### useBorderPadding

    private boolean useBorderPadding

  Increases padding to include border if true

### phrase

    protected Phrase phrase

  The text in the cell.

### rotation

    private int rotation

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

Constructor Detail

### PdfPCell

    public PdfPCell()

  Constructs an empty `PdfPCell`. The default padding is 2.

### PdfPCell

    public PdfPCell(Phrase phrase)

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

  Parameters:
    `phrase` - the text

### PdfPCell

    public PdfPCell(Image image)

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

  Parameters:
    `image` - the `Image`

### PdfPCell

    public PdfPCell(Image image,
                    boolean fit)

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

  Parameters:
    `image` - the `Image`
    `fit` - `true` to fit the image to the cell

### PdfPCell

    public PdfPCell(PdfPTable table)

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

  Parameters:
    `table` - The `PdfPTable`

### PdfPCell

    public PdfPCell(PdfPCell cell)

  Constructs a deep copy of a `PdfPCell`.

  Parameters:
    `cell` - the `PdfPCell` to duplicate

Method Detail

### addElement

    public void addElement(Element element)

  Adds an iText element to the cell.

  Parameters:
    `element` -

### getPhrase

    public Phrase getPhrase()

  Gets the `Phrase` from this cell.

  Returns:
    the `Phrase`

### setPhrase

    public void setPhrase(Phrase phrase)

  Sets the `Phrase` for this cell.

  Parameters:
    `phrase` - the `Phrase`

### getHorizontalAlignment

    public int getHorizontalAlignment()

  Gets the horizontal alignment for the cell.

  Returns:
    the horizontal alignment for the cell

### setHorizontalAlignment

    public void setHorizontalAlignment(int horizontalAlignment)

  Sets the horizontal alignment for the cell. It could be `Element.ALIGN_CENTER` for example.

  Parameters:
    `horizontalAlignment` - The horizontal alignment

### getVerticalAlignment

    public int getVerticalAlignment()

  Gets the vertical alignment for the cell.

  Returns:
    the vertical alignment for the cell

### setVerticalAlignment

    public void setVerticalAlignment(int verticalAlignment)

  Sets the vertical alignment for the cell. It could be `Element.ALIGN_MIDDLE` for example.

  Parameters:
    `verticalAlignment` - The vertical alignment

### getEffectivePaddingLeft

    public float getEffectivePaddingLeft()

  Gets the effective left padding. This will include the left border width if `isUseBorderPadding()` is true.

  Returns:
    effective value of property paddingLeft.

### getPaddingLeft

    public float getPaddingLeft()

  Returns:
    Value of property paddingLeft.

### setPaddingLeft

    public void setPaddingLeft(float paddingLeft)

  Setter for property paddingLeft.

  Parameters:
    `paddingLeft` - New value of property paddingLeft.

### getEffectivePaddingRight

    public float getEffectivePaddingRight()

  Gets the effective right padding. This will include the right border width if `isUseBorderPadding()` is true.

  Returns:
    effective value of property paddingRight.

### getPaddingRight

    public float getPaddingRight()

  Getter for property paddingRight.

  Returns:
    Value of property paddingRight.

### setPaddingRight

    public void setPaddingRight(float paddingRight)

  Setter for property paddingRight.

  Parameters:
    `paddingRight` - New value of property paddingRight.

### getEffectivePaddingTop

    public float getEffectivePaddingTop()

  Gets the effective top padding. This will include the top border width if `isUseBorderPadding()` is true.

  Returns:
    effective value of property paddingTop.

### getPaddingTop

    public float getPaddingTop()

  Getter for property paddingTop.

  Returns:
    Value of property paddingTop.

### setPaddingTop

    public void setPaddingTop(float paddingTop)

  Setter for property paddingTop.

  Parameters:
    `paddingTop` - New value of property paddingTop.

### getEffectivePaddingBottom

    public float getEffectivePaddingBottom()

  Gets the effective bottom padding. This will include the bottom border width if `isUseBorderPadding()` is true.

  Returns:
    effective value of property paddingBottom.

### getPaddingBottom

    public float getPaddingBottom()

  Getter for property paddingBottom.

  Returns:
    Value of property paddingBottom.

### setPaddingBottom

    public void setPaddingBottom(float paddingBottom)

  Setter for property paddingBottom.

  Parameters:
    `paddingBottom` - New value of property paddingBottom.

### setPadding

    public void setPadding(float padding)

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

  Parameters:
    `padding` -

### isUseBorderPadding

    public boolean isUseBorderPadding()

  If true, then effective padding will include border widths

  Returns:
    true if effective padding includes border widths

### setUseBorderPadding

    public void setUseBorderPadding(boolean use)

  Adjusts effective padding to include border widths.

  Parameters:
    `use` - adjust effective padding if true

### setLeading

    public void setLeading(float fixedLeading,
                           float multipliedLeading)

  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.

  Parameters:
    `fixedLeading` - the fixed leading
    `multipliedLeading` - the variable leading

### getLeading

    public float getLeading()

  Gets the fixed leading

  Returns:
    the leading

### getMultipliedLeading

    public float getMultipliedLeading()

  Gets the variable leading

  Returns:
    the leading

### setIndent

    public void setIndent(float indent)

  Sets the first paragraph line indent.

  Parameters:
    `indent` - the indent

### getIndent

    public float getIndent()

  Gets the first paragraph line indent.

  Returns:
    the indent

### getExtraParagraphSpace

    public float getExtraParagraphSpace()

  Gets the extra space between paragraphs.

  Returns:
    the extra space between paragraphs

### setExtraParagraphSpace

    public void setExtraParagraphSpace(float extraParagraphSpace)

  Sets the extra space between paragraphs.

  Parameters:
    `extraParagraphSpace` - the extra space between paragraphs

### getFixedHeight

    public float getFixedHeight()

  Getter for property fixedHeight.

  Returns:
    Value of property fixedHeight.

### setFixedHeight

    public void setFixedHeight(float fixedHeight)

  Setter for property fixedHeight.

  Parameters:
    `fixedHeight` - New value of property fixedHeight.

### isNoWrap

    public boolean isNoWrap()

  Getter for property noWrap.

  Returns:
    Value of property noWrap.

### setNoWrap

    public void setNoWrap(boolean noWrap)

  Setter for property noWrap.

  Parameters:
    `noWrap` - New value of property noWrap.

### getTable

    PdfPTable getTable()

  Getter for property table.

  Returns:
    Value of property table.

### setTable

    void setTable(PdfPTable table)

### getMinimumHeight

    public float getMinimumHeight()

  Getter for property minimumHeight.

  Returns:
    Value of property minimumHeight.

### setMinimumHeight

    public void setMinimumHeight(float minimumHeight)

  Setter for property minimumHeight.

  Parameters:
    `minimumHeight` - New value of property minimumHeight.

### getColspan

    public int getColspan()

  Getter for property colspan.

  Returns:
    Value of property colspan.

### setColspan

    public void setColspan(int colspan)

  Setter for property colspan.

  Parameters:
    `colspan` - New value of property colspan.

### setFollowingIndent

    public void setFollowingIndent(float indent)

  Sets the following paragraph lines indent.

  Parameters:
    `indent` - the indent

### getFollowingIndent

    public float getFollowingIndent()

  Gets the following paragraph lines indent.

  Returns:
    the indent

### setRightIndent

    public void setRightIndent(float indent)

  Sets the right paragraph lines indent.

  Parameters:
    `indent` - the indent

### getRightIndent

    public float getRightIndent()

  Gets the right paragraph lines indent.

  Returns:
    the indent

### getSpaceCharRatio

    public float getSpaceCharRatio()

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

  Returns:
    the space/character extra spacing ratio

### setSpaceCharRatio

    public void setSpaceCharRatio(float spaceCharRatio)

  Sets the ratio between the extra word spacing and the extra character spacing when the text is fully justified. Extra word spacing will grow `spaceCharRatio` times more than extra character spacing. If the ratio is `PdfWriter.NO_SPACE_CHAR_RATIO` then the extra character spacing will be zero.

  Parameters:
    `spaceCharRatio` - the ratio between the extra word spacing and the extra character spacing

### setRunDirection

    public void setRunDirection(int runDirection)

  Sets the run direction of the text content in the cell (PdfWriter.RUN_DIRECTION_DEFAULT, PdfWriter.RUN_DIRECTION_NO_BIDI, PdfWriter.RUN_DIRECTION_LTR or PdfWriter.RUN_DIRECTION_RTL).

  Parameters:
    `runDirection` -

### getRunDirection

    public int getRunDirection()

  Gets the run direction of the text content in the cell

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

### getImage

    public Image getImage()

  Getter for property image.

  Returns:
    Value of property image.

### setImage

    public void setImage(Image image)

  Setter for property image.

  Parameters:
    `image` - New value of property image.

### getCellEvent

    public PdfPCellEvent getCellEvent()

  Gets the cell event for this cell.

  Returns:
    the cell event

### setCellEvent

    public void setCellEvent(PdfPCellEvent event)

  Sets the cell event for this cell.

  Parameters:
    `event` - the cell event

### getArabicOptions

    public int getArabicOptions()

  Gets the arabic shaping options.

  Returns:
    the arabic shaping options

### setArabicOptions

    public void setArabicOptions(int arabicOptions)

  Sets the arabic shaping options. The option can be AR_NOVOWEL, AR_COMPOSEDTASHKEEL and AR_LIG.

  Parameters:
    `arabicOptions` - the arabic shaping options

### isUseAscender

    public boolean isUseAscender()

  Gets state of first line height based on max ascender

  Returns:
    true if an ascender is to be used.

### setUseAscender

    public void setUseAscender(boolean use)

  Enables/ Disables adjustment of first line height based on max ascender.

  Parameters:
    `use` - adjust height if true

### isUseDescender

    public boolean isUseDescender()

  Getter for property useDescender.

  Returns:
    Value of property useDescender.

### setUseDescender

    public void setUseDescender(boolean useDescender)

  Setter for property useDescender.

  Parameters:
    `useDescender` - New value of property useDescender.

### getColumn

    public ColumnText getColumn()

  Gets the ColumnText with the content of the cell.

  Returns:
    a columntext object

### setColumn

    public void setColumn(ColumnText column)

  Sets the columntext in the cell.

  Parameters:
    `column` -

### getRotation

    public int getRotation()

  Gets the rotation of the cell.

  Overrides:
    `getRotation` in class `Rectangle`
  Returns:
    the rotation of the cell.

### setRotation

    public void setRotation(int rotation)

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

  Parameters:
    `rotation` - the rotation of the cell

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD