pnmtopclxl
Convert PNM images to PCL XL format
TLDR
Convert PNM files to an HP LaserJet PCL XL printer stream
Specify the resolution of the image as well as the location of the page from the upper left corner of each image
Generate a duplex printer stream for the specified paper format
SYNOPSIS
pnmtopclxl [options] [pnmfile]
PARAMETERS
-width=width
Scales the image to the specified width in inches.
-height=height
Scales the image to the specified height in inches.
-xscale=xscale
Scales the image horizontally by the factor xscale.
-yscale=yscale
Scales the image vertically by the factor yscale.
-scale=scale
Scales the image uniformly by the factor scale in both X and Y directions.
-gray
Outputs the PCL XL data in grayscale. If the input PNM is color, it will be converted to grayscale.
-rgb
Outputs the PCL XL data using the RGB color space. This is the default for color images.
-cmyk
Outputs the PCL XL data using the CMYK color space.
-compress={none|rle|jpeg|delta}
Specifies the compression method for the image data: none (no compression), rle (Run-Length Encoding), jpeg (JPEG compression), or delta.
-landscape
Sets the page orientation to landscape.
-resolution=dpi
Sets the output resolution in dots per inch (dpi).
-pagesize={A3|A4|A5|B4|B5|executive|folio|jisb4|jisb5|ledger|legal|letter|monarch|number10|tabloid}
Sets the standard page size for the output document.
-pageleft=left
Sets the left margin of the image on the page in inches.
-pagetop=top
Sets the top margin of the image on the page in inches.
-multipagemode
Enables a mode where pnmtopclxl does not close the PCL XL page after processing an image, allowing multiple concatenated pnmtopclxl outputs to form a single PCL XL document with multiple images on one or more pages.
pnmfile
The input PNM image file. If omitted, pnmtopclxl reads from standard input.
DESCRIPTION
The pnmtopclxl command is a utility from the Netpbm project designed to convert PNM (Portable Anymap) image files into PCL XL (Printer Command Language XL) format. PCL XL is a page description language primarily used by modern Hewlett-Packard (HP) printers. This command takes a PNM image (which can be PBM, PGM, or PPM) as input, either from a specified file or standard input, and outputs the corresponding PCL XL data to standard output.
It supports various options for scaling, setting output resolution, defining page sizes and margins, selecting color spaces (grayscale, RGB, CMYK), and choosing compression methods. This makes it a versatile tool for preparing images for direct printing on PCL XL compatible printers, especially when precise control over image rendering on the page is required for automated workflows or custom print solutions.
CAVEATS
This command implements a subset of the complex PCL XL specification. While it is suitable for converting image data for printing, it is not designed for general document generation. Compatibility with all PCL XL printers may vary, especially with older or non-HP models that might not fully support the PCL XL standard.
STANDARD INPUT/OUTPUT
Like most Netpbm tools, pnmtopclxl typically reads the PNM image from standard input if no pnmfile argument is provided, and writes the PCL XL output to standard output. This design facilitates piping commands together, for example, convert input.jpg pnm:- | pnmtopclxl - > output.pclxl.
PCL XL BACKGROUND
PCL XL (also known as PCL 6 Enhanced) is a binary, object-oriented printer language introduced by HP to provide improved performance and features over older PCL versions. It is designed to be more efficient for graphics and text rendering, often used for direct print streams to laser printers.
HISTORY
pnmtopclxl is a component of the Netpbm graphics toolkit, a widely used suite of command-line tools for image manipulation. Netpbm itself originated from the PBMPLUS package created by Jef Poskanzer in the late 1980s. Over the years, Netpbm has grown to include hundreds of utilities, with pnmtopclxl being added to support the PCL XL format, which became prevalent with newer HP printers. It continues to be maintained as part of the Netpbm project, providing essential image format conversion capabilities in Unix-like environments.