LoginSignup
0
0

More than 1 year has passed since last update.

C#  OpenDocumentをパワーポイントに変換

Last updated at Posted at 2021-06-23

OpenDocument(オープンドキュメント)とは、XMLをベースとしたオフィススイート用のファイルフォーマットです。今日はSpire.Presentationという無料のライブラリを使って、OpenDocumentをパワーポイントに変換する方法を紹介します。

下準備

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

f:id:lendoris:20210623144913p:plain

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

(Net 4.0を例としたら、デフォルトパスは“Bin→NET4.0→Presentation.dll”というようになります。)

f:id:lendoris:20210623144922p:plain

using Spire.Presentation;

namespace odptoPDF
{
    class Program
    {
        static void Main(string[] args)
        {
            //ファイルをロードします。
            Presentation presentation = new Presentation();
            presentation.LoadFromFile("Sample.odp",FileFormat.ODP);

           // OpenDocumentファイルで保存します。
            presentation.SaveToFile("OdptoPDF.pdf",FileFormat.PDF);

        }
    }
}

実行結果

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