[Novalug] Printing question

geoff mcnamara geoffm at companionway.net
Sat Dec 8 09:13:58 EST 2007


Charlie
There are a couple of unix (small-efficient) tools that will help with that:
the most common across unix versions is probably "pr" (the print tool) 
so to paginate a text file to a printer:
  pr <options> <file> | lpr

To see the formatted output before sending to a printer:
  pr <options> <file> | less

To see the options for "pr": 
  man pr

Some useful "pr" options:
-d    <-- double space
-f     <-- use form feeds instead of newlines to separate pages
-h "your string" <-- custom header centered - use "" to make it blank - 
defaults to printing file name at top
-l  nn   <-- set page length in lines to nn - usually not needed
-o nn  <-- margin offset
-t <-- omit page headers and footers
-w nn <-- alter page width
--help <-- the gnu usual for help
--- lots of other options as well

Other more powerful tools used the same way:
  enscript 
  mpage

-geoff

Charles M Howe wrote:
> List,
>
> I have a text file, (created using vi) of considerable length to print.
> It consists mainly of single lines  but sometimes (a few times a page)
> there are two lines of text. Then there is a blank line.
>
> The inelegant way of printing it is to insert a new page (control-L)
> after 60 (or 59, or even 58)lines of text, then a few blank lines. But
> that gets tedious. Can anyone suggest a better way of doing it?
>
> Charlie
>
>
> _______________________________________________
> Novalug mailing list
> Novalug at calypso.tux.org
> http://calypso.tux.org/cgi-bin/mailman/listinfo/novalug
>   



More information about the Novalug mailing list