1. A method for performing optical character recognition on an image of a document, comprising: receiving the image of the document; identifying a plurality of text areas in the document, wherein each of the plurality of text areas corresponds to a continuous set of non-whitespace characters detected in the document; identifying a midpoint of each of the plurality of text areas in the document wherein the identified midpoint of each of the plurality of text areas has a pixel coordinate location in a two-dimensional space; detecting one or more lines of text in the document, wherein each of the one or more lines of text comprises a set of text areas having midpoints with a vertical pixel coordinate located within a threshold number of pixels on a vertical axis in the two-dimensional space or a horizontal pixel coordinate located within a threshold number of pixels on a horizontal axis in two-dimensional space; determining a probable orientation of the document based on an orientation of the detected one or more lines of text, wherein the probable orientation indicates that lines of text in the document are oriented parallel with a vertical axis or a horizontal axis; and extracting text from the image based on the determined probable orientation of the document.