# autos.skills.powerPoint 库模块帮助文档

## autos.skills.powerPoint 成员列表 <a id="autos.skills.powerPoint" href="#autos.skills.powerPoint">&#x23;</a>

PPT/PPTX 任务优先原生生成、读取、预检与有限编辑，统一复用 fsys.openXml。  
Office/WPS COM 可按需用于制作、嵌入媒体及渲染导出；原生优先，不限制混合使用。

### autos.skills.powerPoint.addBlankSlide(presentation,index) <a id="autos.skills.powerPoint.addBlankSlide" href="#autos.skills.powerPoint.addBlankSlide">&#x23;</a>
添加空白页；index 默认在末尾。

### autos.skills.powerPoint.addTextBox(slide,text,left=60,top=60,width=600,height=80,options) <a id="autos.skills.powerPoint.addTextBox" href="#autos.skills.powerPoint.addTextBox">&#x23;</a>
添加文本框，坐标单位为 point；options 可设置字体、颜色与对齐。

### autos.skills.powerPoint.addTitleSlide(presentation,title,subtitle,index) <a id="autos.skills.powerPoint.addTitleSlide" href="#autos.skills.powerPoint.addTitleSlide">&#x23;</a>
添加含标题与副标题的页面。

### autos.skills.powerPoint.checkPptx(slides,options,checkOptions) <a id="autos.skills.powerPoint.checkPptx" href="#autos.skills.powerPoint.checkPptx">&#x23;</a>
生成前版式预检，转发 builder.check；参数同 writePptx，不启动 Office、不写文件。  
返回 {ok,issues,counts,errors,warnings,missingFonts}；code: overflow/tableGrow/offSlide/overlap。输入不合法 null,err。

### autos.skills.powerPoint.closePresentation(presentation,saveChanges=false) <a id="autos.skills.powerPoint.closePresentation" href="#autos.skills.powerPoint.closePresentation">&#x23;</a>
关闭文稿；可先保存。

### autos.skills.powerPoint.createPresentation(startIfMissing=true,visible=true) <a id="autos.skills.powerPoint.createPresentation" href="#autos.skills.powerPoint.createPresentation">&#x23;</a>
通过 Office/WPS 创建演示文稿。

