Installation

Installation of Aspose.Slides FOSS for Java

Aspose.Slides FOSS for Java is distributed as a standard Maven artifact. It has no native extensions, no system libraries to install, and no Microsoft Office or other proprietary runtime required.


Prerequisites

RequirementDetail
Java version21 or later
Build toolMaven 3.8+ or Gradle 7+
Operating systemWindows, macOS, Linux (any platform that runs a JDK)
Compiler / build toolsJDK 21+ (for compilation)

1. Install via Maven (Recommended)

Add the following dependency to your pom.xml:

<dependency>
    <groupId>org.aspose.slides.foss</groupId>
    <artifactId>aspose-slides-foss</artifactId>
    <version>1.0.0</version>
</dependency>

Maven downloads and installs the package along with any transitive dependencies. No post-install configuration is needed.


2. Install via Gradle

Add the following to your build.gradle:

dependencies {
    implementation 'org.aspose.slides.foss:aspose-slides-foss:1.0.0'
}

Or in Kotlin DSL (build.gradle.kts):

dependencies {
    implementation("org.aspose.slides.foss:aspose-slides-foss:1.0.0")
}

3. Verify the Installation

After adding the dependency, verify that the library loads correctly and a Presentation can be created:

import org.aspose.slides.foss.Presentation;
import org.aspose.slides.foss.export.SaveFormat;

public class VerifyInstall {
    public static void main(String[] args) {
        try (Presentation prs = new Presentation()) {
            System.out.println("Aspose.Slides FOSS installed successfully");
            System.out.println("Slides in empty presentation: " + prs.getSlides().size());
        }
    }
}

Expected output:

Aspose.Slides FOSS installed successfully
Slides in empty presentation: 1

Quick Start: Create a Presentation with a Shape

The following program creates a new presentation, adds a rectangle with text, and saves it as a .pptx file:

import org.aspose.slides.foss.Presentation;
import org.aspose.slides.foss.ShapeType;
import org.aspose.slides.foss.export.SaveFormat;

public class QuickStart {
    public static void main(String[] args) {
        try (Presentation prs = new Presentation()) {
            var slide = prs.getSlides().get(0);

            // Add a rectangle shape and set its text
            var shape = slide.getShapes().addAutoShape(ShapeType.RECTANGLE, 50, 50, 400, 150);
            shape.addTextFrame("Hello from Aspose.Slides FOSS!");

            prs.save("hello.pptx", SaveFormat.PPTX);
        }
        System.out.println("Saved hello.pptx");
    }
}

Important: Always use Presentation inside a try-with-resources block. This ensures proper cleanup of internal resources when the block exits.


Platform Notes

Windows, macOS, Linux: The library is identical on all platforms. It is pure Java with no platform-specific native code.

Docker / serverless: The library works inside slim Docker images (such as eclipse-temurin:21-jre-alpine). No additional system packages are required.

CI/CD: Add the Maven dependency to your pom.xml and your CI pipeline will resolve it automatically.


Additional Resources

 English