ヘッダーとフッター
Contents
[
Hide
]
この記事では、Aspose.Slides for Python via Java を使用してフッターを追加し、日付と時刻のプレースホルダーを更新する方法を示します。
パッケージはInstallationに記載された手順でインストールします。各例では、JVM を開始する前に asposeslides をインポートし、JVM が実行中になった後に API をインポートします。
フッターを追加
スライドのフッター領域にテキストを追加し、表示させます。
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()
日付と時刻の更新
スライド上の日付と時刻のプレースホルダーを変更します。
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()