com.lowagie.text.pdf

Class PdfPTable

public class PdfPTable extends Object implements LargeElement

This is a table that can be put at an absolute position but can also be added to the document as the class Table. In the last case when crossing pages the table always break at full rows; if a row is bigger than the page it is dropped silently to avoid infinite loops.

A PdfPTableEvent can be associated to the table to do custom drawing when the table is rendered.

Author: Paulo Soares (psoares@consiste.pt)

Field Summary
protected float[]absoluteWidths
static intBACKGROUNDCANVAS
The index of the duplicate PdfContentByte where the background will be drawn.
static intBASECANVAS
The index of the original PdfcontentByte.
protected booleancomplete
Indicates if the PdfPTable is complete once added to the document.
protected PdfPCell[]currentRow
protected intcurrentRowIdx
protected PdfPCelldefaultCell
booleanextendLastRow
Holds value of property extendLastRow.
intfooterRows
Holds value of property footerRows.
protected intheaderRows
Holds value of property headerRows.
booleanheadersInEvent
Holds value of property headersInEvent.
inthorizontalAlignment
Holds value of property horizontalAlignment.
protected booleanisColspan
booleankeepTogether
Defines if the table should be kept on one page if possible
booleanlockedWidth
Holds value of property lockedWidth.
static intLINECANVAS
The index of the duplicate PdfContentByte where the border lines will be drawn.
protected float[]relativeWidths
protected booleanrowCompleted
Keeps track of the completeness of the current row.
protected ArrayListrows
protected intrunDirection
booleanskipFirstHeader
Holds value of property skipFirstHeader.
booleanskipLastFooter
Holds value of property skipLastFooter.
protected floatspacingAfter
The spacing after the table.
protected floatspacingBefore
The spacing before the table.
booleansplitLate
Holds value of property splitLate.
booleansplitRows
Holds value of property splitRows.
protected PdfPTableEventtableEvent
protected floattotalHeight
protected floattotalWidth
static intTEXTCANVAS
The index of the duplicate PdfContentByte where the text will be drawn.
protected floatwidthPercentage
Holds value of property widthPercentage.
Constructor Summary
protected PdfPTable()
PdfPTable(float[] relativeWidths)
Constructs a PdfPTable with the relative column widths.
PdfPTable(int numColumns)
Constructs a PdfPTable with numColumns columns.
PdfPTable(PdfPTable table)
Constructs a copy of a PdfPTable.
Method Summary
voidaddCell(PdfPCell cell)
Adds a cell element.
voidaddCell(String text)
Adds a cell element.
voidaddCell(PdfPTable table)
Adds a nested table.
voidaddCell(Image image)
Adds an Image as Cell.
voidaddCell(Phrase phrase)
Adds a cell element.
protected PdfPRowadjustCellsInRow(int start, int end)
Calculates the extra height needed in a row because of rowspans.
static PdfContentByte[]beginWritingRows(PdfContentByte canvas)
Gets and initializes the 4 layers where the table is written to.
floatcalculateHeights(boolean firsttime)
Calculates the heights of the table.
voidcalculateHeightsFast()
Calculates the heights of the table.
protected voidcalculateWidths()
voidcompleteRow()
Completes the current row with the default cell.
protected voidcopyFormat(PdfPTable sourceTable)
Copies the format of the sourceTable without copying the content.
voiddeleteBodyRows()
Removes all of the rows except headers
booleandeleteLastRow()
Deletes the last row in the table.
booleandeleteRow(int rowNumber)
Deletes a row from the table.
static voidendWritingRows(PdfContentByte[] canvases)
Finishes writing the table.
voidflushContent()
float[]getAbsoluteWidths()
Gets the absolute sizes of each column width.
ArrayListgetChunks()
Gets all the chunks in this element.
PdfPCellgetDefaultCell()
Gets the default PdfPCell that will be used as reference for all the addCell methods except addCell(PdfPCell).
float[][]getEventWidths(float xPos, int firstRow, int lastRow, boolean includeHeaders)
floatgetFooterHeight()
Gets the height of the rows that constitute the footer as defined by setFooterRows().
intgetFooterRows()
Gets the number of rows in the footer.
floatgetHeaderHeight()
Gets the height of the rows that constitute the header as defined by setHeaderRows().
intgetHeaderRows()
Gets the number of the rows that constitute the header.
intgetHorizontalAlignment()
Gets the horizontal alignment of the table relative to the page.
booleangetKeepTogether()
Getter for property keepTogether
intgetNumberOfColumns()
Returns the number of columns.
PdfPRowgetRow(int idx)
Gets a row with a given index (added by Jin-Hsia Yang).
floatgetRowHeight(int idx)
Gets the height of a particular row.
floatgetRowHeight(int idx, boolean firsttime)
Gets the height of a particular row.
ArrayListgetRows()
Gets an arraylist with all the rows in the table.
ArrayListgetRows(int start, int end)
Gets an arraylist with a selection of rows.
floatgetRowspanHeight(int rowIndex, int cellIndex)
Gets the maximum height of a cell in a particular row (will only be different from getRowHeight is one of the cells in the row has a rowspan > 1).
intgetRunDirection()
Returns the run direction of the contents in the table.
PdfPTableEventgetTableEvent()
Gets the table event for this page.
floatgetTotalHeight()
Gets the total height of the table.
floatgetTotalWidth()
Gets the full width of the table.
floatgetWidthPercentage()
Gets the width percentage that the table will occupy in the page.
booleanisComplete()
booleanisContent()
booleanisExtendLastRow()
Gets the value of the last row extension.
booleanisHeadersInEvent()
Gets the header status inclusion in PdfPTableEvent.
booleanisLockedWidth()
Getter for property lockedWidth.
booleanisNestable()
booleanisSkipFirstHeader()
Tells you if the first header needs to be skipped (for instance if the header says "continued from the previous page").
booleanisSkipLastFooter()
Tells you if the last footer needs to be skipped (for instance if the footer says "continued on the next page")
booleanisSplitLate()
Gets the property splitLate.
booleanisSplitRows()
Gets the split value.
booleanprocess(ElementListener listener)
Processes the element by adding it (or the different parts) to an ElementListener.
booleanrowSpanAbove(int currRow, int currCol)
Checks if there are rows above belonging to a rowspan.
voidsetComplete(boolean complete)
voidsetExtendLastRow(boolean extendLastRow)
When set the last row will be extended to fill all the remaining space to the bottom boundary.
voidsetFooterRows(int footerRows)
Sets the number of rows to be used for the footer.
voidsetHeaderRows(int headerRows)
Sets the number of the top rows that constitute the header.
voidsetHeadersInEvent(boolean headersInEvent)
When set the PdfPTableEvent will include the headers.
voidsetHorizontalAlignment(int horizontalAlignment)
Sets the horizontal alignment of the table relative to the page.
voidsetKeepTogether(boolean keepTogether)
If true the table will be kept on one page if it fits, by forcing a new page if it doesn't fit on the current page.
voidsetLockedWidth(boolean lockedWidth)
Uses the value in setTotalWidth() in Document.add().
voidsetRunDirection(int runDirection)
Sets the run direction of the contents of the table.
voidsetSkipFirstHeader(boolean skipFirstHeader)
Skips the printing of the first header.
voidsetSkipLastFooter(boolean skipLastFooter)
Skips the printing of the last footer.
voidsetSpacingAfter(float spacing)
Sets the spacing after this table.
voidsetSpacingBefore(float spacing)
Sets the spacing before this table.
voidsetSplitLate(boolean splitLate)
If true the row will only split if it's the first one in an empty page.
voidsetSplitRows(boolean splitRows)
When set the rows that won't fit in the page will be split.
voidsetTableEvent(PdfPTableEvent event)
Sets the table event for this table.
voidsetTotalWidth(float totalWidth)
Sets the full width of the table.
voidsetTotalWidth(float[] columnWidth)
Sets the full width of the table from the absolute column width.
voidsetWidthPercentage(float[] columnWidth, Rectangle pageSize)
Sets the percentage width of the table from the absolute column width.
voidsetWidthPercentage(float widthPercentage)
Sets the width percentage that the table will occupy in the page.
voidsetWidths(float[] relativeWidths)
Sets the relative widths of the table.
voidsetWidths(int[] relativeWidths)
Sets the relative widths of the table.
static PdfPTableshallowCopy(PdfPTable table)
Makes a shallow copy of a table (format without content).
intsize()
Gets the number of rows in this table.
voidskipColsWithRowspanAbove()
When updating the row index, cells with rowspan should be taken into account.
floatspacingAfter()
Gets the spacing after this table.
floatspacingBefore()
Gets the spacing before this table.
inttype()
Gets the type of the text element.
floatwriteSelectedRows(int rowStart, int rowEnd, float xPos, float yPos, PdfContentByte[] canvases)
Writes the selected rows to the document.
floatwriteSelectedRows(int colStart, int colEnd, int rowStart, int rowEnd, float xPos, float yPos, PdfContentByte[] canvases)
Writes the selected rows and columns to the document.
floatwriteSelectedRows(int rowStart, int rowEnd, float xPos, float yPos, PdfContentByte canvas)
Writes the selected rows to the document.
floatwriteSelectedRows(int colStart, int colEnd, int rowStart, int rowEnd, float xPos, float yPos, PdfContentByte canvas)
Writes the selected rows and columns to the document.

