Skip to content
Aurélien PIERRE edited this page Dec 22, 2013 · 1 revision

Requirements

Operating system

This script is designed for GNU/Linux. It may work on other UNIX systems, but it was only tested on Ubuntu 12.04.

Packages

Scan2Thunderbird is just a sequence of third party softwares calls. This softwares are :

All these packages must be installed.

Hardware

The script uses the first configured scanner found by SANE. Thus, it must be correctly configured and supported by SANE.

Usage

Launching

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").

Launcher

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.

Settings

You just have to enter the number of pages in you document and the desired outpout (color or black and white) when asking.

How it runs

From 1 to 3 pages

The scanning pre-configured settings are :

  • resolution : 300 DPI,
  • quality : 90 %
  • file format : jpeg

For 4 pages and more

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

Generating PDF

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).

Post-processing test

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.

Sending the file

The .pdf.gz file is used as an attachment in a new Thunderbird window.

Cleaning files

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.