Results 1 to 4 of 4
  1. #1
    greenhorn is offline Member
    Join Date
    Feb 2011
    Posts
    22
    Rep Power
    0

    Default Create power point slide and post text on it

    Hello,
    I have tried to create a power point slide and place some text on it with Java and now I have pieces of code I need to bring together.

    Create a slide:
    [JAVA]

    import org.apache.poi.hslf.HSLFSlideShow;
    import org.apache.poi.hslf.model.Slide;
    import org.apache.poi.hslf.usermodel.SlideShow;
    import java.io.*;
    public class createNewPersentation
    {
    public static void main(String str[])
    {
    try{
    SlideShow slideShow = new SlideShow();
    Slide slide = slideShow.createSlide();
    FileOutputStream out = new FileOutputStream("slideshow.ppt");
    slideShow.write(out);
    out.close();
    }catch(Exception e){}}
    }[/JAVA]

    Create a title and place text:

    [JAVA]
    import org.apache.poi.hslf.HSLFSlideShow;
    import org.apache.poi.hslf.model.Slide;
    import org.apache.poi.hslf.usermodel.SlideShow;
    import java.io.*;

    import org.apache.poi.hslf.model.TextBox;


    class setSlideTitle
    {
    public static void main(String a[])
    {
    try
    { SlideShow slideShow = new SlideShow();
    Slide slide = slideShow.createSlide();
    TextBox title = slide.addTitle();
    title.setText("First Titel");
    getRichTextRuns()[0];
    richtextrun.setFontSize(32);
    richtextrun.setFontName("Arial");
    richtextrun.setBold(true);
    richtextrun.setItalic(true);
    richtextrun.setUnderlined(true);
    richtextrun.setFontColor(Color.red);
    richtextrun.setAlignment(TextBox.AlignRight);
    FileOutputStream out = new FileOutputStream
    ("colorfulSlideTitle.ppt");
    slideShow.write(out);
    out.close();
    }catch(Exception e){}
    }

    FileOutputStream out = new FileOutputStream("slideshow.ppt");
    slideShow.write(out);
    out.close();
    }catch(Exception e){}
    }}
    [/JAVA]

    Thanks for any advice
    Greenhorn

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    First bit of advice: please give details on your problem and ask an answerable question. So far you've told us nothing about what's wrong, what's not working, etc.

  3. #3
    greenhorn is offline Member
    Join Date
    Feb 2011
    Posts
    22
    Rep Power
    0

    Default Research source

    Thanks for the advise, I will follow this in the future. For now I have found a source which can help me.
    http://www.docjar.com/docs/api/org/a...age-index.html

  4. #4
    greenhorn is offline Member
    Join Date
    Feb 2011
    Posts
    22
    Rep Power
    0

    Default Research source

    Thanks for the advise, I will follow this in the future. For now I have found a source which can help me.
    org.apache.poi.hslf.examples

Similar Threads

  1. Replies: 0
    Last Post: 08-05-2010, 03:32 PM
  2. Newbie question about slide text
    By sasho23 in forum NetBeans
    Replies: 3
    Last Post: 06-14-2010, 01:34 PM
  3. Text looks blurry at point size below 9
    By TAdamson1981 in forum Java 2D
    Replies: 1
    Last Post: 04-28-2009, 06:42 PM
  4. how to point cursor on the 1st text field in a jframe
    By VineetKumar in forum AWT / Swing
    Replies: 4
    Last Post: 04-17-2009, 03:58 PM
  5. Insert text at abitrary point in a JTextPane
    By angues in forum AWT / Swing
    Replies: 6
    Last Post: 02-02-2009, 05:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •