public void addTextWatermark(String text, File sourceImageFile,
File destImageFile, Job job) {
try {
BufferedImage sourceImage = ImageIO.read(sourceImageFile);
Graphics2D g2d = (Graphics2D) sourceImage.getGraphics();
int centerX = 0;
int centerY = 0;
AlphaComposite alphaChannel = AlphaComposite.getInstance(
AlphaComposite.SRC_OVER, job.getCodeCapacity());
g2d.setComposite(alphaChannel);
g2d.setColor(hex2Rgb(job.getCodeFontColor()));
g2d.setFont(new Font(job.getCodeFontName(), job
.getCodeFontStyle(), job.getCodeFontSize()));
g2d.rotate(Math.toRadians(-job.getCodeFontDegree()));
centerX = job.getCodePositionX();
centerY = job.getCodePositionY();
FontMetrics fontMetrics = g2d.getFontMetrics();
Rectangle2D rect = fontMetrics.getStringBounds(text, g2d);
g2d.drawString(text, centerX, centerY);
ImageIO.write(sourceImage, "jpg", destImageFile);
g2d.dispose();
} catch (IOException ex) {
} catch (Exception ex) {
}
}