aardio 文档

在已有备注母版下创建备注页

fsys.openXml.pptx.editor.addNotesText 只为当前页没有备注页的幻灯片新增备注部件;它不会新建备注母版、版式或演讲者母版,也不需要 Office/WPS。

最小用法

import fsys.openXml.pptx;
import fsys.openXml.pptx.editor;

var pptx=fsys.openXml.pptx;
var doc,err=pptx.editor.open("/template.pptx");
if(!doc) return null,err;

// 第 2 页必须尚无 notesSlide;文稿必须已有唯一可用 notesMaster。
var created,err=doc.addNotesText(2,["开场说明","这里是第二段提词"]);
if(created===null){doc.close();return null,err;}

var path,err=doc.save("/with-notes.pptx");
doc.close();
if(!path) return null,err;

var report,err=pptx.verify(path);
if(!report) return null,err;
if(!report.ok || !report.complete) return null,"另存结果未通过结构校验",report;
return pptx.read(path);

返回表包含:

严格范围

失败与降级

没有备注母版、母版选择重复或不一致、备注模板关系损坏、目标页已有备注、目标页被共享引用,或正文模板结构复杂时会返回 null,err,不会留下半成品。需要导入用户母版、创建新母版、保留复杂备注页自定义图形,或要求应用级排版时,改用 PowerPoint/WPS COM。

创建后仍应按质量门执行 pptx.verify,再用 pptx.read(path,{includeNotes=true}) 核对页序、noteCount、pages[i].notesPart 与 notesText。结构通过不等同于目标应用的视觉和放映验收。

Markdown 格式