|
@@ -97,7 +97,7 @@ class KMOCRPDFWindowController: NSWindowController, NSWindowDelegate, KMGOCRMana
|
|
|
self.pdfDocument = cpdfDocument
|
|
|
self.password = pwd ?? ""
|
|
|
let url: URL? = cpdfDocument.documentURL
|
|
|
- var lastPathComponent = url?.deletingPathExtension()
|
|
|
+ let lastPathComponent = url?.deletingPathExtension()
|
|
|
if let str = lastPathComponent?.lastPathComponent {
|
|
|
if str.count > 0 {
|
|
|
self.pathFile = str
|
|
@@ -110,7 +110,11 @@ class KMOCRPDFWindowController: NSWindowController, NSWindowDelegate, KMGOCRMana
|
|
|
|
|
|
self._fileAttri = KMFileAttribute()
|
|
|
self._fileAttri?.password = self.pdfDocument?.password ?? ""
|
|
|
- self._fileAttri?.filePath = self.pdfDocument?.documentURL.path ?? ""
|
|
|
+ if self.pdfDocument?.documentURL != nil && self.pdfDocument?.documentURL.path != nil{
|
|
|
+ self._fileAttri?.filePath = self.pdfDocument?.documentURL.path ?? ""
|
|
|
+ }else {
|
|
|
+ self._fileAttri?.filePath = ""
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
convenience init(filePath: String, pwd: String?) {
|