|HP-GL/2 is a vector graphics language used in a large number of Hewlett Packard products. It is used in a large number of plotter products and forms a major part of PCL5, a printer control language used in HPs LaserJet family of products.|
Last updated: 2 Mar 2001
This page will be updated with more useful information soon (we hope), but until then...
HP-GL/2 was a popular vector graphics format for a large number of years. The graphics model is pretty much superseded these days, but it is a small, simple and effective way to represent vector images. The web committees have been standardising SVG (scalable vector graphics) for quite a while now, and that promises to wipe out most existing vector graphics formats once it's released. SVG however is so complex that the implementation task is huge, and although it is supposed to be applicable to portable devices, the size of the command set means you will need a lot of ROM to fit it in anything small. HP-GL/2 on the other hand is a small simple vector language that would be better suited to portable devices.
Flash from Macromedia is another really nice vector language that is proprietary, but has a lot of nice implementation features. It too will be superseded by SVG, but until then it's probably the best thing out there.
So why bother with another implementation? Well, HP-GL/2 has been around for ages and there are a huge number of real products out there which use it, as well as a lot of design software that produces HP-GL/2 files. The plug-in will let you view such files, or author compact vector graphics by hand for viewing. There are a few implementations out on the web, but few with source. The only one we've found is an HP-GL to other graphics format converter, and misses out on some important language features such as all polygon clip and fill commands. Our implementation is pure HP-GL/2 - i.e. no decayed HP-GL commands (like XT and YT for example) that were dropped by HP.
If you don't care about the software and just want to load a plug-in to view HP-GL/2 files, then just download this HP-GL/2 plug in and place it in the Netscape\program\Plugins folder wherever you have installed Netscape. Restart the browser and you should be able to see the cool HP-GL/2 tiger. This tiger is of course a standard Adobe Illustrator drawing that is used to show Postscript off and the SVG people use it to show some of their implementations as well. The version here is a bit wrong cause it was hand edited with errors into HP-GL/2, and so some mistakes were made, but it serves to illustrate the point. By the way, the HP-GL/2 version is smaller than SVG, and if the HP-GL/2 command PE was implemented and used, it would be smaller again. So what, you say? Well, it just shows that for simple vector stuff, HP-GL/2 is just as useful as many other excessively complicated languages.
Anyway, out of the goodness of our hearts, we've chucked the source into the public domain without that restrictive GNU licence. We only ask that if you add to or fix bugs then please send the changes back to us by mailing firstname.lastname@example.org if you wish. No one is under obligation to do so, but we just ask that as a small favour for giving you this stuff in the first place. So anyway, the source code is here It contains a few directories which normally get unpacked into the Netscape plug-in SDK main directory.
So, to unpack, first grab the Netscape SDK and put it on your disk somewhere.
Then unpack the gl2-0_1.zip file inside the top level. You will end
up with a directory called 'gl-plugin'. In there, there are two Microsoft
Visual Studio 6 workspaces in the directory 'Viewer' and 'Winproject'.
The workspace in 'Winproject' builds the Netscape plug-in. The workspace
in 'Viewer' builds a Windows program which can be used stand-alone to view
HP-GL/2 files (and us useful when debugging).
The file 'notes' in the base directory contains scribbled missing bits and pieces. If you want another cool HP-GL/2 viewer (binary only) there used to be one at http://www.splot.com.
This is really a work in progress and it needs a few man-weeks to finish it off to acceptable level. Hopefully someone will find this useful for something. Enjoy.