Last active
April 21, 2024 18:02
-
-
Save documentprocessing/05c46927b1b8ab5841f4fa772e6d15fc to your computer and use it in GitHub Desktop.
Create PowerPoint PPTX with python-pptx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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