foo2zjs-pstops
Convert PostScript to ZjStream format for printers
SYNOPSIS
foo2zjs-pstops [options] [input.ps] [output.ps]
foo2zjs-pstops [options] < input.ps > output.ps
PARAMETERS
-l
Selects specific pages to print. pages can be a comma-separated list of page numbers or ranges (e.g., '1,3-5,7').
-n
Enables N-up printing, arranging N logical pages onto a single physical sheet. Common values are 2, 4, 6, 8, etc.
-o
Sets the output orientation of the pages. Common values include 'portrait' or 'landscape'.
-s
Scales the content of the pages by the specified factor. For example, '0.5' for half size.
-b
Reverses the page order, typically used for back sides in duplex printing.
-e
Prints only even-numbered pages.
-N
Enables booklet mode, arranging and reordering pages for proper folded booklet printing.
-S
Specifies the source page size (e.g., 'A4', 'Letter').
-P
Specifies the destination page size for output (e.g., 'A4', 'Letter').
-W
Sets the output width in PostScript points.
-H
Sets the output height in PostScript points.
-X
Adjusts the X-axis offset of the content on the page in PostScript points.
-Y
Adjusts the Y-axis offset of the content on the page in PostScript points.
DESCRIPTION
The foo2zjs-pstops command is a specialized utility included with the foo2zjs printer driver suite, designed to preprocess PostScript files before they are sent to printers utilizing the proprietary ZjStream protocol or similar formats supported by foo2zjs.
Unlike generic PostScript manipulation tools, foo2zjs-pstops is tailored to integrate seamlessly with the foo2zjs workflow. Its primary function is to manipulate the layout and order of pages within a PostScript document. This includes selecting specific pages, reversing page order for duplex printing, arranging multiple pages per sheet (N-up printing), creating booklets, and adjusting page scaling and positioning.
It takes a PostScript file as input (either from standard input or a specified file) and produces a modified PostScript file on standard output or to an output file. This processed PostScript is then typically piped as input to the main foo2zjs rasterizer, which converts it into the printer's native language. foo2zjs-pstops is an essential component for users needing advanced print layout capabilities with their foo2zjs-compatible printers, such as printing brochures, manuals, or saving paper by consolidating content.
CAVEATS
foo2zjs-pstops requires a valid PostScript file as input; it cannot process other document formats directly. It is a pre-processor and does not perform the final rasterization or direct printer communication; its output must typically be piped to the main foo2zjs filter for actual printing. Complex or non-standard PostScript constructs might not be handled as expected, though it generally works well with standard PostScript produced by applications.
CUPS INTEGRATION
When used within the Common Unix Printing System (CUPS), foo2zjs-pstops typically acts as a filter in the print job pipeline, often invoked by a wrapper script like foo2zjs-wrapper. This allows users to leverage its capabilities through standard print commands like lpr or through graphical print dialogs, with options being passed by CUPS.
USAGE PIPELINE
A common usage pattern involves piping the output of foo2zjs-pstops to the main foo2zjs driver: cat document.ps | foo2zjs-pstops -n 2 | foo2zjs | lp. This example demonstrates taking a PostScript document, arranging two pages per sheet, converting it to the printer's native format, and then sending it to the default printer.
HISTORY
foo2zjs-pstops is an integral part of the foo2zjs open-source printer driver project, primarily developed by Rick Richardson. The foo2zjs suite emerged to provide robust Linux/Unix support for a range of laser printers that use proprietary data streams (like ZjStream), for which native manufacturer drivers were often unavailable or inadequate. foo2zjs-pstops was created to extend the functionality of the driver, allowing users to perform common PostScript page manipulations – such as N-up printing, duplexing, and booklet creation – directly within the foo2zjs processing pipeline, thus enhancing flexibility and resource efficiency for these specific printer models.
SEE ALSO
foo2zjs(1), foo2zjs-wrapper(1), pstops(1), psbook(1), psselect(1), psnup(1), gs(1)