Thursday, July 16, 2009

How to install OCR for PDF in ubuntu

To get OCR in Ubuntu, you need to use the Open-Source Tesseract OCR engine. However, it can only perform OCR on the TIFF format. In order to allow it to do PDF, we also need the Evince PDF reader to allow us to export a page to TIFF to feed Tesseract with.

Install Evince PDF reader

Quote : $ sudo apt-get install evince

Install tesseract in Ubuntu:

Quote : $ sudo apt-get install tesseract-ocr

Now, get the TIFF from Evince; Right click the page and click “Save image as…” and export the file. Then, to get a good OCR we need to convert it to monochrome.


Quote : $ tesseract foo.tif bar
Unable to load unicharset file /usr/share/tesseract-ocr/tessdata/eng.unicharset

If the above bug happens, fix it by:

Quote : $ sudo apt-get install tesseract-ocr-eng

This is caused by a nasty bug in Ubuntu.

And now finally, do:

Quote : $ tesseract foo.tif bar# and without the .txt extension, or you will end up with bar.txt.txt

to complete it!

Tq http://www.compdigitec.com/

Enjou ubuntu... ;)

No comments:

kunkun-laptop .... ;)