PowerPoint JS API: Add support for getting dimensions of slides

PowerPoint JS API: Add support for getting dimensions of slides
43

Upvotes

Upvote

 Oct 13 2022
0 Comments 
New

Currently, only the shape class has the width and height properties. It would be really beneficial for us to have the same properties also for the slide class.

 

Use case:

We need to insert content add-ins covering the entire slide. As content add-in allows us to specify only fixed dimensions in the manifest (RequestedWidth and RequestedHeight), our idea is to automatically resize newly inserted content add-ins to the dimensions of the parent slide. e.g.:

 

contentAddinShape.left = 0;
contentAddinShape.top = 0;
contentAddinShape.width = parentSlide.width;
contentAddinShape.height = parentSlide.height;

 


Alternative solution:
Allow setting RequestedWidth and RequestedHeight in relative units, so we could use something like:

 

<DefaultSettings>
  <RequestedWidth>100%</RequestedWidth>
  <RequestedHeight>100%</RequestedHeight>
</DefaultSettings>