How can i detect if an element is hidden in the pdf?

I´m trying export the vectors and graphics in two diferents images, but I have a problem with this.

How can i detect if an text-element is hidden ?
e.g. discard an text element if an image is over that element, maybe detecting the layer-number or z-index of the element.

I´m develop in c++


while ((element = reader.Next()) != 0)



Thank you.
Best regards,
Emmanuel García.