[home]
upprint: tools for better n-up printing


Contents

Description

Typical 2-up page placement
2-up page placement with upprint
The upprint package contains tools for better formatting of print jobs. Unlike print systems such as CUPS, which delegate all formatting to the print server, the upprint tools are designed to work on the user side, and therefore under the user's control. The package provides the following tools:
  • pstops-clip: an extension of Angus J. C. Duggan's pstops program for reformatting postscript files. The extension allows configurable page clipping.
  • psdim: a small utility to be used in conjunction with pstops. It determines the true margins of a postscript documents and calculates the optimal page placement for n-up printing. It outputs a format string suitable for processing by pstops or pstops-clip. In order to accurately determine the size of the pages in a postscript document, psdim internally uses the ghostscript interpreter to render the document. For this reason, psdim is relatively slow, but much more accurate than other tools.
  • lprwrap: a wrapper around the standard "lpr" program. Lprwrap is a client-side program, which means, all processing is done under your control before passing the print job to lpr. Lprwrap can convert common file formats to postscript. It recognizes special options for duplex printing and n-up printing. It handles n-up printing intelligently, with optimal margins based on the actual document (see above illustration).

News

For changes prior to version 1.5, see the file NEWS. For a more detailed list of changes, see the ChangeLog.

February 15, 2007: Release 1.5 The new upprint package combines the features of the old lpr-wrapper and psdim packages. It contains lprwrap, psdim, as well as the new program pstops-clip. Page clipping was improved, so that documents with opaque backgrounds can now be printed in n-up mode. A 'fudge' feature was added to allow more flexible margin detection. The lpr-wrapper program was renamed lprwrap.

Downloading

If you would like to ensure the accuracy of the downloaded files, you can double-check their SHA1 sums.

Source distribution: upprint-1.5.tar.gz
Packages: Redhat Binary RPM (i386) upprint-1.5-1.i386.rpm
Redhat Source RPM upprint-1.5-1.src.rpm
Gentoo ebuild lpr-wrapper-0.6-gentoo.tar.bz2(1)

(1) Gentoo ebuild courtesy of Tobias Sager <moixa AT gmx.ch>. Go here for the newest version.

Dependencies

For psdim to work, ghostscript must be installed on your system.

For lprwrap to work, you need at least: bash, lpr, file, mktemp, sed, and awk. For enhanced functionality, you should also have: getopt, mpage, gzip, bzip2, iconv, dvips, and pdf2ps.

For your convenience, here are some links to the required packages. The RPM links are outdated. The software marked "*" is required for lprwrap and lprwrap-cups. The software marked "**" is required for lprwrap.

Installing

You can build and install the upprint tools from sources using the standard configure/make commands. Please see the file INSTALL for generic installation instructions. Also see the file README for specific compile time configuration options. Redhat RPM packages are also available.

Lprwrap examples and customization

You can use the lprwrap program in the same way you normally use "lpr", for example:
  lprwrap -oduplex test.ps
This should print the page in duplex (double-sided) format, if your printer allows it. If you are using the CUPS printing system, use
  lprwrap-cups -oduplex test.ps
instead. Also try 2-up printing with
  lprwrap -o2up test.ps

For ease of use, you can rename the lprwrap program as "lpr". To do so, you must first rename the original lpr program as lpr-orig. Create a symbolic link from "lpr" to "lprwrap" (or "lprwrap-cups", if you are using CUPS).

  cd /usr/bin
  mv lpr lpr-orig
  ln -s lprwrap lpr     ---OR:---    ln -s lprwrap-cups lpr
You can now run the lprwrap utility by the name "lpr". (Note that the name "lpr-orig" is hardwired into lprwrap, so don't change the name to anything else).

Psdim examples

In the simplest case, psdim can be used to figure out an optimal format string for 2-up printing:

              % psdim --2up test.ps
              [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]
              2:0@0.93L(9.79in,-1.13in)+1@0.93L(9.79in,4.09in)
The resulting format string can be fed directly to pstops:

              % pstops `psdim --2up test.ps` test.ps test.2up.ps
              [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]
              [1] [2] [3] [4] [5]
              Wrote 5 pages, 155746 bytes

Documentation

For usage instructions, see the file README.

You can also view the man pages lprwrap(1), psdim(1), and pstops-clip(1).

Related software

  • Ghostscript. The PostScript interpreter. Required by psdim.

Version

1.5

License

For psdim and lprwrap:

Copyright © 2001-2007 Peter Selinger.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.

See the file COPYING for details.

For pstops-clip:

Copyright © 1991-1995 Angus J. C. Duggan.
Copyright © 2006-2007 Peter Selinger.

This program may be copied and used for any purpose (including distribution as part of a for-profit product), provided:

  1. The original attribution of the programs is clearly displayed in the product and/or documentation, even if the programs are modified and/or renamed as part of the product.

  2. The original source code of the programs is provided free of charge (except for reasonable distribution costs). For a definition of reasonable distribution costs, see the Gnu General Public License or Larry Wall's Artistic License (provided with the Perl 4 kit). The GPL and Artistic License in NO WAY affect this license; they are merely used as examples of the spirit in which it is intended.

  3. These programs are provided "as-is". No warranty or guarantee of their fitness for any particular task is provided. Use of these programs is completely at your own risk.

See the file pstops-clip/LICENSE for details.

Back to Homepage: [home]
Peter Selinger / Department of Mathematics and Statistics / Dalhousie University
selinger@users.sourceforge.net / PGP key