Guides
全局配置
GlobalConfig 控制应用级的全局行为,包括主题模式、文件保存策略、BOTA 面板、搜索高亮、缩略图、页面编辑器等。
配置字段总览
| 字段 | 类型 | 默认值 | 说明 |
|---|---|---|---|
themeMode | String | "system" | 应用主题模式 |
fileSaveExtraFontSubset | boolean | true | 保存时是否嵌入字体子集 |
useSaveIncremental | boolean | true | 是否使用增量保存 |
signatureType | String | "manual" | 默认签名类型 |
enableExitSaveTips | boolean | true | 退出时是否显示保存提示 |
enableErrorTips | boolean | true | 是否显示错误提示 |
主题模式
themeMode 控制应用的整体主题:
| 值 | 说明 |
|---|---|
light | 浅色模式 |
dark | 深色模式 |
system | 跟随系统(默认) |
json
{
"global": {
"themeMode": "system"
}
}
themeMode控制的是应用 UI 框架主题(状态栏、工具栏背景等),与readerViewConfig.themes控制的 PDF 页面阅读主题不同。参见 主题与样式 了解两者区别。
保存行为
json
{
"global": {
"fileSaveExtraFontSubset": true,
"useSaveIncremental": true,
"enableExitSaveTips": true
}
}| 字段 | 说明 |
|---|---|
fileSaveExtraFontSubset | 保存时嵌入字体子集,确保编辑过的文本在其他设备上正确显示 |
useSaveIncremental | 增量保存仅追加变更数据到文件末尾,速度快但文件可能逐渐增大 |
enableExitSaveTips | 退出文档时若有未保存更改,弹出保存提示对话框 |
签名类型
json
{
"global": {
"signatureType": "manual"
}
}| 值 | 说明 |
|---|---|
manual | 手写签名(默认) |
digital | 数字签名 |
electronic | 电子签名 |
水印配置
global.watermark 配置水印对话框的默认值:
json
{
"global": {
"watermark": {
"types": ["text", "image"],
"saveAsNewFile": false,
"text": "",
"image": "tools_logo",
"textSize": 80,
"textColor": "#FF000000",
"scale": 1.0,
"rotation": -45,
"opacity": 255,
"isFront": false,
"isTilePage": false
}
}
}| 字段 | 说明 |
|---|---|
types | 可用水印类型:text(文本)、image(图片) |
saveAsNewFile | 是否保存为新文件 |
text | 默认文本内容 |
image | 默认图片资源名(drawable 中的资源) |
textSize | 文本字号 |
textColor | 文本颜色 |
scale | 缩放比例 |
rotation | 旋转角度 |
opacity | 不透明度(0-255) |
isFront | 是否在页面前景(true)或背景(false) |
isTilePage | 是否平铺到整个页面 |
缩略图配置
json
{
"global": {
"thumbnail": {
"title": "",
"backgroundColor": "",
"editMode": true
}
}
}| 字段 | 说明 |
|---|---|
title | 缩略图面板标题 |
backgroundColor | 背景颜色 |
editMode | 是否启用缩略图编辑模式(支持页面拖拽排序、删除等) |
BOTA 面板配置
BOTA(Book Of Annotations)面板包含大纲、书签和注释列表三个标签页。
json
{
"global": {
"bota": {
"tabs": ["outline", "bookmark", "annotations"],
"menus": {
"annotations": {
"global": [
{ "id": "importAnnotation" },
{ "id": "exportAnnotation" },
{ "id": "removeAllAnnotation" },
{ "id": "removeAllReply" }
],
"item": [
{
"id": "reviewStatus",
"subMenus": ["accepted", "rejected", "cancelled", "completed", "none"]
},
{ "id": "markedStatus" },
{
"id": "more",
"subMenus": ["addReply", "viewReply", "delete"]
}
]
}
}
}
}
}BOTA 标签页
| 值 | 说明 |
|---|---|
outline | 文档大纲(目录) |
bookmark | 书签 |
annotations | 注释列表 |
注释列表菜单
全局菜单(global):作用于整个注释列表的操作。
| id | 说明 |
|---|---|
importAnnotation | 导入注释 |
exportAnnotation | 导出注释 |
removeAllAnnotation | 删除所有注释 |
removeAllReply | 删除所有回复 |
条目菜单(item):作用于单个注释条目的操作。
| id | 说明 |
|---|---|
reviewStatus | 审核状态(子菜单:accepted/rejected/cancelled/completed/none) |
markedStatus | 标记状态 |
more | 更多操作(子菜单:addReply/viewReply/delete) |
搜索高亮配置
json
{
"global": {
"search": {
"normalKeyword": {
"borderColor": "#00000000",
"fillColor": "#77FFFF00"
},
"focusKeyword": {
"borderColor": "#00000000",
"fillColor": "#CCFD7338"
}
}
}
}| 字段 | 说明 |
|---|---|
normalKeyword | 普通搜索结果的高亮样式(边框色 + 填充色) |
focusKeyword | 当前聚焦的搜索结果高亮样式 |
页面编辑器配置
json
{
"global": {
"pageEditor": {
"menus": [
"insertPage",
"replacePage",
"extractPage",
"copyPage",
"rotatePage",
"deletePage"
]
}
}
}| 菜单项 | 说明 |
|---|---|
insertPage | 插入页面 |
replacePage | 替换页面 |
extractPage | 提取页面 |
copyPage | 复制页面 |
rotatePage | 旋转页面 |
deletePage | 删除页面 |