Browse Source

【综合】签名注释复制逻辑优化

niehaoyu 8 months ago
parent
commit
7344c09d4a

+ 7 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListViewExtension/CPDFListView+Function.swift

@@ -38,6 +38,13 @@ extension CPDFListView {
                     let imagePath = KMStampManager.defaultManager.addStampToFolder(withImage: image)
                     let newImage = NSImage(contentsOfFile: imagePath)
                     newAnnotation = CPDFStampAnnotation(document: self.document, image: newImage)
+                } else if let stampAnnotation = annotation as? CPDFListSignatureAnnotation {
+                    newAnnotation = CPDFListSignatureAnnotation(document: self.document)
+                    (newAnnotation as! CPDFListSignatureAnnotation).setImage(stampAnnotation.signImage)
+                    if stampAnnotation.stamp != nil {
+                        newAnnotation?.updateAppearanceStream()
+                        (newAnnotation as? CPDFListSignatureAnnotation)?.setBorderBounds(stamp: stampAnnotation.stamp!)
+                    }
                 } else if let stampAnnotation = annotation as? CPDFSignatureAnnotation {
                     newAnnotation = CPDFSignatureAnnotation(document: self.document)
                     (newAnnotation as! CPDFSignatureAnnotation).setImage(stampAnnotation.signImage)