Skip to content

Instantly share code, notes, and snippets.

@documentprocessing
Last active April 21, 2024 18:02
Show Gist options
  • Save documentprocessing/05c46927b1b8ab5841f4fa772e6d15fc to your computer and use it in GitHub Desktop.
Save documentprocessing/05c46927b1b8ab5841f4fa772e6d15fc to your computer and use it in GitHub Desktop.
Create PowerPoint PPTX with python-pptx
# import Presentation class from python-pptx library
from pptx import Presentation
# Creating presentation object
root_Presentation = Presentation()
# Creating slide layout
layout_slide = root_Presentation.slide_layouts[0]
#Create a slide object and attach it to the Presentation
slide = root_Presentation.slides.add_slide(layout_slide)
# Adding title and subtitle in first page of slide
slide.shapes.title.text = "DocumentProcessing.com"
## Use placeholder subtitle to be added as text
slide.placeholders[1].text = "Learn about Document Editor, Covnerter, Annotator, Metadata, Merger, and Parser APIs"
# Save the
root_Presentation.save("create_pptx.pptx")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment