python pptx inconsistant text frame location

落爺英雄遲暮 提交于 2019-12-25 08:33:00

问题


I add text to a pptx slide, and wan't it to be aligned properly.

i use the following code

placing = (slide.width/2,0,slide.width/4,0)
txBox = slide.shapes.add_textbox(placing[0], placing[1], placing[2], placing[3])
tf = txBox.text_frame
tf.margin_left = 0
tf.text = text

it works, but the location is not consistent, the text starts at a different "left" location when the text grown longer or shorter.

what am i missing here?

is it possible that the text frame grows larger when the text is longer and than it's "left" value is changing? in that case, how can i force the text to fit some arbitrary dimensions?

thanks

来源:https://stackoverflow.com/questions/41119056/python-pptx-inconsistant-text-frame-location

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!