/**
* 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.
*
* @param colStart the first column to be written, zero index
* @param colEnd the last column to be written + 1. If it is -1 all the
* columns to the end are written
* @param rowStart the first row to be written, zero index
* @param rowEnd the last row to be written + 1. If it is -1 all the
* rows to the end are written
* @param xPos the x write coordinate
* @param yPos the y write coordinate
* @param canvas the <CODE>PdfContentByte</CODE> where the rows will
* be written to
* @return the y coordinate position of the bottom of the last row
* @param 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.
* @since 5.1.0 added the reusable parameter
*/
virtual public float WriteSelectedRows(int colStart, int colEnd, int rowStart, int rowEnd, float xPos, float yPos,
PdfContentByte canvas, bool reusable)
{
int totalCols = NumberOfColumns;
if (colStart < 0)
colStart = 0;
else
colStart = Math.Min(colStart, totalCols);
if (colEnd < 0)
colEnd = totalCols;
else
colEnd = Math.Min(colEnd, totalCols);
bool clip = (colStart != 0 || colEnd != totalCols);
if (clip)
{
float w = 0;
for (int k = colStart; k < colEnd; ++k)
w += absoluteWidths[k];
canvas.SaveState();
float lx = (colStart == 0) ? 10000 : 0;
float rx = (colEnd == totalCols) ? 10000 : 0;
canvas.Rectangle(xPos - lx, -10000, w + lx + rx, PdfPRow.RIGHT_LIMIT);
canvas.Clip();
canvas.NewPath();
}
PdfContentByte[] canvases = BeginWritingRows(canvas);
float y = WriteSelectedRows(colStart, colEnd, rowStart, rowEnd, xPos, yPos, canvases, reusable);
EndWritingRows(canvases);
if (clip)
canvas.RestoreState();
return y;
}