ONLYOFFICE Docs 版本演进全解析:从 CHANGELOG 读懂 DocumentServer 9.x 功能、API 与安全加固

原创2026-10-14 18:07:361,865 阅读

ONLYOFFICE Docs 版本演进全解析:从 CHANGELOG 读懂 DocumentServer 9.x 功能、API 与安全加固

本篇技术指南以当前仓库根目录的 CHANGELOG.md(覆盖 4.0.2~9.4.0 全部版本)为唯一主体,系统梳理 ONLYOFFICE Docs(即 Document Server)近年版本的核心脉络:包括 9.x 系列新增的编辑器能力(多页面视图、PDF 编辑、表单签名、图表编辑、动态数组与 Solver 等)、公开的插件/编辑器 API 扩展(含大量可直接使用的 JavaScript 方法与参数说明)、服务端配置项(customization、storage、DB 连接等)、架构级变更(组件整合、移除 RabbitMQ 与数据库依赖)以及贯穿始终的安全漏洞修复清单。读完本文,你将能依据版本号快速定位功能与 API 的引入时间点,并掌握 9.x 时代用于集成与定制的关键参数和方法。

一、总览:版本时间线与架构主线

ONLYOFFICE Docs(6.0 起由 Document Server 更名而来)的变更日志按版本号从新到旧排列。仓库 Readme.md 将其定位为"免费的协作式在线办公套件",包含文本、表格、演示文稿、表单、PDF 与图表查看器等编辑器,完全兼容 OOXML(.docx/.xlsx/.pptx)并支持实时协作编辑。本仓库以 submodule 方式引用 server(后端服务层)、core(文档格式转换核心)、sdkjs(前端 JavaScript SDK)、web-apps(前端界面)等组件。

纵观 CHANGELOG 可提炼出四条演进主线:

  1. 编辑器矩阵扩张:从早期仅有文档/表格/演示三类编辑器,到 9.x 时代形成 Document Editor、Spreadsheet Editor、Presentation Editor、Forms(表单)、PDF Editor、Diagram Viewer 六大产品线;
  2. API 与集成能力持续增强:每个大版本都伴随大量 Builder API(ApiXxx.prototype.Yyy)与插件方法(window.Asc.plugin.executeMethod)的新增,是文档自动化与插件开发的一手资料;
  3. 后端架构逐步收敛:9.4.0 将组件整合进单一进程,移除了 RabbitMQ 与数据库依赖;此前版本则先后引入 PostgreSQL/MySQL/Oracle/MSSQL 支持、Redis 集群、S3/Azure 存储;
  4. 安全修复贯穿始终:XSS、越界读取(out-of-bounds read)、宏沙箱绕过、路径穿越、命令注入等漏洞在历次版本中被系统修复,并常标注 CVE 编号。

二、9.4.0:单一进程、表格对象 API 与签名表单

9.4.0 是 CHANGELOG 顶部(即当前最新)版本,其变更可归纳为五个板块。

2.1 编辑器新功能

模块 变更
All Editors 新增克罗地亚语界面(hr-HR);图表设置从右侧面板迁移到独立的 Chart design 选项卡
Document Editor 实现水平线(horizontal line)的插入
Spreadsheet Editor 工作表支持 Dark mode(深色模式)
Presentation Editor 新增 25 套演示设计主题;新增 20 种按类别分组的幻灯片过渡效果
Forms 签名图片保存至 localStorage,填写签名域时默认使用上次选择的图片;新增 Send for signing(发送签署)与 Filling status(填写状态)面板
Mobile 可禁用自动保存,改为手动管理保存

2.2 安全加固

9.4.0 修复了一批高危问题,其中包括:

  • XLS→XLSX 转换过程中的越界读取漏洞,涉及 ChartSheetSubstream::recalc、TextPropsStream::readFields、MetroBlob::ReadComplexData、SUPBOOK::serialize_book、ATTACHEDLABEL::serialize_rPr 等函数;
  • Convert-and-edit-wopi.ejs 中的 XSS 漏洞(不安全输出);
  • GUID 生成漏洞——攻击者可基于 GUID 的创建时间推算 GUID;
  • 通过 sloppy-mode 的 this 与 eval 绕过宏沙箱限制、访问环境对象的漏洞;
  • 处理含内嵌字体的 PDF 时可能导致崩溃或文件损坏的问题。

2.3 后端架构:组件整合

9.4.0 最值得关注的后端变更是架构收敛:

  • 移除了"最多 20 个同时打开的文档"的限制(对应 Community Edition 的用户规模约束,详见 Readme.md 的版本对比表);
  • 移除代码压缩(minification),简化支持与提升可读性;
  • 将各组件整合进单一进程,以优化资源消耗并简化应用运维;
  • 由于组件整合,移除了对 RabbitMQ 的依赖;
  • 同样由于组件整合,移除了对数据库的依赖。

这意味着部署与运维模型发生根本变化:不再需要单独维护消息队列与关系数据库。此前的版本(8.x、9.0.x)中大量与 PostgreSQL/MySQL/Oracle/MSSQL、Redis 集群相关的配置与排错条目,在 9.4.0 之后的单进程架构下不再是必要组件。

2.4 定制项

新增 plugins 配置段落的 disable 参数:一个插件 ID 数组,被列出的插件在加载时被阻止,并在界面中隐藏。

2.5 API 扩展(9.4.0)

9.4.0 的 API 增量以签名表单与**电子表格列表对象(ListObject)**为核心:

字段光标移动插件方法:

MoveCursorToField
MoveCursorOutsideField

GroupActions 选项扩展(控制滚动与光标位置):

lockScroll
keepSelection
StartAction("GroupActions", pr)
scrollToTarget
cancel
EndAction("GroupActions", pr)

签名表单类与方法:

ApiSignatureForm
ApiSignatureForm.GetImage
ApiSignatureForm.SetImage
Api.CreateSignatureForm
ApiFormBase.IsFilled
ApiDocument.GetFormsHighlight
ApiDocument.GetControlsHighlight

内容控件颜色管理:

ApiInlineLvlSdt.SetColor
ApiInlineLvlSdt.GetColor
ApiBlockLvlSdt.SetColor
ApiBlockLvlSdt.GetColor

ApiWorksheet 新增:AddListObject、GetListObjects。

新类 ApiListObject(电子表格"表格对象"的完整操作面):

GetActive
GetName / SetName
GetDisplayName / SetDisplayName
GetAlternativeText / SetAlternativeText
GetComment / SetComment
GetSummary / SetSummary
GetParent
GetRange
GetHeaderRowRange
GetDataBodyRange
GetTotalsRowRange
GetSourceType
GetTableStyle / SetTableStyle
GetShowHeaders / SetShowHeaders
GetShowTotals / SetShowTotals
GetShowAutoFilter / SetShowAutoFilter
GetShowAutoFilterDropDown / SetShowAutoFilterDropDown
GetShowTableStyleColumnStripes / SetShowTableStyleColumnStripes
GetShowTableStyleFirstColumn / SetShowTableStyleFirstColumn
GetShowTableStyleLastColumn / SetShowTableStyleLastColumn
GetShowTableStyleRowStripes / SetShowTableStyleRowStripes
GetAutoFilter
GetListColumns
AddListColumn
GetListRows
AddListRow
GetSort
Resize
Unlist
Delete

新类 ApiListColumn:

GetName / SetName
GetIndex
GetParent
GetRange
GetDataBodyRange
GetTotalsCalculation / SetTotalsCalculation
GetTotal
Delete

新类 ApiListRow:

GetIndex
GetParent
GetRange
Delete

新类 ApiSort 与 ApiSortFields、ApiSortField(对列表对象执行排序并读取/修改排序条件):

