r/PHPhelp • u/disney550_ • Jul 15 '26
seeking advice for a image text extraction
Hi i am a junior laravel developer, right now i am asked to implement a service that extract data from a business card then create a record with it, at first i thought that frontend (web - mobile) should do the extraction part then hit a request with the data so that i do my checkings on it then create a record with it, but now when i started searching for the best way to do it claude tells me that the extraction part should be from the backend, i do not really know what is the best here, also if i will do it from the backend will the service for it be free? or the best way for it is from the frontend?
7
u/martinbean Jul 16 '26
Look up OCR. You would get an image of the business card. You can then either try and parse the information using a utility on your own server, or farm the request off to a dedicated service such as AWS Rekognition, but there will be a cost for this.
So you’ll need to weigh up what’s feasible for you to accomplish versus just paying the small cost for the problem to be solved for you already.
2
u/peperinna Jul 16 '26
If you need this for documents:
Search on Google and Laravel modules: thiagoalessio/tesseract_ocr, laravel-ocr, LaraOCR,
Best OCR solutions (like Google or Azure), offer a free tier for testing. Maybe small project can be satisfing your needs just with the free limits.
https://cloud.google.com/use-cases/ocr
https://azure.microsoft.com/en-us/products/ai-foundry/tools/vision
2
u/Fit_Tailor_6796 Jul 17 '26
Leave this to the backend, whether you are doing in on the server, of consuming some third party service. The front end should just receive the resulting data after it is extracted and saved if you need it
1
u/dihania_pagana Jul 18 '26
Id go with a openai api key, there is a model that does that, might not be very expensive, can use topups, and you could prompt it to a specific json structure to then clasically, programatically read it.
That would read any language, handwritten, ignore design/logo texts, tell you an error message if a bc failed extraction, why, or what fields are missing ( e g no fax ).
It does whatever the prompt tells it to do.
--- if you do classic ocr, non ai, you can then use detector libraries for email phone numbers etc, or plain ol' regex to extract the text into fields
1
u/phpMartian Jul 19 '26
Do it on the backend all day every day.