There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Software Development
Tag Cloud
access acer asus bios bsod computer crash dns drive driver drivers error ethernet excel freeze games gaming graphics hard drive hardware hdmi internet java laptop malware memory monitor motherboard network printer problem ram random registry router slow software sound trojan usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Software & Hardware > Software Development >
Solved: Ghostscript not working in Windows XP

Reply  
Thread Tools
andreyman3d2k's Avatar
Junior Member with 9 posts.
 
Join Date: Oct 2009
28-Oct-2009, 11:20 AM #1
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
lotuseclat79's Avatar
Distinguished Member with 21,345 posts.
 
Join Date: Sep 2003
Location: -71.45091, 42.27841
28-Oct-2009, 11:26 AM #2
Quote:
Originally Posted by andreyman3d2k View Post
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
andreyman3d2k's Avatar
Junior Member with 9 posts.
 
Join Date: Oct 2009
28-Oct-2009, 11:54 AM #3
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?
lotuseclat79's Avatar
Distinguished Member with 21,345 posts.
 
Join Date: Sep 2003
Location: -71.45091, 42.27841
28-Oct-2009, 03:02 PM #4
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
Attached Files
File Type: txt gsmanpage.txt (14.7 KB, 104 views)
__________________
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 at 03:10 PM..
andreyman3d2k's Avatar
Junior Member with 9 posts.
 
Join Date: Oct 2009
28-Oct-2009, 05:05 PM #5
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
andreyman3d2k's Avatar
Junior Member with 9 posts.
 
Join Date: Oct 2009
28-Oct-2009, 05:39 PM #6
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?
andreyman3d2k's Avatar
Junior Member with 9 posts.
 
Join Date: Oct 2009
28-Oct-2009, 05:40 PM #7
Sorry, screwed up the attachment. Should work now.
Attached Thumbnails
Solved: Ghostscript not working in Windows XP-ghostscript-screen.jpg  
lotuseclat79's Avatar
Distinguished Member with 21,345 posts.
 
Join Date: Sep 2003
Location: -71.45091, 42.27841
28-Oct-2009, 06:57 PM #8
Quote:
Originally Posted by andreyman3d2k View Post
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
andreyman3d2k's Avatar
Junior Member with 9 posts.
 
Join Date: Oct 2009
28-Oct-2009, 08:00 PM #9
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?
IMM's Avatar
IMM IMM is offline IMM is authorized to help remove malware.
Malware Removal Specialist with 3,260 posts.
 
Join Date: Feb 2002
29-Oct-2009, 02: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/
andreyman3d2k's Avatar
Junior Member with 9 posts.
 
Join Date: Oct 2009
29-Oct-2009, 09: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.
andreyman3d2k's Avatar
Junior Member with 9 posts.
 
Join Date: Oct 2009
29-Oct-2009, 10:50 AM #12
GOT IT TO WORK!!!

I was missing the = sign after -sOutputFile

Thanks so much for your help Tom!

Andrey
Reply

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




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.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 02:12 PM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.