Issue converting from EPS to PNG when called from Web application server
Posted: Fri Mar 21, 2025 3:40 pm
Hi I need some help,
I have a .bat file (C:\Tools\testConversion.bat), which has the two NConvert commands I am using:
C:\Tools\nconvert.exe -overwrite -out png c:\images\*.eps
C:\Tools\nconvert.exe -overwrite -resize 25%% 25%% -out png c:\images\*.tif
When I run the .bat file from command line both NConvert commands work as expected and produce a .png file foreach eps and tiff file found in the c:\images directory. This tells me the eps image files are good.
However, when I call this .bat script from an web application server using java code,
1. eps conversion fails: The NConvert command to convert eps images to png fails and reports the message: Error: Don't know how to read this picture (<inputfile.eps>).
2. tif image files conversion are successful
Since the tiff image conversion works, it tells me that there are no problems with permissions, paths or environment variables.
But I don’t know why eps image conversion fails.
My web application server is Wildfly, hosting my java web application. The java code to call the script is:
// command to run
String cmd = "cmd.exe /c \"C:\\Tools\\testConversion.bat\"" ;
// setup env
String[] env = {"Path=C:\\WINDOWS\\system32;C:\\WINDOWS;"};
// call script
Runtime.getRuntime().exec(cmd, env);
Wildfly, nconvert, my script testConversion.bat and all the image files are all on my local machine, and the eps conversion still fails.
I’m at a loss trying to find out why the eps conversion works from command line and not when called from the WildFly application server and the tiff conversion does work in both cases.
The following are NConvert version information:
** NCONVERT v7.192 (c) 1991-2024 Pierre-E Gougelet (Aug 26 2024/11:00:16) **
Version for Windows 7/8/10/11 x64 (All rights reserved)
Thank you
I have a .bat file (C:\Tools\testConversion.bat), which has the two NConvert commands I am using:
C:\Tools\nconvert.exe -overwrite -out png c:\images\*.eps
C:\Tools\nconvert.exe -overwrite -resize 25%% 25%% -out png c:\images\*.tif
When I run the .bat file from command line both NConvert commands work as expected and produce a .png file foreach eps and tiff file found in the c:\images directory. This tells me the eps image files are good.
However, when I call this .bat script from an web application server using java code,
1. eps conversion fails: The NConvert command to convert eps images to png fails and reports the message: Error: Don't know how to read this picture (<inputfile.eps>).
2. tif image files conversion are successful
Since the tiff image conversion works, it tells me that there are no problems with permissions, paths or environment variables.
But I don’t know why eps image conversion fails.
My web application server is Wildfly, hosting my java web application. The java code to call the script is:
// command to run
String cmd = "cmd.exe /c \"C:\\Tools\\testConversion.bat\"" ;
// setup env
String[] env = {"Path=C:\\WINDOWS\\system32;C:\\WINDOWS;"};
// call script
Runtime.getRuntime().exec(cmd, env);
Wildfly, nconvert, my script testConversion.bat and all the image files are all on my local machine, and the eps conversion still fails.
I’m at a loss trying to find out why the eps conversion works from command line and not when called from the WildFly application server and the tiff conversion does work in both cases.
The following are NConvert version information:
** NCONVERT v7.192 (c) 1991-2024 Pierre-E Gougelet (Aug 26 2024/11:00:16) **
Version for Windows 7/8/10/11 x64 (All rights reserved)
Thank you