For a future synchrotron light source based on a linac, e.g. an X-ray free electron laser and an energy recovery linac (ERL), an injector is a key component to generate a high brightness electron beam. For the acceleration and transportation of the electron beam in the injector, the adjustment of beam orbit inside the cavity is important to avoid the deterioration of the beam quality due to the transverse electric field of it, which causes the transverse emittance growth. To adjust the beam orbit, an investigation of the electromagnetic center of the cavity is required in the beam operation. This paper shows a new method for measuring the electromagnetic center of the cavity, and describes an analytical model of emittance growth due to a combination of transverse electric field and orbit offset. The validation of the method was confirmed by the emittance measurement in the compact ERL (cERL) injector at KEK.