// ApiSort
GetSortFields
GetMatchCase / SetMatchCase
GetHeader
GetOrientation / SetOrientation
GetSortMethod / SetSortMethod
GetParent
GetRng
Apply

// ApiSortFields
GetParent
GetCount
Item
Add
Add2
Clear

// ApiSortField
GetParent
GetKey
GetSortOn / SetSortOn
GetOrder / SetOrder
GetPriority / SetPriority
GetSortOnValue
SetSortOnColor
ModifyKey
Delete

补齐段落设置读取方法:

ApiParaPr.prototype.GetTopBorder()
ApiParaPr.prototype.GetLeftBorder()
ApiParaPr.prototype.GetRightBorder()
ApiParaPr.prototype.GetBottomBorder()
ApiParaPr.prototype.GetBetweenBorder()
ApiParaPr.prototype.GetKeepLines()
ApiParaPr.prototype.GetKeepNext()
ApiParaPr.prototype.GetNumPr()
ApiParaPr.prototype.GetPageBreakBefore()
ApiParaPr.prototype.GetTabs()
ApiParaPr.prototype.GetWidowControl()
ApiParaPr.prototype.GetContextualSpacing()

并改进了 ApiTextPr 上若干 Get 方法在对象隶属于样式或默认格式(而非段落)时的行为。

文本表单格式与允许字符:

ApiTextForm.prototype.GetFormat()
ApiTextForm.prototype.SetFormat(format)
ApiTextForm.prototype.GetAllowedSymbols()
ApiTextForm.prototype.SetAllowedSymbols(symbols)

其他新方法:

Api.GetDefNames
ApiRange.FillDown
ApiRange.FillUp
ApiRange.FillRight
ApiRange.FillLeft
ApiRange.SetFormula

// 单元格尺寸管理
ApiTable.prototype.SetColumnWidth
ApiTable.prototype.GetColumnWidth
ApiTableRow.prototype.GetHeight

// 跳转页码插件方法
GoToPage

三、9.3.x:正则函数、动态数组、Solver、MD 导出与 PDF 版本历史

3.1 9.3.0 编辑器新功能

  • All Editors:可为图片、形状或组合添加超链接;实现纹理填充的全部设置;文档、表格、演示文稿的宏录制全面更新;
  • Document Editor:新增 Multiple pages(多页)视图;View 选项卡新增 Zoom to 100% 与 Multiple pages 按钮;评论外观改为使用用户颜色并显示评论起止位置;支持双击/三击选择单词/段落;新增保存为 MD 格式;页眉页脚设置移入独立的 Header & Footer 选项卡;
  • Spreadsheet Editor:支持新函数 REGEXTEST、REGEXREPLACE、REGEXEXTRACT;改进 COUNTIF;支持动态数组(dynamic arrays);新增 Solver(Simplex LP 线性规划求解);支持选择多个分隔符拆分文本到列/粘贴;新增整合工作表/行列操作的 Format 按钮;支持读取 TSV 文件;
  • Presentation Editor:幻灯片放映演示模式支持 GIF 动画播放;
  • Forms:新增可手绘与添加文字的签名设置窗口;可通过右键菜单将固定表单拉伸至表格单元格大小;新增 Protection 选项卡;支持保存为 MD 格式;
  • PDF Editor:新增版本历史;多页视图与缩放按钮;启用 Edit PDF 模式时若文件受编辑保护则弹出密码提示;支持 Link 注释(可添加到区域或页面文本上);可用内嵌字体继续编辑 PDF;通过辅助弹出工具栏实现文本脱敏(redact);新增打印页面参数。

3.2 9.3.0 安全修复

  • 修复 XLS 处理/转换中的多类越界读取漏洞(经 FilePass、HLink、rgXTI.itabLast、Formula 记录的 cce、ShapePropsStream、CRN.colLast 等记录/字段),可导致信息泄露与 ASLR 绕过;
  • 修复 XLS 处理/转换中的不可信指针解引用漏洞(经 pictFmla.cbBufInCtlStm 等向量),同样导致信息泄露与 ASLR 绕过;
  • 修复通过动态 import() 执行宏时的 DOM-based XSS(CVE-2021-43446、CVE-2023-50883、CVE-2024-44085)。

3.3 9.3.0 后端与定制

  • 面向集成方新增两个开放处理器:/meta/formats(以 JSON 形式返回可转换格式列表)、/meta/config(连接数据:headers、地址、文件大小限制);
  • Service Worker 增加缓存机制,替换最近打开的三个文档,加速重新打开并允许缓存浏览器不缓存的大文件;
  • 为未运行的 example 与 admin-panel 服务新增信息页;
  • permissions.copy 参数行为变更:禁止复制不再仅限外部剪贴板,内部剪贴板同样禁止,打开编辑器或尝试复制时显示相应警告;
  • Mobile:电子表格输入公式时高亮显示当前激活的参数。

3.4 9.3.0 API 扩展

脚注/尾注:

ApiDocument.prototype.GetCurrentFootEndnote = function()
ApiDocumentContent.prototype.IsFootnote = function()
ApiDocumentContent.prototype.IsEndnote = function()
ApiDocumentContent.prototype.SelectNoteReference = function()

Add-in 字段插件方法:

window.Asc.plugin.executeMethod("SelectAddinField", [fieldId]);
window.Asc.plugin.executeMethod("RemoveAddinField", [fieldId]);

统一的 ApiColor 类——9.3.0 起所有颜色统一由 ApiColor 表示,创建实例的方法:

Api.prototype.AutoColor = function()
Api.prototype.RGB = function(r, g, b)
Api.prototype.RGBA = function(r, g, b, a)
Api.prototype.HexColor = function(hexString)
Api.prototype.ThemeColor = function(name)

主题色可用名称:accent1, accent2, accent3, accent4, accent5, accent6, bg1, bg2, dk1, dk2, lt1, lt2, tx1, tx2。

ApiColor 的读取方法:

ApiColor.prototype.GetClassType = function()
ApiColor.prototype.IsAutoColor = function()
ApiColor.prototype.IsThemeColor = function()
ApiColor.prototype.GetRGB = function()
ApiColor.prototype.GetRGBA = function()
ApiColor.prototype.GetHex = function()
ApiColor.prototype.GetThemeName = function()

同时,大量颜色相关方法被更新为接受/返回 ApiColor 实例:

ApiRange.prototype.SetColor = function(color)
ApiRange.prototype.SetShd = function(type, color)
ApiDocument.prototype.SetFormsHighlight = function(color)
ApiDocument.prototype.SetControlsHighlight = function(color)
ApiParagraph.prototype.SetColor = function(color)
ApiRun.prototype.SetColor = function(color)
ApiRun.prototype.SetShd = function(type, color)
ApiTable.prototype.SetBackgroundColor = function(color)
ApiTableRow.prototype.SetBackgroundColor = function(color)
ApiTableCell.prototype.SetBackgroundColor = function(color)
ApiTableCell.prototype.GetBackgroundColor = function()
ApiTableCell.prototype.SetColumnBackgroundColor = function(color)
ApiTextPr.prototype.SetColor = function(color)
ApiTextPr.prototype.GetColor = function()
ApiTextPr.prototype.SetShd = function(type, color)
ApiTextPr.prototype.GetShd = function(color)
ApiParaPr.prototype.SetShd = function(type, color)
ApiParaPr.prototype.GetShd = function(color)
ApiInlineLvlSdt.prototype.SetBorderColor = function(color)
ApiInlineLvlSdt.prototype.GetBorderColor = function()
ApiInlineLvlSdt.prototype.SetBackgroundColor = function(color)
ApiInlineLvlSdt.prototype.GetBackgroundColor = function()
ApiFormBase.prototype.SetBorderColor = function(color)
ApiFormBase.prototype.GetBorderColor = function()
ApiFormBase.prototype.SetBackgroundColor = function(color)
ApiFormBase.prototype.GetBackgroundColor = function()
Api.prototype.CreateSolidFill = function(color)
Api.prototype.CreatePatternFill = function(patternType, bgColor, fgColor)
Api.prototype.CreateGradientStop = function(color, pos)
Api.prototype.CreateThemeColorScheme = function(arrColors, sName)

