Browse Source

【批量功能】- 子界面

jiajie 1 year ago
parent
commit
12ab1a2671

+ 18 - 0
PDF Office/PDF Master/Class/PDFTools/AddHeaderFooter/VC/KMBatchOperateAddHeaderFooterViewController.swift

@@ -282,6 +282,24 @@ class KMBatchOperateAddHeaderFooterViewController: KMBatchOperateBaseViewControl
 //            }
 //        }
 //        wc.beginSheetModal(for: NSApp.keyWindow!, completionHandler: nil)
+        var windowController: KMBaseWindowController = KMBaseWindowController()
+        let filePath: String = Bundle.main.path(forResource: "PDF Master User Guide", ofType: "pdf") ?? ""
+        let cdocument = CPDFDocument(url: URL(fileURLWithPath: filePath))
+
+        if (isBates) {
+            windowController = KMHeaderFooterWindowController(windowNibName: "KMHeaderFooterWindowController")
+            windowController.isBates = true
+        } else{
+            windowController = KMHeaderFooterWindowController(windowNibName: "KMHeaderFooterWindowController")
+        }
+        windowController.pdfDocument = cdocument
+        
+        windowController.cancelAction = { [unowned self] controller in
+            self.km_endSheet()
+        }
+        
+        self.km_beginSheet(windowC: windowController)
+        
     }
     
     @IBAction func buttonClicked_Action(_ sender: Any) {

+ 24 - 6
PDF Office/PDF Master/Class/PDFTools/Watermark/Controller/KMBatchOperateAddWatermarkViewController.swift

@@ -376,16 +376,34 @@ class KMBatchOperateAddWatermarkViewController: KMBatchOperateBaseViewController
         }
     }
     
+    @IBAction func buttonClicked_addtemplate(_ sender: NSButton) {
+        let filePath: String = Bundle.main.path(forResource: "PDF Master User Guide", ofType: "pdf") ?? ""
+        let cdocument = CPDFDocument(url: URL(fileURLWithPath: filePath))
+        if isBackground {
+            let controller = KMBackgroundWindowController(windowNibName: "KMBackgroundWindowController")
+            controller.pdfDocument = cdocument
+            
+            controller.cancelAction = { [unowned self] controller in
+                self.km_endSheet()
+            }
+            self.km_beginSheet(windowC: controller)
+        }else{
+            let controller = KMWatermarkWindowController(windowNibName: "KMWatermarkWindowController")
+           
+            controller.pdfDocument = cdocument
+            
+            controller.cancelAction = { [unowned self] wmWindowC in
+                self.km_endSheet()
+            }
+            
+            self.km_beginSheet(windowC: controller)
+        }
+    }
     
     /*
 
-
-
-
-
-
      //添加水印模版
-     - (IBAction)buttonClicked_addtemplate:(id)sender {
+     - (IBAction):(id)sender {
          NSWindowController *windowController = self.view.window.windowController;
          NSString *filePath = nil;
          NSString *password = nil;

+ 4 - 4
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/StampList/CreateStamp/Controller/KMStampCreaterWindowController.swift

@@ -175,7 +175,7 @@ class KMStampCreaterWindowController: NSWindowController, NSTextViewDelegate{
             }
         }
         self.stamp?.bounds = self.preView.bounds
-        self.stamp?.setCustomStampString(self.stamp?.string ?? "", dateString: dateString)
+        self.stamp?.setCustomStampString(self.stamp?.contentStr ?? "", dateString: dateString)
         self.preView.image = self.stamp?.stampPreviewImage()
     }
     @IBAction func timeButton_Click(_ sender: NSButton) {
@@ -192,7 +192,7 @@ class KMStampCreaterWindowController: NSWindowController, NSTextViewDelegate{
             }
         }
         self.stamp?.bounds = self.preView.bounds
-        self.stamp?.setCustomStampString(self.stamp?.string ?? "", dateString: dateString)
+        self.stamp?.setCustomStampString(self.stamp?.contentStr ?? "", dateString: dateString)
         self.preView.image = self.stamp?.stampPreviewImage()
     }
     func textViewDidChangeSelection(_ notification: Notification) {
@@ -207,10 +207,10 @@ class KMStampCreaterWindowController: NSWindowController, NSTextViewDelegate{
  
     @IBAction func dismissSheet(_ sender: NSButton) {
         if sender == self.addButton {
-            if self.stamp?.string.count ?? 0 < 1 && self.stamp?.dateString.count ?? 0 < 1 {
+            if self.stamp?.contentStr.count ?? 0 < 1 && self.stamp?.dateString.count ?? 0 < 1 {
                 return
             }
-            if KMStampManagerNew.shareManager.addStamp(withString: self.stamp?.string, dateString: self.stamp?.dateString, color: self.stamp?.stampColor ?? .RedColor){
+            if KMStampManagerNew.shareManager.addStamp(withString: self.stamp?.contentStr, dateString: self.stamp?.dateString, color: self.stamp?.stampColor ?? .RedColor){
                 
             }
             if (self.closeCallBack != nil) {