0
0

More than 3 years have passed since last update.

Java Powerpointにフッタを挿入

Posted at

 

今日はJavaでPowerpointにフッタを挿入する方法を紹介します。Spire.Presentation for Javaというライブラリを使ってPowerpointにフッタを簡単に挿入することができます。

下準備

1.E-iceblueの公式サイトからFree Spire. Presentation for Java無料版をダウンロードしてください。

f:id:lendoris:20210120151857p:plain

2.IDEを起動して新規プロジェクトを作成してから、インストールされたファイルにあった相応しいSpire. Presentation.jarを参照に追加してください。

f:id:lendoris:20210120151914p:plain

コード

import com.spire.presentation.FileFormat;
import com.spire.presentation.Presentation;

public class AddFooter {
    public static void main(String[] args) throws Exception {

 //PowerPointドキュメントをロードします。
        Presentation presentation = new Presentation();
        presentation.loadFromFile("Input.pptx");

        //フッタを入れます。
        presentation.setFooterText("フッタです");
        //フッタを表示にします。
        presentation.setFooterVisible(true);
        //ページ番号を表示にします。
        presentation.setSlideNumberVisible(true);
        //日付を表示にします。
        presentation.setDateTimeVisible(true);

        //保存します。
        presentation.saveToFile("AddFooter.pptx", FileFormat.PPTX_2010);
    }
}

実行結果

f:id:lendoris:20210120155822p:plain

 

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0