I can view a pdf image with text using the evince document viewer, however I cannot select the text in the image to copy and paste. How do I copy text from an image in a pdf file?

  • PDFs are two types: 1.images being are scanned 2. text being are converted to PDF. You can't convert type #1 to text. – PersianGulf Sep 19 '14 at 23:49

You need OCR (Optical Character Recognition) to be able to extract text from images. If you Google OCR you'll find plenty of online OCR software that tries to extract text from images. I've personally never used one so hard to say how successful they are. You'll note that some of them take image files as an input in which case you'll have to convert the PDF to an image format (tools for that are available online as well).

If you're more technically inclined, there's a Python library pytesser which may be helpful.

Capture2Text is an open source tool which performs OCR on a screenshot and outputs the result to the clipboard so it almost feels like you're copying the text from the image. This is probably your best bet.

  • I apologize, but I went on the Capture2Text website and I was unable to find the linux versions. Am I looking in the wrong website? – linuxfreebird Sep 20 '14 at 2:41
  • Nothing to apologize about, you're right. I saw open source software and thought if the source is available, you must be able to compile it in Linux. This isn't always the case. Anyway, I found a fairly detailed post on the Ubuntu stackexchange for the same problem. The problem is that you'll have to build the tesseract OCR engine - instructions can be found here. – Harvinder Sep 20 '14 at 2:58
  • Also take a look at some of the answers to this question. – Harvinder Sep 20 '14 at 3:04

Unless you can get some sort of OCR to work, as suggested by Harvinder, you are out of luck. If it's an image in a PDF, it's no different than being an image in a JPEG or PNG or any other image.

Even if you find an OCR package that works for you, you might get very poor results. I've spent more time editing OCR'd PDF's than it would have taken to just re-type the text.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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