0236-0239.html

来自「linux-unix130.linux.and.unix.ebooks130 l」· HTML 代码 · 共 464 行

HTML
464
字号


<HTML>

<HEAD>

<TITLE>Developer.com - Online Reference Library - 0672311739:RED HAT LINUX 2ND EDITION:Printing with Linux</TITLE>

<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>

 -->




<!-- ISBN=0672311739 //-->

<!-- TITLE=RED HAT LINUX 2ND EDITION //-->

<!-- AUTHOR=DAVID PITTS ET AL //-->

<!-- PUBLISHER=MACMILLAN //-->

<!-- IMPRINT=SAMS PUBLISHING //-->

<!-- PUBLICATION DATE=1998 //-->

<!-- CHAPTER=12 //-->

<!-- PAGES=0229-0242 //-->

<!-- UNASSIGNED1 //-->

<!-- UNASSIGNED2 //-->









<P><CENTER>

<a href="0233-0235.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0240-0242.html">Next</A>

</CENTER></P>



<A NAME="PAGENUM-236"><P>Page 236</P></A>













<P>The pr command has 19 different command-line options to help you format documents

for printing. For example,

</P>



<!-- CODE SNIP //-->

<PRE>

# pr +9 -h CONFIDENTIAL DOCUMENT -o 5 &lt; myfile.txt | lpr

</PRE>

<!-- END CODE SNIP //-->









<P>will print your document, starting at page 9, with a header containing the date, time,

words &quot;CONFIDENTIAL DOCUMENT,&quot; and page number, with a left margin of 5 spaces.

</P>









<P>Another text formatter you might want to try is the

fmt command; see its man page for details.

</P>









<H3><A NAME="ch12_ 10">

Other Helpful Printer Programs and<BR>

Filters

</A></H3>









<P>Printer filters work by defining and inserting printer definitions into your

/etc/printcap file. Embedded in each printer description is a pointer (pathname) to a script or program

containing the filter that is run before output to the printer. See the

printcap man page and the sample /etc/printcap listing later in this chapter.

</P>









<H4><A NAME="ch12_ 11">





APSfilter

</A></H4>









<P>Even if, as a Red Hat user, you're spoiled with the

printtool program, there might be times when you need to use other programs or scripts to help set up or manage printing. If you

can't or don't want to run X, but want to easily install printing services for HP or PostScript

printers, one great solution is the printing filter package called APSfilter, by Andreas Klemm

and Thomas Bueschgens. Installing APSfilter is a snap, and it's even easier to use.

</P>









<P>APSfilter works well with all Linux printing applications. Two added benefits are that it

prints two formatted pages in Landscape mode on a single page when you print text documents,

saving you paper, and automagically recognizes the following documents:

xfig, pbm, pnm, tiff, jpeg, gif, Sun rasterfile, PostScript,

dvi, raw ASCII, gzip, and compressed.

</P>









<P>One downside is that APSfilter's printing of grayscale is not as good as the grayscale

printing offered by the printtool program's setup (at least on

HP deskjets). Hopefully, this will be fixed in the next version.

</P>









<H4><A NAME="ch12_ 12">





BubbleTools

</A></H4>









<P>If you have a Canon Bubble Jet, IBM Proprinter X24E, Epson LQ1550, or Epson Stylus,

Olav Wolfelschneider's BubbleTools printer drivers can help you. This filter program converts

a number of graphics formats, including Group 3 Fax, for this series of 360-dpi printers.

</P>









<H4><A NAME="ch12_ 13">





magicfilter

</A></H4>









<P>Another printer filter similar to APSfilter is H. Peter Anvin's magicfilter, which detects

and converts documents for printing through a combination of a compiled C filter and

printer configuration file.

</P>









<P>You can find APSfilter, BubbleTools, and magicfilter, along with other Linux printing

utilities at

sunsite.unc.edu/pub/Linux/system/Printing.

</P>



<A NAME="PAGENUM-237"><P>Page 237</P></A>











<H4><A NAME="ch12_ 14">





PostScript Printers

</A></H4>









<P>If you want a print spooler specifically designed for PostScript printers, give Dave

Chappell's PPR a try. PPR works with printers attached to parallel, serial, and AppleTalk (LocalTalk)

ports, along with other network interfaces. PPR also works much like other non-PostScript

printer filters, and converts different graphics file formats for printing.

</P>









<P>You can find PPR at

ftp://ppr-dist.trincoll.edu/pub/ppr/.

</P>









<H4><A NAME="ch12_ 15">





Enhanced Printer Spooler

</A></H4>









<P>The future of Linux printing has arrived, and its

name is LPRng. This print spooler software, descended from the 4.3BSD release, but totally rewritten from the ground up, offers a host

of benefits and features in the areas of distribution, setup, use, and security. Some of these are

as follows:

</P>









<UL>

<LI>          GNU GPL distribution for freedom from restrictive copyrights

<LI>          Backwards printer filter compatibility

<LI>          Enhanced security with a permissions database

<LI>          Improved diagnostics

<LI>           Multiple printers on a single queue

<LI>          Simplified client and server printer configuration files

<LI>          Simplified printer database

</UL>









<P>You will find the latest copy of LPRng at the site

ftp://dickory.sdsu.edu/pub/LPRng (along with other neat printing utilities).

</P>









<H4><A NAME="ch12_ 16">





System Accounting

</A></H4>









<P>Want to know how much printing you or your users have been doing and at what cost?

Should your printer's name be &quot;TreeEater&quot;? See the man pages for the

