Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save aspose-com-gists/ca731f8fd76b67fc56580bd84d112665 to your computer and use it in GitHub Desktop.
Save aspose-com-gists/ca731f8fd76b67fc56580bd84d112665 to your computer and use it in GitHub Desktop.
Create Thumbnails for PPT Slides in Python
import aspose.slides as slides
import aspose.pydrawing as drawing
with slides.Presentation("presentation.pptx") as pres:
# User defined dimension
desiredX = 1200
desiredY = 800
# Get scaled values of X and Y
ScaleX = (1.0 / pres.slide_size.size.width) * desiredX
ScaleY = (1.0 / pres.slide_size.size.height) * desiredY
# Loop through slides
for slide in pres.slides:
# Create thumbnail
bmp = slide.get_thumbnail(ScaleX, ScaleY)
# Save the image to disk in JPEG format
bmp.save("Thumbnail_{i}.jpg".format(i = slide.slide_number), drawing.imaging.ImageFormat.jpeg)
import aspose.slides as slides
import aspose.pydrawing as drawing
with slides.Presentation("presentation.pptx") as pres:
# Loop through slides
for slide in pres.slides:
# Create a full scale image
bmp = slide.get_thumbnail(1, 1)
# Save the image to disk in JPEG format
bmp.save("Thumbnail_{i}.jpg".format(i = slide.slide_number), drawing.imaging.ImageFormat.jpeg)
@vitaliyKorzhenko
Copy link

waaaateeer MARK!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment