PowerPoint: How to get inset(padding) for text inside a shape. RRS feed

  • Question

  • Is there any method to get the real padding(inset) for text inside a shape with OpenXML SDK?

    Text box attribute:

    Vertical alignment: Middle

    Text direction: Horizontal

    Autofit: Do not Autofit

    Internal margin: left 0.1cm, top 0cm, Right 0.2cm, bottom 0cm.

    The text inside a shape, it's at the middle of the shape. so, the real top margin is not 0cm. How can I cat get the real margin form SDK.

    Thank you.

    Friday, September 4, 2015 3:01 AM


  • Hi Jollson3,

    Based on my understanding, there is no such element or property we can get the "real padding". Because the top padding in the example you listed above is 0 and the PowerPoint will render the textbox via all the property of it. 

    However we can calculate it by ourselves. For example, we can get the height of the textbox and font. Then the "real padding" equals textbox's height/2 - font's height/2 - textbox's top margin.

    In addition, we can use open XML SDK 2.5 Productivity Tool which shifted by Open XML SDK 2.5 to reflect the code of presentation to get a quick sample code.

    Hope it is helpful.

    Regards & Fei

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, September 7, 2015 3:17 AM