我正在尝试将多个图表放入由Python生成的幻灯片中,但我需要幻灯片的尺寸更宽。我查阅了提供的文档,但可用文档并不多。
我正在尝试将多个图表放入由Python生成的幻灯片中,但我需要幻灯片的尺寸更宽。我查阅了提供的文档,但可用文档并不多。
pptx生成的幻灯片默认宽度为10英寸、高度为7.5英寸。以下代码可更改其默认幻灯片宽度和高度:
from pptx import Presentation
from pptx.util import Inches
prs = Presentation()
# set width and height to 16 and 9 inches.
prs.slide_width = Inches(16)
prs.slide_height = Inches(9)
prs = Presentation()
prs.slide_width = 11887200
prs.slide_height = 6686550