PSUtils - PostScript Utilities (Version 1.17)



Documentation
Psbook
Psmerge
Psnup
Psselect
Pstops
Psresize
Epsffit
Extractres, includeres

PSUtils is a collection of useful utilities for manipulating PostScript documents. The package consists of the following programs

psbook, psnup, psresize, psselect, pstops, epsffit, getafm

and perl-scripts

extractres, fixdlsrps, fixfmps, fixmacps, fixpsditps, fixpspps, fixscribeps, fixtpps, fixwfwps, fixwpps, fixwwps, includeres, psmerge.

Documentation

  • Man Pages: psbook(1), psmerge(1), psnup(1), psresize(1), psselect(1), pstops(1), epsffit(1), extractres(1), fixdlsrps(1), fixfmps(1), fixmacps(1), fixpsditps(1), fixpspps(1), fixscribeps(1), fixtpps(1), fixwfwps(1), fixwpps(1), fixwwps(1), getafm(1), includeres(1).

Psbook

Psbook rearranges pages from a PostScript document into "signatures" for printing books or booklets, creating a new PostScript file. The input PostScript file should follow the Adobe Document Structuring Conventions.

Psmerge

Psmerge merges PostScript documents into a single document. It only works in the specific case the the files were created using the same application, with the same device setup and resources (fonts, procsets, patterns, files, etc) loaded. If the -o option is used, output will be sent to the file named, otherwise it will go to standard output. Psmerge will merge multiple files concatenated into a single file as if they were in separate files.

Psnup

Psnup puts multiple logical pages onto each physical sheet of paper. The input PostScript file should follow the Adobe Document Structuring Conventions.

Examples: The potential use of this utility is varied but one particular use is in conjunction with psbook(1). For example, using "groff" to create a PostScript document and "lpr" as the UNIX print spooler a typical command line might look like this:

% groff -Tps -ms file | psbook | psnup -2 | lpr

Where file is a 4 page document this command will result in a two page document printing two pages of file per page and rearranges the page order to match the input pages 4 and 1 on the first output page and pages 2 then 3 of the input document on the second output page.

Psselect

Psselect selects pages from a PostScript document, creating a new PostScript file. The input PostScript file should follow the Adobe Document Structuring Conventions.

Pstops

Pstops rearranges pages from a PostScript document, creating a new PostScript file. The input PostScript file should follow the Adobe Document Structuring Conventions. Pstops can be used to perform a large number of arbitrary re-arrangements of Documents, including arranging for printing 2-up, 4-up, booklets, reversing, selecting front or back sides of documents, scaling, etc.

Psresize

Psresize rescales and centres a document on a different size of paper. The input PostScriptfile should follow the Adobe Document Structuring Conventions.

Examples: The following command can be used to convert a document on A4 size paper to letter size paper:

% psresize -PA4 -pletter in.ps out.ps

Epsffit

Epsffit fits an EPSF file (encapsulated PostScript) to a given bounding box. The coordinates of the box are given by (llx,lly) for the lower left, and (urx,ury) for the upper right, in PostScript units (points).

If no input or output files are specified, epsffit read from the standard input and writes to the standard output.

Extractres, includeres

Extractres extracts resources (fonts, procsets, patterns, files, etc) appearing in a PostScript document, and puts appropriate "%%IncludeResource" comments in the document prologue. The extracted resources are written to files with the same name as the resource, and an appropriate extension.

Includeres includes resources (fonts, procsets, patterns, files, etc) in place of "%%IncludeResource" comments in a PostScript document. The resources are searched for in the current directory and the system default directory under the resource name, and with an appropriate extension.

The pipeline

% extractres file.ps | includeres >out.ps

will move all resources appearing in a document to the document prologue, removing redundant copies. The output file can then be put through page re-arrangement filters such as "psnup" or "pstops" safely.