Friday, May 8, 2026
HomeLanguagesJavaJava Program to Create a Blank PPT Document

Java Program to Create a Blank PPT Document

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




// Creating a blank PPT document using java
import org.apache.poi.xslf.usermodel.XMLSlideShow;
import java.io.*;
 
class GFG {
    public static void main(String[] args)
        throws IOException
    {
        // Creating a new empty slide show
        // by creating an object of XMLSlideShow class.
        XMLSlideShow PPT = new XMLSlideShow();
 
        // Creating a FileOutputStream object
        File newFile = new File("Lazyroar.pptx");
        FileOutputStream output
            = new FileOutputStream(newFile);
 
        // After that writing
        // the changes to the file.
        PPT.write(output);
        System.out.println(
            "Blank PPT has been created successfully");
        output.close();
    }
}


 

 

Output:

 

 

Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

1 COMMENT

Most Popular

Dominic
32514 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
6892 POSTS0 COMMENTS
Nicole Veronica
12012 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12107 POSTS0 COMMENTS
Shaida Kate Naidoo
7016 POSTS0 COMMENTS
Ted Musemwa
7262 POSTS0 COMMENTS
Thapelo Manthata
6975 POSTS0 COMMENTS
Umr Jansen
6962 POSTS0 COMMENTS