# استخراج متن و تصاویر از سند PPTX از طریق دات نت

> کد منبع سی شارپ برای استخراج متن و تصاویر از فایل PPTX در .NET Framework، .NET Core، Windows Azure، Mono یا Xamarin.

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



## نحوه تجزیه فایل PPTX با استفاده از C#

 برای تجزیه فایل PPTX، از
 [Aspose.Slides for .NET](https://products.aspose.com/slides/fa/net)
 API که یک API دستکاری اسناد غنی، قدرتمند و آسان برای پلتفرم C# است. باز کن
 [NuGet](https://www.nuget.org/packages/aspose.slides.net)
 مدیر بسته، جستجو کنید
 **Aspose.Slides**
 و نصب کنید. همچنین می توانید از دستور زیر در کنسول Package Manager استفاده کنید.

### فرمان

```cs

PM> Install-Package Aspose.Slides.NET

```

## مراحل تجزیه فایل های PPTX در سی شارپ

تجزیه سند پایه با [Aspose.Slides for .NET](https://products.aspose.com/slides/fa/net) APIها را می توان تنها با چند خط کد انجام داد.

فایل PPTX را بارگیری کنید.

تمام قاب های متن را دریافت کنید.

از طریق هر بخش پاراگراف حلقه بزنید.

خروجی مورد نیاز مانند متن، فونت و غیره را دریافت کنید.

## سیستم مورد نیاز

 API های ما در تمام سیستم عامل ها و سیستم عامل های اصلی پشتیبانی می شوند. لطفا قبل از اجرای کد زیر، از داشتن پیش نیازهای زیر در سیستم خود اطمینان حاصل کنید.

- مایکروسافت ویندوز یا یک سیستم عامل سازگار با .NET Framework، .NET Core، Windows Azure، Mono یا Xamarin Platforms
- محیط توسعه مانند Microsoft Visual Studio
- Aspose.Slides برای DLL.NET که در پروژه شما ارجاع داده شده است - از NuGet با استفاده از دکمه دانلود در بالا نصب کنید

### تجزیه فایل های 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);
            }

```

## درباره Aspose.Slides for .NET API

 Aspose.Slides API را می توان برای خواندن، نوشتن، دستکاری و تبدیل اسناد Microsoft PowerPoint به PDF، XPS، HTML، TIFF، ODP و فرمت های مختلف دیگر استفاده کرد. می توان فایل های جدید را از ابتدا ایجاد کرد و آن ها را در قالب های پشتیبانی شده مربوطه ذخیره کرد. Aspose.Slides یک API مستقل برای ایجاد، تجزیه یا دستکاری ارائه ها، اسلایدها و عناصر است و به هیچ نرم افزاری مانند Microsoft یا 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.

## سایر فرمت های تجزیه پشتیبانی شده

- [ODP](https://products.aspose.com/slides/fa/net/parser/odp/) — فرمت ارائه اسناد باز
- [PPT](https://products.aspose.com/slides/fa/net/parser/ppt/) — مایکروسافت پاورپوینت 97-2003
