aardio 文档

autos.skills.powerPoint 库模块帮助文档

autos.skills.powerPoint 成员列表 #

PPT/PPTX 任务优先原生生成、读取、预检与有限编辑,统一复用 fsys.openXml。
Office/WPS COM 可按需用于制作、嵌入媒体及渲染导出;原生优先,不限制混合使用。

autos.skills.powerPoint.addBlankSlide(presentation,index) #

添加空白页;index 默认在末尾。

autos.skills.powerPoint.addTextBox(slide,text,left=60,top=60,width=600,height=80,options) #

添加文本框,坐标单位为 point;options 可设置字体、颜色与对齐。

autos.skills.powerPoint.addTitleSlide(presentation,title,subtitle,index) #

添加含标题与副标题的页面。

autos.skills.powerPoint.checkPptx(slides,options,checkOptions) #

生成前版式预检,转发 builder.check;参数同 writePptx,不启动 Office、不写文件。
返回 {ok,issues,counts,errors,warnings,missingFonts};code: overflow/tableGrow/offSlide/overlap。输入不合法 null,err。

autos.skills.powerPoint.closePresentation(presentation,saveChanges=false) #

关闭文稿;可先保存。

autos.skills.powerPoint.createPresentation(startIfMissing=true,visible=true) #

通过 Office/WPS 创建演示文稿。

autos.skills.powerPoint.editPptx() #

返回对象:openXmlPptxEditorObject

autos.skills.powerPoint.editPptx(path,options) #

打开有限编辑会话,转发 pptx.editor.open;文本替换、页序/复制/删除、表格填值/合并、图片及显式动画/切换替换。另存并 close,不改源件;不是任意已有图表数据编辑器。

autos.skills.powerPoint.exportAsPdf(presentation,path,overwrite=true) #

通过 Office/WPS 导出 PDF。

autos.skills.powerPoint.exportSlidesAsImages(presentation,dir,format="png",width=0,height=0) #

通过 Office/WPS 导出各页图片。

autos.skills.powerPoint.extractPptxMedia(path,outputDir,overwrite=true,options) #

统一调用 fsys.openXml.pptx.extractMedia,返回本次已导出的文件数组。
旧入口默认允许覆盖;overwrite=false 跳过已有文件。同名平铺冲突报错。
CRC、长度、限额或写入失败返回 null,err,partial,不把半成品当成功;partial.files 为已提交文件。
仅复制原始字节,不执行或转码。options 可指定读取限额。

autos.skills.powerPoint.extractTextFromPptx() #

返回对象:openXmlPresentationObject

autos.skills.powerPoint.extractTextFromPptx(path,includeNotes=true,options) #

统一调用 fsys.openXml.pptx.read;按实际页序读取正文、基本表格与备注。
旧字段保留;notes 逐页对齐,noteCount 为实际含备注部件的页面数;增加 pages,warnings。

autos.skills.powerPoint.getActivePresentation(startIfMissing=false) #

获取活动演示文稿 COM 对象。

autos.skills.powerPoint.getActivePresentationInfo(startIfMissing=false) #

获取活动演示文稿信息。

autos.skills.powerPoint.getApp(startIfMissing=false,visible=true) #

连接或启动 Office/WPS,返回 com.powerPoint 透明代理,继承 Application 的全部方法/属性;仅 COM 编组时需要 .Application。失败返回 null,err。

autos.skills.powerPoint.getAppInfo(startIfMissing=false) #

返回应用名称、版本、文稿数与活动文稿名。

autos.skills.powerPoint.getPresentationInfo(presentation) #

返回 name,fullName,path,slideCount,saved。

autos.skills.powerPoint.isRunning() #

检查 PowerPoint/WPS 是否已运行。

autos.skills.powerPoint.listPptxEntries(path,pattern,options) #

使用 fsys.openXml.pptx 列举真实 ZIP 条目,包含目录。
保留 path,isDir,size,formattedSize;增加 name,compressedSize,contentType;pattern 为 aardio 模式串。
options 可传 fsys.openXml 读取限额;并非整包内容校验。

autos.skills.powerPoint.listPptxMedia(path,options) #

列出标准 ppt/media/ 及主部件同级 media/ 下的文件,含子目录;不含目录项。
保留 path,name,ext,size,isDir,formattedSize;增加 partName,contentType,compressedSize。
不是按页引用分析,不保证发现任意路径的媒体。

autos.skills.powerPoint.openPresentation(path,startIfMissing=true,withWindow=true,readOnly=false) #

通过 Office/WPS 打开演示文稿。

autos.skills.powerPoint.quitApp(app,owned,timeout=15000) #

只退出 startApp 启动的实例;仍有打开的文稿时拒绝,不替调用方关闭。
只等待自然退出,不处理加载项或退出对话框,不自动点击、不强制结束进程。
为保持返回结构兼容,dismissed 始终为 0。
成功返回 true,{exited,dismissed,ms};失败 null,err。

autos.skills.powerPoint.saveAs(presentation,path,format,overwrite=true) #

通过 Office/WPS 另存文稿;format 为名称或数值。

autos.skills.powerPoint.startApp(visible=false) #

启动验收/导出专用的新 PowerPoint 实例,返回 app,owned;失败 null,err。
已有任何 PowerPoint 进程时拒绝:COM 激活可能复用已有进程,后台实例也可能注册 ROT,不能据此判断归属。
owned.pid 为创建前后新增的进程号;只把 owned 交给 quitApp。

autos.skills.powerPoint.version #

技能包版本。

autos.skills.powerPoint.writePptx(path,slides,options) #

声明式生成 PPTX,转发 builder.write;支持文本/形状/PNG或JPEG/表格与合并/二维图表/备注/整形状及逐段落动画、Morph(fade 回退)、标准版式、页码和链接。默认不覆盖;成功完整路径,失败 null,err。

Markdown 格式 Autos 技能包提示词(skill.md)