I have a text document which is in image format (PNG FILE). I want to manually highlight each sentence in that image programmatically using javascript/css. I want to use this technique on web page. Is there any idea to do that?
1 Answer
You would need to do some server-side processing with OCR to detect the location within the image where sentences start/end. Once you know that, you could use javascript and CSS to place styled divs over the image.
3 Comments
codelearner
Thanks for the reply. On server-side I am already converting text to image but I don't have idea how to keep track of location because one image can have 10 sentences and may be some sentence will be on multiple lines. How to keep its track and then create divs accordingly.
Brendan
Why not re-assess your approach. Do you really need to send back an image? Why can't you send back text and style it up regularly?
codelearner
Its because of using different font and non-english language which mobile devices doesn't support.
<canvas>element. But probably not very efficient.