void IPdfPCellEvent.CellLayout(PdfPCell cell, iTextSharp.text.Rectangle position, PdfContentByte[] canvases)
{
PdfContentByte canvas = canvases[PdfPTable.TEXTCANVAS];
float x = 0;
float y = 0;
int alignment = 0;
switch (pos)
{
case "TOP_LEFT":
x = position.GetLeft(3);
y = position.GetTop(content.Leading);
alignment = Element.ALIGN_LEFT;
break;
case "TOP_RIGHT":
x = position.GetRight(3);
y = position.GetTop(content.Leading);
alignment = Element.ALIGN_RIGHT;
break;
case "BOTTOM_LEFT":
x = position.GetLeft(3);
y = position.GetBottom(3);
alignment = Element.ALIGN_LEFT;
break;
case "BOTTOM_RIGHT":
x = position.GetRight(3);
y = position.GetBottom(3);
alignment = Element.ALIGN_RIGHT;
break;
case "CENTER_TOP":
x = position.GetRight(3) + position.GetLeft(3) / 2;
y = position.GetTop(3);
alignment = Element.ALIGN_RIGHT;
break;
case "CENTER_BOTTOM":
x = position.GetRight(3) + position.GetLeft(3) / 2;
y = position.GetBottom(3);
alignment = Element.ALIGN_RIGHT;
break;
case "CENTER_MIDDLE":
x = position.GetRight(3) + position.GetLeft(3) / 2;
y = x;
alignment = Element.ALIGN_RIGHT;
break;
}
ColumnText.ShowTextAligned(canvas, alignment, content, x, y, 0);
}