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

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

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



## نحوه تجزیه فایل PPT با استفاده از سی شارپ

 برای تجزیه فایل PPT، از
 [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

```

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

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

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

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

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

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

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

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

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

### تجزیه فایل های PPT - C#

```cs
//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 .NET API

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

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.

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

- [ODP](https://products.aspose.com/slides/fa/net/parser/odp/) — فرمت ارائه اسناد باز
- [PPTX](https://products.aspose.com/slides/fa/net/parser/pptx/) — قالب ارائه XML را باز کنید
