|
@@ -1051,20 +1051,27 @@ extension KMBatchManager {
|
|
|
fileName = NSLocalizedString("Untitled", comment: "")
|
|
|
}
|
|
|
|
|
|
- let path = outputFolderPath + "/" + fileName + ".pdf"
|
|
|
-
|
|
|
- // // 检查文件是否已存在,如果存在,则添加数字后缀
|
|
|
- // var finalPath = path
|
|
|
- // var count = 1
|
|
|
- // while FileManager.default.fileExists(atPath: finalPath) {
|
|
|
- // let newFileName = "\(fileName) \(count)"
|
|
|
- // finalPath = outputFolderPath + "/" + newFileName + ".pdf"
|
|
|
- // count += 1
|
|
|
- // }
|
|
|
-
|
|
|
- // 使用最终路径进行保存或其他操作
|
|
|
- // path = finalPath
|
|
|
+ var typeString = ""
|
|
|
+ switch type {
|
|
|
+ case .compress:
|
|
|
+ typeString = "_compress"
|
|
|
+ case .OCR:
|
|
|
+ typeString = "_OCR"
|
|
|
+ case .security:
|
|
|
+ typeString = "_security"
|
|
|
+ case .watermark:
|
|
|
+ typeString = "_watermark"
|
|
|
+ case .background:
|
|
|
+ typeString = "_background"
|
|
|
+ case .headerAndFooter:
|
|
|
+ typeString = "_headerAndFooter"
|
|
|
+ case .batesNumber:
|
|
|
+ typeString = "_bates"
|
|
|
+ default:
|
|
|
+ typeString = ""
|
|
|
+ }
|
|
|
|
|
|
+ var path = "\(outputFolderPath)/\(fileName)\(typeString).pdf"
|
|
|
return path
|
|
|
}
|
|
|
|