Previous Next Table of Contents

4. Resources

Resource files

In general gv does not depend on any external resource files. However, when starting gv, preferences are read from

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.

Resources of gv

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.

antialias

Whether antialiasing should be used. Valid values are "True" and "False".

autoCenter

Whether the displayed page should automatically be centered (for instance when opening a new file). Valid values are "True" and "False".

autoResize

Whether gv is allowed to resize the main window according to the size of the current page. Valid values are "True" and "False".

confirmPrint

Whether printing requires an extra confirmation. Valid values are "True" and "False".

confirmQuit

Whether leaving gv requires extra confirmation. Valid values are "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.

scrollingEyeGuide

If this resource is "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".

ignoreEOF

Defines the behaviour of the postscript scanner as described in the Options section. Valid values are "True" and "False".

respectDSC

Determines whether gv should attempt to respect document structuring comments. Valid values are "True" and "False".

reverseScrolling

Defines the interpretation of directions when scrolling with the mouse. Valid values are "True" and "False".

swapLandscape

Whether the meaning of "landscape" and "seacape" should be interchanged. Valid values are "True" and "False".

scratchDir

Specifies a directory used to store temporary data.

defaultSaveDir

Specifies the default destination directory for files to be saved.

useBackingPixmap

If the value of this resource is "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.

watchFile

Whether the document should be checked periodically and updated automatically if changes are detected. Valid values are "True" and "False".

watchFileFrequency

Defines the time in milliseconds elapsing between successive checks of the document when watchFile is set to "True". Allowed values must be larger than 500.

printCommand

The command used for printing a file. The command may contain multiple '%s' wildcards which will be replaced by the name of the file to be printed.

gsInterpreter

The command used to start the ghostscript interpreter.

gsCmdScanPDF

The command used to extract document structuring comments from a PDF file.

gsCmdConvPDF

The command used to convert a PDF file to PostScript.

gsX11Device

The ghostscript command line option which activates the "X11" device.

gsX11AlphaDevice

The ghostscript command line option which activates the "X11" device with antialiasing enabled.

gsSafer

Determines whether ghostscript should be started with the "-dSAFER" command line option.

gsQuiet

Determines whether ghostscript should be started with the "-dQUIET" command line option.

gsArguments

May be used to provide additional command line options for the ghostscript interpreter. Starting gv with the "-arguments <arguments>" option will override this resource setting.

magMenu

Describes the menu that pops up when preparing to to zoom an area of the displayed page.

dirs

Defines a list of directories accessible via the 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.

filter

Defines the default filter to be used when displaying a directory contents in the file selection window. A filter is specified according to the syntax

   <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".

filters

Defines a list of filters offered in the Filters menu of the file selection window. The filter "None" has a special meaning causing all files to be displayed when the corresponding menu entry is selected.

miscMenuEntries

Describes the menu that pops up when clicking with the third mouse button on the displayed page. The value of this resource is a list of menu entries. Allowed entries are "update", "redisplay", "toggle_current", "toggle_even", "toggle_odd", "unmark", "stop", "print_all", "print_marked", "save_all", "save_marked" and "line".

showTitle

Whether the name of the displayed document should be shown in the title bar of the window. The name of gv's icon will also change accordingly if this resource is set to "True".

maximumWidth, maximumHeight

When resizing gv will not attempt to exceed the size specified by these resources. These resources may be specified as a positive integer or as "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.

minimumWidth, minimumHeight

Defines a minimum size for the main window. Valid values for both resources are positive integers larger than 200.

scale

Sets the initial scale. The value of this resource is the offset of the scale to be selected relative to the scale 1.0 in the the "Scale" menu.

scaleBase

Selects the initial scale base. The value of this resource should be a positive integer.

scales

Defines the available scales bases and scales in the "Scale" menu.

orientation

Sets the initial orientation. Valid values are "portrait", "landscape","seascape", "upside-down" and "automatic". "automatic" causes gv to attempt to derive the correct orientation from document structuring comments.

fallbackOrientation

Defines the paper-size to be used when automatic orientation detetction fails. Valid values are "portrait", "landscape","seascape" and "upside-down".

medias

A list describing the page medias known to gv. List entries starting with "!" or "#" will not appear in the "Media" menu but will still be used for automatic paper size detection.

pagemedia

Sets the paper size. Allowd values are as given in the above list of paper-sizes. Specifying "automatic" causes gv to attempt to derive the correct paper-size from document structuring comments.

fallbackPageMedia

Defines the paper-size to be used when automatic paper-size detetction fails. Valid values are as given in the above list of paper-sizes.

The default user and system specific resource file

GV.pageMedia:           automatic
GV.orientation:         automatic
GV.fallbackOrientation: portrait
GV.swapLandscape:       False
GV.autoCenter:          True
GV.antialias:           False
GV.respectDSC:          True
GV.ignoreEOF:           True
GV.confirmPrint:        True
GV.reverseScrolling:    False
GV.scrollingEyeGuide:   True
GV.autoResize:          True
GV.maximumWidth:        screen-20
GV.maximumHeight:       screen-44
GV.minimumWidth:        400
GV.minimumHeight:       430
GV.confirmQuit:         1
GV.watchFile:           False
GV.watchFileFrequency:  1000
GV.showTitle:           True
GV.miscMenuEntries:     redisplay       \n\ 
                        # update        \n\ 
                        stop            \n\ 
                        line            \n\ 
                        toggle_current  \n\ 
                        toggle_even     \n\ 
                        toggle_odd      \n\ 
                        unmark          \n\ 
                        line            \n\ 
                        print_all       \n\ 
                        print_marked    \n\ 
                        save_all        \n\ 
                        save_marked
