1. An image scanning device comprising: a processor that acts as: a detector that scans an image in units of pages, and detects a code image included in the image in units of pages; and a setter that sets, when the detector detects the code image on one page and then detects the code image on another page, a scanning area on a subsequent page following the other page in accordance with a position of the code image detected on the one page and a position of the code image detected on the other page, wherein, when the position of the code image detected on the one page matches the position of the code image detected on the other page or when an amount of misalignment between the position of the code image detected on the one page and the position of the code image detected on the other page is less than a predetermined amount of misalignment, the processor acting as the setter sets an area that includes the position of the code image detected on the one page and the position of the code image detected on the other page and that is smaller than a whole page as a scanning area on the subsequent page.