### autos.skills.powerPoint.editPptx() <a id="autos.skills.powerPoint.editPptx" href="#autos.skills.powerPoint.editPptx">&#x23;</a>
[返回对象:openXmlPptxEditorObject](#openXmlPptxEditorObject)

### autos.skills.powerPoint.editPptx(path,options) <a id="autos.skills.powerPoint.editPptx" href="#autos.skills.powerPoint.editPptx">&#x23;</a>
打开有限编辑会话，转发 pptx.editor.open；文本替换、页序/复制/删除、表格填值/合并、图片及显式动画/切换替换。另存并 close，不改源件；不是任意已有图表数据编辑器。

### autos.skills.powerPoint.exportAsPdf(presentation,path,overwrite=true) <a id="autos.skills.powerPoint.exportAsPdf" href="#autos.skills.powerPoint.exportAsPdf">&#x23;</a>
通过 Office/WPS 导出 PDF。

### autos.skills.powerPoint.exportSlidesAsImages(presentation,dir,format="png",width=0,height=0) <a id="autos.skills.powerPoint.exportSlidesAsImages" href="#autos.skills.powerPoint.exportSlidesAsImages">&#x23;</a>
通过 Office/WPS 导出各页图片。

### autos.skills.powerPoint.extractPptxMedia(path,outputDir,overwrite=true,options) <a id="autos.skills.powerPoint.extractPptxMedia" href="#autos.skills.powerPoint.extractPptxMedia">&#x23;</a>
统一调用 fsys.openXml.pptx.extractMedia，返回本次已导出的文件数组。  
旧入口默认允许覆盖；overwrite=false 跳过已有文件。同名平铺冲突报错。  
CRC、长度、限额或写入失败返回 null,err,partial，不把半成品当成功；partial.files 为已提交文件。  
仅复制原始字节，不执行或转码。options 可指定读取限额。

### autos.skills.powerPoint.extractTextFromPptx() <a id="autos.skills.powerPoint.extractTextFromPptx" href="#autos.skills.powerPoint.extractTextFromPptx">&#x23;</a>
[返回对象:openXmlPresentationObject](#openXmlPresentationObject)

### autos.skills.powerPoint.extractTextFromPptx(path,includeNotes=true,options) <a id="autos.skills.powerPoint.extractTextFromPptx" href="#autos.skills.powerPoint.extractTextFromPptx">&#x23;</a>
统一调用 fsys.openXml.pptx.read；按实际页序读取正文、基本表格与备注。  
旧字段保留；notes 逐页对齐，noteCount 为实际含备注部件的页面数；增加 pages,warnings。

### autos.skills.powerPoint.getActivePresentation(startIfMissing=false) <a id="autos.skills.powerPoint.getActivePresentation" href="#autos.skills.powerPoint.getActivePresentation">&#x23;</a>
获取活动演示文稿 COM 对象。

### autos.skills.powerPoint.getActivePresentationInfo(startIfMissing=false) <a id="autos.skills.powerPoint.getActivePresentationInfo" href="#autos.skills.powerPoint.getActivePresentationInfo">&#x23;</a>
获取活动演示文稿信息。

### autos.skills.powerPoint.getApp(startIfMissing=false,visible=true) <a id="autos.skills.powerPoint.getApp" href="#autos.skills.powerPoint.getApp">&#x23;</a>
连接或启动 Office/WPS，返回 com.powerPoint 透明代理，继承 Application 的全部方法/属性；仅 COM 编组时需要 .Application。失败返回 null,err。

### autos.skills.powerPoint.getAppInfo(startIfMissing=false) <a id="autos.skills.powerPoint.getAppInfo" href="#autos.skills.powerPoint.getAppInfo">&#x23;</a>
返回应用名称、版本、文稿数与活动文稿名。

### autos.skills.powerPoint.getPresentationInfo(presentation) <a id="autos.skills.powerPoint.getPresentationInfo" href="#autos.skills.powerPoint.getPresentationInfo">&#x23;</a>
返回 name,fullName,path,slideCount,saved。

### autos.skills.powerPoint.isRunning() <a id="autos.skills.powerPoint.isRunning" href="#autos.skills.powerPoint.isRunning">&#x23;</a>
检查 PowerPoint/WPS 是否已运行。

### autos.skills.powerPoint.listPptxEntries(path,pattern,options) <a id="autos.skills.powerPoint.listPptxEntries" href="#autos.skills.powerPoint.listPptxEntries">&#x23;</a>
使用 fsys.openXml.pptx 列举真实 ZIP 条目，包含目录。  
保留 path,isDir,size,formattedSize；增加 name,compressedSize,contentType；pattern 为 aardio 模式串。  
options 可传 fsys.openXml 读取限额；并非整包内容校验。

### autos.skills.powerPoint.listPptxMedia(path,options) <a id="autos.skills.powerPoint.listPptxMedia" href="#autos.skills.powerPoint.listPptxMedia">&#x23;</a>
列出标准 ppt/media/ 及主部件同级 media/ 下的文件，含子目录；不含目录项。  
保留 path,name,ext,size,isDir,formattedSize；增加 partName,contentType,compressedSize。  
不是按页引用分析，不保证发现任意路径的媒体。

### autos.skills.powerPoint.openPresentation(path,startIfMissing=true,withWindow=true,readOnly=false) <a id="autos.skills.powerPoint.openPresentation" href="#autos.skills.powerPoint.openPresentation">&#x23;</a>
通过 Office/WPS 打开演示文稿。

### autos.skills.powerPoint.quitApp(app,owned,timeout=15000) <a id="autos.skills.powerPoint.quitApp" href="#autos.skills.powerPoint.quitApp">&#x23;</a>
只退出 startApp 启动的实例；仍有打开的文稿时拒绝，不替调用方关闭。  
只等待自然退出，不处理加载项或退出对话框，不自动点击、不强制结束进程。  
为保持返回结构兼容，dismissed 始终为 0。  
成功返回 true,{exited,dismissed,ms}；失败 null,err。

### autos.skills.powerPoint.saveAs(presentation,path,format,overwrite=true) <a id="autos.skills.powerPoint.saveAs" href="#autos.skills.powerPoint.saveAs">&#x23;</a>
通过 Office/WPS 另存文稿；format 为名称或数值。

### autos.skills.powerPoint.startApp(visible=false) <a id="autos.skills.powerPoint.startApp" href="#autos.skills.powerPoint.startApp">&#x23;</a>
启动验收/导出专用的新 PowerPoint 实例，返回 app,owned；失败 null,err。  
已有任何 PowerPoint 进程时拒绝：COM 激活可能复用已有进程，后台实例也可能注册 ROT，不能据此判断归属。  
owned.pid 为创建前后新增的进程号；只把 owned 交给 quitApp。

### autos.skills.powerPoint.version <a id="autos.skills.powerPoint.version" href="#autos.skills.powerPoint.version">&#x23;</a>
技能包版本。

### autos.skills.powerPoint.writePptx(path,slides,options) <a id="autos.skills.powerPoint.writePptx" href="#autos.skills.powerPoint.writePptx">&#x23;</a>
声明式生成 PPTX，转发 builder.write；支持文本/形状/PNG或JPEG/表格与合并/二维图表/备注/整形状及逐段落动画、Morph（fade 回退）、标准版式、页码和链接。默认不覆盖；成功完整路径，失败 null,err。
