1GSCAN2PDF(1)          User Contributed Perl Documentation         GSCAN2PDF(1)
2
3
4

Name

6       gscan2pdf - A GUI to produce PDFs or DjVus from scanned documents
7

Synopsis

9       1. Scan one or several pages in with File/Scan
10       2. Create PDF of selected pages with File/Save
11

Description

13       gscan2pdf has the following command-line options:
14
15       --device=<device> Specifies the device to use, instead of getting the
16       list of devices from via the SANE API. This can be useful if the
17       scanner is on a remote computer which is not broadcasting its
18       existence.
19       --help Displays this help page and exits.
20       --log=<log file> Specifies a file to store logging messages.
21       --(debug|info|warn|error|fatal) Defines the log level. If a log file is
22       specified, this defaults to 'debug', otherwise 'warn'.
23       --version Displays the program version and exits.
24
25       Scanning is handled with SANE via scanimage.  PDF conversion is done by
26       PDF::API2.  TIFF export is handled by libtiff (faster and smaller
27       memory footprint for multipage files).
28

Download

30       gscan2pdf is available on Sourceforge
31       (<https://sourceforge.net/project/showfiles.php?group_id=174140&package_id=199621>).
32
33   Debian-based
34       If you are using Debian, you should find that sid has the latest
35       version already packaged.
36
37       If you are using a Ubuntu-based system, just add the following line to
38       your "/etc/apt/sources.list" file:
39
40       "deb http://ppa.launchpad.net/jeffreyratcliffe/ubuntu <release> main"
41
42       "deb-src http://ppa.launchpad.net/jeffreyratcliffe/ubuntu <release>
43       main"
44
45       where "<release>" is the version of Ubuntu you are using.
46
47       If you are you are using Synaptic, then use menu Edit/Reload Package
48       Information, search for gscan2pdf in the package list, and lo and
49       behold, you can install the nice shiny new version automatically.
50
51       From the command line:
52
53       "apt-get update"
54
55       "apt-get install gscan2pdf"
56
57       If you add my key to your list of trusted keys, then you will no longer
58       get the "not authenticated" warnings. Fetch the key:
59
60       "gpg --keyserver subkeys.pgp.net --recv-keys 4DD7CC93"
61
62       Then add it to the apt keyring:
63
64       "gpg --export --armor 4DD7CC93 | sudo apt-key add -"
65
66   RPMs
67       Download the rpm from Sourceforge, and then install it with "rpm -i
68       gscan2pdf-version.rpm"
69
70   From source
71       The source is hosted in the files section of the gscan2pdf project on
72       Sourceforge
73       (<http://sourceforge.net/project/showfiles.php?group_id=174140>).
74
75   From the repository
76       gscan2pdf uses Git for its Revision Control System. You can browse the
77       tree at http://gscan2pdf.git.sourceforge.net/git/gitweb.cgi?p=gscan2pdf
78
79       Git users can clone the complete tree with "git clone
80       git://gscan2pdf.git.sourceforge.net/gitroot/gscan2pdf/gscan2pdf"
81

Building gscan2pdf from source

83       Having downloaded the source either from a Sourceforge file release, or
84       from the Git repository, unpack it if necessary with "tar xvfz
85       gscan2pdf-x.x.x.tar.gz cd gscan2pdf-x.x.x"
86
87       "perl Makefile.PL", will create the Makefile.  There is a "make test",
88       but this is not machine-dependent, and therefore really just for my
89       benefit to make sure I haven't broken the device-dependent options
90       parsing routine.
91
92       You can install directly from the source with "make install", but
93       building the appropriate package for your distribution should be as
94       straightforward as "make debdist" or "make rpmdist". However, you will
95       additionally need the rpm, devscripts, fakeroot, debhelper and gettext
96       packages.
97

Dependencies

99       The list below looks daunting, but all packages are available from any
100       reasonable up-to-date distribution. If you are using Synaptic, having
101       installed gscan2pdf, locate the gscan2pdf entry in Synaptic, right-
102       click it and you can install them under Recommends. Note also that the
103       library names given below are the Debian/Ubuntu ones. Those
104       distributions using RPM typically use perl(module) where Debian has
105       libmodule-perl.
106
107       Required
108           libgtk2.0-0 (>= 2.4)
109               The GTK+ graphical user interface library.
110
111           libglib-perl (>= 1.100-1)
112               Perl interface to the GLib and GObject libraries
113
114           libgtk2-perl (>= 1:1.043-1)
115               Perl interface to the 2.x series of the Gimp Toolkit library
116
117           libgtk2-imageview-perl
118               Perl bindings to the gtkimageview widget.  See
119               <http://trac.bjourne.webfactional.com/>
120
121           libgtk2-ex-simple-list-perl
122               A simple interface to Gtk2's complex MVC list widget
123
124           liblocale-gettext-perl (>= 1.05)
125               Using libc functions for internationalization in Perl
126
127           libpdf-api2-perl
128               provides the functions for creating PDF documents in Perl
129
130           libsane
131               API library for scanners
132
133           libsane-perl
134               Perl bindings for libsane.
135
136           libset-intspan-perl
137               manages sets of integers
138
139           libtiff-tools
140               TIFF manipulation and conversion tools
141
142           Imagemagick
143               Image manipulation programs
144
145           perlmagick
146               A perl interface to the libMagick graphics routines
147
148           sane-utils
149               API library for scanners -- utilities.
150
151       Optional
152           sane
153               scanner graphical frontends. Only required for the scanadf
154               frontend.
155
156           libgtk2-ex-podviewer-perl
157               Perl Gtk2 widget for displaying Plain Old Documentation (POD).
158               Not required if you don't need the gscan2pdf documentation
159               (which is anyway repeated on the website).
160
161           unpaper
162               post-processing tool for scanned pages. See
163               <http://unpaper.berlios.de/>.
164
165           xdg-utils
166               Desktop integration utilities from freedesktop.org. Required
167               for Email as PDF.  See <http://portland.freedesktop.org/wiki/>
168
169           djvulibre-bin
170               Utilities for the DjVu image format. See
171               <http://djvu.sourceforge.net/>
172
173           gocr
174               A command line OCR. See <http://jocr.sourceforge.net/>.
175
176           tesseract
177               A command line OCR. See http://code.google.com/p/tesseract-ocr/
178               <http://code.google.com/p/tesseract-ocr/>
179
180           ocropus
181               A command line OCR. See <http://code.google.com/p/ocropus/>
182
183           cuneiform
184               A command line OCR. See http://launchpad.net/cuneiform-linux
185               <http://launchpad.net/cuneiform-linux>
186

Support

188       There are two mailing lists for gscan2pdf:
189
190       gscan2pdf-announce
191           A low-traffic list for announcements, mostly of new releases. You
192           can subscribe at
193           http://lists.sourceforge.net/lists/listinfo/gscan2pdf-announce
194           <http://lists.sourceforge.net/lists/listinfo/gscan2pdf-announce>
195
196       gscan2pdf-help
197           General support, questions, etc.. You can subscribe at
198           http://lists.sourceforge.net/lists/listinfo/gscan2pdf-help
199           <http://lists.sourceforge.net/lists/listinfo/gscan2pdf-help>
200

Reporting bugs

202       Before reporting bugs, please read the "FAQs" section.
203
204       Please report any bugs found, preferably against the Debian
205       package[1][2].  You do not need to be a Debian user, or set up an
206       account to do this.
207
208       1. http://packages.debian.org/sid/gscan2pdf
209       2. http://www.debian.org/Bugs/
210
211       Alternatively, there is a bug tracker for the gscan2pdf project on
212       Sourceforge
213       (<https://sourceforge.net/tracker/?group_id=174140&atid=868098>).
214
215       Please include the output of "gscan2pdf --debug" with any new bug
216       report.
217

Translations

219       gscan2pdf has already been partly translated several languages.  If you
220       would like to contribute to an existing or new translation, please
221       check out Rosetta: <https://translations.launchpad.net/gscan2pdf>
222
223       Note that the translations for the scanner options are taken directly
224       from sane-backends. If you would like to contribute to these, you can
225       do so either at contact the sane-devel mailing list
226       (sane-devel@lists.alioth.debian.org) and have a look at the po/
227       directory in the source code http://www.sane-project.org/cvs.html
228       <http://www.sane-project.org/cvs.html>.
229
230       Alternatively, Ubuntu has its own translation project. For the 9.04
231       release, the translations are available at
232       https://translations.launchpad.net/ubuntu/jaunty/+source/sane-backends/+pots/sane-backends
233       <https://translations.launchpad.net/ubuntu/jaunty/+source/sane-
234       backends/+pots/sane-backends>
235
237   File
238       New
239
240       Clears the page list.
241
242       Open
243
244       Opens any format that imagemagick supports. PDFs will have their
245       embedded images extracted and imported one per page.
246
247       Scan
248
249       Sets options before scanning via SANE.
250
251       Device
252
253       Chooses between available scanners.
254
255       # Pages
256
257       Selects the number of pages, or all pages to scan.
258
259       Source document
260
261       Selects between single sided or double sides pages.
262
263       This affects the page numbering.  Single sided scans are numbered
264       consecutively.  Double sided scans are incremented (or decremented, see
265       below) by 2, i.e. 1, 3, 5, etc..
266
267       Side to scan
268
269       If double sided is selected above, assuming a non-duplex scanner, i.e.
270       a scanner that cannot automatically scan both sides of a page, this
271       determines whether the page number is incremented or decremented by 2.
272
273       To scan both sides of three pages, i.e. 6 sides:
274
275       1. Select:
276           # Pages = 3 (or "all" if your scanner can detect when it is out of
277           paper)
278
279           Double sided
280
281           Facing side
282
283       2. Scans sides 1, 3 & 5.
284       3. Put pile back with scanner ready to scan back of last page.
285       4. Select:
286           # Pages = 3 (or "all" if your scanner can detect when it is out of
287           paper)
288
289           Double sided
290
291           Reverse side
292
293       5. Scans sides 6, 4 & 2.
294       6. gscan2pdf automatically sorts the pages so that they appear in the
295       correct order.
296
297       Device-dependent options
298
299       These, naturally, depend on your scanner.  They can include
300
301       Page size.
302       Mode (colour/black & white/greyscale)
303       Resolution (in PPI)
304       Batch-scan
305           Guarantees that a "no documents" condition will be returned after
306           the last scanned page, to prevent endless flatbed scans after a
307           batch scan.
308
309       Wait-for-button/Button-wait
310           After sending the scan command, wait until the button on the
311           scanner is pressed before actually starting the scan process.
312
313       Source
314           Selects the document source.  Possible options can include Flatbed
315           or ADF.  On some scanners, this is the only way of generating an
316           out-of-documents signal.
317
318       Save
319
320       Saves the selected or all pages as a PDF, DjVu, TIFF, PNG, JPEG, PNM or
321       GIF.
322
323       PDF Metadata
324
325       Metadata are information that are not visible when viewing the PDF, but
326       are embedded in the file and so searchable and can be examined,
327       typically with the "Properties" option of the PDF viewer.
328
329       The metadata are completely optional, but can also be used to generate
330       the filename see preferences for details.
331
332       DjVu
333
334       Both black and white, and colour images produce better compression than
335       PDF. See <http://www.djvuzone.org/> for more details.
336
337       Email as PDF
338
339       Attaches the selected or all pages as a PDF to a blank email.  This
340       requires xdg-email, which is in the xdg-utils package.  If this is not
341       present, the option is ghosted out.
342
343       Print
344
345       Prints the selected or all pages.
346
347       Compress temporary files
348
349       If your temporary ($TMPDIR) directory is getting full, this function
350       can be useful - compressing all images at LZW-compressed TIFFs. These
351       require much less space than the PNM files that are typically produced
352       by SANE or by importing a PDF.
353
354   Edit
355       Delete
356
357       Deletes the selected page.
358
359       Renumber
360
361       Renumbers the pages from 1..n.
362
363       Note that the page order can also be changed by drag and drop in the
364       thumbnail view.
365
366       Select
367
368       The select menus can be used to select, all, even, odd, blank, dark or
369       modified pages. Selecting blank or dark pages runs imagemagick to make
370       the decision.  Selecting modified pages selects those which have
371       modified by threshold, unsharp, etc., since the last OCR run was made.
372
373       Preferences
374
375       The preferences menu item allows the control of the default behviour of
376       various functions. Most of these are self-explanatory.
377
378       Frontend
379
380       gscan2pdf supports two frontends, scanimage and scanadf.  scanadf
381       support was added when it was realised that scanadf works better than
382       scanimage with some scanners. On Debian-based systems, scanadf is in
383       the sane package, not, like scanimage, in sane-utils. If scanadf is not
384       present, the option is obviously ghosted out.
385
386       In 0.9.27, Perl bindings for SANE were introduced and two further
387       frontends, scanimage-perl and scanadf-perl (scanimage and scanadf
388       transliterated from C into Perl) were added.
389
390       Default filename for PDF files
391
392       The following variables are available, which are replaced by the
393       corresponding metadata:
394
395        %a     author
396        %t     title
397        %y     document's year
398        %Y     today's year
399        %m     document's month
400        %M     today's month
401        %d     document's day
402        %D     today's day
403
404   View
405       Zoom 100%
406
407       Zooms to 1:1. How this appears depends on the desktop resolution.
408
409       Zoom to fit
410
411       Scales the view such that all the page is visible.
412
413       Zoom in
414
415       Zoom out
416
417       Rotate 90 clockwise
418
419       The rotate options require the package imagemagick and, if this is not
420       present, are ghosted out.
421
422       Rotate 180
423
424       Rotate 90 anticlockwise
425
426   Tools
427       Threshold
428
429       Changes all pixels darker than the given value to black; all others
430       become white.
431
432       Unsharp mask
433
434       The unsharp option sharpens an image. The image is convolved with a
435       Gaussian operator of the given radius and standard deviation (sigma).
436       For reasonable results, radius should be larger than sigma. Use a
437       radius of 0 to have the method select a suitable radius.
438
439       Crop
440
441       unpaper
442
443       unpaper (see <http://unpaper.berlios.de/>) is a utility for cleaning up
444       a scan.
445
446       OCR (Optical Character Recognition)
447
448       The gocr, tesseract, ocropus or cuneiform utilities are used to produce
449       text from an image.
450
451       There is an OCR output buffer for each page and is embedded as plain
452       text behind the scanned image in the PDF produced. This way, Beagle can
453       index (i.e. search) the plain text.
454
455       In DjVu files, the OCR output buffer is embedded in the hidden text
456       layer.  Thus these can also be indexed by Beagle.
457
458       There is an interesting review of OCR software at
459       <http://web.archive.org/web/20080529012847/http://groundstate.ca/ocr>.
460       An important conclusion was that 400ppi is necessary for decent
461       results.
462
463       Up to v2.04, the only way to tell which languages were available to
464       tesseract was to look for the language files. Therefore, gscan2pdf
465       checks the path returned by:
466
467        tesseract '' '' -l ''
468
469       If there are no language files in the above location, then gscan2pdf
470       assumes that tesseract v1.0 is installed, which had no language files.
471
472       Variables for user-defined tools
473
474       The following variables are available:
475
476        %i     input filename
477        %o     output filename
478        %r     resolution
479
480       An image can be modified in-place by just specifying %i.
481

FAQs

483   Why isn't option xyz available in the scan window?
484       Possibly because SANE or your scanner doesn't support it.
485
486       If an option listed in the output of "scanimage --help" that you would
487       like to use isn't available, send me the output and I will look at
488       implementing it.
489
490   I've only got an old flatbed scanner with no automatic sheetfeeder. How do
491       I scan a multipage document?
492       If you are lucky, you have an option like Wait-for-button or Button-
493       wait, where the scanner will wait for you to press the scan button on
494       the device before it starts the scan, allowing you to scan multiple
495       pages without touching the computer.
496
497       Otherwise, you have to set the number of pages to scan to 1 and hit the
498       scan button on the scan window for each page.
499
500   Why is option xyz ghosted out?
501       Probably because the package required for that option is not installed.
502       Email as PDF requires xdg-email (xdg-utils), unpaper and the rotate
503       options require imagemagick.
504
505   Why can I not scan from the flatbed of my HP scanner?
506       Generally for HP scanners with an ADF, to scan from the flatbed, you
507       should set "# Pages" to "1", and possibly "Batch scan" to "No".
508
509   When I update gscan2pdf using the Update Manager in Ubuntu, why is the list
510       of changes never displayed?
511       As far as I can tell, this is pulled from changelogs.ubuntu.com, and
512       therefore only the changelogs from official Ubuntu builds are
513       displayed.
514
515   Why can gscan2pdf not find my scanner?
516       If your scanner is not connected directly to the machine on which you
517       are running gscan2pdf and you have not installed the SANE daemon,
518       saned, gscan2pdf cannot automatically find it. In this case, you can
519       specify the scanner device on the command line:
520
521       "gscan2pdf --device <device">
522

See Also

524        Xsane
525        http://scantailor.sourceforge.net/
526

Author

528       Jeffrey Ratcliffe (ra28145 at users dot sf dot net)
529

Thanks to

531       ·   all the people who have sent patches, translations, bugs and
532           feedback.
533
534       ·   the GTK2 project for a most excellent graphics toolkit.
535
536       ·   the Gtk2-Perl project for their superb Perl bindings for GTK2.
537
538       ·   The SANE project for scanner access
539
540       ·   BjA~Xrn Lindqvist for the gtkimageview widget
541
542       ·   Sourceforge for hosting the project.
543
544
545
546perl v5.12.4                      2011-09-28                      GSCAN2PDF(1)
Impressum