Aspose.Slides  for Python via Java

Python PowerPoint API for Presentations

Create, Read, Modify and Convert PowerPoint and OpenOffice presentations using Python without any external software.

  Download Free Trial

Aspose.Slides for Python via Java is a Python library that lets you create, modify, and convert PowerPoint presentations in Python. It supports all presentation elements such as slides, shapes, text, charts, tables, images, and more. It also offers many advanced features such as merging, cloning, splitting, comparing, and printing presentations. It works without any dependencies and can process thousands of presentations in a short time.

Why Choose Aspose.Slides for Python via Java?

Aspose.Slides for Python via Java offers many advantages over other solutions for PowerPoint automation, such as:

  • Cross-platform compatibility: Aspose.Slides for Python via Java supports multiple platforms. You can use Aspose.Slides for Python via Java on Windows, Linux, macOS, and other operating systems.
  • Easy integration and deployment: Aspose.Slides for Python via Java is a standalone library that does not require Microsoft Office or any other software to be installed on your system. You can easily integrate Aspose.Slides for Python via Java with your existing applications and deploy it on any server or cloud environment.
  • Powerful features and functionality: Aspose.Slides for Python via Java provides a rich set of features and functionality for working with PowerPoint presentations, such as creating and modifying slides, adding and editing shapes, text, images, animations, transitions, charts, tables, and other elements, applying themes and layouts, inserting audio and video, exporting and printing presentations, export to video, and much more.
  • High performance and quality: Aspose.Slides for Python via Java delivers high performance and quality results for processing PowerPoint presentations. You can process thousands of presentations in minutes, without compromising the fidelity and accuracy of the output.
  • Free trial and licensing options: Aspose.Slides for Python via Java offers a free trial version that you can download and use for 30 days, without any limitations. You can also choose from various licensing options that suit your needs and budget, such as developer, site, OEM, and cloud licenses.

Advanced Python PowerPoint API Features

Create or clone existing slides from templates

Work with PowerPoint tables via API

Apply or remove the protection on shapes

Add Excel charts as OleObjects to slides

Create shapes and add text to shapes on slides

Handle text & shape formatting

Generate presentations from database

Protect presentations & resultant PDF

Print presentations on a physical printer

System Requirements

Aspose.Slides for Python via Java is platform-independent API. It can run on Windows, Unix/Linux & Mac platforms with the following software installed:
  • JDK 1.8 or above
  • Python 3.7 or above
  • JPype1 1.5.0 or above (JPype has been tested on Java versions from 1.8 to 11)

How to Install

Use PyPI to install our Python library for Presentation processing from the PyPI repository:

pip install aspose-slides-java

How to Create New PowerPoint Presentation in Python

In the example given below, we have added a rectangle to the first slide of the presentation.

            	
import jpype
import asposeslides

jpype.startJVM()

from asposeslides.api import Presentation, SaveFormat, ShapeType

pres = Presentation()
slide = pres.getSlides().get_Item(0)
slide.getShapes().addAutoShape(ShapeType.Rectangle, 50, 150, 300, 200)
pres.save("NewPresentation.pptx", SaveFormat.Pptx)

jpype.shutdownJVM()
            
        

How to Merge Presentations in Python

This Python code shows you how to merge presentations:

            
import jpype
import asposeslides

jpype.startJVM()

from asposeslides.api import Presentation, SaveFormat

pres1 = Presentation("pres1.pptx");
pres2 = Presentation("pres2.pptx");

for i in range(pres2.getSlides().size()):
    pres1.getSlides().addClone(pres2.getSlides().get_Item(i));

pres1.save("combinedPresentation.pptx", SaveFormat.Pptx);

jpype.shutdownJVM()
            
        

How to Import Presentation From PDF in Python. Convert PDF to PPT, Convert PDF to PPTX, Convert PDF to ODP

This Python code demonstrates the PDF to PowerPoint conversion process:

            
import jpype
import asposeslides

jpype.startJVM()

from asposeslides.api import Presentation, SaveFormat

pres = Presentation();

pres.getSlides().removeAt(0);
pres.getSlides().addFromPdf("welcome-to-powerpoint.pdf");

pres.save("outputPresentation.pptx", SaveFormat.Pptx);

jpype.shutdownJVM()
            
        

How to Convert PowerPoint to PDF in Python

This Python code shows you how to convert a PowerPoint PPT, PPTX, and OpenOffice ODP document to a PDF document using the default options. The resulting file is a PDF document at the maximum quality levels

            
import jpype
import asposeslides

jpype.startJVM()

from asposeslides.api import Presentation, SaveFormat

pres = Presentation("PowerPoint.pptx");

pres.save("PPTX-to-PDF.pdf", SaveFormat.Pdf);

jpype.shutdownJVM()
            
        

How to Convert PowerPoint to JPG in Python. Convert PPT to JPG, Convert PPTX to JPG, Convert ODP to JPG

The following example shows you how to convert a PowerPoint PPT, PPTX, and OpenOffice ODP document into a set of JPEG images.

            
import jpype
import asposeslides

jpype.startJVM()

from asposeslides.api import Presentation
from javax.imageio import ImageIO
from java.io import File

pres = Presentation("pres.pptx");

format_name = "PNG"

for i in range(pres.getSlides().size()):
    buffImage = pres.getSlides().get_Item(i).getThumbnail(2, 2)
    ImageIO.write(buffImage, format_name, File("image_java" + str(i) + ".png"))

jpype.shutdownJVM()
            
        
  

Support and Learning Resources