Read the complete article on how to apply animation effects to text in PowerPoint PPT in Python: https://blog.aspose.com/2022/02/08/apply-text-animation-in-ppt-in-python/
Last active
February 9, 2022 05:31
-
-
Save aspose-com-gists/295bab13c921469e6d04b78223bf4704 to your computer and use it in GitHub Desktop.
Apply Animation Effects to Text in PowerPoint PPT using Python
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 aspose.slides as slides | |
# load presentation | |
with slides.Presentation("presentation.pptx") as presentation: | |
# select paragraph to add effect | |
autoShape = presentation.slides[0].shapes[0] | |
paragraph = autoShape.text_frame.paragraphs[0] | |
# add Fly animation effect to selected paragraph | |
effect = presentation.slides[0].timeline.main_sequence.add_effect(paragraph, slides.animation.EffectType.FLY, slides.animation.EffectSubtype.LEFT, slides.animation.EffectTriggerType.ON_CLICK) | |
# save presentation | |
presentation.save("AnimationEffectinParagraph.pptx", slides.export.SaveFormat.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 aspose.slides as slides | |
# load presentation | |
with slides.Presentation("AnimationEffectinParagraph.pptx") as pres: | |
# get sequence | |
sequence = pres.slides[0].timeline.main_sequence | |
# access shape | |
autoShape = pres.slides[0].shapes[0] | |
# loop through paragraphs | |
for paragraph in autoShape.text_frame.paragraphs: | |
# get animation effects | |
effects = sequence.get_effects_by_paragraph(paragraph) | |
if len(effects) > 0: | |
print("Paragraph \"" + paragraph.text + "\" has " + str(effects[0].type) + " effect.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment