'How to find whether the text overlaps with the overlay in a PDF

I am using PDF box version 2.0.25 to manipulate pdf files. I add overlays to the pdf files. These overlays consists of various texts, images and shapes. And I want to check whether they overlap with the existing texts and images of the pdf.

I have found a way to extract the images and text locations of the PDF. But I am unable to find a way to extract overlay information. Can you please help?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source