Patent ID: 8040553

Claim:
An image forming apparatus that performs booklet printing, comprising: at least one processor; a storage device; and memory storing computer-readable instructions that, when executed, cause the at least one processor to provide: an information acquisition device that acquires a total number of pages of image data to be printed; an image data acquisition device that sequentially acquires the image data by page unit from a first page to a last page and stores, in the storage device, the acquired image data; a determination device that determines whether the image data for (2N+2) pages or above are stored in the storage device upon each acquisition of the image data, wherein N is a positive integer corresponding to a number of sheets necessary for booklet printing of the acquired total number of pages; an execution device that sequentially causes execution of printing of the image data for four pages to be printed on one and same sheet as collected, when it is determined by the determination device that the image data for (2N+2) pages or above are stored in the storage device; and a clearance device that clears a storage area of the storage device which stores the image data for which execution of printing has been caused by the execution device, wherein the image data acquisition device is configured to interrupt the data acquisition when storage of the image data by the storage device is not possible, and wherein the image data acquisition device is further configured to restart the interrupted data acquisition when the storage area is cleared by the clearance device.