This content has been marked as final. Show 4 replies
If you have an anchored object that is across the spread from the anchor point, then indeed you'll get the wrong page with your line of code. And, to be quite honest, that's a challenging case to deal with.
What you could do is set the ruler origin to spread and compare the left coordinate of the object with the left coordinate of the right page to work out which page it is on.
The spread is, of course, the parent of the page, so you're almost there as far as finding it is concerned.
Thank you - however, after experimentation, I think I need a different approach. Mixed facing pages is not the only obstacle. This is a toughy!
What I am trying to do is use placeholder images in xml elements (placed during rule processing of an imported xml doc) to mark locations for other images that will be placed in a second pass. These new images will be chosen based on the tag content.
I cannot place images based on content the first time through because they end up inside the xml element, and so cannot be floated in the margin.
My first approach involved looping through all images in the document (myDocument.allGraphics) and replacing them based on the content info I recorded in the initial doc processing - this ALMOST works. Unfortunately, they are not exactly in the right order - sometimes, they are a bit off, especially when content spans multiple pages.
I tried copying the placeholders into an array the first time through - however, the images in this array do not allow access of the page information via the heirarchy above.
Is there another approach? Thanks again for helping.
The other way to get at all the graphics in a document is to use the Links collection. I'm not sure that this will do you much good though.