|
@@ -427,6 +427,15 @@ class CDSignatureCertificateCustomViewController: NSViewController, NSTextFieldD
|
|
|
openPanel.beginSheetModal(for: self.view.window!) { result in
|
|
|
if result == .OK {
|
|
|
let fileURL = openPanel.urls.first
|
|
|
+ let document = CPDFDocument(url: fileURL)
|
|
|
+ if !document!.allowsCopying || !document!.allowsPrinting {
|
|
|
+ let alert = NSAlert()
|
|
|
+ alert.alertStyle = .critical
|
|
|
+ alert.messageText = NSLocalizedString("This is a secured document. Editing is not permitted.", comment: "")
|
|
|
+ alert.runModal()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
self.appearanceData.signatureConfig.text = ""
|
|
|
self.photoImage = NSImage(contentsOf: fileURL!)
|
|
|
self.appearanceData.signatureConfig.image = self.photoImage
|