0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Java PowerPointをHTML形式に変換

Posted at

Spire.Presentation for Javaが、強いライブラリだって皆さんもうご存知でしょう?Spire.Presentation for Javaは、いろいろな機能を搭載しています。とりわけ、その変換機能は素晴らしいし、PowerPointを様々なファイル形式に変換できますので、とても便利なライブラリですね。だから今日PowerPointをHTML形式に変換する方法を紹介させていただきます。

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

f:id:lendoris:20210923151648p:plain

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

f:id:lendoris:20210923151757p:plain

f:id:lendoris:20210923151845p:plain

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

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

    // Presentation オブジェクトを作成します。
    Presentation presentation = new Presentation();

    //サンプルファイルをロードします。
    presentation.loadFromFile("C:\\Users\\Administrator\\Desktop\\sample.pptx");

    //HTMLで保存します。
    presentation.saveToFile("C:\\Users\\Administrator\\Desktop\\ToHtml.html", FileFormat.HTML);
}

}

<h4><strong>実行結果</strong></h4>
<p><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/l/lendoris/20210923/20210923152051.png" alt="f:id:lendoris:20210923152051p:plain" width="554" height="323" loading="lazy" title="" class="hatena-fotolife" itemprop="image" /></p>
<p style="margin: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, 'ヒラギノ角ゴ Pro W3', 'Hiragino Kaku Gothic Pro', メイリオ, Meiryo, 'MS Pゴシック', 'MS PGothic', sans-serif; line-height: 1.6; color: #000001; overflow-wrap: break-word; padding: 0px;"><strong style="font-weight: bold; margin: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, 'ヒラギノ角ゴ Pro W3', 'Hiragino Kaku Gothic Pro', メイリオ, Meiryo, 'MS Pゴシック', 'MS PGothic', sans-serif; line-height: 1.6; color: #000001; overflow-wrap: break-word;"> </strong></p>
<p style="margin: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, 'ヒラギノ角ゴ Pro W3', 'Hiragino Kaku Gothic Pro', メイリオ, Meiryo, 'MS Pゴシック', 'MS PGothic', sans-serif; line-height: 1.6; color: #000001; overflow-wrap: break-word; padding: 0px;"> </p>
<p style="margin: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, 'ヒラギノ角ゴ Pro W3', 'Hiragino Kaku Gothic Pro', メイリオ, Meiryo, 'MS Pゴシック', 'MS PGothic', sans-serif; line-height: 1.6; color: #000001; overflow-wrap: break-word; padding: 0px;"> </p>
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?