通常有两个命令可以查询扫描仪的情况,sane-find-scanner和scanimage。sane-find-scanner用来搜索本地扫描仪的接口:
sane-find-scanner
# No SCSI scanners found. If you expected something different, make sure that
# you have loaded a SCSI driver for your SCSI adapter.
found USB scanner (vendor=0x04a5, product=0x2060) at /dev/usb/scanner0
found USB scanner (vendor=0x04a5 [Color], product=0x2060 [ FlatbedScanner 13]) at libusb:002:002
# A USB device was detected. This program can't be sure if it's really
# a scanner. If it is your scanner, it may or may not be supported by
# SANE. Try scanimage -L and read the backend's manpage.
# Scanners connected to the parallel port or other proprietary ports can't be
# detected by this program.
上面结果表示没有发现SCSI接口扫描仪,检测到USB接口扫描仪。使用scanimage加参数-L 用来设备扫描仪的具体型号:
# scanimage -L
device `snapscan:/dev/usb/scanner0' is a Acer FlatbedScanner13
正确检测到扫描仪的型号之后,下面就可以调用Linux下的扫描程序进行工作了。
Scanimage是一个命令行下的工具,可以直接进行扫描:
# scanimage –d /dev/usb/scanner0 -mode color >1.pnm
这样一个1.pnm格式的图像文件就生成了。