PNG JPG BMP TIFF PPT
Aspose.Slides  for .NET

C#でPPT形式を解析する

MicrosoftやAdobePDFなどのソフトウェアを使用せずに、サーバー側のAspose.Slides for.NETAPIを使用したネイティブで高性能なPPTドキュメントの解析。

C#を使用してPPTファイルを解析する方法

PPTファイルを解析するために、 [Aspose.Slides for .NET](https://products.aspose.com/slides/ja/net) C#プラットフォーム用の機能豊富で強力で使いやすいドキュメント操作APIであるAPI。開ける [NuGet](https://www.nuget.org/packages/aspose.slides.net) パッケージマネージャー、検索 ** Aspose.Slides ** とインストールします。パッケージマネージャーコンソールから次のコマンドを使用することもできます。

指示


PM> Install-Package Aspose.Slides.NET

C#でPPTファイルを解析する手順

[Aspose.Slides for .NET](https://products.aspose.com/slides/ja/net)APIを使用した基本的なドキュメントの解析は、わずか数行のコードで実行できます。

  1. PPTファイルをロードします。

  2. すべてのテキストフレームを取得します。

  3. 各段落部分をループします。

  4. テキスト、フォントなどの必要な出力を取得します。

システム要求

当社のAPIは、すべての主要なプラットフォームとオペレーティングシステムでサポートされています。以下のコードを実行する前に、システムに次の前提条件があることを確認してください。

-Microsoft Windows、または.NET Framework、.NET Core、Windows Azure、Mono、またはXamarinプラットフォームと互換性のあるOS -MicrosoftVisualStudioのような開発環境 -プロジェクトで参照されているAspose.Slidesfor.NETDLL-上の[ダウンロード]ボタンを使用してNuGetからインストールします

 

PPTファイルの解析-C#

//Extract Text from the Whole ppt Presentation 
    Presentation pptPresentation = new Presentation(dataDir + "demo.ppt");
    
    //Get an Array of ITextFrame objects from all slides in the PPTX
    ITextFrame[] textFramesPPTX = Aspose.Slides.Util.SlideUtil.GetAllTextFrames(pptPresentation, true);
    
    //Loop through the Array of TextFrames
     for (int i = 0; i < textFramesPPTX.Length; i++)
    
        //Loop through paragraphs in current ITextFrame
        foreach (IParagraph para in textFramesPPTX[i].Paragraphs)
    
             //Loop through portions in the current IParagraph
             foreach (IPortion port in para.Portions)
             {
                //Display text in the current portion
                Console.WriteLine(port.Text);
    
                //Display font height of the text
                Console.WriteLine(port.PortionFormat.FontHeight);
    
                //Display font name of the text
                if (port.PortionFormat.LatinFont != null)
                   Console.WriteLine(port.PortionFormat.LatinFont.FontName);
            }  

    
 
  • Aspose.Slides for.NETAPIについて

    Aspose.Slides APIを使用して、Microsoft PowerPointドキュメントの読み取り、書き込み、操作、およびPDF、XPS、HTML、TIFF、ODP、その他のさまざまな形式への変換を行うことができます。新しいファイルを最初から作成し、サポートされている関連する形式で保存できます。 Aspose.Slidesは、プレゼンテーション、スライド、要素を作成、解析、または操作するためのスタンドアロンAPIであり、MicrosoftやOpenOfficeなどのソフトウェアに依存しません。

    Online PPT Parser Live Demos

    Extract text and images from PPT documents right now by visiting our Live Demos website . The live demo has the following benefits

      No need to download Aspose API.
      No need to write any code.
      Just upload your PPT files.
      It will be parsed instantly.

    PPT PPT ファイル形式とは

    A file with PPT extension represents PowerPoint file that consists of a collection of slides for displaying as SlideShow. It specifies the Binary File Format used by Microsoft PowerPoint 97-2003. A PPT file can contain several different types of information such as text, bulleted points, images, multimedia and other embedded OLE objects. Microsoft came up with newer file format for PowerPoint, known as PPTX, from 2007 onwards that is based on Office OpenXML and is different from this binary file format. Several other application programs such as OpenOffice Impress and Apple Keynote can also create PPT files.

    続きを読む

    その他のサポートされている解析形式

    C#を使用すると、を含む他の形式を簡単に解析できます。

    ODP (OpenDocumentプレゼンテーション形式)
    PPTX (XMLプレゼンテーション形式を開く)