pac command, which you can use to track usage and costs. You'll also need to read the man pages for the

printcap database to see how to enable printer use accounting.

</P>









<H3><A NAME="ch12_ 17">

Some Program Tips

</A></H3>









<P>The following are some helpful tips to help you print documents or set up applications

for easier printing.

</P>









<H5><A NAME="ch12_ 18">

emacs

</A></H5>









<P>Want to print directly from emacs? You can print the entire buffer, unformatted or

formatted, by pressing Esc+X, typing lpr-buffer, and hitting Enter, or by pressing Esc+X, typing

print-buffer, and hitting Enter. Just make sure that you set your

lpr-switches variable in your .emacs file to point to the correct printer in your

/etc/printcap file.

</P>



<A NAME="PAGENUM-238"><P>Page 238</P></A>















<P>You'll find emacs, along with its help files and documentation, on your Red Hat Linux <BR>

CD-ROM.

</P>









<H4><A NAME="ch12_ 19">





Applixware for Linux

</A></H4>









<P>Applixware, a fully integrated suite of office tools and development environment, is a

newcomer to the Linux scene, but is a veteran UNIX application. If you want to create,

import, edit, and print documents with ease, this product is a good bet.

</P>









<P>However, here's a tip on how to set up your printer for Applixware you won't find in

the program's manuals. Go to Applixware Preferences and select Printing. In the Printing

Preferences dialog that comes up, set Default Printer Type to PostScript, as shown in Figure

12.3. Then scroll down the list of preferences at the bottom of the dialog to Pathname of

Your Printer Aliases File. Click in the Value text area, and enter the path of the file

(/etc/printers). Then create a simple ASCII file containing a list of printers defined in your

/etc printcap file. (You are using X so that you can do a lot of different things at once, aren't you?)

</P>





<BR>

Figure 12.3.<BR>

The Printer Preferences<BR>

dialog.<BR>

<a href="10rhu03.html"><img src="images/tn_10rhu03_jpg.jpg"></a><BR>











<P>For example, here's a sample /etc/printcap for an

HP DeskJet 500, created following installation and setup using

printtool. Note that printtool offers four different modes for the

printer (normal black-and-white printing, normal color printing with color cartridge,

Floyd-Steinberg black-and-white print for better grayscale, and Floyd-Steinberg color printing for best, but slow):

</P>



<!-- CODE //-->

<PRE>

### /etc/printcap

###

### Please don't edit this file directly unless you know

what you are doing!

### Be warned that the control-panel printtool requires a very strict format!

### Look at the printcap(5) man page for more info.

###

### This file can be edited with the printtool in the control-panel.

##

##PRINTTOOL3## LOCAL cdj500 300x300 letter {} DeskJet500 8 1

DJ500greyscale:\

    :sd=/var/spool/lpd/lp0:\

    :mx#0:\

</PRE>

<!-- END CODE //-->



<A NAME="PAGENUM-239"><P>Page 239</P></A>



<!-- CODE //-->

<PRE>

    :sh:\

    :lp=/dev/lp1:\

    :if=/var/spool/lpd/lp0/filter:

##PRINTTOOL3## LOCAL cdj500 300x300 letter {} DeskJet500 24 {}

DJ500colorbest:\

    :sd=/var/spool/lpd/lp0:\

    :mx#0:\

    :sh:\

    :lp=/dev/lp1:\

    :if=/var/spool/lpd/lp0/filter:

##PRINTTOOL3## LOCAL cdj500 300x300 letter {} DeskJet500 3 {}

DJ500colornormal:\

    :sd=/var/spool/lpd/lp0:\

    :mx#0:\

    :sh:\

    :lp=/dev/lp1:\

    :if=/var/spool/lpd/lp0/filter:

##PRINTTOOL3## LOCAL cdj500 300x300 letter {} DeskJet500 1 1

DJ500mononormal:\

    :sd=/var/spool/lpd/lp0:\

    :mx#0:\

    :sh:\

    :lp=/dev/lp1:\

    :if=/var/spool/lpd/lp0/filter:

</PRE>

<!-- END CODE //-->









<P>From this listing, create and save the file

/etc/printers with the following four lines:

</P>



<!-- CODE SNIP //-->

<PRE>

DJ500greyscale

DJ500colorbest

DJ500colornormal

DJ500mononormal

</PRE>

<!-- END CODE SNIP //-->









<P>Then, under Applixware, save the preferences by clicking the OK button and then the

Dismiss button.

</P>









<P>Now, when you go to print from, say, Applix Words, you'll see these four printers listed

in your Print dialog box. Select an appropriate printer, make sure that PostScript is selected

in the Class pop-up menu, and uncheck the Print to File box. When you

hit OK, your file will immediately print using the fonts and formatting of your Applix Words document.

</P>









<H3><A NAME="ch12_ 20">

Other Helpful Programs

</A></H3>









<P>The following are short descriptions of just a couple of the programs offering handy

printing services available either in your Red Hat distribution or for Linux. You'll find some of

these indispensable.

</P>









<H5><A NAME="ch12_ 21">

xv

</A></H5>









<P>One great tool that does a lot more than just print graphics is John Bradley's program,

xv, which runs under X. It can read and export nearly 18 different graphics file formats, and even

comes in a scanner-driver version so you can scan and immediately print. You can print a quick

copy of a graphic with the click of a button.

</P>



<P><CENTER>

<a href="0233-0235.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0240-0242.html">Next</A>

</CENTER></P>









</td>
</tr>
</table>

<!-- begin footer information -->





</body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?