page.addElement(drawVerticalLine(posX+460, posY, 15));
page.addElement(insertCenterBoldText("Desconto", posX+460, posY, 75));
}
private JRPrintElement printImage(String imageName, int posX, int posY, int width, int height) {
JRBasePrintImage image = new JRBasePrintImage(jasperPrint.getDefaultStyleProvider());
image.setX(posX);
image.setY(posY);
image.setWidth(width);
image.setHeight(height);
image.setScaleImage(JRImage.SCALE_IMAGE_FILL_FRAME);
try {
File photoPath = new File(Constants.PHOTO_DIR + imageName);
if (photoPath.exists()) {
image.setRenderer(
JRImageRenderer.getInstance(
JRImageLoader.loadImageDataFromLocation(Constants.PHOTO_DIR + imageName)
)
);
}