LoginSignup
0
0

More than 3 years have passed since last update.

  Java  PowerpointをXPSに変換

Posted at

今日はJavaでPowerpointをXPSに変換する方法を紹介します。今回はSpire.Presentation for Javaというライブラリが必要となります。これは無料でMicrosoft Office系のソフトをダウンロードせずに使用できます。

では、行きましょう

下準備

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

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

元のファイル

 

f:id:lendoris:20201223152051p:plain

import com.spire.presentation.*;

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

    //presentation objectを作成します。
    Presentation ppt = new Presentation();

    //ファイルをロードします。
    ppt.loadFromFile("Sample.pptx");

    //XPSで保存します。
    ppt.saveToFile("toXPS.xps", FileFormat.XPS);
ppt.dispose();

    }
}

完成例

f:id:lendoris:20201223152106p: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