feat(功能增强): 支持全文全选复制,完善选区取消
build.yaml / build (push) Successful in 38s

This commit is contained in:
xiaoqidun committed 2026-09-14 15:12:06 +08:00
1 parent a4ae065d43
commit 651e3cf5b5
4 files changed
+135 -8

No files matched your search

+18
View File
@@ -289,6 +289,24 @@ func (s *Session) PageText(index int) (*ofdgo.PageText, error) {
return text, nil
}
// PageTextString 获取页面原文,不为全文复制保留额外的页面和文字索引
// 入参: index 页面索引
// 返回: string 页面原文, error 错误信息
func (s *Session) PageTextString(index int) (string, error) {
text := s.textCache[index]
if text == nil {
page, err := s.Reader.PageContentByIndex(index)
if err != nil {
return "", err
}
text, err = s.Renderer.PageText(page)
if err != nil {
return "", err
}
}
return text.String(), nil
}
// SearchPage 搜索指定页面,复用当前会话的文字索引
// 入参: index 页面索引, query 搜索文字
// 返回: []ofdgo.TextMatch 匹配结果, error 错误信息