"How do you do" is a formal greeting used in the same way as "It's a pleasure to meet you" or "Pleased to meet you." In a casual situation it would be better to say "It's nice to meet you" or just "Hello." I hope this helps.