[comp.sources.wanted] - HP-GL to PostScript ?

aduncan@rhea.trl.oz (Allan Duncan) (04/04/91)

I have need to convert HP-GL to output on a postscript printer, and have
a recollection that I saw such an item go by earlier this year, but
since I had no need of it then, let it pass.  Silly fool I.


Allan Duncan	ACSnet	a.duncan@trl.oz
(03) 541 6708	ARPA	a.duncan%trl.oz.au@uunet.uu.net
		UUCP	{uunet,hplabs,ukc}!munnari!trl.oz!a.duncan
Telecom Research Labs, PO Box 249, Clayton, Victoria, 3168, Australia.

kirkham@shiva.trl.oz (Daniel Kirkham) (04/04/91)

In article <2869@trlluna.trl.oz> aduncan@rhea.trl.oz (Allan Duncan) writes:
>I have need to convert HP-GL to output on a postscript printer, and have
>a recollection that I saw such an item go by earlier this year, but
>since I had no need of it then, let it pass.  Silly fool I.
>
>
On the Sun-4s, there is hpgl2ps installed in /usr/local/bin. Give that a go.

I have the source, so it can be installed on other platforms (CFN permitting)
if necessary.

Here is the manual (not installed, I'm afraid):


HPGL2PS((1L))     MISC. REFERENCE MANUAL PAGES      HPGL2PS((1L))



NAME
     hpgl2ps - A HP (Hewlett  Packard)  plot  command  filter  to
     PostScript

SYNOPSIS
     hpgl2ps [-amr] [-l line sizes] [-s scale]  [-x  offset]  [-y
     offset] [plotfile]

DESCRIPTION
     This filter is used to convert the Hewlett  Packard  Graphic
     Language  (HP-GL)  9873C plotter commands to PostScript. The
     HP-GL commands are a subset of the  Roland  plotter  command
     set (RD-GL).

     The default conditions for hpgl2ps are:

     1.   The plot translation is from ISO A3 (420mm x 297mm)  to
          ISO A4 (297mm x 210mm) on the LaserWriter.

     2.   Line thicknesses are in millimeters and are  for  lines
          (pens)  1  to  9:  ( 0.1, 0.2, 0.3, 0.4, 0.5, 0.7, 1.0,
          1.25, 1.5 )

     Note:
          If the plotfile is not specified then standard input is
          assumed.

ARGUMENTS
     -a   Draw on an A4 ISO (297mm x 210mm) sheet of paper.  This
          will  give  an aproximate 1:1 translation to the Laser-
          Writer.

     -l line sizes
          This  option  allows  the  default  line  sizes  to  be
          replaced  with different sizes starting from line (pen)
          one through nine. The new sizes (real or  integer)  are
          entered in a comma seperated string (line size) and are
          in millimeters. Only the sizes entered  in  the  string
          will  be  changed  with  respect to lines (pens) one to
          nine while nonentered line (pen) sizes will retain  the
          default sizes.

          In the following example only  the  first  three  sizes
          will be changed.

          eg: hpgl2ps -l 0.4,0.3,1 file | lpr -Plaser1

     -m   Enable the manual feed on the LaserWriter (cutoff  time
          3 minutes).

     -r   Rotate plot(s) through 90 degrees. (The  plot  is  made
          smaller)

     -s scale Scale the plot from 0.1 to 3 times its original
          size.

     -x offset Place an X offset (in mm) in the plot.

     -y offset Place an Y offset (in mm) in the plot.

     Note: Offsets are with respect to the 0, 0 (origin)  of  the
     HP-GL  /  RD-GL plotting commands, thus if the minimum plot-
     ting coordinates are below either the X and/or Y  zero  axis
     then a positive offset is applied.  Similarly if the minimum
     plot coordinates are above the X and/or Y zero axis  then  a
     negative offset is applied.

FILES
     /usr/local/bin/hpgl2ps

AUTHOR
     Don McCormick
     CSIRO
     Division of Applied Physics
     PO 218, Lindfield, N.S.W., 2070
     Australia

BUGS
     Some of the graphics commands are unimplemented and a  warn-
     ing will be displayed. If this command is vital then it must
     be written into the code.

     No interactive command is suported.

     If any bugs are found notify damc@natmlab or  damc@nifty  or
     root.


--
Daniel Kirkham,                  Internet           d.kirkham@trl.oz.au
Telecom Research Laboratories,   UUCP  {uunet,ukc}!munnari!trl.oz.au!d.kirkham
P.O. Box 249,  Clayton,          VoiceNet           + 61 3 541 6328
Victoria 3168, AUSTRALIA.        FaxNet             + 61 3 543 6026