Aspose.Slides for Python via .NET は、プレゼンテーションを操作、処理する強力なクラス ライブラリです。Aspose.Slides for Python via .NET では、サードパーティのアプリケーションや依存関係を必要とせずに、PowerPoint のプレゼンテーション (PPT、PPTX) やその他の形式 (ODP) の読み込み、編集、操作、変換が可能となります。
Aspose.Slides for Python via .NET では、下記の機能が提供されます。
下記の例では、プレゼンテーションの最初にスライドにラインを追加します。
import aspose.slides as slides # プレゼンテーション ファイルを操作する Presentation オブジェクトをインスタンス化 with slides.Presentation() as presentation: slide = presentation.slides[0] slide.shapes.add_auto_shape(slides.ShapeType.LINE, 50, 150, 300, 0) presentation.save("NewPresentation_out.pptx", slides.export.SaveFormat.PPTX)
この Python コードでは、プレゼンテーションを結合します。
import aspose.slides as slides with slides.Presentation("Presentation1.pptx") as pres1: with slides.Presentation("Presentation2.pptx") as pres2: for slide in pres2.slides: pres1.slides.add_clone(slide) pres1.save("combined.pptx", slides.export.SaveFormat.PPTX)
この Python コードでは、PDF を PowerPoint に変換する処理を実行します。
import aspose.slides as slides with slides.Presentation() as pres: pres.slides.remove_at(0) pres.slides.add_from_pdf("welcome-to-powerpoint.pdf") pres.save("OutputPresentation.pptx", slides.export.SaveFormat.PPTX)
この Python コードでは、PowerPoint の PPT や PPTX、OpenOffice の ODP ドキュメントを、デフォルト オプションを使用して PDF ドキュメントに変換します。出力結果のファイルは高品質な PDF ドキュメントとなります。
import aspose.slides as slides # PPT ファイルを操作する Presentation オブジェクトをインスタンス化 presentation = slides.Presentation("PowerPoint.ppt") # プレゼンテーションを PDF として保存 presentation.save("PPT-to-PDF.pdf", slides.export.SaveFormat.PDF)
下記の例は、PowerPoint の PPT や PPTX、OpenOffice の ODP ドキュメントを一連の JPEG イメージに変換します。
import aspose.slides as slides import aspose.pydrawing as drawing pres = slides.Presentation("pres.pptx") for sld in pres.slides: bmp = sld.get_thumbnail(1, 1) bmp.save("Slide_{num}.jpg".format(num=str(sld.slide_number)), drawing.imaging.ImageFormat.jpeg)