Skip to main content

A Python-based Windows scanning automation tool for printer/scanner devices using WIA

Project description

PyAutoScan

GitHub PyPI version Python 3.7+ License: MIT Windows Build PyAutoScan Executable

A Python-based Windows scanning automation tool for printer/scanner devices using WIA.

PyAutoScan simplifies the process of scanning documents with HP and other printer devices that support WIA (Windows Image Acquisition). It provides:

  • One-click auto-scan with customizable quality (low/medium/high)
  • Image-to-PDF conversion for multi-page documents
  • Configurable settings via scan_config.ini (resolution, color mode, auto-crop, deskew, output folder, etc.)
  • Automatic file naming with timestamps
  • Scanner info extraction (model, driver properties, max resolution, supported features)
  • Optional auto-crop & deskew for cleaner scans

Works with HP and other multi-function printer devices (MFP) that expose their scanner through WIA.

๐Ÿš€ Quick Start

# Clone the repository
git clone https://github.com/Pandiyarajk/pyautoscan.git
cd pyautoscan

# Install dependencies
pip install -r requirements.txt

# Test scanner connection
python scanner_info.py

# Start scanning
python basic_scan.py

๐Ÿš€ Features

  • Basic Scanning: Simple, fast scanning with configurable quality and format options
  • Advanced Scanning: Enhanced scanning with auto-crop and deskew capabilities
  • Multiple Formats: Support for JPG, PNG, TIFF, and PDF output
  • Quality Control: Configurable DPI settings (150, 300, 600)
  • Scanner Detection: Automatic scanner detection and information display
  • Configuration Management: INI-based configuration for easy customization
  • PDF Conversion: Convert multiple images to single PDF documents
  • Windows Integration: Native Windows WIA (Windows Image Acquisition) support

๐Ÿ“‹ Requirements

  • Windows 10/11
  • Python 3.7+ (Tested on Python 3.13)
  • Compatible scanner with WIA drivers (Tested on HP Printer scanner features)
  • Required Python packages (see requirements.txt)

๐Ÿ“‹ Dependencies

  • pywin32: Windows COM integration for WIA
  • Pillow: Image processing and PDF creation
  • powerlogger: Enhanced logging with Rich console output and file rotation

๐Ÿ› ๏ธ Installation

Option 1: Clone from GitHub

  1. Clone the repository:

    git clone https://github.com/Pandiyarajk/pyautoscan.git
    cd pyautoscan
    
  2. Install dependencies:

    pip install -r requirements.txt
    
  3. Verify scanner connection:

    python scanner_info.py
    

Option 2: Install via pip (when published to PyPI)

pip install pyautoscan

Option 3: Download Release

Download the latest release from GitHub Releases for pre-built Windows executables.

๐Ÿ“– Usage

Basic Scanning

python basic_scan.py

Advanced Scanning

python advanced_scan.py

Scanner Information

python scanner_info.py

Configuration

Edit scan_config.ini to customize:

  • Output directory
  • File format preferences
  • Quality settings
  • Auto-processing options

๐Ÿ”ง Configuration

The scan_config.ini file allows you to customize:

[SCAN]
output_dir = Scans
file_format = jpg
quality = medium
auto_crop = true
deskew = true
color_mode = 1
combine_pdf = false

Quality Settings

  • Low: 150 DPI (fast, smaller files)
  • Medium: 300 DPI (balanced)
  • High: 600 DPI (high quality, larger files)

Supported Formats

  • JPG: Compressed, good for documents
  • PNG: Lossless, good for images
  • TIFF: High quality, large files
  • PDF: Portable document format

๐Ÿ“ Project Structure