GV.scale:               0
GV.scaleBase:           1
GV.scales:              Natural size,   1.000,  screen  \n\ 
                        Pixel based,    1.000,  pixel   \n\ 
                        0.100,          0.100           \n\ 
                        0.125,          0.125           \n\ 
                        0.250,          0.250           \n\ 
                        0.500,          0.500           \n\ 
                        0.707,          0.707           \n\ 
                        1.000,          1.000           \n\ 
                        1.414,          1.414           \n\ 
                        2.000,          2.000           \n\ 
                        4.000,          4.000           \n\ 
                        8.000,          8.000           \n\ 
                        10.00,          10.00
GV.medias:              Letter,         612     792     \n\ 
                        # LetterSmall,  612     792     \n\ 
                        Legal,          612     1008    \n\ 
                        Statement,      396     612     \n\ 
                        Tabloid,                792     1224    \n\ 
                        Ledger,         1224    792     \n\ 
                        Folio,          612     936     \n\ 
                        Quarto,         610     780     \n\ 
                        # 7x9,          504     648     \n\ 
                        # 9x11,         648     792     \n\ 
                        # 9x12,         648     864     \n\ 
                        # 10x13,                720     936     \n\ 
                        10x14,          720     1008    \n\ 
                        Executive,      540     720     \n\ 
                        # A0,           2384    3370    \n\ 
                        # A1,           1684    2384    \n\ 
                        # A2,           1191    1684    \n\ 
                        A3,             842     1191    \n\ 
                        A4,             595     842     \n\ 
                        # A4Small,      595     842     \n\ 
                        A5,             420     595     \n\ 
                        # A6,           297     420     \n\ 
                        # A7,           210     297     \n\ 
                        # A8,           148     210     \n\ 
                        # A9,           105     148     \n\ 
                        # A10,          73      105     \n\ 
                        # B0,           2920    4127    \n\ 
                        # B1,           2064    2920    \n\ 
                        # B2,           1460    2064    \n\ 
                        # B3,           1032    1460    \n\ 
                        B4,             729     1032    \n\ 
                        B5,             516     729     \n\ 
                        # B6,           363     516     \n\ 
                        # B7,           258     363     \n\ 
                        # B8,           181     258     \n\ 
                        # B9,           127     181     \n\ 
                        # B10,          91      127     \n\ 
                        # ISOB0,                2835    4008    \n\ 
                        # ISOB1,                2004    2835    \n\ 
                        # ISOB2,                1417    2004    \n\ 
                        # ISOB3,                1001    1417    \n\ 
                        # ISOB4,                709     1001    \n\ 
                        # ISOB5,                499     709     \n\ 
                        # ISOB6,                354     499     \n\ 
                        # ISOB7,                249     354     \n\ 
                        # ISOB8,                176     249     \n\ 
                        # ISOB9,                125     176     \n\ 
                        # ISOB10,       88      125     \n\ 
                        # C0,           2599    3676    \n\ 
                        # C1,           1837    2599    \n\ 
                        # C2,           1298    1837    \n\ 
                        # C3,           918     1296    \n\ 
                        # C4,           649     918     \n\ 
                        # C5,           459     649     \n\ 
                        # C6,           323     459     \n\ 
                        # C7,           230     323     \n\ 
                        # DL,           312     624
GV.magMenu:             2,      2       \n\ 
                        4,      4       \n\ 
                        8,      8       \n\ 
                        16,     16      \n\ 
                        32,     32      \n\ 
                        64,     64
GV*Ghostview.background:                white
GV*Ghostview.foreground:                black
GV.gsInterpreter:       gs
GV.gsCmdScanPDF:        gs -dNODISPLAY -dQUIET -sPDFname=%s -sDSCname=%s pdf2dsc.ps -c quit
GV.gsCmdConvPDF:        gs -dNODISPLAY -dQUIET  -dNOPAUSE -sPSFile=%s %s -c quit
GV.gsX11Device:         -sDEVICE=x11
GV.gsX11AlphaDevice:    -dNOPLATFONTS -sDEVICE=x11alpha
GV.gsSafer:             True
GV.gsQuiet:             True
GV.gsArguments:
GV.uncompressCommand:   gzip -d -c %s > %s
GV.printCommand:        lpr
GV.scratchDir:          ~/
GV.defaultSaveDir:      ~/
GV.fallbackPageMedia:   a4
GV.useBackingPixmap:    True
GV*dirs:                Home\n\ 
                        Tmp\n\ 
                        /usr/doc\n\ 
                        /usr/local/doc
GV*filter:              no .*
GV*filters:             None\n\ 
                        *.*ps* *.pdf*  no  .*\n\ 
                        *.*ps*   no  .*\n\ 
                        *.pdf*  no  .*\n\ 
                        no  .*


Previous Next Table of Contents