Welcome to Linux Knowledge Base and Tutorial
"The place where you learn linux"
HP & Linux

 Create an AccountHome | Submit News | Your Account  

Tutorial Menu
Linux Tutorial Home
Table of Contents

· Introduction to Operating Systems
· Linux Basics
· Working with the System
· Shells and Utilities
· Editing Files
· Basic Administration
· The Operating System
· The X Windowing System
· The Computer Itself
· Networking
· System Monitoring
· Solving Problems
· Security
· Installing and Upgrading
· Linux and Windows

Man Pages
Linux Topics
Test Your Knowledge

Site Menu
Site Map
Copyright Info
Terms of Use
Privacy Info
Masthead / Impressum
Your Account

Private Messages

News Archive
Submit News
User Articles
Web Links


The Web

Who's Online
There are currently, 59 guest(s) and 0 member(s) that are online.

You are an Anonymous user. You can register for free by clicking here




       gs [ options ] [ files ] ... (Unix, VMS)
       gswin32 [ options ] [ files ] ... (MS Windows)
       gswin32c [ options ] [ files ] ... (MS Windows)
       gs386 [ options ] [ files ] ... (DOS for PC)
       gsos2 [ options ] [ files ] ... (OS/2)


       The gs (gswin32, gswin32c, gs386, gsos2)  command  invokes
       Ghostscript,    an    interpreter    of   Adobe   Systems'
       PostScript(tm) and Portable  Document  Format  (PDF)  lan­
       guages.  gs reads "files" in sequence and executes them as
       Ghostscript programs.  After doing this, it reads  further
       input  from  the  standard input stream (normally the key­
       board), interpreting each  line  separately.   The  inter­
       preter quits gracefully when it encounters the "quit" com­
       mand (either in a file or from the keyboard),  at  end-of-
       file,  or at an interrupt signal (such as Control-C at the

       The  interpreter  recognizes  several  switches  described
       below,  which  may appear anywhere in the command line and
       apply to all files thereafter.  Invoking Ghostscript  with
       the -h or -? switch produces a message which shows several
       useful switches, all the devices known to that executable,
       and  the  search path for fonts; on Unix it also shows the
       location of detailed documentation.

       Ghostscript may be built able to use many different output
       devices.   To  see  which devices your executable can use,
       run "gs -h".  Unless  you  specify  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  device  you  determine  with "gs -h".  To specify
       "AbcXyz" as the initial output device, include the switch


       For example, for output to an Epson printer you might  use
       the command

            (x11) selectdevice

       Finally,  you can specify a default device in the environ­
       ment variable GS_DEVICE.   The  order  of  precedence  for
       these  alternatives  from  highest  to lowest (Ghostscript
       uses the device defined highest in the list) is:

            (command line)
            (first device in build list)

       Some printers can print at different  resolutions  (densi­
       ties).   To  specify the resolution on such a printer, use
       the "-r" switch:

            gs -sDEVICE=<device> -r<xres>x<yres>

       For example, on a 9-pin Epson-compatible printer, you  get
       the lowest-density (fastest) mode with

            gs -sDEVICE=epson -r60x72

       and the highest-density (best output quality) mode with

            gs -sDEVICE=epson -r240x72.

       If  you select a printer as the output device, Ghostscript
       also allows you to choose where Ghostscript sends the out­
       put  --  on Unix systems, usually to a temporary file.  To
       send the output to a file "foo.xyz", use the switch


       You might want to print each page separately.  To do this,
       send  the output to a series of files "foo1.xyz, foo2.xyz,
       ..." using the "-sOutputFile=" switch with "%d" in a file­
       name template:


       Each  resulting  file receives one page of output, and the
       files are numbered in sequence.  "%d" is a  printf  format
       specification; you can also use a variant like "%02d".

       On  Unix  systems you can also send output to a pipe.  For
       example, to pipe output to the "lpr"  command  (which,  on
       many  Unix  systems,  directs  it  to  a printer), use the


       for instance


       At  this  time, the known paper sizes, defined in the ini­
       tialization file "gs_statd.ps", are:

       PAPERSIZE    X inches   Y inches   X cm      Y cm
       a0           33.0556    46.7778    83.9611   118.816
       a1           23.3889    33.0556    59.4078   83.9611
       a2           16.5278    23.3889    41.9806   59.4078
       a3           11.6944    16.5278    29.7039   41.9806
       a4           8.26389    11.6944    20.9903   29.7039
       a5           5.84722    8.26389    14.8519   20.9903
       a6           4.125      5.84722    10.4775   14.8519
       a7           2.91667    4.125      7.40833   10.4775
       a8           2.05556    2.91667    5.22111   7.40833
       a9           1.45833    2.05556    3.70417   5.22111
       a10          1.02778    1.45833    2.61056   3.70417
       b0           39.3889    55.6667    100.048   141.393
       b1           27.8333    39.3889    70.6967   100.048
       b2           19.6944    27.8333    50.0239   70.6967
       b3           13.9167    19.6944    35.3483   50.0239
       b4           9.84722    13.9167    25.0119   35.3483
       b5           6.95833    9.84722    17.6742   25.0119
       archA        9          12         22.86     30.48
       archB        12         18         30.48     45.72
       archC        18         24         45.72     60.96
       archD        24         36         60.96     91.44
       archE        36         48         91.44     121.92
       flsa         8.5        13         21.59     33.02
       flse         8.5        13         21.59     33.02
       halfletter   5.5        8.5        13.97     21.59
       note         7.5        10         19.05     25.4
       letter       8.5        11         21.59     27.94
       legal        8.5        14         21.59     35.56
       11x17        11         17         27.94     43.18
       ledger       17         11         43.18     27.94

       Note that the B paper sizes are ISO sizes: for information
       about using JIS B sizes, see Use.htm.

       Ghostscript  can  do  many things other than print or view
       PostScript and PDF files.  For example,  if  you  want  to
       know  the  bounding  box  of  a  PostScript (or EPS) file,
       Ghostscript provides a special "device" that  just  prints
       out this information:

                 gs -sDEVICE=bbox myfile.ps

       tor, Ghostscript first tries to open  the  file  with  the
       name  as  given, using the current working directory if no
       directory is specified.  If this fails, and the file  name
       doesn't  specify  an  explicit  directory  or  drive  (for
       instance, doesn't contain "/" on Unix systems  or  "\"  on
       DOS systems), Ghostscript tries directories in this order:

       1.  the directories specified by the -I  switches  in  the
           command line (see below), if any;

       2.  the  directories  specified  by the GS_LIB environment
           variable, if any;

       3.  the directories specified by the GS_LIB_DEFAULT  macro
           in  the  Ghostscript  makefile when the executable was
           built.  When gs is built on  Unix,  GS_LIB_DEFAULT  is
           where  "#.##"  represents the Ghostscript version num­

       Each of these (GS_LIB_DEFAULT, GS_LIB, and  -I  parameter)
       may  be either a single directory or a list of directories
       separated by ":".


       Ghostscript looks for the following  resources  under  the
       program name "Ghostscript":

              The border width in pixels (default = 1).

              The name of the border color (default = black).

              The  window size and placement, WxH+X+Y (default is

              The number of x pixels per inch  (default  is  com­
              puted from WidthOfScreen and WidthMMOfScreen).

              The  number  of  y pixels per inch (default is com­
              puted from HeightOfScreen and HeightMMOfScreen).

              Determines whether backing store is to be used  for
              saving display window (default = true).

       See  the  usage  document  for  a  more  complete  list of
              Takes the next argument as a file  name  as  usual,
              but  takes  all  remaining  arguments (even if they
              have the syntactic form of  switches)  and  defines
              the  name  "ARGUMENTS"  in "userdict" (not "system­
              dict") as an array of those strings, before running
              the  file.  When Ghostscript finishes executing the
              file, it exits back to the shell.

              Define a name in "systemdict" with the given  defi­
              nition.   The  token  must be exactly one token (as
              defined by the "token" operator) and may contain no

       -dname Define a name in "systemdict" with value=null.

              Define  a  name in "systemdict" with a given string
              as value.  This is different from -d.  For example,
              -dname=35 is equivalent to the program fragment
                        /name 35 def
              whereas -sname=35 is equivalent to
                        /name (35) def

       -q     Quiet  startup:  suppress  normal startup messages,
              and also do the equivalent of -dQUIET.

              Equivalent to -dDEVICEWIDTH=number1  and  -dDEVICE­
              HEIGHT=number2.  This is for the benefit of devices
              (such as X11 windows) that require (or allow) width
              and height to be specified.

              Equivalent to -dDEVICEXRESOLUTION=number1 and -dDE­
              VICEYRESOLUTION=number2.  This is for  the  benefit
              of devices such as printers that support multiple X
              and Y resolutions.  If only one number is given, it
              is used for both X and Y resolutions.

              Adds the designated list of directories at the head
              of the search path for library files.

       -      This is not  really  a  switch,  but  indicates  to
              Ghostscript  that  standard  input is coming from a
              file or a pipe and not interactively from the  com­
              mand  line.   Ghostscript reads from standard input
              Disables the "deletefile" and  "renamefile"  opera­
              tors  and  the  ability  to  open files in any mode
              other than read-only. This is desirable for  spool­
              ers  or any other environments where a malicious or
              badly written PostScript program must be  prevented
              from changing important files.

              Causes  Ghostscript  to  exit  after processing all
              files  named  on  the  command  line,  rather  than
              prompting for further PostScript commands.

              Disables  the  prompt  and pause at the end of each
              page. This may be desirable in converting documents
              or  for applications where another program is driv­
              ing Ghostscript.

              Selects an  alternate  initial  output  device,  as
              described above.

              Selects  an alternate output file (or pipe) for the
              initial output device, as described above.

              Suppresses the normal initialization of the  output
              device.  This may be useful when debugging.

              Disables  character caching. Useful only for debug­

              Disables  the  "bind"  operator.  Useful  only  for

              Disables  the use of fonts supplied by the underly­
              ing platform (for instance X Windows). This may  be
              needed  if the platform fonts look undesirably dif­
              ferent from the scalable fonts.

              Causes individual character outlines to  be  loaded
              from  the disk the first time they are encountered.
              (Normally Ghostscript loads all the character  out­
              lines when it loads a font.) This may allow loading
              more fonts into RAM, at the expense of slower  ren­

       location of Ghostscript documentation on your system, from
       which you can get more details.

              Startup  files,  utilities,  and basic font defini­

              More font definitions

              Ghostscript demonstration files

              Diverse document files


              String of options to be processed before  the  com­
              mand line options

              Used to specify an output device

              Path names used to search for fonts

       GS_LIB Path names for initialization files and fonts

       TEMP   Where temporary files are made


       The various Ghostscript document files (above), especially


       See the Usenet news group comp.lang.postscript.


       This document was last  revised  for  Ghostscript  version


       L.  Peter  Deutsch  <ghost@aladdin.com>  is  the principal
       author of Ghostscript.  Russell J. Lang  <rjl@aladdin.com>
       is   the  author  of  most  of  the  MS  Windows  code  in

7.05                      22 April 2002                     GS(1)

The Linux Tutorial is always looking for new contributors.



Security Code
Security Code
Type Security Code

Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.

Help if you can!

Amazon Wish List

Did You Know?
The Linux Tutorial welcomes your suggestions and ideas.


Tell a Friend About Us

Bookmark and Share

Web site powered by PHP-Nuke

Is this information useful? At the very least you can help by spreading the word to your favorite newsgroups, mailing lists and forums.
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters. Articles are the property of their respective owners. Unless otherwise stated in the body of the article, article content (C) 1994-2013 by James Mohr. All rights reserved. The stylized page/paper, as well as the terms "The Linux Tutorial", "The Linux Server Tutorial", "The Linux Knowledge Base and Tutorial" and "The place where you learn Linux" are service marks of James Mohr. All rights reserved.
The Linux Knowledge Base and Tutorial may contain links to sites on the Internet, which are owned and operated by third parties. The Linux Tutorial is not responsible for the content of any such third-party site. By viewing/utilizing this web site, you have agreed to our disclaimer, terms of use and privacy policy. Use of automated download software ("harvesters") such as wget, httrack, etc. causes the site to quickly exceed its bandwidth limitation and are therefore expressly prohibited. For more details on this, take a look here

PHP-Nuke Copyright © 2004 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.19 Seconds