public class PdfPRow extends Object implements IAccessibleElement
Modifier and Type | Field and Description |
---|---|
protected HashMap<PdfName,PdfObject> |
accessibleAttributes |
protected boolean |
adjusted |
static float |
BOTTOM_LIMIT
the bottom limit (bottom right y)
|
protected boolean |
calculated |
protected PdfPCell[] |
cells |
protected float[] |
extraHeights
extra heights that needs to be added to a cell because of rowspans.
|
protected AccessibleElementId |
id |
protected float |
maxHeight |
boolean |
mayNotBreak
True if the table may not break after this row.
|
static float |
RIGHT_LIMIT
the right limit
|
protected PdfName |
role |
protected float[] |
widths |
Constructor and Description |
---|
PdfPRow(PdfPCell[] cells)
Constructs a new PdfPRow with the cells in the array that was passed as a parameter.
|
PdfPRow(PdfPCell[] cells, PdfPRow source) |
PdfPRow(PdfPRow row)
Makes a copy of an existing row.
|
Modifier and Type | Method and Description |
---|---|
protected void |
calculateHeights()
Calculates the heights of each cell in the row.
|
void |
copyRowContent(PdfPTable table, int idx)
Copies the content of a specific row in a table to this row.
|
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.
|
PdfPCell[] |
getCells()
Returns the array of cells in the row.
|
AccessibleElementId |
getId() |
float |
getMaxHeights()
Gets the maximum height of the row (i.e.
|
float |
getMaxRowHeightsWithoutCalculating() |
PdfName |
getRole()
Gets the role of the accessible element.
|
boolean |
hasRowspan()
Checks if a cell in the row has a rowspan greater than 1.
|
protected void |
initExtraHeights()
Initializes the extra heights array.
|
boolean |
isAdjusted() |
boolean |
isCalculated()
Checks if the dimensions of the columns were calculated.
|
boolean |
isInline() |
boolean |
isMayNotBreak()
Getter for the mayNotbreak variable.
|
protected void |
restoreCanvases(PdfContentByte[] canvases) |
protected void |
saveAndRotateCanvases(PdfContentByte[] canvases, float a, float b, float c, float d, float e, float f) |
void |
setAccessibleAttribute(PdfName key, PdfObject value)
Set the attribute of accessible element (everything in A dictionary + Lang , Alt , ActualText , E ).
|
void |
setAdjusted(boolean adjusted) |
static float |
setColumn(ColumnText ct, float left, float bottom, float right, float top) |
void |
setExtraHeight(int cell, float height)
Sets an extra height for a cell.
|
void |
setFinalMaxHeights(float maxHeight) |
void |
setId(AccessibleElementId id) |
void |
setMaxHeights(float maxHeight)
Changes the maximum height of the row (to make it higher).
|
void |
setMayNotBreak(boolean mayNotBreak)
Setter for the mayNotBreak variable.
|
void |
setRole(PdfName role)
Sets the role of the accessiblee element.
|
boolean |
setWidths(float[] widths)
Sets the widths of the columns in the row.
|
PdfPRow |
splitRow(PdfPTable table, int rowIndex, float new_height)
Splits a row to newHeight.
|
void |
splitRowspans(PdfPTable original, int originalIdx, PdfPTable part, int partIdx)
Split rowspan of cells with rowspan on next page by inserting copies with the remaining rowspan and reducing the previous rowspan appropriately, i.e.
|
void |
writeBorderAndBackground(float xPos, float yPos, float currentMaxHeight, PdfPCell cell, PdfContentByte[] canvases)
Writes the border and background of one cell in the row.
|
void |
writeCells(int colStart, int colEnd, float xPos, float yPos, PdfContentByte[] canvases, boolean reusable)
Writes a number of cells (not necessarily all cells).
|
public boolean mayNotBreak
public static final float BOTTOM_LIMIT
public static final float RIGHT_LIMIT
protected PdfPCell[] cells
protected float[] widths
protected float[] extraHeights
protected float maxHeight
protected boolean calculated
protected boolean adjusted
protected PdfName role
protected AccessibleElementId id
public PdfPRow(PdfPCell[] cells)
cells
-
public PdfPRow(PdfPRow row)
row
-
public boolean setWidths(float[] widths)
widths
-
protected void initExtraHeights()
public void setExtraHeight(int cell, float height)
cell
- the index of the cell that needs an extra height
height
- the extra height
protected void calculateHeights()
public void setMayNotBreak(boolean mayNotBreak)
public boolean isMayNotBreak()
public void writeBorderAndBackground(float xPos, float yPos, float currentMaxHeight, PdfPCell cell, PdfContentByte[] canvases)
xPos
- The x-coordinate where the table starts on the canvas
yPos
- The y-coordinate where the table starts on the canvas
currentMaxHeight
- The height of the cell to be drawn.
cell
-
canvases
-
protected void saveAndRotateCanvases(PdfContentByte[] canvases, float a, float b, float c, float d, float e, float f)
protected void restoreCanvases(PdfContentByte[] canvases)
public static float setColumn(ColumnText ct, float left, float bottom, float right, float top)
public void writeCells(int colStart, int colEnd, float xPos, float yPos, PdfContentByte[] canvases, boolean reusable)
colStart
- The first column to be written. Remember that the column index starts with 0.
colEnd
- The last column to be written. Remember that the column index starts with 0. If -1, all the columns to the end are written.
xPos
- The x-coordinate where the table starts on the canvas
yPos
- The y-coordinate where the table starts on the canvas
reusable
- if set to false, the content in the cells is "consumed"; if true, you can reuse the cells, the row, the parent table as many times you want.
public boolean isCalculated()
public float getMaxHeights()
public void setMaxHeights(float maxHeight)
maxHeight
- the new maximum height
public void copyRowContent(PdfPTable table, int idx)
table
- the table from which you want to copy a row
idx
- the index of the row that needs to be copied
public PdfPRow splitRow(PdfPTable table, int rowIndex, float new_height)
new_height
- the new height
public float getMaxRowHeightsWithoutCalculating()
public void setFinalMaxHeights(float maxHeight)
public void splitRowspans(PdfPTable original, int originalIdx, PdfPTable part, int partIdx)
public PdfPCell[] getCells()
public boolean hasRowspan()
public boolean isAdjusted()
public void setAdjusted(boolean adjusted)
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
Copyright © 1998–2022. All rights reserved.