PPT PPTX ODP POT ppsx
Aspose.Slides  for Python via .NET
PPT

Python का उपयोग करके PPT प्रस्तुतिकरण से पाठ और छवियां निकालें

सर्वर-साइड API का उपयोग करके PowerPoint से पाठ, छवि, वीडियो और ऑडियो फ़ाइलें निकालने के लिए अपना स्वयं का Python एप्लिकेशन बनाएं.

Python के माध्यम से PPT प्रस्तुतिकरण से पाठ निकालें

संपूर्ण प्रस्तुति से पाठ को स्कैन करने के लिए, GetAllTextFrames स्थिर विधि का उपयोग करें, जिसे SlideUtil वर्ग द्वारा प्रदर्शित किया गया है। नीचे दिया गया कोड मास्टर स्लाइड सहित प्रस्तुति से पाठ और स्वरूपण जानकारी को स्कैन करता है।

Python का उपयोग करके PPT प्रस्तुतिकरण से टेक्स्ट निकाला जा रहा है


import aspose.slides as slides

#Instatiate Presentation class that represents a PPT file
with slides.Presentation("pres.ppt") as pptxPresentation:
    # Get an Array of ITextFrame objects from all slides in the PPT
    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)

PPT से Python के ज़रिए टेक्स्ट कैसे निकालें

ये PPT फ़ाइलों को पार्स करने के चरण हैं।

  1. प्रस्तुति के उदाहरण के साथ PPT लोड करें

  2. PPT में सभी स्लाइड्स से टेक्स्टफ्रेम ऑब्जेक्ट्स की एक सरणी प्राप्त करें

  3. TextFrames की सरणी के माध्यम से लूप करें

  4. वर्तमान टेक्स्टफ्रेम में अनुच्छेदों के माध्यम से लूप करें

  5. वर्तमान अनुच्छेद में भागों के माध्यम से लूप करें

  6. वर्तमान भाग में पाठ प्राप्त करें

अन्य समर्थित पार्स प्रारूप

{Product_lang} का उपयोग करके, आप निम्न स्वरूपों को भी स्कैन कर सकते हैं: