Code: Select all
controller = document.getCurrentController()
cursor = controller.getViewCursor()
par_enum = document.Text.createEnumeration()
while par_enum.hasMoreElements():
par = par_enum.nextElement()
cursor.gotoRange(par, False)
pos = cursor.getPosition() # pos.X and pos.Y are the paragraph's coordinates
Code: Select all
shape_enum = document.DrawPage.createEnumeration()
while shape_enum.hasMoreElements():
shape = shape_enum.nextElement()
cursor.gotoRange(shape.Anchor, False)
pos = cursor.getPosition() # pos.X and pos.Y are the paragraph's coordinates
Question: How do I get the real coordinates of a graphics? Looks like using the anchor here is imprecise?