Package slides.hyperlink

Source Code of slides.hyperlink.ApacheHyperlink

package slides.hyperlink;

import java.io.FileOutputStream;

import org.apache.poi.xslf.usermodel.XMLSlideShow;
import org.apache.poi.xslf.usermodel.XSLFHyperlink;
import org.apache.poi.xslf.usermodel.XSLFSlide;
import org.apache.poi.xslf.usermodel.XSLFTextBox;
import org.apache.poi.xslf.usermodel.XSLFTextRun;

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.");

  }
}
TOP

Related Classes of slides.hyperlink.ApacheHyperlink

TOP
Copyright © 2018 www.massapi.com. 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.