scan/README.md

82 lines
2.4 KiB
Markdown
Executable File

# Overview
Bash wrapper for [scanline](https://github.com/klep/scanline) to allow for fast document scanning.
# Features
- Automatically tag PDFs based on filename
- Duplex scanning
- "multipage" scanning to allow for scanner adjustment between pages (for example if pages are different sizes)
- Store documents in directories based on financial year instead of calendar year for defined tags
# Requirements
- OSX
- [bashtools](https://git.nethack.net/rob/bashtools)
- [scanline](https://github.com/klep/scanline)
- (optional) [OCRmyPDF](https://github.com/ocrmypdf/OCRmyPDF) to make searchable PDFs
# Usage
rpearce@crom:scan$ ./scan
usage: ./scan [OPTIONS] filename tag1 [tag2] [tag3] ... [tagX]
1. Mounts $PDFSHARE to $PDFDIR
2. Scans to: $PDFDIR/tag1/<year>/filename
3. Creates symlinks in:
$PDFDIR/tag2/<year>/filename
$PDFDIR/tag3/<year>/filename
...etc...
OPTIONS
-d scan in duplex mode
-f xxx for given tag, use financial year in path rather than calendar year
-h show this text
-l list all available scanners
-m multi-page mode (prompts to load new pages each time)
-M mount $PDFSHARE to $PDFDIR then exit
-o use ocrmypdf to straighten document, extract text into pdf and use tags as keyword metadata
-O xxx specify path to ocrmypdf
-p preview document after scanning
-s xxx select scanner to use
-T Temporary mode - scan to /tmp/a.pdf
-v verbose mode
# Examples
## .scanrc example
bash$ cat ~/.scanrc
# Always preview documents
-p
# If "tax" tag is found, file based on financial year
-f tax
# AutoTag based on certain filenames
at nrma car/mazda
at rego car/mazda
at super super
at homeloan house
at visa bank
at youthsaver bank
at rcpt receipts
at receipt receipts
at elec utilities
at water utilities
at gas utilities
at ticket tickets
at quote quotes
## Usage examples
# Scan a double sided document
bash$ ./scan -d my_duplex_bank_statement.pdf bank financial
# Make a combined PDF of an A4 document and a small form factor reciept
bash$ ./scan -m combined.pdf misc
# Scan something without filing it to $PDFDIR/<tag>/<year>
bash$ ./scan -T
bash$ mv /tmp/a.pdf wherever