Having a PharmD makes you a Doctor of Pharmacy. The Doctor is the title that comes with the qualification.
The title " Doctor," is not exclusive to one profession.
However, a medical doctor can simply say "I am a doctor" and, in normal everyday conversation, people understand that to mean a medical practitioner or physician. That is because the word "doctor" has become commonly associated with the medical profession.
For a pharmacist with a PharmD, you have earned a doctorate and you can use the title Dr.
But your profession is still pharmacy, and you are a pharmacist.
So when you're speaking in a professional or healthcare context, there should be no problem saying, "I am a pharmacist.", "I am a Doctor of Pharmacy.", "I am a pharmacist with a PharmD."
The problem starts when someone deliberately avoids identifying as a pharmacist and repeatedly introduces themselves simply as "a doctor" especially in situations where people will naturally assume they mean medical doctor.
For example, imagine a pharmacist saying, "I told this boy not to study pharmacy. It is my duty as a doctor to save lives."
A medical doctor is a physician/medical practitioner by profession.
A PharmD holder is a pharmacist by profession with a doctorate-level professional qualification.
Both can use the title Doctor appropriately,but they are not the same profession, they do not have the same training, and the title should not be used to blur that distinction.
Pharmacists are pharmacists.
While you can be addressed with the title "Dr" when you've earned your PharmD degree, it doesn't make you a "Doctor".
The "Dr" title in PharmD is a professional/academic title, not a medical one, you should at all times identify it as such.