Pārlūkot izejas kodu

【2025】【综合】
1、裁剪完善
2、水印数据完善
3、批量转档完善

niehaoyu 4 dienas atpakaļ
vecāks
revīzija
6fc55bf27b

+ 1 - 1
PDF Office/PDF Master/KMClass/KMPDFViewController/EditTool/Watermark/Model/KMWatermarkModel.swift

@@ -70,7 +70,7 @@ import Cocoa
             try?FileManager.default.createDirectory(atPath: resultFolder, withIntermediateDirectories: false)
         }
         let resultPath = resultFolder.stringByAppendingPathComponent((self.tag + ".png"))
-        if let image = KMWatermarkManager.defaultManager.drawImageAtpageRect(rect: CGRectMake(0, 0, 136, 181), data: self) {
+        if let image = KMWatermarkManager.defaultManager.drawImageAtpageRect(rect: CGRectMake(0, 0, 136*3, 181*3), data: self) {
             try?image.pngData()?.write(to: URL(fileURLWithPath: resultPath))
         }
     }

+ 1 - 1
PDF Office/PDF Master/KMClass/KMPDFViewController/HeaderFooter/Views/KMHeaderPropertyController.swift

@@ -563,7 +563,7 @@ class KMHeaderPropertyController: KMNBaseViewController {
         saveWindow.own_beginSheetModal(for: view.window) { string in
             
         }
-        saveWindow.titleLabel.stringValue = KMLocalizedString("Add Header&Footer")
+        saveWindow.titleLabel.stringValue = KMLocalizedString("Add Header & Footer")
     }
     
     //MARK: - Mouse

+ 2 - 0
PDF Office/PDF Master/KMClass/KMPDFViewController/KMMainViewController.swift

@@ -5325,6 +5325,8 @@ extension KMMainViewController: KMRightSideControllerDelegate {
             KMCropManager.defaultManager.cropSeparateOn = false
             
             cropVC.selectionRect = rightSideController?.edit_cropController?.pageBounds ?? CGRectZero
+            KMCropManager.defaultManager.cropRect = cropVC.selectionRect
+            
             cropVC.reloadSelectionRect()
             
             self.kmCropControllerDidChangedSelectionOrMagnification(cropVC)

+ 18 - 1
PDF Office/PDF Master/KMClass/NewBatch/Manager/KMBatchManager.swift

@@ -149,7 +149,10 @@ extension KMBatchManager {
     }
     
     func convertFile(outputFolderPath: String, data: KMBatchSettingItemViewModel, filesData: [KMBatchProcessingTableViewModel]) {
-        guard !filesData.isEmpty else { return }
+        guard !filesData.isEmpty else {
+            self.batchSuccess()
+            return
+        }
 
         func processFile(at index: Int) {
             guard index < filesData.count else {
@@ -523,6 +526,8 @@ extension KMBatchManager {
                     }
                 }
             }
+        } else {
+            self.batchSuccess()
         }
     }
     
@@ -588,6 +593,8 @@ extension KMBatchManager {
                     self.batchSuccess()
                 }
             }
+        } else {
+            self.batchSuccess()
         }
     }
     
@@ -656,6 +663,8 @@ extension KMBatchManager {
                     self.batchSuccess()
                 }
             }
+        } else {
+            self.batchSuccess()
         }
     }
     
@@ -721,6 +730,8 @@ extension KMBatchManager {
                     self.batchSuccess()
                 }
             }
+        } else {
+            self.batchSuccess()
         }
     }
     
@@ -786,6 +797,8 @@ extension KMBatchManager {
                     self.batchSuccess()
                 }
             }
+        } else {
+            self.batchSuccess()
         }
     }
     
@@ -864,6 +877,8 @@ extension KMBatchManager {
                     }
                 }
             }
+        } else {
+            self.batchFailure()
         }
     }
     
@@ -973,6 +988,8 @@ extension KMBatchManager {
                     }
                 }
             }
+        } else {
+            self.batchSuccess()
         }
     }
     

+ 2 - 0
PDF Office/PDF Master/KMClass/NewBatch/View/KMBatchProcessingView/PasswordAlertView/KMBatchProcessingPasswordAlertViewController.swift

@@ -39,6 +39,8 @@ class KMBatchProcessingPasswordAlertViewController: KMNBaseViewController {
     }
     
     override func updateUILanguage() {
+        titleLabel.stringValue = KMLocalizedString("At least one file in the list requires a password before you can proceed. Continuing the current operation will skip these undecrypted files. Do you want to continue?")
+        
         cancelButton.properties.buttonText = KMLocalizedString("Cancel")
         cancelButton.reloadData()
         continueButton.properties.buttonText = KMLocalizedString("Continue")

+ 1 - 1
PDF Office/PDF Master/KMClass/NewBatch/View/Setting/BatchRemove/KMBatchRemoveView.swift

@@ -91,7 +91,7 @@ class KMBatchRemoveView: KMBatchSettingItemView {
     }
     
     override func reloadData() {
-        if (self.filesData.count != 0 && self.data.options != .none) {
+        if (self.filesData.count != 0 && KMBatchRemoveOptions.language(options: self.data.options) != "") {
             self.removeButton.properties.isDisabled = self.isDisable
         } else {
             self.removeButton.properties.isDisabled = true

+ 10 - 2
PDF Office/PDF Master/KMClass/Tools/Category/Foundation/NSImage+Create.swift

@@ -242,8 +242,16 @@ extension NSImage {
         let centerY = imageSize.height / 2
         
         // 平铺效果
-        let columns = Int(imageSize.width / (textSize.width + horizontalSpacing))
-        let rows = Int(imageSize.height / (textSize.height + verticalSpacing))
+        var columns = Int(imageSize.width / (textSize.width + horizontalSpacing))
+        var rows = Int(imageSize.height / (textSize.height + verticalSpacing))
+        
+        if columns == 0 {
+            columns = 1
+        }
+        
+        if rows == 0 {
+            rows = 1
+        }
         
         // 中心旋转
         let transform = NSAffineTransform()