Create Presentations in Java
Overview
This article shows how to create a presentation in Aspose.Slides, add simple content to a slide, and save the result as a file. It also demonstrates how to create and save a new presentation, open an existing presentation in a supported format, and save it to another format. In addition, the article includes a short FAQ covering common questions related to formats, templates, slide sizing, units, memory usage, threading, licensing, digital signatures, and VBA support.
Create a Presentation
Creating a PowerPoint file from scratch in Aspose.Slides for Java is as direct as instantiating the Presentation class. The constructor automatically supplies a blank deck with a single slide, giving you an immediate canvas for shapes, text, charts, or any other content your application needs. Once you modify that slide—or add new ones—you can persist the result to PPTX, legacy PPT, or even OpenDocument formats. The short code sample below illustrates this workflow by adding a simple shape onto the first slide.
- Create an instance of the Presentation class.
- Get a reference to the slide by its index.
- Add an IAutoShape object of
Cloudtype using theaddAutoShapemethod exposed by theShapescollection. - Add text to the auto-shape.
- Save the modified presentation as a PPTX file.
In the example below, a cloud shape is added to the first slide of the presentation.
// Instantiate the Presentation class that represents a presentation file.
Presentation presentation = new Presentation();
try {
// Get the first slide.
ISlide slide = presentation.getSlides().get_Item(0);
// Add an auto-shape of type Cloud.
IAutoShape autoShape = slide.getShapes().addAutoShape(ShapeType.Cloud, 20, 20, 200, 80);
autoShape.getTextFrame().setText("Hello, Aspose!");
// Save the presentation as a PPTX file.
presentation.save("new_presentation.pptx", SaveFormat.Pptx);
} finally {
presentation.dispose();
}
The result:

FAQ
What formats can I save a new presentation to?
You can save to PPTX, PPT, and ODP, and export to PDF, XPS, HTML, SVG, and images, among others.
Can I start from a template (POTX/POTM) and save as a regular PPTX?
Yes. Load the template and save to the desired format; POTX/POTM/PPTM and similar formats are supported.
How do I control slide size/aspect ratio when creating a presentation?
Set the slide size (including presets like 4:3 and 16:9 or custom dimensions) and choose how content should scale.
In what units are sizes and coordinates measured?
In points: 1 inch equals 72 units.
How do I handle very large presentations (with many media files) to reduce memory usage?
Use BLOB management strategies, limit in-memory storage by leveraging temporary files, and prefer file-based workflows over purely in-memory streams.
Can I create/save presentations in parallel?
You cannot operate on the same Presentation instance from multiple threads. Run separate, isolated instances per thread or process.
How do I remove the trial watermark and limitations?
Apply a license once per process. The license XML must remain unmodified, and the license setup should be synchronized if multiple threads are involved.
Can I digitally sign the PPTX I create?
Yes. Digital signatures (adding and verifying) are supported for presentations.
Are macros (VBA) supported in created presentations?
Yes. You can create/edit VBA projects and save macro-enabled files such as PPTM/PPSM.