部分
Contents
[
Hide
]
获取部分的位置坐标
getCoordinates() 方法已添加到 IPortion 和 Portion 类中,允许获取部分开头的坐标。
// 实例化表示 PPTX 的 Presentation 类
Presentation pres = new Presentation();
try {
// 重塑演示文稿的上下文
IAutoShape shape = (IAutoShape) pres.getSlides().get_Item(0).getShapes().get_Item(0);
ITextFrame textFrame = (ITextFrame) shape.getTextFrame();
for (IParagraph paragraph : textFrame.getParagraphs())
{
for (IPortion portion : paragraph.getPortions())
{
Point2D.Float point = portion.getCoordinates();
System.out.println("X: " + point.x + " Y: " + point.y);
}
}
} finally {
if (pres != null) pres.dispose();
}