I want to fit an image in PPT placeholder and looked two below links:
Similar Question
Similar Query
From the similar question, I have applied the solution but it is still showing cropped image in the ppt.
My code for the same:
prs = Presentation(path)
title_slide_layout = prs.slide_layouts[4] ## Changed the content to picture as I need two pictures in one slide
pic_placeholder = slide.placeholders[15] ## The two picture placeholders
pic_placeholder1 = slide.placeholders[16]
print(pic_placeholder.left.inches, pic_placeholder.top.inches, pic_placeholder.width.inches, pic_placeholder.height.inches)
## 0.5 2.4461811023622047 4.4184033245844265 4.253472222222222
"""Below solution from the question posted above """
pic_placeholder.left = Inches(0.1)
pic_placeholder.width = Inches(3)
pic_placeholder.height = Inches(3)
##Similarly I need to do for 2nd picture also, but it is not working for this picture also
prs.save(path)
As for the Similar Query
link, I was not able to understand, what was the final solution, how can this be achieved.
Problem Statement: (What do you want to achieve?
Want to get two images side by side in a slide and they should fit in the placeholder and the aspect ratio is preserved
What did you try?
Above code is what I tried !!
In what specific ways did it not work?
When implementing the solution, I am still getting cropped images from one side.
All I want is two different images on one slide and none of them being cropped!!