电子表格数据验证(Data Validation)完整 API:

ApiRange.prototype.GetValidation()
ApiValidation.prototype.Add(Type, AlertStyle, Operator, Formula1, Formula2)
ApiValidation.prototype.Delete()
ApiValidation.prototype.Modify(Type, AlertStyle, Operator, Formula1, Formula2)
ApiValidation.prototype.GetType()
ApiValidation.prototype.SetType(Type)
ApiValidation.prototype.GetAlertStyle()
ApiValidation.prototype.SetAlertStyle(AlertStyle)
ApiValidation.prototype.GetIgnoreBlank()
ApiValidation.prototype.SetIgnoreBlank(IgnoreBlank)
ApiValidation.prototype.GetInCellDropdown()
ApiValidation.prototype.SetInCellDropdown(InCellDropdown)
ApiValidation.prototype.GetShowInput()
ApiValidation.prototype.SetShowInput(ShowInput)
ApiValidation.prototype.GetShowError()
ApiValidation.prototype.SetShowError(ShowError)
ApiValidation.prototype.GetInputTitle()
ApiValidation.prototype.SetInputTitle(InputTitle)
ApiValidation.prototype.GetInputMessage()
ApiValidation.prototype.SetInputMessage(InputMessage)
ApiValidation.prototype.GetErrorTitle()
ApiValidation.prototype.SetErrorTitle(ErrorTitle)
ApiValidation.prototype.GetErrorMessage()
ApiValidation.prototype.SetErrorMessage(ErrorMessage)
ApiValidation.prototype.GetFormula1()
ApiValidation.prototype.SetFormula1(Formula1)
ApiValidation.prototype.GetFormula2()
ApiValidation.prototype.SetFormula2(Formula2)
ApiValidation.prototype.GetOperator()
ApiValidation.prototype.SetOperator(Operator)
ApiValidation.prototype.GetParent()

自动筛选(ApiAutoFilter / ApiFilter):

ApiWorksheet.prototype.GetAutoFilter = function()

// ApiAutoFilter
ApiAutoFilter.prototype.GetFilters
ApiAutoFilter.prototype.GetFilterMode
ApiAutoFilter.prototype.GetParent
ApiAutoFilter.prototype.GetRange
ApiAutoFilter.prototype.ApplyFilter = function()
ApiAutoFilter.prototype.ShowAllData = function()

// ApiFilter
ApiFilter.prototype.GetParent
ApiFilter.prototype.GetCriteria1
ApiFilter.prototype.GetCriteria2
ApiFilter.prototype.GetOn
ApiFilter.prototype.GetOperator

幻灯片过渡(ApiSlideShowTransition):

Api.prototype.CreateSlideShowTransition = function()
ApiSlide.prototype.GetSlideShowTransition = function()
ApiSlide.prototype.SetSlideShowTransition = function(transition)

// 效果
ApiSlideShowTransition.prototype.GetEntryEffect = function()
ApiSlideShowTransition.prototype.SetEntryEffect = function(effect: EntryEffect)

// 速度与时长
ApiSlideShowTransition.prototype.GetDuration = function()
ApiSlideShowTransition.prototype.SetDuration = function(duration: number)
ApiSlideShowTransition.prototype.GetSpeed = function()
ApiSlideShowTransition.prototype.SetSpeed = function(speed: string)

// 自动过渡
ApiSlideShowTransition.prototype.GetAdvanceOnClick = function()
ApiSlideShowTransition.prototype.SetAdvanceOnClick = function(value: bool)
ApiSlideShowTransition.prototype.GetAdvanceOnTime = function()
ApiSlideShowTransition.prototype.SetAdvanceOnTime = function(value: bool)
ApiSlideShowTransition.prototype.GetAdvanceTime = function()
ApiSlideShowTransition.prototype.SetAdvanceTime = function(time: number)

超链接(ApiHyperlink):

Api.prototype.CreateHyperlink = function(url, tooltip)
ApiDrawing.prototype.SetHyperlink = function(hyperlink)

形状填充与描边查询:

ApiShape.prototype.SetFill
ApiShape.prototype.GetFill
ApiShape.prototype.SetLine
ApiShape.prototype.GetLine
ApiFill.prototype.GetType
ApiStroke.prototype.GetWidth
ApiStroke.prototype.GetFill
ApiStroke.prototype.GetDashType

动画时间线(Animation)——9.3.0 将演示动画控制完整暴露给 API:

ApiSlide.prototype.GetTimeLine
ApiTimeLine.prototype.GetClassType
ApiTimeLine.prototype.GetMainSequence
ApiTimeLine.prototype.GetInteractiveSequences
ApiTimeLine.prototype.AddInteractiveSequence
ApiTimeLine.prototype.GetAllEffects
ApiAnimationSequence.prototype.GetClassType
ApiAnimationSequence.prototype.GetCount
ApiAnimationSequence.prototype.GetEffect
ApiAnimationSequence.prototype.AddEffect
ApiAnimationSequence.prototype.RemoveAllEffects
ApiAnimationEffect.prototype.GetClassType
ApiAnimationEffect.prototype.GetEffectType
ApiAnimationEffect.prototype.GetTriggerType
ApiAnimationEffect.prototype.SetTriggerType
ApiAnimationEffect.prototype.GetDuration
ApiAnimationEffect.prototype.SetDuration
ApiAnimationEffect.prototype.GetDelay
ApiAnimationEffect.prototype.SetDelay
ApiAnimationEffect.prototype.GetShape
ApiAnimationEffect.prototype.GetRepeatCount
ApiAnimationEffect.prototype.SetRepeatCount
ApiAnimationEffect.prototype.Delete
ApiAnimationEffect.prototype.MoveTo

表单签署与 Add-in 字段插件方法:

IsFormSigned
GetCurrentAddinField

表单锁定(类似 UI 中的锁按钮):

ApiFormBase.prototype.SetLock(isLock)
ApiFormBase.prototype.GetLock()

FormData 对象扩展字段:options(复选框、单选组、下拉列表与组合框)、label(复选框的文本标签)、format(日期字段格式)、lang(日期字段语言)。

描边创建变化:Api.prototype.CreateStroke(width, fill, sDash) 新增 sDash 参数。

ApiDrawing 增强:

ApiDrawing.prototype.GetFlipH()
ApiDrawing.prototype.GetFlipV()
ApiDrawing.prototype.SetFlipH
ApiDrawing.prototype.SetFlipV
ApiDrawing.prototype.Unselect()
ApiDrawing.prototype.SetRelativeHeight(sRelativeFrom, nPercent)
ApiDrawing.prototype.SetRelativeWidth(sRelativeFrom, nPercent)

并修改了 Select(新增 isReplace 参数)、SetHorPosition/SetVerPosition(新增 bPercent 参数):

ApiDrawing.prototype.Select(isReplace)
ApiDrawing.prototype.SetHorPosition(sRelativeFrom, nDistance, bPercent)
ApiDrawing.prototype.SetVerPosition(sRelativeFrom, nDistance, bPercent)
ApiDrawing.prototype.Fill(oFill)
ApiDrawing.prototype.SetOutLine(oStroke)

按名称获取绘图对象(文档/工作簿/演示通用):

ApiDocument.prototype.GetDrawingsByName(ids)
ApiWorkbook.prototype.GetDrawingsByName(ids)
ApiPresentation.prototype.GetDrawingsByName(ids)

选中形状查询:

