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.