pyautoscan/
โ”œโ”€โ”€ basic_scan.py          # Basic scanning functionality
โ”œโ”€โ”€ advanced_scan.py       # Advanced scanning with auto-processing
โ”œโ”€โ”€ scanner_info.py        # Scanner detection and information
โ”œโ”€โ”€ scan_config.ini        # Configuration file
โ”œโ”€โ”€ requirements.txt       # Python dependencies
โ”œโ”€โ”€ setup.py               # PyPI distribution setup
โ”œโ”€โ”€ README.md             # This file
โ”œโ”€โ”€ CHANGELOG.md          # Version history
โ”œโ”€โ”€ TESTING.md            # Testing documentation and results
โ”œโ”€โ”€ LICENSE               # MIT License
โ”œโ”€โ”€ .github/workflows/    # GitHub Actions CI/CD
โ”œโ”€โ”€ .gitignore            # Git ignore file
โ”œโ”€โ”€ run_scanner.bat       # Windows batch launcher
โ””โ”€โ”€ Scans/                # Output directory for scanned files

๐Ÿ”ง Development

Repository

Build Status

The project uses GitHub Actions for continuous integration:

  • Build: Windows executables for Python 3.8-3.13
  • Test: Automated testing on Windows with Python 3.13
  • Release: Automatic builds on releases

๐Ÿš€ Building Executables

Using PyInstaller

# Install PyInstaller
pip install pyinstaller

# Build basic scanner
pyinstaller --onefile --windowed basic_scan.py

# Build advanced scanner
pyinstaller --onefile --windowed advanced_scan.py

Note: Successfully tested with Python 3.13 and HP Printer scanner features.

Using GitHub Actions

The repository includes a GitHub Actions workflow that automatically builds Windows executables on each release.

๐Ÿ” Troubleshooting

Common Issues

  1. "No scanner detected"

    • Ensure scanner is connected and powered on
    • Verify WIA drivers are installed
    • Run scanner_info.py to test connection
  2. Permission errors

    • Run as administrator if needed
    • Check Windows security settings
  3. Format not supported

    • Verify scanner supports requested format
    • Check scanner_info.py output for supported formats

Scanner Compatibility

This tool works with any scanner that supports Windows WIA (Windows Image Acquisition). Most modern scanners are compatible.

Tested Hardware:

  • HP Printer scanner features (confirmed working)
  • Windows WIA drivers
  • Python 3.13 compatibility verified

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Repository: https://github.com/Pandiyarajk/pyautoscan

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ‘จโ€๐Ÿ’ป Author

Pandiyaraj Karuppasamy
Email: pandiyarajk@live.com
Date: 27-Aug-2025

๐Ÿ™ Acknowledgments

  • Windows WIA (Windows Image Acquisition) API
  • Python Imaging Library (PIL/Pillow)
  • pywin32 for Windows COM integration
  • PowerLogger for enhanced logging capabilities

๐Ÿ“ž Support

If you encounter any issues or have questions:

  • Open an issue on GitHub
  • Check the troubleshooting section above
  • Verify your scanner compatibility

Note: This tool is designed specifically for Windows systems and requires a compatible scanner with WIA drivers.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyautoscan-1.0.0.tar.gz (20.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyautoscan-1.0.0-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file pyautoscan-1.0.0.tar.gz.

File metadata

  • Download URL: pyautoscan-1.0.0.tar.gz
  • Upload date:
  • Size: 20.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for pyautoscan-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c1822a3ca0491056c03f8aab39bc94abce147f4ab94e81575dd7bc7738ab56a1
MD5 160f0db2429633b400e043542377274f
BLAKE2b-256 26dd929660583cb4f2dd941851ba85d7f009f1221e20692fa64d241bdc85b45f

See more details on using hashes here.

File details

Details for the file pyautoscan-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pyautoscan-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for pyautoscan-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1085ecc6cb30cf11a228bdf3d064c51289c171d87648e4088f8081ff5527f941
MD5 fff49b36c90839e0027b45de272b6277
BLAKE2b-256 b5e5c89b3fc04869cb6fc8052e4cbf81f93693e08a835b40d361d3354ff7ebd6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page