Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 11th, 2012  |  syntax: None  |  size: 1.35 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. private static void testSlideBG() throws IOException {
  2.                
  3.                 File pptFile = new File("/home/rdpatel/data/user/urvish/testAll.ppt");
  4.                 Presentation pres = new Presentation(new FileInputStream(pptFile));
  5.                 FileOutputStream fos;
  6.                 for (int i = 0; i < pres.getSlides().size(); i++) {
  7.                         // Shapes shapes =pres.getSlides().get(i).getShapes();
  8.                         // for(int j=0;j<shapes.size(); j++){
  9.                         fos = new FileOutputStream("/home/rdpatel/Desktop/Slide_" + i + ".png");
  10.                         try {
  11.                                 // fos.write(pres.getPictures().getPictureById(pres.getSlides().get(i).getBackground().getShapeId()).getImage());
  12.                                 System.out.println("Master shapeID:" + pres.getSlides().get(i).getBackground().getMasterShapeId());
  13.                                 System.out.println("shapeID:" + pres.getSlides().get(i).getBackground().getFillFormat());
  14.                                 System.out.println("isFollowMasterBG:" + pres.getSlides().get(i).isFollowMasterBackground());
  15.                                 //fos.write(pres.getPictures().getPictureById(pres.getSlides().get(i).getSlidePosition()).getImage());
  16.                         } finally {
  17.                                 fos.close();
  18.                         }
  19.                         // }
  20.                 }
  21.                 System.out.println("--------------------------");
  22.                 for (int i = 0; i < pres.getPictures().size(); i++) {
  23.                         Picture picture = pres.getPictures().get(i);
  24.                         System.out.println("Pic ID: " + pres.getPictures().get(i).getPictureId());
  25.                 }
  26.         }
  27.        
  28.         public static void main(String[] args) throws IOException {
  29.                 testSlideBG();
  30.         }