You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by qwerty_giggi <qw...@libero.it> on 2007/01/03 15:15:36 UTC

I am writing an PowerPoint viewer....

hi.... I am writing an application java that, taken in input a file .ppt, it
allows to display it in a window similar to that used in PowerPoint. Until
now I have developed these points:
- TextBox (I have to resolve a problem on the color of the font.... there is
no match among the color of PowerPoint and that extracted by the font);
- Image;
I now have a problem with the lines..... I have not found a method to
extract the start point and the end point of the line..... the information
extracted by the anchor are not enough to be able to redraw the line.....
so.... if someone can help me..... thanks to everybody
sorry for my english....
-- 
View this message in context: http://www.nabble.com/I-am-writing-an-PowerPoint-viewer....-tf2913684.html#a8141426
Sent from the POI - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


Re[2]: I am writing an PowerPoint viewer....

Posted by Yegor Kozlov <ye...@dinom.ru>.
If a shape is not supported you will get either ShapeGroup or
AutoShape object.

Table is a group of shapes and you should get ShapeGroup.
Use ShapeGroup.getShapes() to iterate over the children.

All implemented shapes are in org.apache.poi.hslf.model.*.

What we have:
 - Line
 - TextBox
 - Picture
 - AutoShape
 - ShapeGroup is a container which can hold any of the above shapes.
 
Yegor

q> ok.....it's works well!!!
q> which are the objects that hslf doesn't recognize?I know :

q> - Tables;
q> - Custom curves.
q> which are the others? thanks a lot 
q> bye


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


Re: I am writing an PowerPoint viewer....

Posted by qwerty_giggi <qw...@libero.it>.
ok.....it's works well!!!
which are the objects that hslf doesn't recognize?I know :

- Tables;
- Custom curves.
which are the others? thanks a lot 
bye
-- 
View this message in context: http://www.nabble.com/I-am-writing-an-PowerPoint-viewer....-tf2913684.html#a8178474
Sent from the POI - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


Re: I am writing an PowerPoint viewer....

Posted by Yegor Kozlov <ye...@dinom.ru>.
Line has enough info to translate ppt commands into Java graphics calls.

The sample code is below.

    public void draw(Graphics2D graphics, Line line){
        java.awt.Rectangle anchor = line.getAnchor();
        Color color = line.getLineColor();
        if (color != null){
            graphics.setColor(color);
            float width = (float)line.getLineWidth();
            Stroke stroke = new BasicStroke(width);
            graphics.setStroke(stroke);

            EscherSpRecord spRecord = line.getSpContainer().getChildById(EscherSpRecord.RECORD_ID);
            
            boolean flipped = (spRecord.getFlags() & EscherSpRecord.FLAG_FLIPVERT) != 0;
            if (flipped)
                graphics.drawLine(anchor.x, anchor.y+anchor.height, anchor.x+anchor.width, anchor.y);
            else
                graphics.drawLine(anchor.x, anchor.y, anchor.x+anchor.width, anchor.y+anchor.height);
        }
    }

Yegor
    

q> hi.... I am writing an application java that, taken in input a file .ppt, it
q> allows to display it in a window similar to that used in PowerPoint. Until
q> now I have developed these points:
q> - TextBox (I have to resolve a problem on the color of the font.... there is
q> no match among the color of PowerPoint and that extracted by the font);
q> - Image;
q> I now have a problem with the lines..... I have not found a method to
q> extract the start point and the end point of the line..... the information
q> extracted by the anchor are not enough to be able to redraw the line.....
q> so.... if someone can help me..... thanks to everybody
q> sorry for my english....


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/