|
@@ -832,19 +832,55 @@ let KMPDFDynamicStampNeedAuthorKey1 = "km_pdfview_dynamic_stamp_need_author"
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private func updateAnnotation() {
|
|
|
+ if annotationModel?.annotation != nil {
|
|
|
+ for tAnnotation in annotations {
|
|
|
+ if tAnnotation is CPDFListStampAnnotation{
|
|
|
+ (tAnnotation as? CPDFListStampAnnotation)?.updateAppearanceStream()
|
|
|
+ } else if tAnnotation is CPDFListSignatureAnnotation {
|
|
|
+ (tAnnotation as? CPDFListSignatureAnnotation)?.updateAppearanceStream()
|
|
|
+ }
|
|
|
+ pdfView?.setNeedsDisplayAnnotationViewFor(tAnnotation.page)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if annotationModel?.annotations != nil {
|
|
|
+ if annotation is CPDFListStampAnnotation {
|
|
|
+ sampleImageView.image = (annotationModel?.annotation as! CPDFListStampAnnotation).stampImage()
|
|
|
+ } else if annotation is CPDFListSignatureAnnotation {
|
|
|
+ sampleImageView.image = (annotationModel?.annotation as! CPDFListSignatureAnnotation).signImage
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// MARK: Button Method
|
|
|
|
|
|
@IBAction func opacitySliderAction(_ sender: Any) {
|
|
|
for tAnnotation in self.annotations {
|
|
|
let opacity = self.opacitySlider.floatValue
|
|
|
- self.pdfView?.setStampAnnotation(((tAnnotation) as! KMAnnotationStamp), forImageAlpha: CGFloat(opacity))
|
|
|
+ if tAnnotation is CPDFListStampAnnotation {
|
|
|
+ self.pdfView?.setStampAnnotation(((tAnnotation) as! CPDFListStampAnnotation), forImageAlpha: CGFloat(opacity))
|
|
|
+ } else if tAnnotation is CPDFListSignatureAnnotation {
|
|
|
+ self.pdfView?.setSignatureAnnotation(((tAnnotation) as! CPDFListSignatureAnnotation), forImageAlpha: CGFloat(opacity))
|
|
|
+ }
|
|
|
+ annotationModel?.setOpacity(CGFloat(opacity))
|
|
|
+ opacityComboBox.stringValue = "\(Int(opacity * 100))%"
|
|
|
+ updateAnnotation()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@IBAction func opacityComboBoxAction(_ sender: Any) {
|
|
|
for tAnnotation in self.annotations {
|
|
|
let opacity = CGFloat(self.opacityComboBox.intValue) / 100
|
|
|
- self.pdfView?.setStampAnnotation(((tAnnotation ) as! KMAnnotationStamp), forImageAlpha: CGFloat(opacity))
|
|
|
+// if tAnnotation is CPDFListStampAnnotation {
|
|
|
+// self.pdfView?.setStampAnnotation(((tAnnotation) as! CPDFListStampAnnotation), forImageAlpha: CGFloat(opacity))
|
|
|
+// } else if tAnnotation is CPDFListSignatureAnnotation {
|
|
|
+// self.pdfView?.setSignatureAnnotation(((tAnnotation) as! CPDFListSignatureAnnotation), forImageAlpha: CGFloat(opacity))
|
|
|
+// }
|
|
|
+ annotationModel?.setOpacity(CGFloat(opacity))
|
|
|
+ opacitySlider.floatValue = Float(opacity)
|
|
|
+ opacitySlider.toolTip = "\(Int(opacity * 100))%"
|
|
|
+ updateAnnotation()
|
|
|
}
|
|
|
}
|
|
|
|