iv****@gmail.com a écrit :
[...] I am just trying to add the ability to
"search=find" (OCR-equivalent) text in image-files of articles. The
user will see the true authentic representation of the text in the
image itself.
A possible start would be:
* create a div of fixed width and height (in pixels)
* set the image as background of that div
* split the recognized text in words, or possibly in lines, create one
span per unit and position it inside the div
(using lines instead of words as unit allows the search to span
several words)
But then a simple proof of concept shows that a lot of information is
missing: do you have any way to obtain the font used in the image? How
can you make sure the end user has the same font installed, or allows
text to be as small as the text in the image?
I would go another route:
* create a div as above
* put the image in it
* write a simple FORM that lets the user enter search pattern
* write the server side code that, given that search pattern,
find all the matches and, for each match, computes a rectangle
framing the matching text, then creates a span inside the outer
div (simple border, no background to let the text shine through)
* when this is working, add some Ajax "magic" for interactivity.
Good luck!
--
Daniel Déchelotte
http://yo.dan.free.fr/