These batch files are destined for previewing PostScript files under DOS
using ghostscript, but more comfortably. They were inspired by gsvi4dos by
P. Mikulik. The idea is to change temporarily some keys on keyboard and then
run ghostscript on the file ps_view.ps by P. Pianowski and B. Jackowski and
an input PostScript file. Then it is possible to browse through the input
file using PgUp, PdDn, ^PgUp, ^PgDn, to move on page using arrows, to scale
continuously etc. The keyboard layout is different from that one proposed
in the package ps_view.zip of P. Pianowski and B. Jackowski. Some other
ideas from this package were used.

In gsvi4dos not all the functions offered by ps_view.ps were accessible and
there was trouble with displaying some files (e.g. metapost.ps or
pst-user.ps from pstricks; the reading get cycled). The file ps_view.ps
is slightly modified. Two more parameters are now saved in a restore file.
Full path of input PS files is now first found using findlibfile command
(GS 3.12 and 3.33 finds a file in the directories given by gs_lib
environment variable and -I switch if the full path is not given only on
the command line but not when run is used).

INSTALLATION
============
1. The files !psview.bat and !view*.bat should be put into the directory
   given in PATH or !psview.bat should be edited and full path to !view*.bat
   added.
2. The files ps_view.ps and gs312.ps should be put where ghostscript looks
   for its initialization files.
3. Something like device=c:\dos\ansi.sys must be added to config.sys
   (and the system rebooted).
4. In !psview.bat the right version of ghostscript must be given
5. In view2.bat on line 17 or 21 the right path to ghostscript should be
   added or a directory with ghostscript should be given in PATH. The right
   name of ghostscript must be given here (gs386 or gs).
   Dont forget that dos4gw.exe must be in the current directory or in the
   directory given in PATH.
6. It is necessary to set gs_lib environment variable, i.e. something like
            set gs_lib=c:\gs;c:\gs\fonts;.\
   or in view2.bat on line 17 or 21 to add the switch -I, i.e. something
   like
            command /cgs386 -Ic:\gs;c:\gs\fonts;.\ ...
   If this command line is to long (max 128 characters), you can use
            command /cgs386 @sw_file ...
   and put the switch -I (and perhaps some other ones) to the file sw_file.


In !view2.bat the program gs.exe is called through command.com.
Otherwise when ghostscript is stopped by ^C, the standard keyboard layout
is not reset.

If a restore file with the default name (!ps_rest.ps) is found in the current
directory, an input PostScript file is displayed with the previously saved
parameters (size of shift, magnification, magnification factor,page number,
position on page etc.).

USE
===
To display PostScript input_file in the current directory or in the directories
given by -I or gs_lib run
          !psview input_file.
Otherwise the full path must be given with all backslashes doubled, e.g.
          !psview c:\\emtex\\gs\\input_file.

VERSION OF GHOSTSCRIPT
=====================
This previewer works with ghostscript ver. 2.52, 2.61, 3.12 and 3.33.
I have no experience with other versions.

CONTROLLING THE PREVIEWER (HOT KEYS)
====================================
(std means default setting, [...] is an optional parameter)

   [<n>] PgDn           go by <n> pages forward (std 1)
   [<n>] PgUp           go by <n> pages backwards (std 1)
    Ctrl PgDn           go to the last page
    Ctrl PgUp           go to the first page
   [<n>] arrow          shift by <n> in the direction of arrow
                        (std according to the setting of s)
   [<n>] Alt p          go to the <n>th page (counted from the beginning)
      Alt i             display the current page with initial parameters
      Alt w             display the whole page
      Alt c             redraw the current page
        F5              reset screen graphics (text cursor)
       End              scale the page 1.2 times
       Home             scale the page 1/1.2 times
  [<n1> [<n2>]] F9      display the scaled page shifted by <n1> <n2>;
                        if <n2> is not given, then <n2>=<n1>
                        (std 0, scaling according to the setting of m)
  [<n1> [<n2>]] F10     display the scaled page shifted by <n1> <n2>;
                        if <n2> is not given, then <n2>=<n1>
                        (std 0, scaling 1/m according to the setting of m)
  [<n1> [<n2>]] F8      display the page shifted by <n1> <n2>;
                        if <n2> is not given, then <n2>=<n1> (std 0)
    [<n>] Alt r         rotate by <n>*90 degrees (std 1)
    [<n>] Alt s         set shift for arrows to <n> (std displays value of s)
    [<n>] Alt m         set magnification factor to <n> (std displays value of m)
       Alt g            draw the grid
       Alt h            flip the page horizontally
       Alt v            flip the page vertically
       Alt f            show the page frame
   [(<file>)] F4        conditional reading of setting information from <file>
                        (std !ps_rest.ps)
   [(<file>)] F3        writing of setting information to <file>
                        (std !ps_rest.ps)
     [<n>] Del          undo <n> previous changes (std 1)
     [<n>] Ins          redo <n> undone changes (std 1)
   Alt x   or   Esc     exit (without saving the restart setting information)
         q              quit with saving the restart setting information
[(<file>)] Ctrl PrtScr  print contents of the frame to <file> (std to printer);
                        all for ljet3
     (<file>) F1        read the first page from <file> (browsing is impossible)
     (<file>) F2        read new paged document from <file>
       Alt e            error handler (restore virtual memory)

For F3, F4 and Ctrl PrtScr if <file> is not in the current
directory, the full path with doubled backslashes must be given.
For F1 and F2 if <file> is not in the current directory or in the directories
given by -I and gs_lib, the full path with doubled backslashes must be given.

The inner frame showed by Alt f is moved by 6mm inwards from the edges of
A4 paper (this can be changed by editing ps_view.ps).

At most first 256 pages of the document can be displayed.

Hint: The following procedure proved to be good to me:
      - set magnification factor to about 2.3 (for A4 page);   2.3 Alt m
      - scale the page;   F9
      - shift upper left corner of the page to upper left corner
        of the screen;   using <n> arrows
      - set size of shift to 9;   9 Alt s
      - go to the first page;   Ctrl PgUp
      - write settings;   F3 (or Alt q)
      Then Up and Down arrows shift the page by about half the height of
      the page. Next time you run !psview <file>, the first page of your
      document will be automatically displayed with the right settings.
      Moreover, you can anytime restore this state using F4.


Brno, 5. 7. 1995                                        Jaromir Kuben
                                                        kuben@scova.vabo.cz
