# استخراج النص والصور من ملفات ODP باستخدام Python

> Python شفرة المصدر لتحليل العرض التقديمي ODP.

Source: https://products.aspose.com/slides/ar/python-net/parser/odp/
Updated: 2023-05-01



## استخراج نص من ODP العرض التقديمي عبر Python

لمسح النص من العرض التقديمي بأكمله ، استخدم الأسلوب الثابت [GetAllTextFrames](https://reference.aspose.com/slides/python-net/aspose.slides.util/slideutil/) الذي تعرضه فئة SlideUtil. يقوم الكود أدناه بمسح النص ومعلومات التنسيق من العرض التقديمي ، بما في ذلك الشرائح الرئيسية.

### استخراج نص من ODP عرض تقديمي باستخدام Python

```py

import aspose.slides as slides

#Instatiate Presentation class that represents a ODP file
with slides.Presentation("pres.odp") as pptxPresentation:
    # Get an Array of ITextFrame objects from all slides in the ODP
    textFramesPPTX = slides.util.SlideUtil.get_all_text_frames(pptxPresentation, True)

    # Loop through the Array of TextFrames
    for i in range(len(textFramesPPTX)):
	    # Loop through paragraphs in current ITextFrame
        for para in textFramesPPTX[i].paragraphs:
            # Loop through portions in the current IParagraph
            for port in para.portions:
			    # Display text in the current portion
                print(port.text)

    			# Display font height of the text
                print(port.portion_format.font_height)

			    # Display font name of the text
                if port.portion_format.latin_font != None:
                    print(port.portion_format.latin_font.font_name)
```

## كيفية استخراج نص من ODP عبر Python

هذه هي خطوات تحليل ملفات ODP.

تحميل ODP بمثيل عرض تقديمي

الحصول على صفيف من كائنات TextFrame من كل الشرائح في ODP

حلقة خلال صفيف إطارات النص

تكرار الفقرات في TextFrame الحالي

تكرار خلال الأجزاء في الفقرة الحالية

احصل على نص في الجزء الحالي

## تنسيقات التحليل المدعومة الأخرى
