Before going further
-------------------

  This documents a version of hpscat revised by Jungshik Shin
(jshin@minerva.cis.yale.edu). It is based on hpscat 1.3.1
written by Kang, Joong-bin(jbkang@csone.kaist.ac.kr). The
revision has been mostly cosmetic changes and to add 
more user-control of appearence of output. The heart of 
the program remains almost the same and most  advantages
gained by using this program should be attributed  to 
the original author since  most changes due to me are 
trivial and can be done by anyone having taken CS 101 
and with a little knowledge of Postscript language. 



What's New in this version 
---------------------------


1. Conforms to Adobe Postscript document format more strictly. 
   Now, one may use 'psutils' to manipulate a resulting PS
   file from hpscat in many a way including 
   concatenating  pages into one(psnup) and selecting specific
   pages(either a group of pages- e.g. odd or even numbered 
   for double-side printings - or a single page) to print(psselect)
   or setting different margins for even and odd numbered pages
   (psbook). 'ghostscript' and ghostview' can be used to do 
   similar things and randomly(not sequentially) view pages. 

2. Hangul font for text can be selected either at command line
   ( -hf<hangul font name>) or by specifying 
   'hangulfont' resource in ~/.hpscatrc

3. Not only a4, but also many other papertypes(a3,a5,b4,b5,US 
   letter,Legal,Executive,etc) are now supported. 
   One may choose the papertype by '-p<paper>' at command line 
   or 'paper' resource in ~/.hpscatrc. 
   By defining US_VERSION in Makefile, default paper
   type can be set to 'letter' instead of 'A4'. 
   On top of that, you may define your own paper type
   in paper.c and paper.h before compilation. 
   You need to specify 
   width and height in standard Postscript unit(1/72 inch). 

4. '-pw'(paperwidth) and '-ph'(paperheight) options are
   available for user defined paper size(paper type
   other than predefined)

