title: Adding shapes to Powerpoint slide using XSLF (Apache POI Project)
body: <p>The apache POI project explains how to read a shape from a powerpoint slide <a href="http://poi.apache.org/slideshow/xslf-cookbook.html#GetShapes" rel="nofollow">http://poi.apache.org/slideshow/xslf-cookbook.html#GetShapes</a></p>
  
  <p>However, I can't find any doc on how to add a shape to a powerpoint slide using this part of the library.  If I use an old powerpoint format (ppt as opposed to pptx), I can just use the hslf part of the libaray and do: </p>
  
  <pre><code>SlideShow ppt = new SlideShow();
  //add first slide
  Slide s1 = ppt.createSlide();
  
  // create shapes./ 
  java.awt.geom.GeneralPath path = new java.awt.geom.GeneralPath();
  path.moveTo(100, 100);
  path.lineTo(200, 100);
  path.curveTo(50, 45, 134, 22, 78, 133);
  path.curveTo(10, 45, 134, 56, 78, 100);
  path.lineTo(100, 200);
  path.closePath();
  
  Freeform shape = new Freeform();
  shape.setPath(path);
  s1.addShape(shape);
  
  //save changes in a file
  FileOutputStream out;
  try {
      out = new FileOutputStream("slideshow.ppt");
      ppt.write(out);
      out.close(); 
  } catch (FileNotFoundException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
  } catch (IOException ex) {
      e.printStakTrace();
  }
  </code></pre>
  
  <p>How would I do something similar using xlsf part of the library and thus generate a pptx?</p>
  
  <p>Thanks</p>