Package com.lowagie.text.pdf
Interface PdfPTableEvent
- All Known Implementing Classes:
PdfPTableEventForwarder
,SimpleTable
public interface PdfPTableEvent
An interface that can be used to retrieve the position of cells in
PdfPTable
.-
Method Summary
Modifier and TypeMethodDescriptionvoid
tableLayout
(PdfPTable table, float[][] widths, float[] heights, int headerRows, int rowStart, PdfContentByte[] canvases) This method is called at the end of the table rendering.
-
Method Details
-
tableLayout
void tableLayout(PdfPTable table, float[][] widths, float[] heights, int headerRows, int rowStart, PdfContentByte[] canvases) This method is called at the end of the table rendering. The text or graphics are added to one of the 4PdfContentByte
contained incanvases
.
The indexes tocanvases
are:PdfPTable.BASECANVAS
- the originalPdfContentByte
. Anything placed here will be under the table.PdfPTable.BACKGROUNDCANVAS
- the layer where the background goes to.PdfPTable.LINECANVAS
- the layer where the lines go to.PdfPTable.TEXTCANVAS
- the layer where the text go to. Anything placed here will be over the table.
The
widths
andheights
have the coordinates of the cells.
The size of thewidths
array is the number of rows. Each sub-array inwidths
corresponds to the x column border positions where the first element is the x coordinate of the left table border and the last element is the x coordinate of the right table border. If colspan is not used all the sub-arrays inwidths
are the same.
For theheights
the first element is the y coordinate of the top table border and the last element is the y coordinate of the bottom table border.- Parameters:
table
- thePdfPTable
in usewidths
- an array of arrays with the cells' x positions. It has the length of the number of rowsheights
- an array with the cells' y positions. It has a length of the number of rows + 1headerRows
- the number of rows defined for the header.rowStart
- the first row number after the headercanvases
- an array ofPdfContentByte
-