World Library  
Flag as Inappropriate
Email this Article


Article Id: WHEBN0000060111
Reproduction Date:

Title: Hpgl  
Author: World Heritage Encyclopedia
Language: English
Subject: Harlequin RIP, Comparison of computer-aided design editors, Printer Command Language, DISLIN, WorkXPlore 3D
Publisher: World Heritage Encyclopedia


HP-GL (Hewlett-Packard Graphics Language; often written as HPGL) is a printer control language created by Hewlett-Packard (HP). HP-GL was the primary printer control language used by HP plotters. It later became a standard for almost all plotters. Hewlett-Packard's printers also usually support HPGL in addition to PCL.


The language is formed from a series of two letter codes, followed by optional parameters. For instance an arc can be drawn on a page by sending the string:


This means Arc Absolute, and the parameters place the center of the arc at absolute coordinates 100,100 on the page, with a starting angle of 50 degrees measured counter-clockwise. A fourth optional parameter (not used here) specifies how far the arc continues, and defaults to 5 degrees.


Typical HP-GL files start with a few setup commands, followed by a long string of graphics commands. The file was in ASCII (text file) format, for instance:

An example HP-GL file
Command Meaning
IN; initialize, start a plotting job
IP; set the initial point (origin), in this case the default 0,0
SC0,40,0,40; allows scaling in millimeters since 1 mm = 40 plotter units. Each user-unit is 1 millimeter, in both X and Y directions
SP1; select pen 1
PU0,0; lift Pen Up and move to starting point for next action
PD100,0,100,100,0,100,0,0; put Pen Down and move to the following locations (draw a box around the page)
PU50,50; Pen Up and move to X,Y coordinates 50,50 (in this case mm, after the SC command)
CI25; draw a circle with radius 25 (mm)
SS; select the standard font
DT*,1; set the text delimiter to the asterisk, and do not print them (the 1, meaning "true")
PU20,80; lift the pen and move to 20,80
LBHello World*; draw a label
LTlinetype,length set line type and its repetition length
CSxx set character set (e.g. 33 is German)
DIx,y set direction of text given as the catheti
SIww,hh set character width and height

The coordinate system was based on the smallest units one of the HP plotters could support, and was set to 25 µm (i.e. 40 units per millimeter, 1016 per inch). The coordinate space was positive or negative floating point numbers, specifically ±230.


The original HP-GL language did not support definition of line width, as this parameter was determined by the pens loaded into the plotter. With the advent of the first inkjet plotters, line width for the "pens" specified within the HP-GL files had to be set at the printer so it would know what line width to print for each pen, a cumbersome and error-prone process. With HP-GL/2, definition of line width was introduced into the language and allowed for elimination of this step. Also, among other improvements a binary file format was defined that allowed for smaller files and shorter file transfer times, and the minimal resolution was reduced.


HPGL is related to AGL (A Graphics Language), an extension of the BASIC programming language. AGL was implemented on Hewlett-Packard minicomputers to simplify controlling a plotter. AGL commands describe the desired graphics plotting function, which the computer relays to the plotter as several HP-GL instructions to the plotter.

See also

  • ShareCAD, a free online HPGL/PLT viewer

External links

  • HP-GL/2 reference (3.6MB pdf file)
  • Hewlett Packard Graphics Language Commands
  • HP-GL Overview
  • Chiplotle, a Python-based HP-GL plotter control library for using vintage pen plotters with contemporary operating systems
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.

Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.