I'm trying to determine the (x,y) coordinates for TextRuns within a slide (so
I can figure out which one is *really* the title!). Can someone point me to
some sample code?
The code you need is in Slide#getTitle(), see
ihttp://svn.apache.org/repos/asf/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Slide.java
To test whether a shape is the title use the following code:
for(Shape sh : slide.getShapes()){
if(sh instanceof TextShape){
TextShape tx = (TextShape)sh;
TextRun run = tx.getTextRun();
int type = run.getRunType();
if (type == TextHeaderAtom.CENTER_TITLE_TYPE || type ==
TextHeaderAtom.TITLE_TYPE ){
//got title
String title = run.getText();
}
}
}
Yegor
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]