How do I determine 'underline' style for text?

Q: We are using PDFNet to extract PDF content. In case of text
extraction we are currently able to find it is bold or italic but
unable to find if the word or character is underline or not? Can you
please help us on this?
A: Underline style is not supported as part of a PDF font. To achieve
this effect applications draw text and then a path (i.e. a line) just
below the text. If you would like to detect 'underline' text style in
existing PDF document you would need to compare the positioning
information (element.GetBBox()) of thin horizontal lines/rectangles
(i.e. e_path) relative to text elements or words.