continue;
float currentMaxHeight = maxHeight + extraHeights[k];
writeBorderAndBackground(xPos, yPos, currentMaxHeight, cell, canvases);
Image img = cell.getImage();
float tly = cell.getTop() + yPos - cell.getEffectivePaddingTop();
if (cell.getHeight() <= currentMaxHeight) {
switch (cell.getVerticalAlignment()) {
case Element.ALIGN_BOTTOM:
tly = cell.getTop() + yPos - currentMaxHeight + cell.getHeight()
- cell.getEffectivePaddingTop();
break;
case Element.ALIGN_MIDDLE:
tly = cell.getTop() + yPos + (cell.getHeight() - currentMaxHeight) / 2
- cell.getEffectivePaddingTop();
break;
default:
break;
}
}
if (img != null) {
if (cell.getRotation() != 0) {
img = Image.getInstance(img);
img.setRotation(img.getImageRotation() + (float)(cell.getRotation() * Math.PI / 180.0));
}
boolean vf = false;
if (cell.getHeight() > currentMaxHeight) {
img.scalePercent(100);
float scale = (currentMaxHeight - cell.getEffectivePaddingTop() - cell
.getEffectivePaddingBottom())
/ img.getScaledHeight();
img.scalePercent(scale * 100);
vf = true;
}
float left = cell.getLeft() + xPos
+ cell.getEffectivePaddingLeft();
if (vf) {
switch (cell.getHorizontalAlignment()) {
case Element.ALIGN_CENTER:
left = xPos
+ (cell.getLeft() + cell.getEffectivePaddingLeft()
+ cell.getRight()
- cell.getEffectivePaddingRight() - img
.getScaledWidth()) / 2;
break;
case Element.ALIGN_RIGHT:
left = xPos + cell.getRight()
- cell.getEffectivePaddingRight()
- img.getScaledWidth();
break;
default:
break;
}
tly = cell.getTop() + yPos - cell.getEffectivePaddingTop();
}
img.setAbsolutePosition(left, tly - img.getScaledHeight());
try {
canvases[PdfPTable.TEXTCANVAS].addImage(img);
} catch (DocumentException e) {
throw new ExceptionConverter(e);
}