1. A computer implemented method for scanning a document, the computer implemented method comprising: detecting a document placed on a scanning surface of a scanning device; detecting a residue deposited on the document; determining a portion of the document to be scanned based on a location of the residue on the document; and scanning the portion of the document; wherein determining a portion of the document to be scanned based on a location of the residue on the document further comprises: determining whether the residue on the document forms an enclosed area; responsive to determining that the residue of the document forms an enclosed area, determining the portion of the document to be scanned using the enclosed area; and responsive to determining that the residue of the document does not form an enclosed area, determining the portion of the document to be scanned using a proximity algorithm, wherein the proximity algorithm specifies that the portion of the document to be scanned is located outside of a particular circumference of the residue using a virtual polygon that is formed using the unenclosed area to define the particular circumference.