Skip to main content

A 100% standalone Power Point Python API for Processing Power Point Files

Project description

Standalone PowerPoint Compatible Python API for Efficient Presentation Handling

Foo

Product Page | Documentation | Examples | Forum | Temporary License | Customized Demo

Spire.Presentation for Python is a comprehensive PowerPoint compatible API designed for developers to efficiently create, modify, read, and convert PowerPoint files within Python programs. It offers a broad spectrum of functions to manipulate PowerPoint documents without any external dependencies.

Spire.Presentation for Python supports a wide range of PowerPoint features, such as adding and formatting text, tables, charts, images, shapes, and other objects, inserting and modifying animations, transitions, and slide layouts, generating and managing master slides, and many more.

This professional Python API also enables developers to easily convert PowerPoint files to various formats with high quality, including PDF, SVG, image, HTML, XPS, and more.

Support for Various PowerPoint Versions

  • PPT - PowerPoint Presentation 97-2003
  • PPS - PowerPoint SlideShow 97-2003
  • PPTX - PowerPoint Presentation 2007/2010/2013/2016/2019
  • PPSX - PowerPoint SlideShow 2007, 2010

High-Quality and Efficient PowerPoint File Conversion

Spire.Presentation for Python allows conversion from PowerPoint files to images, PDF, HTML, XPS, and SVG and interconversion between PowerPoint Presentation formats.

Support for Rich Presentation Manipulation Features

  • Work with PowerPoint Charts
  • Print PowerPoint Presentations
  • Work with SmartArtImages and Shapes
  • Audio and Video
  • Protect Presentation Slides
  • Text and Image Watermark
  • Merge Split PowerPoint Document
  • Comments and Notes
  • Manage PowerPoint Tables
  • Set Animations on Shapes
  • Manage Hyperlink
  • Extract Text and Image
  • Replace Text

Examples

Create a PowerPoint document in Python

from spire.presentation.common import *
import math
from spire.presentation import *


outputFile ="HelloWorld.pptx"

#Create a PPT document
presentation = Presentation()

#Add a new shape to the PPT document
left = math.trunc(presentation.SlideSize.Size.Width / float(2))-250
rec = RectangleF.FromLTRB(left, 80, left+500, 150+80)
shape = presentation.Slides[0].Shapes.AppendShape(ShapeType.Rectangle, rec)
shape.ShapeStyle.LineColor.Color = Color.get_White()
shape.Fill.FillType = FillFormatType.none

#Add text to the shape
shape.AppendTextFrame("Hello World!")

#Set the font and fill style of the text
textRange = shape.TextFrame.TextRange
textRange.Fill.FillType = FillFormatType.Solid
textRange.Fill.SolidColor.Color = Color.get_CadetBlue()
textRange.FontHeight = 66
textRange.LatinFont = TextFont("Lucida Sans Unicode")

#Save the document
presentation.SaveToFile(outputFile, FileFormat.Pptx2010)
presentation.Dispose()

Convert PowerPoint files to PDF

from spire.presentation.common import *
from spire.presentation import *


inputFile ="./Data/ToPDF.pptx"
outputFile = "ToPDF.pdf"

#Create a PPT document
presentation = Presentation()

#Load PPT file from disk
presentation.LoadFromFile(inputFile)

#Save the PPT to PDF file format
presentation.SaveToFile(outputFile, FileFormat.PDF)
presentation.Dispose()

Convert PowerPoint files to Images

from spire.presentation.common import *
from spire.presentation import *

inputFile ="./Data/ToImage.pptx"

#Create PPT document
presentation = Presentation()

#Load PPT file from disk
presentation.LoadFromFile(inputFile)

#Save PPT document to images
for i, slide in enumerate(presentation.Slides):
    fileName ="ToImage_img_"+str(i)+".png"
    image = slide.SaveAsImage()
    image.Save(fileName)
    image.Dispose()

presentation.Dispose()

Set passwords for PowerPoint presentations

from spire.presentation import *

inputFile = "./Data/Encrypt.pptx"
outputFile = "Encrypt_out.pptx"

#Create a PPT document
presentation = Presentation()
#Load the document from disk
presentation.LoadFromFile(inputFile)
#Get the password that the user entered
password = "e-iceblue"
#Encrypy the document with the password
presentation.Encrypt(password)
#Save the document
presentation.SaveToFile(outputFile, FileFormat.Pptx2010)
presentation.Dispose()

Product Page | Documentation | Examples | Forum | Temporary License | Customized Demo

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

Spire.Presentation-9.3.0-py3-none-win_amd64.whl (24.4 MB view details)

Uploaded Python 3Windows x86-64

File details

Details for the file Spire.Presentation-9.3.0-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for Spire.Presentation-9.3.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 111acdca12a9641912dd445626e1e8108a2fcf3459721978cfd3d46844fc83c6
MD5 97d90246ee606f6307c1fcb9e3e8f4e8
BLAKE2b-256 7c5f553461dc0512db9cdfd610aff07562aab2acf42e06db5ee5f2850f098f12

See more details on using hashes here.

File details

Details for the file Spire.Presentation-9.3.0-py3-none-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for Spire.Presentation-9.3.0-py3-none-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 9cfced30a0e6ac844047386126680daa14263ef9ccac875856983804994fd233
MD5 d3b4f3de3a0ed7af6ed4fe8a34ab5775
BLAKE2b-256 eeb9cd0678fe2a50ad2b36bab2fa3fae0fa3f3bfb5ff414ec28f9fe586c32880

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page