Insert images to powerpoint slide using python (win32com.client) -
I have been working with powering several hundred images and resizing them. I have to use a special source format which is similar to the other power points used by our company.
I am actively playing with Win32com API and I have come to know how to open a file and a blank slide.
My question is how would I go about writing an image and shaping its size (images will be the only thing on each page). Apart from this, I am trying to use the theme of my company for the background and title page but it is not important to get images on the page and re-size.
Any help would be greatly appreciated, thanks!
I found this address from Xavier page:
Pict1 = Slide1 This will work if your original image is square; Otherwise, it will distort them.
Better to specify -1 for width and height then the PPT will put them in their "natural" shape (whatever the PPT can decide ... is not important for current purposes). After that you can determine the aspect ratio of your aspect ratio and make sure that if you change the shape or you can resize, then it remains constant. Adjust the LockAspectRatio property and height or width to the right and automatically adjust the proportions to maintain the other aspect ratio.
Comments
Post a Comment