PNG JPG BMP TIFF PPTX
Aspose.Slides  for .NET

Parseer PPTX-formaten in C#

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

Hoe PPTX-bestand te parseren met behulp van C#

Om het PPTX-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 PPTX-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 PPTX-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
 

Parseer PPTX-bestanden - C#

//Extract Text from the Whole pptx Presentation 
    Presentation pptxPresentation = new Presentation(dataDir + "demo.pptx");
    
    //Get an Array of ITextFrame objects from all slides in the PPTX
    ITextFrame[] textFramesPPTX = Aspose.Slides.Util.SlideUtil.GetAllTextFrames(pptxPresentation, 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 PPTX Parser Live Demos

    Extract text and images from PPTX 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 PPTX files.
      It will be parsed instantly.

    PPTX Wat is PPTX bestandsformaat

    Files with PPTX extension are presentation files created with popular Microsoft PowerPoint application. Unlike the previous version of presentation file format PPT which was binary, the PPTX format is based on the Microsoft PowerPoint open XML presentation file format. A presentation file is a collection of slides where each slide can comprise of text, images, formatting, animations, and other media. These slides are presented to audience in the form of slideshows with custom presentation settings.

    Meer lezen

    Andere ondersteunde parseerformaten

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

    ODP (OpenDocument-presentatie-indeling)
    PPT (Microsoft PowerPoint 97-2003)