mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-29 15:06:46 +08:00
This commit is contained in:
1 parent
66f0d8a928
commit
2ea937b7be
11 files changed
+641
-19
No files matched your search
+15
-1
@@ -39,6 +39,7 @@ func RunWASM() {
|
||||
registerCallback("ofdgoDocumentInfo", documentInfo)
|
||||
registerCallback("ofdgoAttachmentData", attachmentData)
|
||||
registerCallback("ofdgoRenderPage", renderPage)
|
||||
registerCallback("ofdgoSearchPage", searchPage)
|
||||
registerCallback("ofdgoExportFormats", exportFormats)
|
||||
registerCallback("ofdgoExportPage", exportPage)
|
||||
registerCallback("ofdgoExportPDF", exportPDF)
|
||||
@@ -118,7 +119,10 @@ func configureDocument(args []js.Value) (any, error) {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
currentSession.Renderer.RenderAnnotations = args[1].Bool()
|
||||
if currentSession.Renderer.RenderAnnotations != args[1].Bool() {
|
||||
currentSession.Renderer.RenderAnnotations = args[1].Bool()
|
||||
clear(currentSession.textCache)
|
||||
}
|
||||
return currentSession.Summary(), nil
|
||||
}
|
||||
|
||||
@@ -181,6 +185,16 @@ func renderPage(args []js.Value) (any, error) {
|
||||
}), nil
|
||||
}
|
||||
|
||||
// searchPage 搜索OFD页面文字
|
||||
// 入参: args 浏览器参数
|
||||
// 返回: any 搜索结果, error 错误信息
|
||||
func searchPage(args []js.Value) (any, error) {
|
||||
if currentSession == nil {
|
||||
return nil, fmt.Errorf("ofd document is not opened")
|
||||
}
|
||||
return currentSession.SearchPage(args[0].Int(), args[1].String())
|
||||
}
|
||||
|
||||
// exportFormats 获取导出格式
|
||||
// 入参: args 浏览器参数
|
||||
// 返回: any 导出格式, error 错误信息
|
||||
|
||||
Reference in new issue
Block a user