Line heads are arranged along the transfer direction of a recording medium. Each line head has a nozzle surface in which nozzles are provided over a width direction of the recording medium. Purge units each corresponding to one of the line heads are arranged along the transfer direction of the recording medium at positions which deviate from the recording medium in the width direction. Each purge unit cleans the nozzle surface of a corresponding one of the line heads.