# 安装
pip install Aspose.Slides==24.12.0
# 代码(没有水印,亲测可用!!)
使用导出md为中介,巧妙!但是不能导出整张无水印的幻灯片!
python
import aspose.slides as slides
ppt_path = r"xxx.pptx"
out_dir = "save"
with slides.Presentation(ppt_path) as pres:
# Create Markdown creation options
md_options = slides.export.MarkdownSaveOptions()
# Set parameter for render all items (items that are grouped will be rendered together).
md_options.export_type = slides.export.MarkdownExportType.VISUAL
# Set folder name for saving images
md_options.images_save_folder_name = "md-images"
# Set path for folder images
md_options.base_path = out_dir
# Save presentation in Markdown format
pres.save(out_dir + "/pres.md", slides.export.SaveFormat.MD, md_options)
图片都保存在 save/md-images文件夹中