2

I have an html form where a user can upload a pdf . I want to extract the whole text from pdf, search it for specific words and then store them in my database. Any ideas ? I don't ask you the whole code of course. But something to begin with. Like a library or something like OCR , but free.

  • you do not even specify what OS or programming language – Harry Nov 12 '17 at 18:23
  • 1
    i work in php . that's why i use that tags – martha t Nov 13 '17 at 13:21
  • 1
    Not sure if this is an option in your scenario, but consider distributing fillable PDFs beforehand and then you can easily extract structured data from it. – Vlastimil Ovčáčík Nov 18 '17 at 13:28
  • Why are you thinking of OCR? Aren't these PDFs text? – Mawg Dec 10 '18 at 12:44
0

If the pdf has been created programmatically, rather than scanned, the python library pdfminer can extract the text for you.

It and python are free, gratis & open source, and are available for most platforms.

  • 1
    Thanks for the response! I am afraid that the pdf it's scanned plus i don't know much about Python ! I work mostly in java , c++ , php , html . – martha t Nov 13 '17 at 13:23
  • 2
    The problem with scanned pdf files is that basically they are images, with possibly some attempt at OCR. You could look at github.com/tesseract-ocr/tesseract for an Apache Licenced OCR it is C but there are wrappers for python, java and a few others. – Steve Barnes Nov 13 '17 at 14:42
0

Did you Google for PHP OCR?

What about this S.O question ?

The article OCR in PHP: Read Text from Images with Tesseract explains more.

There is a PhpOcr project on SourceForge.

Tesarect would seem to be your best bet.

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.