Field Detail

absoluteWidths

protected float[] absoluteWidths

BACKGROUNDCANVAS

public static final int BACKGROUNDCANVAS
The index of the duplicate PdfContentByte where the background will be drawn.

BASECANVAS

public static final int BASECANVAS
The index of the original PdfcontentByte.

complete

protected boolean complete
Indicates if the PdfPTable is complete once added to the document.

Since: iText 2.0.8

currentRow

protected PdfPCell[] currentRow

currentRowIdx

protected int currentRowIdx

defaultCell

protected PdfPCell defaultCell

extendLastRow

private boolean extendLastRow
Holds value of property extendLastRow.

footerRows

private int footerRows
Holds value of property footerRows.

headerRows

protected int headerRows
Holds value of property headerRows.

headersInEvent

private boolean headersInEvent
Holds value of property headersInEvent.

horizontalAlignment

private int horizontalAlignment
Holds value of property horizontalAlignment.

isColspan

protected boolean isColspan

keepTogether

private boolean keepTogether
Defines if the table should be kept on one page if possible

lockedWidth

private boolean lockedWidth
Holds value of property lockedWidth.

LINECANVAS

public static final int LINECANVAS
The index of the duplicate PdfContentByte where the border lines will be drawn.

relativeWidths

protected float[] relativeWidths

