Scan a paper from a picture in JavaScript