PPTX with speaker notes is rejected by PowerPoint/WPS as corrupt (missing notesMaster) #197
hwh19850925-cmyk
started this conversation in
General
Replies: 1 comment
-
|
感谢详细定位。这个问题我已按 speaker notes 导出兼容性单独补了一版:
修复内容:
我没有额外引入 已做的回归验证: python3 -m py_compile ...
python3 skills/ppt-master/scripts/svg_to_pptx.py projects/hello_world_test_ppt169_20260624 -o /tmp/notes_master_check.pptx
unzip -t /tmp/notes_master_check.pptx
python3 -c "from pptx import Presentation; ..."
soffice --headless --convert-to pdf --outdir /tmp /tmp/notes_master_check.pptx同时验证了 可以拉取最新 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
当启用 enable_notes 导出 PPTX 时,生成的文件会被 PowerPoint 和 WPS 拒绝,提示为 "无法读取"。根本原因是:notesSlide 部件被创建,但没有 notesMaster 部件、theme2 部件以及 <p:notesMasterIdLst> 声明——而这些正是 PowerPoint 所强制要求的。
当前的 create_notes_slide_rels_xml 特意没有引用 notesMaster,认为这样能避免悬空关系(dangling rels),但实际效果恰恰相反:PowerPoint 要求每个 notesSlide 都必须引用一个 notesMaster。
修复方案(3 个文件):
_notes_template.py(新增) — 包含从 PowerPoint 生成的文件中提取出的完整 notesMaster1.xml + theme2.xml + 关系文件(rels)模板。
pptx_notes.py — create_notes_slide_rels_xml 现在会引用 notesMaster;添加了 create_notes_master_xml、create_notes_master_rels_xml 和 create_notes_theme_xml 来返回模板化的 XML。
pptx_builder.py — 在首次创建 notesSlide 时,生成 notesMaster + theme2 + 关系文件,将 presentation→notesMaster 的关系注入到 presentation.xml.rels 和 <p:notesMasterIdLst> 中,并在 [Content_Types].xml 中注册 notesMaster 和 theme2 的覆盖配置(overrides)。
Diff:[参见下方的详细 diff 输出]
Beta Was this translation helpful? Give feedback.
All reactions