You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by jaime <jg...@kfussion.com> on 2011/01/04 12:58:11 UTC

XSLF example

Hi,

I'm getting some trouble trying to open pptx files, does anyone have some
quick guide to start in???

Thanks  
-- 
View this message in context: http://apache-poi.1045710.n5.nabble.com/XSLF-example-tp3326884p3326884.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: XSLF example

Posted by jaime <jg...@kfussion.com>.
The problem is that I made this method to display a ppt file 

 public ImageIcon display() throws JPresentationException {

        Background background;
        background = slides[current].getBackground();
        Fill f = background.getFill();
        Color color = f.getForegroundColor();
        Dimension dimension = ppt.getPageSize();
        shapes = slides[current].getShapes();
        BufferedImage img = new BufferedImage(dimension.width,
dimension.height, BufferedImage.TYPE_INT_RGB);
        Graphics2D graphics = img.createGraphics();
        graphics.setPaint(color);
        graphics.fill(new Rectangle2D.Float(0, 0, dimension.width,
dimension.height));
        slides[current].draw(graphics);
        ImageIcon icon = new ImageIcon(img);
                
        return icon;
}

but now I intend to open pptx files so I change some types and the rest
works just fine (xslf instead of hslf) but the problem remain in the display
method cause I'm unable to display anything 

thanks  
-- 
View this message in context: http://apache-poi.1045710.n5.nabble.com/XSLF-example-tp3326884p3327624.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: XSLF example

Posted by Mark Beardsley <ma...@tiscali.co.uk>.
I do not know if this will help at all, but you can look at the testcode the
developers use to prove the api here -
http://svn.apache.org/repos/asf/poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/.

You will see that there are only two test cases and of these, I think the
TestXSLFPowerPointExtractor.java class will propably be the better place to
start (that class is in the extractor sub-folder by the way).

After that, it is best to post again with specific questions you may have as
that way it will be easier for the other list users to help you out.

Yours

Mark B
-- 
View this message in context: http://apache-poi.1045710.n5.nabble.com/XSLF-example-tp3326884p3327291.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