The original problem is -
I need to move some InDesign elements form one position to the other. For this I've used ITransformFacade::TransformItems(). Everything is working fine except the case-
- If I try to move the element beyond the spread, InDesign crashes! So the problem is- HOW TO HANDLE THIS CASE?
I'm not really sure if there's a straight-forward solution to handle this case but the possible solution to this that I thought of is that- get the spread coordinates wrt the page and then do a check before moving the items.
So to get the spread coordinates wrt the page, I did this-
PMMatrix page2pb = ::InnerToPasteboardMatrix(pageGeometry); PMMatrix pb2page = page2pb.Invert();
//bounds spreadGeometry->GetPathBoundingBox(pb2page)
Now, for the first page/spread, I'm getting absolutely correct coordinates of the spread, but for the other pages I'm getting incorrect y-coordinate! I'm not really sure what wrong am I doing here!
Please guide me. Thanks!