Hi, I have the following code which places a PDF inside a rectangle var f = new File("C:/pdf.pdf"); var doc = app.activeDocument; var thepdf =doc.pages.rectangles.place(f, false); doc.pages.rectangles.fit(FitOptions.FILL_PROPORTIONALLY); Now I want to move "thepdf" (which is of object type PDF) but I can only find a way to move the rectangle around it. I need to move the inner rectangle (the PDF), like I would do with the Direct selection tool. is this possible?
Yes. That's possible.
The PDF placed inside the rectangle is the graphics object of the rectangle.
Or, if you look it up in the links collection, the parent of that link. The parent of that parent is the container object, the rectangle.
myRectangle.graphics.move(/*insert your arguments here*/)
Would move the PDF inside. Where the move() method could have different arguments:
Works like charm. Thank you very much!