com.itextpdf.text.pdf.events
Class PdfPTableEventForwarder

java.lang.Object
  extended by com.itextpdf.text.pdf.events.PdfPTableEventForwarder
All Implemented Interfaces:
PdfPTableEvent, PdfPTableEventSplit

public class PdfPTableEventForwarder
extends Object
implements PdfPTableEventSplit

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
protected  ArrayList<PdfPTableEvent> events
          ArrayList containing all the PageEvents that have to be executed.
 
Constructor Summary
PdfPTableEventForwarder()
           
 
Method Summary
 void addTableEvent(PdfPTableEvent event)
          Add a page event to the forwarder.
 void splitTable(PdfPTable table)
          This method is called to indicate that table is being split.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

events

protected ArrayList<PdfPTableEvent> events
ArrayList containing all the PageEvents that have to be executed.

Constructor Detail

PdfPTableEventForwarder

public PdfPTableEventForwarder()
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: PdfPTableEvent
This method is called at the end of the table rendering. The text or graphics are added to one of the 4 PdfContentByte contained in canvases.
The indexes to canvases are:

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

The widths and heights have the coordinates of the cells.
The size of the widths array is the number of rows. Each sub-array in widths 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 in widths are the same.
For the heights 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.

Specified by:
tableLayout in interface PdfPTableEvent
Parameters:
table - the PdfPTable in use
widths - an array of arrays with the cells' x positions. It has the length of the number of rows
heights - an array with the cells' y positions. It has a length of the number of rows + 1
headerRows - the number of rows defined for the header.
rowStart - the first row number after the header
canvases - an array of PdfContentByte
See Also:
PdfPTableEvent.tableLayout(com.itextpdf.text.pdf.PdfPTable, float[][], float[], int, int, com.itextpdf.text.pdf.PdfContentByte[])

splitTable

public void splitTable(PdfPTable table)
Description copied from interface: PdfPTableEventSplit
This method is called to indicate that table is being split. It's called before the tableLayout method and before the table is drawn.

Specified by:
splitTable in interface PdfPTableEventSplit
Parameters:
table - the PdfPTable in use
Since:
iText 5.0.6
See Also:
PdfPTableEventSplit.splitTable(com.itextpdf.text.pdf.PdfPTable)


Copyright © 2013. All Rights Reserved.