如何使用pythonpptx提取背景图像?

2024-09-21 03:28:18 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试从pptx文件中提取所有图像,但无法提取背景图像。在presentation.slide\u母版或presentation.slide\u布局中找不到图像属性。如何提取背景图像?下面的代码用于从幻灯片中提取图像

谢谢

for idx, slide in enumerate(presentation.slides):
     for shape in slide.shapes:
        if shape.shape_type == MSO_SHAPE_TYPE.PICTURE:
            image_blob = shape.image.blob

Tags: 文件代码in图像imagefor属性布局

热门问题