# Estrai testo e immagini dal documento PPTX tramite .NET

> Codice sorgente C# per estrarre testo e immagini dal file PPTX su piattaforme .NET Framework, .NET Core, Windows Azure, Mono o Xamarin.

Source: https://products.aspose.com/slides/it/net/parser/pptx/
Updated: 2026-08-11



## Come analizzare il file PPTX usando C#

 Per analizzare il file PPTX, useremo
 [Aspose.Slides per .NET](https://products.aspose.com/slides/it/net)
 API che è un'API di manipolazione dei documenti ricca di funzionalità, potente e facile da usare per la piattaforma C#. Aprire
 [NuGet](https://www.nuget.org/packages/aspose.slides.net)
 gestore pacchetti, cerca
 **Aspose.Slides**
 e installa. È inoltre possibile utilizzare il seguente comando dalla Console di gestione pacchetti.

### Comando

```cs

PM> Install-Package Aspose.Slides.NET

```

## Passaggi per analizzare i file PPTX in C#

È possibile eseguire un'analisi di base del documento con le API [Aspose.Slides for .NET](https://products.aspose.com/slides/it/net) con poche righe di codice.

Carica file PPTX.

Ottieni tutte le cornici di testo.

Scorri ogni parte del paragrafo.

Ottieni l'output richiesto come testo, carattere, ecc.

## Requisiti di sistema

 Le nostre API sono supportate su tutte le principali piattaforme e sistemi operativi. Prima di eseguire il codice seguente, assicurati di avere i seguenti prerequisiti sul tuo sistema.

- Microsoft Windows o un sistema operativo compatibile con piattaforme .NET Framework, .NET Core, Windows Azure, Mono o Xamarin
- Ambiente di sviluppo come Microsoft Visual Studio
- Aspose.Slides per .NET DLL a cui si fa riferimento nel progetto - Installa da NuGet utilizzando il pulsante Download sopra

### Analizza file PPTX - C#

```cs
//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);
            }

```

## Informazioni su Aspose.Slides per .NET API

 L'API Aspose.Slides può essere utilizzata per leggere, scrivere, manipolare e convertire documenti Microsoft PowerPoint in PDF, XPS, HTML, TIFF, ODP e vari altri formati. Si possono creare nuovi file da zero e salvarli nei relativi formati supportati. Aspose.Slides è un'API standalone per la creazione, l'analisi o la manipolazione di presentazioni, diapositive ed elementi e non dipende da alcun software come Microsoft o OpenOffice.

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.

## Altri formati di analisi supportati

- [ODP](https://products.aspose.com/slides/it/net/parser/odp/) — Formato di presentazione OpenDocument
- [PPT](https://products.aspose.com/slides/it/net/parser/ppt/) — Microsoft PowerPoint 97-2003
