Copy link to clipboard
Copied
Hi Everyone,
How to anchor the images in the same page using javascript. Please help me!!!
Thanks,
Magesh
Hi Magesh,
let's assume you want to anchor a rectangle to a text insertion point.
Study the method insertAnchoredObject() of the anchoredObjectSettings of a rectangle object:
Basically you need an insertion point and the rectangle, that contains the image you want to anchor.
Let's assume you selected the text frame with the mouse first and added the rectangle to your selection.
Then the f
...Copy link to clipboard
Copied
Hi Magesh,
you can anchor graphic frames to text. And you can move around text frames in your document. The anchored frames will move along. What you cannot do: Anchor a graphic frame so that it is visible on one spread but it is anchored to a text on a different spread.
That are some basics. I have no idea what you exactly like to do.
Show some screenshots with a before and after situation.
And explain better, please. What do you mean by "same page" for example? "same" like what?
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
Hi Laubender,
Thanks for your reply!!
My question is very simple. InDesign document has the image without an anchor. So we need to provide the anchor to near text (same page or spread) using script.
Thanks,
Magesh
Copy link to clipboard
Copied
Hi Magesh,
let's assume you want to anchor a rectangle to a text insertion point.
Study the method insertAnchoredObject() of the anchoredObjectSettings of a rectangle object:
Basically you need an insertion point and the rectangle, that contains the image you want to anchor.
Let's assume you selected the text frame with the mouse first and added the rectangle to your selection.
Then the following will work:
var myTextFrame = app.selection[0];
var myInsertionPoint = myTextFrame.insertionPoints[0];
var myRectangle = app.selection[1];
myRectangle.anchoredObjectSettings.
insertAnchoredObject
(
myInsertionPoint ,
AnchorPosition.ANCHORED
);
Regards,
Uwe Laubender
( ACP )
// EDITED CODE: AnchorPosition.ANCHORED is needed instead of AnchorPosition.Anchored.