Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have scanned about 80 pages into gray scale pdf (image format). The end size of the file is about 70MB, which is very huge.

Now I am looking for a method to convert the grayscale image-based PDF file into a simple black/white text-based PDF file.

I have done many attempts with gs but with no success (only a few percent recovery). If any expert has some idea, kindly let me know.

share|improve this question
If you're interested in keeping the PDF images as-is and adding text to it, have a look at question Adding OCR info to a PDF. – colan Sep 6 '14 at 13:22
If you could post a link to (for example) one-page example we could test solutions... – Rmano Apr 30 '15 at 8:23
It's not an OCR solution but helps a lot (although 72dpi is a bit on the low side, I have better results with 120). – Rmano Apr 30 '15 at 8:29

I am still thinking about a solution for the command line. But at the moment I can only offer the following:

gImageReader is a simple GTK+ front-end to tesseract-ocr.

sudo apt-get install gimagereader
sudo apt-get install tesseract-ocr

sorry for german text sorry for the german text

share|improve this answer

You need some OCR tool. Look at Tesseract

share|improve this answer
While this may answer the question, it would be preferred that you summarize or include key points to the linked page, should it disappear in future. – Thomas W. Mar 14 '13 at 23:27

In your pdf file, right-click and save each page as image (or find some tool that does all pages automatically)

Open Ubuntu software center. Search for tesseract. This will find YAGF which you should install. In YAGF, click on File -> Open Image and load your image. Then click on File -> Recognize.

I had 100% accuracy in my first test.

share|improve this answer

I guess you are using ubuntu. Search 'ocr' in ubuntu software center. You will get many image-to-text OCR softwares.

share|improve this answer

For the graphical interface suggested by @A.B. on ubuntu 14.04 you should follow:

ocr tesseract on ubuntu 14.04

or anyway, add to the repository list:

sudo add-apt-repository ppa:sandromani/gimagereader
sudo apt-get update

before this works:

sudo apt-get install gimagereader
share|improve this answer

You can try pdfocr:

 sudo add-apt-repository ppa:gezakovacs/pdfocr
 sudo apt-get update
 sudo apt-get install pdfocr

To execute the sintax is

 pdfocr -i input.pdf -o output.pdf

where input.pdf is the name of the input file and output.pdf the output file.

By default it uses Tesseract. To install it:

 sudo apt-get install tesseract-ocr

pdfocr creates an embedded text layer.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.