LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-02-2009, 01:53 PM   #1
Sanford Stein
Member
 
Registered: Jun 2008
Location: Evanston, Illinois
Distribution: RHEL 6.4
Posts: 126

Rep: Reputation: 17
No output from ghostscript


I am trying to run ghostscript on postscript files on RHEL 5.3.

For now, I am just trying to get output to the screen.
(Character ssh window.)

When I write a very simple program, I get no output, and the last line from ghostscript is:

>>showpage, press <return> to continue<<

Pressing return just exits the program.

When I run the examples in /usr/share/ghostscript..., I either get no output or garbage similar to the following:

Loading NimbusRomNo9L-Regu font from /usr/share/fonts/default/Type1/n021003l.pfb... 2490224 1176223 1838308 530771 2 done.
Using NimbusRomanNo9L-Regu font for NimbusRomNo9L-Regu.

(The above is from colorcir.ps, which I assume is supposed to display a colored circle.)

Anyone know what is going on? Does ghostscript require a GUI display?

Thanks,
Sanford Stein
 
Old 10-03-2009, 09:29 AM   #2
chris_toliver
LQ Newbie
 
Registered: May 2006
Posts: 5

Rep: Reputation: 0
No output from ghostscript

I think it only requires a GUI is you choose a value
for sDEVICE such as X11. You might typically have
ghostscript output to a file instead of to the GUI with

-sOutputFile=foo.xyz

For printed output (eg to your terminal) choose "standard output".
From the man page:

You can also send output to standard output:

-sOutputFile=-
or
-sOutputFile=%stdout%

Usually only your diagnostic info will go to your terminal.
 
Old 10-05-2009, 09:05 AM   #3
Sanford Stein
Member
 
Registered: Jun 2008
Location: Evanston, Illinois
Distribution: RHEL 6.4
Posts: 126

Original Poster
Rep: Reputation: 17
Chris,

Thanks for your response. I have already tried the -sOutputFile switch in all the forms you suggest (diskfile, standard output) and still get the same lack of output that I described in my original e-mail.

SS
 
Old 10-05-2009, 09:07 AM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680
What kind of output do you want that won't be the same as cat'ing the postscript file? That's the information that would be sent to a printer device.
 
Old 10-06-2009, 08:45 AM   #5
Sanford Stein
Member
 
Registered: Jun 2008
Location: Evanston, Illinois
Distribution: RHEL 6.4
Posts: 126

Original Poster
Rep: Reputation: 17
jschiwal:

My expectation is that ghostscript would display on the screen, or dump to a disk file, whatever the commands in my PostScript file dictate.

For example, here is my test file test.ps, which draws a square:

/inch {72 mul} def % Convert inches->points (1/72 inch)
newpath % Start a new path
10 inch 10 inch moveto % an inch in from the lower left
1 inch 0 inch rlineto % bottom side
0 inch 1 inch rlineto % right side
-1 inch 0 inch rlineto % top side
closepath % Automatically add left side to close path
stroke % Draw the box on the paper
showpage % We're done... eject the page

I would expect 'ghostscript -sOutputFile=- test.ps' to draw the box on my character-based terminal, and 'ghostscript -sOutpuFile=dum.out' to send the box to dum.out. Perhaps a GUI terminal or printer is required as output, but then why does ghostscript permit stdout and file output options?

Thanks,
Sanford Stein
 
Old 10-08-2009, 08:59 AM   #6
chris_toliver
LQ Newbie
 
Registered: May 2006
Posts: 5

Rep: Reputation: 0
I also get the same response as you got in your original post. It ends with:

Using NimbusSansL-Regu font for NimbusSanL-Regu.
>>showpage, press <return> to continue<<

However if I give it the command:

ghostscript -sDEVICE=x11 colorcir.ps

Along with the messages it draws a window with the color circle displayed.

If I want to translate the ps file into a png file so
I could put it in a web page or email for example I do:

ghostscript -sDEVICE=png16 -SOutputFile=color_circle_for_webpage.png colorcir.ps

I get the diagnositic messages and the prompt:

>>showpage, press <return> to continue<<

I press [return], get a GS> prompt.
After I type quit and type ls -ltr
I see the last entry is:

-rw-r--r-- 1 toliver ptcog 25991 Oct 8 09:48 color_circle_for_webpage.png

It has made the file for me there.

If I type:

ghostscript -sDEVICE=png16 -SOutputFile=- colorcir.ps

It fills my terminal with binary gibberish.

The example you showed doesn't draw anything when I try it.
So maybe there is some problem with the postscript coding.
 
Old 10-09-2009, 10:46 AM   #7
Sanford Stein
Member
 
Registered: Jun 2008
Location: Evanston, Illinois
Distribution: RHEL 6.4
Posts: 126

Original Poster
Rep: Reputation: 17
Chris,

Thanks for all your suggestions.

If I use the png16 device, I am able to create an output file and when I point to it with my browser it DOES display what I expect to see.

When I try to use the x11 DEVICE, I get the following:

ESP Ghostscript 815.02: Cannot open X display `(null)'.
**** Unable to open the initial device, quitting.

Running 'startx' produces all kinds of errors. I know that this is unrelated to ghostscript, but do you know what's wrong? Do I need to be on an X windows terminal?

I copied my example gstest.ps directly from a PostScript online tutorial so it may very well be bogus code.

Thanks again,
SS
 
Old 10-13-2009, 05:39 PM   #8
chris_toliver
LQ Newbie
 
Registered: May 2006
Posts: 5

Rep: Reputation: 0
I'm pretty sure that the x11 option requires you to have an X server
running. There might be other options depending on how your ghostscript
was compiled or what libraries you have available.

Type ghostscript --help
and you will get a section that lists
Available devices:

On my system which is a standard redhat enterprise Linux system
there are maybe 150 different options. Included in there is tek4696
which is likely something intended to go to an old tek terminal.
Maybe start googling the terms that might seem similar to your terminal.
Interesting that even though I know I have an X server running the default
output listed is "display". That sounds pretty generic to me.

What do you have for devices when you type ghostscript --help?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Why does Ghostscript PDF output look so bad? Wynd Linux - General 15 08-06-2006 09:49 AM
when Ghostscript is used? xcore_on Linux - Newbie 2 05-24-2006 11:10 PM
ghostscript shifting PDF output upwards sshatz Linux - Software 1 09-22-2004 07:06 PM
Where is ghostscript Kocil Slackware 2 10-18-2003 09:56 PM
need ghostscript help!!! sarah_777 Linux - Newbie 7 05-09-2002 09:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration