Skip to content

aspose-slides/Aspose.Slides-for-Java

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

GitHub all releases GitHub

Java PowerPoint API

Aspose.Slides a Java PowerPoint API for presentation manipulation and management. It allows developers to read, write, convert and manipulate PowerPoint presentations in Java applications with the ability to manipulate all document elements such as slides, tables, text, charts, shapes, images and SmartArt diagrams and more.

Directory Description
Examples A collection of Java examples that help you learn how to use product features.
Plugins Plugins to help integrate Aspose.Slides for Java in different environments.

PowerPoint File Manipulation via Java

Checkout the product overview to know all about Aspose.Slides for Java.

  • Load & convert presentations to other formats.
  • Create presentations from scratch.
  • Manipulate all of presentation elements via intuitive object model.
  • Create or embed charts.
  • Create or manipulate shapes.

Read & Write Presentations

Microsoft PowerPoint: PPT, PPTX, PPS, POT, PPSX, PPTM, PPSM, POTX, POTM
OpenOffice: ODP, OTP

Save Presentations As

Fixed Layout: PDF, PDF/A, XPS Image: JPEG, PNG, BMP, TIFF, GIF, SVG Web: HTML, SWF

Supported Environments

  • Microsoft Windows: Windows Desktop & Server (x86, x64)
  • macOS: Mac OS X
  • Linux: Ubuntu, OpenSUSE, CentOS, and others
  • Java Versions: J2SE 6.0 (1.6) or above

Get Started with Aspose.Slides for Java

Aspose hosts all Java APIs at the Aspose Repository. You can easily use Aspose.Slides for Java API directly in your Maven projects with simple configurations. For the detailed instructions please visit Installing Aspose.Slides for Java from Maven Repository documentation page.

Convert Presentation to PDF

// instantiate a Presentation object that represents a presentation file
Presentation pres = new Presentation("demo.pptx");
try {
    // save the presentation to PDF with default options
    pres.save("output.pdf", SaveFormat.Pdf);
} finally {
    if (pres != null) pres.dispose();
}

Create Presentation from Scratch

// instantiate Presentation
Presentation pres = new Presentation();
try {
    // get the first slide
    ISlide sld = (ISlide) pres.getSlides().get_Item(0);
    
    // add an AutoShape of Rectangle type
    IAutoShape ashp = sld.getShapes().addAutoShape(ShapeType.Rectangle, 150, 75, 150, 50);
    
    // add ITextFrame to the Rectangle
    ashp.addTextFrame("Hello World");
    
    // change the text color to Black (which is White by default)
    ashp.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().getFillFormat()
            .setFillType(FillType.Solid);
    ashp.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().getFillFormat()
            .getSolidFillColor().setColor(java.awt.Color.BLACK);
    
    // change the line color of the rectangle to White
    ashp.getShapeStyle().getLineColor().setColor(java.awt.Color.WHITE);
    
    // remove any fill formatting in the shape
    ashp.getFillFormat().setFillType(FillType.NoFill);
    
    // save the presentation to disk
    pres.save("output.pptx", SaveFormat.Pptx);
} finally {
    if (pres != null) pres.dispose();
}

Home | Product Page | Docs | Demos | API Reference | Examples | Blog | Search | Free Support | Temporary License