简体   繁体   English

python-pptx中获取text_frame的高宽

[英]Get text_frame height and width in python-pptx

How do I get the position, width, and height of the shape.text_frame ?如何获取 shape.text_frame 的shape.text_frame 、宽度和高度? I tried looking in the xml and have found something like this for this shape我试着查看 xml 并为这种形状找到了类似的东西

<a:bodyPr lIns="90000" rIns="90000" tIns="91440" bIns="91440" anchor="ctr">
     <a:noAutofit/>
</a:bodyPr>

which doesn't mention any of these except for the margin from bbox of text_frame, and the vertical align.除了 text_frame 的 bbox 的边距和垂直对齐之外,它没有提到任何这些。

If not possible to extract from xml then how it is calculated in slides or libreoffice?如果无法从 xml 中提取,那么它是如何在幻灯片或 libreoffice 中计算的?

The Shape object whose TextFrame it is has height and width properties.TextFrame所在的Shape object 具有heightwidth属性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM