HPGL was developed by Hewlett Packard to drive its family of pen plotters. Most commands are vector oriented - pick up the pen, put down the pen, move here, move there. Very few complex commands are part of HPGL since the original plotters did not include powerful CPUs.

HPGL/2 was developed as a successor to HPGL to support many more advanced features that could be offloaded to plotters with powerful CPU's and large amounts of memory. HPGL/2 also includes quite a lot of raster controls and commands since most modern plotters are actually raster devices. This includes embedded pen definitions (up to 256 since a raster device can never run out of pens...) fill patterns, screened vectors, clipping windows, data transformation and the like.

Most plotter drivers do not take advantage of the advanced HPGL/2 functions since they are based on old code that originally supported basic HPGL. However one very popular HPGL/2 command that is often used is PE - poyline encoded command.

PE is very popular because it compresses the pen movement commands by encoding them. This significantly reduces the plot file size. However PE is more difficult to decode which is why many low cost (or no cost) HPGL to DXF programs don't properly support it. Needless to say, HP2DXF does support the PE command.

Supported HPGL/HPGL2 Commands

Command    HPGL   HPGL2    Description

SP          x      x       Selects a pen; data mapped to AutoCAD layer
                           layer no=10 x pen number + | line-type|

PA          x      x       move pen absolute

PR          x      x       move pen relative to current coordinates

PE                 x       polyline encoded - a series of movements encoded
                           to minimize bytes used.

PU          x      x       pen up

PD          x      x       pen down - any moves with pen down generate arcs, 

PW                 x       pen width - translated to polyline with width

IP          x      x       new user unit scale factor

AA          x      x       arc absolute

AR          x      x       arc relative

EA          x      x       outline of rectangle translated to a zero width
                           closed polyline

LB          x      x       string of text - to DXF text

DT          x      x       string termination character

SI          x      x       character height

DI          x      x       direction (angle) of text

CS          x      x       text scaling parameter

CI          x      x       circle

SC          x      x       scale factor

LT          x      x       line type - indirectly supported by mapping to a unique
                           AutoCAD layer.

Special Notes and Behavior

  1. Plotter draws are mapped to DXF polylines. The polyline is continued until a pen up command breaks it.

  2. HP2DXF translates plotter units (1/1016 inch) into inches by multiplying by 1016.

  3. HP2DXF writes out the DXF data with 6 places of accuracy. This far exceeds the basic precision of HPGL which is approximately 0.001 inch.

Command Line Usage

HP2DXf is run from the UNIX command line. Syntax:

hp2dxf  [input_file]  [output_file]  [options]

input_file           the hpgl file to translate
output_file          name of the DXF file. If not present the input file
                     name with suffix .dxf is used.


-s                   scale factor. Defaults to 1.0

-p                   create a "closed" polyline if first/last point of a
                     list of draws meet.

-d                   disable automatic arc recognition.

Datasheet [ 1 | 2 | 3 ] Download Revision History Price

417 Ingalls St., Santa Cruz, CA 95060    Tel (831) 426-6163     Fax 426-2824    email: info@artwork.com