An image forming apparatus comprising an image forming unit configured to form an image on a recording medium; an adjustment unit (130, 2090) configured to adjust a condition for image formation, based on an output from a sensor device; a printer housing 2200; an operation panel; and the sensor device comprising: a light source; a photo-detection system configured to receive light emitted from the light source and reflected at a sheet-like object, whereby such a recording medium is the object; and a holding member (140, 170, 174, 176) configured to hold the object such that relative positions of a surface of the object inserted into the sensor device and the photo-detection system are fixed; the sensor device further comprises a housing, having an inner space accommodating the light source, the photo-detection system and the holding member (140, 170, 174, 176); characterized in that: the sensor device is detached from the printer housing and is disposed near an operation panel, such that an operator can pick it up with his/her hand; the housing of the sensor device comprises a -X side surface, a -Y side surface and a +Y side surface in a XYZ Cartesian coordinate system, and has a slit into which the object is inserted, the slit being formed in the -X side surface, having a prescribed length in the X-direction and penetrating to the -Y side surface and the +Y side surface of the housing; and the sensor device is configured such that the sheet-like object can be inserted into the slit in a + X-direction by an operator holding the sheet-like object with both hands and applying tension in the +Y and -Y directions to the sheet-like object. a light source; a photo-detection system configured to receive light emitted from the light source and reflected at a sheet-like object, whereby such a recording medium is the object; and a holding member (140, 170, 174, 176) configured to hold the object such that relative positions of a surface of the object inserted into the sensor device and the photo-detection system are fixed; the sensor device further comprises a housing, having an inner space accommodating the light source, the photo-detection system and the holding member (140, 170, 174, 176); characterized in that: the sensor device is detached from the printer housing and is disposed near an operation panel, such that an operator can pick it up with his/her hand; the housing of the sensor device comprises a -X side surface, a -Y side surface and a +Y side surface in a XYZ Cartesian coordinate system, and has a slit into which the object is inserted, the slit being formed in the -X side surface, having a prescribed length in the X-direction and penetrating to the -Y side surface and the +Y side surface of the housing; and the sensor device is configured such that the sheet-like object can be inserted into the slit in a + X-direction by an operator holding the sheet-like object with both hands and applying tension in the +Y and -Y directions to the sheet-like object. the sensor device is detached from the printer housing and is disposed near an operation panel, such that an operator can pick it up with his/her hand; the housing of the sensor device comprises a -X side surface, a -Y side surface and a +Y side surface in a XYZ Cartesian coordinate system, and has a slit into which the object is inserted, the slit being formed in the -X side surface, having a prescribed length in the X-direction and penetrating to the -Y side surface and the +Y side surface of the housing; and the sensor device is configured such that the sheet-like object can be inserted into the slit in a + X-direction by an operator holding the sheet-like object with both hands and applying tension in the +Y and -Y directions to the sheet-like object.