PNG JPG BMP TIFF PPT
Aspose.Slides  for .NET

PPT-formaten ontleden in C#

Native en hoogwaardige PPT-documentparsering met Aspose.Slides aan de serverzijde voor .NET API’s, zonder het gebruik van software zoals Microsoft of Adobe PDF.

Hoe PPT-bestand te parseren met behulp van C#

Om het PPT-bestand te ontleden, gebruiken we

Aspose.Slides voor .NET

API, een veelzijdige, krachtige en gebruiksvriendelijke API voor documentmanipulatie voor het C#-platform. Open

NuGet

pakketbeheerder, zoek naar Aspose.Dia’s en installeren. U kunt ook de volgende opdracht gebruiken vanuit de Package Manager Console.

Opdracht


PM> Install-Package Aspose.Slides.NET

Stappen om PPT-bestanden te ontleden in C#

Een basisdocument ontleden met Aspose.Slides for .NET API’s kan worden gedaan met slechts enkele regels code.

  1. Laad PPT-bestand.

  2. Krijg alle tekstframes.

  3. Loop door elk paragraafgedeelte.

  4. Verkrijg de vereiste uitvoer zoals tekst, lettertype enz.

systeem vereisten

Onze API’s worden ondersteund op alle belangrijke platforms en besturingssystemen. Voordat u de onderstaande code uitvoert, moet u ervoor zorgen dat u de volgende vereisten op uw systeem hebt.

  • Microsoft Windows of een compatibel besturingssysteem met .NET Framework, .NET Core, Windows Azure, Mono of Xamarin Platforms
  • Ontwikkelomgeving zoals Microsoft Visual Studio
  • Aspose.Slides voor .NET DLL waarnaar in uw project wordt verwezen - Installeer vanaf NuGet met behulp van de downloadknop hierboven
 

PPT-bestanden ontleden - 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);
            }  

    
 
  • Over Aspose.Slides voor .NET API

    Aspose.Slides API kan worden gebruikt om Microsoft PowerPoint-documenten te lezen, schrijven, manipuleren en converteren naar PDF, XPS, HTML, TIFF, ODP en verschillende andere formaten. Men kan vanaf het begin nieuwe bestanden maken en deze opslaan in de relevante ondersteunde formaten. Aspose.Slides is een zelfstandige API voor het maken, parseren of manipuleren van presentaties, dia’s en elementen en is niet afhankelijk van software zoals Microsoft of 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 Wat is PPT bestandsformaat

    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.

    Meer lezen

    Andere ondersteunde parseerformaten

    Met behulp van C# kan men gemakkelijk andere formaten ontleden, waaronder.

    ODP (OpenDocument-presentatie-indeling)
    PPTX (Open XML-presentatie-indeling)