Scan in batch mode from console
Command-line tool for scanning in batch mode on Linux
- Scan sheets in batch mode
- Merge scanned images automatically into a single PDF file
- Add new pages to existing sheets scanned before
- Replace pages by scanning them again
pip install smth
Or install from source:
git clone https://github.com/dmitrvk/smth cd smth sudo python setup.py install
If you got an error with missing
make sure you have sane installed.
For Debian-based distributions, you may need to install
Assume you have some handwriting, e.g. lecture notes you want to scan.
- Create a new notebook type.
This is needed to tell the program how to crop and rotate scanned images properly:
$ smth types --create ? Enter title: A5 ? Enter page width in millimeters: 148 ? Enter page height in millimeters: 210 ? Are pages paired? (default - no) No Created type 'A5' 148x210mm.
- Create a new notebook.
$ smth create ? Enter title: lectures ? Choose type A5 ? Enter path to PDF: ~/scans ? Enter 1st page number: 1 Create notebook 'lecture' of type 'A5' at '/home/user/scans/lecture.pdf'
All scanned pages will be inserted in the PDF file, so you will have all pages in one file.
- Start scanning process.
$ smth scan ? Choose notebook lectures ? How many new pages? (leave empty if none) 3 Searching for available devices... ? Choose device pixma:04A9176D_3EBCC9
Scanning process will start immediately. All you need is to put new pages on scanner's glass one after another.
Generated PDF will contain all scanned pages.
Separate jpg images will be saved at
smth remembers all notebooks you scanned before, all notebook types and the scanner device. With smth you can add new pages to existing notebooks or replace any page in a notebook by scanning the page again.
Crop images properly
Single pages (portrait)
Always cropped from the top left corner of scanner's output. If scanner's output is landscape, the image will be rotated 90 counter-clockwise before cropping.
Single pages (landscape)
Always cropped from the top left corner of image in landscape orientation. The image will be rotated 90 clockwise before cropping if it is portrait.
If scanner's output is portrait, always rotate 90 clockwise.
The only exception is if the page height is larger than the short side of scanner's glass. In this case portrait orientation will be kept.
If both pages fits the scanner's glass, then both pages will be cropped at once from the top left corner.
If the width of two pages is larger then the scanner glass' width, then left pages will be cropped from the top left corner and the right pages will be cropped from the top right corner.
Create a new notebook with specified title, type, path to PDF and 1st page number.
Show a list of available notebooks.
Scan notebook adding new pages and/or replacing existing ones.
--set-device- reset the device which is used to prefrorm scanning and choose another one.
If smth is run without arguments, this command will be run by default.
Manage types of notebooks.
A type of a notebook specifies its pages size and whether pages are paired. This information is essential for smth when it crops and rotates scanned images and inserts pages into a PDF file.
w --------- Notebook that consists of single pages. --------- h --------- --------- --------- w - page width in millimeters, --------- h - page height in millimeters w -------^------- Notebook with paired pages. -------^------- h -------^------- -------^------- w - page width in millimeters, -------^------- h - page height in millimeters
If run without arguments, show the list of available notebook types.
--create- create a new notebook type.
The type of A4 format in portrait orientation is created by default.
Configuration is stored in
[scanner] device = <device> delay = 0
Device name which sane uses for scanning.
scan command, the value of this parameter is used by default.
You can change it manually or run
scan command with
$ smth scan --set-device
Time in seconds which should pass before scanning of the next page starts.
Set this option to higher value if you need extra time to put next sheet on scanner's glass.
This project is licensed under the GNU General Public License v3.0.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size smth-0.3.0-py3-none-any.whl (35.0 kB)||File type Wheel||Python version py3||Upload date||Hashes View|
|Filename, size smth-0.3.0.tar.gz (19.7 kB)||File type Source||Python version None||Upload date||Hashes View|