I have a slightly strange problem, I don't know the java expert I know.
I need to use imagemagick in my application to make emails on my website converted to images, so no bank can send emails easily. The problem is solved using the command line with the image. <b> convert -size 200x30 xc: transparent -font / home / emad / TITUSCBZ.TTF -fill black -pointsize 12 -draw "text 5.15 ' emadhegab@hotmail.com '" /home/emad/test.png
and it works like magic, and so I tried putting this on java to run it with Runtime.getRuntime (). Exec (command) but the result is sadly disappointing. I now have an image as a result .. but without text inside. I do sys out to see the command, and took the command that came out and put it in the terminal, and it worked ... the problem in Runtime is some kind of .. java code is .. in case you ask
==================
String size = ("1000x1030");
String path = System.getProperty("user.home");
String command="convert -size "+ size +" xc:white -font /tmp/TITUSCBZ.TTF -pointsize 12 -draw 'text 300,300 \"emadhegab@hotmail.com\"' "+path +"/test.jpg";
try{
Process proc =Runtime.getRuntime().exec(command);
System.out.println(command);
}catch(Exception e){
System.out.println("error");
}
===================
he will give you a blank image .. anyone has a solution
source
share