


hp2xx(1)                 USER COMMANDS                   hp2xx(1)



NAME
     hp2xx - A HPGL converter into some vector- and  raster  for-
     mats

USAGE
     hp2xx [-options] [hpgl-file(s)]

OPTION SUMMARY
     Option Format  Default   Description
     -------------------------------------------------------------------------
     General options:
       -f   char *  ""        Name of output file (default: stdout)
       -m   char *  pcl       Mode. Valid: mf,ps, pcl,pcx,atari, vga (DOS only)
       -p   int     1         Pensize [dots] (PCL,PCX,VGA), [1/10 mm] (mf, ps).
                              Valid: 1-4
       -q           off       Quiet mode. No diagnostic output.
       -r   double  0.0       Rotation angle [deg]. -r90 gives landscape
       -s   char *  hp2xx.swp Name of swap file

     Size controls:
       -a   double  1.0       Aspect factor. Valid: > 0.0
       -h   double  100       Height   [mm] of picture
       -w   double   -        Width    [mm] of picture. If given, overrides -h
       -x   double   -        Preset xmin value of HPGL coordinate range
       -X   double   -        Preset xmax value of HPGL coordinate range
       -y   double   -        Preset ymin value of HPGL coordinate range
       -Y   double   -        Preset ymax value of HPGL coordinate range

     Raster format controls:
       -d   int     75        DPI value (x or both x&y)
       -D   int     75        DPI value (y only)

     PCL only:
       -F           off       Send a FormFeed after graphics data
       -i           off       Pre-initialize printer
       -S           off       Use (Deskjet) Special commands
       -o   double  0.0       x offset [mm] of picture (left  margin)
       -O   double  0.0       y offset [mm] of picture (upper margin)
       -d   (see above)       Valid ONLY 300, 150, 100, 75
       -D   (see above)       INVALID for PCL!

     PS and PCL:
       -o   double  0.0       x offset [mm] of picture (left  margin)
       -O   double  0.0       y offset [mm] of picture (upper margin)

     VGA (on PCs) only:       Hi-Res mode setups:
       -V   int     18        VGA mode byte (decimal)
       -W   int     640       VGA pixel width.
     -------------------------------------------------------------------------
       -H              Show help.





Sun Release 4.1  Last change: 12 September 1991                 1






hp2xx(1)                 USER COMMANDS                   hp2xx(1)



DESCRIPTION
     _h_p_2_x_x reads HPGL ASCII source files,  interprets  them,  and
     converts them into either another vector-oriented  format or
     one of  several  rasterfile  formats.  Currently,  its  HPGL
     parser only recognizes a small subset of the HP 7475 command
     subset, basically the absolute or relative Move or Draw com-
     mands,  so  don't  expect  fancier stuff like circles / text
     output / filled polygons. Since  it  only  processes  simple
     vectors, its output can be easily adapted to many formats.

GENERAL FUNCTION
     _h_p_2_x_x reads from stdin or from a file if any  given  on  the
     command  line.  You may specify more than one input file (if
     this makes sense at all). The output is written to stdout by
     default.  Use  option -_f _o_u_t_f_i_l_e to specify your output file
     name, or just use output redirection (DOS users beware:  DOS
     limits  output redirection to ASCII data only, so -f is pre-
     ferred).  The program scans the current HPGL source,  writes
     all vectors in internal binary format into a temporary file,
     and concurrently determines the maximal coordinate range. It
     then  processes the vectors by mapping them into a new coor-
     dinate system with a height of 100mm by default exactly cov-
     ering  the  detected  y  range, and by preserving the aspect
     ratio of the original data.  Use option -_h _h_e_i_g_h_t to set the
     desired  height  of  your  output picture; optionally use -_a
     _a_s_p_e_c_t_f_a_c_t_o_r to alter the aspect ratio by the  given  factor
     (aspectfactor  <  1  narrows  your  picture). Alternatively,
     specify the desired picture width using -_w _w_i_d_t_h. The height
     will  then  be automatically generated, as will be the width
     if you control the picture's heigth.  Please  note  that  -_w
     overrides any -_h option!

     Option -_r _r_o_t_a_t_i_o_n__a_n_g_l_e (_i_n _d_e_g_r_e_e_s) allows you  to  rotate
     the  object prior to all scaling operations. Its main use is
     to facilitate landscape format: -r90 rotates your whole pic-
     ture,  e.g.  from  portait to landscape format. However, any
     reasonable rotation angle is valid.

     If you need to process a series  of  similar  objects  which
     should  be  translated into exactly the same coordinate sys-
     tem, there is a way to override the auto-scaling: First, run
     all  files separately and note the infos on the used coordi-
     nate ranges. Then, pick a range that  will  cover  ALL  your
     pictures.   You  can  now  assign defaults to the internally
     generated range limits by specifying -_x _x_m_i_n,  -_X  _x_m_a_x,  -_y
     _y_m_i_n,  and  -_Y _y_m_a_x. NOTE: Clipping is NOT supported! If any
     picture  coordinate  exceeds  your  limits,  they  will   be
     overwritten.

     Use option -_m _m_o_d_e to select the program mode, i.e. the out-
     put  format.  Currently  supported:  mode = "mf" (Metafont),
     "ps" (PostScript), "pcl" (HP-PCL Level  3  format,  suitable



Sun Release 4.1  Last change: 12 September 1991                 2






hp2xx(1)                 USER COMMANDS                   hp2xx(1)



     for  printing  on  a  HP Laserjet II, DeskJet, or compatible
     printer), "atari"  (ATARI  screen  format),  or  "pcx"  (PC-
     Paintbrush  format, also accepted by MS-Paintbrush / Windows
     3.0 and many other PC based pixel renderers). On PC's, there
     also  is  a  preview  option  "vga" which supports VGA cards
     ONLY. Default mode is pcl.

     If you use a raster format, the  picture  is  rasterized  by
     default  into  a  75  DPI  resolution  image.  Use option -_d
     _D_P_I__v_a_l_u_e to change the resolution, e.g. -d300 will cause  a
     HP LJ-II compatible 300 dpi rasterization. There is a way of
     specifying  a  different  resolution  for  y  direction:  -_D
     _D_P_I__y__v_a_l_u_e,  although  it  is  of  limited  use  yet. It is
     intended for, e.g., support of NEC P6 printers (360x180 DPI)
     and alike in a later release.

     If processing large pictures  at  high  resolution  on  low-
     memory  machines, typically under DOS, the program may start
     swapping. Opionally change the swap file by using  -_s  _s_w_a_p_-
     _f_i_l_e, e.g. to speed up processing by swapping to a RAM disk.

VECTOR FORMATS
     Currently, two vector formats  are  supported:  _T_e_X/_M_e_t_a_f_o_n_t
     and -I PostScript.  Use -_m _m_f to convert a HPGL drawing into
     a Metafont character to be included into a TeX  document  as
     the  character  "Z"  of  a special font that you may create.
     Edit the metafont source, e.g., to change the letter "Z" for
     another,  or  to  change the line thickness, which is set to
     0.4pt by default.  Use option -_p _p_e_n_s_i_z_e for a limited  con-
     trol over pensize: The actual Metafont pensize will be "pen-
     size * 0.1 mm", with pensize = 1, 2,  3,  or  4.   The  same
     applies  to  -_m _p_s, the PostScript mode. Here, you also need
     to use options -o and -O (see below) for proper  margins  in
     paper  since _h_p_2_x_x puts your picture "flush" to the left and
     upper paper limit by default.

