 | Junior Member with 9 posts. | | | | Solved: Ghostscript not working in Windows XP Hello all!
Not sure if this forum is the right place, but it might be.
I've been having a problem with ghostscript on for a web project I am doing.. Couldn't figure it out, but now I see the problem -- Everything I type into the ghostscript console gives the "/undefined in [whatever I type]" error.
For example:
-sDEVICE=jpeg -sOutputFile=foo.jpg foo.ps
gives:
Error: /undefined in -sDEVICE=Jpeg
I am running this on Windows XP, Ghostscript 8.70 (tried downloading earlier version 8.63, same result)
What's going on? Tremendous gratitude for any help!
Andrey | | Distinguished Member with 14,999 posts. | | Join Date: Sep 2003 Location: -71.45091, 42.27841 | | Quote:
Originally Posted by andreyman3d2k Hello all!
Not sure if this forum is the right place, but it might be.
I've been having a problem with ghostscript on for a web project I am doing.. Couldn't figure it out, but now I see the problem -- Everything I type into the ghostscript console gives the "/undefined in [whatever I type]" error.
For example:
-sDEVICE=jpeg -sOutputFile=foo.jpg foo.ps
gives:
Error: /undefined in -sDEVICE=Jpeg
I am running this on Windows XP, Ghostscript 8.70 (tried downloading earlier version 8.63, same result)
What's going on? Tremendous gratitude for any help!
Andrey | Hi Andrey,
From a Run Command window, suggest you try running: gs -h
Ghostscript may be built to use many different output devices. To see
which devices your executable includes, run "gs -h". Unless you spec‐
ify a particular device, Ghostscript normally opens the first one of
those and directs output to it, so if the first one in the list is the
one you want to use, just issue the command
gs myfile.ps
You can also check the set of available devices from within
Ghostscript: invoke Ghostscript and type
devicenames ==
but the first device on the resulting list may not be the default
Note: The above information is from the man page for ghostscript on a Linux system, but the gs executable in Windows, i.e. gs.exe, might need to be substitued for gs when you run the command.
-- Tom
__________________ The independence created by philosophical insight is - in my opinion - the mark of distinction
between a mere artisan or specialist and a real seeker after truth. - Einstein 1944
Imagination is more important than knowledge. - Einstein | | Junior Member with 9 posts. | | | | Thanks for the reply Tom! I've been getting absolutely nowhere, and out of like a dozen forums you gave the first meaningful response!
I did what you said, and saw the list of devices. I think the one i want is Jpeg. How would I switch to it? here is the command I am trying to run:
-sDEVICE=jpeg -dNOPAUSE -dBATCH -sOutputFile='[outputpath]' '[inputpath]'
I got that from a script online, but it was written for linux... Does that switch not work? | | Distinguished Member with 14,999 posts. | | Join Date: Sep 2003 Location: -71.45091, 42.27841 | | Hi Andrey,
I am attaching the man page for ghostscript on Ubuntu Linux. Take a look at it to see if you can forumlate a solution. My time is limited, and I know you will figure it out!
I'll check back to this thread later tonight to see how it goes. I just ran the command: gs -h
and I saw jpeg in the output as a valid device, so if your output shows jpeg then you can do it, otherwise, I wouldn't think so.
Note: The format of the ghostscript command (gs) you are trying to do is:
$ gs -sDEVICE=jpeg -dNOPAUSE -dBATCH -sOutputFile='[outputpath]' '[inputpath]'
where the $ is the prompt (assuming you are running it from the run command - the $ is not present, but is in a command line environment in Ubuntu if that is where you run the command from a regular user account.
-- Tom
__________________ The independence created by philosophical insight is - in my opinion - the mark of distinction
between a mere artisan or specialist and a real seeker after truth. - Einstein 1944
Imagination is more important than knowledge. - Einstein
Last edited by lotuseclat79 : 28-Oct-2009 02:10 PM.
| | Junior Member with 9 posts. | | | | Hi Tom
I think I can't use the ghostscript prompt directly... even when I type -h i get nothing
currently I am trying to use the command prompt, but still with no cigar.
I type into the command prompt:
"C:/Program Files/gs/gs8.70/bin/gswin32.exe" -sDEVICE=jpeg -dNOPAUSE -dBATCH -sOutputFIle "C:/Documents and Settings/Andrey/Desktop/pdftest/book5.jpg" "C:/Documents and Settings/Andrey/Desktop/pdftest/book5.pdf"
It returns: Error: /undefinedfilename in "C:/Documents and Settings/Andrey/Desktop/pdftest/book5.jpg"
Operand stack... etc.
All the paths are correct.
I was thinking that maybe it is adding the path to some pre-defined directory... or maybe it doesn't have permissions?? it's weird.
I read that ghostscript treats anything where there is : as the second character as an absolute path, and my command fits the bill, since C:/... has a semicolon in the second position. So that should be fine.
Thanks again for all your help.
Andrey | | Junior Member with 9 posts. | | | | Ack I had a filename wrong! But now that I've fixed it, the error has become even stranger. Can't even type it -- attaching a screenshot.
Is it a fish looking through a window? or is it cursing at me? | | Junior Member with 9 posts. | | | | Sorry, screwed up the attachment. Should work now. | | Distinguished Member with 14,999 posts. | | Join Date: Sep 2003 Location: -71.45091, 42.27841 | | Quote:
Originally Posted by andreyman3d2k Hi Tom
I think I can't use the ghostscript prompt directly... even when I type -h i get nothing
currently I am trying to use the command prompt, but still with no cigar.
I type into the command prompt:
"C:/Program Files/gs/gs8.70/bin/gswin32.exe" -sDEVICE=jpeg -dNOPAUSE -dBATCH -sOutputFIle "C:/Documents and Settings/Andrey/Desktop/pdftest/book5.jpg" "C:/Documents and Settings/Andrey/Desktop/pdftest/book5.pdf"
It returns: Error: /undefinedfilename in "C:/Documents and Settings/Andrey/Desktop/pdftest/book5.jpg"
Operand stack... etc.
All the paths are correct.
I was thinking that maybe it is adding the path to some pre-defined directory... or maybe it doesn't have permissions?? it's weird.
I read that ghostscript treats anything where there is : as the second character as an absolute path, and my command fits the bill, since C:/... has a semicolon in the second position. So that should be fine.
Thanks again for all your help.
Andrey | Hi Andrey,
I don't understand why some items in the command line are enclosed in quotes? Certainly not the command itself, i.e. "C:/Program Files/gs/gs8.70/bin/gswin32.exe".
I would recommend de-quoting your full command line and then attempt to rerun it, in the Run Command window or figure out how to get a window for using command lines, and then insert the full command line you wish to execute after the prompt - may be a $.
-- Tom
__________________ The independence created by philosophical insight is - in my opinion - the mark of distinction
between a mere artisan or specialist and a real seeker after truth. - Einstein 1944
Imagination is more important than knowledge. - Einstein | | Junior Member with 9 posts. | | | | Okay, I will try without quotes at work tomorrow, thanks. I thought the quotes were required on the command line when the path has two words in it, like 'Program Files'. The command prompt seems to find the directory for ghostscript, so "C:/Program Files/gs/gs8.70/bin/gswin32.exe" works. Will try to remove the quotes in the commands passed to ghostscript, maybe that will work. The error message is so cryptic. What can those symbols mean? | | Distinguished Member with 3,234 posts. | | |
29-Oct-2009, 01:06 AM
#10 | This comment is slightly off-topic -- but until you get used to it (and assuming you aren't running from a batch file or similar) you might want to try a GUI for ghostscript such as GSView http://www.ghostgum.com.au/ | | Junior Member with 9 posts. | | |
29-Oct-2009, 08:51 AM
#11 | Hi IMM, thanks for the reply. I actually tried that already, downloaded GSview. Everything works fine there -- I can select a PDF and make it into a jpeg. The problem is that I need it to be done via command line, because it is going to be called by a PHP script on a web page, not done manually. | | Junior Member with 9 posts. | | |
29-Oct-2009, 09:50 AM
#12 | GOT IT TO WORK!!!
I was missing the = sign after -sOutputFile
Thanks so much for your help Tom!
Andrey | |
Smart Search
| Find your solution! | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | |  WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
| You Are Using: |
Advertisements do not imply our endorsement of that product or service.
All times are GMT -5. The time now is 03:25 PM.
Copyright © 1996 - 2009 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd. | |
|