Learn how to convert PPT or PPTX to PNG in Python: https://blog.aspose.com/2021/12/29/convert-ppt-to-png-in-python/
Forked from aspose-com-gists/ppt-to-png-custom-scale.py
Created
November 17, 2022 11:13
-
-
Save raval08255/f2e8093afa1a8c5e019c3b030c3ef81d to your computer and use it in GitHub Desktop.
Convert PowerPoint PPT or PPTX to PNG in Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import aspose.slides as slides | |
import aspose.pydrawing as drawing | |
# Load presentation | |
pres = slides.Presentation("presentation.pptx") | |
# Loop through slides | |
for index in range(pres.slides.length): | |
# Get reference of slide | |
slide = pres.slides[index] | |
# Define scaling | |
scaleX = 2 | |
scaleY = 2 | |
# Save as PNG | |
slide.get_thumbnail(scaleX, scaleY).save("slide_{i}.png".format(i = index), drawing.imaging.ImageFormat.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import aspose.slides as slides | |
import aspose.pydrawing as drawing | |
# Load presentation | |
pres = slides.Presentation("presentation.pptx") | |
# Loop through slides | |
for index in range(pres.slides.length): | |
# Get reference of slide | |
slide = pres.slides[index] | |
# Define custom size | |
size = drawing.Size(960, 720) | |
# Save as PNG | |
slide.get_thumbnail(size).save("slide_{i}.png".format(i = index), drawing.imaging.ImageFormat.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import aspose.slides as slides | |
import aspose.pydrawing as drawing | |
# Load presentation | |
pres = slides.Presentation("presentation.pptx") | |
# Loop through slides | |
for index in range(pres.slides.length): | |
# Get reference of slide | |
slide = pres.slides[index] | |
# Save as PNG | |
slide.get_thumbnail().save("slide_{i}.png".format(i = index), drawing.imaging.ImageFormat.png) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment