final ElementAlignment verticalAlignment =
(ElementAlignment) layoutContext.getStyleProperty(ElementStyleKeys.VALIGNMENT);
final int alignmentX = (int) RenderUtility.computeHorizontalAlignment(horizontalAlignment, width, clipWidth);
final int alignmentY = (int) RenderUtility.computeVerticalAlignment(verticalAlignment, height, clipHeight);
g2.translate(alignmentX, alignmentY);
scaleTransform = AffineTransform.getScaleInstance(scaleX, scaleY);
}
final PdfGraphics2D pdfGraphics2D = (PdfGraphics2D) g2;
pdfGraphics2D.drawPdfImage(itextImage, image, scaleTransform, null);