feat(注解转换): 完善注解转换与状态保留
build.yaml / build (push) Successful in 45s

This commit is contained in:
xiaoqidun committed 2026-09-28 17:00:10 +08:00
1 parent 1d365d29db
commit 95dea33a95
4 files changed
+33 -8

No files matched your search

+15
View File
@@ -65,6 +65,21 @@ func (p *pdfImporter) annotations(ctx context.Context, page *pdfgo.Page, strict
continue
}
dict := annotation.Dictionary
if annotation.Subtype == "Text" {
value, err := p.reader.Resolve(dict["Open"])
if err != nil {
return err
}
if value != nil && value != pdfgo.Boolean(false) && value != pdfgo.Boolean(true) {
return fmt.Errorf("invalid PDF text annotation open state")
}
if value == pdfgo.Boolean(true) {
if strict {
return &pdfgo.UnsupportedError{Feature: "initially open text annotation"}
}
p.warning(pdfgo.Diagnostic{Page: p.page + 1, Message: "PDF text annotation open state retained as annotation parameter"})
}
}
popupObject := dict["Popup"]
if annotation.Subtype == "Popup" {
popupObject = dict