A built-in distance sensor constantly measures the distance to the marking location and focuses on that location. By tracking unintentional deviation in the height or inclination of the target, marking defects can be prevented over the entire marking area.