feat(前端界面): OFDGo WebUI支持设置DPI
build.yaml / build (push) Successful in 32s

This commit is contained in:
2026-07-09 14:10:25 +08:00
parent 3fab819246
commit 89577ea72f
5 changed files with 44 additions and 4 deletions
+4
View File
@@ -30,6 +30,7 @@ import (
// OpenOptions 打开OFD文档选项
type OpenOptions struct {
Fonts []FontFile
DPI float64
RenderAnnotations bool
}
@@ -186,6 +187,9 @@ func Open(data []byte, opts OpenOptions) (*Session, error) {
return nil, err
}
var rendererOptions []ofdgo.RendererOption
if opts.DPI > 0 {
rendererOptions = append(rendererOptions, ofdgo.WithDPI(opts.DPI))
}
if len(opts.Fonts) > 0 {
fontFS := ofdgo.NewFontFS(opts.Fonts)
if fontFS.Len() == 0 {