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.
# 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
- 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
- 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
)
- pywin32: Windows COM integration for WIA
- Pillow: Image processing and PDF creation
- powerlogger: Enhanced logging with Rich console output and file rotation
-
Clone the repository:
git clone https://github.com/Pandiyarajk/pyautoscan.git cd pyautoscan
-
Install dependencies:
pip install -r requirements.txt
-
Verify scanner connection:
python scanner_info.py
pip install pyautoscan
Download the latest release from GitHub Releases for pre-built Windows executables.
python basic_scan.py
python advanced_scan.py
python scanner_info.py
Edit scan_config.ini
to customize:
- Output directory
- File format preferences
- Quality settings
- Auto-processing options
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
- Low: 150 DPI (fast, smaller files)
- Medium: 300 DPI (balanced)
- High: 600 DPI (high quality, larger files)
- JPG: Compressed, good for documents
- PNG: Lossless, good for images
- TIFF: High quality, large files
- PDF: Portable document format
pyautoscan/
βββ π pyautoscan/ # Main package
β βββ __init__.py # Package initialization
β βββ basic_scan.py # Basic scanning functionality
β βββ advanced_scan.py # Advanced scanning features
β βββ scanner_info.py # Scanner information utility
βββ π tests/ # Test suite
β βββ __init__.py
β βββ test_basic_scan.py
βββ π .github/ # GitHub Actions workflows
βββ π Scans/ # Output directory (gitignored)
βββ π README.md # Main documentation
βββ π DEVELOPMENT.md # Development guide
βββ π TESTING.md # Testing documentation
βββ π CHANGELOG.md # Version history
βββ π LICENSE # MIT License
βββ π requirements.txt # Production dependencies
βββ π requirements-dev.txt # Development dependencies
βββ π pyproject.toml # Modern Python packaging
βββ π setup.py # Traditional packaging
βββ π MANIFEST.in # Package file inclusion
βββ π .gitignore # Git ignore rules
βββ οΏ½οΏ½ .pre-commit-config.yaml # Code quality hooks
βββ π Makefile # Development commands
βββ π run_scanner.bat # Windows launcher
βββ π scan_config.ini # Configuration file
- GitHub: https://github.com/Pandiyarajk/pyautoscan
- Issues: https://github.com/Pandiyarajk/pyautoscan/issues
- Releases: https://github.com/Pandiyarajk/pyautoscan/releases
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
# Install PyInstaller
pip install pyinstaller
# Build basic scanner
pyinstaller --onefile --windowed pyautoscan/basic_scan.py
# Build advanced scanner
pyinstaller --onefile --windowed pyautoscan/advanced_scan.py
Note: Successfully tested with Python 3.13 and HP Printer scanner features.
The repository includes a GitHub Actions workflow that automatically builds Windows executables on each release.
-
"No scanner detected"
- Ensure scanner is connected and powered on
- Verify WIA drivers are installed
- Run
scanner_info.py
to test connection
-
Permission errors
- Run as administrator if needed
- Check Windows security settings
-
Format not supported
- Verify scanner supports requested format
- Check
scanner_info.py
output for supported formats
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
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
Repository: https://github.com/Pandiyarajk/pyautoscan
This project is licensed under the MIT License - see the LICENSE file for details.
Pandiyaraj Karuppasamy
Email: pandiyarajk@live.com
Date: 27-Aug-2025
- Windows WIA (Windows Image Acquisition) API
- Python Imaging Library (PIL/Pillow)
- pywin32 for Windows COM integration
- PowerLogger for enhanced logging capabilities
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.