feat(签章能力): 优化签章画布定位交互
build.yaml / build (push) Successful in 45s

This commit is contained in:
xiaoqidun committed 2026-09-27 23:41:18 +08:00
1 parent 31e67b2721
commit 5842522edf
12 files changed
+465 -42

No files matched your search

+15 -1
View File
@@ -112,6 +112,20 @@ func (p *pdfImporter) appearanceAnnotation(ctx context.Context, page *pdfgo.Page
p.report.Warnings = append(p.report.Warnings, pdfgo.Diagnostic{Page: p.page + 1, Message: "PDF darken stamp appearance flattened over page content"})
}
converted := Annotation{Type: pdfAnnotationType(annotation.Subtype), Subtype: string(annotation.Subtype), Appearance: Appearance{Boundary: pdfBoundary(box), Objects: stamp.objects}}
popupObject := annotation.Dictionary["Popup"]
if annotation.Subtype == "Popup" {
popupObject = annotation.Dictionary
}
if popupObject != nil {
popup, err := p.reader.ReadPopupAnnotation(popupObject)
if err != nil {
return err
}
converted.Parameters = &AnnotationParameters{Parameter: []AnnotationParameter{
{Name: "PDF.Popup.Open", Value: strconv.FormatBool(popup.Open)},
{Name: "PDF.Popup.Rect", Value: fmt.Sprintf("%g %g %g %g", popup.Rect.XMin, popup.Rect.YMin, popup.Rect.XMax, popup.Rect.YMax)},
}}
}
if len(actions) != 0 {
region, err := NewShape(ShapeRectangle, Box{W: box.W, H: box.H})
if err != nil {
@@ -220,7 +234,7 @@ func pdfAnnotationType(subtype pdfgo.Name) string {
return "Watermark"
case "Highlight", "Underline", "Squiggly", "StrikeOut":
return "Highlight"
case "Text", "FreeText", "Line", "Square", "Circle", "Polygon", "PolyLine", "Caret", "Ink", "FileAttachment", "Sound", "Movie", "Screen", "Link":
case "Text", "FreeText", "Line", "Square", "Circle", "Polygon", "PolyLine", "Caret", "Ink", "FileAttachment", "Sound", "Movie", "Screen", "Link", "Popup":
return "Path"
}
return ""