A substrate processing apparatus of the present invention has a retaining base
which retains a substrate, a device detecting undulation or thickness unevenness,
and a control device which operates the detecting device. The substrate is deformed
in a range of a field to be processed, by locally displacing the retaining base
on the basis of the detected undulation or thickness unevenness of the substrate.
Blurring of an image formed on the substrate can be thereby prevented.