PowerPoint 有可供选择的主题。选择是这样的:
有没有办法使用python-pptx
设置新演示文稿的主题?
类似于:
from pptx import Presentation
prs = Presentation()
prs.set_theme(theme)
...
关于this github issue它建议创建一个带有主题的幻灯片,然后打开它。
In that starting .pptx file you would include your customized themes. You can do this by creating a presentation that uses all the themes you would like to have available and then deleting all the slides (but not the slide masters or slide layouts). You will be left with an empty presentation having multiple slide masters, each of which has its own set of slide layouts.
最佳答案
基本上,您可以使用该主题创建一个模板,并将其用作起点(而不是内置的默认主题)。
- 在 PowerPoint 中打开一个具有所需主题的新演示文稿。
- 将其另存为 .pptx,并使用您想要的名称,也许
madison.pptx
是屏幕截图中顶行的第三个。 创建新演示文稿时使用该演示文稿作为“起点”:
prs = Presentation("madison.pptx")
新演示文稿 (prs
) 将应用 Madison 主题。
python-pptx
尚无法将主题应用到现有演示文稿。
关于python - 使用 python-pptx 设置主题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57482998/