foo2zjs-wrapper
Print to specific ZjStream-based printers
SYNOPSIS
foo2zjs-wrapper [OPTIONS] [FILE]
PARAMETERS
FILE
The PostScript file to be processed. If no file is specified, foo2zjs-wrapper reads from standard input (stdin).
-r
Sets the printer resolution, e.g., 600 or 1200 DPI. This option is passed directly to foo2zjs and can also influence Ghostscript rendering.
-d
Specifies duplex (double-sided) printing mode. Common values include 'Simplex', 'DuplexNoTumble', or 'DuplexTumble'.
-p
Defines the paper size, such as 'Letter', 'A4', 'Legal', etc.
-c
Sets the color rendering mode, e.g., '1' for color, '0' for monochrome/grayscale.
-n
Prints multiple pages per sheet. For example, '-n 2' for 2-up, '-n 4' for 4-up.
-t
Enables or disables toner save mode, typically '0' for normal, '1' for toner save.
-G
Forces grayscale rendering of the output, even for color input.
-s
Selects the paper input tray or source, e.g., '1' for tray 1, '2' for manual feed.
-N
Specifies the number of copies to print. While CUPS often handles copies, this option can also be passed to the driver.
-v
Enables verbose output, showing more details about the processing steps and options used.
-K
Sets the resolution for Ghostscript rendering (often for internal PPM conversion, passed to gs).
-R
Similar to -K, sets the Ghostscript resolution for input rendering (passed to gs).
...
Many other options supported by the underlying foo2zjs driver are passed through by the wrapper. Refer to the foo2zjs(1) man page for a comprehensive list.
DESCRIPTION
The foo2zjs-wrapper command acts as a convenient front-end for the foo2zjs printer driver, primarily designed to simplify the printing of PostScript files to ZjS-based laser printers. It typically takes a PostScript input stream or file, processes it through Ghostscript (gs) to convert it into a raw PPM (Portable PixMap) image, and then feeds this PPM data to the foo2zjs driver to generate the printer-specific ZjS (Zjs Imaging System) language output.
This wrapper is particularly useful in environments like CUPS (Common Unix Printing System) where print jobs are often submitted as PostScript. It abstracts away the multi-step conversion process, allowing users or CUPS to simply send a PostScript file to the wrapper, which then handles the entire conversion pipeline to produce the printer-ready data. Many common printing options, such as resolution, paper size, duplexing, and color mode, are passed directly through to the underlying foo2zjs driver, providing a unified interface for configuration and printing.
CAVEATS
The foo2zjs-wrapper command relies on the presence and correct configuration of both the foo2zjs driver and Ghostscript (gs) on the system. It is primarily designed to handle PostScript input; other input formats may require prior conversion. The output is raw printer data, which typically needs to be directed to a printer queue (e.g., via lpr) or directly to a printer device.
INTEGRATION WITH CUPS
In a CUPS environment, foo2zjs-wrapper is often configured as a filter. When a print job is sent to a printer queue that uses a foo2zjs PPD (PostScript Printer Description) file, CUPS will typically invoke this wrapper with the PostScript job data. The wrapper then processes the job and sends the resulting printer-ready ZjS data back to CUPS, which in turn sends it to the physical printer.
INPUT AND OUTPUT
The expected input for foo2zjs-wrapper is PostScript data, which can be provided via standard input (piped from another command) or by specifying a file path as an argument. The command's output is the raw ZjS printer language data, which is written to standard output. This output is usually redirected to a printer device or piped to a print spooler command like lpr.
HISTORY
The foo2zjs project, which includes the foo2zjs-wrapper, was initiated by Rick S. Casey. Its development stemmed from the need for open-source drivers for printers utilizing the ZjS (Zjs Imaging System) language, which is common in many HP, Xerox, Minolta, Konica, Samsung, and Lexmark laser printers that lack native PostScript support. The wrapper was created to streamline the workflow, particularly for CUPS integration, by automating the Ghostscript-to-PPM and PPM-to-ZjS conversion pipeline, making these printers more accessible on Linux and Unix-like systems.