RASTER FORMATS
     The following formats are supported: HP-PCL, PCX, ATARI, and
     VGA (preview on PC's).  However, generation of other formats
     is made easy for  programmers  because  of  _h_p_2_x_x'_s  modular
     structure.  The program allocates a bitmap on a line-by-line
     basis, swapping lines to disk if needed, and plots into this
     bitmap.  Depending  on  the  selected  format,  a conversion
     module is then activated, which might easily be replaced  by
     other converters. Add more formats if you like!

     Option -_p _p_e_n_s_i_z_e controls the size (in pixels) of the  vir-
     tual plotting pen. The only implemented shape of the pen tip
     is a square of the given length.  Default  pen  size  is  1.
     Specifying  -p4  when in 75 DPI mode will make pretty clumsy
     pictures, while you may prefer -p2 over -p1 when in 300 DPI.




Sun Release 4.1  Last change: 12 September 1991                 3






hp2xx(1)                 USER COMMANDS                   hp2xx(1)



     PCX: The size of a PCX picture is controlled via its  speci-
     fied  height  and  the  current DPI value. To create a high-
     resolution  PCX  image,  just  increase  the  DPI  value  as
     desired. PCX format does not accept offsets.

     ATARI: ST screens (640x400 pixels) can easily be  dumped  to
     files.   Many  programs  accept  graphics by including these
     screen dump files. Graphics filling more than one  screenful
     may  be  split  into  screen-size  blocks and loaded/mounted
     blockwise.  _h_p_2_x_x converts to ATARI screen format by  trying
     to fit the resulting picture into a single screen equivalent
     (max. 400 rows, max. 80 Bytes (640 pixel) per  row).  If  it
     succeeds,  _h_p_2_x_x produces a single output file. Specify ONLY
     its base name (option -f), since _h_p_2_x_x adds the file  exten-
     sion  ".000".  However,  if  more screen blocks are required
     horizontally and/or  vertically,  _h_p_2_x_x  will  automatically
     split the picture into files with extensions ".001" / ".010"
     to a maximum of ".999" in a matrix-like  fashion:  Extension
     ".rrc" indicates a block at row position rr and column posi-
     tion c, counting from 0.  The picture is padded  with  back-
     ground color at its right and lower margins, if needed. File
     compression is not supported yet.  --  By  setting  DPI  and
     height/width,  you implicitely have control over the result-
     ing scan lines or columns. E.g., leaving DPI at its  default
     (-d  75),  and specifying a height of 135mm (-h 135), you'll
     get 400 rows.

     PCL: HP-PCL Level 3 format, most useful for  direct  printer
     output. Due to this action, there have been added some extra
     flags and options: Use flag -_i to send a printer initializa-
     tion  sequence  before the actual image. Flag -_F adds a Form
     Feed (FF, hex 0C) after the image  is  completed,  which  is
     what  you may want most of the time. However, overlay print-
     ing of several files is feasible by omitting -F.

     For additional control of the picture's  final  position  on
     paper,  you  may  add x or y offsets using -_o _X__o_f_f_s_e_t or -_O
     _Y__o_f_f_s_e_t. _E._g., -_o _2_0 -_O and 20 mm additional left margin.

     For DeskJet / DeskJet-plus / DeskJet 500 printers, there are
     some special printer commands. Activate them with flag -_S.

EXAMPLES
      % hp2xx -m pcx -f my_output.pcx -d300 -p2 -h50 -a 1.2 my_input.hp

        creates a PCX file at 300 DPI of height 50 mm, using an
        aspect factor of 1.2 and a pen size of 2 pixels.

      % my_hpgl_generator | hp2xx -o20 -O30 -F -q | lpr -P my_PCL_printer

        HPGL output is piped through hp2xx; the resulting PCL code
        is piped to the printer queue, giving an image of height 100 mm



Sun Release 4.1  Last change: 12 September 1991                 4






hp2xx(1)                 USER COMMANDS                   hp2xx(1)



        at 75 DPI. An additional left margin of 20mm and upper margin
        of 30mm is created. A formfeed will be added (handy if your
        printer queue does not).

      % hp2xx -m vga my_input.hp

        (PC only): Preview on VGA screen.

AUTHOR
      Heinz W. Werntges,  Biokybernetik,  Geb.  26.12,  Heinrich-
     Heine-Universitaet,
      D-4000 Duesseldorf 1, Germany. Internet:  heinz@biokyb.uni-
     duesseldorf.de

DIAGNOSTICS
     The number of ignored and/or unknown HPGL commands is given.
     You  will  be informed if swapping starts. Progress is indi-
     cated by output of dots, each dot representing 10  move/draw
     commands during scanning and plotting, or 10 scan lines dur-
     ing output. Shut off  diagnostic  output  by  specifying  -_q
     (quiet mode).

BUGS
     There are many non-implemented HPGL commands. Only few test-
     ing  has  been  done for Postscript and ATARI formats, so be
     prepared for bugs there, and PLEASE report  them  --   thank
     you!

SEE ALSO
     HPtoMF(1), D. Donath's HPGL-to-Metafont converter.

























Sun Release 4.1  Last change: 12 September 1991                 5



