[英]how to increase the slide size a python generated powerpoint presentation using python-pptx
我正在嘗試將多個圖表放入 python 生成的幻燈片中,但我需要幻燈片的大小更寬。 我查看了提供的可用文檔,這些文檔並不多。
我能夠通過調整 prs 的寬度和高度大小來解決這個問題
prs = Presentation()
prs.slide_width = 11887200
prs.slide_height = 6686550
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)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.