indexterms

This commit is contained in:
tille 2006-10-24 12:59:58 +00:00
parent 464016d739
commit c5de0f58a4
1 changed files with 24 additions and 24 deletions

View File

@ -18,12 +18,12 @@
<sect2 id="sect_08_01_01"><title>Command line printing</title>
<sect3 id="sect_08_01_01_01"><title>Getting the file to the printer</title>
<para>Printing from within an application is very easy, selecting the <menuchoice><guimenuitem>Print</guimenuitem></menuchoice> option from the menu.</para>
<para>From the command line, use the <command>lp</command> or <command>lpr</command> command.</para>
<para>From the command<indexterm><primary>printing</primary><secondary>lp/lpr</secondary></indexterm> line, use the <command>lp<indexterm><primary>lp</primary></indexterm></command> or <command>lpr<indexterm><primary>lpr</primary></indexterm></command> command.</para>
<cmdsynopsis><command>lp <filename>file(s)</filename></command></cmdsynopsis>
<cmdsynopsis><command>lpr <filename>file(s)</filename></command></cmdsynopsis>
<para>These commands can read from a pipe, so you can print the output of commands using</para>
<para>These commands can read from a pipe<indexterm><primary>I/O redirection</primary><secondary>printing</secondary></indexterm>, so you can print the output of commands using</para>
<cmdsynopsis><command>command | lp</command></cmdsynopsis>
@ -31,13 +31,13 @@
</sect3>
<sect3 id="sect_08_01_01_02"><title>Status of your print jobs</title>
<para>Once the file is accepted in the print queue, an identification number for the print job is assigned:</para>
<para>Once the file is accepted in the print<indexterm><primary>printing</primary><secondary>status</secondary></indexterm> queue, an identification number for the print job is assigned:</para>
<screen>
<prompt>davy:~&gt;</prompt> <command>lp /etc/profile</command>
request id is blob-253 (1 file(s))
</screen>
<para>To view (query) the print queue, use the <command>lpq</command> or <command>lpstat</command> command. When entered without arguments, it displays the contents of the default print queue.</para>
<para>To view (query) the print queue, use the <command>lpq<indexterm><primary>lpq</primary></indexterm></command> or <command>lpstat<indexterm><primary>lpstat</primary></indexterm></command> command. When entered without arguments, it displays the contents of the default print queue.</para>
<screen>
<prompt>davy:~&gt;</prompt> <command>lpq</command>
blob is ready and printing
@ -51,7 +51,7 @@ blob-253 davy 1024 Tue 25 Jul 2006 10:20_01 AM CEST
<sect3 id="sect_08_01_01_03"><title>Status of your printer</title>
<para>Which is the default printer on a system that has access to multiple printers?</para>
<para>Which is the default printer<indexterm><primary>printing</primary><secondary>status</secondary></indexterm> on a system that has access to multiple printers?</para>
<cmdsynopsis><command>lpstat <option>-d</option></command></cmdsynopsis>
<screen>
@ -69,13 +69,13 @@ printer blob now printing blob-253. enabled since Jan 01 18:01
</sect3>
<sect3 id="sect_08_01_01_04"><title>Removing jobs from the print queue</title>
<para>If you don't like what you see from the status commands, use <command>lprm</command> or <command>cancel</command> to delete jobs.</para>
<para>If you don't like<indexterm><primary>printing</primary><secondary>remove jobs</secondary></indexterm> what you see from the status commands, use <command>lprm<indexterm><primary>lprm</primary></indexterm></command> or <command>cancel<indexterm><primary>cancel</primary></indexterm></command> to delete jobs.</para>
<screen>
<prompt>davy:~&gt;</prompt> <command>lprm <parameter>253</parameter></command>
</screen>
<para>In the graphical environment, you may see a popup window telling you that the job has been canceled.</para>
<para>In larger environments, <command>lpc</command> may be used to control multiple printers. See the Info or man pages on each command.</para>
<para>In larger environments, <command>lpc</command> may be used to control multiple printers. See the <application>Info</application> or man pages on each command.</para>
<para>There are many GUI print tools used as a front-end to <command>lp</command>, and most graphical applications have a print function that uses <command>lp</command>. See the built-in Help functions and program specific documentation for more.</para>
<note><title>Why are there two commands for every task related to printing?</title>
@ -89,32 +89,32 @@ printer blob now printing blob-253. enabled since Jan 01 18:01
<para>If we want to get something sensible out of the printer, files should be formatted first. Apart from an abundance of formatting software, Linux comes with the basic UNIX formatting tools and languages.</para>
<para>Modern Linux systems support direct printing, without any formatting by the user, of a range of file types: text, PDF, PostScript and several image formats like PNG, JPEG, BMP and GIF.</para>
<para>For those file formats that do need formatting, Linux comes with a lot of formatting tools, such as the <command>pdf2ps</command>, <command>fax2ps</command> and <command>a2ps</command> commands, that convert other formats to PostScript. These commands can create files that can then be used on other systems that don't have all the conversion tools installed.</para>
<para>Apart from these command line tools there are a lot of graphical word processing programs. Several complete office suites are available, many are free. These do the formatting automatically upon submission of a print job. Just to name a few: OpenOffice, KOffice, AbiWord, WordPerfect, etc.</para>
<para>For those file formats that do need formatting, Linux comes with a lot of formatting<indexterm><primary>printing</primary><secondary>formatting tools</secondary></indexterm> tools, such as the <command>pdf2ps</command>, <command>fax2ps</command> and <command>a2ps</command> commands, that convert other formats to PostScript. These commands can create files that can then be used on other systems that don't have all the conversion tools installed.</para>
<para>Apart from these command line tools there are a lot of graphical word processing programs. Several complete office suites are available, many are free. These do the formatting automatically upon submission of a print job. Just to name a few: <application>OpenOffice.org</application>, <application>KOffice</application>, <application>AbiWord</application>, <application>WordPerfect</application>, etc.</para>
<para>The following are common languages in a printing context:</para>
<para>The following are common languages<indexterm><primary>printing</primary><secondary>languages overview</secondary></indexterm> in a printing context:</para>
<itemizedlist>
<listitem><para><command>groff</command>: GNU version of the UNIX <command>roff</command> command. It is a front-end to the groff document formatting system. Normally it runs the <command>troff</command> command and a post-processor appropriate for the selected device. It allows generation of PostScript files.</para></listitem>
<listitem><para><emphasis>TeX</emphasis> and the macro package <emphasis>LaTeX</emphasis>: one of the most widely used markup languages on UNIX systems. Usually invoked as <command>tex</command>, it formats files and outputs a corresponding device-independent representation of the typeset document.</para>
<para>Technical works are <emphasis>still</emphasis> frequently written in LaTeX because of its support for mathematic formulas, although efforts are being made at <ulink url="http://www.w3.org">W3C</ulink> (the World Wide Web Consortium) to include this feature in other applications.</para></listitem>
<listitem><para>SGML and XML: Free parsers are available for UNIX and Linux. XML is the next generation SGML, it forms the basis for DocBook XML, a document system (this book is written in XML, for instance).</para></listitem>
<listitem><para><command>groff</command>: GNU version<indexterm><primary>groff</primary></indexterm> of the UNIX <command>roff</command> command. It is a front-end to the groff document formatting system. Normally it runs the <command>troff</command> command and a post-processor appropriate for the selected device. It allows generation of PostScript files.</para></listitem>
<listitem><para><application>TeX</application> and the macro<indexterm><primary>TeX</primary></indexterm> package <application>LaTeX</application>: one of the most widely used markup languages on UNIX systems. Usually invoked as <command>tex</command>, it formats files and outputs a corresponding device-independent representation of the typeset document.</para>
<para>Technical works are <emphasis>still</emphasis> frequently written in <application>LaTeX</application> because of its support for mathematic formulas, although efforts are being made at <ulink url="http://www.w3.org">W3C</ulink> (the World Wide Web Consortium) to include this feature in other applications.</para></listitem>
<listitem><para>SGML<indexterm><primary>SGML</primary></indexterm> and XML<indexterm><primary>XML</primary></indexterm>: Free parsers are available for UNIX and Linux. XML is the next generation SGML, it forms the basis for DocBook XML, a document system (this book is written in XML, for instance).</para></listitem>
</itemizedlist>
<tip><title>Printing documentation</title>
<para>The man pages contain pre-formatted <command>troff</command> data which has to be formatted before it can roll out of your printer. Printing is done using the <option>-t</option> option to the <command>man</command> command:</para>
<para>The man<indexterm><primary>man pages</primary><secondary>printing</secondary></indexterm> pages contain pre-formatted <command>troff<indexterm><primary>troff</primary></indexterm></command> data which has to be formatted before it can roll out of your printer. Printing<indexterm><primary>printing</primary><secondary>man pages</secondary></indexterm> is done using the <option>-t</option> option to the <command>man</command> command:</para>
<cmdsynopsis><command>man <option>-t</option> <parameter>command</parameter> &gt; <filename>man-command.ps</filename></command></cmdsynopsis>
<para>Then print the PostScript file. If a default print destination is configured for your system/account, you can just issue the command <command>man <option>-t</option> <parameter>command</parameter></command> to send the formatted page to the printer directly.</para>
</sect3>
<sect3 id="sect_08_01_02_02"><title>Previewing formatted files</title>
<para>Anything that you can send to the printer can normally be sent to the screen as well. Depending on the file format, you can use one of these commands:</para>
<para>Anything that you can send to the printer can normally be sent to the screen as well. Depending on the file format, you can use one of these commands<indexterm><primary>printing</primary><secondary>preview</secondary></indexterm>:</para>
<itemizedlist>
<listitem><para>PostScript files: with the <command>gv</command> (GhostView) command.</para></listitem>
<listitem><para>TeX dvi files: with <command>xdvi</command>, or with KDE's <command>kdvi</command>.</para></listitem>
<listitem><para>PDF files: <command>xpdf</command>, <command>kpdf</command>, <command>gpdf</command> or Adobe's viewer, <command>acroread</command>, which is also available for free but is not free software. Adobe's reader supports PDF 1.6, the others only support PDF versions up to 1.5. The version of a PDF file can be determined using the <command>file</command> command.</para></listitem>
<listitem><para>PostScript files: with the <command>gv<indexterm><primary>gv</primary></indexterm></command> (GhostView) command.</para></listitem>
<listitem><para>TeX dvi files: with <command>xdvi<indexterm><primary>xdvi</primary></indexterm></command>, or with <application>KDE</application>'s <command>kdvi<indexterm><primary>kdvi</primary></indexterm></command>.</para></listitem>
<listitem><para>PDF files: <command>xpdf<indexterm><primary>xpdf</primary></indexterm></command>, <command>kpdf<indexterm><primary>kpdf</primary></indexterm></command>, <command>gpdf<indexterm><primary>gpdf</primary></indexterm></command> or Adobe's viewer, <command>acroread<indexterm><primary>acroread</primary></indexterm></command>, which is also available for free but is not free software. Adobe's reader supports PDF 1.6, the others only support PDF versions up to 1.5. The version of a PDF file can be determined using the <command>file</command> command.</para></listitem>
<listitem><para>From within applications, such as Firefox or OpenOffice, you can usually select <menuchoice><guimenu>Print Preview</guimenu></menuchoice> from one of the menus.</para></listitem>
</itemizedlist>
</sect3>
@ -123,23 +123,23 @@ printer blob now printing blob-253. enabled since Jan 01 18:01
</sect1>
<sect1 id="sect_08_02"><title>The server side</title>
<sect2 id="sect_08_02_01"><title>General</title>
<para>Until a couple of years ago, the choice for Linux users was simple: everyone ran the same old LPD from BSD's Net-2 code. Then LPRng became more popular, but nowadays most modern Linux distributions use <ulink url="http://www.cups.org">CUPS</ulink>, the Common UNIX Printing System. <application>CUPS</application> is an implementation of the Internet Printing Protocol (IPP), an HTTP-like RFC standard replacement protocol for the venerable (and clunky) LPD protocol. CUPS is distributed under the GNU Public License. CUPS is also the default print system on MacOS X.</para>
<para>Until a couple of years ago, the choice for Linux users was simple: everyone ran the same old LPD from BSD's Net-2 code. Then <application>LPRng</application> became more popular, but nowadays most modern Linux distributions use <ulink url="http://www.cups.org">CUPS</ulink>, the Common UNIX Printing System<indexterm><primary>printing</primary><secondary>CUPS</secondary></indexterm>. <application>CUPS<indexterm><primary>CUPS</primary></indexterm></application> is an implementation of the Internet Printing Protocol (IPP), an HTTP-like RFC standard replacement protocol for the venerable (and clunky) LPD protocol. CUPS is distributed under the GNU Public License. CUPS is also the default print system on MacOS X.</para>
</sect2>
<sect2 id="sect_08_02_02"><title>Graphical printer configuration</title>
<para>Most distributions come with a GUI for configuring networked and local (parallel port or USB) printers. They let you choose the printer type from a list and allow easy testing. You don't have to bother about syntax and location of configuration files. Check your system documentation before you attempt installing your printer.</para>
<para>Most distributions come with a GUI for configuring networked and local (parallel port or USB) printers. They let you choose the printer type from a list and allow easy<indexterm><primary>printers</primary><secondary>printer configuration</secondary></indexterm> testing. You don't have to bother about syntax and location of configuration files. Check your system documentation before you attempt installing your printer.</para>
<para>CUPS can also be configured using a web interface that runs on port 631 on your computer. To check if this feature is enabled, try browsing to <ulink url="localhost:631/help" /> or <ulink url="localhost:631/" />.</para>
</sect2>
<sect2 id="sect_08_02_04"><title>Buying a printer for Linux</title>
<para>As more and more printer vendors make drivers for CUPS available, CUPS will allow easy connection with almost any printer that you can plug into a serial, parallel, or USB port, plus any printer on the network. CUPS will ensure a uniform presentation to you and your applications of all different types of printers.</para>
<para>As more and more printer vendors make drivers for CUPS available, CUPS will allow easy connection with almost any printer<indexterm><primary>printers</primary><secondary>choosing</secondary></indexterm> that you can plug into a serial, parallel, or USB port, plus any printer on the network. CUPS will ensure a uniform presentation to you and your applications of all different types of printers.</para>
<para>Printers that only come with a Win9x driver could be problematic if they have no other support. Check with <ulink url="http://linuxprinting.org/" /> when in doubt.</para>
<para>In the past, your best choice would have been a printer with native PostScript support in the firmware, since nearly all UNIX or Linux software producing printable output, produces it in PostScript, the publishing industry's printer control language of choice. PostScript printers are usually a bit more expensive, but it is a device-independent, open programming language and you're always 100% sure that they will work. These days, however, the importance of this rule of thumb is dwindling.</para>
<para>In the past, your best choice would have been a printer with native PostScript support in the firmware, since nearly all UNIX or Linux software producing printable output, produces it in PostScript<indexterm><primary>printers</primary><secondary>PostScript</secondary></indexterm>, the publishing industry's printer control language of choice. PostScript printers are usually a bit more expensive, but it is a device-independent, open programming language and you're always 100% sure that they will work. These days, however, the importance of this rule of thumb is dwindling.</para>
</sect2>
</sect1>
<sect1 id="sect_08_03"><title>Print problems</title>
<para>In this section, we will discuss what you can do as a user when something goes wrong. We won't discuss any problems that have to do with the daemon-part of the printing service, as that is a task for system administrators.</para>
<sect2 id="sect_08_03_01"><title>Wrong file</title>
<para>If you print the wrong file, the job may be canceled using the command <command>lprm <parameter>jobID</parameter></command>, where jobID is in the form <emphasis>printername-printjobnumber</emphasis> (get it from information displayed by <command>lpq</command> or <command>lpstat</command>). This will work when other jobs are waiting to be printed in this printer's queue. However, you have to be really quick if you are the only one using this printer, since jobs are usually spooled and send to the printer in only seconds. Once they arrive on the printer, it is too late to remove jobs using Linux tools.</para>
<para>If you print the wrong file, the job may be canceled<indexterm><primary>printing</primary><secondary>troubleshooting</secondary></indexterm> using the command <command>lprm <parameter>jobID</parameter></command>, where jobID is in the form <emphasis>printername-printjobnumber</emphasis> (get it from information displayed by <command>lpq</command> or <command>lpstat</command>). This will work when other jobs are waiting to be printed in this printer's queue. However, you have to be really quick if you are the only one using this printer, since jobs are usually spooled and send to the printer in only seconds. Once they arrive on the printer, it is too late to remove jobs using Linux tools.</para>
<para>What you can try in those cases, or in cases where the wrong print driver is configured and only rubbish comes out of the printer, is power off the printer. However, that might not be the best course of action, as you might cause paper jams and other irregularities.</para>
</sect2>
<sect2 id="sect_08_03_02">