Home | Determine the OS and version of PHP »
OCR for PDF in Ubuntu
By admin | July 8, 2008
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 tesseract in Ubuntu:
$ 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.
$ tesseract foo.tif bar
Unable to load unicharset file /usr/share/tesseract-ocr/tessdata/eng.unicharset
If the above bug happens, fix it by:
$ sudo apt-get install tesseract-ocr-eng
This is caused by a nasty bug in Ubuntu.
And now finally, do:
$ tesseract foo.tif bar# and without the .txt extension, or you will end up with bar.txt.txt
to complete it!
If you found this article helpful or interesting, please help Compdigitec spread the word. Don’t forget to subscribe to Compdigitec Labs for more useful and interesting articles!
Topics: Linux | 22 Comments »
June 11th, 2009 at 05:06
Thanks mate, exactly what I was searching for.
July 26th, 2009 at 17:23
I just got a 1 byte file 🙁 any ideas?
February 9th, 2010 at 13:22
Thanks for the awesome bugfix for Ubuntu. I was banging my head what was wrong.
February 24th, 2022 at 04:53
… [Trackback]
[…] Read More to that Topic: compdigitec.com/labs/2008/07/08/ocr-for-pdf-in-ubuntu/ […]
February 27th, 2022 at 11:27
… [Trackback]
[…] Information to that Topic: compdigitec.com/labs/2008/07/08/ocr-for-pdf-in-ubuntu/ […]
April 21st, 2022 at 19:03
… [Trackback]
[…] Read More Info here to that Topic: compdigitec.com/labs/2008/07/08/ocr-for-pdf-in-ubuntu/ […]
June 17th, 2022 at 03:05
… [Trackback]
[…] Read More on to that Topic: compdigitec.com/labs/2008/07/08/ocr-for-pdf-in-ubuntu/ […]
June 19th, 2022 at 20:26
… [Trackback]
[…] Info to that Topic: compdigitec.com/labs/2008/07/08/ocr-for-pdf-in-ubuntu/ […]
July 28th, 2022 at 13:07
อาหารยามเช้า ปลุกสมอง ก่อนปั่น slotxoth คัดสรรเกม สล็อตออนไลน์ ยอดฮิต Slotxo แตกง่าย ทำเงินได้ไม่จำกัดสล็อต เป็นเกมที่มีผู้เล่นมีความสนใจเป็นลำดับแรกๆในบรรดาเกม pg slot สล็อตคัดสรรเกม
August 31st, 2022 at 11:40
… [Trackback]
[…] There you can find 25874 more Information to that Topic: compdigitec.com/labs/2008/07/08/ocr-for-pdf-in-ubuntu/ […]
September 12th, 2022 at 16:50
… [Trackback]
[…] Find More to that Topic: compdigitec.com/labs/2008/07/08/ocr-for-pdf-in-ubuntu/ […]
September 14th, 2022 at 00:03
… [Trackback]
[…] Information to that Topic: compdigitec.com/labs/2008/07/08/ocr-for-pdf-in-ubuntu/ […]
September 23rd, 2022 at 06:43
… [Trackback]
[…] There you will find 69112 more Information on that Topic: compdigitec.com/labs/2008/07/08/ocr-for-pdf-in-ubuntu/ […]
October 5th, 2022 at 04:36
… [Trackback]
[…] Here you will find 69674 more Info on that Topic: compdigitec.com/labs/2008/07/08/ocr-for-pdf-in-ubuntu/ […]
November 15th, 2022 at 16:36
… [Trackback]
[…] Read More Info here to that Topic: compdigitec.com/labs/2008/07/08/ocr-for-pdf-in-ubuntu/ […]
January 8th, 2023 at 01:05
… [Trackback]
[…] There you can find 95687 additional Information on that Topic: compdigitec.com/labs/2008/07/08/ocr-for-pdf-in-ubuntu/ […]
January 19th, 2023 at 12:09
… [Trackback]
[…] Read More to that Topic: compdigitec.com/labs/2008/07/08/ocr-for-pdf-in-ubuntu/ […]
February 1st, 2023 at 00:43
… [Trackback]
[…] Read More on on that Topic: compdigitec.com/labs/2008/07/08/ocr-for-pdf-in-ubuntu/ […]
February 19th, 2023 at 08:59
… [Trackback]
[…] Read More to that Topic: compdigitec.com/labs/2008/07/08/ocr-for-pdf-in-ubuntu/ […]
February 24th, 2023 at 06:48
… [Trackback]
[…] There you can find 92020 additional Info on that Topic: compdigitec.com/labs/2008/07/08/ocr-for-pdf-in-ubuntu/ […]
March 2nd, 2023 at 18:28
… [Trackback]
[…] Read More to that Topic: compdigitec.com/labs/2008/07/08/ocr-for-pdf-in-ubuntu/ […]
March 11th, 2023 at 00:14
… [Trackback]
[…] Info to that Topic: compdigitec.com/labs/2008/07/08/ocr-for-pdf-in-ubuntu/ […]