-
Notifications
You must be signed in to change notification settings - Fork 0
Documentation (EN)
This script is designed for GNU/Linux. It may work on other UNIX systems, but it was only tested on Ubuntu 12.04.
Scan2Thunderbird is just a sequence of third party softwares calls. This softwares are :
- SANE and scanimage
- ImageMagick
- Mozilla Thunderbird
- Gzip
- Shred, which is part of CoreUtils
All these packages must be installed.
The script uses the first configured scanner found by SANE. Thus, it must be correctly configured and supported by SANE.
First, the program must have execution rights, so you have 2 possibilities :
- in a file browser like Nautilus, do a right click on the file, go in "Properties" and then in "Permissions". Select "Execution" for current user.
- in a terminal, enter :
chmod 750 scan2thunderbird.sh
To execute it, open a terminal, go to scan2thunderbird.sh directory and run the script. Example :
$ cd Downloads
$ sh scan2thunderbird.sh
In several file browsers, a double-click on the file will have the same effect (choose "Open in a terminal").
To save time, you can create a launcher on your desktop, for example with gnome-menu.
The command must be /directory-of-the-script/scan2thunderbird.sh
. Don't forget to select "open in a terminal" option.
You just have to enter the number of pages in you document and the desired outpout (color or black and white) when asking.
The scanning pre-configured settings are :
- resolution : 300 DPI,
- quality : 90 %
- file format : jpeg
The scanning pre-configured settings are :
- resolution : 150 DPI,
- quality : 90 %
- file format : jpeg
All files are first generated in TIFF format by SANE, and then converted in JPEG by ImageMagick
After scanning individual pages, they are gathered in the same PDF file.
This is compressed with Gzip in order to optimize band-width usage, with "9" compression level (better).
Most email providers limit mail attachments to 5 Mo. So, if your file is larger, the programm asks you if it must re-do harder compression :
- first recompression will decrease resolution to 150 DPI,
- second and next recompression will decrease JPEG quality of 5% each time.
You can compress it much as it is necessary or bypass recompression.
The .pdf.gz file is used as an attachment in a new Thunderbird window.
For security purpose, no local copies of the scanned files are conserved. They are deleted with shred, after 35 passes of random bytes. A copy of the PDF file is usually stored on your "Sent" folder, in your mailbox.
The lines corresponding to the deletion of the .tiff and .jpeg are mentionned in the program, so you can comment them if you want to change the behaviour of the script.