an image forming apparatus includes a print data receiving unit that receives print data designating black as a color material for printing a code information portion ; a discriminating unit that discriminates as to whether or not black as a color material is in a usable state ; a print data generation unit that generates , when the discriminating unit discriminates that the color material of black is not the usable state , the print data that changes a designation of the color material of black as to the code information portion of the print data received by the print data receiving portion into a designation of other color material enabling the code information to be read by a code information reading apparatus ; and an image forming unit that forms an image by the print data thus changed by the print data generation unit .