GNU gv - View PostScript and PDF documents using ghostscript.
This is the First edition of the GNU gv Manual, updated for gv version 3.6.1.
Copyright © 1995, 1996, 1997 Johannes Plass
Copyright © 2004 José E. Marchesi
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 or any later version published by the Free Software Foundation.
GNU gv allows to view and navigate through PostScript and PDF documents on an X display by providing a user interface for the ghostscript interpreter.
Please note that gv is derived from Tim Theisen's ghostview.
Usage: gv [OPTION]... [FILE] PostScript and PDF viewer. --monochrome display document using only black and white --grayscale display document without colors --color display document as usual --safer start ghostscript in safe mode --nosafer do not start ghostscript in safe mode --quiet start ghostscript with the -dQUIET option --noquiet do not start ghostscript with the -dQUIET option --arguments=ARGS start ghostscript with additional options as specified by the string ARGS --page=LABEL display the page with label LABEL first --center the page should be centered automatically --nocenter the page should not be centered automatically --media=MEDIA selects the paper size to be used --orientation=ORIENTATION sets the orientation of the page --scale=N selects the scale N --scalebase=N selects the scale base N --swap interchange the meaning of the orientations landscape and seascape --noswap do not interchange the meaning of the orientation landscape and seascape --antialias use antialiasing --noantialias do not use antialiasing --dsc dsc comments are respected --nodsc dsc comments are not respected --eof ignore the postscript EOF comment while scanning documents --noeof do not ignore the postscript EOF comment while scanning documents --pixmap use backing pixmap --nopixmap do not use backing pixmap --watch watch the document file for changes --nowatch do not watch the document file for changes --help print a help message and exit --usage print a usage message and exit --resize fit the size of the window to the size of the page --noresize do not fit the size of the window to the size of the page -geometry [<width>][x<height>][{+-}<xoffset>{+-}<yoffset>] --ad=FILE read and use additional resources from FILE --style=FILE read and use additional resources from FILE. These resources have lower priority than those provided on the context of --ad --spartan shortcut for --style=gv_spartan.dat --version show gv version and exit
--ad=
file--style
option.
--antialias, --noantialias
--arguments=
args--center, --nocenter
--dsc, --nodsc
--nodsc
is used gv
will not attempt to examine the structure of the document but will
pass the file to the ghostscript interpreter as a whole. In this case no
page numbers are shown and freely moving around in the document is not
possible. This option may help when viewing files not conforming to
the document structuring conventions.
--eof, --noeof
--noeof
is used the scanner will
ignore end of file (EOF) comments. This may help when
viewing documents which import other documents without enclosing them
within the proper "BeginDocument" and "EndDocument" comments. If
--eof
is used, the scanner treats an EOF comment as
marking the end of the file.
--pixmap, --nopixmap
--pixmap
is used gv tries to maintain off-screen regions of
the displayed page by allocating a sufficiently large pixmap. If
--nopixmap
is used the X Server is responsible for
maintaining obscured portions of the displayed page (see also the
useBackingPixmap resource).
--version
--help, --usage
--scale=
n--scalebase
n--monochrome, --grayscale, --color
--media=
media--page=
label--orientation=
orientationportrait
,
landscape
, seascape
and upsidedown
.
--quiet, --noquiet
-dQUIET
option.
--resize, --noresize
--safer, --nosafer
-dSAFER
option.
--spartan
--style=gv_spartan.dat
.
--style=
file--ad
option.
--swap, --noswap
--watch, --nowatch
--watch
option causes gv to check the document
periodically. If changes are detected gv will
automatically display the newer version of the file.
The document is by default checked once every second.
This can be changed via the watchFileFrequency resource.
Note that sending gv the SIGHUP signal also causes
an update of the displayed document. This method
may be used by document creators to trigger gv
remotely.
In general gv does not depend on any external resource files. However, when starting gv, preferences are read from
Administrators may want to modify this file in order
to set up gv according to the local needs of their system.
XUSERFILESEARCHPATH
environment variable.
The files gv_user.ad and gv_system.ad (located in the library directory of gv, which is most probably either /usr/local/lib/gv/ or /usr/lib/gv/ may serve as a basis for constructing the user and system specific resource files.
Note that the user and system specific resource files are not the only sources of preferences taken into account when gv is started. However, in practice these are the most important.
The following describes some of the resources of gv. The precise syntax of some of the resource values may be inferred from the appended default system specific resource file.
True
and False
.
It defaults to True
.
True
and False
.
It defaults to True
.
True
and False
.
It defaults to True
.
True
and False
.
It defaults to True
.
0
(Never), 1
(When processing) and 2
(Always).
The default value is 1
, which causes
a confirmation request when trying to leave gv
in the presence of pending PDF to Postscript conversions.
True
scrolling via the
keyboard causes a temporary border to be drawn around the
previously visible area of the page.
Allowed values are True
and False
.
It defaults to True
.
True
and False
.
It defaults to True
.
True
and False
.
It defaults to True
.
True
and False
.
It defaults to False
.
landscape
and seacape
should be interchanged.
Valid values are True
and False
.
It defaults to False
.
It defaults to the invocation directory.
It defaults to the home directory, ~/.
False
the X Server
is advised that saving off-screen pixels of the displayed page
would be beneficial (maintaining backing store). In this case gv
does not actively maintain the contents of the page but relies
on the X Server. The server is, however, always free to stop
maintaining backing backing store.
If the value of this resource is True
the X Server
is advised that maintaining backing store is not useful.
In this case gv attempts to allocate a sufficiently large pixmap
to store the contents of the displayed page.
It defaults to True
.
True
and False
.
It defaults to False
.
True
.
Allowed values must be larger than 500.
It defaults to 1000
.
%s
wildcards
which will be replaced by the name of the file to be
printed.
It defaults to lpr
.
It defaults to gv
.
It defaults to gs -dNODISPLAY -dQUIET -sPDFname=%s -sDSCname=%s pdf2dsc.ps -c quit
It defaults to gs -dNODISPLAY -dQUIET -dNOPAUSE -sPSFile=%s %s -c quit
It defaults to -sDEVICE=x11
It defaults to -dNOPLATFONTS -sDEVICE=x11alpha
-dSAFER
command line option.
It defaults to True
.
-dQUIET
command line option.
It defaults to True
.
-arguments
arguments
option will override this resource setting.
It defaults to the empty string.
Directories
menu in the file selection window.
The special value Home
corresponds to the users home directory,
the value Tmp
corresponds to the scratch directory as defined
by the scratchDir resource.
It defaults to Home Tmp /usr/doc /usr/local/doc
<filter> := [<filespecs>] [no <filespecs>] <filespecs> := <filespec> [<filespecs>] <filespec> := filename possibly including wildcards '*' which match any character.
Example: The filter
GV*filter: *.ps *.pdf no .*
screens out all files with names starting with a dot and keeps of the remaining ones only those which end on .ps or .pdf.
It defaults to no .*
None
has a special meaning
causing all files to be displayed when the corresponding
menu entry is selected.
Allowed entries are
update
reload
toggle_current
toggle_even
toggle_odd
unmark
stop
print_all
print_marked
save_all
save_marked
line
True
.
It defaults to True
.
screen
, optionally combined with
a positive or negative offset.
The default values listed above provide examples for this syntax.
screen
will automatically be replaced by the size of the
screen.
maximumWidth
defaults to screen-20
.
maximumHeight
defaults to screen-44
.
minimumWidth
defaults to 400
.
minimumHeight
defaults to 430
.
It defaults to 0
.
It defaults to 1
.
portrait
landscape
seascape
upside-down
automatic
automatic
causes gv to attempt
to derive the correct orientation from document structuring
comments.
It defaults to automatic
.
portrait
, landscape
,
seascape
and upside-down
.
It defaults to portrait
.
!
or #
will not appear in the
Media menu but will still be used for automatic paper size
detection.
automatic
causes gv to attempt
to derive the correct paper-size from document structuring
comments.
It defaults to automatic
.
It defaults to a4
.
The following mouse events are defined when the mouse pointer is either on the displayed page or on a zoomed area:
The following mouse events are defined when the mouse pointer is in the window of either a file or a directory list:
The following mouse events are defined when the mouse pointer is in the window showing a list of page numbers of the current file (table of contents):
The Panner widget is the rectangular region located close to the left edge of the main window. It indicates the size and the position of the visible area of the current page relative to the total page.
The following mouse events are defined when the mouse pointer is in this region:
The << and >> buttons are used to move to another page. The following mouse events are defined:
The following key events are defined in the main window. Those bindings scrolling the page are also defined in zoom popups.
The Scale menu which allows to view the document at different sizes is divided into two parts. The first part shows a list of available scale bases, the second part, separated by a line, lists the relative scales which are applied with respect to the selected scale base.
By default two scales bases are available, the Natural size and the Pixel based base. When choosing the Pixel based scale base a relative scale of 1.0 causes one postscript point to correspond to one pixel on the screen.
When viewing a document at a relative scale of 1.0 using the Natural size base the page should appear in its real size, as if printed on paper. For the Natural size base to work properly gv has to know the correct size of the root window. Automatic detection of this size unfortunately only provides approximate results, therefore it is best if it is provided by the user. To do so the resource
GV.screenSize: <width> x <height>
should be added to the SCREEN_RESOURCES
property of the screen
the document is viewed on, with width and height
describing the width and height of the root window in units of millimeters.
For instance by using the command
echo "GV.screenSize: 396 x 291" | xrdb -override -screen
a width of 346 mm and a height of 291 mm will be used for the Natural size scale base. Alternatively the resource
GV.screenSize_<machine>_<disp>_<scr>: <width> x <height>
may be added to a resource file read by gv. Here
machine ,disp and ANGLED describe
the display on which gv displays the document.
For instance, if the display is set to tic.tac.toe.wo:0.1
the resource should be specified as
GV.screenSize_tic_0_1: 396 x 291
Note that this method doesn't work on VMS. As a last alternative the resource
GV.screenSize: <width> x <height>
may be added to one of the resource files. However, for obvious reasons this method should be used only on single user machines.
It is probably a de facto standard for user interfaces that windows are supposed to be scrolled by means of scrollbars attached to their sides. However, for various reasons the use of scrollbars has been minimized in gv.
Instead, in all windows with obscured data, scrolling may be performed by
pressing button1, moving the mouse, then releasing button1
directly in the window. This includes the displayed page, zoom popups, the table of contents and the file and directory lists displayed in the file selection popup.
During document creation it is usually desirable to always display the newest version of the document in work.
Instead of explicitly loading it via the file selection popup the most recent version can be displayed by pressing the Reload button in the main window (VMS users should use the Update File entry in the File menu). Choosing the Reload entry in the menu that pops up when clicking with the third mouse button anywhere on the displayed page certainly has the same effect.
More comfortable is the "Watch File" feature which may be switched on by selecting the corresponding entry in the State menu. If activated gv will check every now and then if a new version of the displayed file exists. If so it will be displayed automatically. By default the file is checked about once every second.
Finally it may also be left to the document creating program to trigger gv to update its display. To do so the program should send the SIGHUP signal to gv. For instance at the end of a shell script generating a postscript file from latex sources the line
kill -SIGHUP <gv_pid>
may be added (here gv_pid is the process id of gv). Executing the script and thereby creating a new version of the document will then also cause the result to be displayed instantaneously. Please note that this feature is available only on X11 R6 based systems.
They have been removed in order to make more room for the image. The displayed portion of the image may be moved by dragging the image or the paner (panel between the "Save Marked" and << >> buttons) with the mouse. Alternatively, the cursor arrow keys can be used.
Use the "spartan" style by starting gv with the command
gv -spartan
This removes the "Open", "Print", "Save", "Reload", and page marking buttons (they are still available from the "File" and "Page" menus) and replaces them with the document attribute controls, which are normally along the top.
Antialiasing can improve the display of bitmapped fonts (eg. from TeX) when displayed on a colour or greyscale screen. The same technique is used by xdvi. Note that antialiasing requires at least Ghostscript version 4.x.
Antialiasing can be turned on from the "State" menu, and can be made
default by saving the setting in State | gv Options...
.
There are two methods that can be used to save the contents of the window when it's not currently displayed: backing store and backing pixmap. Some X-servers seem to support only backing store (eg. VAXstations) and some only backing pixmap (eg. some X-terminals, including EWS).
In order to force gv to use one method or the other, use the
State | Setup Options ...
menu and toggle the "Backing Pixmap" button.
When selected/highlighted (normally the default), gv will use backing
pixmap; otherwise it will use backing store. Select "Apply" to use a new
setting and "Save" to make it the new default.
When the GHOSTVIEW
environment variable is set, ghostscript
draws on an existing drawable rather than creating its own window.
Ghostscript can be directed to draw on either a window or a pixmap.
The GHOSTVIEW
environment variable contains the window id of
the target window. The window id is an integer. Ghostscript will use
the attributes of the window to obtain the width, height, colormap,
screen, and visual of the window. The remainder of the information is
gotten from the GHOSTVIEW property on that window.
The GHOSTVIEW environment variable contains a window id and a pixmap id. They are integers separated by white space. Ghostscript will use the attributes of the window to obtain the colormap, screen, and visual to use. The width and height will be obtained from the pixmap. The remainder of the information, is gotten from the GHOSTVIEW property on the window. In this case, the property is deleted when read.
window-id [pixmap-id]
"%d %d"
Explanation of parameters:
window-id
pixmap-id
bpixmap orient llx lly urx ury xdpi ydpi [left bottom top right]
"%d %d %d %d %d %d %f %f %d %d %d %d"
Explanation of parameters:
pixmap
orient
llx, lly, urx, ury
xdpi, ydpi
left, bottom, top, right (optional)
If the final destination is a pixmap, the client will get a property notify event when ghostscript reads the GHOSTVIEW property causing it to be deleted.
Ghostscript sends events to the window where it read the GHOSTVIEW property. These events are of type ClientMessage. The message_type is set to either PAGE or DONE. The first long data value gives the window to be used to send replies to ghostscript. The second long data value gives the primary drawable. If rendering to a pixmap, it is the primary drawable. If rendering to a window, the backing pixmap is the primary drawable. If no backing pixmap is employed, then the window is the primary drawable. This field is necessary to distinguish multiple ghostscripts rendering to separate pixmaps where the GHOSTVIEW property was placed on the same window.
The PAGE message indicates that a "page" has completed. Ghostscript will wait until it receives a ClientMessage whose message_type is NEXT before continuing.
The DONE message indicates that ghostscript has finished processing.
%!PS-Adobe-<real> [EPSF-<real>] %%BoundingBox: <int> <int> <int> <int>|(atend) %%CreationDate: <textline> %%Orientation: Portrait|Landscape|(atend) %%Pages: <uint>|(atend) %%PageOrder: Ascend|Descend|Special|(atend) %%Title: <textline> %%DocumentMedia: <text> <real> <real> <real> <text> <text> %%DocumentPageSizes: <text> %%EndComments
Preview section:
%%BeginPreview %%EndPreview
Defaults section:
%%BeginDefaults %%PageBoundingBox: <int> <int> <int> <int>|(atend) %%PageOrientation: Portrait|Landscape %%PageMedia: <text> %%EndDefaults
Prolog section:
%%BeginProlog %%EndProlog
Setup section:
%%BeginSetup %%PageBoundingBox: <int> <int> <int> <int>|(atend) %%PageOrientation: Portrait|Landscape %%PaperSize: <text> %%EndSetup
Page properties:
%%Page: <text> <uint> %%PageBoundingBox: <int> <int> <int> <int>|(atend) %%PageOrientation: Portrait|Landscape %%PageMedia: <text> %%PaperSize: <text>
%%Trailer %%EOF
Document section:
%%BeginDocument: <text> [<real>[<text>]] %%EndDocument
Binary section:
%%BeginBinary: <uint> %%EndBinary
Data section:
%%BeginData: <uint> [Hex|Binary|ASCII[Bytes|Lines]] %%EndData
Letter 612x792 LetterSmall 612x792 Tabloid 792x1224 Ledger 1224x792 Legal 612x1008 Statement 396x612 Executive 540x720 A0 2384x3371 A1 1685x2384 A2 1190x1684 A3 842x1190 A4 595x842 A4Small 595x842 A5 420x595 B4 729x1032 B5 516x729 Envelope ???x??? Folio 612x936 Quarto 610x780 10x14 720x1008
Copyright © 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software—to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and modification follow.
Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and “any later version”, you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.
one line to give the program's name and an idea of what it does. Copyright (C) year name of author This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
The hypothetical commands show w and show c should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than show w and show c; they could even be mouse-clicks or menu items—whatever suits your program.
You should also get your employer (if you work as a programmer) or your school, if any, to sign a “copyright disclaimer” for the program, if necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. signature of Ty Coon, 1 April 1989 Ty Coon, President of Vice
This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License.