242 lines
10 KiB
HTML
242 lines
10 KiB
HTML
<!--startcut ======================================================= -->
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
|
<html>
|
|
<head>
|
|
<META NAME="generator" CONTENT="lgazmail v1.2M.l">
|
|
<TITLE>The Answer Guy 45: Saving Trees: Laying up Multiple Pages per Printer Sheet</TITLE>
|
|
</HEAD><BODY BGCOLOR="#FFFFFF" TEXT="#000000"
|
|
LINK="#3366FF" VLINK="#A000A0">
|
|
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
|
|
<H4>"The Linux Gazette...<I>making Linux just a little more fun!</I>"</H4>
|
|
<P> <hr> <P>
|
|
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
|
|
<center>
|
|
<H1><A NAME="answer">
|
|
<img src="../../gx/dennis/qbubble.gif" alt="(?)"
|
|
border="0" align="middle">
|
|
<font color="#B03060">The Answer Guy</font>
|
|
<img src="../../gx/dennis/bbubble.gif" alt="(!)"
|
|
border="0" align="middle">
|
|
</A></H1>
|
|
<BR>
|
|
<H4>By James T. Dennis,
|
|
<a href="mailto:linux-questions-only@ssc.com">linux-questions-only@ssc.com</a><BR>
|
|
LinuxCare,
|
|
<A HREF="http://www.linuxcare.com/">http://www.linuxcare.com/</A>
|
|
</H4>
|
|
</center>
|
|
|
|
<p><hr><p>
|
|
<!-- endcut ======================================================= -->
|
|
<!-- begin 10 -->
|
|
<H3 align="left"><img src="../../gx/dennis/qbubble.gif"
|
|
height="50" width="60" alt="(?) " border="0"
|
|
>Saving Trees: Laying up Multiple Pages per Printer Sheet</H3>
|
|
|
|
|
|
<p><strong>From Kong Liong Wong on Tue, 24 Aug 1999
|
|
</strong></p>
|
|
<!-- ::
|
|
Saving Trees: Laying up Multiple Pages per Printer Sheet
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
:: -->
|
|
<P><STRONG>
|
|
Hi Answerguy
|
|
</STRONG></P>
|
|
<P><STRONG>
|
|
I'm running Solaris 2.6 and I'm using HP Jetadmin to administer my network
|
|
HP laser printers. I've seen some organization who are able to print double
|
|
pages on 1 sheet, with the time stamp, user as well as page number
|
|
information neatly printed on the side. All I'm able to achieve now is
|
|
printing 1 page per sheet and the formatting is ugly.
|
|
I know I can use HP JetPrint to format my printing, but is there any other
|
|
alternative way?
|
|
</STRONG></P>
|
|
<P><STRONG>
|
|
Please help
|
|
</STRONG></P>
|
|
<P><STRONG>
|
|
regards
|
|
Kong Liong
|
|
</STRONG></P>
|
|
<BLOCKQUOTE><IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
|
|
HEIGHT="28" WIDTH="50" BORDER="0"
|
|
>
|
|
Is this a PostScript (TM) printer? If not you probably want to
|
|
install a Ghostcript filter so that any PostScript that you send
|
|
to the queue will be converted into your printer's native control
|
|
language (some version of PCL for your HP).
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
Once that is accomplished it's very easy to configure your system
|
|
to perform lay up as you describe. There's a program called
|
|
'<tt>mpage</tt>' which is commonly available with Linux distributions
|
|
(you'll have to dig around to find the sources and compile them
|
|
for Solaris). It's what you want.
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
'<tt>mpage</tt>' (<A HREF="http://gate.mesa.nl/pub/mpage"
|
|
>http://gate.mesa.nl/pub/mpage</A>) allows you to print 1,
|
|
2, 4 or 8 pages of text per side of a printed sheet. It does
|
|
this by arranging the text into PostScript pages, and using the
|
|
scaling and rotation features of PostScript to do the the layout.
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
'<tt>mpage</tt>' will add a small frame and a set of headers and footers
|
|
to each printed sheet by default. It offers a number of options
|
|
to disable or control these features. There's where you can get
|
|
your filename, date, username and other information onto the
|
|
output.
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
That's fine for text. However, your output is already in
|
|
PostScript there's a program called '<tt>pstops</tt>' which can do a
|
|
PostScript to PostScript "conversion/translation" according to
|
|
the parameters you specify. In that model you can provide it
|
|
with parameters to scale each odd numbered page to 60%, rotate it
|
|
ninety degrees, position it on an output sheet, take every even
|
|
numbered page, scale it, rotate it another direction, add it to
|
|
your output page, etc.
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
Notice that I gave an example of scaling/reducing the pages by
|
|
less than 50% for a reason. It turns out that typical margins
|
|
around your original pages are just a bit larger than they need
|
|
to be when you do this layout. So scaling by 55% to 65% actually
|
|
produces better looking and more readable output.
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
It can be a bit tricky to get your pstops parameters right.
|
|
While I was writing my book I'd generate the PS file from my
|
|
LaTeX <tt>.dvi</tt> files (using '<tt>dvips</tt>'), then for some of the draft
|
|
printouts I'd use '<tt>pstops</tt>' to lay that out and '<tt>gv</tt>' to select
|
|
the even sheets (print those), and finally use '<tt>gv</tt>' to toggle my
|
|
sheet/page selections, turn the paper around and print the
|
|
other sides. Most of the work was done by my book's Makefile
|
|
(using '<tt>make</tt>'). The result was that I could generate a full
|
|
draft of my book while only using about 100 sheets of paper for
|
|
400 pages of writing. (Luckily my eyes are fine with the reduction).
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
Here's a sample '<TT>pstops</TT>' command like the one that I used:
|
|
</BLOCKQUOTE>
|
|
|
|
<blockquote><code>pstops -q -pletter "2:0L@.7(21cm,0)+1L@.7(21cm,11.6cm)"
|
|
lsa.ps > /tmp/quarto.ps
|
|
</code></blockquote>
|
|
<BLOCKQUOTE>
|
|
(The term "quarto" is probably a misnomer here --- but
|
|
that's what I called it in my Makefile).
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
While writing this I've been running a couple of web searches in
|
|
my other '<tt>screen</tt>' terminals (to get a good URL on mpage and to
|
|
check the man page). While I was doing that I noticed that
|
|
'<tt>mpage</tt>' wasn't installed on my
|
|
<A HREF="http://www.debian.org/">Debian</A> box so I did an '<tt>apt-get
|
|
install</tt>' of that and found that it apparently supports layup of
|
|
PostScript as well as text files. It's probably a newer version
|
|
than I remember. Possibly it's just a feature that's been there
|
|
for years, which I just never noticed before.
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
Considering how obtuse the '<tt>pstops</tt>' command arguments can be
|
|
perhaps you should just stick with '<tt>mpage</tt>'.
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
'<tt>pstops</tt>' is part of the PSUtils page by Angus J. C. Duggan
|
|
(<A HREF="http://www.tardis.ed.ac.uk/home/ajcd/psutils"
|
|
>http://www.tardis.ed.ac.uk/home/ajcd/psutils</A>). There are a
|
|
number of other free tools that he's provided which might be of
|
|
interest to anyone with advanced printing needs. In fact,
|
|
glancing at his web page I see that I probably should have been
|
|
using '<tt>psnup</tt>' instead of '<tt>pstops</tt>' for what I was doing.
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
Oh well. Live long enough and you can learn lots. One of the
|
|
reasons I spent so much time on TAG is that it gives me the
|
|
incentive to double check the man pages and look up the web sites
|
|
for packages that I use --- so I often learn new tricks in the
|
|
process.
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
Incidentally I'd like to make a special notice on Angus' web page
|
|
for the PSUtils package. It's beautiful. There's lots of very
|
|
useful information about the package --- and he's taken the time
|
|
to give credit to a large number of people that inspired his work
|
|
or otherwise contributed to the package.
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
Thanks, Angus. (I've copied you, and the current maintainer of
|
|
'<tt>mpage</tt>' on this message. It will be published in the Linux
|
|
Gazette Answer Guy column later this month. Linux Gazette is
|
|
at <A HREF="http://www.linuxgazette.com"
|
|
>http://www.linuxgazette.com</A> --- which is odd since it's a
|
|
free webazine with very little commercial sponsorship).
|
|
</BLOCKQUOTE>
|
|
|
|
<p><em>[ Given the number of commercial support bullets, and the generous
|
|
hosting by SSC, I'm tempted to disagree on the amount of commercial
|
|
sponsorship, though I must admit that I'm very pleased not to
|
|
see it smothered with "regulation size" banner ads.
|
|
-- Heather ]</em></p>
|
|
|
|
<BLOCKQUOTE>
|
|
In any event, Mr. Wong, I hope these tips will help you get what
|
|
you want out of your printer. Of course, there are many other
|
|
print filtering packages available for Linux and other forms of
|
|
UNIX. I'm sure I'll learn about a few more, probably as a result
|
|
of some future "Answer Guy" question.
|
|
</BLOCKQUOTE>
|
|
<!-- sig -->
|
|
|
|
<!-- end 10 -->
|
|
<!--startcut ======================================================= -->
|
|
<P> <hr> <P>
|
|
<H5 align="center"><a href="http://www.linuxgazette.com/copying.html"
|
|
>Copyright ©</a> 1999, James T. Dennis
|
|
<BR>Published in <I>The Linux Gazette</I> Issue 45 September 1999</H5>
|
|
<H6 ALIGN="center">HTML transformation by
|
|
<A HREF="mailto:star@starshine.org">Heather Stern</a> of
|
|
Starshine Technical Services,
|
|
<A HREF="http://www.starshine.org/">http://www.starshine.org/</A>
|
|
</H6>
|
|
<P> <hr> <P>
|
|
<!-- begin tagnav ::::::::::::::::::::::::::::::::::::::::::::::::::-->
|
|
<TABLE WIDTH="98%"><TR VALIGN="center" ALIGN="center">
|
|
<TD ROWSPAN="2" COLSPAN="2" WIDTH="42%"><A
|
|
HREF="../lg_answer45.html"
|
|
><IMG SRC="../../gx/dennis/answernew.gif"
|
|
ALT="[ Answer Guy Index ]"></A></td>
|
|
<TD WIDTH="14%"><A HREF="1.html">1</A></TD>
|
|
<TD WIDTH="14%"><A HREF="2.html">2</A></TD>
|
|
<TD WIDTH="14%"><A HREF="3.html">3</A></TD>
|
|
<TD WIDTH="14%"><A HREF="4.html">4</A></TD>
|
|
</TR><TR VALIGN="center" ALIGN="center">
|
|
<TD WIDTH="14%"><A HREF="5.html">5</A></TD>
|
|
<TD WIDTH="14%"><A HREF="6.html">6</A></TD>
|
|
<TD WIDTH="14%"><A HREF="7.html">7</A></TD>
|
|
<TD WIDTH="14%"><A HREF="8.html">8</A></TD>
|
|
</TR><TR VALIGN="center" ALIGN="center">
|
|
<TD><A HREF="9.html" >9</A></TD>
|
|
<TD><A HREF="10.html">10</A></TD>
|
|
<TD><A HREF="11.html">11</A></TD>
|
|
<TD><A HREF="12.html">12</A></TD>
|
|
<TD><A HREF="13.html">13</A></TD>
|
|
</TR></TABLE>
|
|
<!-- end tagnav ::::::::::::::::::::::::::::::::::::::::::::::::::::-->
|
|
<P> <hr> <P>
|
|
<!-- begin lgnav ::::::::::::::::::::::::::::::::::::::::::::::::::: -->
|
|
<A HREF="../index.html"
|
|
><IMG SRC="../../gx/indexnew.gif" ALT="[ Table Of Contents ]"></A>
|
|
<A HREF="/index.html"
|
|
><IMG SRC="../../gx/homenew.gif" ALT="[ Front Page ]"></A>
|
|
<A HREF="../lg_bytes45.html"
|
|
><IMG SRC="../../gx/back2.gif" ALT="[ Previous Section ]"></A>
|
|
<A HREF="../lg_tips45.html"
|
|
><IMG SRC="../../gx/fwd.gif" ALT="[ Next Section ]"></A>
|
|
<!-- end lgnav ::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
|
|
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
|
|
</BODY></HTML>
|
|
<!--endcut ========================================================= -->
|