Browse Source

Merge branch 'develop_2025' of git.kdan.cc:Mac_PDF/PDF_Office into develop_2025

niehaoyu 2 months ago
parent
commit
2fa0043070

BIN
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/ComPDFKit.framework/Versions/A/ComPDFKit


+ 1 - 1
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/ComPDFKit.framework/Versions/A/Headers/CPDFPage.h

@@ -76,7 +76,7 @@ extern NSNotificationName const CPDFPageDidFindSearchChangeNotification;
 /**
  * Returns the index for the page.
  *
- * @discussion Typically, the label is “0” for the first page, “1” for the second page,defualt 0.
+ * @discussion Typically, the index is “0” for the first page, “1” for the second page,defualt 0.
  */
 @property (nonatomic,readonly) NSUInteger pageIndexInteger;
 

+ 2 - 2
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/ComPDFKit.framework/Versions/A/Headers/CPDFSignatureAnnotation.h

@@ -62,14 +62,14 @@ typedef NS_ENUM(NSInteger, CPDFSignatureDraggedType) {
 - (void)updateAnnotationRotation:(NSInteger)annotationRotation;
 
 /**
- * Method to move stampAnnotation
+ * Method to move signatureAnnotation
  *
  * @discussion offset
  */
 - (void)moveSignatureAnnotationWithActivePage:(CPDFPage *)newActivePage offset:(CPDFKitPlatformPoint)offset;
 
 /**
- * Method to drag stampAnnotation
+ * Method to drag signatureAnnotation
  *
  * @discussion draggedIndex
  */

+ 2 - 2
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/ComPDFKit.framework/Versions/A/Headers/CPDFSignatureWidgetAnnotation.h

@@ -112,14 +112,14 @@ typedef NS_ENUM(NSInteger, CPDFSignatureWidgetDraggedType) {
 - (void)updateAnnotationRotation:(NSInteger)annotationRotation;
 
 /**
- * Method to move stampAnnotation
+ * Method to move signaturewidgetAnnotation
  *
  * @discussion offset
  */
 - (void)moveSignatureWidgetAnnotationWithActivePage:(CPDFPage *)newActivePage offset:(CPDFKitPlatformPoint)offset;
 
 /**
- * Method to drag stampAnnotation
+ * Method to drag signaturewidgetAnnotation
  *
  * @discussion draggedIndex
  */

+ 6 - 6
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/ComPDFKit.framework/Versions/A/_CodeSignature/CodeResources

@@ -746,11 +746,11 @@
 		<dict>
 			<key>hash</key>
 			<data>
-			eJRFtJCSbqfLYN9bi1fkEwMeCXk=
+			JS9XIkdq9l7aRwhTvNfIomJ48AA=
 			</data>
 			<key>hash2</key>
 			<data>
-			Qyn7j8aeHUugjUzkybampkyBK/5xSnVFNQfmgYcpQ2Q=
+			WdXVpY+ZV5RuDM0STs+5Pf2W/vMe+zAuXkXAGNVANsw=
 			</data>
 		</dict>
 		<key>Headers/CPDFPageMetalView.h</key>
@@ -889,22 +889,22 @@
 		<dict>
 			<key>hash</key>
 			<data>
-			DQ29qJAActmfAjFAiJdD9k/ylTA=
+			DgTEXci+8VewOv2RxiDqpzAGmFk=
 			</data>
 			<key>hash2</key>
 			<data>
-			8ftt5wGS5KCuHGOLAHHX/4gZfPTjzpV82fTgm2eFaIs=
+			h5P2YNTsWIwj8grSimbOnCzJDxPn1qmOM1OPYarfbew=
 			</data>
 		</dict>
 		<key>Headers/CPDFSignatureWidgetAnnotation.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			dNZO42mzu0ITlaQKrrK6Ggv1GM8=
+			Gip6to5TnqaTJtbuJG5bN+6IKw8=
 			</data>
 			<key>hash2</key>
 			<data>
-			LOeVeFRYKs0MD4ndjpF+ovR9Ro6DJOZQ8KQzDU1GJMI=
+			kjnM6CniQeQpRmSuuQhtGgzKoKfstp8hDHsVH+0DO0M=
 			</data>
 		</dict>
 		<key>Headers/CPDFSoundAnnotation.h</key>

+ 12 - 3
PDF Office/PDF Master/KMClass/KMPDFViewController/KMMainViewController.swift

@@ -2907,7 +2907,6 @@ extension KMMainViewController {
     
     func showOCREditAlert() {
         DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.3) { [unowned self] in
-            alertTipViewController.isShowOCRAlert = true
             alertTipViewController.showInView(listView)
             alertTipViewController.reloadOCRAlertUI()
             alertTipViewController.reloadAlertUIFrame()
@@ -2919,9 +2918,9 @@ extension KMMainViewController {
     }
     
     func closeOCREditAlert() {
-        alertTipViewController.isShowOCRAlert = false
+        guard let view = alertTipViewController.OCRComponentAlert else { return }
         alertTipViewController.reloadOCRAlertUI()
-        //        alertTipViewController.reloadAlertUIFrame()
+        alertTipViewController.reloadAlertUIFrame()
     }
     
     func showOCRToolAlert(_ string: String) {
@@ -3569,6 +3568,16 @@ extension KMMainViewController: KMPDFToolbarControllerDelegate {
 
 //MARK: - KMRightSideControllerDelegate右边属性栏代理
 extension KMMainViewController: KMRightSideControllerDelegate {
+    func kmRightSideControllerRotateLeft(_ annotations: [CPDFStampAnnotation], withPDFView pdfView: CPDFListView?) {
+        CPDFStampAnnotation.rotateLeft(annotations, withPDFView: pdfView)
+        (undoManager?.prepare(withInvocationTarget: self) as AnyObject).kmRightSideControllerRotateRight(annotations, withPDFView: pdfView)
+    }
+    
+    func kmRightSideControllerRotateRight(_ annotations: [CPDFStampAnnotation], withPDFView pdfView: CPDFListView?) {
+        CPDFStampAnnotation.rotateRight(annotations, withPDFView: pdfView)
+        (undoManager?.prepare(withInvocationTarget: self) as AnyObject).kmRightSideControllerRotateLeft(annotations, withPDFView: pdfView)
+    }
+    
     func kmRightSideControllerDidContendVCUpdated(_ controller: KMRightSideController) {
         //MARK: -Crop
         if (controller.contentViewController is KMCropPropertyController) {

+ 16 - 1
PDF Office/PDF Master/KMClass/KMPDFViewController/RightSideController/KMRightSideController.swift

@@ -15,6 +15,9 @@ import KMComponentLibrary
     //OCR
     @objc func kmRightSideControllerOCRShowTypeChange(_ controller: KMRightSideController, _ type: KMOCRShowType)
     @objc func kmRightSideControllerOCRDoneAction(_ controller: KMRightSideController, _ model: KMOCRModel)
+    
+    @objc func kmRightSideControllerRotateLeft(_ annotations: [CPDFStampAnnotation], withPDFView pdfView: CPDFListView?)
+    @objc func kmRightSideControllerRotateRight(_ annotations: [CPDFStampAnnotation], withPDFView pdfView: CPDFListView?)
 }
 
 class KMRightSideController: NSViewController {
@@ -460,7 +463,7 @@ class KMRightSideController: NSViewController {
                         stamp_Controller = KMStampController.init()
                     }
                     stamp_Controller?.pdfView = self.pdfView
-                    
+                    stamp_Controller?.delegate = self
                     contentViewController = stamp_Controller
                 }
             } else if subToolMode == .Stamp {
@@ -749,3 +752,15 @@ extension KMRightSideController: KMStampListControllerDelegate {
         reloadTopRightButtonInfo()
     }
 }
+
+extension KMRightSideController: KMStampControllerDelegate {
+    func kmStampControllerRotateLeft(_ annotations: [CPDFStampAnnotation], withPDFView pdfView: CPDFListView?) {
+        delegate?.kmRightSideControllerRotateLeft(annotations, withPDFView: pdfView)
+    }
+
+    func kmStampControllerRotateRight(_ annotations: [CPDFStampAnnotation], withPDFView pdfView: CPDFListView?) {
+        delegate?.kmRightSideControllerRotateRight(annotations, withPDFView: pdfView)
+    }
+}
+
+

+ 10 - 6
PDF Office/PDF Master/KMClass/KMPDFViewController/RightSideController/Views/StampList/KMStampController.swift

@@ -8,6 +8,13 @@
 import Cocoa
 import KMComponentLibrary
 
+@objc protocol KMStampControllerDelegate: AnyObject {
+        
+    //注释旋转
+    @objc func kmStampControllerRotateLeft(_ annotations: [CPDFStampAnnotation], withPDFView pdfView: CPDFListView?)
+    @objc func kmStampControllerRotateRight(_ annotations: [CPDFStampAnnotation], withPDFView pdfView: CPDFListView?)
+}
+
 class KMStampController: NSViewController {
     
     @IBOutlet var rotateBGView: NSView!
@@ -18,6 +25,7 @@ class KMStampController: NSViewController {
     private var annotations: [CPDFStampAnnotation] = []
     var pdfView: CPDFListView?
     
+    weak open var delegate: KMStampControllerDelegate?
     
     //MARK: - func
     override func viewDidAppear() {
@@ -69,14 +77,10 @@ class KMStampController: NSViewController {
     //MARK: - Action
     @objc func buttonClicked(_ button: ComponentButton) {
         if button == rotateLeftButton {
-            CPDFStampAnnotation.rotateLeft(annotations, withPDFView: pdfView)
+            delegate?.kmStampControllerRotateLeft(annotations, withPDFView: pdfView)
         } else if button == rotateRightButton {
-            CPDFStampAnnotation.rotateRight(annotations, withPDFView: pdfView)
+            delegate?.kmStampControllerRotateRight(annotations, withPDFView: pdfView)
         }
         
     }
-    
-    
-    
-    
 }

+ 8 - 11
PDF Office/PDF Master/KMClass/PDFListView/ViewController/KMNAlertTipViewController.swift

@@ -271,8 +271,7 @@ class KMNAlertTipViewController: KMNBaseViewController {
      }
     
     public func reloadOCRAlertUI() {
-        if isShowOCRAlert == true {
-            OCRComponentAlert.isHidden = false
+        if isShowOCRAlert == true && self.listView?.toolMode == .CEditPDFToolMode {
             var isContainsImagePage = false
             for i in 0..<(listView?.document?.pageCount ?? 0) {
                 guard i < listView?.document?.pageCount ?? 0 else { continue }
@@ -291,16 +290,14 @@ class KMNAlertTipViewController: KMNBaseViewController {
                 }
                 OCRComponentAlert.reloadData()
             } else {
-//                if OCRComponentAlert.superview != nil {
-//                    OCRComponentAlert.removeFromSuperview()
-//                }
-                OCRComponentAlert.isHidden = true
+                if OCRComponentAlert.superview != nil {
+                    OCRComponentAlert.removeFromSuperview()
+                }
             }
         } else {
-//            if OCRComponentAlert.superview != nil {
-//                OCRComponentAlert.removeFromSuperview()
-//            }
-//            OCRComponentAlert.isHidden = true
+            if OCRComponentAlert.superview != nil {
+                OCRComponentAlert.removeFromSuperview()
+            }
         }
      }
 
@@ -336,7 +333,7 @@ class KMNAlertTipViewController: KMNBaseViewController {
             alertHeight += 32.0
         }
         
-        if OCRComponentAlert.superview != nil && OCRComponentAlert.isHidden == false {
+        if OCRComponentAlert.superview != nil {
             if alertHeight > 0 {
                 alertHeight += 1
             }