我正在使用pptx-python,我想将幻灯片的默认大小设置为全景大小(16:9)。到目前为止,我只能创建4:3大小的幻灯片,这是默认的。如何更改幻灯片的大小?
我试图访问幻灯片的宽度和高度属性,但对象幻灯片没有任何这些属性。
presentation = Presentation()
title_only_slide_layout = presentation.slide_layouts[5]
slide = presentation.slides.add_slide(title_only_slide_layout)
print(slide.height)AttributeError: 'SlideShapes' object has no attribute 'height'
发布于 2019-10-16 21:31:30
这里找到的文档说明"Presentation“对象具有属性"slide_height",但我没有看到任何关于具有属性python-pptx Documentation的"Slide”对象的文档。相反,"Slide“似乎继承了"Presentation”的高度和宽度。
尝试将print语句更改为以下内容。
print(presentation.slide_height)https://stackoverflow.com/questions/58414238
复制相似问题