PDF 生成模板编辑器
开源可视化 PDF 生成引擎,支持自定义模板,并提供面向开发者的 API,灵活构建文档生成流程。
ComPDFKit_Tools 提供两种搜索工具栏:阅读模式下的 搜索工具栏 和内容编辑模式下的 搜索替换工具栏。
通过 GlobalConfig 中的 searchConfig 配置搜索高亮样式:
{
"global": {
"searchConfig": {
"searchHighlightColor": "#FFFF00",
"currentSearchHighlightColor": "#FF8000"
}
}
}| 字段 | 说明 |
|---|---|
searchHighlightColor | 匹配结果的高亮颜色 |
currentSearchHighlightColor | 当前焦点匹配项的高亮颜色 |
CSearchToolbar 是阅读模式下的搜索工具栏,位于 com.compdfkit.tools.viewer.pdfsearch 包中。
功能包括:
搜索工具栏通过以下方式触发:
toolbarRightItems 中包含 "search"CSearchReplaceToolbar 在内容编辑模式下使用,支持搜索并替换文本内容。
功能包括:
| 组件 | 说明 |
|---|---|
CSearchToolbar | 阅读模式搜索工具栏 |
CSearchReplaceToolbar | 内容编辑模式搜索替换工具栏 |
CSearchResultListFragment | 搜索结果列表 Fragment |
CSearchResultListAdapter | 搜索结果列表适配器 |
在内容编辑模式下,搜索替换的上下文菜单通过 contextMenuConfig.contentEditorMode.searchReplace 配置:
{
"contextMenuConfig": {
"contentEditorMode": {
"searchReplace": [
{ "key": "replace" }
]
}
}
}