Python के साथ प्रस्तुतियों आयात करें
परिचय
With Aspose.Slides for Python via .NET, you can import content into a presentation from other file formats. The SlideCollection class provides methods to import slides from PDF, HTML, and other sources.
PDF को प्रस्तुति में बदलें
This section shows how to convert a PDF into a presentation using Aspose.Slides. It walks you through importing the PDF, turning its pages into slides, and saving the result as a PPTX file.

- Create an instance of the Presentation class.
- Call the add_from_pdf method and pass the PDF file.
- Use the save method to save the presentation in PowerPoint format.
The following Python example demonstrates converting a PDF to a presentation:
import aspose.slides as slides
with slides.Presentation() as presentation:
presentation.slides.remove_at(0)
presentation.slides.add_from_pdf("sample.pdf")
presentation.save("output.pptx", slides.export.SaveFormat.PPTX)
Tip
आप Aspose का मुफ्त PDF से PowerPoint वेब ऐप आज़मा सकते हैं — यह यहाँ वर्णित प्रक्रिया का एक लाइव कार्यान्वयन है।HTML को प्रस्तुति में बदलें
This section shows how to import HTML content into a presentation using Aspose.Slides. It covers loading the HTML, transforming it into slides with preserved text, images, and basic formatting, and saving the result as a PPTX file.
- Create an instance of the Presentation class.
- Call the add_from_html method and pass the HTML file.
- Use the save method to save the presentation in PowerPoint format.
The following Python example demonstrates converting an HTML to a presentation:
import aspose.slides as slides
with slides.Presentation() as presentation:
presentation.slides.remove_at(0)
with open("page.html", "rb") as html_stream:
presentation.slides.add_from_html(html_stream)
presentation.save("output.pptx", slides.export.SaveFormat.PPTX)
अक्सर पूछे जाने वाले प्रश्न
क्या PDF आयात करते समय तालिकाएँ संरक्षित रहती हैं, और उनकी पहचान को सुधारा जा सकता है?
Tables can be detected during import; PdfImportOptions includes a detect_tables parameter that enables table recognition. The effectiveness depends on the PDF’s structure.
Note
You can also use Aspose.Slides to convert HTML into other popular file formats: