LinuxCommandLibrary

hp-scan

Scan documents using HP devices

SYNOPSIS

hp-scan [OPTIONS] [OUTPUT_FILE]

PARAMETERS

-r <resolution>
    Sets the scan resolution in DPI (dots per inch). Example: -r 300.

-m <mode>
    Sets the scan mode. Common modes include color, grayscale, or binary (lineart).

-f <format>
    Specifies the output file format. Common formats are jpeg, png, tiff, or pdf.

-s <source>
    Selects the scan source. Typically flatbed or adf (Automatic Document Feeder).

-o <output_file>
    Specifies the output filename. If omitted, the scan is saved to a default file (e.g., scan.jpeg).

-x <width_pixels>
    Sets the scan width in pixels.

-y <height_pixels>
    Sets the scan height in pixels.

-l <x_coord_mm>, -t <y_coord_mm>, -w <width_mm>, -h <height_mm>
    Define a specific scan area in millimeters: left, top, width, height.

--help
    Displays a help message with available options.

--version
    Shows the version information of the hp-scan utility.

DESCRIPTION

hp-scan is a command-line utility provided by the HPLIP (HP Linux Imaging and Printing) project. It enables users to scan documents and images directly from HP multifunction devices (MFPs) and standalone scanners connected to a Linux system. It leverages the SANE (Scanner Access Now Easy) backend to communicate with the hardware, offering control over various scan settings such as resolution, color mode, scan source (flatbed or ADF), and output file format.

While not providing a graphical interface, hp-scan is invaluable for basic scanning operations, scripting, and integrating scanning capabilities into custom workflows where a full GUI application might be overkill or unavailable. It supports saving scans in common image formats like JPEG, PNG, TIFF, and PDF.

CAVEATS

For hp-scan to function, the HP device must be properly installed and configured within the HPLIP framework. This often involves running hp-setup first. Networked scanners require proper network connectivity. Scan quality and available options can vary significantly based on the specific HP device model and its capabilities.

INTEGRATION WITH HPLIP

hp-scan is an integral part of the HPLIP suite, relying on the HPLIP daemon and drivers to interface with HP hardware. It's often used in conjunction with other HPLIP utilities.

SCRIPTING CAPABILITY

Given its command-line interface, hp-scan is well-suited for automation. It can be easily incorporated into shell scripts for batch scanning, scheduled tasks, or integrating scanning into custom applications.

HISTORY

The HPLIP project, which includes hp-scan, was initiated by HP in 2001 to provide comprehensive Linux support for their wide range of printers and scanners. hp-scan has evolved as a core component of this suite, adapting to new HP hardware and SANE backend developments, ensuring consistent scanning functionality for HP devices on Linux over the years.

SEE ALSO

scanimage(1), sane-find-scanner(1), hp-setup(1), xsane(1), simple-scan(1)

Copied to clipboard