A nontransitory computer-readable storage medium storing thereon a computer program executed by a computer provided in an image forming apparatus that produces an integrated duplicate by printing images of a plurality of documents on a single sheet of recording paper or a plurality of continuously-fed sheets of recording paper, the computer program, when read and executed by the computer, causing the image forming apparatus to implement:
- a first portion that reads each of the documents and obtains image data corresponding thereto;
- a second portion that detects identification codes included in the documents from individual pieces of the image data;
- a third portion that extracts the image data including the identification codes that are identical with one another;
- and
- a fourth portion that keeps at least one of the identification codes which are included in the image data extracted by the third portion and deletes the identification codes other than said at least one of the identification codes.