public class PdfPCell extends Rectangle implements IAccessibleElement
Modifier and Type | Field and Description |
---|---|
protected HashMap<PdfName,PdfObject> |
accessibleAttributes |
protected ArrayList<PdfPHeaderCell> |
headers |
protected AccessibleElementId |
id |
protected Phrase |
phrase
The text in the cell.
|
protected PdfName |
role |
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
ALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_JUSTIFIED, ALIGN_JUSTIFIED_ALL, ALIGN_LEFT, ALIGN_MIDDLE, ALIGN_RIGHT, ALIGN_TOP, ALIGN_UNDEFINED, ANCHOR, ANNOTATION, AUTHOR, BODY, CCITT_BLACKIS1, CCITT_ENCODEDBYTEALIGN, CCITT_ENDOFBLOCK, CCITT_ENDOFLINE, CCITTG3_1D, CCITTG3_2D, CCITTG4, CHAPTER, CHUNK, CREATIONDATE, CREATOR, DIV, HEADER, IMGRAW, IMGTEMPLATE, JBIG2, JPEG, JPEG2000, KEYWORDS, LANGUAGE, LIST, LISTITEM, MARKED, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, SECTION, SUBJECT, TITLE, WRITABLE_DIRECT, YMARK
Constructor and Description |
---|
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(PdfPTable table, PdfPCell style)
Constructs a PdfPCell with a PdfPtable .
|
PdfPCell(Phrase phrase)
Constructs a PdfPCell with a Phrase .
|
Modifier and Type | Method and Description |
---|---|
void |
addElement(Element element)
Adds an iText element to the cell.
|
void |
addHeader(PdfPHeaderCell header) |
PdfObject |
getAccessibleAttribute(PdfName key)
Get the attribute of accessible element (everything in A dictionary + Lang , Alt , ActualText , E ).
|
HashMap<PdfName,PdfObject> |
getAccessibleAttributes()
Gets all the properties of accessible element.
|
int |
getArabicOptions()
Gets the arabic shaping options.
|
float |
getCachedMaxHeight()
Gets the height which was calculated on last call of getMaxHeight().
|
float |
getCalculatedHeight()
Get the calculated height of the cell.
|
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.
|
List<Element> |
getCompositeElements()
Returns the list of composite elements of the column.
|
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()
Get the fixed height of the cell.
|
float |
getFollowingIndent()
Gets the following paragraph lines indent.
|
ArrayList<PdfPHeaderCell> |
getHeaders() |
int |
getHorizontalAlignment()
Gets the horizontal alignment for the cell.
|
AccessibleElementId |
getId() |
Image |
getImage()
Getter for property image.
|
float |
getIndent()
Gets the first paragraph line indent.
|
float |
getLeading()
Gets the fixed leading.
|
float |
getMaxHeight()
Returns the height of the cell.
|
float |
getMinimumHeight()
Get the minimum height of the cell.
|
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.
|
PdfName |
getRole()
Gets the role of the accessible element.
|
int |
getRotation()
Gets the rotation of the cell.
|
int |
getRowspan()
Getter for property rowspan.
|
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.
|
PdfPTable |
getTable()
Getter for property table.
|
int |
getVerticalAlignment()
Gets the vertical alignment for the cell.
|
boolean |
hasCachedMaxHeight() |
boolean |
hasCalculatedHeight()
Tells you whether the height was calculated.
|
boolean |
hasFixedHeight()
Tells you whether the cell has a fixed height.
|
boolean |
hasMinimumHeight()
Tells you whether the cell has a minimum height.
|
boolean |
isInline() |
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 |
setAccessibleAttribute(PdfName key, PdfObject value)
Set the attribute of accessible element (everything in A dictionary + Lang , Alt , ActualText , E ).
|
void |
setArabicOptions(int arabicOptions)
Sets the arabic shaping options.
|
void |
setCalculatedHeight(float calculatedHeight)
Set a calculated height for the cell.
|
void |
setCellEvent(PdfPCellEvent cellEvent)
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)
Set a fixed height for the cell.
|
void |
setFollowingIndent(float indent)
Sets the following paragraph lines indent.
|
void |
setHorizontalAlignment(int horizontalAlignment)
Sets the horizontal alignment for the cell.
|
void |
setId(AccessibleElementId id) |
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)
Set a minimum height for the cell.
|
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 |
setRole(PdfName role)
Sets the role of the accessiblee element.
|
void |
setRotation(int rotation)
Sets the rotation of the cell.
|
void |
setRowspan(int rowspan)
Setter for property rowspan.
|
void |
setRunDirection(int runDirection)
Sets the run direction of the text content in the cell.
|
void |
setSpaceCharRatio(float spaceCharRatio)
Sets the ratio between the extra word spacing and the extra character spacing when the text is fully justified.
|
void |
setUseAscender(boolean useAscender)
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.
|
cloneNonPositionParameters, disableBorderSide, enableBorderSide, equals, getBackgroundColor, getBorder, getBorderColor, getBorderColorBottom, getBorderColorLeft, getBorderColorRight, getBorderColorTop, getBorderWidth, getBorderWidthBottom, getBorderWidthLeft, getBorderWidthRight, getBorderWidthTop, getBottom, getBottom, getChunks, getGrayFill, getHeight, getLeft, getLeft, getRight, getRight, getTop, getTop, getWidth, hasBorder, hasBorders, isContent, isNestable, isUseVariableBorders, normalize, process, rectangle, rotate, setBackgroundColor, setBorder, setBorderColor, setBorderColorBottom, setBorderColorLeft, setBorderColorRight, setBorderColorTop, setBorderWidth, setBorderWidthBottom, setBorderWidthLeft, setBorderWidthRight, setBorderWidthTop, setBottom, setGrayFill, setLeft, setRight, setTop, setUseVariableBorders, softCloneNonPositionParameters, toString, type
protected Phrase phrase
protected PdfName role
protected AccessibleElementId id
protected ArrayList<PdfPHeaderCell> headers
public PdfPCell()
PdfPCell
. The default padding is 2.
public PdfPCell(Phrase phrase)
PdfPCell
with a Phrase
. The default padding is 2.
phrase
- the text
public PdfPCell(Image image)
PdfPCell
with an Image
. The default padding is 0.
image
- the Image
public PdfPCell(Image image, boolean fit)
PdfPCell
with an Image
. The default padding is 0.25 for a border width of 0.5.
image
- the Image
fit
- true
to fit the image to the cell
public PdfPCell(PdfPTable table)
PdfPCell
with a PdfPtable
. This constructor allows nested tables. The default padding is 0.
table
- The PdfPTable
public PdfPCell(PdfPTable table, PdfPCell style)
PdfPCell
with a PdfPtable
. This constructor allows nested tables.
table
- The PdfPTable
style
- The style to apply to the cell (you could use getDefaultCell())
public PdfPCell(PdfPCell cell)
PdfPCell
.
cell
- the PdfPCell
to duplicate
public void addElement(Element element)
element
-
public Phrase getPhrase()
Phrase
from this cell.
Phrase
public void setPhrase(Phrase phrase)
Phrase
for this cell.
phrase
- the Phrase
public int getHorizontalAlignment()
public void setHorizontalAlignment(int horizontalAlignment)
Element.ALIGN_CENTER
for example.
horizontalAlignment
- The horizontal alignment
public int getVerticalAlignment()
public void setVerticalAlignment(int verticalAlignment)
Element.ALIGN_MIDDLE
for example.
verticalAlignment
- The vertical alignment
public float getEffectivePaddingLeft()
isUseBorderPadding()
is true.
public float getPaddingLeft()
public void setPaddingLeft(float paddingLeft)
paddingLeft
- New value of property paddingLeft.
public float getEffectivePaddingRight()
isUseBorderPadding()
is true.
public float getPaddingRight()
public void setPaddingRight(float paddingRight)
paddingRight
- New value of property paddingRight.
public float getEffectivePaddingTop()
isUseBorderPadding()
is true.
public float getPaddingTop()
public void setPaddingTop(float paddingTop)
paddingTop
- New value of property paddingTop.
public float getEffectivePaddingBottom()
isUseBorderPadding()
is true.
public float getPaddingBottom()
public void setPaddingBottom(float paddingBottom)
paddingBottom
- New value of property paddingBottom.
public void setPadding(float padding)
padding
-
public boolean isUseBorderPadding()
public void setUseBorderPadding(boolean use)
use
- adjust effective padding if true
public void setLeading(float fixedLeading, float multipliedLeading)
fixedLeading
- the fixed leading
multipliedLeading
- the variable leading
public float getLeading()
public float getMultipliedLeading()
public void setIndent(float indent)
indent
- the indent
public float getIndent()
public float getExtraParagraphSpace()
public void setExtraParagraphSpace(float extraParagraphSpace)
extraParagraphSpace
- the extra space between paragraphs
public void setCalculatedHeight(float calculatedHeight)
calculatedHeight
- New value of property calculatedHeight.
public float getCalculatedHeight()
public boolean hasCalculatedHeight()
public void setFixedHeight(float fixedHeight)
fixedHeight
- New value of property fixedHeight.
public float getFixedHeight()
public boolean hasFixedHeight()
public float getCachedMaxHeight()
public boolean hasCachedMaxHeight()
public void setMinimumHeight(float minimumHeight)
minimumHeight
- New value of property minimumHeight.
public float getMinimumHeight()
public boolean hasMinimumHeight()
public boolean isNoWrap()
public void setNoWrap(boolean noWrap)
noWrap
- New value of property noWrap.
public PdfPTable getTable()
public int getColspan()
public void setColspan(int colspan)
colspan
- New value of property colspan.
public int getRowspan()
public void setRowspan(int rowspan)
rowspan
- New value of property rowspan.
public void setFollowingIndent(float indent)
indent
- the indent
public float getFollowingIndent()
public void setRightIndent(float indent)
indent
- the indent
public float getRightIndent()
public float getSpaceCharRatio()
public void setSpaceCharRatio(float spaceCharRatio)
spaceCharRatio
times more than extra character spacing. If the ratio is PdfWriter.NO_SPACE_CHAR_RATIO
then the extra character spacing will be zero.
spaceCharRatio
- the ratio between the extra word spacing and the extra character spacing
public void setRunDirection(int runDirection)
runDirection
-
public int getRunDirection()
public Image getImage()
public void setImage(Image image)
image
- New value of property image.
public PdfPCellEvent getCellEvent()
public void setCellEvent(PdfPCellEvent cellEvent)
cellEvent
- the cell event
public int getArabicOptions()
public void setArabicOptions(int arabicOptions)
arabicOptions
- the arabic shaping options
public boolean isUseAscender()
public void setUseAscender(boolean useAscender)
useAscender
- adjust height if true
public boolean isUseDescender()
public void setUseDescender(boolean useDescender)
useDescender
- New value of property useDescender.
public ColumnText getColumn()
public List<Element> getCompositeElements()
public void setColumn(ColumnText column)
column
-
public int getRotation()
getRotation
in class Rectangle
public void setRotation(int rotation)
setRotation
in class Rectangle
rotation
- the rotation of the cell
public float getMaxHeight()
public PdfObject getAccessibleAttribute(PdfName key)
IAccessibleElement
A
dictionary + Lang
, Alt
, ActualText
, E
).
getAccessibleAttribute
in interface IAccessibleElement
public void setAccessibleAttribute(PdfName key, PdfObject value)
IAccessibleElement
A
dictionary + Lang
, Alt
, ActualText
, E
).
setAccessibleAttribute
in interface IAccessibleElement
public HashMap<PdfName,PdfObject> getAccessibleAttributes()
IAccessibleElement
getAccessibleAttributes
in interface IAccessibleElement
public PdfName getRole()
IAccessibleElement
getRole
in interface IAccessibleElement
public void setRole(PdfName role)
IAccessibleElement
null
if you don't want to tag this element. Note that all child elements won't also be tagged.
setRole
in interface IAccessibleElement
public AccessibleElementId getId()
getId
in interface IAccessibleElement
public void setId(AccessibleElementId id)
setId
in interface IAccessibleElement
public boolean isInline()
isInline
in interface IAccessibleElement
public void addHeader(PdfPHeaderCell header)
public ArrayList<PdfPHeaderCell> getHeaders()
Copyright © 1998–2018. All rights reserved.