I am using PDFStripper (from PDFBox 2.0.26) to annotate (by drawing a coloured box around each relevant piece of text) an image of a PDF document.
The internal details in the TextPosition would be sufficient for the purpose, but the exposed details are not. In particular there is not way (that I have found) to get the size of a box around the text that includes the descenders. I can aggregate all the x,y,height and width data to create an overall box, but it only goes down to the baseline. The PDFont value in the TextPosition has the maximum descender depth (if I recall correctly) but is private and there is no getter either for the descender depth or the PDFont value from which it could be calculated. Have I missed something, or could the TextPosition class be extended to add access to either the descender depth, the font or preferably both?