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

> کد نمونه جاوا برای استخراج متن و تصاویر از فایل PPT در Java Runtime Environment برای JSP/JSF Application و Desktop Applications.

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



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

 برای تجزیه فایل PPT، از
 [Aspose.Slides for Java](https://products.aspose.com/slides/fa/java/)
 API که یک API تجزیه کننده غنی، قدرتمند و آسان برای استفاده برای پلتفرم جاوا است. آخرین نسخه آن را می توانید مستقیماً از اینجا دانلود کنید
 [Maven](https://repository.aspose.com/webapp/#/artifacts/browse/tree/General/repo/com/aspose/aspose-slides)
 و با افزودن تنظیمات زیر به pom.xml آن را در پروژه مبتنی بر Maven خود نصب کنید.

### مخزن

```xml

<repository>
    <id>AsposeJavaAPI</id>
    <name>Aspose Java API</name>
    <url>https://releases.aspose.com/java/repo/</url>
</repository>

```

### وابستگی

```xml

<dependency>
    <groupId>com.aspose</groupId>
    <artifactId>aspose-slides</artifactId>
    <version>version of aspose-slides API</version>
    <classifier>jdk17</classifier>
</dependency>
```

## مراحل تجزیه فایل های PPT در جاوا

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

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

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

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

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

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

 Aspose.Slides برای جاوا در تمام سیستم عامل ها و سیستم عامل های اصلی پشتیبانی می کند. لطفا مطمئن شوید که پیش نیازهای زیر را دارید.

- مایکروسافت ویندوز یا یک سیستم عامل سازگار با محیط اجرای جاوا برای برنامه های کاربردی JSP/JSF و برنامه های دسکتاپ.
- آخرین نسخه Aspose.Slides برای جاوا را مستقیماً از اینجا دریافت کنید
 [Maven](https://repository.aspose.com/webapp/#/artifacts/browse/tree/General/repo/com/aspose/aspose-slides).

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

```cs
//Load PPT file
Presentation pptPresentation = new Presentation("demo.ppt");
try{
    //Get an Array of TextFrameEx objects from the first slide
    ITextFrame[] textFramesSlideOne = SlideUtil.getAllTextBoxes(pptPresentation.getSlides().get_Item(0));

    //Loop through the Array of TextFrames
    for (int i = 0; i < textFramesSlideOne.length; i++){
        //Loop through paragraphs in current TextFrame
        for (IParagraph para : textFramesSlideOne[0].getParagraphs()){
            //Loop through portions in the current Paragraph
            for (IPortion port : para.getPortions()){
                //Display text in the current portion
                System.out.print(port.getText());

                //Display font height of the text
                System.out.print(port.getPortionFormat().getFontHeight());

                //Display font name of the text
                System.out.print(port.getPortionFormat().getLatinFont().getFontName());
            }
        }
    }
} finally {
    if (pptPresentation != null) pptPresentation.dispose();
}
//Similarly extarcting text from the Whole Presentation
//Use getAllTextFrames(pptPresentation, true) method and Iterate through Array

```

## درباره Aspose.Slides for Java 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/java/parser/odp/) — فرمت ارائه اسناد باز
- [PPTX](https://products.aspose.com/slides/fa/java/parser/pptx/) — قالب ارائه XML را باز کنید