rowCompleted

protected boolean rowCompleted
Keeps track of the completeness of the current row.

Since: 2.1.6

rows

protected ArrayList rows

runDirection

protected int runDirection

skipFirstHeader

private boolean skipFirstHeader
Holds value of property skipFirstHeader.

skipLastFooter

private boolean skipLastFooter
Holds value of property skipLastFooter.

Since: 2.1.6

spacingAfter

protected float spacingAfter
The spacing after the table.

spacingBefore

protected float spacingBefore
The spacing before the table.

splitLate

private boolean splitLate
Holds value of property splitLate.

splitRows

private boolean splitRows
Holds value of property splitRows.

tableEvent

protected PdfPTableEvent tableEvent

totalHeight

protected float totalHeight

totalWidth

protected float totalWidth

TEXTCANVAS

public static final int TEXTCANVAS
The index of the duplicate PdfContentByte where the text will be drawn.

widthPercentage

protected float widthPercentage
Holds value of property widthPercentage.

Constructor Detail

PdfPTable

protected PdfPTable()

PdfPTable

public PdfPTable(float[] relativeWidths)
Constructs a PdfPTable with the relative column widths.

Parameters: relativeWidths the relative column widths

PdfPTable

public PdfPTable(int numColumns)
Constructs a PdfPTable with numColumns columns.

