Package org.apache.poi.xslf.usermodel

Examples of org.apache.poi.xslf.usermodel.XMLSlideShow


public class ApacheAddLayoutSlides
{
  public static void main(String[] args) throws Exception
  {
    XMLSlideShow ppt = new XMLSlideShow(new FileInputStream("data/presentation.pptx"));

      // blank slide
      ppt.createSlide();

      // there can be multiple masters each referencing a number of layouts
      // for demonstration purposes we use the first (default) slide master
      XSLFSlideMaster defaultMaster = ppt.getSlideMasters()[0];

      // title slide
      XSLFSlideLayout titleLayout = defaultMaster.getLayout(SlideLayout.TITLE);
      // fill the placeholders
      XSLFSlide slide1 = ppt.createSlide(titleLayout);

      // title and content
      XSLFSlideLayout titleBodyLayout = defaultMaster.getLayout(SlideLayout.TITLE_AND_CONTENT);
      XSLFSlide slide2 = ppt.createSlide(titleBodyLayout);

      FileOutputStream out = new FileOutputStream("data/Apache_Layouts.pptx");
    ppt.write(out);
    out.close();
   
    System.out.println("Layout slides created Successfuly.");
  }
View Full Code Here


public class ApacheMoveSlides
{
  public static void main(String[] args) throws Exception
  {
    XMLSlideShow ppt = new XMLSlideShow(new FileInputStream("data/presentation.pptx"));

    //add slides
      ppt.createSlide();
      ppt.createSlide();
      ppt.createSlide();

      XSLFSlide[] slides = ppt.getSlides();
      ppt.setSlideOrder(slides[0], 4);
     
      //save changes in a file
      FileOutputStream out = new FileOutputStream("data/Apache_ReOrdered_Slides.pptx");
      ppt.write(out);
      out.close();
     
    System.out.println("Slides ReOrdered Successfuly.");
  }
View Full Code Here

public class ApacheHyperlink
{
  public static void main(String[] args) throws Exception
  {
    XMLSlideShow ppt = new XMLSlideShow();
      XSLFSlide slide = ppt.createSlide();

    
      // assign a hyperlink to a text run
      XSLFTextBox shape = slide.createTextBox();
      XSLFTextRun r = shape.addNewTextParagraph().addNewTextRun();
      r.setText("Apache POI");
      XSLFHyperlink link = r.createHyperlink();
      link.setAddress("http://poi.apache.org");
     
      //save changes
      FileOutputStream out = new FileOutputStream("data/Apache_Hyperlink.ppt");
      ppt.write(out);
      out.close();
     
    System.out.println("Presentation with hyperlink Saved.");

  }
View Full Code Here

TOP

Related Classes of org.apache.poi.xslf.usermodel.XMLSlideShow

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.