I am creating java process using ProcessBuilder for ghostscript to convert pdf into tiff as below
process = new ProcessBuilder("D:\\ghost-script\\gs\\gs9.02\\bin\\gswin64.exe","-q", "-dNOPAUSE", "-dBATCH", "-dMaxStripSize=8192", "-sDEVICE=tiffg4", "-r300x300", "-dDITHERPPI=200", "-sOutputFile=D:\\ghost-script\\example\\output.tif", "D:\\ghost-script\\example\\input2.pdf", "-c", "quit").start();
Now I have two problems.
Any help is much appreciated.
For your first question, the window comes from the executable you launch, you may want to use
gswin64c.exe
See this topic : Ghostscript suppress output windows when called by command line
For your second question, use waitFor() on the Process
object.
process.waitFor();