compressed printing to a laserjet from a shell program

Lennart Sorensen lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org
Thu Apr 21 13:24:04 UTC 2005


On Wed, Apr 20, 2005 at 04:31:49PM -0400, Madison Kelly wrote:
> Lennart Sorensen wrote:
> >On Wed, Apr 20, 2005 at 10:25:45AM -0400, Madison Kelly wrote:
> >
> >> I have a text-based accounting program running on Linux (clients and 
> >>server). I have an HP LaserJet 2430dtn setup and working wonderfully 
> >>from GUI apps and from the command line. What I need to do, and I have 
> >>limited experience printing from the shell, is get the shell program to 
> >>tell the printer to print in a compressed mode.
> >>
> >> I have created a second copy of the driver/queue to play with so the 
> >>main printer driver should be left alone and stay working letting me 
> >>experiment as I need to on the new second queue.
> >>
> >> The system is FC3 and the terminal is bash.
> >
> >
> >What do you mean by compressed mode?
> >
> >If you mean like 2 pages on on sheet of paper, then if you have a good
> >printing system (nothing beats cupsys) then you can do:
> >
> >lpr -o number-up=2
> 
> ... It never ceases to amaze how a problem that can be so vexing can 
> have such a simple solution. That worked perfectly, thank you!

Just don't try to figure out the scripts behind the scenes of cupsys.
They are very clever and really hard to follow.  Great way to make your
brain hurt.

For example this is valid: lpr -o media=Letter,Transparency (great if
you have an inkjet supported by gimpprint driver and want to tell it
what it is printing on.  It even has tons of high end brand name paper
types).  lpoptions -l gives a list for the chosen printer (if you have
picked a default), otherwise tell it which printer to look at the
options for,

You can also do nice things like:
lpr -o landscape
lpr -o page-range=1-4,7-9
lpr -o outputorder=reverse (real handy on inkjets that stack paper
backwards)
lpr -o mirror (iron on transfers need this)
lpr -o prettyprint (for c, c++ highlighting, and nice indenting and
filename at top and such)
lpr -o scaling=100 imagefile prints the image to fit 100% of the paper
size by scaling it to fit.  scaling=200 will make the image print on 4
sheets of paper.
lpr -o natural-scaling=100 imagefile prints the image at 100% of it's
original size (which I guess depends on some dpi setting somewhere)

There are also cpi= lpi= and brightness=, gamme=, and so on for
controlling text size for normal text files and brightness and gamma are
obvious.

For all the cupsys goodness see:
http://localhost:631/sum.html#STANDARD_OPTIONS

Lennart Sorensen
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list