Header and Footer
Contents
[
Hide
]
This article demonstrates how to add footers and update date and time placeholders using Aspose.Slides for Python via Java.
Install the package as described in Installation. Each example imports asposeslides before starting the JVM, then imports the API after the JVM is running.
Add a Footer
Add text to the footer area of a slide and make it visible.
import jpype
import asposeslides
if not jpype.isJVMStarted():
jpype.startJVM()
from asposeslides.api import Presentation
presentation = Presentation()
try:
slide = presentation.getSlides().get_Item(0)
slide.getHeaderFooterManager().setFooterText("My footer")
slide.getHeaderFooterManager().setFooterVisibility(True)
finally:
presentation.dispose()
Update Date and Time
Modify the date and time placeholder on a slide.
import jpype
import asposeslides
if not jpype.isJVMStarted():
jpype.startJVM()
from asposeslides.api import Presentation
presentation = Presentation()
try:
slide = presentation.getSlides().get_Item(0)
slide.getHeaderFooterManager().setDateTimeText("01/01/2024")
slide.getHeaderFooterManager().setDateTimeVisibility(True)
finally:
presentation.dispose()