Parameters: numColumns the number of columns

PdfPTable

public PdfPTable(PdfPTable table)
Constructs a copy of a PdfPTable.

Parameters: table the PdfPTable to be copied

Method Detail

addCell

public void addCell(PdfPCell cell)
Adds a cell element.

Parameters: cell the cell element

addCell

public void addCell(String text)
Adds a cell element.

Parameters: text the text for the cell

addCell

public void addCell(PdfPTable table)
Adds a nested table.

Parameters: table the table to be added to the cell

addCell

public void addCell(Image image)
Adds an Image as Cell.

Parameters: image the Image to add to the table. This image will fit in the cell

addCell

public void addCell(Phrase phrase)
Adds a cell element.

Parameters: phrase the Phrase to be added to the cell

adjustCellsInRow

protected PdfPRow adjustCellsInRow(int start, int end)
Calculates the extra height needed in a row because of rowspans.

Parameters: start the index of the start row (the one to adjust) end the index of the end row on the page

Since: 2.1.6

beginWritingRows

public static PdfContentByte[] beginWritingRows(PdfContentByte canvas)
Gets and initializes the 4 layers where the table is written to. The text or graphics are added to one of the 4 PdfContentByte returned with the following order:

The layers are placed in sequence on top of each other.

Parameters: canvas the PdfContentByte where the rows will be written to

Returns: an array of 4 PdfContentByte

See Also: (int, int, float, float, PdfContentByte[])

calculateHeights

public float calculateHeights(boolean firsttime)
Calculates the heights of the table.

Parameters: firsttime if true, the heights of the rows will be recalculated. This takes time; normally the heights of the rows are already calcultated, so in most cases, it's save to use false as parameter.

Returns: the total height of the table. Note that it will be 0 if you didn't specify the width of the table with setTotalWidth().

Since: 2.1.5 added a parameter and a return type to an existing method, and made it public

calculateHeightsFast

public void calculateHeightsFast()
Calculates the heights of the table.

calculateWidths

protected void calculateWidths()

Since: 2.1.6 private is now protected

completeRow

public void completeRow()
Completes the current row with the default cell. An incomplete row will be dropped but calling this method will make sure that it will be present in the table.

copyFormat

protected void copyFormat(PdfPTable sourceTable)
Copies the format of the sourceTable without copying the content.

Parameters: sourceTable

Since: 2.1.6 private is now protected

deleteBodyRows

public void deleteBodyRows()
Removes all of the rows except headers

deleteLastRow

public boolean deleteLastRow()
Deletes the last row in the table.

Returns: true if the last row was deleted

deleteRow

public boolean deleteRow(int rowNumber)
Deletes a row from the table.

Parameters: rowNumber the row to be deleted

Returns: true if the row was deleted

endWritingRows

public static void endWritingRows(PdfContentByte[] canvases)
Finishes writing the table.

Parameters: canvases the array returned by beginWritingRows()

flushContent

public void flushContent()

Since: iText 2.0.8

See Also: flushContent

getAbsoluteWidths

public float[] getAbsoluteWidths()
Gets the absolute sizes of each column width.

Returns: he absolute sizes of each column width

getChunks

public ArrayList getChunks()
Gets all the chunks in this element.

Returns: an ArrayList

getDefaultCell

public PdfPCell getDefaultCell()
Gets the default PdfPCell that will be used as reference for all the addCell methods except addCell(PdfPCell).

Returns: default PdfPCell

getEventWidths

float[][] getEventWidths(float xPos, int firstRow, int lastRow, boolean includeHeaders)

getFooterHeight

public float getFooterHeight()
Gets the height of the rows that constitute the footer as defined by setFooterRows().

Returns: the height of the rows that constitute the footer

Since: 2.1.1

getFooterRows

public int getFooterRows()
Gets the number of rows in the footer.

Returns: the number of rows in the footer

getHeaderHeight

public float getHeaderHeight()
Gets the height of the rows that constitute the header as defined by setHeaderRows().

Returns: the height of the rows that constitute the header and footer

getHeaderRows

public int getHeaderRows()
Gets the number of the rows that constitute the header.

Returns: the number of the rows that constitute the header

getHorizontalAlignment

public int getHorizontalAlignment()
Gets the horizontal alignment of the table relative to the page.

Returns: the horizontal alignment of the table relative to the page

getKeepTogether

public boolean getKeepTogether()
Getter for property keepTogether

Returns: true if it is tried to keep the table on one page; false otherwise

getNumberOfColumns

public int getNumberOfColumns()
Returns the number of columns.

Returns: the number of columns.

Since: 2.1.1

getRow

public PdfPRow getRow(int idx)
Gets a row with a given index (added by Jin-Hsia Yang).

Parameters: idx

Returns: the row at position idx

getRowHeight

public float getRowHeight(int idx)
Gets the height of a particular row.

Parameters: idx the row index (starts at 0)

Returns: the height of a particular row

getRowHeight

public float getRowHeight(int idx, boolean firsttime)
Gets the height of a particular row.

Parameters: idx the row index (starts at 0) firsttime is this the first time the row heigh is calculated?

Returns: the height of a particular row

Since: 3.0.0

getRows

public ArrayList getRows()
Gets an arraylist with all the rows in the table.

Returns: an arraylist

getRows

public ArrayList getRows(int start, int end)
Gets an arraylist with a selection of rows.

Parameters: start the first row in the selection end the first row that isn't part of the selection

Returns: a selection of rows

Since: 2.1.6

getRowspanHeight

public float getRowspanHeight(int rowIndex, int cellIndex)
Gets the maximum height of a cell in a particular row (will only be different from getRowHeight is one of the cells in the row has a rowspan > 1).

Parameters: rowIndex the row index cellIndex the cell index

Returns: the height of a particular row including rowspan

Since: 2.1.6

getRunDirection

public int getRunDirection()
Returns the run direction of the contents in the table.

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

getTableEvent

public PdfPTableEvent getTableEvent()
Gets the table event for this page.

Returns: the table event for this page

getTotalHeight

public float getTotalHeight()
Gets the total height of the table.

Returns: the total height of the table

getTotalWidth

public float getTotalWidth()
Gets the full width of the table.

Returns: the full width of the table

getWidthPercentage

public float getWidthPercentage()
Gets the width percentage that the table will occupy in the page.

Returns: the width percentage that the table will occupy in the page

isComplete

public boolean isComplete()

Since: iText 2.0.8

See Also: isComplete

isContent

public boolean isContent()

Since: iText 2.0.8

See Also: isContent

isExtendLastRow

public boolean isExtendLastRow()
Gets the value of the last row extension.

Returns: true if the last row will extend; false otherwise

isHeadersInEvent

public boolean isHeadersInEvent()
Gets the header status inclusion in PdfPTableEvent.

Returns: true if the headers are included; false otherwise

isLockedWidth

public boolean isLockedWidth()
Getter for property lockedWidth.

Returns: Value of property lockedWidth.

isNestable

public boolean isNestable()

Since: iText 2.0.8

See Also: isNestable

isSkipFirstHeader

public boolean isSkipFirstHeader()
Tells you if the first header needs to be skipped (for instance if the header says "continued from the previous page").

Returns: Value of property skipFirstHeader.

isSkipLastFooter

public boolean isSkipLastFooter()
Tells you if the last footer needs to be skipped (for instance if the footer says "continued on the next page")

Returns: Value of property skipLastFooter.

Since: 2.1.6

isSplitLate

public boolean isSplitLate()
Gets the property splitLate.

Returns: the property splitLate

isSplitRows

public boolean isSplitRows()
Gets the split value.

Returns: true to split; false otherwise

process

public boolean process(ElementListener listener)
Processes the element by adding it (or the different parts) to an ElementListener.

Parameters: listener an ElementListener

