- java.lang.Object
-
- com.itextpdf.text.pdf.events.PdfPTableEventForwarder
-
- All Implemented Interfaces:
PdfPTableEvent
public class PdfPTableEventForwarder extends java.lang.Object implements PdfPTableEvent
If you want to add more than one page event to a PdfPTable, you have to construct a PdfPTableEventForwarder, add the different events to this object and add the forwarder to the PdfWriter.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.ArrayListeventsArrayList containing all the PageEvents that have to be executed.
-
Constructor Summary
Constructors Constructor Description PdfPTableEventForwarder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTableEvent(PdfPTableEvent event)Add a page event to the forwarder.voidtableLayout(PdfPTable table, float[][] widths, float[] heights, int headerRows, int rowStart, PdfContentByte[] canvases)This method is called at the end of the table rendering.
-
-
-
Method Detail
-
addTableEvent
public void addTableEvent(PdfPTableEvent event)
Add a page event to the forwarder.- Parameters:
event- an event that has to be added to the forwarder.
-
tableLayout
public void tableLayout(PdfPTable table, float[][] widths, float[] heights, int headerRows, int rowStart, PdfContentByte[] canvases)
Description copied from interface:PdfPTableEventThis method is called at the end of the table rendering. The text or graphics are added to one of the 4PdfContentBytecontained incanvases.
The indexes tocanvasesare: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
widthsandheightshave the coordinates of the cells.
The size of thewidthsarray is the number of rows. Each sub-array inwidthscorresponds 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 inwidthsare the same.
For theheightsthe first element is the y coordinate of the top table border and the last element is the y coordinate of the bottom table border.- Specified by:
tableLayoutin interfacePdfPTableEvent- Parameters:
table- thePdfPTablein 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- See Also:
PdfPTableEvent.tableLayout(com.lowagie.text.pdf.PdfPTable, float[][], float[], int, int, com.lowagie.text.pdf.PdfContentByte[])
-
-