Section: User Commands (1)
Return to Main Contents


hpgl2gif, hpgl2ppm, hpgl2bmp, hpgl2png, hpgl2tiff, hpgl2pdf, hpgl2cps - convert HPGL plot file to GIF, PPM, BMP, PNG or TIFF image, PDF or colour PostScript file  


hpgl2gif [-p colour,...] [-b colour] [-h height] [-w width] [-G] [-t] [-f[vfont]] [-r] [-m] [-A | -B | -A3 | -A4] [hpglfile] > giffile
hpgl2ppm [options] [hpglfile] > ppmfile
hpgl2bmp [options] [hpglfile] > bmpfile
hpgl2png [options] [hpglfile] > pngfile
hpgl2tiff [options] [hpglfile] > tifffile
hpgl2pdf [options] [hpglfile] > pdffile
hpgl2cps [options] [hpglfile] > psfile  


Each of these programs interprets the HPGL instructions stored in the hpglfile, or the standard input if no file is specified, and generates output in the appropriate format. The output is on the standard output, which should be redirected to a file.

The programs act as a front end to various filters, mostly in the emuhpgl(1) suite and the netpbm package, to carry the HPGL though the necessary sequence of conversions to the desired final format. The emuhpgl(1) programs emulate only a small subset of the full HPGL, which is adequate for handling output from programs like analysis(1) and layout(1).

The output graphics are in an aspect ratio equivalent to what would be produced by an HP plotter on A-size (8.5×11´´) paper.  


-p colour,...
Sets colours for various pens, up to 8 in all. Each colour can be a name without spaces, as in the file /usr/neuro/lib/rgb.txt, or hexadecimal values as #FFAA99. The default is to use the colours specified in the SCRPENS environment variable. You can also use -p bw or -p wb for a faster rendering of a simple black on white or white on black bitmap image.
-b colour
Sets the image background colour (default is white).
-h height
Sets the image height in pixels (default is 400).
-w width
Sets the image width in pixels (default is 520). If only one of -h or -w is given, the other is set proportionally. For the hpgl2pdf and hpgl2cps commands, the height and width are specified in decipoints, rather than pixels, and the default size is 7920×6120, which corresponds to a US A-size sheet of letter paper in landscape orientation. You can use -w 8420 -h 5950 for A4 landscape.
Causes a cleaner, but slower rendering, using the GhostScript (gs(1)) PostScript emulator. This also causes lines to be rendered somewhat thicker than the default width of a single pixel. The hpgl2pdf and hpgl2cps commands ignore this option, as the former always uses gs(1) to render the PDF, and the latter doesn't render the PostScript. hpgl2cps produces a tweaked version of the output of hpgl2psc, in which the pens select colours rather than simple shades of gray.
Causes the program to output a summary of command usage and options.

Emuhpgl Options

The following options will be passed directly to the initial HPGL conversion program, which is hpgl2ras, hpgl2xpm or hpgl2psc.
Causes text to be suppressed.
Causes text to be rendered as a series of line segments, using the specified vfont to select a variable Hershey font, or by default, a font approximating the default font on HP plotters.
Causes the image to be reduced to 72% of its linear size, and rotated so that it appears in portrait orientation on the upper part of a letter sized page. This option only has an effect on the hpgl2pdf and hpgl2cps commands.
Merges together multiple unconnected line segments into a single path, rather than stroking each one separately. This option only has an effect on the hpgl2cps command, and possibly on hpgl2pdf as well, depending on how GhostScript renders the PS into a PDF.
-A, -B, -A3, -A4
Adjust the coordinate system and aspect ratio to correspond to the plotter's defaults for that page size. The default page size can also be changed by setting the environment variable HPGLPAGE to one of the above page sizes. If you use one of these, you will probably also want to adjust the rendered image size using -h and -w options, to get the right proportions for the chosen page size.


/usr/neuro/lib/rgb.txt        X11 colour database


layout(1), analysis(1), emuhpgl(1) (for hpgl2ras, hpgl2xpm and hpgl2psc), ras2xbm(1), xpmtoppm(1), xbmtopbm(1), ppmtogif(1), ppmtobmp(1), pnmtopng(1), pnmtotiff(1), gs(1)


Emuhpgl Options

This document was created by man2html, using the manual pages.
Time: 19:13:01 GMT, May 23, 2018
Copyright © G. R. Detillieux, Spinal Cord Research Centre, The University of Manitoba.