sane-hp5590(5) | SANE Scanner Access Now Easy | sane-hp5590(5) |
sane-hp5590 - SANE backend for Hewlett-Packard 4500C/4570C/5500C/5550C/5590/7650 Workgroup/Document scanners
The sane-hp5590 library implements a SANE (Scanner Access Now Easy) backend that provides access to the following Hewlett-Packard Workgroup/Document scanners:
If you own a scanner other than the ones listed above that works with this backend, please let us know this by sending the scanner’s exact model name and the USB vendor and device ids (e.g. from /sys/bus/usb/devices, sane-find-scanner or syslog) to us. Even if the scanner’s name is only slightly different from the models mentioned above, please let us know.
The options the backend supports can either be selected through command line options to programs like scanimage or through GUI elements in xscanimage or xsane. Valid command line options and their syntax can be listed by using:
scanimage --help -d hp5590:interface:device
where interface and device specify the device in question, as in the configuration file. Add --all-options to also list the hardware read-out options. The -d parameter and its argument can be omitted to obtain information on the first scanner identified.
Use the command:
scanimage -L
to list all devices recognized by your SANE installation.
By default, the maximum size will be scanned.
Default settings: Lineart, Flatbed, 100dpi.
The scanner uses the last pixel in every scan line for storing the end-of-page status. This is needed to detect the end of the document sheet when the automatic document feeder (ADF) is used. Unfortunately the end-of-page pixels are also generated in flatbed scans. It is recommended to hide these pixels.
The RGB color value must be specified and calculated as 65536 * r + 256 * g + b, with r, g, b being values in the range of 0 .. 255.
The following options allow reading out the button state, counter value, color setting, and the state of document in ADF. This can be used to programmatically control corresponding scanner options like switching between flatbed and ADF mode, or triggering prost processing tasks after scanning.
The scanner stores the id of the last button pressed until it is read. After read out, the state is reset and subsequent readings will return “none”.
Scanbd is a scanner button daemon, which can read scanner buttons and trigger scan actions.
Do not use the old scanbuttond interface with hp5590. It is outdated and shall not be used any more. Scanbd’s regular interface is fully supported by the current version of the hp5590 backend.
This example shows a minimum configuration file and the corresponding script file for scanbd to be included in scanbd.conf.
device hp5590 {
# Device matching
filter = "^hp5590.*"
desc = "HP5590 Scanner Family"
# Read out counter value and store in environment variable.
function function_lcd_counter {
filter = "^counter-value.*"
desc = "hp5590: LCD counter"
env = "SCANBD_FUNCTION_LCD_COUNTER"
}
# Run scan script when button is pressed.
action do-scan {
filter = "^button-pressed.*"
desc = "hp5590: Scan button pressed"
script = "scan_action.script"
string-trigger {
from-value = "none"
to-value = "scan"
}
} }
#!/bin/bash echo device = $SCANBD_DEVICE echo action = $SCANBD_ACTION echo counter = $SCANBD_FUNCTION_LCD_COUNTER scanfile="$HOME/tmp/scans/scan-$(date +%s).pnm" case $SCANBD_ACTION in do-scan)
scanimage -d "$SCANBD_DEVICE" > "$scanfile"
;; *)
echo Warning: Unknown scanbd action: "$SCANBD_ACTION"
;; esac
If the library was compiled with debug support enabled, this environment variable controls the debug level for this backend.
SANE_DEBUG_HP5590
Higher debug levels increase the verbosity of the output:
10 - generic processing 20 - verbose backend messages 40 - HP5590 high-level commands 50 - HP5590 low-level (USB-in-USB) commands
Ilia Sotnikov <hostcc@gmail.com>.
13 Jul 2008 |