Features and Capabilities
Features and Capabilities
Aspose.Slides FOSS for Java provides a broad set of capabilities for working with PowerPoint .pptx files programmatically. This page lists all supported feature areas with representative code examples.
Presentation I/O
Open an existing .pptx file or create a new one, then save back to PPTX format.
import org.aspose.slides.foss.Presentation;
import org.aspose.slides.foss.export.SaveFormat;
// Open an existing presentation
try (Presentation prs = new Presentation("input.pptx")) {
System.out.println("Slide count: " + prs.getSlides().size());
prs.save("output.pptx", SaveFormat.PPTX);
}
// Create a new presentation (starts with one blank slide)
try (Presentation prs = new Presentation()) {
prs.save("new.pptx", SaveFormat.PPTX);
}Note: PPTX is the only supported save format. Export to PDF, HTML, SVG, or images is not available.
Unknown XML parts in the source file are preserved verbatim on save, so opening and re-saving a .pptx will never strip content the library does not yet understand.
Slides Management
Add, remove, clone, and reorder slides.
import org.aspose.slides.foss.Presentation;
import org.aspose.slides.foss.export.SaveFormat;
try (Presentation prs = new Presentation()) {
// Access the first slide
var slide = prs.getSlides().get(0);
// Add an additional blank slide at the end
prs.getSlides().addEmptySlide(prs.getLayoutSlides().get(0));
System.out.println("Total slides: " + prs.getSlides().size());
prs.save("multi-slide.pptx", SaveFormat.PPTX);
}Shapes
Add AutoShapes, PictureFrames, Tables, and Connectors to a slide.
AutoShapes
import org.aspose.slides.foss.Presentation;
import org.aspose.slides.foss.ShapeType;
import org.aspose.slides.foss.export.SaveFormat;
try (Presentation prs = new Presentation()) {
var slide = prs.getSlides().get(0);
// Add a rectangle at (x=50, y=50) with width=300, height=100
var shape = slide.getShapes().addAutoShape(ShapeType.RECTANGLE, 50, 50, 300, 100);
shape.addTextFrame("Aspose.Slides FOSS");
prs.save("shapes.pptx", SaveFormat.PPTX);
}Tables
import org.aspose.slides.foss.Presentation;
import org.aspose.slides.foss.export.SaveFormat;
try (Presentation prs = new Presentation()) {
var slide = prs.getSlides().get(0);
// Column widths and row heights in points
double[] colWidths = {120.0, 120.0, 120.0};
double[] rowHeights = {40.0, 40.0, 40.0};
var table = slide.getShapes().addTable(50, 50, colWidths, rowHeights);
table.getRows().get(0).get(0).getTextFrame().setText("Product");
table.getRows().get(0).get(1).getTextFrame().setText("Quantity");
table.getRows().get(0).get(2).getTextFrame().setText("Price");
prs.save("table.pptx", SaveFormat.PPTX);
}Connectors
import org.aspose.slides.foss.Presentation;
import org.aspose.slides.foss.ShapeType;
import org.aspose.slides.foss.export.SaveFormat;
try (Presentation prs = new Presentation()) {
var slide = prs.getSlides().get(0);
var box1 = slide.getShapes().addAutoShape(ShapeType.RECTANGLE, 50, 100, 150, 60);
var box2 = slide.getShapes().addAutoShape(ShapeType.RECTANGLE, 350, 100, 150, 60);
var conn = slide.getShapes().addConnector(ShapeType.BENT_CONNECTOR3, 0, 0, 10, 10);
conn.setStartShapeConnectedTo(box1);
conn.setStartShapeConnectionSiteIndex(3); // right side
conn.setEndShapeConnectedTo(box2);
conn.setEndShapeConnectionSiteIndex(1); // left side
prs.save("connector.pptx", SaveFormat.PPTX);
}Text Formatting
Format text at paragraph and character level using PortionFormat.
import org.aspose.slides.foss.Presentation;
import org.aspose.slides.foss.ShapeType;
import org.aspose.slides.foss.NullableBool;
import org.aspose.slides.foss.FillType;
import org.aspose.slides.foss.drawing.Color;
import org.aspose.slides.foss.export.SaveFormat;
try (Presentation prs = new Presentation()) {
var slide = prs.getSlides().get(0);
var shape = slide.getShapes().addAutoShape(ShapeType.RECTANGLE, 50, 50, 500, 150);
var tf = shape.addTextFrame("Bold blue heading");
var fmt = tf.getParagraphs().get(0).getPortions().get(0).getPortionFormat();
fmt.setFontHeight(28);
fmt.setFontBold(NullableBool.TRUE);
fmt.getFillFormat().setFillType(FillType.SOLID);
fmt.getFillFormat().getSolidFillColor().setColor(Color.fromArgb(255, 0, 70, 127));
prs.save("text.pptx", SaveFormat.PPTX);
}NullableBool.TRUE sets the property explicitly; NullableBool.NOT_DEFINED inherits from the slide master.
Fill Types
Apply solid, gradient, pattern, or picture fills to shapes.
import org.aspose.slides.foss.Presentation;
import org.aspose.slides.foss.ShapeType;
import org.aspose.slides.foss.FillType;
import org.aspose.slides.foss.drawing.Color;
import org.aspose.slides.foss.export.SaveFormat;
try (Presentation prs = new Presentation()) {
var slide = prs.getSlides().get(0);
var shape = slide.getShapes().addAutoShape(ShapeType.RECTANGLE, 50, 50, 300, 150);
// Solid fill
shape.getFillFormat().setFillType(FillType.SOLID);
shape.getFillFormat().getSolidFillColor().setColor(Color.fromArgb(255, 30, 120, 200));
prs.save("fill.pptx", SaveFormat.PPTX);
}Visual Effects
Apply outer shadow, glow, soft edge, blur, reflection, and inner shadow to shapes.
The effect properties are accessible through shape.getEffectFormat(). Call enableOuterShadowEffect(), enableGlowEffect(), enableSoftEdgeEffect(), setBlurEffect(radius, grow), enableReflectionEffect(), or enableInnerShadowEffect() to configure each independently.
3D Formatting
Apply 3D bevel, camera, light rig, material, and extrusion depth via shape.getThreeDFormat(). This controls the visual depth and lighting model for shape rendering in PPTX viewers that support 3D effects.
Speaker Notes
Attach notes to any slide using getNotesSlideManager().
import org.aspose.slides.foss.Presentation;
import org.aspose.slides.foss.export.SaveFormat;
try (Presentation prs = new Presentation()) {
var notes = prs.getSlides().get(0).getNotesSlideManager().addNotesSlide();
notes.getNotesTextFrame().setText("Key talking point: emphasize the ROI benefit.");
prs.save("notes.pptx", SaveFormat.PPTX);
}Comments
Add threaded comments with author information and slide position.
import org.aspose.slides.foss.Presentation;
import org.aspose.slides.foss.drawing.PointF;
import org.aspose.slides.foss.export.SaveFormat;
import java.time.LocalDateTime;
try (Presentation prs = new Presentation()) {
var author = prs.getCommentAuthors().addAuthor("Jane Smith", "JS");
var slide = prs.getSlides().get(0);
author.getComments().addComment(
"Please verify this data before the presentation.",
slide,
new PointF(2.0f, 2.0f),
LocalDateTime.now()
);
prs.save("comments.pptx", SaveFormat.PPTX);
}Embedded Images
Embed an image from a file into the presentation and add it to a slide as a PictureFrame.
import org.aspose.slides.foss.Presentation;
import org.aspose.slides.foss.ShapeType;
import org.aspose.slides.foss.export.SaveFormat;
import java.nio.file.Files;
import java.nio.file.Path;
try (Presentation prs = new Presentation()) {
byte[] imageData = Files.readAllBytes(Path.of("logo.png"));
var image = prs.getImages().addImage(imageData);
var slide = prs.getSlides().get(0);
slide.getShapes().addPictureFrame(ShapeType.RECTANGLE, 50, 50, 200, 150, image);
prs.save("with-image.pptx", SaveFormat.PPTX);
}Document Properties
Read and write core, app, and custom document properties.
import org.aspose.slides.foss.Presentation;
import org.aspose.slides.foss.export.SaveFormat;
try (Presentation prs = new Presentation()) {
var props = prs.getDocumentProperties();
// Core properties
props.setTitle("Q1 Results");
props.setAuthor("Finance Team");
props.setSubject("Quarterly Review");
props.setKeywords("Q1, finance, results");
// Custom property
props.setCustomPropertyValue("ReviewedBy", "Legal Team");
prs.save("deck.pptx", SaveFormat.PPTX);
}Known Limitations
The following areas raise UnsupportedOperationException and are not available in this edition:
| Area | Status |
|---|---|
| Charts | Not implemented |
| SmartArt | Not implemented |
| Animations and transitions | Not implemented |
| PDF / HTML / SVG / image export | Not implemented (PPTX only) |
| VBA macros | Not implemented |
| Digital signatures | Not implemented |
| Hyperlinks and action settings | Not implemented |
| OLE objects | Not implemented |
| Mathematical text | Not implemented |
See Also
- Getting Started: Installation and first program
- API Reference: Class and method reference
- How-To Guides: Task-oriented articles