poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yegor Kozlov <ye...@dinom.ru>
Subject Re: HSLF 3.1-beta1 problem
Date Fri, 09 May 2008 08:56:17 GMT
It is correct.
Placeholders in PowerPoint have type=Rectangle unlike normal text
 which has type=TextBox. In 3.0.2 there was a hack to create TextBox
 in both cases. In the version 3.1 it was removed.

If you need to access text, cast shapes to TextShape, not to TextBox.
Both AutoShape and TextBox are subclasses of TextShape.

Yegor
 
> I've encountered following problem with poi-3.1-beta1-20080428:

> I have a simple one-slide presentation with a heading and a bullet list
> (i.e. one of the default layouts).
> Then I'll execute following code:
> ------
> import java.io.*;
> import org.apache.poi.hslf.model.Shape;
> import org.apache.poi.hslf.model.Slide;
> import org.apache.poi.hslf.usermodel.SlideShow;

> public class Main {

>         public static void main(String[] args) throws Exception {
>                 
>                 FileInputStream inputStream = new
> FileInputStream("/path/to/my/slideshow.ppt");
>                 SlideShow slideshow = new SlideShow(inputStream);
>                 for (Slide slide : slideshow.getSlides()) {
>                         for (Shape shape : slide.getShapes()) {
>                                 System.out.println(shape.toString());
>                         }
>                 }
>     }
> }
> ------
> Using 3.1-beta1 the result is:
> org.apache.poi.hslf.model.AutoShape@a18aa2
> org.apache.poi.hslf.model.AutoShape@194ca6c

> which is incorrect in my opinion. 

> Previous version (3.0.2) gives:
> org.apache.poi.hslf.model.TextBox@f5da06
> org.apache.poi.hslf.model.TextBox@bd0108


> Tomas


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Mime
View raw message