Monday 20 May 2013

Xsane generates large PDFs, use gscan2pdf instead

A friend and I both noticed that Xsane, which is the usual application used with flatbed scanners, generates large PDFs. An investigation showed this is an old problem. One of the comments, by the author in fact, suggested gscan2pdf.

Being a Perl program, this has a large set of dependencies, and there were reports that not all were available in openSUSE repos, so I decided to install from source instead of using a contributed RPM. My strategy was to run perl Makefile.PL, see what missing dependencies were listed and then install then firstly from the standard openSUSE repos, otherwise from CPAN. Some dependencies only show up at runtime, so start it from a terminal and watch it for diagnostic messages.

These dependencies were satisfied using zypper:
tiff
unpaper
ImageMagick-devel
sane-backends-devel
perl-PerlMagick
perl-Try-Tiny
perl-PDF-API2
perl-Font-TTF
perl-Goo-Canvas
perl-Gtk2-ImageView
perl-Config-General
perl-Log-Log4perl
perl-Readonly
These dependencies were satisfied using CPAN:
Gtk2-Ex-PodViewer Gtk2-Ex-Simple-List IO-stringy Set-IntSpan Proc-ProcessTable
These lists are not exhaustive because 1. I may have already had some installed and 2. I did not install dependencies for DjVu or OCR features. So regard this as a starting point.

In retrospect installing from the openSUSE contributed RPM may have been smooth. Perhaps somebody can try that and report. If you are running Debian or derivatives you will probably have no problem getting all the dependencies.

Preliminary results show that gscan2pdf generates much smaller files than Xsane so this is what I'll be using from now on and I encourage you to try gscan2pdf instead of Xsane.