/**
* Writes the selected rows to the document.
* This method clips the columns; this is only important
* if there are columns with colspan at boundaries.
* <P>
* 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
* @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 coodinate
* @param yPos the y write coodinate
* @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
*/
public float WriteSelectedRows(int colStart, int colEnd, int rowStart, int rowEnd, float xPos, float yPos, PdfContentByte canvas)
{
if (colEnd < 0)
colEnd = absoluteWidths.Length;
colEnd = Math.Min(colEnd, absoluteWidths.Length);
if (colStart < 0)
colStart = 0;
colStart = Math.Min(colStart, absoluteWidths.Length);
if (colStart != 0 || colEnd != absoluteWidths.Length) {
float w = 0;
for (int k = colStart; k < colEnd; ++k)
w += absoluteWidths[k];
canvas.SaveState();
float lx = 0;
float rx = 0;
if (colStart == 0)
lx = 10000;
if (colEnd == absoluteWidths.Length)
rx = 10000;
canvas.Rectangle(xPos - lx, -10000, w + lx + rx, 20000);
canvas.Clip();
canvas.NewPath();
}
PdfContentByte[] canvases = BeginWritingRows(canvas);
float y = WriteSelectedRows(colStart, colEnd, rowStart, rowEnd, xPos, yPos, canvases);
EndWritingRows(canvases);
if (colStart != 0 || colEnd != absoluteWidths.Length)
canvas.RestoreState();
return y;
}