getting ghostscript to take in files with spaces in their name (like something in "my documents")
I'm trying to run this command to use ghostscr开发者_开发知识库ipt (from java) but Whether with single quote ' or " or nothing at all I get an error
Error: /undefinedfilename in ('c:\\Documents)
gswin32c.exe -q -dNOPAUSE -sDEVICE=tiffgray -sOutputFile=C:\polter.tiff -r300 'c:\Documents and Settings\polter.pdf' -c quit
any ideas?
use the short names for folders. short names are aliases which are using the 8.3 format. you can find the short name of a folder by using the dir /x
command on the command prompt. your path will then look something like this: c:\docume~1\polter.pdf
Break up the arguments yourself:
String[] cmd = {
"gswin32c.exe",
"-q", "-dNOPAUSE", "-sDEVICE=tiffgray",
"-sOutputFile=C:\polter.tiff", "-r300",
"c:\Documents and Settings\polter.pdf",
"-c", "quit"
};
Runtime.getRuntime().exec(cmd);
精彩评论