ApiWorksheet.prototype.GetSelectedShapes()
ApiWorksheet.prototype.GetSelectedDrawings()

其他新方法:

ApiShape.prototype.SetPaddings(nLeft, nTop, nRight, nBottom)
ApiTable.prototype.SetSize = function (width, height)
ApiChart.prototype.GetTitle = function ()

PDF 编辑器宏 API:支持增删改页面、表单、注释、自选图形、表格、图片、图表。

3.5 9.3.1 / 9.2.1 修复要点

  • 9.3.1:修复打开电子表格时评论作者名显示问题;修复通过 connector 控制 PDF 编辑器的能力;
  • 9.2.1:修复韩语断词;修复跨文档移动/复制工作表时的数据重叠(对应 GitHub issue DocumentServer#3512);修复 PDF 打开、翻页、查找面板下的复制/粘贴/撤销、删除页面等错误;修复 Color theme name 自定义利用的 XSS 注入、多级列表设置窗口 Font 字段的 JS 代码 XSS、评论编辑表单 textarea 的漏洞、XLS→XLSX 转换中的内存操纵(可能导致信息泄露乃至 RCE)。

四、9.2.0 与 9.1.0:快捷键定制、宏录制、外部图表数据与 WOPI 增强

4.1 9.2.0 新功能

  • All Editors:可自定义键盘快捷键;除 PDF 外所有编辑器可录制部分执行动作为宏;
  • Forms:可为新添加的字段选择角色;为复选框与单选按钮添加标签,填写模式下点击标签等同于点击复选框;
  • PDF Editor:可修改隐藏文本(Redact)的颜色;从第三方资源插入公式;
  • Security:升级 Redis 至不受 CVE-2025-49844 影响的版本;修复通过 websocket 在受保护工作簿中添加命名区域的漏洞;修复 denyEditingRights 中的 XSS;修复 linux-libc-dev 中可提权并窃取 hypervisor 进程数据的漏洞(CVE-2025-38352、CVE-2025-40300);
  • Back-end:改善侧边栏外观并为 Admin Panel 添加图标。

9.2.0 API 新增:

// 复选框/单选按钮文本
ApiCheckBoxForm.prototype.SetLabel = function(label)
ApiCheckBoxForm.prototype.GetLabel = function()

// 段落数值标识符(保存在文件中)
ApiParagraph.prototype.GetParaId
ApiParagraph.prototype.SetParaId

// 删除表单并可保留内容(类似 Content Control)
ApiFormBase.prototype.Delete = function(keepContent)

// 获取全部表单
ApiDocument.prototype.GetAllForms

同时 GetAllContentControls 不再返回表单;新增 onParagraphText 事件(段落内容变更),事件对象结构:

{
  "paragraphId" : paraId,
  "recalcId"    : recalcId,
  "text"        : text,
  "annotations" : []
}

其中 annotations 是元素数组(上次标记后注释的新位置):

{
  "id" : id,
  "start" : start,
  "length" : length,
  "name" : "grammar"
}

新增注释相关事件 onClickAnnotation、onFocusAnnotation、onBlurAnnotation,参数对象:

{
  "paragraphId" : paraId,
  "rangeId"     : [rangeId, ...],
  "name"        : "grammar"
}

Plugins:AI 插件在 Document 与 Form 编辑器中新增 Grammar & Spelling(语法与拼写)检查。

4.2 9.1.0 新功能

  • All Editors:图表支持外部数据——编辑器间复制时可选择内嵌文件或指向源的链接;可启用/禁用图表元素;支持 HEIF 图片;可配置左侧面板已解决/未解决评论的显示;
  • Document Editor:支持任意嵌套层级的块级内容控件内分节;完整图表编辑器(内嵌 XLSX 文件现在直接打开,不再从图表缓存取值);支持 HWPML 文档格式查看;支持从 MathML 格式插入数学公式;
  • Spreadsheet Editor:单元格常规文本方向设置;透视表日期筛选;若干表单控件(Check Box、Combo Box、List Box、Spin Button、Scroll Bar、Button)的打开支持;混合数据类型公式逻辑改进;公式计算内存占用下降;优化 VLOOKUP/XLOOKUP 计算;公式输入高亮激活参数;公式翻译新增塞尔维亚语(西里尔/拉丁)与繁体中文;格式化表格设置移入 Table Design 选项卡;双击工作表名称即可重命名;
  • Presentation Editor:完整图表编辑器;Master Slide 设置移入独立选项卡;
  • Forms:字段使用体验优化;View Form / Manage Roles 按钮更名为 Preview / Manage Recipient Roles;支持 MathML 公式;
  • PDF Editor:新增 Redact 脱敏功能;Comment 区新增注释类型;支持 SmartArt;支持图表;实现图形元素与表单的复制粘贴;
  • Security:修复处理文档内超链接时的 XSS;修复 x2t 转换时向文件系统写入任意文件的漏洞;修复经 ConvertService 转换 EPUB 时读取文件系统任意文件的漏洞;修复 info/config 端点可修改服务器配置的漏洞;
  • Convert:支持 PDF 与 PPTX 直接转换为 TXT;
  • Back-end:新增管理面板(查看服务器状态并部分配置);新增 storage.commandOptions.s3 与 storage.commandOptions.az(自定义存储命令,如启用 AWS KMS 或配置 Azure Blob Storage);storage.useDirectStorageUrls=false 时 DocServer 默认返回内部链接;新增 oracleExtraOptions.thin(集群中通过 Oracle Instant Client 以 Thick Mode 连接 Oracle);PostgreSQL 移除公共 schema,管理员可指定任意 schema 并通过 pgPoolExtraOptions 配置;新增 DB_SCHEMA 参数(仅 PostgreSQL 与 MSSQL 生效,其他数据库忽略;适用于 deb/docker/rpm 包);
  • WOPI:CheckFileInfo 支持 UserCanOnlyComment 参数(打开即评论模式,行为类似 document.permissions.comment);打开编辑器时若无法对文件加锁,则以查看模式打开并显示错误信息。

9.1.0 API 新增:

// 透视表筛选
ApiPivotField.prototype.GetPivotFilters()
ApiPivotField.prototype.AutoSort(order, field, property)
ApiPivotField.prototype.AutoSortField
ApiPivotField.prototype.AutoSortOrder
ApiPivotFilters.prototype.Add(filterType, dataField, value1, value2, wholeDayFilter)
ApiPivotItem.prototype.GetVisible()
ApiPivotItem.prototype.SetVisible(visible)

// 通用 ApiRange 方法
ApiRange.prototype.Offset(rowOffset, columnOffset)
ApiRange.prototype.Resize(rowSize, columnSize)
ApiRange.prototype.GetRange(cell1, cell2)
ApiRange.prototype.GetEntireRow()
ApiRange.prototype.GetEntireColumn()

形状几何(ApiGeometry / ApiPath / ApiPathCommand)——9.1.0 将自选图形的路径级几何完全开放:

Api.prototype.CreateCustomGeometry()
Api.prototype.CreatePresetGeometry(preset)
ApiShape.prototype.GetGeometry
ApiShape.prototype.SetGeometry(geometry)

// ApiGeometry
ApiGeometry.prototype.IsCustom()
ApiGeometry.prototype.GetPreset()
ApiGeometry.prototype.GetPathCount()
ApiGeometry.prototype.GetPath(index)
ApiGeometry.prototype.GetPaths()
ApiGeometry.prototype.AddPath()
ApiGeometry.prototype.GetAdjValue(name)
ApiGeometry.prototype.AddAdj(name, value)
ApiGeometry.prototype.SetAdjValue(value)
ApiGeometry.prototype.AddGuide(name, fmla, x, y, z)
ApiGeometry.prototype.SetTextRect(l, t, r, b)
ApiGeometry.prototype.AddConnectionPoint(angle, x, y)

// ApiPath
ApiPath.prototype.GetStroke()
ApiPath.prototype.SetStroke(stroke)
ApiPath.prototype.GetFill()
ApiPath.prototype.SetFill(fill)
ApiPath.prototype.GetWidth()
ApiPath.prototype.SetWidth(width)
ApiPath.prototype.GetHeight()
ApiPath.prototype.SetHeight(height)
ApiPath.prototype.GetCommands()
ApiPath.prototype.GetCommandCount()
ApiPath.prototype.GetCommand(index)
ApiPath.prototype.MoveTo(x, y)
ApiPath.prototype.LineTo(x, y)
ApiPath.prototype.CubicBezTo(x1, y1, x2, y2, x3, y3)
ApiPath.prototype.QuadBezTo(x1, y1, x2, y2)
ApiPath.prototype.ArcTo(wR, hR, stAng, swAng)
ApiPath.prototype.Close()

// ApiPathCommand
ApiPathCommand.prototype.GetType()
ApiPathCommand.prototype.GetX()
ApiPathCommand.prototype.GetY()
ApiPathCommand.prototype.GetX0()
ApiPathCommand.prototype.GetY0()
ApiPathCommand.prototype.GetX1()
ApiPathCommand.prototype.GetY1()
ApiPathCommand.prototype.GetX2()
ApiPathCommand.prototype.GetY2()
ApiPathCommand.prototype.GetWR()
ApiPathCommand.prototype.GetHR()
ApiPathCommand.prototype.GetStartAngle()
ApiPathCommand.prototype.GetSweepAngle()

五、9.0.x:Modern 主题、AI 宏生成、PDF 表单编辑器与存储集成

5.1 9.0.0 核心新功能

  • All Editors:新增 Modern Light 与 Modern Dark 界面主题;拼写检查列表记住上次选择的语言;阿拉伯语拼写词典(覆盖十六种方言);AI 驱动的宏生成(从描述生成宏、VBA 转 JavaScript);新增乌尔都语界面(ur-PK);图表标签支持 TextArt 文本设置;支持绘制 Up/Down Bars 图表元素;
  • Document Editor:RTL 段落编号预览、TextArt 定位与段落边框/填充绘制改进;基于段落文字方向的方向键光标导航;印度数字(Hindi digits)显示;中文界面下可在 File 菜单选择西文/中文首选字号;Home 工具栏新增 Borders 按钮;支持读取 MD 格式;
  • Spreadsheet Editor:支持双向文本显示;可从另一个电子表格选择外部数据;
  • Presentation Editor:工具栏与高级设置中可设置段落方向(Text Direction > RTL);可查看带文本的动画;Slide Master 右键菜单新增 Preserve 选项;
  • Forms:Signature 与 Image 字段外观改进(占位符与签名图标常显);新增 "type": "signature" 用于填写过程中的签名域;
  • PDF Editor:文本可设 RTL 方向;Community Edition 亦可使用 Edit Text 选项;实现 PDF 表单编辑器;支持在 PDF 文件之间复制页面;
  • Diagram:Diagram Viewer 首个版本发布,可打开 VSDX 文件;
  • Convert:支持将 XLSB 转为编辑器内部格式,无需预转换即可编辑并以 XLSX 保存。

5.2 9.0.0 后端与定制

  • Azure Blob Storage:storage.name = "storage-az" 用于编辑器缓存,需指定 endpoint、bucketName 与 credentials(accessKeyId、secretAccessKey);
  • 新增 storage.useDirectStorageUrls(bool):控制外链存储链接的发放方式——直链或经服务器代理;
  • 预加载机制:通过给 api.js 链接追加 ?preload=placeholder 或使用 api.js 旁的隐藏 iframe(preload.html),可在打开文档前将静态编辑器数据(html、css、js、fonts)放入浏览器缓存;
  • runtimeConfig.filePath:动态服务器配置路径,可在不重启的情况下修改参数(类似租户配置);
  • 可在 /info 页面设置编辑器所用 AI 模型的参数与密钥;
  • 服务器管理员可自行添加词典;
  • 新增 customization.forceWesternFontSize(false/true)与 customization.layout.header.user(true/false,扩展许可可用,用于隐藏头部用户头像/首字母图标)。

5.3 9.0.0 API:Content Controls 与 Custom XML 全面开放

创建/添加自定义 Content Controls:

ApiDocument.prototype.AddCheckBoxContentControl = function(checkBoxPr)
ApiDocument.prototype.AddPictureContentControl = function(width, height)
ApiDocument.prototype.AddComboBoxContentControl = function(list, selected)
ApiDocument.prototype.AddDropDownListContentControl = function(list, selected)
ApiDocument.prototype.AddDatePickerContentControl = function(datePickerPr)
Api.prototype.CreateCheckBoxContentControl = function(checkBoxPr)
Api.prototype.CreatePictureContentControl = function(width, height)
Api.prototype.CreateComboBoxContentControl = function(list, selected)
Api.prototype.CreateDropDownListContentControl = function(list, selected)
Api.prototype.CreateDatePickerContentControl = function(datePickerPr)

Custom XML 集合管理:

ApiDocument.prototype.GetCustomXmlParts = function()
ApiCustomXmlParts.prototype.Add = function(xml)
ApiCustomXmlParts.prototype.GetCount = function()
ApiCustomXmlParts.prototype.GetById = function(xmlPartId)
ApiCustomXmlParts.prototype.GetByNamespace = function(namespace)
ApiCustomXmlParts.prototype.GetAll = function()

Custom XML Part 元素级操作:

ApiCustomXmlPart.prototype.GetId = function()
ApiCustomXmlPart.prototype.GetNodes = function(xPath)
ApiCustomXmlPart.prototype.GetXml = function()
ApiCustomXmlPart.prototype.Delete = function()
ApiCustomXmlPart.prototype.DeleteAttribute = function(xPath, name)
ApiCustomXmlPart.prototype.InsertAttribute = function(xPath, name, value)
ApiCustomXmlPart.prototype.GetAttribute = function(xPath, name)
ApiCustomXmlPart.prototype.UpdateAttribute = function(xPath, name, value)
ApiCustomXmlPart.prototype.DeleteElement = function(xPath)
ApiCustomXmlPart.prototype.InsertElement = function(xPath, xmlStr, index)
ApiCustomXmlPart.prototype.UpdateElement = function(xPath, xmlStr)

Custom XML 节点级操作:

ApiCustomXmlNode.prototype.GetNodes = function(xPath)
ApiCustomXmlNode.prototype.GetXPath = function ()
ApiCustomXmlNode.prototype.GetNodeName = function()
ApiCustomXmlNode.prototype.GetNodeValue = function()
ApiCustomXmlNode.prototype.GetXml = function()
ApiCustomXmlNode.prototype.GetText = function()
ApiCustomXmlNode.prototype.SetNodeValue = function(xml)
ApiCustomXmlNode.prototype.SetText = function(text)
ApiCustomXmlNode.prototype.SetXml = function (xml)
ApiCustomXmlNode.prototype.Delete = function()
ApiCustomXmlNode.prototype.GetParent = function()
ApiCustomXmlNode.prototype.Add = function(nodeName)
ApiCustomXmlNode.prototype.GetAttributes = function()
ApiCustomXmlNode.prototype.SetAttribute = function(name, value)
ApiCustomXmlNode.prototype.UpdateAttribute = function(name, value)
ApiCustomXmlNode.prototype.DeleteAttribute = function(name)
ApiCustomXmlNode.prototype.GetAttribute = function(name)

Content Control 与 Custom XML 数据绑定:

ApiInlineLvlSdt.prototype.SetDataBinding = function(xmlMapping)
ApiInlineLvlSdt.prototype.GetDataBinding = function()
ApiInlineLvlSdt.prototype.UpdateFromXmlMapping = function()
ApiInlineLvlSdt.prototype.GetDataForXmlMapping = function()
ApiBlockLvlSdt.prototype.SetDataBinding = function(xmlMapping)
ApiBlockLvlSdt.prototype.GetDataBinding = function()
ApiBlockLvlSdt.prototype.UpdateFromXmlMapping = function()
ApiBlockLvlSdt.prototype.GetDataForXmlMapping = function()

演示文稿 API 扩充:

ApiPresentation.prototype.AddMathEquation(sText, sFormat)

// 备注页
ApiNotesPage.prototype.GetBodyShape()
ApiNotesPage.prototype.AddBodyShapeText(sText)
ApiSlide.prototype.GetNotesPage()
ApiSlide.prototype.AddNotesText(sText)

// 获取演示对象
ApiPresentation.prototype.GetAllOleObjects()
ApiPresentation.prototype.GetAllCharts()
ApiPresentation.prototype.GetAllShapes()
ApiPresentation.prototype.GetAllImages()
ApiPresentation.prototype.GetAllDrawings()

// 模板
ApiMaster.prototype.GetAllLayouts()

文件元数据(ApiCore / ApiCustomProperties):

ApiCore.prototype.SetCategory = function (sCategory)
ApiCore.prototype.GetCategory = function ()
ApiCore.prototype.SetContentStatus = function (sStatus)
ApiCore.prototype.GetContentStatus = function ()
ApiCore.prototype.SetCreated = function (oCreated)
ApiCore.prototype.GetCreated = function ()
ApiCore.prototype.SetCreator = function (sCreator)
ApiCore.prototype.GetCreator = function ()
ApiCore.prototype.SetDescription = function (sDescription)
ApiCore.prototype.GetDescription = function ()
ApiCore.prototype.SetIdentifier = function (sIdentifier)
ApiCore.prototype.GetIdentifier = function ()
ApiCore.prototype.SetKeywords = function (sKeywords)
ApiCore.prototype.GetKeywords = function ()
ApiCore.prototype.SetLanguage = function (sLanguage)
ApiCore.prototype.GetLanguage = function ()
ApiCore.prototype.SetLastModifiedBy = function (sLastModifiedBy)
ApiCore.prototype.GetLastModifiedBy = function ()
ApiCore.prototype.SetLastPrinted = function (oLastPrinted)
ApiCore.prototype.GetLastPrinted = function ()
ApiCore.prototype.SetModified = function (oModified)
ApiCore.prototype.GetModified = function ()
ApiCore.prototype.SetRevision = function (sRevision)
ApiCore.prototype.GetRevision = function ()
ApiCore.prototype.SetSubject = function (sSubject)
ApiCore.prototype.GetSubject = function ()
ApiCore.prototype.SetTitle = function (sTitle)
ApiCore.prototype.GetTitle = function ()
ApiCore.prototype.SetVersion = function (sVersion)
ApiCore.prototype.GetVersion = function ()
ApiCustomProperties.prototype.AddStringProperty = function (sName, sValue)
ApiCustomProperties.prototype.AddNumberProperty = function (sName, nValue)
ApiCustomProperties.prototype.AddDateProperty = function (sName, oValue)
ApiCustomProperties.prototype.AddBoolProperty = function (sName, bValue)
ApiCustomProperties.prototype.GetPropertyValueByName = function (sName)

获取上述对象实例的方法:

ApiDocument.prototype.GetCore()
ApiDocument.prototype.GetCustomProperties()
Api.prototype.GetCore()
Api.prototype.GetCustomProperties()
ApiPresentation.prototype.GetCore()
ApiPresentation.prototype.GetCustomProperties()

Content Control 外观切换("boundingBox" / "hidden"):

ApiInlineLvlSdt.prototype.SetAppearance = function(type)
ApiInlineLvlSdt.prototype.GetAppearance = function()
ApiBlockLvlSdt.prototype.SetAppearance = function(type)
ApiBlockLvlSdt.prototype.GetAppearance = function()

表单角色与取值——9.0.0 为表单基类补充了角色与标签能力,并在创建表单时可通过 FormPrBase.role 设置角色:

ApiFormBase.prototype.GetTag = function()
ApiFormBase.prototype.SetTag = function(tag)
ApiFormBase.prototype.GetRole = function()
ApiFormBase.prototype.SetRole = function(role)
ApiDocument.prototype.GetFormsByRole = function(role)
ApiDocument.prototype.GetFormsByKey = function(key)
ApiDocument.prototype.GetFormKeysByRole = function(role)
ApiDocument.prototype.GetFormValueByKey = function(key)
ApiDateForm.prototype.SetDate = function(date)
ApiDateForm.prototype.GetDate = function()

字体槽(fontSlot):GetFontFamily 方法新增 fontSlot 参数("ascii"、"eastAsia"、"hAnsi"、"cs"),并通过主题自动计算字体:

ApiTextPr.prototype.GetFontFamily = function(fontSlot)

角色管理类 ApiFormRoles:

ApiDocument.prototype.GetFormRoles = function()
ApiFormRoles.prototype.Add = function(name, props)
ApiFormRoles.prototype.Remove = function(name, delegateRole)
ApiFormRoles.prototype.GetCount = function()
ApiFormRoles.prototype.GetAllRoles = function()
ApiFormRoles.prototype.HaveRole = function(name)
ApiFormRoles.prototype.GetRoleColor = function(name)
ApiFormRoles.prototype.SetRoleColor = function(name, color)
ApiFormRoles.prototype.MoveUp = function(name)
ApiFormRoles.prototype.MoveDown = function(name)

Plugins:文档编辑器中可通过插件为 Content Control 添加自定义按钮。

5.4 9.0.1~9.0.4 修复与补充

  • 9.0.1:无公开发布;
  • 9.0.2:修复页眉/页脚计算、打开含协作变更文档的首次计算、XLSX 导出 PDF 崩溃、DocSpace 中填写的 PDF Forms 打开等问题;Modern 主题默认 Tab 样式改为 Line;
  • 9.0.3:表格单元格区域可按图片插入(navigator.clipboard,对应 DocumentServer#985);新增 customization.toolbarHideFileName 隐藏工具栏文档标题;修复含 CJK 字体的文件导出 PDF 时体积显著增大问题(DocumentServer#2934)等;
  • 9.0.4:支持 woff2 字体;File 菜单新增 Suggest a Feature;新增 customization.suggestFeature 参数;服务端发行版(ONLYOFFICE 品牌)内置 AI、Photo Editor、MathType、OCR、Typograf、Doc2md、LanguageTool、DeepL、Thesaurus、Speech input、Zotero 等插件;修复大量转换崩溃(DOC/DOCX/ODT/ODS/PPTX/XLSM/KEY→各格式经 x2t)。

六、表单(Forms)与 PDF 编辑器演进专题

表单与 PDF 是 7.x 以来投入最大的两条产品线,CHANGELOG 中有清晰的时间线:

  • 7.5.0:PDF 编辑器开始支持 PDF 表单、注释、评论与绘图;
  • 8.0.0:表单从 OFORM 切换为符合 OOXML 规范的 PDF 格式(附旧 OFORM 文件转 PDF 的对话框);单选按钮新增"选中项名称"设置;新增 formsdataurl 回调参数(提交时携带已填表单数据的 json 链接,替代 formdata);
  • 8.1.0:表单直接以 PDF 格式呈现(不再使用 DOCXF);固定表单插入时不再自动换行置于文本前;必填字段边框厚度在任何缩放下恒为 2px;查看/填写模式新增切换编辑模式按钮(依赖集成方订阅 onRequestEditRights 事件与 permissions.edit 权限);
  • 8.2.0:新增可上传预制备图片的 Signature 字段;PDF 编辑器支持保存到存储、PDF 协同编辑、裁剪/组合形状处理、渐变与文本识别改进;
  • 8.3.0:PDF 编辑器支持 Stamp 注释、渐变、多页选择(Ctrl/Shift 组合操作)、注释不透明度、高亮/删除线/下划线快捷面板;表单默认固定文本框尺寸增大;
  • 9.0.0:PDF 表单编辑器落地、页面跨文件复制、Signature/Image 字段占位常显、"type": "signature" 类型;
  • 9.1.0:PDF 编辑器 Redact 脱敏、SmartArt、图表、注释新类型、图形与表单复制粘贴;
  • 9.2.0:为字段选择接收角色、复选框/单选按钮标签、隐藏文本(Redact)颜色修改、第三方公式插入;
  • 9.3.0:签名设置窗口(手绘与文字)、固定表单拉伸适配表格单元格、Protection 选项卡、PDF 版本历史、Link 注释、嵌入字体继续编辑、辅助工具栏脱敏、打印参数;
  • 9.4.0:签名图片缓存至 localStorage、Send for signing 与 Filling status 面板、签名表单 API 类(见 2.5 节)。

七、定制参数(Customization)汇总

CHANGELOG 中的 customization 配置演进是集成方最常查阅的内容,按引入版本汇总如下:

参数 引入版本 说明
customization.font.size 7.4.0 界面元素字号(按钮、选项卡、标签等),扩展许可可用
customization.layout.toolbar.draw 7.4.0 隐藏/显示 Draw 选项卡,扩展许可可用
customization.font.name 7.3.0 界面字体名称,扩展许可可用
customization.layout.leftMenu.mode / rightMenu.mode 7.3.0 左右面板初始显示状态
customization.features.roles 8.1.0 PDF 表单角色配置功能开关,默认 true
customization.close.visible / close.text 8.1.0 关闭按钮可见性及提示文本('Close file')
customization.logo.visible / image / imageDark 8.1.0 移动端与嵌入模式 logo 显隐、浅色/深色头部 logo
customization.layout.header.editMode 8.1.0 隐藏头部编辑模式切换按钮,默认 true
customization.features.featuresTips 8.3.1 隐藏新功能提示,false/true
customization.mobile.info 8.3.0 移动端隐藏 Document Info 按钮
customization.pointerMode 8.3.0 打开时默认光标类型:'hand'/'select'
customization.compactToolbar 8.3.0 查看模式下支持紧凑工具栏
customization.slidePlayerBackground 8.3.0 幻灯片放映模式背景
customization.wordHeadingsColor 8.3.0 标题样式默认颜色
customization.submitForm 8.3.0 提交已填表单按钮的设置(见下)
customization.features.tabStyle.mode/change、tabBackground.mode/change 8.2.0 Tab 样式与背景外观
customization.logo.imageLight / imageDark 8.2.0 浅色/深色头部 logo URL
customization.forceWesternFontSize 9.0.0 西文/中文首选字号强制项
customization.layout.header.user 9.0.0 隐藏头部用户头像/首字母图标,扩展许可可用
customization.suggestFeature 9.0.4 File 菜单 Suggest a Feature 项
customization.toolbarHideFileName 9.0.3 隐藏工具栏中的文档标题

customization.submitForm 在 8.3.0 起的结构为:

submitForm:
  visible: true/false        —— 控制按钮显示(默认 true)
  resultMessage: 'text'/''/null/undefined
      ''(空串)—— 不显示消息
      null/undefined —— 显示默认文本
      'text' —— 显示自定义消息

同时保留向后兼容:旧版本中 submitForm 以 true/false 控制按钮可见性。

此外 8.2.0 扩展了 editorConfig.region 参数(决定默认度量单位:us-...、ca-... 区域默认英寸,除非 customization.unit 另行指定;同时设定电子表格默认数字与日期/时间格式),并停止支持 editorConfig.location;customization.toolbarNoTabs 被 features.tabStyle=line 与 features.tabBackground=toolbar 取代;goback.requestClose 不再支持。

八、后端、存储与 WOPI 配置演进

8.1 数据库与存储

  • 4.1.2:后端从 MySQL 迁移至 PostgreSQL;支持 ipfilter 用户过滤;
  • 8.0.0:新增 Oracle 与 MS SQL Server 支持(oracle/mssql 数据库类型),Oracle 高级连接设置 oracleExtraOptions,MSSQL 为 msSqlExtraOptions;
  • 8.1.0:新增 services.CoAuthoring.server.editorStatStorage(许可与统计数据存储位置)与 persistentStorage(分离缓存文件与遗忘/错误文件存储);MySQL 支持 SSL/TLS 连接;
  • 8.2.0:新增 mysqlExtraOptions(node-mysql2 附加连接参数,含 SSL);9.1.0 增加 oracleExtraOptions.thin、pgPoolExtraOptions、DB_SCHEMA;9.0.0 增加 Azure Blob Storage(storage.name = "storage-az")与 storage.useDirectStorageUrls;
  • 9.4.0:组件整合后移除数据库依赖;
  • 5.x 时代多次移除/降级 Redis(5.5.0 起开源版不再要求 Redis;7.4.0 提及 cluster 连接选项 optionsCluster、iooptionsClusterNodes、iooptionsClusterOptions)。

8.2 版本文件更新与 Service Worker

8.3.0 引入"文件版本变化时无需重启即可更新编辑器"的方案:集成方需处理 onRequestRefreshFile 事件,调用 refreshFile 方法并传入推荐打开文档的数据;WOPI 场景下文件版本自动更新,无需集成方改动;未实现新方案的集成方沿用 onOutdatedVersion 事件。同时新增 Service Worker 控制编辑器页面静态资源缓存;drop 命令(不带 users 参数时)现在会关闭所有正在编辑该 key 文档的用户。新增集成方事件 onUserActionRequired(打开文件需要输入密码或选择编码/分隔符时触发)。

8.3 WOPI

  • 6.4.0:首次支持 WOPI 协议;6.4.1 起 WOPI 默认禁用(WOPI_ENABLED 环境变量);
  • 8.1.0:WOPI 支持 Save Copy as(PutRelativeFile);PDF 表单填写模式下启用 formsubmit discovery action;docs_api_config 参数向 Docs API 传递部分打开配置;WOPISrc 查询参数用于请求落到单一服务器(Docs API 则以 document key 写入 WOPISrc);WOPISrc 与 shardkey 均可作为分片键;
  • 8.2.0:convert-to 请求新增 Password 与 PasswordToOpen 参数;
  • 9.1.0:CheckFileInfo 支持 UserCanOnlyComment;无法加锁时以查看模式打开并报错;
  • 7.3.0:新增 /cool/convert-to/<format> 与 /lool/convert-to/<format> 转换服务(WOPI 协议),以及旧格式文件转换页面;客户端库从 sockjs 换为 socket.io。

九、安全修复全景(重点 CVE 与攻击向量)

CHANGELOG 的安全条目可归纳为几类,按时间顺序列举关键项:

  • XLS→XLSX 转换类:8.0.1、8.1.0、8.1.1、8.2.0、9.2.1、9.3.0、9.4.0 持续修复 ChartSheetSubstream、GlobalsSubstream、WorkBookStream、PtgName 系列、CDataStream::ReadEmrTextBase、CSvmFile::Read_META_BMP 等函数中的越界读取、缓冲区溢出、段错误与内存操纵问题(部分可致信息泄露、ASLR 绕过乃至 RCE);
  • XSS 类:涉及 Color theme name、多级列表 Font 字段、评论编辑 textarea、Animation Pane 提示、Shape name、Math Autocorrect、Number format 列表、Sheet name、Dropdown List、denyEditingRights、动态 import() 宏执行(CVE-2021-43446、CVE-2023-50883、CVE-2024-44085)、Convert-and-edit-wopi.ejs 等;
  • 路径穿越/任意文件读写:CVE-2021-25833(Convert Service 参数)、5.6.2 savefile 参数、CVE-2021-3199(图片上传参数)、x2t 转换写任意文件、EPUB 转换读任意文件;
  • 宏与沙箱:9.4.0 修复 sloppy-mode this/eval 绕过宏沙箱;7.2.0 默认启用随机 JWT 密钥(修复 CVE-2021-43444、CVE-2021-43445、CVE-2021-43447、CVE-2021-43448、CVE-2021-43449),升级 nodejs 修复 CVE-2022-32212,宏执行连接其他主机时显示警告(CVE-2021-43446);
  • 依赖组件:9.2.0 升级 Redis(CVE-2025-49844)与 linux-libc-dev(CVE-2025-38352、CVE-2025-40300);
  • 其他:GUID 可预测性(9.4.0)、createDecipheriv 不安全算法(8.3.0)、fs.folderPath 文件系统访问(8.1.0)、commandSetPassword 越权设密(8.1.0)、DOC 转换链中的堆溢出(8.2.0)、CVE-2023-30186 内存耗尽(7.3.3)、CVE-2022-47412 搜索替换面板 XSS(7.3.3)。

十、插件(Plugins)与宏

插件体系在各版本持续强化:

  • 9.0.4:服务端发行版内置 AI、Photo Editor、MathType、OCR、Typograf、Doc2md、LanguageTool、DeepL、Thesaurus、Speech input、Zotero 插件;
  • 9.1.0:插件可用 GetCurrentAddinField 等新方法;
  • 9.2.0:AI 插件新增 Grammar & Spelling 检查;
  • 9.3.0:新增 SelectAddinField/RemoveAddinField、IsFormSigned、GoToPage、MoveCursorToField/MoveCursorOutsideField 等插件方法;
  • 8.x:插件可修改界面(8.1.0);SearchNext/SearchPrevious 高亮搜索;api.prototype.Undo/Redo/CanUndo/CanRedo(8.2.0);pluginsmanager 工具用于服务器端安装/卸载插件(7.4.0);8.2.0 起商业版要求经 Plugin Manager 安装插件;
  • 5.x~7.x:系统插件与并行插件方案(5.0.3)、插件市场(7.2.0)、背景插件移入按钮菜单(8.0.0)、多可视化插件并行(8.0.0)、Developer mode for Plugin Manager(7.5.0)。

宏方面:7.2.0 起默认 JWT 随机密钥并强化宏执行安全提示;9.0.0 引入 AI 宏生成与 VBA 转 JavaScript;9.2.0 支持录制动作为宏;9.3.0 更新全部编辑器的宏录制;9.3.0 为 PDF 编辑器开放增删改页面/表单/注释/图形/表格/图片/图表的宏 API。

十一、历史版本里程碑(7.x 及以前)

7.x 系列(2023 年前后):

  • 7.0.0:Content Controls 与文件比较在开源版开放;全新的表单创建/填写/共享模式;深色模式;电子表格 Sheet Views 开源化;版本历史;
  • 7.1.0:PDF/XPS/DjVu 新查看器(全部客户端渲染);动画窗格;幻灯片母版编辑模式;GETPIVOTDATA、IMPORTRANGE 函数;移动端深色主题;
  • 7.2.0:默认随机密钥 JWT;新界面语言 pt-PT、zh-TW 等;新插件市场;Live viewer(查看模式实时看变化);
  • 7.3.0:方程双模式(Unicode/LaTeX);文档编辑保护限制;Watch Window;TEXTBEFORE/TEXTAFTER/TEXTSPLIT 等新函数;表单新字段(日期时间、邮编、信用卡);角色管理;旧二进制格式自动转 OOXML;
  • 7.4.0:Draw 选项卡;吸管取色;雷达图;MHTML/SXC/ET/ETT/SXI/DPS/DPT/SXV/STW/WPS/WPT 格式支持;Solver 前的函数扩充(SEQUENCE、XMATCH、EXPAND、FILTER、SORT 等);
  • 7.5.0:自动断字;SORTBY;Morph 过渡;PDF 表单/注释/评论/绘图支持;getForgotten/deleteForgotten/getForgottenList 命令;formdata 回调参数。

6.x 系列:

  • 6.0.0:透视表完整支持;条件格式数据条全量支持;切片器;特殊粘贴;工作表跨簿移动;LINEST 函数;
  • 6.1.0:HTML 类格式(ePub/mht/html)彻底重做;行号显示;交叉引用;尾注;Sheet View(付费版);
  • 6.2.0:图表目录插入;透视表切片器;数据验证设置;GROWTH/TREND/LOGEST/UNIQUE/RANDARRAY;
  • 6.3.0:界面主题;150% 缩放;拼写检查器改为 SharedWorker;密码保护;组合图表;XLOOKUP;脚注保存至文件;
  • 6.4.0:首次支持 WOPI 协议;125%/175% 缩放;Simple markup 审阅模式;条件格式编辑;迷你图;sparklines;移动端编辑器 React 重写。

5.x 系列:5.0.0(透视表读写、69 个新函数、演示备注与视频);5.4.0(水印、批注 @提及、页眉页脚、拼写检查);5.5.0(文件比较与 Content Controls,付费版;移除 nodejs 依赖,各服务单一二进制);5.6.0 起更换版本编号方案;6.0.0 起更名为 ONLYOFFICE Docs。

4.x 系列:4.1.2 后端换用 PostgreSQL;4.2.0 脚注编辑、迷你图、SUMIFS;4.3.0 HiDPI 全支持、43 种拼写语言、自定义端口、强制保存;4.4.x 特殊粘贴、富文本内容支持、ACOT/ACOTH/BETA.DIST/IFNA/XOR 等大批新函数、x2t 打开速度 Windows 200%/Linux 20% 提升。

十二、如何利用 CHANGELOG 做技术决策

  1. 定位功能引入版本:本文第二章至第五章按版本索引了 9.x 的编辑器能力与 API,需要确认某个能力是否可用时,直接对照对应版本号与 CHANGELOG.md 原文;
  2. 升级评估:关注每版的 Back-end 与 Security 段落——9.4.0 的架构收敛(去 RabbitMQ/DB)、8.x 的数据库选型变化、7.2.0 的 JWT 默认密钥策略,都是升级前必须确认的破坏性/配置性变更;
  3. API 开发对照:Builder API(ApiXxx.prototype.Yyy)与插件方法(window.Asc.plugin.executeMethod)均以代码块形式记录在 CHANGELOG 中,可作为开发文档自动化的速查表;电子表格的 ListObject/Sort、表单的 ApiFormBase/Signature、演示的动画时间线与过渡类,是三大编辑器自动化的核心增量;
  4. 安全基线:将历次安全修复(第九节)作为自查清单,评估旧版本部署的暴露面,特别是 XLS 转换、WOPI、宏执行与 JWT 相关条目;
  5. 配套资料:产品定位、组件构成与版本版对比可查阅 Readme.md,长期规划见 ROADMAP.md。

结语

ONLYOFFICE Docs 的 CHANGELOG 不只是流水账,而是一部可检索的技术演进档案:它记录了表单与 PDF 从无到有、协作与安全机制逐步成型、API 覆盖面从段落样式扩展到表格对象/几何路径/动画时间线的全过程。9.4.0 的单进程架构更是为部署复杂度画上了阶段性句号。对集成方、插件开发者与运维人员而言,按版本索引本文所列的功能、参数与方法,即可在升级、定制与自动化开发中做到"知其然,也知其所以然"。

登录后查看全文
DocumentServer