📄 scanners.html
字号:
href="http://www.FreeBSD.org/cgi/url.cgi?ports/graphics/sane-frontends/pkg-descr"><ttclass="FILENAME">graphics/sane-frontends</tt></a>). The backends part provides access tothe scanner itself. The <b class="APPLICATION">SANE</b>'s <ahref="http://sane-project.org/sane-supported-devices.html" target="_top">supporteddevices</a> list specifies which backend will support your image scanner. It is mandatoryto determine the correct backend for your scanner if you want to be able to use yourdevice. The frontends part provides the graphical scanning interface (<bclass="APPLICATION">xscanimage</b>).</p><p>The first thing to do is install the <ahref="http://www.FreeBSD.org/cgi/url.cgi?ports/graphics/sane-backends/pkg-descr"><ttclass="FILENAME">graphics/sane-backends</tt></a> port or package. Then, use the <ttclass="COMMAND">sane-find-scanner</tt> command to check the scanner detection by the <bclass="APPLICATION">SANE</b> system:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">sane-find-scanner -q</kbd>found SCSI scanner "AGFA SNAPSCAN 600 1.10" at /dev/pass3</pre><p>The output will show the interface type of the scanner and the device node used toattach the scanner to the system. The vendor and the product model may not appear, it isnot important.</p><div class="NOTE"><blockquote class="NOTE"><p><b>Note:</b> Some USB scanners require you to load a firmware, this is explained inthe backend manual page. You should also read <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=sane-find-scanner&sektion=1&manpath=FreeBSD+Ports"><span class="CITEREFENTRY"><spanclass="REFENTRYTITLE">sane-find-scanner</span>(1)</span></a> and <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=sane&sektion=7&manpath=FreeBSD+Ports"><span class="CITEREFENTRY"><span class="REFENTRYTITLE">sane</span>(7)</span></a> manualpages.</p></blockquote></div><p>Now we have to check if the scanner will be identified by a scanning frontend. Bydefault, the <b class="APPLICATION">SANE</b> backends comes with a command line toolcalled <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=scanimage&sektion=1&manpath=FreeBSD+Ports"><span class="CITEREFENTRY"><span class="REFENTRYTITLE">scanimage</span>(1)</span></a>.This command allows you to list the devices and to perform an image acquisition from thecommand line. The <var class="OPTION">-L</var> option is used to list the scannerdevice:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">scanimage -L</kbd>device `snapscan:/dev/pass3' is a AGFA SNAPSCAN 600 flatbed scanner</pre><p>No output or a message saying that no scanners were identified indicates that <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=scanimage&sektion=1&manpath=FreeBSD+Ports"><span class="CITEREFENTRY"><span class="REFENTRYTITLE">scanimage</span>(1)</span></a> isunable to identify the scanner. If this happens, you will need to edit the backendconfiguration file and define the scanner device used. The <ttclass="FILENAME">/usr/local/etc/sane.d/</tt> directory contains all backendsconfiguration files. This identification problem does appear with certain USBscanners.</p><p>For example, with the USB scanner used in the <ahref="scanners.html#SCANNERS-KERNEL-USB">Section 7.6.2.1</a>, <ttclass="COMMAND">sane-find-scanner</tt> gives us the following information:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">sane-find-scanner -q</kbd>found USB scanner (UNKNOWN vendor and product) at device /dev/uscanner0</pre><p>The scanner is correctly detected, it uses the USB interface and is attached to the<tt class="FILENAME">/dev/uscanner0</tt> device node. We can now check if the scanner iscorrectly identified:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">scanimage -L</kbd>No scanners were identified. If you were expecting something different,check that the scanner is plugged in, turned on and detected by thesane-find-scanner tool (if appropriate). Please read the documentationwhich came with this software (README, FAQ, manpages).</pre><p>Since the scanner is not identified, we will need to edit the <ttclass="FILENAME">/usr/local/etc/sane.d/epson.conf</tt> file. The scanner model used wasthe <span class="TRADEMARK">EPSON Perfection</span>® 1650, so we know the scannerwill use the <var class="LITERAL">epson</var> backend. Be sure to read the help commentsin the backends configuration files. Line changes are quite simple: comment out all linesthat have the wrong interface for your scanner (in our case, we will comment out alllines starting with the word <var class="LITERAL">scsi</var> as our scanner uses the USBinterface), then add at the end of the file a line specifying the interface and thedevice node used. In this case, we add the following line:</p><pre class="PROGRAMLISTING">usb /dev/uscanner0</pre><p>Please be sure to read the comments provided in the backend configuration file as wellas the backend manual page for more details and correct syntax to use. We can now verifyif the scanner is identified:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">scanimage -L</kbd>device `epson:/dev/uscanner0' is a Epson GT-8200 flatbed scanner</pre><p>Our USB scanner has been identified. It is not important if the brand and the model donot match. The key item to be concerned with is the <varclass="LITERAL">`epson:/dev/uscanner0'</var> field, which give us the right backend nameand the right device node.</p><p>Once the <tt class="COMMAND">scanimage -L</tt> command is able to see the scanner, theconfiguration is complete. The device is now ready to scan.</p><p>While <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=scanimage&sektion=1&manpath=FreeBSD+Ports"><span class="CITEREFENTRY"><span class="REFENTRYTITLE">scanimage</span>(1)</span></a>does allow us to perform an image acquisition from the command line, it is preferable touse a graphical user interface to perform image scanning. <b class="APPLICATION">SANE</b>offers a simple but efficient graphical interface: <b class="APPLICATION">xscanimage</b>(<a href="http://www.FreeBSD.org/cgi/url.cgi?ports/graphics/sane-frontends/pkg-descr"><ttclass="FILENAME">graphics/sane-frontends</tt></a>).</p><p><b class="APPLICATION">Xsane</b> (<ahref="http://www.FreeBSD.org/cgi/url.cgi?ports/graphics/xsane/pkg-descr"><ttclass="FILENAME">graphics/xsane</tt></a>) is another popular graphical scanning frontend.This frontend offers advanced features such as various scanning mode (photocopy, fax,etc.), color correction, batch scans, etc. Both of these applications are useable as a <bclass="APPLICATION">GIMP</b> plugin.</p></div><div class="SECT2"><h2 class="SECT2"><a id="AEN9228" name="AEN9228">7.6.4 Allowing Scanner Access to OtherUsers</a></h2><p>All previous operations have been done with <tt class="USERNAME">root</tt> privileges.You may however, need other users to have access to the scanner. The user will need readand write permissions to the device node used by the scanner. As an example, our USBscanner uses the device node <tt class="FILENAME">/dev/uscanner0</tt> which is owned bythe <tt class="GROUPNAME">operator</tt> group. Adding the user <ttclass="USERNAME">joe</tt> to the <tt class="GROUPNAME">operator</tt> group will allow himto use the scanner:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">pw groupmod operator -m <varclass="REPLACEABLE">joe</var></kbd></pre><p>For more details read the <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=pw&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">pw</span>(8)</span></a> manual page.</p><div class="NOTE"><blockquote class="NOTE"><p><b>Note:</b> Of course, for security reasons, you should think twice before adding auser to any group, especially the <tt class="GROUPNAME">operator</tt> group.</p></blockquote></div></div></div><div class="NAVFOOTER"><hr align="LEFT" width="100%" /><table summary="Footer navigation table" width="100%" border="0" cellpadding="0"cellspacing="0"><tr><td width="33%" align="left" valign="top"><a href="tvcard.html"accesskey="P">Prev</a></td><td width="34%" align="center" valign="top"><a href="index.html"accesskey="H">Home</a></td><td width="33%" align="right" valign="top"><a href="kernelconfig.html"accesskey="N">Next</a></td></tr><tr><td width="33%" align="left" valign="top">Setting Up TV Cards</td><td width="34%" align="center" valign="top"><a href="multimedia.html"accesskey="U">Up</a></td><td width="33%" align="right" valign="top">Configuring the FreeBSD Kernel</td></tr></table></div><p align="center"><small>This, and other documents, can be downloaded from <ahref="ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/">ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/</a>.</small></p><p align="center"><small>For questions about FreeBSD, read the <ahref="http://www.FreeBSD.org/docs.html">documentation</a> before contacting <<ahref="mailto:questions@FreeBSD.org">questions@FreeBSD.org</a>>.<br />For questions about this documentation, e-mail <<ahref="mailto:doc@FreeBSD.org">doc@FreeBSD.org</a>>.</small></p></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -