Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Java Poi Change Size of PowerPoint Slide Using Java

Related Tutorials


 
 

Share on Google+Share on Google+

Change Size of PowerPoint Slide Using Java

Advertisement
In this example we are going to create a slide then change the size of the slide.

Change Size of PowerPoint Slide Using Java

     


In this example we are going to create a slide then change the size of the slide.

setPageSize(java.awt.Dimension pgsize):
This method is used to change the size current page. The size of page is passed as parameter in this method. The return type is void. This method is defined as public in SlideShow class.

 

 


  
 The code of the program is given below:

import org.apache.poi.hslf.HSLFSlideShow;
import org.apache.poi.hslf.model.Slide;
import org.apache.poi.hslf.usermodel.SlideShow;
import java.io.*;
class changeSlideSize{
  public static void main(String a[])
  {
  try{
SlideShow slideShow = new SlideShow(new HSLFSlideShow
(
"slideshow.ppt"));
  java.awt.Dimension pgsize = slideShow.
getPageSize
();
  slideShow.setPageSize(new java.awt.Dimension
(
800600));
 FileOutputStream out = new FileOutputStream
(
"changeSize.ppt");
  slideShow.write(out);
  out.close();
  }
  catch(Exception we){}
  }
}

The output of the program is given below:

Download this example.

Advertisement

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: March 14, 2008

Related Tutorials

Discuss: Change Size of PowerPoint Slide Using Java  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0
DMCA.com