Returns: true if the element was processed successfully

rowSpanAbove

boolean rowSpanAbove(int currRow, int currCol)
Checks if there are rows above belonging to a rowspan.

Parameters: currRow the current row to check currCol the current column to check

Returns: true if there's a cell above that belongs to a rowspan

Since: 2.1.6

setComplete

public void setComplete(boolean complete)

Since: iText 2.0.8

See Also: LargeElement

setExtendLastRow

public void setExtendLastRow(boolean extendLastRow)
When set the last row will be extended to fill all the remaining space to the bottom boundary.

Parameters: extendLastRow true to extend the last row; false otherwise

setFooterRows

public void setFooterRows(int footerRows)
Sets the number of rows to be used for the footer. The number of footer rows are subtracted from the header rows. For example, for a table with two header rows and one footer row the code would be:
 table.setHeaderRows(3);
 table.setFooterRows(1);
 
Row 0 and 1 will be the header rows and row 2 will be the footer row.

Parameters: footerRows the number of rows to be used for the footer

setHeaderRows

public void setHeaderRows(int headerRows)
Sets the number of the top rows that constitute the header. This header has only meaning if the table is added to Document and the table crosses pages.

Parameters: headerRows the number of the top rows that constitute the header

setHeadersInEvent

public void setHeadersInEvent(boolean headersInEvent)
When set the PdfPTableEvent will include the headers.

Parameters: headersInEvent true to include the headers; false otherwise

setHorizontalAlignment

public void setHorizontalAlignment(int horizontalAlignment)
Sets the horizontal alignment of the table relative to the page. It only has meaning if the width percentage is less than 100%.

Parameters: horizontalAlignment the horizontal alignment of the table relative to the page

setKeepTogether

public void setKeepTogether(boolean keepTogether)
If true the table will be kept on one page if it fits, by forcing a new page if it doesn't fit on the current page. The default is to split the table over multiple pages.

Parameters: keepTogether whether to try to keep the table on one page

setLockedWidth

public void setLockedWidth(boolean lockedWidth)
Uses the value in setTotalWidth() in Document.add().

Parameters: lockedWidth true to use the value in setTotalWidth() in Document.add()

setRunDirection

public void setRunDirection(int runDirection)
Sets the run direction of the contents of the table.

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

setSkipFirstHeader

public void setSkipFirstHeader(boolean skipFirstHeader)
Skips the printing of the first header. Used when printing tables in succession belonging to the same printed table aspect.

Parameters: skipFirstHeader New value of property skipFirstHeader.

setSkipLastFooter

public void setSkipLastFooter(boolean skipLastFooter)
Skips the printing of the last footer. Used when printing tables in succession belonging to the same printed table aspect.

Parameters: skipLastFooter New value of property skipLastFooter.

Since: 2.1.6

setSpacingAfter

public void setSpacingAfter(float spacing)
Sets the spacing after this table.

Parameters: spacing the new spacing

setSpacingBefore

public void setSpacingBefore(float spacing)
Sets the spacing before this table.

Parameters: spacing the new spacing

setSplitLate

public void setSplitLate(boolean splitLate)
If true the row will only split if it's the first one in an empty page. It's true by default. It's only meaningful if setSplitRows(true).

Parameters: splitLate the property value

setSplitRows

public void setSplitRows(boolean splitRows)
When set the rows that won't fit in the page will be split. Note that it takes at least twice the memory to handle a split table row than a normal table. true by default.

Parameters: splitRows true to split; false otherwise

setTableEvent

public void setTableEvent(PdfPTableEvent event)
Sets the table event for this table.

Parameters: event the table event for this table

setTotalWidth

public void setTotalWidth(float totalWidth)
Sets the full width of the table.

Parameters: totalWidth the full width of the table.

setTotalWidth

public void setTotalWidth(float[] columnWidth)
Sets the full width of the table from the absolute column width.

Parameters: columnWidth the absolute width of each column

Throws: DocumentException if the number of widths is different than the number of columns

setWidthPercentage

