Skip to main content
BEGINNER_X
Legend
December 16, 2016
Question

Find Image Name

  • December 16, 2016
  • 4 replies
  • 1399 views

Hi All,

Is it possible to find the Image Name for behind the selection text frame?

My output or alert should be "bcd.tif".

Regards

Siraj

This topic has been closed for replies.

4 replies

Trevor:
Legend
December 30, 2016

See here for an answer Re: find text frame behind rectange

Stefan Rakete
Inspiring
December 20, 2016

Hi,

get all TextFrames on the spread, get all Images on the spread and then check which textframe is above an image

by comparing the bounds:

if ( textGB[0] >= imgGB[0]

         && textGB[1] >= imgGB[1]

         && textGB[2] <= imgGB[2]

         && textGB[3] <= imgGB[3]) {

Does the textframe need to be completly on the image or is it valid also if it only overlaps ?

Thanks Stefan

Peter Kahrel
Community Expert
Community Expert
December 17, 2016

Kartik -- The link you gave doesn't really answer the question. That link is about stacking order (and misses the simple solution that the frame with the lower index is on top). Siraj want to find the image that's behind the selected text frame, and that can be done by comparing the geometric bounds, as Jarek suggested in that same thread. (For stacking order, see [JS] :: [CSX] - PageItem Stacking Order.

Peter

tpk1982
Legend
December 18, 2016

Hello Peter,

Yes the link is not a direct answer for Siraj. But i thought he may get some ideas how to approach...

tpk1982
Legend
December 17, 2016