| Constructor: |
public PdfPCell() {
super(0, 0, 0, 0);
borderWidth = 0.5f;
border = BOX;
column.setLeading(0, 1);
}
Constructs an empty PdfPCell.
The default padding is 2. |
public PdfPCell(Phrase phrase) {
super(0, 0, 0, 0);
borderWidth = 0.5f;
border = BOX;
column.addText(this.phrase = phrase);
column.setLeading(0, 1);
}
Constructs a PdfPCell with a Phrase.
The default padding is 2. Parameters:
phrase - the text
|
public PdfPCell(Image image) {
this(image, false);
}
Constructs a PdfPCell with an Image.
The default padding is 0. Parameters:
image - the Image
|
public PdfPCell(PdfPTable table) {
this(table, null);
}
Constructs a PdfPCell with a PdfPtable.
This constructor allows nested tables.
The default padding is 0. Parameters:
table - The PdfPTable
|
public PdfPCell(PdfPCell cell) {
super(cell.llx, cell.lly, cell.urx, cell.ury);
cloneNonPositionParameters(cell);
verticalAlignment = cell.verticalAlignment;
paddingLeft = cell.paddingLeft;
paddingRight = cell.paddingRight;
paddingTop = cell.paddingTop;
paddingBottom = cell.paddingBottom;
phrase = cell.phrase;
fixedHeight = cell.fixedHeight;
minimumHeight = cell.minimumHeight;
noWrap = cell.noWrap;
colspan = cell.colspan;
if (cell.table != null)
table = new PdfPTable(cell.table);
image = Image.getInstance(cell.image);
cellEvent = cell.cellEvent;
useDescender = cell.useDescender;
column = ColumnText.duplicate(cell.column);
useBorderPadding = cell.useBorderPadding;
rotation = cell.rotation;
}
Constructs a deep copy of a PdfPCell. Parameters:
cell - the PdfPCell to duplicate
|
public PdfPCell(Image image,
boolean fit) {
super(0, 0, 0, 0);
if (fit) {
borderWidth = 0.5f;
border = BOX;
this.image = image;
column.setLeading(0, 1);
setPadding(borderWidth / 2);
}
else {
borderWidth = 0.5f;
border = BOX;
column.addText(this.phrase = new Phrase(new Chunk(image, 0, 0)));
column.setLeading(0, 1);
setPadding(0);
}
}
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
|
public PdfPCell(PdfPTable table,
PdfPCell style) {
super(0, 0, 0, 0);
borderWidth = 0.5f;
border = BOX;
column.setLeading(0, 1);
this.table = table;
table.setWidthPercentage(100);
table.setExtendLastRow(true);
column.addElement(table);
if (style != null) {
cloneNonPositionParameters(style);
verticalAlignment = style.verticalAlignment;
paddingLeft = style.paddingLeft;
paddingRight = style.paddingRight;
paddingTop = style.paddingTop;
paddingBottom = style.paddingBottom;
colspan = style.colspan;
cellEvent = style.cellEvent;
useDescender = style.useDescender;
useBorderPadding = style.useBorderPadding;
rotation = style.rotation;
}
else {
setPadding(0);
}
}
Constructs a PdfPCell with a PdfPtable.
This constructor allows nested tables. Parameters:
table - The PdfPTable
style - The style to apply to the cell (you could use getDefaultCell())
- since:
2.1.0 -
|
| Method from com.lowagie.text.pdf.PdfPCell Detail: |
public void addElement(Element element) {
if (table != null) {
table = null;
column.setText(null);
}
column.addElement(element);
}
Adds an iText element to the cell. |
public int getArabicOptions() {
return column.getArabicOptions();
}
Gets the arabic shaping options. |
public PdfPCellEvent getCellEvent() {
return this.cellEvent;
}
Gets the cell event for this cell. |
public int getColspan() {
return colspan;
}
Getter for property colspan. |
public ColumnText getColumn() {
return column;
}
Gets the ColumnText with the content of the cell. |
public List getCompositeElements() {
return getColumn().compositeElements;
}
Returns the list of composite elements of the column. |
public float getEffectivePaddingBottom() {
return paddingBottom + (isUseBorderPadding() ? (getBorderWidthBottom()/(isUseVariableBorders()?1f:2f)) : 0);
}
Gets the effective bottom padding. This will include
the bottom border width if #isUseBorderPadding() is true. |
public float getEffectivePaddingLeft() {
return paddingLeft + (isUseBorderPadding() ? (getBorderWidthLeft()/(isUseVariableBorders()?1f:2f)) : 0);
}
Gets the effective left padding. This will include
the left border width if #isUseBorderPadding() is true. |
public float getEffectivePaddingRight() {
return paddingRight + (isUseBorderPadding() ? (getBorderWidthRight()/(isUseVariableBorders()?1f:2f)) : 0);
}
Gets the effective right padding. This will include
the right border width if #isUseBorderPadding() is true. |
public float getEffectivePaddingTop() {
return paddingTop + (isUseBorderPadding() ? (getBorderWidthTop()/(isUseVariableBorders()?1f:2f)) : 0);
}
|
public float getExtraParagraphSpace() {
return column.getExtraParagraphSpace();
}
Gets the extra space between paragraphs. |
public float getFixedHeight() {
return fixedHeight;
}
Getter for property fixedHeight. |
public float getFollowingIndent() {
return column.getFollowingIndent();
}
Gets the following paragraph lines indent. |
public int getHorizontalAlignment() {
return column.getAlignment();
}
Gets the horizontal alignment for the cell. |
public Image getImage() {
return this.image;
}
Getter for property image. |
public float getIndent() {
return column.getIndent();
}
Gets the first paragraph line indent. |
public float getLeading() {
return column.getLeading();
}
|
public float getMinimumHeight() {
return minimumHeight;
}
Getter for property minimumHeight. |
public float getMultipliedLeading() {
return column.getMultipliedLeading();
}
Gets the variable leading |
public float getPaddingBottom() {
return paddingBottom;
}
Getter for property paddingBottom. |
public float getPaddingLeft() {
return paddingLeft;
}
|
public float getPaddingRight() {
return paddingRight;
}
Getter for property paddingRight. |
public float getPaddingTop() {
return paddingTop;
}
Getter for property paddingTop. |
public Phrase getPhrase() {
return phrase;
}
Gets the Phrase from this cell. |
public float getRightIndent() {
return column.getRightIndent();
}
Gets the right paragraph lines indent. |
public int getRotation() {
return this.rotation;
}
Gets the rotation of the cell. |
public int getRunDirection() {
return column.getRunDirection();
}
Gets the run direction of the text content in the cell |
public float getSpaceCharRatio() {
return column.getSpaceCharRatio();
}
Gets the space/character extra spacing ratio for
fully justified text. |
public PdfPTable getTable() {
return table;
}
Getter for property table. |
public int getVerticalAlignment() {
return verticalAlignment;
}
Gets the vertical alignment for the cell. |
public boolean isNoWrap() {
return noWrap;
}
Getter for property noWrap. |
public boolean isUseAscender() {
return column.isUseAscender();
}
Gets state of first line height based on max ascender |
public boolean isUseBorderPadding() {
return useBorderPadding;
}
If true, then effective padding will include border widths |
public boolean isUseDescender() {
return this.useDescender;
}
Getter for property useDescender. |
public void setArabicOptions(int arabicOptions) {
column.setArabicOptions(arabicOptions);
}
Sets the arabic shaping options. The option can be AR_NOVOWEL,
AR_COMPOSEDTASHKEEL and AR_LIG. |
public void setCellEvent(PdfPCellEvent event) {
if (event == null) this.cellEvent = null;
else if (this.cellEvent == null) this.cellEvent = event;
else if (this.cellEvent instanceof PdfPCellEventForwarder) ((PdfPCellEventForwarder)this.cellEvent).addCellEvent(event);
else {
PdfPCellEventForwarder forward = new PdfPCellEventForwarder();
forward.addCellEvent(this.cellEvent);
forward.addCellEvent(event);
this.cellEvent = forward;
}
}
Sets the cell event for this cell. |
public void setColspan(int colspan) {
this.colspan = colspan;
}
Setter for property colspan. |
public void setColumn(ColumnText column) {
this.column = column;
}
Sets the columntext in the cell. |
public void setExtraParagraphSpace(float extraParagraphSpace) {
column.setExtraParagraphSpace(extraParagraphSpace);
}
Sets the extra space between paragraphs. |
public void setFixedHeight(float fixedHeight) {
this.fixedHeight = fixedHeight;
minimumHeight = 0;
}
Setter for property fixedHeight. |
public void setFollowingIndent(float indent) {
column.setFollowingIndent(indent);
}
Sets the following paragraph lines indent. |
public void setHorizontalAlignment(int horizontalAlignment) {
column.setAlignment(horizontalAlignment);
}
Sets the horizontal alignment for the cell. It could be
Element.ALIGN_CENTER for example. |
public void setImage(Image image) {
column.setText(null);
table = null;
this.image = image;
}
Setter for property image. |
public void setIndent(float indent) {
column.setIndent(indent);
}
Sets the first paragraph line indent. |
public void setLeading(float fixedLeading,
float multipliedLeading) {
column.setLeading(fixedLeading, multipliedLeading);
}
Sets the leading fixed and variable. The resultant leading will be
fixedLeading+multipliedLeading*maxFontSize where maxFontSize is the
size of the biggest font in the line. |
public void setMinimumHeight(float minimumHeight) {
this.minimumHeight = minimumHeight;
fixedHeight = 0;
}
Setter for property minimumHeight. |
public void setNoWrap(boolean noWrap) {
this.noWrap = noWrap;
}
Setter for property noWrap. |
public void setPadding(float padding) {
paddingBottom = padding;
paddingTop = padding;
paddingLeft = padding;
paddingRight = padding;
}
Sets the padding of the contents in the cell (space between content and border). |
public void setPaddingBottom(float paddingBottom) {
this.paddingBottom = paddingBottom;
}
Setter for property paddingBottom. |
public void setPaddingLeft(float paddingLeft) {
this.paddingLeft = paddingLeft;
}
Setter for property paddingLeft. |
public void setPaddingRight(float paddingRight) {
this.paddingRight = paddingRight;
}
Setter for property paddingRight. |
public void setPaddingTop(float paddingTop) {
this.paddingTop = paddingTop;
}
Setter for property paddingTop. |
public void setPhrase(Phrase phrase) {
table = null;
image = null;
column.setText(this.phrase = phrase);
}
Sets the Phrase for this cell. |
public void setRightIndent(float indent) {
column.setRightIndent(indent);
}
Sets the right paragraph lines indent. |
public void setRotation(int rotation) {
rotation %= 360;
if (rotation < 0)
rotation += 360;
if ((rotation % 90) != 0)
throw new IllegalArgumentException("Rotation must be a multiple of 90.");
this.rotation = rotation;
}
Sets the rotation of the cell. Possible values are
0, 90, 180 and 270. |
public void setRunDirection(int runDirection) {
column.setRunDirection(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). |
public void setSpaceCharRatio(float spaceCharRatio) {
column.setSpaceCharRatio(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. |
void setTable(PdfPTable table) {
this.table = table;
column.setText(null);
image = null;
if (table != null) {
table.setExtendLastRow(verticalAlignment == Element.ALIGN_TOP);
column.addElement(table);
table.setWidthPercentage(100);
}
}
|
public void setUseAscender(boolean use) {
column.setUseAscender(use);
}
Enables/ Disables adjustment of first line height based on max ascender. |
public void setUseBorderPadding(boolean use) {
useBorderPadding = use;
}
Adjusts effective padding to include border widths. |
public void setUseDescender(boolean useDescender) {
this.useDescender = useDescender;
}
Setter for property useDescender. |
public void setVerticalAlignment(int verticalAlignment) {
if (table != null)
table.setExtendLastRow(verticalAlignment == Element.ALIGN_TOP);
this.verticalAlignment = verticalAlignment;
}
Sets the vertical alignment for the cell. It could be
Element.ALIGN_MIDDLE for example. |