5.  For printers with unusually large non-printable area(off-set) 
    relative to the paper size(or whenever default (minimum) side-margin
    or top/bottom margin is too narrow for pages not to be
    clipped or you just want wider margins than default ), 
    one may enforce larger margins by '-mlm'(minimum
    left margin) and '-mbm'(minimum bottom margin). Left
    and right margins are euqal to each other and top and
    bottom margins are almost equal(ratio is defined in 
    TMBM_ratio in paper.h) in the output of hpscat. 
    Hence, no separte options for right and top margins. 
    Note also that these options are for setting not 
    actual  but  minimum' margins, so that 
    specifying values smaller than default margins 
    calculated by hpscat for a given papersize  does not
    result in pages with margins given by these options. 
    You may wish to be able to set margins on all four sides,
    but I think that's sort of  overkill for this kind of 
    text-to-PS translator. 'psutils' package and 'ghostscript'
    (especially, the newest Aldain Ghostscript 3.51 available
     at http://www.cs.wisc.edu/~ghost) can be 
    made use of for manipulation of  output PS file. 

6. A minor bug fix. In hpscat 1.3.1, when a document has such 
   a length that it ends in the second column of landscape 
   three column output, the last page is not printed
   because 'showpage' (Postscript keyword) is not
   added to that page. That's fixed and the last page
   is printed in that case,too. 


7. Date and page number in footer and header are now
   correctly right-justified regardless of space they take
   by defining a new Postscript procedure RS in 
   PS Prolog. (See ps.c. It's adopted from "PostScript by Example" 
   by Henry McGilton and Mary Campione, Addision Wesley, 1993). 
     


8. Many new options one can specify at command line or
   in ~/.hpscatrc for mostly cosmetic setting. 

   ( Enclosed within parentheses are resource names to be used 
     in '.hpscatrc' )

   -T<title> (title) :     
                   Document title. Handy when redirecting stdout to 
                   hpscat or printing a file with obnoxiously long 
                   name irrelevant to content of the file. 
   -tf<title font> (titlefont) :
                   font for 'Title'
   -nb(nobox)    : whether or not to draw outline box
   -nh(noheader) : whether or not to print out header
   -nf(nofooter) : whether or not to print out footer
   -sw(shade_width) :
                   shaded area width in outline box when line number
                      is printed.
   -sn(shade_width_nl) :
                   shaded area width in outline box without line number.

   -nl(nolinenum) : its behavior is changed. It does not imply 
                    'no outline box' any more. Besides, with this option 
                    enabled, text width is increased by as much as - or
                    actually slightly less than by s_width_nl(see init.c
                    and hpscat.h) when outline box is drawn - 
                    line number would occupy  if printed. 
                   

HOW TO INSTALL
--------------
  
  0. Read 'README' by the original author of hpscat, 
     jbkang@csone.kaist.ac.kr

  1. In the source directory where this README file is, 
     just typing 'make' will get you  'hpscat' in the
     same directory. Move it wherever you like to put
     it( perhaps /usr/local/bin if you have root previlege
     or ~/bin if you don't have)
     It should be compiled cleanly under virtually 
     all Unix and Unix-like OS'. I tested this under
     Linux 1.3.32(Kernel)+GCC 2.6.3 and SunOS 5.4.

  2. For customization, edit Makefile ( which paper size
     to use as default , A4 or US letter), hpscat.h,
     paper.h, and paper.c. You may change default 
     size of margins and add a new paper type or 
     a length unit. Recompile hpscat(by 'make') after these
     changes. 

Additional Note
---------------

   1. As noted in README, Hangul PS fonts are not included
      in this package, you have to get Hangul PS fonts
      from somewhere else if you don't have a Hangul 
      PS printer.
      ( Is it too much to ask you to design and distribute 
        a set of them for which you can earn a lot of money? 
        Well, probablely so as desinging even a single Hangul PS font
        seems to be far from trivial  :-) ) 

       You have to download the Hangul PS font used in your
       document before sending output of hpscat to your PS
       printer. In Unix, it's usually done by 
       ' cat Header HFONT | lpr -P<printer_name>' (in BSD) or
       ' cat Header HFONT | lp -d<printer name>'  (in System V)
       where HFONT is the name of the file with Hangul PS
       font used in your document. 
       Under MS-Windows, there are  utilities for 
       downloading a PS file. Mac System 7.x includes 
       that utility and there are a few public domain programs for that
       purpose (e.g. SendPS and DropPS)

    2. You don't need a PS printer to print out a PS file as you
       may know well. Ghostscript and Ghostview can be used 
       to print out to most printers 'on earth' (e.g.  HP Laser Jet,
       Epson DotMatrix, HP DeskJet/Inkjet ,etc) and view on the screen    
       a file generated by hpscat. 

       Note for HP LJ with only PCL support: HP LJ is known for 
       slight variation and incompatibility in paper off-set and 
       unprintable area  among different models in its family. 
       Therefore, a PS file with correct margin when viewed with 
       ghostview can have a clipped page when printed out. 
       This is not the fault of hpscat , nor that of ghostscript. 
       The newest ghostscript from Aladin software has options
       to deal with this and it may need some tinkering with
       these options before getting output the same as 
       previewed with ghostview on your printer. 

       Ghostview/Ghostscript are available at http://www.cs.wisc.edu/~ghost
       for virtually all OS'. 

       To view and print out a hangul PS file made by hpscat, 
       you need to add following lines in 'gs_init.ps'(initialization
       file for ghostscript).  

       Around the end of 'gs_init.ps', you may find following
       two lines. 



WRITESYSTEMDICT not { systemdict readonly pop } if

(END INIT) VMDEBUG

       Insert what follows between two lines above as shown below.
These lines load Hangul font header and Hangul fonts when 
ghostscript and ghostview are executed. 


----- What to be inserted -----------
(full path for hangul font header file) run
QUIET not { (Loading Korean Fonts: ) print } if
(full path for the file with hangul font ) run
QUIET not { (Hangul font name ) print } if
%Repeat the last two lines for each Hangul font you have
----------------

-------- how it looks after inserting -----------

WRITESYSTEMDICT not { systemdict readonly pop } if

(full path for hangul font header file) run
QUIET not { (Loading Korean Fonts: ) print } if
(full path for the file with hangul font ) run
QUIET not { (Hangul font name ) print } if
%Repeat the last two lines for each Hangul font you have

(END INIT) VMDEBUG
-------------------


Acknowledgement
---------------

1. I deeply appreciate Mr. Kang,Joong-bin for making original
   'hpscat' which has been such an invaluable utility 
    to me and many Koreans especially those abroad 
    who would still have hard time pringting Hangul 
    documents without hpscat. 

2.  Another gratitude goes to Kim, Kyoung-chul(ddaeng7@glory.kaist.ac.kr),
    who saved me a great deal of time and money( and quite a few
    trees, as well :-) ) by posting the recipe aforementioned 
    for viewing and printing output of hpscat with ghostscript and
    ghostview. 

3.  I also wish to express my thanks to Lim, Dong-chul(lim@rani.chem.yale.edu) 
    for adding an impetus to my effort to revise hpscat by making
    his own revision almost simultaneously. 

4.  The last and not the least thanks goes to all the authors
    of freely available tools and OS I used to revise hpscat,
    including  ghostscript/ghostview, GCC,Hanterm,hvi(helvis), 
    and  Linux. 



                                             Jungshik Shin
                                             (jshin@minerva.cis.yale.edu)

