|
@@ -1515,12 +1515,24 @@ extension KMMainViewController {
|
|
|
|
|
|
let fileManager = FileManager.default
|
|
|
let newFileURL = fileURL!.deletingLastPathComponent().appendingPathComponent(outputSavePanel.url!.lastPathComponent)
|
|
|
+ var result = true
|
|
|
do {
|
|
|
try fileManager.moveItem(at: fileURL!, to: newFileURL)
|
|
|
} catch {
|
|
|
+ result = false
|
|
|
print("Error renaming file! Threw: \(error.localizedDescription)")
|
|
|
}
|
|
|
- tabController?.title = outputSavePanel.url!.lastPathComponent
|
|
|
+ if (result) {
|
|
|
+ tabController?.title = outputSavePanel.url!.lastPathComponent
|
|
|
+
|
|
|
+ if let newPdfDocument = CPDFDocument(url: newFileURL) {
|
|
|
+ self.isSaveKeyChain = false
|
|
|
+ newPdfDocument.unlock(withPassword: self.document?.password)
|
|
|
+ if (newPdfDocument.pageCount > 0) {
|
|
|
+ self.setDocument = newPdfDocument
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
} else {
|
|
|
outputSavePanel.close()
|
|
|
}
|