sane-hp5590(5)            (13 Jul 2008)            sane-hp5590(5)

     NAME
          sane-hp5590 - SANE backend for Hewlett-Packard
          4500C/4570C/5500C/5550C/5590/7650 Workgroup/Document scan-
          ners

     DESCRIPTION
          The sane-hp5590 library implements a SANE (Scanner Access
          Now Easy) backend that provides access to the following
          Hewlett-Packard Workgroup/Document scanners:

          [bu]
            ScanJet 4500C

          [bu]
            ScanJet 4570C

          [bu]
            ScanJet 5500C

          [bu]
            ScanJet 5550C

          [bu]
            ScanJet 5590

          [bu]
            ScanJet 7650

          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[cq]s exact model name and the USB vendor and
          device ids (e.g. from /sys/bus/usb/devices,
          sane-find-scanner(1) or syslog) to us.  Even if the
          scanner[cq]s name is only slightly different from the models
          mentioned above, please let us know.

     OPTIONS
          The options the backend supports can either be selected
          through command line options to programs like scanimage(1)
          or through GUI elements in xscanimage(1) or xsane(1).  Valid
          command line options and their syntax can be listed by
          using:

               C]
               scanimage --help -d hp5590:interface:device
               R]

          where I]interfaceR] and I]deviceR] specify the device in
          question, as in the configuration file.  Add --all-options
          to also list the hardware read-out options.  The -d

     Page 1                       Plan 9             (printed 5/26/22)

     sane-hp5590(5)            (13 Jul 2008)            sane-hp5590(5)

          parameter and its argument can be omitted to obtain informa-
          tion on the first scanner identified.

          Use the command:

               C]
               scanimage -L
               R]

          to list all devices recognized by your SANE installation.

     DEVICE SPECIFIC OPTIONS
          -l I]nR]
               Top-left X position of scan area in B]mmR].  Allowed
               range: 0 ..  215.889.

          -t I]nR]
               Top-left Y position of scan area in B]mmR].  Allowed
               range: 0 ..  297.699.

          -x I]nR]
               X width of scan-area in B]mmR].  Allowed range: 0 ..
               215.889.

          -y I]nR]
               Y height of scan-area in B]mmR].  Allowed range: 0 ..
               297.699.

          By default, the maximum size will be scanned.

          --mode I]modeR]
               Select color mode.  I]modeR] must be one of:
               [lq]Color[rq], [lq]Color (48 bits)[rq], [lq]Gray[rq],
               [lq]Lineart[rq].

               [bu]
                 [lq]Color[rq] - Scanning is done with 3 * 8 bit RGB
                 color values per pixel.

               [bu]
                 [lq]Color (48 bits)[rq] - Scanning is done with 3 *
                 16 bit RGB color values per pixel.

               [bu]
                 [lq]Gray[rq] - Scanning is done with 1 * 8 bit gray
                 value per pixel.

               [bu]
                 [lq]Lineart[rq] - Scanning is done with 1 bit black
                 and white value per pixel.

          --source I]sourceR]

     Page 2                       Plan 9             (printed 5/26/22)

     sane-hp5590(5)            (13 Jul 2008)            sane-hp5590(5)

               Select the source for scanning.  I]sourceR] must be one
               of: [lq]Flatbed[rq], [lq]ADF[rq], [lq]ADF Duplex[rq],
               [lq]TMA Slides[rq], [lq]TMA Negatives[rq].

               [bu]
                 [lq]Flatbed[rq] - Scan document on the flat document
                 glass.

               [bu]
                 [lq]ADF[rq] - Scan frontsides of documents with auto-
                 matic document feeder.

               [bu]
                 [lq]ADF Duplex[rq] - Scan front- and backsides of
                 documents with automatic document feeder.  Note, the
                 backside images must be rotated in a separate post
                 process step.

               [bu]
                 [lq]TMA Slides[rq] - Slide scanning with transparent
                 media adapter.  (Not fully supported by hp5590 back-
                 end).

               [bu]
                 [lq]TMA Negatives[rq] - Negative film scanning with
                 transparent media adapter.  (Not fully supported by
                 hp5590 backend).

          --resolution I]resR]
               Set the resolution of the scanned image in B]dpiR].
               I]resR] must be one of: 100, 200, 300, 600, 1200, 2400.

          Default settings: Lineart, Flatbed, 100dpi.

          --extend-lamp-timeout[=yes|no]
               Extend lamp timeout period.  no = 15 minutes, yes = 1
               hour.  (Default: no)

          --wait-for-button[=yes|no]
               Wait for button press before scanning starts.
               (Default: no)

          --preview[=yes|no]
               Request a preview-quality scan.  (Default: no)

          --hide-eop-pixel[=yes|no]
               Hide end-of-page indicator pixels and overwrite with
               color of next neighbor pixels.  (Default: yes)
               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-

     Page 3                       Plan 9             (printed 5/26/22)

     sane-hp5590(5)            (13 Jul 2008)            sane-hp5590(5)

               of-page pixels are also generated in flatbed scans.  It
               is recommended to hide these pixels.

          --trailing-lines-mode I]modeR]
               Filling mode of trailing lines after end of page when
               automatic document feeder (ADF) is used.  I]modeR] must
               be one of: [lq]last[rq], [lq]raw[rq], [lq]raster[rq],
               [lq]white[rq], [lq]black[rq], [lq]color[rq].  (Default:
               [lq]last[rq])

               [bu]
                 [lq]last[rq] = repeat the last scan line (recom-
                 mended),

               [bu]
                 [lq]raw[rq] = read raw scan data (not recommended),

               [bu]
                 [lq]raster[rq] = generate black and white pixel pat-
                 tern,

               [bu]
                 [lq]white[rq] = white pixels,

               [bu]
                 [lq]black[rq] = black pixels,

               [bu]
                 [lq]color[rq] = RGB or gray colored pixels (see next
                 option).

          --trailing-lines-color I]nR]
               Set color value for filling trailing scan lines in
               trailing lines mode [lq]color[rq] (see previous
               option).  (Default color: violet)
               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.

     READ OUT OPTIONS
          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 corre-
          sponding scanner options like switching between I]flatbedR]
          and I]ADFR] mode, or triggering post processing tasks after
          scanning.

          --button-pressed
               Get the id of the last button pressed.  Id is one of
               [lq]none[rq], [lq]power[rq], [lq]scan[rq],
               [lq]collect[rq], [lq]file[rq], [lq]email[rq],
               [lq]copy[rq], [lq]up[rq], [lq]down[rq], [lq]mode[rq],

     Page 4                       Plan 9             (printed 5/26/22)

     sane-hp5590(5)            (13 Jul 2008)            sane-hp5590(5)

               [lq]cancel[rq].
               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 [lq]none[rq].

          --color-led
               Get the state of the color LED indicators.  The state
               is either [lq]color[rq] or [lq]black_white[rq].

          --counter-value
               Get the counter value as shown on LCD.  The value is in
               the range of 1 ..  99.

          --doc-in-adf
               Get the state of the document-available indicator of
               the automatic document feeder (ADF).  The state is
               either [lq]yes[rq] or [lq]no[rq].

     HINTS FOR USERS OF SCANBD
          scanbd(8) is a scanner button daemon, which can read scanner
          buttons and trigger scan actions.

          Do not use the old scanbuttond(8) interface with hp5590.  It
          is outdated and shall not be used any more.  The regular
          interface of scanbd(8) is fully supported by the current
          version of the I]hp5590R] backend.

          This example shows a minimum configuration file and the cor-
          responding script file for scanbd(8) to be included in
          scanbd.conf.

          [bu]
            hp5590.conf

            C]
            device hp5590 {
                # Device matching
                filter = [dq][ha]hp5590.*[dq]
                desc = [dq]HP5590 Scanner Family[dq]

                # Read out counter value and store in environment variable.
                function function_lcd_counter {
                    filter = [dq][ha]counter-value.*[dq]
                    desc   = [dq]hp5590: LCD counter[dq]
                    env    = [dq]SCANBD_FUNCTION_LCD_COUNTER[dq]
                }

                # Run scan script when button is pressed.

     Page 5                       Plan 9             (printed 5/26/22)

     sane-hp5590(5)            (13 Jul 2008)            sane-hp5590(5)

                action do-scan {
                    filter = [dq][ha]button-pressed.*[dq]
                    desc   = [dq]hp5590: Scan button pressed[dq]
                    script = [dq]scan_action.script[dq]
                    string-trigger {
                        from-value  = [dq]none[dq]
                        to-value    = [dq]scan[dq]
                    }
                }
            }
            R]

          [bu]
            B]scan_action.scriptR]

            C]
            #!/bin/bash
            echo device = $SCANBD_DEVICE
            echo action = $SCANBD_ACTION
            echo counter = $SCANBD_FUNCTION_LCD_COUNTER
            scanfile=[dq]$HOME/tmp/scans/scan-$(date +%s).pnm[dq]
            case $SCANBD_ACTION in
            do-scan)
                scanimage -d [dq]$SCANBD_DEVICE[dq] > [dq]$scanfile[dq]
                ;;
            *)
                echo Warning: Unknown scanbd action: [dq]$SCANBD_ACTION[dq]
                ;;
            esac
            R]

     FILES
          I][at]LIBDIR[at]/libsane-hp5590.aR]
               The static library implementing this backend.

          I][at]LIBDIR[at]/libsane-hp5590.soR]
               The shared library implementing this backend (present
               on systems that support dynamic loading).

     ENVIRONMENT
          If the library was compiled with debug support enabled, this
          environment variable controls the debug level for this back-
          end.

          B]SANE_DEBUG_HP5590R]

          Higher debug levels increase the verbosity of the output:

               C]
               10 - generic processing
               20 - verbose backend messages
               40 - HP5590 high-level commands

     Page 6                       Plan 9             (printed 5/26/22)

     sane-hp5590(5)            (13 Jul 2008)            sane-hp5590(5)

               50 - HP5590 low-level (USB-in-USB) commands
               R]

          Example:
               export SANE_DEBUG_HP5590=50

     SEE ALSO
          sane(7), sane-usb(5) scanbd(8), scanimage(1), xscanimage(1),
          xsane(1)

     AUTHORS
          Ilia Sotnikov <hostcc@gmail.com>.

     Page 7                       Plan 9             (printed 5/26/22)