| CPC B41J 2/04556 (2013.01) [B41J 2/04541 (2013.01); B41J 2/125 (2013.01); B41J 25/304 (2013.01); B41J 2203/01 (2020.08)] | 9 Claims |

|
1. An image forming apparatus comprising:
a head to form an image on a recording medium;
a detector to detect a vertical movement of the recording medium and a distance to the recording medium in a vertical direction,
the detector including an optical sensor to project light to the recording medium and receive the light reflected from the recording medium; and
circuitry configured to:
set a first area based on a result of detection performed by the detector, the first area being an area in which the recording medium and the head collide with each other;
retract the head to prevent the recording medium and the head from colliding with each other, in a case where a position of the head is in the first area,
set, based on the result of detection performed by the detector, a second area wider than the first area and from which the head is retracted, and
retract the head, in a case where the position of the head is in the second area.
|