An image forming apparatus includes a transfer unit that transfers an image onto an object by making contact with the object; an attachment table to which the object is attached and that changes a height thereof in accordance with force by which the transfer unit makes contact with the object; and a transport unit that transports the attachment table to which the object has been attached along a transport path.