LeoFCardoso / pdf2pdfocr

A free tool to OCR a PDF and add a text "layer" in the original file, making a searchable PDF. Use only open source tools. Please tip!
Apache License 2.0
274 stars 35 forks source link

Integration with Google Vision API #11

Closed bharat-patidar closed 5 years ago

bharat-patidar commented 5 years ago

Hello, I want to replace tesseract engine with Google vision API. Can you please suggest me how to do the same. thanks

LeoFCardoso commented 5 years ago

Hi, please look at: https://cloud.google.com/vision/docs/ocr

With pdf2pdfocr you have to rewrite "do_ocr_tesseract" function to generate a PDF file only with text information from OCR engine.

Multiple pages document can be affected by upload procedures.

Is this API for free? If so, I can have a look and try to code something. Pull requests are welcome also!

bharat-patidar commented 5 years ago

Hi Leo, Thank you for the instant response. No, this API is not free. Can you guide me to create PDF file from the text information of Google's OCR engine, so that I can utilize this PDF in your further part of code. I have attached link for text file which is the result of google vision api when I passed an image for OCR. https://www.dropbox.com/s/fxb8ond9d1tli6l/gv_output.txt?dl=0

LeoFCardoso commented 5 years ago

Hello! Found this piece of code, but haven't tested it yet. https://github.com/dinosauria123/gcv2hocr If you can generate the corresponding the hocr file, than we have a chance... :-)

LeoFCardoso commented 5 years ago

Hi, please look this also: https://github.com/PublicI/pdf-gcv-ocr

bharat-patidar commented 5 years ago

Thank You so much man for sharing this stuff!! :)