I can get the text, position and size of all shapes on each page of an
Impress document.
However, I need the position of individual words that are inside text-based
shapes.
How can I do this?
Laurent.
int npages = PageHelper.getDrawPageCount( xComponent );
for (int i=0;i<Math.min(2,npages);i++)
{
XDrawPage xPage = PageHelper.getDrawPageByIndex(
xComponent,i);
XShapes xShapes = (XShapes)UnoRuntime.queryInterface(
XShapes.class, xPage);
int nshapes = xShapes.getCount();
for (int j=0;j<nshapes;j++)
{
XShape xShape = (XShape)UnoRuntime.queryInterface(
XShape.class, xShapes.getByIndex( j ));
System.out.println(xShape.getShapeType());
XText xText = (XText) UnoRuntime.queryInterface(
XText.class, xShape );
System.out.println(xText.getString());
System.out.println(xShape.getPosition().X + "," +
xShape.getPosition().Y + "," + xShape.getSize().Width + "," + xShape.getSize
().Height);
}
}