copy copy from scanner to pdf or image file(s)
doc generated from the script with gendoc
ruby script, version=2.03

Synopsis

copy [options]

Description

copy, without any options or arguments, scans an image on the first available device, at the default size, producing a one page PDF (two pages on a duplex scanner), which is then displayed with your favorite pdf viewer. The default size is the maximum size of the device, unless DEFAULTX and/or DEFAULTY have been set in de configursation file.

With the --number=X option, multiple sheets can be scanned, resulting in a multi-page pdf document. The default is to scan 1 sheet, which will be scanned without delay; if the option is set to 2 or more, you need to press RETURN for every page to be scanned, including the first, giving you time to place a new sheet on the scanner. You don't need to count sheets - you can set the --number option to a large number and stop scanning with control-D.

With the --imagetype=X option, you can scan to one or more image files, instead of pdf.X can be one of pdf,␣png,␣jpg,␣ppm,␣gif,␣pgm,␣pbm,␣tif Again, these are saved in the file which you specified with the --outfile=X option, where X is copy by default. If you scan multiple pages, this file name will be extended with 1 for the first page, 2 for the second, and so on. With the --start option, numbering can be started with an other number than 1. Many options are available to influence brightness, contrast, pixel density, color mode, image quality, rotation, page position and size, and more. See the Options section for more information.

Configuration

copy needs one or more scan devices and it needs to know their properties. It reads that information from a configuration file. Copy looks at three places for that file, and uses the first available:

   1. ./copy.conf
   2. ~/.copy.conf
   3. $PREFIX/copy.conf where PREFIX is an environment variable, like |/usr/local|

You need to create this configuration file, using the scanimage program with the --help option, which lists the available devices, as well as their properties. This file must also define the constants PDFVIEWER and IMGVIEWER, which point to executables to display pdf's and images respectively. Optionally, you can define the constants DEFAULTX and DEFAULTY, containing width and height of the scan area in mm. Without these, the maximum area of the device will be scanned if the -x and -y options are not used.

Here is an example, which has two entries, both for the Epson V350 scanner, the first in flatbed mode, the second in transparency mode:

  PDFVIEWER=ENV['PDFVIEWER'] || 'evince'
  IMGVIEWER=ENV['IMGVIEWER'] || 'xv'
  DEFAULTX=210
  DEFAULTY=297
  DEVICES = [
    OpenStruct.new(
      :device  => 'epkowa',
      :name    => 'Epson V350 Flatbed',
      :source  => 'Flatbed',
      :Lineart => 'Binary',
      :Gray    => 'Gray',
      :Color   => 'Color',
      :xmax    => 215.9,
      :ymax    => 297.18,
      :xdpi    => [100,200,300,400,600,800,1200,2400,4800],
      :ydpi    => [100,200,300,400,600,800,1200,1600,2400,3600,4800,6600,9600],
      :hasxy   => true,
      :Dup     => false
    ),
    OpenStruct.new(
      :device  => 'epkowa',
      :name    => 'Epson V350 Transparency',
      :source  => 'Transparency',
      :posneg  => ['Positive','Negative'],
      :Lineart => 'Binary',
      :Gray    => 'Gray',
      :Color   => 'Color',
      :xmax    => 36.83,
      :ymax    => 122.17,
      :xdpi    => [300,600,1200,2400,4800],
      :ydpi    => [100,300,400,600,800,1200,1600,2400,3600,4800,6600,9600],
      :hasxy   => true,
      :Dup     => false
    ),
  ]

Options

General options

-h
Print this help and exit
-H, --help
Show full documentation via less and exit
-V, --version
Print version and exit
-v, --verbose
Be verbose

Device options

-0
Set the scan device nr to 0 (or 1..9).
The default is 0.
    --list
List all devices

Brightness,Contrast,density options

-b, --brightness=X
Set brightness correction to X percent (default: 0)
-c, --contrast=X
Set contrast correction to X percent (default: 0)
-d, --density=X
Set contrast correction to X dpi (default: 300)

Color mode options

-C, --color
Color mode (the default)
-G, --gray
Gray instead of Color mode
-L, --lineart
Lineart instead of Color mode

Positioning options

-l, --left=X
set left offset to X mm (default: 0)
-t, --top=X
set top offset to X mm (default: 0)
-x, --x=X
set width to X mm (default: scanner maximum)
-y, --y=X
set height to X mm (default: scanner maximum)
-A, --A=X
set page size to X, where X can be A0..A8

Output options

-o, --outfile=X
Set output filename to X (default: copy).
If not explicitly set, copy.pdf is not saved, but displayed with the application defined in the environment variable PDFVIEWER. Other image types are always saved.
-i, --imagetype=X
set image type to X; default: pdf

Conversion & Interaction options

-s, --start=X
Starting number for multiple output files (default: 1)
-n, --number=X
Number of sheets to scan (1 or more, default: 1);
on a duplex scanner, this generates twice as many pages.
-q, --quality=X
jpg conversion quality (%, default 75)
-r, --rotate=X
rotate X degrees clockwise
-e, --examples
show some examples of use

Author

Wybo Dekker

Copyright

Released under the GNU General Public License