I want to remove a hidden space in PDF using PDF lib.

When I extract a word "Gregor" in PDF it comes out as "Gre gor", but I really want it like "Gregor".

What could be reasons for this? Or, how can I avoid those "hidden spaces"?