|
@@ -670,10 +670,11 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
|
|
|
let _document: CPDFDocument = (self?.listView?.document)!
|
|
|
|
|
|
let filePath = "\(panel.url!.path)/\(_document.documentURL.deletingPathExtension().lastPathComponent)"
|
|
|
- if (!FileManager.default.fileExists(atPath: filePath)) {
|
|
|
- try?FileManager.default.createDirectory(atPath: filePath, withIntermediateDirectories: true)
|
|
|
+ let uniqueFilePath = KMTools.getUniqueFilePath(filePath: filePath)
|
|
|
+// Swift.debugPrint(uniqueFilePath)
|
|
|
+ if (!FileManager.default.fileExists(atPath: uniqueFilePath)) {
|
|
|
+ try?FileManager.default.createDirectory(atPath: uniqueFilePath, withIntermediateDirectories: true)
|
|
|
}
|
|
|
-// let fileName = outputModel.outputFileNameDeletePathExtension
|
|
|
|
|
|
var filepaths: [String] = []
|
|
|
for i in 0 ..< file_indexs!.count {
|
|
@@ -681,7 +682,7 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
|
|
|
if (indexs.isEmpty) {
|
|
|
continue
|
|
|
}
|
|
|
- let filepath = String(format: "%@/%@.pdf", filePath, model.getNewOutputFileName(index: i+1))
|
|
|
+ let filepath = String(format: "%@/%@.pdf", uniqueFilePath, model.getNewOutputFileName(index: i+1))
|
|
|
filepaths.append(filepath)
|
|
|
|
|
|
let newDocument = CPDFDocument()
|