How do I detect text alignment from a PDF text block?

Q:

How can we recognize from text element if text block is align to left/center/right?

I’ve been searching this group, but found nothing about recognizing text alignment, only how to set align.