Fixing OCR support in gscan2pdf on Ubuntu 14.04 & derivatives

Edit: Jeffrey Ratcliffe, the very active developer of gscan2pdf, has released an update that fixes this bug. Ubuntu users can access it his PPA (see below).

In this post the other day I talked about my relatively painless experience upgrading to Xubuntu 14.04. Since then, I have discovered a couple of bugs in some OCR software I use fairly regularly.

Here is a solution to a slightly annoying regression in gscan2pdf, an otherwise great little PDF scanning, clean-up and OCR solution.

In Ubuntu 14.04 gscan2pdf has a bug in it’s tesseract OCR support meaning it appears to OCR the document but once completed no text is added to the OCR layer. Although the bug does not affect the gocr OCR engine, tesseract (which was developed by Google HP Labs) is a much better engine and the one I prefer to use.

My first attempt at rectifying the problem was to upgrade gscan2pdf to the latest version (from 1.2.3-1 to 1.2.4) which doesn’t seem to have made it into the Ubuntu 14.04 repos, a shame considering Trusty is an LTS release. On the upside Jeffrey Ratcliffe, gscan2pdf’s developer, has a PPA that contains the latest version, so upgrading was relatively painless. The process is well documented here on the RCLUBLINUX blog.

Unfortunately, the bug is not fixed in gscan2pdf 1.2.4 so the upgrade didn’t fix my problem.

A little poking about on the gscan2pdf Sourceforge page however, showed this bug report, and also patch to fix the problem contributed by user tzieg (Thomas Zieg?).

After applying the patch and firing up gscan2pdf I was glad to see tesseract again worked as expected, thanks Thomas!

Problem: After upgrading to Xubuntu 14.04 the tesseract OCR engine no longer worked in gscan2pdf.

Solution: Patch gscan2pdf using the patch supplied by Thomas Zeig.

Procedure: Download a copy of the patch from gscan2pdf’s Sourceforge bugtracker.

Copy the patch to the gscan2pdf directory.

sudo cp Tesseract.pm.patch /usr/share/perl5/Gscan2pdf/

Change to the gscan2pdf directory.

cd /usr/share/perl5/Gscan2pdf/

Apply the patch,

sudo patch -p0 < Tesseract.pm.patch

OCR with tesseract should now work as expected, easy.

 

Right, now to figure out why OCRFeeder crashes when exporting to PDF.

Advertisements

Xubuntu 14.04 – Notification Area Missing Icons

Yesterday I bit the bullet and upgraded my fairly stable Xubuntu install from 13.10 Saucy Salamander to 14.04 Trusty Tahr.

I had no pressing need to upgrade (aside from an the occasional reminder when I logged in that a new release was available) but since Trusty had been out for a few weeks I figured any show stopping bugs would be ironed out by now.

First, I have to comment on how painless the upgrade procedure has become, a couple of clicks and it was away. After about an hour or so spent downloading and installing updates, a reboot and a slightly extended initial login, everything seemed to be right where I left it. No longer are we faced fixing a bunch of small things that go awry during the upgrade process.

I did, however, find one minor annoyance. No longer did all my running apps (the ones that I want to anyway) show up in the notification area I have in the top left of my screen.

Notification area Missing Icons

Missing Icons

Conspicuously missing were Network Manager, Dropbox, Spideroak, KeePass and perhaps a few more, leaving me with just the volume control and power indicator icons showing. This was true even though each of my apps appeared to be running after being correctly started at login.

Indicator Plugin

Indicator Plugin

After a bit of poking around in the XFCE panel preferences I found that replacing the Notification Area applet with the Indicator Plugin applet all my application icons were restored.

This, however, left me with another dilemma, as Indicator Plugin also includes a bunch of icons for mail, bluetooth and keyboard that, although I could hide, I couldn’t easily remove. What I really wanted was for Notification Area to work the way it did before the upgrade.

Notification Area with Icons

Notification Area

After further investigation and a little google-fu, I found that by killing indicator-application-service my icons would reappear. A quick delve into ‘Sessions and Startup’ settings found in XFCE’s Settings Manager found this service (listed as Indicator Application) was started on login and by unticking the box next to it I could tell it not to start. Problem solved. Now my notification area looks the way I like it with grey and black icons showing and the more and out of place looking coloured icons nicely hidden away.

Session and Startup Properties

Session and Startup Properties

Problem: After upgrading to Xubuntu 14.04 some application icons no longer show in the notification area.

Solution: Stop indicator-application-service from starting at login.

Procedure:

  • Open XFCE Settings Manager and navigate to Session and Startup preferences.
  • Click on the Application Autostart Tab and scroll down to Indicator Application
  • Untick the tickbox.
  • Click close, log out and log back in again.