The bad news is you cant place a new object outside the pasteboard.
The good news is you can move it there...
var myTextFrame=mDoc.spreads.item(0).textFrames.item(0), mPlace = [ myTextFrame.geometricBounds, myTextFrame.geometricBounds ]; myTextFrame.move([0,0]); myTextFrame.place(File("/C/temp/1.jpg")); myTextFrame.move(mPlace);
Thanks Jump_Over for reply.
It work for me.
But I am not understand that text is insert in text frame (while Text frame start from outside of the pasteboard )but image is not place.
Thanks once again.
@Jarek – Ok. First I had trouble recreating the situation. Perhaps I had misunderstood.
Now: in case the upper left x/y coordinates of the text frame are outside the pasteboard an error will be thrown…
So, moving the object to 0/0 would be a good approach.
A different solution would be to expand the pasteboard so that the upper x/y coordinates of the text frame would fit on the pasteboard (perhaps the text frame is locked or part of a table cell, then you cannot move the text frame).
@Bill – in the moment you place the image the text frame no longer is a text frame, but an ordinary rectangle (or what ever shape it had before).
You can also place an image to an insertion point of the text frame (or the parent story) as an inline graphic without loosing the contents.
Or you could add a rectangle to an insertion point and place the image there giving some fit attributes to the container (e.g.: myRectangle.fit(FitOptions.PROPORTIONALLY).
Thanks Laubender for your reply.