Reference Guide > Output Devices and Window Systems > PCL Output
  

PCL Output
PCL (Printer Control Language) is used by Hewlett-Packard laser and ink jet printers to produce graphics output. This driver does not support the use of color and does not support the use of hardware fonts.
 
note
When printing from VDA Tools to a PCL device, all output that appears in black in the VDA Tool will appear in white on the printed page (i.e., it will not be visible).
To direct graphics output to a PCL file, issue the command:
SET_PLOT, 'PCL'
This causes PV‑WAVE to use the PCL driver for producing graphical output. Once the PCL driver is enabled via SET_PLOT, the DEVICE procedure is used to control its actions, as described in "Controlling PCL Output with DEVICE Keywords". The default settings for the PCL driver are shown in Default PCL Settings.
 
Table B-5: Default PCL Settings
Setting
Default Value
Output file name
wave.pcl
Mode
Portrait
Optimization Level
0 (None)
Dither Method
Floyd-Steinberg
Resolution
300 dpi
Horizontal Offset
1.27 cm (1/2 in.)
Vertical Offset
2.54 cm (1 in.)
Width
17.78 cm (7 in.)
Height
12.7 cm (5 in.)
By default, PCL writes black on white paper. The default color index when PCL is selected is 0. If the color index is set to 255 when PCL is selected, the result is white writing on white, which is invisible on white paper. Color tables are not used with PCL.
Use INFO, /Device to view the driver’s current settings.
 
note
For UNIX users, when you print files to a PCL device from a UNIX system, you may need to specify the -v option in the print command. This option indicates that a raster image is being transmitted. For example:
lpr -Plj250_q -v wave.pcl
Controlling PCL Output with DEVICE Keywords
The following keywords to the DEVICE procedure provide control over the PCL driver:
Close_File—PV‑WAVE creates, opens and writes a file containing the generated graphics output. The Close_File keyword outputs any buffered commands and closes the file.
 
Caution
Under UNIX, if you close the output file with the Close_File DEVICE keyword, and then execute a command (such as PLOT) that creates more output, PV‑WAVE reopens the same file, erasing the previous contents. To avoid losing the contents of an output file, use the Filename keyword to specify a different filename, or use SET_PLOT to switch to a different graphics driver, or be sure to print the closed output file before creating more output.
 
note
For more information on this topic, see the discussion of printing output files in the PV‑WAVE User’s Guide.
Filename—By default all generated output is sent to a file named wave.pcl. The Filename keyword can be used to change this default. If you specify a filename, the following occurs:
*If the file is already open (as happens if graphics have been directed to the file since the call to SET_PLOT), then the file is completed and closed as if Close_File had been specified.
*The specified file is opened for subsequent graphics output.
Floyd—If present and nonzero, selects the Floyd-Steinberg method of dithering. For information on this dithering method, see the PV‑WAVE User’s Guide.
Inches—By default, the Xoffset, Xsize, Yoffset, and Ysize keywords are specified in centimeters. However, if Inches is present and nonzero, they are taken to be in inches instead.
Landscape—PV‑WAVE normally generates plots with portrait orientation (the x-axis is along the short dimension of the page). If Landscape is present, landscape orientation (the x-axis is along the long dimension of the page) is used instead.
OptimizeIt is desirable, though not always possible, to compress the size of the output file. Such optimization reduces the size of the output file, and improves I/O speed to the printer. There are three levels of optimization:
*0—No optimization is performed. This is the default because it will work with any PCL device. However, users of devices which can support optimization should use one of the other optimization levels.
*1—Optimization is performed using PCL optimization primitives. This gives the best output compression and printing speed. Unfortunately, not all PCL devices support it. On those that can’t, the result will be garbage printed on the page.
The required sequences are: <ESC>*b0M (select full graphics mode), <ESC>*b1M (select compacted graphics mode 1), and <ESC>*b2M select compacted graphics mode 2). To determine if your printer supports the required escape sequences, consult the device’s programmers manual.
The HP LaserJet II does not support this optimization level. The DeskJet PLUS does.
*2—PV‑WAVE attempts to optimize the output by explicitly moving the left margin and then outputting non-blank sections of the page. This is primarily intended for use with the LaserJet II, which does not support optimization level 1.
 
note
Level 2 optimization can be very slow on some devices (such as the DeskJet PLUS). On such devices, it is best to avoid this optimization level.
Ordered—Selects the Ordered Dither method of dithering when displaying images on a monochrome display. For information on this dithering method, see the PV‑WAVE User’s Guide.
PixelsBy default, the Xoffset, Xsize, Yoffset, and Ysize keywords are specified in centimeters. However, if Pixels is present and nonzero, they are taken to be in pixels instead. Note that the selected resolution will determine how large a region is actually written on the page.
Portrait—If Portrait is present, PV‑WAVE will generate plots using portrait orientation, the default.
Resolution—The resolution at which the PCL printer will print. PCL supports resolutions of 75, 100, 150, and 300 dots per inch. The default is 300 dpi. Lower resolution gives smaller output files, while higher resolution gives superior quality.
Threshold—Specifies use of the threshold dithering algorithm. For information on this dithering method, see the PV‑WAVE User’s Guide.
Xoffset—Specifies the x position on the page of the lower-left corner of output generated by PV‑WAVE. Xoffset is specified in centimeters unless Inches or Pixels is specified.
Xsize—Specifies the width of the PV‑WAVE output. Xsize is specified in centimeters unless Inches or Pixels is specified.
Yoffset—Specifies the y position on the page of the lower-left corner of output generated by PV‑WAVE. Yoffset is specified in centimeters unless Inches or Pixels is specified.
Ysize— Specifies the height of the PV‑WAVE output. Ysize is specified in centimeters unless Inches or Pixels is specified.
PCL Image Background Color
Images that are displayed with a black background on a monitor frequently look better if the background is changed to white when displayed with PCL. This is easily done with the following statement, where A is the image variable:
A(WHERE(A EQ 0B)) = 255B

Version 2017.1
Copyright © 2019, Rogue Wave Software, Inc. All Rights Reserved.