feat(注解字形): 优化注解字形与页面写出
build.yaml / build (push) Successful in 45s

This commit is contained in:
xiaoqidun committed 2026-10-04 13:35:47 +08:00
1 parent 5d599dc835
commit 290fc57c34
17 files changed
+220 -38

No files matched your search

+10 -1
View File
@@ -27,18 +27,24 @@ import (
// 入参: ctx 取消上下文, page PDF页面, strict 严格检查开关
// 返回: error 错误信息
func (p *pdfImporter) annotations(ctx context.Context, page *pdfgo.Page, strict bool) error {
annotations, err := page.Annotations()
annotations, err := page.AnnotationsContext(ctx)
if err != nil {
return err
}
parents := make(map[pdfgo.Reference]int)
for i, annotation := range annotations {
if err := ctx.Err(); err != nil {
return err
}
if annotation.Reference != (pdfgo.Reference{}) && annotation.Subtype != "Popup" {
parents[annotation.Reference] = i
}
}
attached := make(map[int]bool)
for i, annotation := range annotations {
if err := ctx.Err(); err != nil {
return err
}
if annotation.Subtype != "Popup" {
continue
}
@@ -61,6 +67,9 @@ func (p *pdfImporter) annotations(ctx context.Context, page *pdfgo.Page, strict
}
}
for i, annotation := range annotations {
if err := ctx.Err(); err != nil {
return err
}
if attached[i] {
continue
}