Class PdfCell
java.lang.Object
com.lowagie.text.Rectangle
com.lowagie.text.pdf.PdfCell
- All Implemented Interfaces:
Element
Deprecated.
A
PdfCell is the PDF translation of a Cell.
A PdfCell is an ArrayList of PdfLines.
When using variable borders (isUseVariableBorders() == true),
the borders are drawn completely inside the cell Rectangle so that adjacent cell borders will not overlap. Otherwise,
the borders are drawn on top of the edges of the cell Rectangle and will overlap the borders of adjacent cells.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate floatDeprecated.This is the cellpadding of the cell.private floatDeprecated.This is the cellspacing of the cell.private floatDeprecated.This is the total height of the content of the cell.private PdfLineDeprecated.private intDeprecated.This is the number of the group the cell is in.private booleanDeprecated.Indicates if this cell belongs to the header of aPdfTableDeprecated.These are the Images in the Cell.private PdfLineDeprecated.private floatDeprecated.This is the leading of the lines.private PdfLineDeprecated.These are the PdfLines in the Cell.Deprecated.These are the PdfLines in the Cell.private intDeprecated.This is the number of the row the cell is in.private intDeprecated.This is the rowspan of the cell.private booleanDeprecated.Indicates that the largest ascender height should be used to determine the height of the first line.private booleanDeprecated.Adjusts the cell contents to compensate for border widths.private booleanDeprecated.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).private intDeprecated.Fields inherited from class Rectangle
backgroundColor, border, borderColor, borderColorBottom, borderColorLeft, borderColorRight, borderColorTop, borderWidth, borderWidthBottom, borderWidthLeft, borderWidthRight, borderWidthTop, BOTTOM, BOX, LEFT, llx, lly, NO_BORDER, offsetToTop, RIGHT, rotation, TOP, UNDEFINED, urx, ury, useVariableBordersFields inherited from interface 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, FOOTNOTE, HEADER, IMGRAW, IMGTEMPLATE, JBIG2, JPEG, JPEG2000, KEYWORDS, LIST, LISTITEM, MARKED, MODIFICATIONDATE, MULTI_COLUMN_TEXT, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, ROW, SECTION, SUBJECT, TABLE, TITLE, YMARK -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate floatDeprecated.Adds an image to this Cell.private voidDeprecated.private voidDeprecated.floatDeprecated.Gets the cellpadding of a cell..floatDeprecated.Gets the cellspacing of a cell.private floatDeprecated.Calculates what the height of the first line should be so that the content will be flush with the top.private voidDeprecated.private floatgetBorderWidthInside(int side) Deprecated.Gets the amount of the border for the specified side that is inside the Rectangle.floatDeprecated.Returns the lower left y-coordinate.intDeprecated.Gets the number of the group this cell is in..getImages(float top, float bottom) Deprecated.Gets the images of a cell that can be drawn between certain limits.floatgetLeft()Deprecated.Returns the lower left x-coordinate.getLines(float top, float bottom) Deprecated.Gets the lines of a cell that can be drawn between certain limits.floatgetRight()Deprecated.Returns the upper right x-coordinate.floatgetTop()Deprecated.Returns the upper right y-coordinate.(package private) booleanisHeader()Deprecated.Checks if this cell belongs to the header of aPdfTable.booleanDeprecated.Gets the value of useAscenderbooleanDeprecated.Gets the value of useBorderPadding.booleanDeprecated.gets the value of useDescenderfloatleading()Deprecated.Gets the leading of a cell.(package private) booleanDeprecated.Checks if the cell may be removed.protected voidprocessActions(Element element, PdfAction action, List<PdfAction> allActions) Deprecated.Processes all actions contained in the cell.rectangle(float top, float bottom) Deprecated.Gets a Rectangle that is altered to fit on the page.floatDeprecated.Returns the height needed to draw the remaining text.private floatDeprecated.Returns the total height of all the lines in the cell.private PdfLineremoveLine(int index) Deprecated.intDeprecated.Gets the number of the row this cell is in..introwspan()Deprecated.Gets the rowspan of a cell.voidsetBottom(float value) Deprecated.Sets the bottom of the Rectangle and determines the proper {link #verticalOffset} to appropriately align the contents vertically.(package private) voidsetGroupNumber(int number) Deprecated.Sets the group number.(package private) voidDeprecated.Indicates that this cell belongs to the header of aPdfTable.voidsetUseAscender(boolean use) Deprecated.Sets the value of useAscender.voidsetUseBorderPadding(boolean use) Deprecated.Sets the value of useBorderPadding.voidsetUseDescender(boolean use) Deprecated.Sets the value of useDescender.intsize()Deprecated.Returns the number of lines in the cell.Methods inherited from class Rectangle
cloneNonPositionParameters, disableBorderSide, enableBorderSide, getBackgroundColor, getBorder, getBorderColor, getBorderColorBottom, getBorderColorLeft, getBorderColorRight, getBorderColorTop, getBorderWidth, getBorderWidthBottom, getBorderWidthLeft, getBorderWidthRight, getBorderWidthTop, getBottom, getChunks, getGrayFill, getHeight, getLeft, getRelativeTop, getRight, getRotation, getTop, getWidth, hasBorder, hasBorders, isContent, isNestable, isUseVariableBorders, normalize, process, rotate, setBackgroundColor, setBorder, setBorderColor, setBorderColorBottom, setBorderColorLeft, setBorderColorRight, setBorderColorTop, setBorderWidth, setBorderWidthBottom, setBorderWidthLeft, setBorderWidthRight, setBorderWidthTop, setGrayFill, setLeft, setRelativeTop, setRight, setRotation, setTop, setUseVariableBorders, softCloneNonPositionParameters, toString, type
-
Field Details
-
lines
-
line
-
images
-
leading
private float leadingDeprecated.This is the leading of the lines. -
rownumber
private int rownumberDeprecated.This is the number of the row the cell is in. -
rowspan
private int rowspanDeprecated.This is the rowspan of the cell. -
cellspacing
private float cellspacingDeprecated.This is the cellspacing of the cell. -
cellpadding
private float cellpaddingDeprecated.This is the cellpadding of the cell. -
header
private boolean headerDeprecated.Indicates if this cell belongs to the header of aPdfTable -
contentHeight
private float contentHeightDeprecated.This is the total height of the content of the cell. Note that the actual cell height may be larger due to another cell on the row * -
useAscender
private boolean useAscenderDeprecated.Indicates that the largest ascender height should be used to determine the height of the first line. Setting this to true can help with vertical alignment problems. -
useDescender
private boolean useDescenderDeprecated.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). -
useBorderPadding
private boolean useBorderPaddingDeprecated.Adjusts the cell contents to compensate for border widths. -
verticalAlignment
private int verticalAlignmentDeprecated. -
firstLine
Deprecated. -
lastLine
Deprecated. -
groupNumber
private int groupNumberDeprecated.This is the number of the group the cell is in.
-
-
Constructor Details
-
PdfCell
public PdfCell(Cell cell, int rownumber, float left, float right, float top, float cellspacing, float cellpadding) Deprecated.Constructs aPdfCell-object.- Parameters:
cell- the originalCellrownumber- the number of theRowtheCellwas in.left- the left border of thePdfCellright- the right border of thePdfCelltop- the top border of thePdfCellcellspacing- the cellspacing of theTablecellpadding- the cellpadding of theTable
-
-
Method Details
-
addList
Deprecated. -
getLeft
-
getRight
-
getTop
-
getBottom
-
setBottom
-
addLine
Deprecated. -
removeLine
Deprecated. -
flushCurrentLine
private void flushCurrentLine()Deprecated. -
firstLineRealHeight
private float firstLineRealHeight()Deprecated.Calculates what the height of the first line should be so that the content will be flush with the top. For text, this is the height of the ascender. For an image, it is the actual height of the image.- Returns:
- the real height of the first line
-
getBorderWidthInside
private float getBorderWidthInside(int side) Deprecated.Gets the amount of the border for the specified side that is inside the Rectangle. For non-variable width borders this is only 1/2 the border width on that side. This always returns 0 ifuseBorderPaddingis false;- Parameters:
side- the side to check. One of the side constants inRectangle- Returns:
- the borderwidth inside the cell
-
addImage
Deprecated.Adds an image to this Cell.- Parameters:
i- the image to addleft- the left borderright- the right borderextraHeight- extra height to add above imagealignment- horizontal alignment (constant from Element class)- Returns:
- the height of the image
-
getLines
Deprecated.Gets the lines of a cell that can be drawn between certain limits.Remark: all the lines that can be drawn are removed from the object!
- Parameters:
top- the top of the part of the table that can be drawnbottom- the bottom of the part of the table that can be drawn- Returns:
- an
ArrayListofPdfLines
-
getImages
Deprecated.Gets the images of a cell that can be drawn between certain limits.Remark: all the lines that can be drawn are removed from the object!
- Parameters:
top- the top of the part of the table that can be drawnbottom- the bottom of the part of the table that can be drawn- Returns:
- an
ArrayListofImages
-
isHeader
boolean isHeader()Deprecated.Checks if this cell belongs to the header of aPdfTable.- Returns:
void
-
setHeader
void setHeader()Deprecated.Indicates that this cell belongs to the header of aPdfTable. -
mayBeRemoved
boolean mayBeRemoved()Deprecated.Checks if the cell may be removed.Headers may always be removed, even if they are drawn only partially: they will be repeated on each following page anyway!
- Returns:
trueif all the lines are already drawn;falseotherwise.
-
size
public int size()Deprecated.Returns the number of lines in the cell.- Returns:
- a value
-
remainingLinesHeight
private float remainingLinesHeight()Deprecated.Returns the total height of all the lines in the cell.- Returns:
- a value
-
remainingHeight
public float remainingHeight()Deprecated.Returns the height needed to draw the remaining text.- Returns:
- a height
-
leading
public float leading()Deprecated.Gets the leading of a cell.- Returns:
- the leading of the lines is the cell.
-
rownumber
public int rownumber()Deprecated.Gets the number of the row this cell is in..- Returns:
- a number
-
rowspan
public int rowspan()Deprecated.Gets the rowspan of a cell.- Returns:
- the rowspan of the cell
-
cellspacing
public float cellspacing()Deprecated.Gets the cellspacing of a cell.- Returns:
- a value
-
cellpadding
public float cellpadding()Deprecated.Gets the cellpadding of a cell..- Returns:
- a value
-
processActions
-
getGroupNumber
public int getGroupNumber()Deprecated.Gets the number of the group this cell is in..- Returns:
- a number
-
setGroupNumber
void setGroupNumber(int number) Deprecated.Sets the group number.- Parameters:
number-
-
rectangle
-
isUseAscender
public boolean isUseAscender()Deprecated.Gets the value of useAscender- Returns:
- useAscender
-
setUseAscender
public void setUseAscender(boolean use) Deprecated.Sets the value of useAscender.- Parameters:
use- use ascender height if true
-
isUseDescender
public boolean isUseDescender()Deprecated.gets the value of useDescender- Returns:
- useDescender
-
setUseDescender
public void setUseDescender(boolean use) Deprecated.Sets the value of useDescender.- Parameters:
use- use descender height if true
-
isUseBorderPadding
public boolean isUseBorderPadding()Deprecated.Gets the value of useBorderPadding.- Returns:
- useBorderPadding
-
setUseBorderPadding
public void setUseBorderPadding(boolean use) Deprecated.Sets the value of useBorderPadding.- Parameters:
use- adjust layout for borders if true
-