Example usage for org.apache.poi.xslf.usermodel XSLFTextShape setAnchor

List of usage examples for org.apache.poi.xslf.usermodel XSLFTextShape setAnchor

Introduction

In this page you can find the example usage for org.apache.poi.xslf.usermodel XSLFTextShape setAnchor.

Prototype

@Override
    public void setAnchor(Rectangle2D anchor) 

Source Link

Usage

From source file:poi.xslf.usermodel.Tutorial3.java

License:Apache License

public static void main(String[] args) throws IOException {
    XMLSlideShow ppt = new XMLSlideShow();

    XSLFSlide slide = ppt.createSlide();

    XSLFTextShape titleShape = slide.createTextBox();
    titleShape.setPlaceholder(Placeholder.TITLE);
    titleShape.setText("This is a slide title");
    titleShape.setAnchor(new Rectangle(50, 50, 400, 100));

    FileOutputStream out = new FileOutputStream("title.pptx");
    ppt.write(out);//from   w w  w.  ja va2s  . c o  m
    out.close();
}