The code below has created a function to insert text into the image.
Does the pdf api have that function?
code
public static void main(String[] args) {
try {
final BufferedImage image = ImageIO.read(new URL("http://localhost:8080/img/watermark_emro_s.gif"));
Graphics g = image.getGraphics();
Color c = new Color(0,0,0);
g.setColor(c);
int height = image.getHeight() / 2;
int width = image.getWidth() / 2;
g.drawString("2020/03/26", width-30, height + 27);
g.dispose();
ImageIO.write(image,"gif", new File("D:\\test.gif"));
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
test.gif (11.0 KB)