How to print booklets and save paper
The basic commands from psutils package
to print booklets from a postcript file file.ps are:
psbook file.ps B.ps
psnup -2 B.ps 2.ps
pstops "2:email@example.com(-0.00cm,0.0cm),1U@1.0(21cm,29.7cm)" 2.ps final.ps
\rm B.ps 2.ps final.ps
command rearranges the pages of file.ps in the proper order.
reduces its size: the area is divided by 2,
but notice that dimensions are only divided by the square root
of 2. The third
line allows printing in landscape using
a recto-verso printer, by inverting the orientation of every second page.
As the margins are different for all files, it is better to adjust
the margins for each file.
The script psbind
seems to be able to calculate these adjustments itself,
and proves useful for quick and dirty print
(use it instead of psnup -2),
but I have not tested its options yet.
The program psdim seems also interesting.
Here is an example. Let us suppose you want to print the file
you can use the following commands
zcat part2.ps.gz |psbook>B.ps
(this avoids gunzipping the file),
psnup -2 -m-30 -b-10 B.ps 2.ps
-m: adjusts external margins (with negative or positive values)
-b: adjusts all margins (both external and internal)
These two options are conflicting, so I suggest adjusting first
the internal margins using -b, and then adjusting external margins
pstops "2:firstname.lastname@example.org(-0.00cm,-0.2cm),1U@1.0(21cm,29.9cm)" 2.ps final.ps
As the options -m and -b of psnup are symmetrical, you may have
to correct a remaining dissymetry. In the file above, I corrected
a dissymetry in the y-axis. Of course you can do the same for
the x-axis. Besides, as printers may print with dissymetries,
you may want to correct them yourself using the pstops command:
it is up to you to make experiments with your printer.
option A4: Choose option A4 in ghostview when previewing.
margins: You can adjust all margins in a psnup-like
command using the script ps21. Notice that this script makes use of pstops which
must be present in your file system.
Though most postscript files are compliant, some may be
not be handled by psutils programs. A few perl scripts also
present in psutils package can cope with a few of them,
to make the files more or less compliant.
These scripts might not be present
in your platform but they can be downloaded separately.
A script of great use is for example
fixwfwps.pl which can fix postscript files created by
Windows Word like
mpage: (paragraph still under construction)
There exists an equivalent of psnup called
man mpage )
which may be present in your platform.
Notice that you cannot feed an mpage output
file to mpage itself or to psutils.
I have not tested mpage landscape mode yet. (At the LIX,
there exists a printer already configured
to print in landscape mode).
Notice that mpage allows to correct the four margins
There also seems to exist a
script form which seems to be different from the program
and that I have not tested for printing.
For one-sided printers,
diverse other techniques can be found at
The Linux Cookbook: Tips and Techniques for Everyday Use - PostScript
. If you have a one-sided printer, you can use the following
guidelines to print booklets:
The inverse command of psnup -2 is
Sometimes, for face-down printers, pages in the postscript file, such
as in Andrew Odlzko's or Donatella Merlini's papers, are
in the reversed order, though you cannot see it with your
favourite order, because it is told that the pages are
in descend order. Commands to put them back in ascend order
are pstops -0 or psselect -r.
No burst page:
Use the command lpr -h to prevent the printer from
printing the burst page.
Huge files: After conversions from different formats like pdf2ps,
you may end with huge files. You can print them with the
command lpr -s, to use the computer's memory instead of
the printer's one. But then you have to wait for the printing
to end before possibly erase the file.
One pass only! It is possible to do all the operations
in one command line only, of the type
<snip>-2R@.65\(0.5in,5.5in\)+1R@.65\(0.5in,11in\) file.ps final.ps
(remove the <snip>),
but then controlling the margins is much more difficult.
Overlapping pages: When the pages are scaled with a positive
factor, they might overlap on the other page. I do not know
how to solve this problem, except that an Acrobat software
in Windows might help (I did not have the time to try it).
I met this phenomenon when I wanted to print
the Newton's book Théorie des fluxions available
at gallica.bnf.fr. Let us
call the downloaded file file.pdf. I used
the following commands:
pdf2ps file.pdf newton.ps
psbook newton.ps B.ps
pstops "1:0@2(-10.3cm,-28cm)" B.ps C.ps
psnup -2 -b10 -m-30 C.ps 2.ps
and in the file 2.ps, the left part of the right A5 always
overlap the left A5. (Some of these files can be of more than 200 Mo
so do not try this example unless you have a powerful machine
and memory enough!)
There exist various commands able to manipulate postscript files,
belonging to the package psutils, present in most recent UNIX
platforms, described at:
psutils - utilities for manipulating PostScript documents.
PSUtils - PostScript utilities.
You can download files separately at
Index of /sw/nlp/distrib/nlp-3.0.4/contrib/psutils.
Send questions, comments and improvements at
URL originale de cette page:
Created on July, 2nd 2002.