MyScript offers an API that does this. You need to feed it all the motions/sequence of points that make up the shape (known as "online OCR"), it won't work with a static document.
Like a9t9 said, ABBYY, Microsoft and Google offer this.
If your images however differ from the typical text document, recognition from those services will fail. OCR is highly dependent on the particular application and the kind of images that you're dealing with. Preprocessing and segmentation are very important.
If you need a custom solution, my email is in my profile.