Unfortunately, gynecological exams aren't necessarily very comfortable for anyone! one of the most common reasons for pain with exam is that your muscles around the opening of your vagina might be very tense.
By practicing relaxation techniques
by breathing deeply or trying to relax your legs in the stirrups might help. That being said, pid can make your cervix
extra sensitive thus making the exam extremely painful. Actually, one of the symptoms of pid is a very painful exam. This should resolve once the infection is treated.