You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Tomas Machalek <to...@gmail.com> on 2008/05/08 14:23:10 UTC
HSLF 3.1-beta1 problem
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
--
View this message in context: http://www.nabble.com/HSLF-3.1-beta1-problem-tp17124921p17124921.html
Sent from the POI - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org
Re: HSLF 3.1-beta1 problem
Posted by Yegor Kozlov <ye...@dinom.ru>.
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