Java Program to Create a Blank PPT Document
Last Updated :
04 Jul, 2021
Program to create a blank PPT document using Java. The external jar(Java archive) file is required for the creation of a new PPT document. Below is the implementation for the same. An object of XMLSlideShow class inside External Apache POI module is required for the creation of a new PPT.
Algorithm:
- Created using the APACHE POI module.
- Creating a new empty slide show by creating an object of XMLSlideShow class.
- Creating a FileOutputStream object.
- After that writing the changes to the file.
Note: External files are required to download for performing the operation. For more documentation of the module used refer to this.
Implementation:
Java
import org.apache.poi.xslf.usermodel.XMLSlideShow;
import java.io.*;
class GFG {
public static void main(String[] args)
throws IOException
{
XMLSlideShow PPT = new XMLSlideShow();
File newFile = new File( "GeeksforGeeks.pptx" );
FileOutputStream output
= new FileOutputStream(newFile);
PPT.write(output);
System.out.println(
"Blank PPT has been created successfully" );
output.close();
}
}
|
Output:
Share your thoughts in the comments
Please Login to comment...