public void setWidthPercentage(float[] columnWidth, Rectangle pageSize)
Sets the percentage width of the table from the absolute column width.

Parameters: columnWidth the absolute width of each column pageSize the page size

Throws: DocumentException

setWidthPercentage

public void setWidthPercentage(float widthPercentage)
Sets the width percentage that the table will occupy in the page.

Parameters: widthPercentage the width percentage that the table will occupy in the page

setWidths

public void setWidths(float[] relativeWidths)
Sets the relative widths of the table.

Parameters: relativeWidths the relative widths of the table.

Throws: DocumentException if the number of widths is different than the number of columns

setWidths

public void setWidths(int[] relativeWidths)
Sets the relative widths of the table.

Parameters: relativeWidths the relative widths of the table.

Throws: DocumentException if the number of widths is different than the number of columns

shallowCopy

public static PdfPTable shallowCopy(PdfPTable table)
Makes a shallow copy of a table (format without content).

Parameters: table

Returns: a shallow copy of the table

size

public int size()
Gets the number of rows in this table.

Returns: the number of rows in this table

skipColsWithRowspanAbove

private void skipColsWithRowspanAbove()
When updating the row index, cells with rowspan should be taken into account. This is what happens in this method.

Since: 2.1.6

spacingAfter

public float spacingAfter()
Gets the spacing after this table.

Returns: the spacing

spacingBefore

public float spacingBefore()
Gets the spacing before this table.

Returns: the spacing

type

public int type()
Gets the type of the text element.

Returns: a type

writeSelectedRows

public float writeSelectedRows(int rowStart, int rowEnd, float xPos, float yPos, PdfContentByte[] canvases)
Writes the selected rows to the document. canvases is obtained from beginWritingRows().

Parameters: rowStart the first row to be written, zero index rowEnd the last row to be written + 1. If it is -1 all the rows to the end are written xPos the x write coordinate yPos the y write coordinate canvases an array of 4 PdfContentByte obtained from beginWrittingRows()

Returns: the y coordinate position of the bottom of the last row

See Also: beginWritingRows

writeSelectedRows

public float writeSelectedRows(int colStart, int colEnd, int rowStart, int rowEnd, float xPos, float yPos, PdfContentByte[] canvases)
Writes the selected rows and columns to the document. This method does not clip the columns; this is only important if there are columns with colspan at boundaries. canvases is obtained from beginWritingRows(). The table event is only fired for complete rows.

Parameters: colStart the first column to be written, zero index colEnd the last column to be written + 1. If it is -1 all the columns to the end are written rowStart the first row to be written, zero index rowEnd the last row to be written + 1. If it is -1 all the rows to the end are written xPos the x write coordinate yPos the y write coordinate canvases an array of 4 PdfContentByte obtained from beginWritingRows()

Returns: the y coordinate position of the bottom of the last row

See Also: beginWritingRows

writeSelectedRows

public float writeSelectedRows(int rowStart, int rowEnd, float xPos, float yPos, PdfContentByte canvas)
Writes the selected rows to the document.

Parameters: rowStart the first row to be written, zero index rowEnd the last row to be written + 1. If it is -1 all the rows to the end are written xPos the x write coordinate yPos the y write coordinate canvas the PdfContentByte where the rows will be written to

Returns: the y coordinate position of the bottom of the last row

writeSelectedRows

public float writeSelectedRows(int colStart, int colEnd, int rowStart, int rowEnd, float xPos, float yPos, PdfContentByte canvas)
Writes the selected rows and columns to the document. This method clips the columns; this is only important if there are columns with colspan at boundaries. The table event is only fired for complete rows.

Parameters: colStart the first column to be written, zero index colEnd the last column to be written + 1. If it is -1 all the columns to the end are written rowStart the first row to be written, zero index rowEnd the last row to be written + 1. If it is -1 all the rows to the end are written xPos the x write coordinate yPos the y write coordinate canvas the PdfContentByte where the rows will be written to

Returns: the y coordinate position of the bottom of the last row