pbmtoppa
Convert PBM images to PPA printer format
TLDR
Convert a PBM image into a PPA file
Specify the desired dots-per-inch and paper size
SYNOPSIS
pbmtoppa [options] [pbmfile]
When pbmfile is omitted, pbmtoppa reads from standard input.
PARAMETERS
-xpos x
Horizontal position of the image on the page, in dots from the left edge.
-ypos y
Vertical position of the image on the page, in dots from the top edge.
-xres res
Horizontal resolution for the output, in dots per inch (DPI).
-yres res
Vertical resolution for the output, in dots per inch (DPI).
-left left
Margin from the left of the page, in dots.
-top top
Margin from the top of the page, in dots.
-width width
Desired width of the image on the page, in dots.
-height height
Desired height of the image on the page, in dots.
-scale scale
Scale factor to apply to both horizontal and vertical dimensions.
-scale-x scale-x
Scale factor for the horizontal dimension.
-scale-y scale-y
Scale factor for the vertical dimension.
-fit / -fit-to-page
Scale the image to fit the entire page.
-fit-to-width
Scale the image to fit the width of the page.
-fit-to-height
Scale the image to fit the height of the page.
-compress {rle|tiff|none}
Specifies the compression method for the PCL output. rle (Run Length Encoding) is default. tiff uses TIFF G4 Fax compression.
-printer {laserjet|laserjetplus|ljet3|ljet4|ljet5|ljet6|deskjet|pslaserjet}
Optimizes output for a specific printer model or PCL level.
-level {2|3|4|5}
Specifies the PCL language level compatibility.
-formfeed
Outputs a form feed character at the end of the PCL stream (default).
-noformfeed
Suppresses the output of a form feed character.
-landscape
Prints the image in landscape orientation.
-portrait
Prints the image in portrait orientation (default).
-rotate
Rotates the image 90 degrees clockwise before printing.
-pagenum n
Sets the starting page number in the PCL stream.
-duplex
Enables duplex (two-sided) printing for compatible printers.
-simplex
Disables duplex printing (default).
DESCRIPTION
The pbmtoppa command is a utility from the Netpbm graphics toolkit that converts a Portable Bitmap (PBM) image into the Hewlett-Packard Printer Command Language (PCL) format. Specifically, it generates PCL output compatible with HP LaserJet printers, particularly older models that utilize the PA-RISC (PCL-5) subset of the language. This tool is crucial for printing 1-bit deep (black and white) images directly to compatible HP LaserJet printers without requiring a graphical environment or specialized printer drivers on the system sending the data. It reads the PBM image from standard input by default, or from a specified file, and writes the generated PCL data to standard output. Users can control various aspects of the output, including image position, resolution, scaling, and compression method, to optimize the printed result for a specific printer model or page layout.
CAVEATS
The pbmtoppa command is designed for 1-bit deep PBM images. While it can theoretically process grayscale or color images through the Netpbm conversion chain (e.g., pnmtopgm or pnmtogray followed by pnmtobm), its output is inherently monochrome PCL suitable for black and white laser printers. Compatibility with specific HP LaserJet models and PCL levels might vary; testing with your target printer is recommended. Its use is generally for direct printing to older PCL-compatible printers or for generating PCL data for spooling systems that handle raw PCL.
PCL OUTPUT CONSIDERATIONS
The PCL output generated by pbmtoppa is a raw printer language stream. This output is typically sent directly to a printer via a parallel port, USB port, or network connection (e.g., using lp or lpr with a raw queue, or via netcat to a printer's port 9100). It is not a document format like PDF or PostScript, but rather instructions for the printer's internal rasterizer. Ensure the printer is configured to accept raw PCL data.
HISTORY
As part of the comprehensive Netpbm project, pbmtoppa has been developed and maintained over many years. The Netpbm toolkit itself originated from the Pbmpusplus package created by Jef Poskanzer in the late 1980s. pbmtoppa specifically addresses the need to generate PCL output for HP LaserJet printers, which became dominant in office environments. Its development reflects the evolution of printer technologies and the need for flexible command-line tools to manage image conversions for various output devices without relying on graphical interfaces or proprietary drivers. It remains a standard component for many Linux distributions due to Netpbm's widespread utility.
SEE ALSO
netpbm(1), pbm(5), pnmtops(1), pnmtopclxl(1), pbmtolj(1)