Sfoglia il codice sorgente

Merge branch 'develop_v1.2' into develop

tangchao 1 anno fa
parent
commit
35d48bf3f6
53 ha cambiato i file con 1940 aggiunte e 1004 eliminazioni
  1. 805 95
      PDF Office/PDF Master.xcodeproj/xcuserdata/lizhe.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
  2. 1 1
      PDF Office/PDF Master/Class/ChromiumTabs/KMBrowserWindowController.swift
  3. 14 3
      PDF Office/PDF Master/Class/ChromiumTabs/KMToolbarRightView.swift
  4. 16 0
      PDF Office/PDF Master/Class/Common/Tools/KMTools.swift
  5. 2 2
      PDF Office/PDF Master/Class/Home/ViewController/KMAIRewritingVC.swift
  6. 1 1
      PDF Office/PDF Master/Class/Home/ViewController/KMAITranslationVC.swift
  7. 2 2
      PDF Office/PDF Master/Class/Home/ViewController/KMFastToolCollectionViewItem.xib
  8. 11 35
      PDF Office/PDF Master/Class/Home/ViewController/KMHomeViewController+Action.swift
  9. 12 21
      PDF Office/PDF Master/Class/Home/ViewController/KMHomeViewController+UI.swift
  10. 1 1
      PDF Office/PDF Master/Class/Home/WindowController/KMAITranslationConfirmWindowController.swift
  11. 2 2
      PDF Office/PDF Master/Class/Home/WindowController/KMAITranslationWindowController.swift
  12. 56 42
      PDF Office/PDF Master/Class/KMLightMember/Controller/ComparativeTable/KMComparativeTableViewController.swift
  13. 21 0
      PDF Office/PDF Master/Class/KMLightMember/Controller/ComparativeTable/Source/KMCompatative.xcassets/full function trial.imageset/Contents.json
  14. 145 0
      PDF Office/PDF Master/Class/KMLightMember/Controller/ComparativeTable/Source/KMCompatative.xcassets/full function trial.imageset/full function trial.pdf
  15. 21 0
      PDF Office/PDF Master/Class/KMLightMember/Controller/ComparativeTable/Source/KMCompatative.xcassets/merging.imageset/Contents.json
  16. 171 0
      PDF Office/PDF Master/Class/KMLightMember/Controller/ComparativeTable/Source/KMCompatative.xcassets/merging.imageset/merging.pdf
  17. 8 2
      PDF Office/PDF Master/Class/KMLightMember/Controller/ComparativeTable/View/KMComparativeView/KMComparativeView.swift
  18. 1 1
      PDF Office/PDF Master/Class/KMLightMember/Controller/Login&Register/KMLoginWindowController.swift
  19. 8 8
      PDF Office/PDF Master/Class/KMLightMember/Controller/Login&Register/View/KMLoginLeftImageView.swift
  20. 1 1
      PDF Office/PDF Master/Class/KMLightMember/Controller/Login&Register/View/KMLoginLeftImageView.xib
  21. 71 82
      PDF Office/PDF Master/Class/KMLightMember/Controller/SubscriptionView/WaterMark/KMSubscribeWaterMarkWindowController.swift
  22. 6 6
      PDF Office/PDF Master/Class/KMLightMember/Controller/SubscriptionView/WaterMark/KMSubscribeWaterMarkWindowController.xib
  23. 2 2
      PDF Office/PDF Master/Class/KMLightMember/Controller/SubscriptionView/WaterMark/View/KMSubscribeWaterMarkCollectionItem.swift
  24. 4 4
      PDF Office/PDF Master/Class/KMLightMember/Controller/SubscriptionView/WaterMark/View/KMSubscribeWaterMarkCollectionItem.xib
  25. 72 165
      PDF Office/PDF Master/Class/KMLightMember/Controller/SubscriptionView/WaterMark/View/KMSubscribeWaterMarkView.swift
  26. 96 158
      PDF Office/PDF Master/Class/KMLightMember/Controller/SubscriptionView/WaterMark/View/KMSubscribeWaterMarkView.xib
  27. 1 1
      PDF Office/PDF Master/Class/KMLightMember/Manager/KMLightMemberManager.swift
  28. 21 0
      PDF Office/PDF Master/Class/KMLightMember/Source/KMLightMember.xcassets/image_Popup.imageset/Contents.json
  29. BIN
      PDF Office/PDF Master/Class/KMLightMember/Source/KMLightMember.xcassets/image_Popup.imageset/Popup.pdf
  30. 1 0
      PDF Office/PDF Master/Class/Merge/OCPart/KMFileAttribute.h
  31. 3 0
      PDF Office/PDF Master/Class/Merge/OCPart/KMPDFEditAppendWindow.h
  32. 72 1
      PDF Office/PDF Master/Class/Merge/OCPart/KMPDFEditAppendWindow.m
  33. 39 6
      PDF Office/PDF Master/Class/Merge/OCPart/KMPDFEditAppendWindow.xib
  34. 37 19
      PDF Office/PDF Master/Class/PDFTools/Compress/Controller/KMCompressWindowController.swift
  35. 43 23
      PDF Office/PDF Master/Class/PDFTools/Convert/Controller/KMConvertBaseWindowController.swift
  36. 1 0
      PDF Office/PDF Master/Class/PDFTools/Convert/Controller/KMConvertBaseWindowController.xib
  37. 1 1
      PDF Office/PDF Master/Class/PDFTools/Convert/Controller/KMConvertExcelWindowController.swift
  38. 5 0
      PDF Office/PDF Master/Class/PDFTools/Convert/View/KMConvertCSVSettingView.swift
  39. 5 0
      PDF Office/PDF Master/Class/PDFTools/Convert/View/KMConvertExcelSettingView.swift
  40. 5 0
      PDF Office/PDF Master/Class/PDFTools/Convert/View/KMConvertImageSettingView.swift
  41. 5 0
      PDF Office/PDF Master/Class/PDFTools/Convert/View/KMConvertPPTsSettingView.swift
  42. 8 7
      PDF Office/PDF Master/Class/PDFTools/Convert/View/KMConvertSettingLimitTipView.swift
  43. 2 2
      PDF Office/PDF Master/Class/PDFTools/Convert/View/KMConvertSettingView.swift
  44. 6 0
      PDF Office/PDF Master/Class/PDFTools/Convert/View/KMConvertWordSettingView.swift
  45. 72 25
      PDF Office/PDF Master/Class/PDFTools/PageEdit/Controller/KMPDFEditViewController.swift
  46. 2 52
      PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Thumbnail/Base/KMPDFThumbViewBaseController.swift
  47. 0 42
      PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Thumbnail/KMThumbnailViewController.swift
  48. 0 7
      PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbarController.swift
  49. 0 4
      PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbarViewController.swift
  50. 31 159
      PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift
  51. 0 20
      PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+MenuAction.swift
  52. 1 0
      PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController.swift
  53. 29 1
      PDF Office/PDF Master/Strings/en.lproj/Localizable.strings

File diff suppressed because it is too large
+ 805 - 95
PDF Office/PDF Master.xcodeproj/xcuserdata/lizhe.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist


+ 1 - 1
PDF Office/PDF Master/Class/ChromiumTabs/KMBrowserWindowController.swift

@@ -378,7 +378,7 @@ extension KMBrowserWindowController: KMToolbarRightViewDelegate {
 #endif
         
 #if VERSION_FREE
-        KMComparativeTableViewController.show(window: self.window!)
+        KMComparativeTableViewController.show(window: self.window!, .upgrade)
 #endif
     }
     

+ 14 - 3
PDF Office/PDF Master/Class/ChromiumTabs/KMToolbarRightView.swift

@@ -54,9 +54,7 @@ import Cocoa
     
     @objc func updateView() -> Void {
 //        KMLightMemberManager.manager.canShowAdvancedView &&
-        if (!KMLightMemberManager.manager.isLogin() ||
-             (KMLightMemberManager.manager.purchaseState != .subscription &&
-              KMLightMemberManager.manager.purchaseState != .trial)) {
+        if canShowAdvanced() {
             if self.advancedLabel != nil {
                 self.advancedContentView.isHidden = false
                 self.advancedViewRightConstraint.constant = 8.0
@@ -93,6 +91,19 @@ import Cocoa
         }
     }
     
+    func canShowAdvanced() -> Bool {
+        #if VERSION_FREE
+        return (KMLightMemberManager.manager.isLogin() &&
+             (KMLightMemberManager.manager.purchaseState != .subscription &&
+              KMLightMemberManager.manager.purchaseState != .trial))
+        #else
+        return (!KMLightMemberManager.manager.isLogin() ||
+             (KMLightMemberManager.manager.purchaseState != .subscription &&
+              KMLightMemberManager.manager.purchaseState != .trial))
+        #endif
+        
+    }
+    
     func fetchAdvancedViewSize() -> CGSize {
         var advancedString = NSLocalizedString("Upgrade", comment: "")
 //        if KMLightMemberManager.manager.purchaseState == .trial {

+ 16 - 0
PDF Office/PDF Master/Class/Common/Tools/KMTools.swift

@@ -387,6 +387,22 @@ extension KMTools {
         return NSLocalizedString("e.g. 1,3-5,10", comment: "")
     }
     
+    @objc class func saveWatermarkDocumentToTemp(document: CPDFDocument, secureOptions: [CPDFDocumentWriteOption : Any]? = nil, removePWD: Bool = false) -> URL? {
+        // 将文档存入临时目录
+        if let data = self.getTempFloderPath(), !FileManager.default.fileExists(atPath: data) {
+            try?FileManager.default.createDirectory(atPath: data, withIntermediateDirectories: false)
+        }
+        guard let filePath = self.getTempFloderPath()?.stringByAppendingPathComponent("temp_saveDocumentFor_temp.pdf") else {
+            return nil
+        }
+        // 清除临时数据
+        if (FileManager.default.fileExists(atPath: filePath)) {
+            try?FileManager.default.removeItem(atPath: filePath)
+        }
+        
+        return self.saveWatermarkDocument(document: document, to: URL(fileURLWithPath: filePath), secureOptions: secureOptions, removePWD:  removePWD)
+    }
+    
     @objc class func saveWatermarkDocument(document: CPDFDocument, to url: URL, secureOptions: [CPDFDocumentWriteOption : Any]? = nil, removePWD: Bool = false) -> URL? {
         guard let _document = self._saveDocumentForWatermark(document: document) else {
             return nil

+ 2 - 2
PDF Office/PDF Master/Class/Home/ViewController/KMAIRewritingVC.swift

@@ -346,7 +346,7 @@ class KMAIRewritingVC: NSViewController {
                     if (self.state == .AIErrorCorrection) {
                         type = .aiCorrect
                     }
-                    let _ = KMSubscribeWaterMarkWindowController.show(window: self.view.window!, isAI: true, type: type) { isSub, _, isClose in
+                    let _ = KMSubscribeWaterMarkWindowController.show(window: self.view.window!, type: type) { isSub, _, isClose in
                         if (isClose) {
                             return
                         }
@@ -415,7 +415,7 @@ class KMAIRewritingVC: NSViewController {
 //            }
             Task { @MainActor in
                 if await (KMLightMemberManager.manager.canPayFunction() == false) {
-                    let _ = KMSubscribeWaterMarkWindowController.show(window: self.view.window!, isAI: true) { isSub, _, isClose in
+                    let _ = KMSubscribeWaterMarkWindowController.show(window: self.view.window!, type: .aiRewrite) { isSub, _, isClose in
                         if (isClose) {
                             return
                         }

+ 1 - 1
PDF Office/PDF Master/Class/Home/ViewController/KMAITranslationVC.swift

@@ -115,7 +115,7 @@ class KMAITranslationVC: NSViewController {
 //                }
                 Task { @MainActor in
                     if await (KMLightMemberManager.manager.canPayFunction() == false) {
-                        let _ = KMSubscribeWaterMarkWindowController.show(window: self.view.window!, isAI: true, type: .aiTranslate) { isSub, _, isClose in
+                        let _ = KMSubscribeWaterMarkWindowController.show(window: self.view.window!, type: .aiTranslate) { isSub, _, isClose in
                             if (isClose) {
                                 return
                             }

+ 2 - 2
PDF Office/PDF Master/Class/Home/ViewController/KMFastToolCollectionViewItem.xib

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21701"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>

+ 11 - 35
PDF Office/PDF Master/Class/Home/ViewController/KMHomeViewController+Action.swift

@@ -951,22 +951,18 @@ extension KMHomeViewController {
     }
     
     func fastTool_MergePDF() {  // MergePDF
-        Task { @MainActor in
-            if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
-                let _ = KMComparativeTableViewController.show(window: self.view.window!, .merge)
-                return
-            }
-            if await (KMLightMemberManager.manager.canPayFunction() == false) {
-                let _ = KMSubscribeWaterMarkWindowController.show(window: self.view.window!, isContinue: true, type: .merge) { isSubscribeSuccess, isWaterMarkExport, isClose in
-                    if (isClose) {
-                        return
-                    }
-                    self.km_open_pdf_merge()
-                }
-                return
-            }
+//        Task { @MainActor in
+//            if await (KMLightMemberManager.manager.canPayFunction() == false) {
+//                let _ = KMSubscribeWaterMarkWindowController.show(window: self.view.window!, isContinue: true, type: .merge) { isSubscribeSuccess, isWaterMarkExport, isClose in
+//                    if (isClose) {
+//                        return
+//                    }
+//                    self.km_open_pdf_merge()
+//                }
+//                return
+//            }
             self.km_open_pdf_merge()
-        }
+//        }
     }
     
     func km_open_pdf_merge() {
@@ -989,21 +985,6 @@ extension KMHomeViewController {
     
     func fastTool_Compression() {   // 压缩
         Task { @MainActor in
-            if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
-                let _ = KMComparativeTableViewController.show(window: self.view.window!, .compress)
-                return
-            }
-            
-            if await (KMLightMemberManager.manager.canPayFunction() == false) {
-                let _ = KMSubscribeWaterMarkWindowController.show(window: self.view.window!, isContinue: true, type: .compress) { isSubscribeSuccess, isWaterMarkExport, isClose in
-                    if (isClose) {
-                        return
-                    }
-                    self.km_secure_openPanel_compress()
-                }
-                return
-            }
-            
             self.km_secure_openPanel_compress()
         }
     }
@@ -1026,11 +1007,6 @@ extension KMHomeViewController {
     
     func showCompressWindow(_ url: URL, _ password: String?) {
         Task { @MainActor in
-            if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
-                let _ = KMComparativeTableViewController.show(window: self.view.window!, .compress)
-                return
-            }
-            
             let windowController = KMCompressWindowController(windowNibName: "KMCompressWindowController")
             self.currentWindowController = windowController
             windowController.documentURL = url

+ 12 - 21
PDF Office/PDF Master/Class/Home/ViewController/KMHomeViewController+UI.swift

@@ -173,23 +173,19 @@ extension KMHomeViewController {
     }
     
     func showConvertWindow(type: KMPDFConvertType) {
-        Task { @MainActor in
-            if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
-                let _ =  KMComparativeTableViewController.show(window: self.view.window!, .convert)
-                return
-            }
-            if await (KMLightMemberManager.manager.canPayFunction() == false) {
-                let _ = KMSubscribeWaterMarkWindowController.show(window: self.view.window!, isContinue: true, type: type.toSubscribeWaterMarkType()) { isSubscribeSuccess, isWaterMarkExport, isClose in
-                    if (isClose) {
-                        return
-                    }
-                    self.km_secure_openPanel_convert(type: type)
-                }
-                return
-            }
+//        Task { @MainActor in
+//            if await (KMLightMemberManager.manager.canPayFunction() == false) {
+//                let _ = KMSubscribeWaterMarkWindowController.show(window: self.view.window!, isContinue: true, type: type.toSubscribeWaterMarkType()) { isSubscribeSuccess, isWaterMarkExport, isClose in
+//                    if (isClose) {
+//                        return
+//                    }
+//                    self.km_secure_openPanel_convert(type: type)
+//                }
+//                return
+//            }
             
             self.km_secure_openPanel_convert(type: type)
-        }
+//        }
     }
     
     func km_secure_openPanel_convert(type: KMPDFConvertType) {
@@ -210,11 +206,6 @@ extension KMHomeViewController {
     
     func showSecurityWindow() {
         Task { @MainActor in
-            if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
-                let _ = KMComparativeTableViewController.show(window: self.view.window!, .secure)
-                return
-            }
-            
             if await (KMLightMemberManager.manager.canPayFunction() == false) {
                 let _ = KMSubscribeWaterMarkWindowController.show(window: self.view.window!, isContinue: true) { isSubscribeSuccess, isWaterMarkExport, isClose in
                     if (isClose) {
@@ -224,7 +215,6 @@ extension KMHomeViewController {
                 }
                 return
             }
-            
             self.km_secure_openPanel_security()
         }
     }
@@ -337,6 +327,7 @@ extension KMHomeViewController {
         } else if (type == .image) {
             windowController = KMConvertImageWindowController()
         }
+        windowController?.subscribeWaterMarkType = type.toSubscribeWaterMarkType()
         
         let model = KMDocumentModel(url: url)
         if (password != nil) {

+ 1 - 1
PDF Office/PDF Master/Class/Home/WindowController/KMAITranslationConfirmWindowController.swift

@@ -138,7 +138,7 @@ class KMAITranslationConfirmWindowController: NSWindowController {
 //        }
         Task { @MainActor in
             if await (KMLightMemberManager.manager.canPayFunction() == false) {
-                let _ = KMSubscribeWaterMarkWindowController.show(window: self.window!, isAI: true) { isSubscribeSuccess, _, isClose in
+                let _ = KMSubscribeWaterMarkWindowController.show(window: self.window!, type: .aiTranslate) { isSubscribeSuccess, _, isClose in
                     if (isClose) {
                         return
                     }

+ 2 - 2
PDF Office/PDF Master/Class/Home/WindowController/KMAITranslationWindowController.swift

@@ -399,7 +399,7 @@ class KMAITranslationWindowController: NSWindowController {
 //            }
             Task { @MainActor in
                 if await (KMLightMemberManager.manager.canPayFunction() == false) {
-                    let _ = KMSubscribeWaterMarkWindowController.show(window: self.window!, isAI: true) { isSubscribeSuccess, _, isClose in
+                    let _ = KMSubscribeWaterMarkWindowController.show(window: self.window!, type: .aiTranslate) { isSubscribeSuccess, _, isClose in
                         if (isClose) {
                             return
                         }
@@ -470,7 +470,7 @@ class KMAITranslationWindowController: NSWindowController {
 //            }
             Task { @MainActor in
                 if await (KMLightMemberManager.manager.canPayFunction() == false) {
-                    let _ = KMSubscribeWaterMarkWindowController.show(window: self.window!, isAI: true) { isSubscribeSuccess, _, isClose in
+                    let _ = KMSubscribeWaterMarkWindowController.show(window: self.window!, type: .aiTranslate) { isSubscribeSuccess, _, isClose in
                         if (isClose) {
                             return
                         }

+ 56 - 42
PDF Office/PDF Master/Class/KMLightMember/Controller/ComparativeTable/KMComparativeTableViewController.swift

@@ -25,16 +25,20 @@ enum KMComparativeInputType: Int {
     case loginInputPassword = 6 //登录密码输入
     case accountInfo = 7 //用户信息
     case loginSuccess = 8 //用户登录成功
+    case loginCancel = 9 //用户登录成功
     
-    case compress       = 9         // 压缩
-    case convert        = 10         // 转档
-    case secure         = 11        // 安全
-    case pageEdit       = 12        // 页面编辑
-    case merge          = 13        // 合并
-    case crop           = 14        // 裁切
-    case thumb          = 15        // 缩略图列表
-    case shareFlatten   = 16        // 分享副本
+    case compress       = 10         // 压缩
+    case convert        = 11         // 转档
+    case secure         = 12        // 安全
+    case pageEdit       = 13        // 页面编辑
+    case merge          = 14        // 合并
+    case crop           = 15        // 裁切
+    case thumb          = 16        // 缩略图列表
+    case shareFlatten   = 17        // 分享副本
     //后续添加
+    
+    case upgrade = 18 //升级按钮
+    case equity = 19 //权益弹窗
 }
 
 class KMComparativeTableViewController: NSWindowController {
@@ -71,48 +75,58 @@ class KMComparativeTableViewController: NSWindowController {
 #endif
         
 #if VERSION_FREE
-        let controller: KMComparativeTableViewController = KMComparativeTableViewController.init(windowNibName: "KMComparativeTableViewController")
-        controller.inputType = type
+        if KMLightMemberManager.manager.isLogin() && (type == .upgrade || type == .equity) {
+            let controller: KMComparativeTableViewController = KMComparativeTableViewController.init(windowNibName: "KMComparativeTableViewController")
+            controller.inputType = type
 
-        controller.loginAction = { controller in
-            comparativeController = nil
-            comparativeMainWindow?.endSheet(controller.window!)
-            comparativeMainWindow = nil
-            controller.close()
+            controller.loginAction = { controller in
+                comparativeController = nil
+                comparativeMainWindow?.endSheet(controller.window!)
+                comparativeMainWindow = nil
+                controller.close()
 
-            if NSApp.mainWindow != nil {
-                KMLoginWindowController.show(window: NSApp.mainWindow!, .ComparativeTable, .login)
+                if NSApp.mainWindow != nil {
+                    KMLoginWindowController.show(window: NSApp.mainWindow!, .ComparativeTable, .login)
+                }
             }
-        }
 
-        controller.signUpAction = { controller in
-            comparativeController = nil
-            comparativeMainWindow?.endSheet(controller.window!)
-            comparativeMainWindow = nil
-            controller.close()
+            controller.signUpAction = { controller in
+                comparativeController = nil
+                comparativeMainWindow?.endSheet(controller.window!)
+                comparativeMainWindow = nil
+                controller.close()
 
-            if NSApp.mainWindow != nil {
-                KMLoginWindowController.show(window: NSApp.mainWindow!, .ComparativeTable, .register)
+                if NSApp.mainWindow != nil {
+                    KMLoginWindowController.show(window: NSApp.mainWindow!, .ComparativeTable, .register)
+                }
             }
-        }
-        
-        controller.subscriptionAction = { controller in
-            controller.subscribeAction(controller: controller)
-        }
-        
-        controller.restoreAction = { controller in
-            controller.subscribeAction(controller: controller, isRestore:true)
-        }
-        
-        window.beginSheet(controller.window!)
+            
+            controller.subscriptionAction = { controller in
+                controller.subscribeAction(controller: controller)
+            }
+            
+            controller.restoreAction = { controller in
+                controller.subscribeAction(controller: controller, isRestore:true)
+            }
+            
+            window.beginSheet(controller.window!)
 
-        comparativeController = controller
-        comparativeMainWindow = window
-        
-        if type == .loginSuccess && KMLightMemberManager.manager.purchaseState != .subscription {
-            controller.subscribeAction(controller: controller)
+            comparativeController = controller
+            comparativeMainWindow = window
+            
+//            if type == .loginSuccess && KMLightMemberManager.manager.purchaseState != .subscription {
+//                controller.subscribeAction(controller: controller)
+//            }
+            return controller
+        } else {
+            if type == .loginCancel {
+                
+            } else {
+                KMSubscribeWaterMarkWindowController.show(window: NSApp.mainWindow!, isContinue: true) { isSubscribeSuccess, isWaterMarkExport, isClose in
+                    
+                }
+            }
         }
-        return controller
 #endif
         return nil
     }

+ 21 - 0
PDF Office/PDF Master/Class/KMLightMember/Controller/ComparativeTable/Source/KMCompatative.xcassets/full function trial.imageset/Contents.json

@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "filename" : "full function trial.pdf",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 145 - 0
PDF Office/PDF Master/Class/KMLightMember/Controller/ComparativeTable/Source/KMCompatative.xcassets/full function trial.imageset/full function trial.pdf

@@ -0,0 +1,145 @@
+%PDF-1.7
+
+1 0 obj
+  << /Length 2 0 R
+     /Range [ 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 ]
+     /Domain [ 0.000000 1.000000 ]
+     /FunctionType 4
+  >>
+stream
+{  1.000000 exch 0.895333 exch 0.345833 exch dup 0.000000 gt { exch pop exch pop exch pop dup 0.000000 sub 0.000000 mul 1.000000 add exch dup 0.000000 sub -0.142000 mul 0.895333 add exch dup 0.000000 sub 0.037500 mul 0.345833 add exch } if dup 1.000000 gt { exch pop exch pop exch pop 1.000000 exch 0.753333 exch 0.383333 exch } if pop }
+endstream
+endobj
+
+2 0 obj
+  337
+endobj
+
+3 0 obj
+  << /Pattern << /P1 << /Matrix [ -15.000002 20.500002 -20.500002 -15.000002 44.760193 19.861086 ]
+                        /Shading << /Coords [ 0.000000 0.000000 1.000000 0.000000 ]
+                                    /ColorSpace /DeviceRGB
+                                    /Function 1 0 R
+                                    /Domain [ 0.000000 1.000000 ]
+                                    /ShadingType 2
+                                    /Extend [ true true ]
+                                 >>
+                        /PatternType 2
+                        /Type /Pattern
+                     >> >> >>
+endobj
+
+4 0 obj
+  << /Length 5 0 R >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+1.000000 0.000000 -0.000000 1.000000 5.500000 5.500000 cm
+/Pattern cs
+/P1 scn
+25.000000 12.500000 m
+25.000000 5.596441 19.403559 0.000000 12.500000 0.000000 c
+5.596441 0.000000 0.000000 5.596441 0.000000 12.500000 c
+0.000000 19.403559 5.596441 25.000000 12.500000 25.000000 c
+19.403559 25.000000 25.000000 19.403559 25.000000 12.500000 c
+h
+f
+n
+Q
+q
+1.000000 0.000000 -0.000000 1.000000 11.500000 11.500000 cm
+1.000000 1.000000 1.000000 scn
+8.000000 13.000000 m
+7.447715 13.000000 7.000000 12.552285 7.000000 12.000000 c
+7.000000 7.000000 l
+7.000000 6.447715 7.447715 6.000000 8.000000 6.000000 c
+12.000000 6.000000 l
+12.552285 6.000000 13.000000 6.447715 13.000000 7.000000 c
+13.000000 12.000000 l
+13.000000 12.552284 12.552285 13.000000 12.000000 13.000000 c
+8.000000 13.000000 l
+h
+1.000000 7.000000 m
+0.447715 7.000000 0.000000 6.552285 0.000000 6.000000 c
+0.000000 1.000000 l
+0.000000 0.447716 0.447715 0.000000 1.000000 0.000000 c
+5.000000 0.000000 l
+5.552285 0.000000 6.000000 0.447715 6.000000 1.000000 c
+6.000000 6.000000 l
+6.000000 6.552285 5.552285 7.000000 5.000000 7.000000 c
+1.000000 7.000000 l
+h
+7.000000 4.000000 m
+7.000000 4.552285 7.447715 5.000000 8.000000 5.000000 c
+12.000000 5.000000 l
+12.552284 5.000000 13.000000 4.552285 13.000000 4.000000 c
+13.000000 1.000000 l
+13.000000 0.447715 12.552284 0.000000 12.000000 0.000000 c
+8.000000 0.000000 l
+7.447715 0.000000 7.000000 0.447715 7.000000 1.000000 c
+7.000000 4.000000 l
+h
+1.000000 13.000000 m
+0.447715 13.000000 0.000000 12.552285 0.000000 12.000000 c
+0.000000 9.000000 l
+0.000000 8.447716 0.447715 8.000000 1.000000 8.000000 c
+5.000000 8.000000 l
+5.552285 8.000000 6.000000 8.447716 6.000000 9.000000 c
+6.000000 12.000000 l
+6.000000 12.552284 5.552285 13.000000 5.000000 13.000000 c
+1.000000 13.000000 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+5 0 obj
+  1814
+endobj
+
+6 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 36.000000 36.000000 ]
+     /Resources 3 0 R
+     /Contents 4 0 R
+     /Parent 7 0 R
+  >>
+endobj
+
+7 0 obj
+  << /Kids [ 6 0 R ]
+     /Count 1
+     /Type /Pages
+  >>
+endobj
+
+8 0 obj
+  << /Pages 7 0 R
+     /Type /Catalog
+  >>
+endobj
+
+xref
+0 9
+0000000000 65535 f
+0000000010 00000 n
+0000000531 00000 n
+0000000553 00000 n
+0000001182 00000 n
+0000003052 00000 n
+0000003075 00000 n
+0000003248 00000 n
+0000003322 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 8 0 R
+   /Size 9
+>>
+startxref
+3381
+%%EOF

+ 21 - 0
PDF Office/PDF Master/Class/KMLightMember/Controller/ComparativeTable/Source/KMCompatative.xcassets/merging.imageset/Contents.json

@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "filename" : "merging.pdf",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 171 - 0
PDF Office/PDF Master/Class/KMLightMember/Controller/ComparativeTable/Source/KMCompatative.xcassets/merging.imageset/merging.pdf

@@ -0,0 +1,171 @@
+%PDF-1.7
+
+1 0 obj
+  << /Length 2 0 R
+     /Range [ 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 ]
+     /Domain [ 0.000000 1.000000 ]
+     /FunctionType 4
+  >>
+stream
+{  0.384314 exch 0.704471 exch 1.000000 exch dup 0.000000 gt { exch pop exch pop exch pop dup 0.000000 sub -0.000980 mul 0.384314 add exch dup 0.000000 sub -0.259471 mul 0.704471 add exch dup 0.000000 sub 0.000000 mul 1.000000 add exch } if dup 1.000000 gt { exch pop exch pop exch pop 0.383333 exch 0.445000 exch 1.000000 exch } if pop }
+endstream
+endobj
+
+2 0 obj
+  338
+endobj
+
+3 0 obj
+  << /Pattern << /P1 << /Matrix [ -17.000002 21.500002 -21.500002 -17.000002 46.755066 22.515627 ]
+                        /Shading << /Coords [ 0.000000 0.000000 1.000000 0.000000 ]
+                                    /ColorSpace /DeviceRGB
+                                    /Function 1 0 R
+                                    /Domain [ 0.000000 1.000000 ]
+                                    /ShadingType 2
+                                    /Extend [ true true ]
+                                 >>
+                        /PatternType 2
+                        /Type /Pattern
+                     >> >> >>
+endobj
+
+4 0 obj
+  << /Length 5 0 R >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+1.000000 0.000000 -0.000000 1.000000 5.500000 5.500000 cm
+/Pattern cs
+/P1 scn
+25.000000 12.500000 m
+25.000000 5.596441 19.403559 0.000000 12.500000 0.000000 c
+5.596441 0.000000 0.000000 5.596441 0.000000 12.500000 c
+0.000000 19.403559 5.596441 25.000000 12.500000 25.000000 c
+19.403559 25.000000 25.000000 19.403559 25.000000 12.500000 c
+h
+f
+n
+Q
+q
+1.000000 0.000000 -0.000000 1.000000 9.799988 11.548340 cm
+1.000000 1.000000 1.000000 scn
+1.750000 12.401611 m
+0.783500 12.401611 0.000000 11.618107 0.000000 10.651609 c
+0.000000 1.749988 l
+0.000000 0.783489 0.783500 -0.000012 1.749999 -0.000012 c
+4.766352 -0.000012 l
+5.732851 -0.000012 6.516352 0.783490 6.516352 1.749988 c
+6.516352 2.566925 l
+5.016352 2.566925 l
+5.016352 1.749988 l
+5.016352 1.611917 4.904423 1.499988 4.766352 1.499988 c
+1.749999 1.499988 l
+1.611929 1.499988 1.500000 1.611916 1.500000 1.749988 c
+1.500000 5.451599 l
+4.419161 5.451599 l
+3.247738 4.528658 l
+4.314874 3.474513 l
+7.072623 5.647289 l
+7.661741 6.111444 l
+7.128173 6.638516 l
+4.633858 9.102467 l
+3.455621 8.174157 l
+4.693246 6.951599 l
+1.500000 6.951599 l
+1.500000 10.651609 l
+1.500000 10.789682 1.611930 10.901611 1.750000 10.901611 c
+4.766353 10.901611 l
+4.904423 10.901611 5.016352 10.789683 5.016352 10.651611 c
+5.016352 9.834674 l
+6.516352 9.834674 l
+6.516352 10.651611 l
+6.516352 11.618109 5.732852 12.401611 4.766353 12.401611 c
+1.750000 12.401611 l
+h
+14.649113 12.401611 m
+15.615612 12.401611 16.399113 11.618107 16.399113 10.651609 c
+16.399113 1.749988 l
+16.399113 0.783489 15.615613 -0.000012 14.649114 -0.000012 c
+11.632761 -0.000012 l
+10.666262 -0.000012 9.882761 0.783490 9.882761 1.749988 c
+9.882761 2.566925 l
+11.382761 2.566925 l
+11.382761 1.749988 l
+11.382761 1.611917 11.494690 1.499988 11.632761 1.499988 c
+14.649114 1.499988 l
+14.787184 1.499988 14.899113 1.611916 14.899113 1.749988 c
+14.899113 5.451599 l
+11.293171 5.451599 l
+12.464592 4.528659 l
+11.397456 3.474515 l
+8.639708 5.647291 l
+8.050589 6.111446 l
+8.584156 6.638518 l
+11.078472 9.102468 l
+12.256708 8.174158 l
+11.019082 6.951599 l
+14.899113 6.951599 l
+14.899113 10.651609 l
+14.899113 10.789682 14.787183 10.901611 14.649113 10.901611 c
+11.632759 10.901611 l
+11.494690 10.901611 11.382761 10.789683 11.382761 10.651611 c
+11.382761 9.834674 l
+9.882761 9.834674 l
+9.882761 10.651611 l
+9.882761 11.618109 10.666260 12.401611 11.632759 12.401611 c
+14.649113 12.401611 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+5 0 obj
+  2416
+endobj
+
+6 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 36.000000 36.000000 ]
+     /Resources 3 0 R
+     /Contents 4 0 R
+     /Parent 7 0 R
+  >>
+endobj
+
+7 0 obj
+  << /Kids [ 6 0 R ]
+     /Count 1
+     /Type /Pages
+  >>
+endobj
+
+8 0 obj
+  << /Pages 7 0 R
+     /Type /Catalog
+  >>
+endobj
+
+xref
+0 9
+0000000000 65535 f
+0000000010 00000 n
+0000000532 00000 n
+0000000554 00000 n
+0000001183 00000 n
+0000003655 00000 n
+0000003678 00000 n
+0000003851 00000 n
+0000003925 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 8 0 R
+   /Size 9
+>>
+startxref
+3984
+%%EOF

+ 8 - 2
PDF Office/PDF Master/Class/KMLightMember/Controller/ComparativeTable/View/KMComparativeView/KMComparativeView.swift

@@ -49,7 +49,10 @@ class KMComparativeView: KMBaseXibView {
                 ["title": "Basic functions like annotation and viewing",
                  "state": 2,
                  "color": "#252629"],
-                ["title": "Convert with 10 pages per file",
+                ["title": "Convert PDF to Office (Only first 10 pages)",
+                 "state": 2,
+                 "color": "#252629"],
+                ["title": "Merge only 2 files for free",
                  "state": 2,
                  "color": "#252629"]
             ],
@@ -57,7 +60,7 @@ class KMComparativeView: KMBaseXibView {
         ],
         [
             "type": 1,
-            "title": "Annual Plan",
+            "title": "Yearly Plan",
             "subtitle": "$79.99",
             "describe": "Save 50%@ for the first year, auto-renew at %@. Billed yearly.",
             "productId": PRODUCT_1,
@@ -72,6 +75,9 @@ class KMComparativeView: KMBaseXibView {
                  "state": 1,
                  "color": "#252629"],
                 ["title": "Convert PDF to Office without limitation",
+                 "state": 1,
+                 "color": "#252629"],
+                ["title": "Batch merge files without limitation",
                  "state": 1,
                  "color": "#252629"]
             ],

+ 1 - 1
PDF Office/PDF Master/Class/KMLightMember/Controller/Login&Register/KMLoginWindowController.swift

@@ -95,7 +95,7 @@ class KMLoginWindowController: NSWindowController {
             
             if self?.inputType == .ComparativeTable {
                 //跳转订阅比较表
-                let _ = KMComparativeTableViewController.show(window: NSApp.mainWindow ?? NSWindow())
+                let _ = KMComparativeTableViewController.show(window: NSApp.mainWindow ?? NSWindow(),.loginCancel)
             }
         }
         

+ 8 - 8
PDF Office/PDF Master/Class/KMLightMember/Controller/Login&Register/View/KMLoginLeftImageView.swift

@@ -30,8 +30,8 @@ class KMLoginLeftImageView: KMBaseXibView {
     override func setup() {
         super.setup()
         
-        self.subscriptionButton.setTitleColor(NSColor(hex: "#3F8FF6"))
-        self.subscriptionButton.font = NSFont.SFProTextSemibold(12.0)
+//        self.subscriptionButton.setTitleColor(NSColor(hex: "#3F8FF6"))
+//        self.subscriptionButton.font = NSFont.SFProTextSemibold(12.0)
         
         self.closeBox.moveCallback = { [weak self] (mouseEntered, mouseBox) in
             if mouseEntered {
@@ -42,17 +42,17 @@ class KMLoginLeftImageView: KMBaseXibView {
         }
         
         Task { @MainActor in
-            self.subscriptionButton.isHidden = true
+//            self.subscriptionButton.isHidden = true
             if self.logType != .registerSuccess {
                 if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
-                    self.subscriptionButton.isHidden = false
+//                    self.subscriptionButton.isHidden = false
                 }
             }
         }
     }
     
     override func updateLanguage() {
-        self.subscriptionButton.title = NSLocalizedString("Subscribe Now", comment: "")
+//        self.subscriptionButton.title = NSLocalizedString("Subscribe Now", comment: "")
     }
     
     func updateImage() {
@@ -60,10 +60,10 @@ class KMLoginLeftImageView: KMBaseXibView {
         switch logType {
         case .registerSuccess:
             image = NSImage(named: "image_registerSuccess")!
-            self.subscriptionButton.isHidden = true
+//            self.subscriptionButton.isHidden = true
         default:
-            image = NSImage(named: "image_other")!
-            self.subscriptionButton.isHidden = false
+            image = NSImage(named: "image_Popup")!
+//            self.subscriptionButton.isHidden = false
         }
         self.imageView.image = image
     }

+ 1 - 1
PDF Office/PDF Master/Class/KMLightMember/Controller/Login&Register/View/KMLoginLeftImageView.xib

@@ -61,7 +61,7 @@
                         <action selector="cancelButtonAction:" target="-2" id="df5-MO-xjM"/>
                     </connections>
                 </button>
-                <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="7z9-Ga-XM3">
+                <button hidden="YES" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="7z9-Ga-XM3">
                     <rect key="frame" x="160" y="26" width="96" height="16"/>
                     <buttonCell key="cell" type="square" title="Subscribe Now" bezelStyle="shadowlessSquare" alignment="center" imageScaling="proportionallyDown" inset="2" id="H4X-qF-Fef">
                         <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>

+ 71 - 82
PDF Office/PDF Master/Class/KMLightMember/Controller/SubscriptionView/WaterMark/KMSubscribeWaterMarkWindowController.swift

@@ -39,12 +39,18 @@ var subscribeWaterMarkMainWindow: NSWindow?
     case aiTranslate
     case aiRewrite
     case aiCorrect
+    
+    func isConvertType() -> Bool {
+        if (self == .toWord || self == .toExcel || self == .toPPT || self == .toRTF || self == .toCSV || self == .toHTML || self == .toText || self == .toImage) {
+            return true
+        }
+        return false
+    }
 }
 
 typealias KMSubscribeWaterMarkWindowControllerCloseAction = (_ controller: KMSubscribeWaterMarkWindowController) -> Void
 typealias KMSubscribeWaterMarkWindowControllerWatermarkExportAction = (_ controller: KMSubscribeWaterMarkWindowController) -> Void
 typealias KMSubscribeWaterMarkWindowControllerSubscribeAction = (_ controller: KMSubscribeWaterMarkWindowController) -> Void
-typealias KMSubscribeWaterMarkWindowControllerRestoreAction = (_ controller: KMSubscribeWaterMarkWindowController) -> Void
 
 class KMSubscribeWaterMarkWindowController: NSWindowController {
 
@@ -54,10 +60,14 @@ class KMSubscribeWaterMarkWindowController: NSWindowController {
     var closeAction: KMSubscribeWaterMarkWindowControllerCloseAction?
     var subscribeAction: KMSubscribeWaterMarkWindowControllerSubscribeAction?
     var watermarkExportAction: KMSubscribeWaterMarkWindowControllerWatermarkExportAction?
-    var restoreAction: KMSubscribeWaterMarkWindowControllerRestoreAction?
     
     var isContinue: Bool?
     var isAI: Bool?
+    var type: KMSubscribeWaterMarkType? {
+        didSet {
+            self.waterMarkView.type = type
+        }
+    }
     
     deinit {
         KMPrint("KMSubscribeWaterMarkWindowController 释放")
@@ -72,35 +82,45 @@ class KMSubscribeWaterMarkWindowController: NSWindowController {
     
     override func awakeFromNib() {
         super.awakeFromNib()
-        
-        if let data = self.isAI, data {
-            self.waterMarkView.waterExportButton.isHidden = true
-            self.waterMarkView.subTrailingConst.constant = 60
-            self.waterMarkView.subWidthConst.constant = 280
-            self.waterMarkView.preferentialImageTrailingConst.constant = 92
-        } else {
-            self.waterMarkView.waterExportButton.isHidden = false
-            self.waterMarkView.subTrailingConst.constant = 0
-            self.waterMarkView.subWidthConst.constant = 192
-            self.waterMarkView.preferentialImageTrailingConst.constant = 32
-        }
     }
     
     //MARK: 打开文件
-    static func show(window: NSWindow, isContinue: Bool = false, isAI: Bool = false, type: KMSubscribeWaterMarkType = .none, subscribeDidClick: (()->Void)? = nil, completion: @escaping (_ isSubscribeSuccess: Bool, _ isWaterMarkExport: Bool, _ isClose: Bool) -> Void) -> KMSubscribeWaterMarkWindowController {
-        if KMLightMemberManager.manager.isLogin() {
+    @objc static func show(window: NSWindow, isContinue: Bool = false, type: KMSubscribeWaterMarkType = .none, subscribeDidClick: (()->Void)? = nil, completion: @escaping (_ isSubscribeSuccess: Bool, _ isWaterMarkExport: Bool, _ isClose: Bool) -> Void) -> KMSubscribeWaterMarkWindowController {
+        var isAI = false
+        if type == .aiCorrect ||
+            type == .aiRewrite ||
+            type == .aiTranslate {
+            isAI = true
+        } else {
+            isAI = false
+        }
+        
+        if isAI && KMLightMemberManager.manager.purchaseState != .subscription {
+            if KMLightMemberManager.manager.isLogin() {
+                KMComparativeTableViewController.show(window: NSApp.mainWindow!, .equity)
+            } else {
+                let controller = KMLoginWindowController.show(window: NSApp.mainWindow!,.equity)
+                if isAI {
+                    let alert = NSAlert()
+                    alert.messageText = NSLocalizedString("Please Login or Sign up to proceed to the next step.", comment: "")
+                    alert.informativeText = NSLocalizedString("On upgrading your account, you can enjoy all AI features in PDF Master.", comment: "")
+                    alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
+                    alert.beginSheetModal(for: (controller?.window)!) { result in
+
+                    }
+                }
+            }
+            return KMSubscribeWaterMarkWindowController.init()
+        } else {
             let subscribeWaterMarkWindowController: KMSubscribeWaterMarkWindowController = KMSubscribeWaterMarkWindowController.init(windowNibName: "KMSubscribeWaterMarkWindowController")
 
             subscribeWaterMarkWindowController.isContinue = isContinue
             subscribeWaterMarkWindowController.isAI = isAI
+            
             window.beginSheet(subscribeWaterMarkWindowController.window!)
             subscribeWaterMarkWindowController.window?.center()
             
-            if isContinue {
-                subscribeWaterMarkWindowController.waterMarkView.waterExportButton.title = NSLocalizedString("Continue", comment: "")
-            } else {
-                subscribeWaterMarkWindowController.waterMarkView.waterExportButton.title = NSLocalizedString("Save with Watermark", comment: "")
-            }
+            subscribeWaterMarkWindowController.type = type
             
             subscribeWaterMarkWindowController.closeAction = { controller in
                 completion(false, false, true)
@@ -112,7 +132,12 @@ class KMSubscribeWaterMarkWindowController: NSWindowController {
             }
             
             subscribeWaterMarkWindowController.watermarkExportAction = { controller in
-                completion(false, true, false)
+                if type.isConvertType() && !KMLightMemberManager.manager.isLogin() {
+                    completion(false, false, true)
+                } else {
+                    completion(false, true, false)
+                }
+                
                 subscribeWaterMarkMainWindow?.endSheet(controller.window!)
                 controller.window?.close()
                 subscribeWaterMarkController = nil
@@ -124,63 +149,37 @@ class KMSubscribeWaterMarkWindowController: NSWindowController {
                     callback()
                 }
                 
-                // 数据埋点
-                controller.trackEvent(type: type)
+                subscribeWaterMarkMainWindow?.endSheet(controller.window!)
+                controller.window?.close()
+                subscribeWaterMarkController = nil
                 
-                controller.waterMarkView.beginLoading(backgroundColor: NSColor.black.withAlphaComponent(0.2))
-                KMPurchaseManager.manager.purchaseProduct(productIdentifier: PRODUCT_1) { isSuccess, error in
-                    if isSuccess {
-                        subscribeWaterMarkMainWindow?.endSheet(controller.window!)
-                        controller.window?.close()
-                        subscribeWaterMarkController = nil
-//                        subscribeWaterMarkMainWindow = nil
-                        
-                        if subscribeWaterMarkMainWindow != nil {
-                            let controller = KMSubscribeSuccessWindowController.show(window: subscribeWaterMarkMainWindow!)
-                            controller.closeAction = { controller in
-                                controller.closeWindow()
-                                completion(true, false, false)
-                            }
-                            subscribeWaterMarkMainWindow = nil
-                        } else {
-                            completion(true, false, false)
-                        }
-                        
-                    } else {
-                        KMComparativeTableViewController.purchasefailed(view: subscribeWaterMarkController?.waterMarkView, state: error)
-                        completion(false, false, false)
-                    }
-                    
-                    controller.waterMarkView.endLoading()
+                if KMLightMemberManager.manager.isLogin() {
+                    KMComparativeTableViewController.show(window: subscribeWaterMarkMainWindow ?? NSWindow(), .equity)
+                } else {
+                    KMLoginWindowController.show(window: subscribeWaterMarkMainWindow ?? NSWindow())
                 }
+                subscribeWaterMarkMainWindow = nil
             }
             
-            subscribeWaterMarkWindowController.restoreAction = { controller in
-                controller.waterMarkView.beginLoading(backgroundColor: NSColor.black.withAlphaComponent(0.2))
-                KMPurchaseManager.manager.restorePurchases { isSuccess, error in
-                    if isSuccess {
-                        subscribeWaterMarkMainWindow?.endSheet(controller.window!)
-                        controller.window?.close()
-                        subscribeWaterMarkController = nil
-                        subscribeWaterMarkMainWindow = nil
-                        
-                        completion(true, false, false)
+            if isContinue {
+                subscribeWaterMarkWindowController.waterMarkView.waterExportButton.title = NSLocalizedString("Save with Watermark", comment: "")
+            } else {
+                if type == .merge {
+                    subscribeWaterMarkWindowController.waterMarkView.waterExportButton.title = NSLocalizedString("Delete From the File List", comment: "")
+                } else if type.isConvertType() {
+                    if KMLightMemberManager.manager.isLogin() {
+                        subscribeWaterMarkWindowController.waterMarkView.waterExportButton.title = NSLocalizedString("Convert First 10 Pages", comment: "")
                     } else {
-                        if error != .restoreSuccess {
-                            KMComparativeTableViewController.purchasefailed(view: subscribeWaterMarkController?.waterMarkView, state: error)
-                        }
-                        completion(false, false, false)
+                        subscribeWaterMarkWindowController.waterMarkView.waterExportButton.title = NSLocalizedString("Later", comment: "")
                     }
-                    controller.waterMarkView.endLoading()
+                } else {
+                    subscribeWaterMarkWindowController.waterMarkView.waterExportButton.title = NSLocalizedString("Save with Watermark", comment: "")
                 }
             }
             
             subscribeWaterMarkController = subscribeWaterMarkWindowController
             subscribeWaterMarkMainWindow = window
             return subscribeWaterMarkWindowController
-        } else {
-            KMLoginWindowController.show(window: NSApp.mainWindow!,.equity)
-            return KMSubscribeWaterMarkWindowController.init()
         }
     }
     
@@ -202,18 +201,10 @@ class KMSubscribeWaterMarkWindowController: NSWindowController {
         }
         
         self.waterMarkView.subscribeAction = { [weak self] view in
-            self?.trackEvent(eventName: "PUW_Sub_Subscribe")
-            
             guard let callBack = self?.subscribeAction else { return }
             
             callBack((self!))
         }
-        
-        self.waterMarkView.restoreAction = { [weak self] view in
-            guard let callBack = self?.restoreAction else { return }
-            
-            callBack((self!))
-        }
     }
     
     func closeWindow() {
@@ -229,13 +220,11 @@ class KMSubscribeWaterMarkWindowController: NSWindowController {
     }
     
     func reloadData() {
-        #if VERSION_FREE
-        self.waterViewHeightConstrain.constant = 511
-        #endif
-        
-        #if VERSION_DMG
-        self.waterViewHeightConstrain.constant = 511 - 80
-        #endif
+        if KMLightMemberManager.manager.isLogin() {
+            self.waterViewHeightConstrain.constant = 624
+        } else {
+            self.waterViewHeightConstrain.constant = 485
+        }
     }
     
     static func isSampleController() -> KMSubscribeWaterMarkWindowController {

+ 6 - 6
PDF Office/PDF Master/Class/KMLightMember/Controller/SubscriptionView/WaterMark/KMSubscribeWaterMarkWindowController.xib

@@ -18,18 +18,18 @@
         <window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="F0z-JX-Cv5">
             <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
             <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
-            <rect key="contentRect" x="196" y="240" width="448" height="511"/>
+            <rect key="contentRect" x="196" y="240" width="380" height="505"/>
             <rect key="screenRect" x="0.0" y="0.0" width="2560" height="1415"/>
-            <value key="minSize" type="size" width="448" height="511"/>
-            <value key="maxSize" type="size" width="448" height="511"/>
+            <value key="minSize" type="size" width="448" height="505"/>
+            <value key="maxSize" type="size" width="448" height="505"/>
             <view key="contentView" id="se5-gp-TjO">
-                <rect key="frame" x="0.0" y="0.0" width="448" height="511"/>
+                <rect key="frame" x="0.0" y="0.0" width="380" height="505"/>
                 <autoresizingMask key="autoresizingMask"/>
                 <subviews>
                     <customView translatesAutoresizingMaskIntoConstraints="NO" id="kKR-sQ-MOd" customClass="KMSubscribeWaterMarkView" customModule="PDF_Master" customModuleProvider="target">
-                        <rect key="frame" x="0.0" y="0.0" width="448" height="511"/>
+                        <rect key="frame" x="0.0" y="0.0" width="380" height="505"/>
                         <constraints>
-                            <constraint firstAttribute="height" constant="511" id="hGQ-d7-hqP"/>
+                            <constraint firstAttribute="height" constant="505" id="hGQ-d7-hqP"/>
                         </constraints>
                     </customView>
                 </subviews>

+ 2 - 2
PDF Office/PDF Master/Class/KMLightMember/Controller/SubscriptionView/WaterMark/View/KMSubscribeWaterMarkCollectionItem.swift

@@ -27,7 +27,7 @@ class KMSubscribeWaterMarkCollectionItem: NSCollectionViewItem {
     }
     
     func setup() {
-        self.titleLabel.textColor = NSColor(hex: "#252629")
+        self.titleLabel.textColor = NSColor(hex: "#273C62")
         self.titleLabel.font = NSFont.SFProTextSemibold(14)
         
         self.subtitleLabel.textColor = NSColor(hex: "#616469")
@@ -43,7 +43,7 @@ class KMSubscribeWaterMarkCollectionItem: NSCollectionViewItem {
             self.iconImageView.image = NSImage(named: data["image"] as! NSImage.Name)
             
             let paragraphStyle = NSMutableParagraphStyle()
-            paragraphStyle.lineHeightMultiple = 1.32
+            paragraphStyle.lineHeightMultiple = 1.4
             paragraphStyle.alignment = .left
             self.titleLabel.attributedStringValue = NSMutableAttributedString(string: NSLocalizedString(titleString, comment: ""), attributes: [NSAttributedString.Key.paragraphStyle: paragraphStyle])
             

+ 4 - 4
PDF Office/PDF Master/Class/KMLightMember/Controller/SubscriptionView/WaterMark/View/KMSubscribeWaterMarkCollectionItem.xib

@@ -17,7 +17,7 @@
         <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
         <customObject id="-3" userLabel="Application" customClass="NSObject"/>
         <customView id="Hz6-mo-xeY">
-            <rect key="frame" x="0.0" y="0.0" width="448" height="66"/>
+            <rect key="frame" x="0.0" y="0.0" width="324" height="66"/>
             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
             <subviews>
                 <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="UN8-s9-tdC">
@@ -40,9 +40,9 @@
                     </textFieldCell>
                 </textField>
                 <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="BPg-hS-GYT">
-                    <rect key="frame" x="42" y="14" width="360" height="32"/>
+                    <rect key="frame" x="42" y="-2" width="254" height="48"/>
                     <constraints>
-                        <constraint firstAttribute="width" constant="356" id="me1-1N-hoI"/>
+                        <constraint firstAttribute="width" constant="250" id="me1-1N-hoI"/>
                     </constraints>
                     <textFieldCell key="cell" title="The trial watermark will be added when you save the file after trying the advanced features" id="C0c-sD-YMa">
                         <font key="font" metaFont="system"/>
@@ -59,7 +59,7 @@
                 <constraint firstItem="UN8-s9-tdC" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" id="vtj-uR-u5F"/>
                 <constraint firstItem="KPf-lK-ZOs" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" id="xMc-CF-EUQ"/>
             </constraints>
-            <point key="canvasLocation" x="104" y="193"/>
+            <point key="canvasLocation" x="-147" y="191"/>
         </customView>
     </objects>
     <resources>

+ 72 - 165
PDF Office/PDF Master/Class/KMLightMember/Controller/SubscriptionView/WaterMark/View/KMSubscribeWaterMarkView.swift

@@ -17,41 +17,52 @@ class KMSubscribeWaterMarkView: KMBaseXibView {
     @IBOutlet weak var closeBox: KMBox!
     @IBOutlet weak var closeButton: NSButton!
     @IBOutlet weak var titleLabel: NSTextField!
+    @IBOutlet weak var subtitleLabel: NSTextField!
+    @IBOutlet weak var subtitleContentHeightConstraint: NSLayoutConstraint!
     @IBOutlet weak var scrollView: NSScrollView!
     @IBOutlet weak var collectionView: NSCollectionView!
+    @IBOutlet weak var collectionViewContentTopConstraint: NSLayoutConstraint!
+    @IBOutlet weak var collectionContentViewHeightConstraint: NSLayoutConstraint!
     @IBOutlet weak var waterExportButton: NSButton!
     @IBOutlet weak var subscribeView: NSView!
     @IBOutlet weak var subscribeLabel: NSTextField!
     @IBOutlet weak var subscribeBox: KMBox!
     @IBOutlet weak var lineView: NSView!
-//    @IBOutlet var textView: NSTextView!
-    @IBOutlet weak var restoreButton: NSButton!
-    @IBOutlet weak var discountImageView: NSImageView!
-    
-    @IBOutlet weak var infoButton: NSButton!
-    @IBOutlet weak var privacyPolicyButton: NSButton!
-    @IBOutlet weak var termsServiceButton: NSButton!
-    @IBOutlet weak var lineView2: NSView!
-    
-    @IBOutlet weak var subTrailingConst: NSLayoutConstraint!
-    @IBOutlet weak var subWidthConst: NSLayoutConstraint!
-    @IBOutlet weak var preferentialImageTrailingConst: NSLayoutConstraint!
     
     var closeAction: KMSubscribeWaterMarkViewCancelAction?
     var subscribeAction: KMSubscribeWaterMarkViewSubscribeAction?
     var waterMarkExportAction: KMSubscribeWaterMarkViewWaterMarkExportAction?
-    var restoreAction: KMSubscribeWaterMarkViewWaterMarkRestoreAction?
     
-    var dataArray = [
+    var dataArray: [[String: String]] = [[:]]
+    
+    var type: KMSubscribeWaterMarkType? {
+        didSet {
+            self.updateLanguage()
+        }
+    }
+    
+    var afterLoginDataArray = [
         ["title": "Save without watermark",
          "subtitle": "When you save a document with PDF Master after editing, no watermark will be attached",
          "image": "remove watermark"],
+        ["title": "AI assitant",
+         "subtitle": "Support AI translation, AI rewriting, AI correction",
+         "image": "ai"],
         ["title": "Convert PDF without limitation",
          "subtitle": "Convert PDF to Office and image without any limitations, get converted files in high quality",
          "image": "convert"],
-        ["title": "AI assitant",
-         "subtitle": "Support AI translation, AI rewriting, AI correction",
-         "image": "ai"]
+        ["title": "Batch Processing",
+         "subtitle": "The trial version can merge only 2 files at a time in batch processing",
+         "image": "merging"]
+    ]
+    
+    var beforeLoginDataArray = [
+        ["title": "First 10 Pages of Conversion",
+         "subtitle": "Login to get the first 10 pages PDF Conversion freely.",
+         "image": "convert"],
+        ["title": "Full-Featured Trial",
+         "subtitle": "Unlock and use all features after signing in PDF Master.",
+         "image": "full function trial"]
     ]
     
     let popover = NSPopover()
@@ -106,108 +117,65 @@ class KMSubscribeWaterMarkView: KMBaseXibView {
             }
         }
         
-        self.restoreButton.contentTintColor = NSColor(hex: "#1770F4")
-        self.restoreButton.font = NSFont.SFProTextRegular(14)
-        
-        self.lineView.backgroundColor(NSColor(hex: "#000000", alpha: 0.1))
-        
-        self.privacyPolicyButton.contentTintColor = NSColor(hex: "#1770F4")
-        self.privacyPolicyButton.font = NSFont.SFProTextRegular(12)
-        
-        self.lineView2.backgroundColor(NSColor(hex: "#000000").withAlphaComponent(0.1))
+        self.lineView.backgroundColor(NSColor(hex: "#000000").withAlphaComponent(0.1))
         
-        self.termsServiceButton.contentTintColor = NSColor(hex: "#1770F4")
-        self.termsServiceButton.font = NSFont.SFProTextRegular(12)
-        
-//        self.textView.frame = (self.textView.enclosingScrollView?.contentView.bounds)!
-//        self.textView.autoresizingMask = [.width, .height]
+        // 获取包含 NSCollectionView 的 NSScrollView
+        if let scrollView = collectionView.enclosingScrollView {
+            scrollView.hasHorizontalScroller = true
+            scrollView.horizontalScroller?.alphaValue = 0
+            
+            scrollView.hasVerticalScroller = true
+            scrollView.verticalScroller?.alphaValue = 0
+        }
     }
     
     override func updateLanguage() {
-        self.titleLabel.stringValue = NSLocalizedString("Subscription Benefits", comment: "")
-        self.waterExportButton.title = NSLocalizedString("Save with Watermark", comment: "")
-        self.subscribeLabel.stringValue = NSLocalizedString("Subscribe", comment: "")
+        if KMLightMemberManager.manager.isLogin() {
+            self.subtitleContentHeightConstraint.constant = 0
+            self.collectionContentViewHeightConstraint.constant = 368
+            self.collectionViewContentTopConstraint.constant = 28
+            self.titleLabel.stringValue = NSLocalizedString("Subscription Benefits", comment: "")
+            self.waterExportButton.title = NSLocalizedString("Save with Watermark", comment: "")
+            self.subscribeLabel.stringValue = NSLocalizedString("Upgrade Now", comment: "")
+        } else {
+            self.subtitleContentHeightConstraint.constant = 80
+            self.collectionContentViewHeightConstraint.constant = 180
+            self.collectionViewContentTopConstraint.constant = 116
+            self.titleLabel.stringValue = NSLocalizedString("Login Benefits", comment: "")
+            self.waterExportButton.title = NSLocalizedString("Save with Watermark ", comment: "")
+            self.subscribeLabel.stringValue = NSLocalizedString("Login or Sign up", comment: "")
+        }
 //        + "  " + NSLocalizedString("Subscription", comment: ""
-        let string = NSLocalizedString("""
-            Payment will be charged to your Apple ID account at the confirmation of purchase.Subscription automatically renews unless it is canceled at least 24 hours before the end of the current period. Your account will be charged for renewal within 24 hours prior to the end of the current period. You can manage and cancel your subscriptions by going to your account settings on the App Store after purchase.
-""", comment: "")
-        let attributedString = NSMutableAttributedString.init(string: string)
-        let paragraphStyle = NSMutableParagraphStyle()
-        paragraphStyle.alignment = .left;
-        paragraphStyle.lineHeightMultiple = 1.37
-        attributedString.addAttributes([NSAttributedString.Key.font : NSFont.SFProTextRegular(11.0),
-                                        NSAttributedString.Key.foregroundColor : NSColor(hex: "#94989C"),
-                                        NSAttributedString.Key.paragraphStyle : paragraphStyle],
-                                    range: NSRange(location: 0, length: string.count))
-        
-//        let range = string.range(of: NSLocalizedString("Subscription", comment: ""))
-//        attributedString.setAttributes([NSAttributedString.Key.font : NSFont.SFProTextRegular(12.0),
-//                                        NSAttributedString.Key.foregroundColor : NSColor(hex: "#1770F4"),
-//                                        NSAttributedString.Key.underlineColor : NSColor.clear,
-//                                        NSAttributedString.Key.link : "register://"],
-//                                       range: string.nsRange(from: range!)!)
         
-//        self.textView.textStorage?.setAttributedString(attributedString)
+        var subtitleString = ""
+        if type == .merge {
+            subtitleString = NSLocalizedString("The trial version can merge only 2 files at a time in batch processing. Login or sign up PDF Master to speed your workflow!", comment: "")
+        } else {
+            subtitleString = NSLocalizedString("Login or sign up PDF Master lets you enjoy all features including annotating, text editing and page organization for FREE!", comment: "")
+        }
+        let paragraphStyle = NSMutableParagraphStyle()
+        paragraphStyle.lineHeightMultiple = 1.32
+        paragraphStyle.alignment = .left
+        self.subtitleLabel.textColor = NSColor(hex: "#273C62")
+        self.subtitleLabel.attributedStringValue = NSMutableAttributedString(string: NSLocalizedString(subtitleString, comment: ""), attributes: [NSAttributedString.Key.paragraphStyle: paragraphStyle, NSAttributedString.Key.font : NSFont.SFProTextRegular(12)])
     }
 
     override func reloadData() {
+        if KMLightMemberManager.manager.isLogin() {
+            self.dataArray = afterLoginDataArray
+        } else {
+            self.dataArray = beforeLoginDataArray
+        }
         self.collectionView.reloadData()
         
 #if VERSION_FREE
-        self.lineView.isHidden = false
-        self.restoreButton.isHidden = false
-//        self.textView.isHidden = false
         
-        self.beginLoading(backgroundColor: NSColor.black.withAlphaComponent(0.2))
-        KMInAppPurchaseManager.manager.fetchProducts { [weak self] isSuccess, products, error in
-            KMPurchaseManager.manager.checkSubscriptionStatus({ [weak self] isSubscription in
-                self?.isSubscription = isSubscription
-                self?.endLoading()
-                self?.updatePrice()
-            })
-        }
 #endif
 
 #if VERSION_DMG
-        self.lineView.isHidden = true
         self.restoreButton.isHidden = true
-//        self.textView.isHidden = true
 #endif
-        self.discountImageView.isHidden = true
-        
-//        if KMLightMemberManager.manager.purchaseState == .trialExpired ||
-//            KMLightMemberManager.manager.purchaseState == .subscriptionExpired {
-//            self.discountImageView.isHidden = true
-//        } else {
-//            self.discountImageView.isHidden = false
-//        }
     }
-    
-    func updatePrice() {
-        let productId: String = PRODUCT_1
-        for product in KMInAppPurchaseManager.manager.availableProducts {
-            if product.productIdentifier == productId {
-                KMPrint("-----------------------------")
-                KMPrint(product.priceLocale.currencySymbol)
-                KMPrint(product.introductoryPrice?.price)
-                KMPrint(product.price)
-                KMPrint("-----------------------------")
-                let currencySymbol: String = product.priceLocale.currencySymbol ?? "$"
-                let currencyCode: String = product.priceLocale.currencyCode ?? "$"
-                let price: String = product.introductoryPrice?.price.description ?? "39.9"
-                let originPrice: String = product.price.description ?? "79.9"
-                
-                if isSubscription {
-                    self.discountImageView.isHidden = true
-                    self.subscribeLabel.stringValue = "\(currencyCode) \(originPrice) / year"
-                } else {
-                    self.discountImageView.isHidden = false
-                    self.subscribeLabel.stringValue = "\(currencyCode)\(price) / year"
-                }
-            }
-        }
-    }
-    
 }
 
 extension KMSubscribeWaterMarkView {
@@ -228,67 +196,6 @@ extension KMSubscribeWaterMarkView {
         
         callBack(self)
     }
-    
-    @IBAction func infoButtonAction(_ sender: Any) {
-        self.showPopover(sender)
-    }
-    
-    @IBAction func restoreButtonAction(_ sender: Any) {
-        guard let callBack = restoreAction else { return }
-        
-        callBack(self)
-    }
-    
-    @IBAction func privacyPolicyButtonAction(_ sender: Any) {
-        NSWorkspace.shared.open(URL(string: "https://www.pdfreaderpro.com/privacy-policy")!)
-    }
-    
-    @IBAction func termsServiceButtonAction(_ sender: Any) {
-        NSWorkspace.shared.open(URL(string: "https://www.pdfreaderpro.com/terms_of_service")!)
-    }
-    
-    func setupPopover() {
-        let string: NSString = NSLocalizedString(
-"""
-Payment will be charged to your Apple ID account at the confirmation of purchase.\nSubscription automatically renews unless it is canceled at least 24 hours before the end of the current period. Your account will be charged for renewal within 24 hours prior to the end of the current period. You can manage and cancel your subscriptions by going to your account settings on the App Store after purchase.
-"""
-            , comment: "") as NSString
-        
-        let paragraphStyle = NSMutableParagraphStyle()
-        paragraphStyle.lineHeightMultiple = 1.4
-        paragraphStyle.alignment = .left
-        let attributes = [NSAttributedString.Key.font : NSFont.SFProTextRegular(12), NSAttributedString.Key.paragraphStyle : paragraphStyle]
-        var size: NSSize = string.boundingRect(with: NSSize(width: 420, height: 600), options: NSString.DrawingOptions(rawValue: 3), attributes: attributes).size
-        size = CGSize(width: size.width, height: size.height + 30)
-        
-        popover.behavior = .transient
-        popover.setValue(true, forKey: "shouldHideAnchor")
-        popover.contentViewController = NSViewController()
-        popover.contentViewController?.view = NSView(frame: NSRect(x: 0, y: 0, width: size.width, height: size.height))
-        popover.contentViewController?.view.wantsLayer = true
-        popover.contentViewController?.view.layer?.backgroundColor = NSColor(hex:"#000000").cgColor
-        
-        let textField = NSTextField(frame: NSRect(x: 16, y: 8, width: size.width - 32, height: size.height - 16))
-        textField.attributedStringValue = NSMutableAttributedString(string: NSLocalizedString(string as String, comment: ""), attributes: attributes)
-        textField.backgroundColor(NSColor(hex: "#000000"))
-        textField.drawsBackground = false
-        textField.isEditable = false
-        textField.isSelectable = false
-        textField.lineBreakMode = .byCharWrapping
-        textField.textColor = NSColor(hex: "#FFFFFF")
-        
-        popover.contentViewController?.view.addSubview(textField)
-    }
-    
-    @objc func showPopover(_ sender: Any?) {
-        if popover.isShown {
-            popover.performClose(sender)
-        } else {
-            self.setupPopover()
-            let button = sender as? NSButton
-            popover.show(relativeTo: button?.bounds ?? NSZeroRect, of: button ?? NSView(), preferredEdge: NSRectEdge.maxX)
-        }
-    }
 }
 
 extension KMSubscribeWaterMarkView: NSCollectionViewDataSource {
@@ -328,11 +235,11 @@ extension KMSubscribeWaterMarkView: NSCollectionViewDelegateFlowLayout {
         let subtitleString: NSString = data["subtitle"]! as NSString
 
         let paragraphStyle = NSMutableParagraphStyle()
-        paragraphStyle.lineHeightMultiple = 1.32
+        paragraphStyle.lineHeightMultiple = 1.4
         paragraphStyle.alignment = .left
-        let size: NSSize = string.boundingRect(with: NSSize(width: 356, height: 100), options: NSString.DrawingOptions(rawValue: 3), attributes: [NSAttributedString.Key.font : NSFont.SFProTextSemibold(14), NSAttributedString.Key.paragraphStyle : paragraphStyle]).size
-        let subtitleSize: NSSize = subtitleString.boundingRect(with: NSSize(width: 356, height: 100), options: NSString.DrawingOptions(rawValue: 3), attributes: [NSAttributedString.Key.font : NSFont.SFProTextRegular(12), NSAttributedString.Key.paragraphStyle : paragraphStyle]).size
-        return NSSize(width: 400, height: max(66, size.height + subtitleSize.height + 4))
+        let size: NSSize = string.boundingRect(with: NSSize(width: 250, height: 100), options: NSString.DrawingOptions(rawValue: 3), attributes: [NSAttributedString.Key.font : NSFont.SFProTextSemibold(14), NSAttributedString.Key.paragraphStyle : paragraphStyle]).size
+        let subtitleSize: NSSize = subtitleString.boundingRect(with: NSSize(width: 250, height: 100), options: NSString.DrawingOptions(rawValue: 3), attributes: [NSAttributedString.Key.font : NSFont.SFProTextRegular(12), NSAttributedString.Key.paragraphStyle : paragraphStyle]).size
+        return NSSize(width: 324, height: max(66, size.height + subtitleSize.height + 4))
     }
 
     public func collectionView(_ collectionView: NSCollectionView, layout collectionViewLayout: NSCollectionViewLayout, insetForSectionAt section: Int) -> NSEdgeInsets {

+ 96 - 158
PDF Office/PDF Master/Class/KMLightMember/Controller/SubscriptionView/WaterMark/View/KMSubscribeWaterMarkView.xib

@@ -10,33 +10,28 @@
             <connections>
                 <outlet property="closeBox" destination="msn-nQ-xqN" id="QFo-LV-8P3"/>
                 <outlet property="closeButton" destination="bTN-v2-Eaj" id="h2L-kr-Gi9"/>
+                <outlet property="collectionContentViewHeightConstraint" destination="7MQ-oW-O1o" id="Hln-jO-fcD"/>
                 <outlet property="collectionView" destination="G8e-lU-M2R" id="Unt-cd-UZq"/>
-                <outlet property="discountImageView" destination="XJT-Av-tgl" id="sML-AH-cZs"/>
-                <outlet property="infoButton" destination="pVA-do-evZ" id="Ty6-pe-Nfj"/>
-                <outlet property="lineView" destination="gPv-qb-Uay" id="6ri-1C-OKN"/>
-                <outlet property="lineView2" destination="LML-4i-B6h" id="gD3-po-5lk"/>
-                <outlet property="preferentialImageTrailingConst" destination="bCN-ta-Soy" id="QW8-tJ-0FR"/>
-                <outlet property="privacyPolicyButton" destination="JH7-7U-TMR" id="gqQ-fP-rw6"/>
-                <outlet property="restoreButton" destination="2p2-EB-ZME" id="4dk-gE-x5C"/>
+                <outlet property="collectionViewContentTopConstraint" destination="1nd-N2-IpE" id="J1u-9e-WUO"/>
+                <outlet property="lineView" destination="FOh-IP-TS8" id="bZg-wu-WLa"/>
                 <outlet property="scrollView" destination="iQs-EU-LBJ" id="bId-Pc-Y9u"/>
-                <outlet property="subTrailingConst" destination="q02-dr-aPM" id="hap-0b-Mte"/>
-                <outlet property="subWidthConst" destination="Waq-d7-0Ra" id="4iZ-sH-JOh"/>
-                <outlet property="subscribeBox" destination="Vzt-oq-0J5" id="Y8y-zX-L6E"/>
-                <outlet property="subscribeLabel" destination="Ek9-Vy-Rri" id="1Uo-E7-TwG"/>
-                <outlet property="subscribeView" destination="ydd-9k-uWl" id="JyA-m8-7cw"/>
-                <outlet property="termsServiceButton" destination="qqD-Zc-d0K" id="GTi-vz-7Pw"/>
+                <outlet property="subscribeBox" destination="3EV-Lt-ZXO" id="Jg8-D5-UYE"/>
+                <outlet property="subscribeLabel" destination="a4m-EO-i32" id="VHn-E2-Ze2"/>
+                <outlet property="subscribeView" destination="zsU-gX-vjE" id="rOk-hB-ChE"/>
+                <outlet property="subtitleContentHeightConstraint" destination="K87-HL-fyQ" id="9vH-er-DyI"/>
+                <outlet property="subtitleLabel" destination="gOH-TM-kj5" id="PUW-kM-4ov"/>
                 <outlet property="titleLabel" destination="2cQ-02-iHc" id="tqt-eV-spv"/>
-                <outlet property="waterExportButton" destination="2l4-AW-3dk" id="75f-ap-dwK"/>
+                <outlet property="waterExportButton" destination="ki6-ve-E1f" id="jDF-Sk-8rV"/>
             </connections>
         </customObject>
         <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
         <customObject id="-3" userLabel="Application" customClass="NSObject"/>
         <customView id="c22-O7-iKe">
-            <rect key="frame" x="0.0" y="0.0" width="448" height="511"/>
+            <rect key="frame" x="0.0" y="0.0" width="380" height="505"/>
             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
             <subviews>
                 <customView translatesAutoresizingMaskIntoConstraints="NO" id="q0v-nJ-k2O">
-                    <rect key="frame" x="0.0" y="483" width="448" height="28"/>
+                    <rect key="frame" x="0.0" y="477" width="380" height="28"/>
                     <subviews>
                         <box boxType="custom" borderWidth="0.0" cornerRadius="4" translatesAutoresizingMaskIntoConstraints="NO" id="msn-nQ-xqN" customClass="KMBox" customModule="PDF_Master" customModuleProvider="target">
                             <rect key="frame" x="8" y="8" width="12" height="12"/>
@@ -72,64 +67,8 @@
                         <constraint firstAttribute="height" constant="28" id="aEs-a0-QaM"/>
                     </constraints>
                 </customView>
-                <customView translatesAutoresizingMaskIntoConstraints="NO" id="VuL-Zv-RS7">
-                    <rect key="frame" x="24" y="117" width="400" height="40"/>
-                    <subviews>
-                        <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="2l4-AW-3dk">
-                            <rect key="frame" x="0.0" y="0.0" width="192" height="40"/>
-                            <constraints>
-                                <constraint firstAttribute="width" constant="192" id="I32-Vf-pIP"/>
-                                <constraint firstAttribute="height" constant="40" id="iRU-jD-Beh"/>
-                            </constraints>
-                            <buttonCell key="cell" type="square" title="Save with Watermark" bezelStyle="shadowlessSquare" alignment="center" imageScaling="proportionallyDown" inset="2" id="Snj-A2-m7D">
-                                <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                                <font key="font" metaFont="system"/>
-                            </buttonCell>
-                            <connections>
-                                <action selector="waterMarkExportButtonAction:" target="-2" id="llL-WB-5pe"/>
-                            </connections>
-                        </button>
-                        <customView translatesAutoresizingMaskIntoConstraints="NO" id="ydd-9k-uWl">
-                            <rect key="frame" x="208" y="0.0" width="192" height="40"/>
-                            <subviews>
-                                <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Ek9-Vy-Rri">
-                                    <rect key="frame" x="76" y="12" width="41" height="16"/>
-                                    <textFieldCell key="cell" lineBreakMode="clipping" enabled="NO" alignment="center" title="Label" id="3bl-Ip-1uL">
-                                        <font key="font" metaFont="system"/>
-                                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                    </textFieldCell>
-                                </textField>
-                                <box boxType="custom" borderWidth="0.0" cornerRadius="4" translatesAutoresizingMaskIntoConstraints="NO" id="Vzt-oq-0J5" customClass="KMBox" customModule="PDF_Master" customModuleProvider="target">
-                                    <rect key="frame" x="0.0" y="0.0" width="192" height="40"/>
-                                    <view key="contentView" id="br7-Zx-Dz0">
-                                        <rect key="frame" x="0.0" y="0.0" width="192" height="40"/>
-                                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                    </view>
-                                </box>
-                            </subviews>
-                            <constraints>
-                                <constraint firstAttribute="bottom" secondItem="Vzt-oq-0J5" secondAttribute="bottom" id="9ao-KM-gev"/>
-                                <constraint firstAttribute="trailing" secondItem="Vzt-oq-0J5" secondAttribute="trailing" id="C4o-V4-0GQ"/>
-                                <constraint firstAttribute="height" constant="40" id="DCY-rK-0ar"/>
-                                <constraint firstItem="Ek9-Vy-Rri" firstAttribute="centerY" secondItem="ydd-9k-uWl" secondAttribute="centerY" id="Orq-pn-gua"/>
-                                <constraint firstAttribute="width" constant="192" id="Waq-d7-0Ra"/>
-                                <constraint firstItem="Ek9-Vy-Rri" firstAttribute="centerX" secondItem="ydd-9k-uWl" secondAttribute="centerX" id="mC6-Hh-zq4"/>
-                                <constraint firstItem="Vzt-oq-0J5" firstAttribute="leading" secondItem="ydd-9k-uWl" secondAttribute="leading" id="ofW-xv-j69"/>
-                                <constraint firstItem="Vzt-oq-0J5" firstAttribute="top" secondItem="ydd-9k-uWl" secondAttribute="top" id="urc-qJ-7Wk"/>
-                            </constraints>
-                        </customView>
-                    </subviews>
-                    <constraints>
-                        <constraint firstItem="ydd-9k-uWl" firstAttribute="top" secondItem="VuL-Zv-RS7" secondAttribute="top" id="Gkk-kI-2Th"/>
-                        <constraint firstAttribute="height" constant="40" id="PTO-gm-e1C"/>
-                        <constraint firstItem="2l4-AW-3dk" firstAttribute="leading" secondItem="VuL-Zv-RS7" secondAttribute="leading" id="Rgr-E0-9mc"/>
-                        <constraint firstAttribute="trailing" secondItem="ydd-9k-uWl" secondAttribute="trailing" id="q02-dr-aPM"/>
-                        <constraint firstItem="2l4-AW-3dk" firstAttribute="centerY" secondItem="VuL-Zv-RS7" secondAttribute="centerY" id="zlT-DN-jqV"/>
-                    </constraints>
-                </customView>
                 <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="2cQ-02-iHc">
-                    <rect key="frame" x="157" y="455" width="134" height="16"/>
+                    <rect key="frame" x="123" y="449" width="134" height="16"/>
                     <textFieldCell key="cell" lineBreakMode="clipping" title="Subscription Benefits" id="5tK-VQ-29f">
                         <font key="font" usesAppearanceFont="YES"/>
                         <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@@ -137,16 +76,16 @@
                     </textFieldCell>
                 </textField>
                 <customView translatesAutoresizingMaskIntoConstraints="NO" id="MG4-H3-ZA1">
-                    <rect key="frame" x="24" y="189" width="400" height="238"/>
+                    <rect key="frame" x="28" y="173" width="324" height="180"/>
                     <subviews>
                         <scrollView wantsLayer="YES" borderType="none" autohidesScrollers="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="iQs-EU-LBJ">
-                            <rect key="frame" x="0.0" y="0.0" width="400" height="238"/>
+                            <rect key="frame" x="0.0" y="0.0" width="324" height="180"/>
                             <clipView key="contentView" drawsBackground="NO" id="k4V-l0-a8F">
-                                <rect key="frame" x="0.0" y="0.0" width="400" height="238"/>
+                                <rect key="frame" x="0.0" y="0.0" width="324" height="180"/>
                                 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                 <subviews>
                                     <collectionView id="G8e-lU-M2R">
-                                        <rect key="frame" x="0.0" y="0.0" width="400" height="238"/>
+                                        <rect key="frame" x="0.0" y="0.0" width="324" height="180"/>
                                         <autoresizingMask key="autoresizingMask" widthSizable="YES"/>
                                         <collectionViewFlowLayout key="collectionViewLayout" minimumInteritemSpacing="10" minimumLineSpacing="10" id="1Gk-3q-zuH">
                                             <size key="itemSize" width="50" height="50"/>
@@ -160,127 +99,126 @@
                                 <rect key="frame" x="-100" y="-100" width="233" height="15"/>
                                 <autoresizingMask key="autoresizingMask"/>
                             </scroller>
-                            <scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="ftN-5U-Bpz">
+                            <scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="ftN-5U-Bpz">
                                 <rect key="frame" x="-100" y="-100" width="15" height="143"/>
                                 <autoresizingMask key="autoresizingMask"/>
                             </scroller>
                         </scrollView>
+                        <imageView hidden="YES" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="X9c-Db-P8e">
+                            <rect key="frame" x="0.0" y="0.0" width="324" height="40"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="40" id="9Hp-hD-Bbg"/>
+                            </constraints>
+                            <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="axesIndependently" image="渐变" id="uLk-nc-Ade"/>
+                        </imageView>
                     </subviews>
                     <constraints>
-                        <constraint firstAttribute="height" constant="238" id="7MQ-oW-O1o"/>
+                        <constraint firstAttribute="height" constant="180" id="7MQ-oW-O1o"/>
+                        <constraint firstAttribute="bottom" secondItem="X9c-Db-P8e" secondAttribute="bottom" id="Msm-Ve-eju"/>
+                        <constraint firstAttribute="trailing" secondItem="X9c-Db-P8e" secondAttribute="trailing" id="ODc-2G-fIp"/>
                         <constraint firstItem="iQs-EU-LBJ" firstAttribute="top" secondItem="MG4-H3-ZA1" secondAttribute="top" id="b42-mD-4Bn"/>
                         <constraint firstItem="iQs-EU-LBJ" firstAttribute="leading" secondItem="MG4-H3-ZA1" secondAttribute="leading" id="gLt-1u-l6X"/>
                         <constraint firstAttribute="bottom" secondItem="iQs-EU-LBJ" secondAttribute="bottom" id="gt2-pE-Slt"/>
+                        <constraint firstItem="X9c-Db-P8e" firstAttribute="leading" secondItem="MG4-H3-ZA1" secondAttribute="leading" id="jBZ-Ih-KQy"/>
                         <constraint firstAttribute="trailing" secondItem="iQs-EU-LBJ" secondAttribute="trailing" id="qHN-wN-lcX"/>
                     </constraints>
                 </customView>
-                <customView translatesAutoresizingMaskIntoConstraints="NO" id="dGs-Lg-ZgQ">
-                    <rect key="frame" x="24" y="24" width="266" height="20"/>
+                <customView translatesAutoresizingMaskIntoConstraints="NO" id="Ja4-Z7-bde">
+                    <rect key="frame" x="28" y="373" width="324" height="60"/>
                     <subviews>
-                        <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="pVA-do-evZ">
-                            <rect key="frame" x="0.0" y="2" width="16" height="16"/>
+                        <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="gOH-TM-kj5">
+                            <rect key="frame" x="6" y="28" width="312" height="32"/>
+                            <textFieldCell key="cell" alignment="center" title="This is a trial version. While saving, PDF Master's watermark will be added to the document." id="IIZ-dr-HjX">
+                                <font key="font" usesAppearanceFont="YES"/>
+                                <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                            </textFieldCell>
+                        </textField>
+                        <customView translatesAutoresizingMaskIntoConstraints="NO" id="FOh-IP-TS8">
+                            <rect key="frame" x="0.0" y="0.0" width="324" height="1"/>
                             <constraints>
-                                <constraint firstAttribute="width" constant="16" id="ItC-YF-e22"/>
-                                <constraint firstAttribute="height" constant="16" id="yVZ-ec-zoN"/>
-                            </constraints>
-                            <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="icon_info" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="gAd-wD-Qb3">
-                                <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                                <font key="font" metaFont="system"/>
-                            </buttonCell>
-                            <connections>
-                                <action selector="infoButtonAction:" target="-2" id="SAF-OU-H6e"/>
-                            </connections>
-                        </button>
-                        <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="JH7-7U-TMR">
-                            <rect key="frame" x="24" y="2" width="88" height="16"/>
-                            <buttonCell key="cell" type="square" title="Privacy Policy" bezelStyle="shadowlessSquare" alignment="center" imageScaling="proportionallyDown" inset="2" id="3tp-h0-oPz">
-                                <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                                <font key="font" metaFont="system"/>
-                            </buttonCell>
-                            <connections>
-                                <action selector="privacyPolicyButtonAction:" target="-2" id="Fbt-bq-SnV"/>
-                            </connections>
-                        </button>
-                        <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="qqD-Zc-d0K">
-                            <rect key="frame" x="129" y="2" width="106" height="16"/>
-                            <buttonCell key="cell" type="square" title="Terms of Service" bezelStyle="shadowlessSquare" alignment="center" imageScaling="proportionallyDown" inset="2" id="BPv-Rv-ubD">
-                                <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                                <font key="font" metaFont="system"/>
-                            </buttonCell>
-                            <connections>
-                                <action selector="termsServiceButtonAction:" target="-2" id="ryg-bz-bRm"/>
-                            </connections>
-                        </button>
-                        <customView translatesAutoresizingMaskIntoConstraints="NO" id="LML-4i-B6h">
-                            <rect key="frame" x="120" y="2" width="1" height="16"/>
-                            <constraints>
-                                <constraint firstAttribute="width" constant="1" id="Bba-r0-lUd"/>
-                                <constraint firstAttribute="height" constant="16" id="IMW-bh-TTs"/>
+                                <constraint firstAttribute="height" constant="1" id="P0i-AM-sJN"/>
                             </constraints>
                         </customView>
                     </subviews>
                     <constraints>
-                        <constraint firstItem="pVA-do-evZ" firstAttribute="leading" secondItem="dGs-Lg-ZgQ" secondAttribute="leading" id="CBF-pD-2R8"/>
-                        <constraint firstItem="LML-4i-B6h" firstAttribute="centerY" secondItem="dGs-Lg-ZgQ" secondAttribute="centerY" id="KOf-50-Pex"/>
-                        <constraint firstItem="qqD-Zc-d0K" firstAttribute="leading" secondItem="LML-4i-B6h" secondAttribute="trailing" constant="8" id="Lnj-0I-T0j"/>
-                        <constraint firstItem="pVA-do-evZ" firstAttribute="centerY" secondItem="dGs-Lg-ZgQ" secondAttribute="centerY" id="VWl-rl-eIG"/>
-                        <constraint firstAttribute="height" constant="20" id="ibD-Sm-7fX"/>
-                        <constraint firstItem="JH7-7U-TMR" firstAttribute="leading" secondItem="pVA-do-evZ" secondAttribute="trailing" constant="8" id="jwI-9v-Eqy"/>
-                        <constraint firstItem="qqD-Zc-d0K" firstAttribute="centerY" secondItem="dGs-Lg-ZgQ" secondAttribute="centerY" id="liN-vg-MgY"/>
-                        <constraint firstItem="JH7-7U-TMR" firstAttribute="centerY" secondItem="dGs-Lg-ZgQ" secondAttribute="centerY" id="oMB-lg-nih"/>
-                        <constraint firstItem="LML-4i-B6h" firstAttribute="leading" secondItem="JH7-7U-TMR" secondAttribute="trailing" constant="8" id="uxt-X4-3GN"/>
+                        <constraint firstItem="gOH-TM-kj5" firstAttribute="top" secondItem="Ja4-Z7-bde" secondAttribute="top" id="J7i-aX-LIu"/>
+                        <constraint firstAttribute="height" constant="60" id="K87-HL-fyQ"/>
+                        <constraint firstItem="FOh-IP-TS8" firstAttribute="leading" secondItem="Ja4-Z7-bde" secondAttribute="leading" id="Rwz-0E-Zj1"/>
+                        <constraint firstItem="gOH-TM-kj5" firstAttribute="leading" secondItem="Ja4-Z7-bde" secondAttribute="leading" constant="8" id="T6O-zG-DYq"/>
+                        <constraint firstAttribute="width" constant="324" id="dFa-YB-Dgm"/>
+                        <constraint firstAttribute="bottom" secondItem="FOh-IP-TS8" secondAttribute="bottom" id="in1-PL-P05"/>
+                        <constraint firstAttribute="trailing" secondItem="gOH-TM-kj5" secondAttribute="trailing" constant="8" id="vhi-7b-oQH"/>
+                        <constraint firstAttribute="trailing" secondItem="FOh-IP-TS8" secondAttribute="trailing" id="z4M-RT-EKq"/>
                     </constraints>
                 </customView>
-                <customView translatesAutoresizingMaskIntoConstraints="NO" id="gPv-qb-Uay">
-                    <rect key="frame" x="24" y="68" width="400" height="1"/>
+                <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ki6-ve-E1f">
+                    <rect key="frame" x="28" y="32" width="324" height="40"/>
                     <constraints>
-                        <constraint firstAttribute="height" constant="1" id="fUx-Zc-744"/>
+                        <constraint firstAttribute="height" constant="40" id="1vq-qG-C1N"/>
                     </constraints>
-                </customView>
-                <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="2p2-EB-ZME">
-                    <rect key="frame" x="306" y="26" width="118" height="16"/>
-                    <buttonCell key="cell" type="square" title="Restore Purchases" bezelStyle="shadowlessSquare" alignment="center" imageScaling="proportionallyDown" inset="2" id="1zx-IL-Omm">
+                    <buttonCell key="cell" type="square" title="Watermark Saving" bezelStyle="shadowlessSquare" alignment="center" imageScaling="proportionallyDown" inset="2" id="bo3-42-gLB">
                         <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                         <font key="font" metaFont="system"/>
                     </buttonCell>
                     <connections>
-                        <action selector="restoreButtonAction:" target="-2" id="lGs-Jz-RWV"/>
+                        <action selector="waterMarkExportButtonAction:" target="-2" id="Jkp-G7-45m"/>
                     </connections>
                 </button>
-                <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="XJT-Av-tgl">
-                    <rect key="frame" x="349" y="147" width="67" height="20"/>
-                    <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="Badge 1" id="3cp-vp-3MC"/>
-                </imageView>
+                <customView translatesAutoresizingMaskIntoConstraints="NO" id="zsU-gX-vjE">
+                    <rect key="frame" x="28" y="88" width="324" height="40"/>
+                    <subviews>
+                        <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="a4m-EO-i32">
+                            <rect key="frame" x="144" y="12" width="37" height="16"/>
+                            <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="oDQ-wf-pIe">
+                                <font key="font" usesAppearanceFont="YES"/>
+                                <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                            </textFieldCell>
+                        </textField>
+                        <box boxType="custom" borderWidth="0.0" titlePosition="noTitle" translatesAutoresizingMaskIntoConstraints="NO" id="3EV-Lt-ZXO" customClass="KMBox" customModule="PDF_Master" customModuleProvider="target">
+                            <rect key="frame" x="0.0" y="0.0" width="324" height="40"/>
+                            <view key="contentView" id="Ajf-rl-zqg">
+                                <rect key="frame" x="0.0" y="0.0" width="324" height="40"/>
+                                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                            </view>
+                        </box>
+                    </subviews>
+                    <constraints>
+                        <constraint firstItem="a4m-EO-i32" firstAttribute="centerX" secondItem="zsU-gX-vjE" secondAttribute="centerX" id="1IX-89-e0g"/>
+                        <constraint firstAttribute="trailing" secondItem="3EV-Lt-ZXO" secondAttribute="trailing" id="Gqk-JG-CYW"/>
+                        <constraint firstAttribute="bottom" secondItem="3EV-Lt-ZXO" secondAttribute="bottom" id="RRE-et-RZW"/>
+                        <constraint firstItem="3EV-Lt-ZXO" firstAttribute="leading" secondItem="zsU-gX-vjE" secondAttribute="leading" id="RnW-8b-zE0"/>
+                        <constraint firstAttribute="height" constant="40" id="Y7i-Kj-Zw4"/>
+                        <constraint firstItem="3EV-Lt-ZXO" firstAttribute="top" secondItem="zsU-gX-vjE" secondAttribute="top" id="g35-yO-W4e"/>
+                        <constraint firstItem="a4m-EO-i32" firstAttribute="centerY" secondItem="zsU-gX-vjE" secondAttribute="centerY" id="nfp-RI-pcL"/>
+                    </constraints>
+                </customView>
             </subviews>
             <constraints>
-                <constraint firstAttribute="trailing" secondItem="gPv-qb-Uay" secondAttribute="trailing" constant="24" id="9tM-n1-I3e"/>
+                <constraint firstItem="MG4-H3-ZA1" firstAttribute="top" secondItem="2cQ-02-iHc" secondAttribute="bottom" constant="96" id="1nd-N2-IpE"/>
+                <constraint firstItem="Ja4-Z7-bde" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" constant="28" id="5v1-aH-ewg"/>
                 <constraint firstItem="2cQ-02-iHc" firstAttribute="top" secondItem="c22-O7-iKe" secondAttribute="top" constant="40" id="GRL-zJ-hGD"/>
-                <constraint firstAttribute="trailing" secondItem="MG4-H3-ZA1" secondAttribute="trailing" constant="24" id="M8D-Go-2lU"/>
-                <constraint firstAttribute="trailing" secondItem="2p2-EB-ZME" secondAttribute="trailing" constant="24" id="MU7-Tu-ONd"/>
+                <constraint firstItem="ki6-ve-E1f" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" constant="28" id="HdL-el-MI0"/>
+                <constraint firstItem="ki6-ve-E1f" firstAttribute="top" secondItem="zsU-gX-vjE" secondAttribute="bottom" constant="16" id="I4R-Ku-dLc"/>
+                <constraint firstAttribute="trailing" secondItem="MG4-H3-ZA1" secondAttribute="trailing" constant="28" id="M8D-Go-2lU"/>
+                <constraint firstAttribute="trailing" secondItem="ki6-ve-E1f" secondAttribute="trailing" constant="28" id="PJV-Yt-tG7"/>
                 <constraint firstItem="2cQ-02-iHc" firstAttribute="centerX" secondItem="c22-O7-iKe" secondAttribute="centerX" id="Tab-Sj-Pk5"/>
                 <constraint firstItem="q0v-nJ-k2O" firstAttribute="top" secondItem="c22-O7-iKe" secondAttribute="top" id="Vaq-qD-AWK"/>
-                <constraint firstItem="MG4-H3-ZA1" firstAttribute="top" secondItem="2cQ-02-iHc" secondAttribute="bottom" constant="28" id="b7P-GP-azS"/>
-                <constraint firstAttribute="trailing" secondItem="XJT-Av-tgl" secondAttribute="trailing" constant="32" id="bCN-ta-Soy"/>
-                <constraint firstItem="VuL-Zv-RS7" firstAttribute="top" secondItem="MG4-H3-ZA1" secondAttribute="bottom" constant="32" id="d0G-5e-1S6"/>
-                <constraint firstItem="dGs-Lg-ZgQ" firstAttribute="top" secondItem="gPv-qb-Uay" secondAttribute="bottom" constant="24" id="eo9-px-UHL"/>
-                <constraint firstAttribute="bottom" secondItem="dGs-Lg-ZgQ" secondAttribute="bottom" constant="24" id="fFZ-3k-ufi"/>
-                <constraint firstItem="gPv-qb-Uay" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" constant="24" id="hzc-Uz-uYl"/>
-                <constraint firstItem="VuL-Zv-RS7" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" constant="24" id="k7X-tB-pMq"/>
-                <constraint firstItem="2p2-EB-ZME" firstAttribute="leading" secondItem="dGs-Lg-ZgQ" secondAttribute="trailing" constant="16" id="kXp-ze-WrI"/>
-                <constraint firstItem="MG4-H3-ZA1" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" constant="24" id="mY1-qU-Bkt"/>
+                <constraint firstItem="Ja4-Z7-bde" firstAttribute="top" secondItem="2cQ-02-iHc" secondAttribute="bottom" constant="16" id="XOd-vi-3Iz"/>
+                <constraint firstItem="MG4-H3-ZA1" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" constant="28" id="mY1-qU-Bkt"/>
                 <constraint firstAttribute="trailing" secondItem="q0v-nJ-k2O" secondAttribute="trailing" id="pkz-AD-sVC"/>
-                <constraint firstItem="2p2-EB-ZME" firstAttribute="centerY" secondItem="dGs-Lg-ZgQ" secondAttribute="centerY" id="wTQ-gG-oqy"/>
-                <constraint firstAttribute="trailing" secondItem="VuL-Zv-RS7" secondAttribute="trailing" constant="24" id="y9S-AD-nI1"/>
-                <constraint firstItem="ydd-9k-uWl" firstAttribute="top" secondItem="XJT-Av-tgl" secondAttribute="bottom" constant="-10" id="yhM-Fo-7H2"/>
+                <constraint firstItem="zsU-gX-vjE" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" constant="28" id="sYP-io-kre"/>
+                <constraint firstAttribute="bottom" secondItem="ki6-ve-E1f" secondAttribute="bottom" constant="32" id="wXu-Y4-WdH"/>
+                <constraint firstAttribute="trailing" secondItem="zsU-gX-vjE" secondAttribute="trailing" constant="28" id="ycZ-kq-u6R"/>
                 <constraint firstItem="q0v-nJ-k2O" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" id="yuk-XJ-HQQ"/>
-                <constraint firstItem="dGs-Lg-ZgQ" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" constant="24" id="zCu-1e-SEa"/>
+                <constraint firstAttribute="trailing" secondItem="Ja4-Z7-bde" secondAttribute="trailing" constant="28" id="zRX-3e-H6f"/>
             </constraints>
             <point key="canvasLocation" x="-265" y="-248.5"/>
         </customView>
     </objects>
     <resources>
-        <image name="Badge 1" width="67" height="20"/>
         <image name="control_btn_icon_close" width="12" height="12"/>
-        <image name="icon_info" width="16" height="16"/>
+        <image name="渐变" width="284" height="40"/>
     </resources>
 </document>

+ 1 - 1
PDF Office/PDF Master/Class/KMLightMember/Manager/KMLightMemberManager.swift

@@ -196,7 +196,7 @@ extension KMLightMemberManager {
     func canPayFunction(needNetworking: Bool = false) async -> Bool {
         var result: Bool = false
         //先确认可以使用高级功能,再确认是否已经订阅
-        if await self.canUseAdvanced() && (self.purchaseState == .subscription || self.purchaseState == .trial) {
+        if await self.canUseAdvanced(needNetworking: needNetworking) && (self.purchaseState == .subscription || self.purchaseState == .trial) {
             result = true
         }
         return result

+ 21 - 0
PDF Office/PDF Master/Class/KMLightMember/Source/KMLightMember.xcassets/image_Popup.imageset/Contents.json

@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "filename" : "Popup.pdf",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
PDF Office/PDF Master/Class/KMLightMember/Source/KMLightMember.xcassets/image_Popup.imageset/Popup.pdf


+ 1 - 0
PDF Office/PDF Master/Class/Merge/OCPart/KMFileAttribute.h

@@ -27,6 +27,7 @@ typedef NS_OPTIONS(NSUInteger, KMPDFSelectPageStringType) {
     NSString        *_password;
 }
 @property (nonatomic,retain) NSString *filePath;
+@property (nonatomic, retain) NSString *oriFilePath;
 @property (nonatomic,retain) PDFDocument *myPDFDocument;
 @property (nonatomic,retain) CPDFDocument *pdfDocument;
 @property (nonatomic) BOOL bAllPage;

+ 3 - 0
PDF Office/PDF Master/Class/Merge/OCPart/KMPDFEditAppendWindow.h

@@ -22,6 +22,9 @@ typedef NS_OPTIONS(NSUInteger, KMPDFPageEditType) {
     };
 
 @interface KMPDFEditAppendWindow : NSWindowController
+
+@property (nonatomic, strong) NSURL *oriDucumentUrl;
+
 @property (nonatomic,copy) void (^saveAsPDFFilePath) (NSString *filePath);
 
 - (id)initWithFilePaths:(NSArray *)files;

+ 72 - 1
PDF Office/PDF Master/Class/Merge/OCPart/KMPDFEditAppendWindow.m

@@ -198,6 +198,8 @@ static KMPDFEditAppendWindow *windowController = nil;
 @property (assign) IBOutlet NSTextField *boxLabel;
 
 @property (assign) IBOutlet KMBlankView *myBlankView;
+@property (weak) IBOutlet NSTextField *limitLable;
+
 
 @property (nonatomic, strong) PasswordWindowController *passwordWindowController;
 @property (nonatomic, strong) KMSavePanelAccessoryController *savePanelAccessoryViewController;
@@ -251,6 +253,7 @@ static KMPDFEditAppendWindow *windowController = nil;
         KMFileAttribute *file = [[KMFileAttribute alloc] init];
         file.myPDFDocument = document;
         file.filePath = document.documentURL.path;
+        file.oriFilePath = self.oriDucumentUrl.path;
         if (password && password.length > 0) {
             file.password = password;
             file.isLocked = YES;
@@ -260,6 +263,13 @@ static KMPDFEditAppendWindow *windowController = nil;
     return self;
 }
 
+- (void)setOriDucumentUrl:(NSURL *)oriDucumentUrl {
+    _oriDucumentUrl = oriDucumentUrl;
+    
+    KMFileAttribute *file = self.files.firstObject;
+    file.oriFilePath = oriDucumentUrl.path;
+}
+
 - (void)windowDidLoad {
     
     [super windowDidLoad];
@@ -459,9 +469,21 @@ static KMPDFEditAppendWindow *windowController = nil;
     self.loading_backgroundView.layer.backgroundColor = [NSColor clearColor].CGColor;
     self.loading_backgroundView.hidden = YES;
     
+    self.limitLable.stringValue = NSLocalizedString(@"Merge 2 files at a time", "");
+    self.limitLable.font = [NSFont SFProTextRegular:12];
+    self.limitLable.textColor = [[NSColor alloc] initWithHex:@"#F3465B" alpha:1];
+    
     self.limit = NO;
     [KMLightMemberManager.manager canPayFunctionWithNeedNetworking:NO completionHandler:^(BOOL result) {
         weakSelf.limit = !result;
+        
+        dispatch_sync(dispatch_get_main_queue(), ^{
+            if (result) {
+                weakSelf.limitLable.hidden = YES;
+            } else {
+                weakSelf.limitLable.hidden = NO;
+            }
+        });
     }];
 }
 
@@ -930,8 +952,14 @@ static KMPDFEditAppendWindow *windowController = nil;
     if (cell == nil) {
         cell = [[KMPDFMergeFileNameTabelViewCell alloc] init];
     }
+    
+    NSString *fileName = [fileAttribute.filePath lastPathComponent];
+    if (fileAttribute.oriFilePath.length > 0) {
+        fileName = fileAttribute.oriFilePath.stringByDeletingPathExtension.lastPathComponent;
+    }
+    
     cell.numberLabel.stringValue = [NSString stringWithFormat:@"%ld",(row + 1)];;
-    cell.fileNameLabel.stringValue = [fileAttribute.filePath lastPathComponent];
+    cell.fileNameLabel.stringValue = fileName;
     cell.pageNumberLabel.stringValue = [NSString stringWithFormat:@"%ld %@",pdf.pageCount,NSLocalizedString(@"Pages", nil)];;
     
 //    cell.iconImageView.image = [[pdf pageAtIndex:0] thumbnailWithSize:60*2 forBox:kPDFDisplayBoxCropBox];
@@ -1085,8 +1113,19 @@ static KMPDFEditAppendWindow *windowController = nil;
 }
 
 #pragma mark Buutton Action
+
+- (void)_clearData {
+    for (KMFileAttribute *file in self.files) {
+        if (file.oriFilePath.length > 0 && [[NSFileManager defaultManager] fileExistsAtPath:file.filePath]) {
+            [[NSFileManager defaultManager] removeItemAtURL:[NSURL fileURLWithPath:file.filePath] error:nil];
+        }
+    }
+}
+
 - (IBAction)buttonItemClicked_Cancel:(id)sender
 {
+    [self _clearData];
+    
     _isSuccessfully = NO;
     [NSApp endSheet:[self window] returnCode:[(NSView *)sender tag]];
     [[self window] orderOut:self];
@@ -1098,6 +1137,31 @@ static KMPDFEditAppendWindow *windowController = nil;
         return;
     }
     
+    if (KMLightMemberManager.manager.purchaseState != KMPurchaseManagerStateSubscription && _files.count > 2) {
+        [KMSubscribeWaterMarkWindowController showWithWindow: self.window isContinue: false type:KMSubscribeWaterMarkTypeMerge subscribeDidClick:^{
+            
+        } completion:^(BOOL isSub, BOOL isWater, BOOL isClose) {
+            
+        }];
+        return;
+    } else if (KMLightMemberManager.manager.purchaseState != KMPurchaseManagerStateSubscription && _files.count <= 2) {
+        __weak typeof(self) weakSelf = self;
+        [KMSubscribeWaterMarkWindowController showWithWindow: self.window isContinue:true type:KMSubscribeWaterMarkTypeMerge subscribeDidClick:^{
+            
+        } completion:^(BOOL isSub, BOOL isWater, BOOL isClose) {
+            if (isWater) {
+                dispatch_async(dispatch_get_main_queue(), ^{
+                    [weakSelf buttonItemClick_Append: sender];
+                });
+            }
+        }];
+        return;
+    }
+    
+    [self buttonItemClick_Append: sender];
+}
+
+- (void)buttonItemClick_Append:(id)sender {
     KMImageTitleButton *customSizeButton = self.customSizeButton.subviews.lastObject;
     if (customSizeButton.state == NSControlStateValueOn) {
         NSInteger widthFloat = [self.pageSizeWidthTextField.stringValue integerValue];
@@ -1204,6 +1268,9 @@ static KMPDFEditAppendWindow *windowController = nil;
     
     KMFileAttribute *file = self.files.firstObject;
     NSString *fileName = file.filePath.stringByDeletingPathExtension.lastPathComponent;
+    if (file.oriFilePath.length > 0) {
+        fileName = file.oriFilePath.stringByDeletingPathExtension.lastPathComponent;
+    }
     fileName = [NSString stringWithFormat:@"%@_Merged", fileName];
     if (_editType == KMPDFPageEditMerge) {
         _isSuccessfully = NO;
@@ -1248,6 +1315,8 @@ static KMPDFEditAppendWindow *windowController = nil;
                                 self.loading_backgroundView.hidden = YES;
                                 
                                 if (self->_isSuccessfully) {
+                                    [self _clearData];
+                                    
                                     [NSApp endSheet:[self window] returnCode:[(NSView *)sender tag]];
                                     [[self window] orderOut:self];
 
@@ -1337,6 +1406,8 @@ static KMPDFEditAppendWindow *windowController = nil;
                             self.loading_backgroundView.hidden = YES;
                             
                             if (self->_isSuccessfully) {
+                                [self _clearData];
+                                
                                 [NSApp endSheet:[self window] returnCode:[(NSView *)sender tag]];
                                 [[self window] orderOut:self];
                                 

+ 39 - 6
PDF Office/PDF Master/Class/Merge/OCPart/KMPDFEditAppendWindow.xib

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21701"/>
         <capability name="Named colors" minToolsVersion="9.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -24,6 +24,7 @@
                 <outlet property="clearBox" destination="kXZ-gh-CUA" id="INH-zz-Maw"/>
                 <outlet property="customSizeButton" destination="QI0-GW-5Ii" id="yJe-Zx-UXW"/>
                 <outlet property="fileNameLabel" destination="MiB-cx-nmS" id="Phd-ss-lv2"/>
+                <outlet property="limitLable" destination="0bJ-0I-xhY" id="KBK-fD-3Rg"/>
                 <outlet property="myBlankView" destination="Bxz-CR-NgQ" id="fja-0n-Ywh"/>
                 <outlet property="nCancelBox" destination="HUw-YH-0kd" id="Df5-e3-Fca"/>
                 <outlet property="nMergeBox" destination="Gzx-57-4ok" id="Qrg-e1-sK9"/>
@@ -333,25 +334,25 @@
                                         <constraint firstAttribute="height" constant="22" id="5bY-aF-fW3"/>
                                     </constraints>
                                 </customView>
-                                <customView translatesAutoresizingMaskIntoConstraints="NO" id="5nS-LC-t5H" customClass="KMImageTitleButton" customModule="PDF_Office" customModuleProvider="target">
+                                <customView translatesAutoresizingMaskIntoConstraints="NO" id="5nS-LC-t5H" customClass="KMImageTitleButton" customModule="PDF_Master" customModuleProvider="target">
                                     <rect key="frame" x="16" y="504" width="45" height="22"/>
                                     <constraints>
                                         <constraint firstAttribute="height" constant="22" id="iSV-P3-W8x"/>
                                     </constraints>
                                 </customView>
-                                <customView translatesAutoresizingMaskIntoConstraints="NO" id="85P-Ad-bEf" customClass="KMImageTitleButton" customModule="PDF_Office" customModuleProvider="target">
+                                <customView translatesAutoresizingMaskIntoConstraints="NO" id="85P-Ad-bEf" customClass="KMImageTitleButton" customModule="PDF_Master" customModuleProvider="target">
                                     <rect key="frame" x="16" y="474" width="45" height="22"/>
                                     <constraints>
                                         <constraint firstAttribute="height" constant="22" id="Ubd-is-gcz"/>
                                     </constraints>
                                 </customView>
-                                <customView translatesAutoresizingMaskIntoConstraints="NO" id="PNC-MR-g6W" customClass="KMImageTitleButton" customModule="PDF_Office" customModuleProvider="target">
+                                <customView translatesAutoresizingMaskIntoConstraints="NO" id="PNC-MR-g6W" customClass="KMImageTitleButton" customModule="PDF_Master" customModuleProvider="target">
                                     <rect key="frame" x="16" y="444" width="45" height="22"/>
                                     <constraints>
                                         <constraint firstAttribute="height" constant="22" id="cMH-MX-phe"/>
                                     </constraints>
                                 </customView>
-                                <customView translatesAutoresizingMaskIntoConstraints="NO" id="ZDa-uQ-GtJ" customClass="KMImageTitleButton" customModule="PDF_Office" customModuleProvider="target">
+                                <customView translatesAutoresizingMaskIntoConstraints="NO" id="ZDa-uQ-GtJ" customClass="KMImageTitleButton" customModule="PDF_Master" customModuleProvider="target">
                                     <rect key="frame" x="16" y="414" width="45" height="22"/>
                                     <constraints>
                                         <constraint firstAttribute="height" constant="22" id="o0Q-lr-IX5"/>
@@ -487,6 +488,34 @@
                         </constraints>
                         <color key="fillColor" red="0.92156862750000001" green="0.92156862750000001" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                     </box>
+                    <customView translatesAutoresizingMaskIntoConstraints="NO" id="ZHD-fQ-Kbu">
+                        <rect key="frame" x="197" y="2" width="331" height="60"/>
+                        <subviews>
+                            <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Sp2-fV-Wrc">
+                                <rect key="frame" x="0.0" y="22" width="16" height="16"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="16" id="4hN-xK-3Ny"/>
+                                    <constraint firstAttribute="height" constant="16" id="RFX-lT-OaW"/>
+                                </constraints>
+                                <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="KMImageNameTipNormal" id="nPY-oN-wLt"/>
+                            </imageView>
+                            <textField hidden="YES" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="0bJ-0I-xhY">
+                                <rect key="frame" x="18" y="22" width="135" height="16"/>
+                                <textFieldCell key="cell" alignment="left" title="Merge 2 files for free." id="MSL-nN-D7Q">
+                                    <font key="font" usesAppearanceFont="YES"/>
+                                    <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                    <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                </textFieldCell>
+                            </textField>
+                        </subviews>
+                        <constraints>
+                            <constraint firstItem="Sp2-fV-Wrc" firstAttribute="centerY" secondItem="ZHD-fQ-Kbu" secondAttribute="centerY" id="1ZQ-Co-nIt"/>
+                            <constraint firstAttribute="height" constant="60" id="2OM-5d-FcX"/>
+                            <constraint firstItem="0bJ-0I-xhY" firstAttribute="leading" secondItem="Sp2-fV-Wrc" secondAttribute="trailing" constant="4" id="8g5-bR-EWs"/>
+                            <constraint firstItem="0bJ-0I-xhY" firstAttribute="centerY" secondItem="ZHD-fQ-Kbu" secondAttribute="centerY" id="EG9-4R-lRH"/>
+                            <constraint firstItem="Sp2-fV-Wrc" firstAttribute="leading" secondItem="ZHD-fQ-Kbu" secondAttribute="leading" id="j0b-bp-y7B"/>
+                        </constraints>
+                    </customView>
                 </subviews>
                 <constraints>
                     <constraint firstAttribute="trailing" secondItem="Gzx-57-4ok" secondAttribute="trailing" constant="16" id="1Ny-f2-6fJ"/>
@@ -499,9 +528,12 @@
                     <constraint firstItem="SNg-B0-ys5" firstAttribute="bottom" secondItem="se5-gp-TjO" secondAttribute="bottom" id="GbZ-tV-MXY"/>
                     <constraint firstItem="Ggk-eO-LzC" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" id="LEN-lk-9rV"/>
                     <constraint firstItem="HqV-Cr-IvX" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" constant="16" id="Lia-zA-HV0"/>
+                    <constraint firstItem="ZHD-fQ-Kbu" firstAttribute="leading" secondItem="kXZ-gh-CUA" secondAttribute="trailing" constant="16" id="WmT-JK-Agc"/>
                     <constraint firstItem="Gzx-57-4ok" firstAttribute="leading" secondItem="HUw-YH-0kd" secondAttribute="trailing" constant="16" id="Z1N-QN-kcx"/>
+                    <constraint firstItem="ZHD-fQ-Kbu" firstAttribute="centerY" secondItem="UA4-8E-ANK" secondAttribute="centerY" id="ZD6-MI-gN1"/>
                     <constraint firstAttribute="trailing" secondItem="SNg-B0-ys5" secondAttribute="trailing" id="d0q-Hn-baS"/>
                     <constraint firstItem="SNg-B0-ys5" firstAttribute="leading" secondItem="Ggk-eO-LzC" secondAttribute="trailing" constant="1" id="gNP-Dq-gpr"/>
+                    <constraint firstItem="HUw-YH-0kd" firstAttribute="leading" secondItem="ZHD-fQ-Kbu" secondAttribute="trailing" constant="8" id="miE-8B-I95"/>
                     <constraint firstItem="Uex-2T-CgC" firstAttribute="centerX" secondItem="se5-gp-TjO" secondAttribute="centerX" id="oIl-2n-ghc"/>
                     <constraint firstItem="7Ci-3J-z10" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" id="sgd-dw-rOw"/>
                     <constraint firstItem="Uex-2T-CgC" firstAttribute="centerY" secondItem="se5-gp-TjO" secondAttribute="centerY" id="t3J-uR-7G2"/>
@@ -618,6 +650,7 @@
     <resources>
         <image name="KMImageNameEmptyFile" width="130" height="130"/>
         <image name="KMImageNameEmptyListNor" width="200" height="200"/>
+        <image name="KMImageNameTipNormal" width="16" height="16"/>
         <image name="KMImageNameUXIconBtnCloseNor" width="16" height="16"/>
         <image name="NSAdvanced" width="32" height="32"/>
         <namedColor name="KM_242424_Color40">

+ 37 - 19
PDF Office/PDF Master/Class/PDFTools/Compress/Controller/KMCompressWindowController.swift

@@ -28,6 +28,7 @@ class KMCompressWindowController: NSWindowController {
     var selectIndex = 2
     
     var limit = true
+    var oriDocumentUrl: URL?
     
     var itemClick       : KMCompressWindowControllerItemClick!
     var resultCallback  : KMCompressWindowControllerResultCallback!
@@ -159,6 +160,8 @@ class KMCompressWindowController: NSWindowController {
     }
     
     @objc func cancelButtonAction() {
+        self._clearData()
+        
         guard let callback = itemClick else {
             return
         }
@@ -171,24 +174,23 @@ class KMCompressWindowController: NSWindowController {
             return
         }
         
-//        Task { @MainActor in
-//            if await (KMLightMemberManager.manager.canPayFunction() == false) {
-//                let _ = KMSubscribeWaterMarkWindowController.show(window: self.window!) { isSubscribeSuccess, isWaterMarkExport, isClose in
-//                    if (isClose) {
-//                        return
-//                    }
-//                    if (isSubscribeSuccess) {
-//                        self._compressButtonAction()
-//                    }
-//                    if (isWaterMarkExport) {
-//                        self._compressButtonAction(limit: true)
-//                    }
-//                }
-//                return
-//            }
-//            self._compressButtonAction()
-//        }
-        self._compressButtonAction(limit: self.limit)
+        Task { @MainActor in
+            if await (KMLightMemberManager.manager.canPayFunction() == false) {
+                let _ = KMSubscribeWaterMarkWindowController.show(window: self.window!) { isSubscribeSuccess, isWaterMarkExport, isClose in
+                    if (isClose) {
+                        return
+                    }
+                    if (isSubscribeSuccess) {
+                        self._compressButtonAction()
+                    }
+                    if (isWaterMarkExport) {
+                        self._compressButtonAction(limit: true)
+                    }
+                }
+                return
+            }
+            self._compressButtonAction()
+        }
     }
     
     func getUniqueFilePath(filePath: String) -> String {
@@ -225,7 +227,11 @@ class KMCompressWindowController: NSWindowController {
     private func _compressButtonAction(limit: Bool = false) {
         DispatchQueue.main.async {
             NSPanel.savePanel(self.window!, true) { panel in
-                panel.nameFieldStringValue = ""+self.documentURL.deletingPathExtension().lastPathComponent+"_Compressed"
+                var url: URL = self.documentURL
+                if (self.oriDocumentUrl != nil) {
+                    url = self.oriDocumentUrl!
+                }
+                panel.nameFieldStringValue = ""+url.deletingPathExtension().lastPathComponent+"_Compressed"
                 panel.allowedFileTypes = ["pdf"]
             } completion: { response, url, isOpen in
                 if (response == .cancel) {
@@ -262,6 +268,10 @@ class KMCompressWindowController: NSWindowController {
                         }
                     }
                     
+                    if (result) {
+                        self._clearData()
+                    }
+                    
                     DispatchQueue.main.async {
                         self.endLoading()
                         guard let callback = self.resultCallback else {
@@ -283,6 +293,14 @@ class KMCompressWindowController: NSWindowController {
             }
         }
     }
+    
+    private func _clearData() {
+        if let _ = self.oriDocumentUrl {
+            if let data = self.documentURL?.path, FileManager.default.fileExists(atPath: data) {
+                try?FileManager.default.removeItem(atPath: data)
+            }
+        }
+    }
 }
 
 extension KMCompressWindowController: NSTableViewDataSource {

+ 43 - 23
PDF Office/PDF Master/Class/PDFTools/Convert/Controller/KMConvertBaseWindowController.swift

@@ -55,6 +55,8 @@ class KMConvertBaseWindowController: KMBaseWindowController {
     private var convert: KMPDFConvert?
     
     var limit = true
+    var oriDocumentUrl: URL?
+    var subscribeWaterMarkType: KMSubscribeWaterMarkType?
     
     deinit {
         KMPrint("KMConvertBaseWindowController 已释放")
@@ -267,8 +269,12 @@ class KMConvertBaseWindowController: KMBaseWindowController {
         return KMPDFConvert()
     }
     
-    func setupContentHeight(height: CGFloat) {
-        self.rightBoxHeightConst.constant = height
+    func setupContentHeight(height: CGFloat, animated: Bool = false) {
+        if (animated) {
+            self.rightBoxHeightConst.animator().constant = height
+        } else {
+            self.rightBoxHeightConst.constant = height
+        }
     }
     
     func refreshUI() {
@@ -304,6 +310,8 @@ class KMConvertBaseWindowController: KMBaseWindowController {
     }
     
     @objc func cancelButtonAction() {
+        self._clearData()
+        
         guard let callback = itemClick else {
             return
         }
@@ -340,26 +348,25 @@ class KMConvertBaseWindowController: KMBaseWindowController {
             return
         }
         
-//        Task { @MainActor in
-//            if await (KMLightMemberManager.manager.canPayFunction() == false) {
-//                let _ = KMSubscribeWaterMarkWindowController.show(window: self.window!) { isSubscribeSuccess, isWaterMarkExport, isClose in
-//                    if (isClose) {
-//                        return
-//                    }
-//                    if (isSubscribeSuccess) {
-//                        self._convertButtonAction()
-//                        return
-//                    }
-//                    if (isWaterMarkExport) {
-//                        self._convertButtonAction(limit: true)
-//                        return
-//                    }
-//                }
-//                return
-//            }
-//            self._convertButtonAction()
-//        }
-        self._convertButtonAction(limit: self.limit)
+        Task { @MainActor in
+            if await (KMLightMemberManager.manager.canPayFunction() == false) {
+                let _ = KMSubscribeWaterMarkWindowController.show(window: self.window!, type: self.subscribeWaterMarkType!) { isSubscribeSuccess, isWaterMarkExport, isClose in
+                    if (isClose) {
+                        return
+                    }
+                    if (isSubscribeSuccess) {
+                        self._convertButtonAction()
+                        return
+                    }
+                    if (isWaterMarkExport) {
+                        self._convertButtonAction(limit: true)
+                        return
+                    }
+                }
+                return
+            }
+            self._convertButtonAction()
+        }
     }
     
     func convertModelAppendParams(convert: KMPDFConvert) -> () {
@@ -669,7 +676,11 @@ class KMConvertBaseWindowController: KMBaseWindowController {
         
         DispatchQueue.main.async {
             NSPanel.savePanel(self.window!) { panel in
-                let name = self.prePDFView!.document.documentURL.deletingPathExtension().lastPathComponent
+                var url: URL = self.prePDFView!.document.documentURL
+                if (self.oriDocumentUrl != nil) {
+                    url = self.oriDocumentUrl!
+                }
+                let name = url.deletingPathExtension().lastPathComponent
                 panel.nameFieldStringValue = name
                 panel.allowedFileTypes = [self.fileExtension]
             } completion: { response, url in
@@ -711,6 +722,7 @@ class KMConvertBaseWindowController: KMBaseWindowController {
                             try?FileManager.default.removeItem(atPath: filePath)
                         }
                         if finished {
+                            self._clearData()
                             cancelButtonAction()
                             if FileManager.default.fileExists(atPath: convert.outputFilePath) {
                                 NSWorkspace.shared.activateFileViewerSelecting([URL(fileURLWithPath: convert.outputFilePath)])
@@ -792,6 +804,14 @@ class KMConvertBaseWindowController: KMBaseWindowController {
         UserDefaults.standard.setValue("\(index)", forKey: kKMConvertLanugageSelectedIndex)
         UserDefaults.standard.synchronize()
     }
+    
+    private func _clearData() {
+        if let _ = self.oriDocumentUrl {
+            if let data = self.prePDFView?.document.documentURL.path, FileManager.default.fileExists(atPath: data) {
+                try?FileManager.default.removeItem(atPath: data)
+            }
+        }
+    }
 }
 
 extension KMConvertBaseWindowController: NSTextFieldDelegate {

+ 1 - 0
PDF Office/PDF Master/Class/PDFTools/Convert/Controller/KMConvertBaseWindowController.xib

@@ -386,6 +386,7 @@
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                     </view>
                     <constraints>
+                        <constraint firstAttribute="width" constant="244" id="Adx-8t-Hxt"/>
                         <constraint firstAttribute="height" constant="22" id="gwG-aj-fgK"/>
                     </constraints>
                     <color key="fillColor" name="findHighlightColor" catalog="System" colorSpace="catalog"/>

+ 1 - 1
PDF Office/PDF Master/Class/PDFTools/Convert/Controller/KMConvertExcelWindowController.swift

@@ -39,7 +39,7 @@ class KMConvertExcelWindowController: KMConvertBaseWindowController {
         
         Task { @MainActor in
             if await (KMLightMemberManager.manager.canPayFunction() == false) {
-                self.setupContentHeight(height: 391+16+20)
+                self.setupContentHeight(height: 391+20, animated: true)
                 return
             }
             self.setupContentHeight(height: 391)

+ 5 - 0
PDF Office/PDF Master/Class/PDFTools/Convert/View/KMConvertCSVSettingView.swift

@@ -57,6 +57,11 @@ class KMConvertCSVSettingView: KMConvertSettingView {
         if (self.pageRangeItemView == nil) {
             self.pageRangeItemView = KMConvertPageRangeSettingItemView.createFromNib()
             self.pageRangeBox.contentView = self.pageRangeItemView
+            
+            self.tipView?.km_add_left_constraint(constant: 8)
+            self.tipView?.km_add_top_constraint(equalTo: self.pageRangeBox, attribute: .bottom, constant: -5)
+            self.tipView?.km_add_right_constraint()
+            self.tipView?.km_add_height_constraint(constant: 16+20+16)
         }
     }
     

+ 5 - 0
PDF Office/PDF Master/Class/PDFTools/Convert/View/KMConvertExcelSettingView.swift

@@ -103,6 +103,11 @@ class KMConvertExcelSettingView: KMConvertSettingView {
         if (self.pageRangeItemView == nil) {
             self.pageRangeItemView = KMConvertPageRangeSettingItemView.createFromNib()
             self.pageRangeBox.contentView = self.pageRangeItemView
+            
+            self.tipView?.km_add_left_constraint(constant: 8)
+            self.tipView?.km_add_top_constraint(equalTo: self.pageRangeBox, attribute: .bottom, constant: -5)
+            self.tipView?.km_add_right_constraint()
+            self.tipView?.km_add_height_constraint(constant: 16+20+16)
         }
     }
         

+ 5 - 0
PDF Office/PDF Master/Class/PDFTools/Convert/View/KMConvertImageSettingView.swift

@@ -63,6 +63,11 @@ class KMConvertImageSettingView: KMConvertSettingView {
         if (self.pageRangeItemView == nil) {
             self.pageRangeItemView = KMConvertPageRangeSettingItemView.createFromNib()
             self.pageRangeBox.contentView = self.pageRangeItemView
+            
+            self.tipView?.km_add_left_constraint(constant: 8)
+            self.tipView?.km_add_top_constraint(equalTo: self.pageRangeBox, attribute: .bottom, constant: -5)
+            self.tipView?.km_add_right_constraint()
+            self.tipView?.km_add_height_constraint(constant: 16+20+16)
         }
         self.pageRangeItemView?.pageCount = self.pageCount
     }

+ 5 - 0
PDF Office/PDF Master/Class/PDFTools/Convert/View/KMConvertPPTsSettingView.swift

@@ -21,6 +21,11 @@ class KMConvertPPTsSettingView: KMConvertSettingView {
         if (self.pageRangeItemView == nil) {
             self.pageRangeItemView = KMConvertPageRangeSettingItemView.createFromNib()
             self.pageRangeBox.contentView = self.pageRangeItemView
+            
+            self.tipView?.km_add_left_constraint(constant: 8)
+            self.tipView?.km_add_top_constraint(equalTo: self.pageRangeBox, attribute: .bottom, constant: -5)
+            self.tipView?.km_add_right_constraint()
+            self.tipView?.km_add_height_constraint(constant: 16+20+16)
         }
     }
 }

+ 8 - 7
PDF Office/PDF Master/Class/PDFTools/Convert/View/KMConvertSettingLimitTipView.swift

@@ -13,7 +13,7 @@ class KMConvertSettingLimitTipView: NSView {
     private var _textField = NSTextField(labelWithString: "")
     private var _funcBox = NSBox()
     
-    private var _funcButtonVC: KMDesignButton?
+//    private var _funcButtonVC: KMDesignButton?
     
     var contentView: NSView {
         get {
@@ -44,12 +44,12 @@ class KMConvertSettingLimitTipView: NSView {
         self.contentView.addSubview(self._textField)
         self.contentView.addSubview(self._funcBox)
         
-        self._funcButtonVC = KMDesignButton(withType: .Text)
-        self._funcBox.contentView = self._funcButtonVC!.view
-        self._funcButtonVC?.stringValue = NSLocalizedString("Unlock", comment: "")
-        self._funcButtonVC?.button(type: .Text, size: .m)
-        self._funcButtonVC?.target = self
-        self._funcButtonVC?.action = #selector(funcAction)
+//        self._funcButtonVC = KMDesignButton(withType: .Text)
+//        self._funcBox.contentView = self._funcButtonVC!.view
+//        self._funcButtonVC?.stringValue = NSLocalizedString("Unlock", comment: "")
+//        self._funcButtonVC?.button(type: .Text, size: .m)
+//        self._funcButtonVC?.target = self
+//        self._funcButtonVC?.action = #selector(funcAction)
         
         self.contentView.km_add_inset_constraint()
         
@@ -70,6 +70,7 @@ class KMConvertSettingLimitTipView: NSView {
         self._textField.stringValue = NSLocalizedString("Convert the first 10 pages for free", comment: "")
         self._textField.font = .SFProTextRegular(12)
         self._textField.textColor = KMAppearance.titleColor()
+        self._textField.textColor = NSColor(hex: "#F3465B")
         
         self._funcBox.boxType = .custom
         self._funcBox.titlePosition = .noTitle

+ 2 - 2
PDF Office/PDF Master/Class/PDFTools/Convert/View/KMConvertSettingView.swift

@@ -114,9 +114,9 @@ class KMConvertSettingView: KMConvertBaseView {
     override func layout() {
         super.layout()
         
-        let width = NSWidth(self.bounds)
+//        let width = NSWidth(self.bounds)
 //        let height = NSHeight(self.bounds)
-        self.tipView?.frame = NSMakeRect(0, 10, width, 16+20+16)
+//        self.tipView?.frame = NSMakeRect(0, 10, width, 16+20+16)
     }
     
     var pageCount = 0 {

+ 6 - 0
PDF Office/PDF Master/Class/PDFTools/Convert/View/KMConvertWordSettingView.swift

@@ -47,6 +47,12 @@ class KMConvertWordSettingView: KMConvertSettingView {
         self.pageLayoutVC?.action = #selector(savePageLayoutRadioAction)
         self.pageLayoutVC?.stringValue = NSLocalizedString("Retain Page Layout", comment: "")
         self.pageLayoutVC?.checkbox_radio()
+        
+        self.tipView?.km_add_left_constraint(constant: 8)
+        self.tipView?.km_add_top_constraint(equalTo: self.pageRangeBox, attribute: .bottom, constant: -5)
+        self.tipView?.km_add_right_constraint()
+//        self.tipView?.km_add_width_constraint(constant: 300)
+        self.tipView?.km_add_height_constraint(constant: 16+20+16)
     }
     
     override func initDefaultVlaue() {

+ 72 - 25
PDF Office/PDF Master/Class/PDFTools/PageEdit/Controller/KMPDFEditViewController.swift

@@ -380,13 +380,9 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
         
         Task { @MainActor in
             self.toolBar.unSelectItem(for: KMToolbarPageEditSplitItemIdentifier)
-            
-            if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
-                let _ = KMComparativeTableViewController.show(window: self.view.window!, .pageEdit)
-                return
-            }
+
             if await (KMLightMemberManager.manager.canPayFunction() == false) {
-                let _ = KMSubscribeWaterMarkWindowController.show(window: self.view.window!, isContinue: true, type: .split) { isSubscribeSuccess, isWaterMarkExport, isClose in
+                let _ = KMSubscribeWaterMarkWindowController.show(window: self.view.window!, type: .split) { isSubscribeSuccess, isWaterMarkExport, isClose in
                     if (isClose) {
                         return
                     }
@@ -401,6 +397,7 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
                 }
                 return
             }
+            
             self._showSplitWindow()
         }
     }
@@ -410,11 +407,6 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
         
         Task { @MainActor in
             self.toolBar.unSelectItem(for: KMToolbarPageEditReverseItemIdentifier)
-            
-            if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
-                let _ = KMComparativeTableViewController.show(window: self.view.window!, .pageEdit)
-                return
-            }
             self.reverseMenuAction(sender: nil)
         }
     }
@@ -455,6 +447,75 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
                 return
             }
             
+//            if self?.canPayFunction == false {
+//                let _ = KMSubscribeWaterMarkWindowController.show(window: windowController.window!, isContinue: true, type: .split) { isSubscribeSuccess, isWaterMarkExport, isClose in
+//                    var limit = true
+//                    if (isClose) {
+//                        return
+//                    }
+//                    if (isSubscribeSuccess) {
+//                        limit = false
+//                    }
+//                    if (isWaterMarkExport) {
+//
+//                    }
+//
+//                    /// 拆分
+//                    let outputModel = _windowC.model! as! KMPageEditSplitSettingModel
+//                    self?.km_endSheet()
+//
+//                    let panel = NSOpenPanel()
+//                    panel.canChooseFiles = false
+//                    panel.canChooseDirectories = true
+//                    panel.canCreateDirectories = true
+//                    panel.beginSheetModal(for: (self?.view.window)!) { response in
+//                        if (response == .cancel) {
+//                            return
+//                        }
+//
+//                        let file_indexs = outputModel.getSplitIndexSets
+//                        if (file_indexs == nil || file_indexs!.count <= 0) {
+//                            return
+//                        }
+//
+//                        DispatchQueue.main.async {
+//                            self?.showProgressWindow(message: NSLocalizedString("Spliting...", comment: ""))
+//                            self?.progressC?.maxValue = Double(file_indexs!.count)
+//                            let _document: CPDFDocument = (self?.listView?.document)!
+//
+//                            let filePath = "\(panel.url!.path)/\(_document.documentURL.deletingPathExtension().lastPathComponent)"
+//                            let uniqueFilePath = KMTools.getUniqueFilePath(filePath: filePath)
+//        //                    Swift.debugPrint(uniqueFilePath)
+//                            if (!FileManager.default.fileExists(atPath: uniqueFilePath)) {
+//                                try?FileManager.default.createDirectory(atPath: uniqueFilePath, withIntermediateDirectories: true)
+//                            }
+//
+//                            var filepaths: [String] = []
+//                            for i in 0 ..< file_indexs!.count {
+//                                let indexs = file_indexs![i]
+//                                if (indexs.isEmpty) {
+//                                    continue
+//                                }
+//                                let filepath = String(format: "%@/%@.pdf", uniqueFilePath, model.getNewOutputFileName(index: i+1))
+//                                filepaths.append(filepath)
+//
+//                                let newDocument = CPDFDocument()
+//                                newDocument?.importPages(indexs, from: _document, at: 0)
+//                                self?.progressC?.increment(by: 1.0)
+//                                if (limit) {
+//                                    let _ = KMTools.saveWatermarkDocument(document: newDocument!, to: URL(fileURLWithPath: filepath))
+//                                } else {
+//                                    newDocument?.write(to: URL(fileURLWithPath: filepath))
+//                                }
+//                            }
+//                            self?.hiddenProgressWindow()
+//                            if let _urlString = filepaths.first?.deletingLastPathComponent {
+//                                NSWorkspace.shared.activateFileViewerSelecting([URL(fileURLWithPath: _urlString)])
+//                            }
+//                        }
+//                    }
+//                }
+//            }
             /// 拆分
             let outputModel = _windowC.model! as! KMPageEditSplitSettingModel
             self?.km_endSheet()
@@ -665,10 +726,6 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
     
     @objc func item_insertCustomPage(sender: NSMenuItem?) {
         Task { @MainActor in
-            if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
-                let _ = KMComparativeTableViewController.show(window: self.view.window!, .pageEdit)
-                return
-            }
             let windowController = KMPageEditInsertCustomPageWindowController()
             if (self.thumbnailView.selectionIndexPaths.count > 0) {
                 let page = self.getSelectedPage()
@@ -964,10 +1021,6 @@ extension KMPDFEditViewController {
 
 extension KMPDFEditViewController: KMThumbnailViewDelegate {
     func thumbnailView(thumbanView: KMThumbnailView, shouldAcceptDrop draggingInfo: NSDraggingInfo, indexPath: IndexPath, dropOperation: NSCollectionView.DropOperation) -> Bool {
-        if (!self.canUseAdvanced) {
-            let _ = KMComparativeTableViewController.show(window: self.view.window!, .pageEdit)
-            return false
-        }
         return true
     }
     func thumbnailView(thumbanView: KMThumbnailView, didDragAddFiles files: [URL], indexpath: IndexPath) {
@@ -1021,12 +1074,6 @@ extension KMPDFEditViewController: KMThumbnailViewDelegate {
     }
     
     func thumbnailView(thumbanView: KMThumbnailView, shouldPasteboardWriterForItemAt indexPath: IndexPath) -> Bool {
-        if (!self.canUseAdvanced) {
-            DispatchQueue.main.async {
-                let _ = KMComparativeTableViewController.show(window: self.view.window!, .pageEdit)
-            }
-            return false
-        }
         return true
     }
     

+ 2 - 52
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Thumbnail/Base/KMPDFThumbViewBaseController.swift

@@ -144,11 +144,6 @@ class KMPDFThumbViewBaseController: KMBaseViewController {
             return
         }
         Task { @MainActor in
-            if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
-                let _ = KMComparativeTableViewController.show(window: self.view.window!)
-                return
-            }
-            
             self._undo_deletePages(indexs: self.indexpathsToIndexs(indexpaths: indexpaths))
             self.deleteAfter(indexpaths: indexpaths)
         }
@@ -157,10 +152,6 @@ class KMPDFThumbViewBaseController: KMBaseViewController {
     // 插入文件事件
     public func insertFileAction() {
         Task { @MainActor in
-            if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
-                let _ = KMComparativeTableViewController.show(window: self.view.window!)
-                return
-            }
             self.km_open_file_multi { [unowned self] index, params in
                 if (self.fetchProgressBlockParamsIsPasswordFile(params: params)) { // 加密文档进度回调
                     return
@@ -210,10 +201,6 @@ class KMPDFThumbViewBaseController: KMBaseViewController {
     // 插入空白页面 指定页面大小和位置
     public func insertBlankPage(size: NSSize, at index: Int) {
         Task { @MainActor in
-            if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
-                let _ = KMComparativeTableViewController.show(window: self.view.window!)
-                return
-            }
             self._undo_insertBlankPage(size: size, at: index)
             self.insertBlankPageAfter(size: size, at: index)
         }
@@ -231,11 +218,6 @@ class KMPDFThumbViewBaseController: KMBaseViewController {
     // 左旋转 指定的item
     public func leftRotateIndexpaths(indexpaths: Set<IndexPath>) {
         Task { @MainActor in
-            if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
-                let _ = KMComparativeTableViewController.show(window: self.view.window!)
-                return
-            }
-            
             self._undo_leftRotate(indexs: self.indexpathsToIndexs(indexpaths: indexpaths))
             self.leftRotateAfter(indexpaths: indexpaths)
         }
@@ -249,10 +231,6 @@ class KMPDFThumbViewBaseController: KMBaseViewController {
     // 右旋转 指定的item
     @objc func rightRotateIndexpaths(indexpaths: Set<IndexPath>) {
         Task { @MainActor in
-            if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
-                let _ = KMComparativeTableViewController.show(window: self.view.window!)
-                return
-            }
             self._undo_rightRotate(indexs: self.indexpathsToIndexs(indexpaths: indexpaths))
             self.rightRotateAfter(indexpaths: indexpaths)
         }
@@ -260,11 +238,6 @@ class KMPDFThumbViewBaseController: KMBaseViewController {
     
     public func cutAction() {
         Task { @MainActor in
-            if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
-                let _ = KMComparativeTableViewController.show(window: self.view.window!)
-                return
-            }
-
             let indexpaths = self.thumbnailView.selectionIndexPaths
             self._cutPages(indexpaths: indexpaths)
             self.cutAfter(indexpaths: indexpaths)
@@ -273,11 +246,6 @@ class KMPDFThumbViewBaseController: KMBaseViewController {
     
     public func copyAction() {
         Task { @MainActor in
-            if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
-                let _ = KMComparativeTableViewController.show(window: self.view.window!)
-                return
-            }
-            
             let indexpaths = self.thumbnailView.selectionIndexPaths
             self._copyPages(indexpaths: indexpaths)
             self.copyAfter(indexpaths: indexpaths)
@@ -312,11 +280,6 @@ class KMPDFThumbViewBaseController: KMBaseViewController {
             return
         }
         Task { @MainActor in
-            if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
-                let _ = KMComparativeTableViewController.show(window: self.view.window!)
-                return
-            }
-
             let index = self.getPasteIndex()
             self._pastePages(at: index)
             self.pasteAfter(at: index)
@@ -331,12 +294,8 @@ class KMPDFThumbViewBaseController: KMBaseViewController {
     // 提取 指定的item
     public func extractActionIndexpaths(indexpaths: Set<IndexPath>) {
         Task { @MainActor in
-            if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
-                let _ = KMComparativeTableViewController.show(window: self.view.window!)
-                return
-            }
             if await (KMLightMemberManager.manager.canPayFunction() == false) {
-                let _ = KMSubscribeWaterMarkWindowController.show(window: self.view.window!, isContinue: true, type: .extract) { isSubscribeSuccess, isWaterMarkExport, isClose in
+                let _ = KMSubscribeWaterMarkWindowController.show(window: self.view.window!, type: .extract) { isSubscribeSuccess, isWaterMarkExport, isClose in
                     if (isClose) {
                         return
                     }
@@ -372,6 +331,7 @@ class KMPDFThumbViewBaseController: KMBaseViewController {
                 }
                 return
             }
+            
             self.showExtractWindow_success(indexpaths: indexpaths) { [unowned self] oneDocumentPerPage, extractAfterDelete in
                 self._extractPages(indexpaths: indexpaths, oneDocumentPerPage: oneDocumentPerPage) { [unowned self] result, params in
                     if (result == .failure || result == .cancel) {
@@ -389,11 +349,6 @@ class KMPDFThumbViewBaseController: KMBaseViewController {
     // 替换 特定的item
     public func replaceAction() {
         Task { @MainActor in
-            if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
-                let _ = KMComparativeTableViewController.show(window: self.view.window!)
-                return
-            }
-
             self.km_open_file_multi {  [unowned self] index, params in
                 if (self.fetchProgressBlockParamsIsPasswordFile(params: params)) { // 加密文档进度回调
                     return
@@ -417,11 +372,6 @@ class KMPDFThumbViewBaseController: KMBaseViewController {
     // 替换 指定的item
     public func replacePages(of targetIndexpaths: Set<IndexPath>, with documents: [CPDFDocument]) {
         Task { @MainActor in
-            if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
-                let _ = KMComparativeTableViewController.show(window: self.view.window!)
-                return
-            }
-            
             if (targetIndexpaths.count == 0 || documents.count == 0) {
                 KMPrint("replace invalid.")
                 return

+ 0 - 42
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Thumbnail/KMThumbnailViewController.swift

@@ -468,11 +468,6 @@ class KMThumbnailViewController: KMBaseViewController {
     
     @IBAction func rotatePageItemAction(menu:NSMenuItem) {
         Task { @MainActor in
-            if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
-                let _ = KMComparativeTableViewController.show(window: self.view.window!)
-                return
-            }
-            
             let indexs = self.thumbnailView.collectionView.selectionIndexes
             let indexPaths = self.thumbnailView.collectionView.selectionIndexPaths
             if indexs.count >= 0 {
@@ -504,11 +499,6 @@ class KMThumbnailViewController: KMBaseViewController {
     
     @IBAction func leftRotatePageItemAction(menu:NSMenuItem) {
         Task { @MainActor in
-            if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
-                let _ = KMComparativeTableViewController.show(window: self.view.window!)
-                return
-            }
-            
             let indexs = self.thumbnailView.collectionView.selectionIndexes
             let indexPaths = self.thumbnailView.collectionView.selectionIndexPaths
             if indexs.count >= 0 {
@@ -578,11 +568,6 @@ class KMThumbnailViewController: KMBaseViewController {
     
     @IBAction func deletePageItemAction(menu:NSMenuItem) {
         Task { @MainActor in
-            if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
-                let _ = KMComparativeTableViewController.show(window: self.view.window!)
-                return
-            }
-            
             let indexs = self.thumbnailView.collectionView.selectionIndexes
             if indexs.count > 0 {
                 self.deletePageItemWithIndexs(indexs: indexs)
@@ -626,13 +611,6 @@ class KMThumbnailViewController: KMBaseViewController {
     }
     
     @IBAction func copyItemAction(menu:NSMenuItem) {
-        Task { @MainActor in
-            if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
-                let _ = KMComparativeTableViewController.show(window: self.view.window!)
-                return
-            }
-        }
-        
         let indexs = self.thumbnailView.collectionView.selectionIndexes
         if indexs.count >= 0 {
             self.copysPages = []
@@ -645,11 +623,6 @@ class KMThumbnailViewController: KMBaseViewController {
     
     @IBAction func cutItemAction(menu:NSMenuItem) {
         Task { @MainActor in
-            if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
-                let _ = KMComparativeTableViewController.show(window: self.view.window!)
-                return
-            }
-            
             let indexs = self.thumbnailView.collectionView.selectionIndexes
             if indexs.count >= 0 {
                 self.copysPages = []
@@ -668,11 +641,6 @@ class KMThumbnailViewController: KMBaseViewController {
     
     @IBAction func pastePageItemAction(menu:NSMenuItem) {
         Task { @MainActor in
-            if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
-                let _ = KMComparativeTableViewController.show(window: self.view.window!)
-                return
-            }
-            
             var index = (self.thumbnailView.collectionView.selectionIndexes).last ?? -1
             if Int(index) >= 0 && self.copysPages.count > 0 {
                 var pageItems: [KMThumbnailPageItem] = []
@@ -781,20 +749,10 @@ extension KMThumbnailViewController : KMThumbnailViewDelegate {
     }
 
     func thumbnailView(thumbanView: KMThumbnailView, shouldAcceptDrop draggingInfo: NSDraggingInfo, indexPath: IndexPath, dropOperation: NSCollectionView.DropOperation) -> Bool {
-        if (!self.canUseAdvanced) {
-            let _ = KMComparativeTableViewController.show(window: self.view.window!, .thumb)
-            return false
-        }
         return true
     }
     
     func thumbnailView(thumbanView: KMThumbnailView, shouldPasteboardWriterForItemAt indexPath: IndexPath) -> Bool {
-        if (!self.canUseAdvanced) {
-            DispatchQueue.main.async {
-                let _ = KMComparativeTableViewController.show(window: self.view.window!, .thumb)
-            }
-            return false
-        }
         return true
     }
     

+ 0 - 7
PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbarController.swift

@@ -516,13 +516,6 @@ extension KMToolbarController: KMToolbarViewControllerDelegate {
         
         // 高级功能
         Task { @MainActor in
-            if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
-                let _ = KMComparativeTableViewController.show(window: self.view.window!)
-                let boxItem = item.clickObject as? KMToolBoxItem
-                boxItem?.isSelected = false
-                return
-            }
-            
             //文字编辑 图片编辑 选中按钮逻辑(只能同时选中其中一个)
             if type == .addText || type == .addImage {
                 let boxItem = item.clickObject as? KMToolBoxItem

+ 0 - 4
PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbarViewController.swift

@@ -186,10 +186,6 @@ class KMToolbarViewController: NSViewController, NSTextFieldDelegate {
         
         if tag == .editPDF {
             Task { @MainActor in
-                if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
-                    let _ =  KMComparativeTableViewController.show(window: self.view.window!)
-                    return
-                }
                 self.delegate?.toolbarViewController?(self, clickMode: tag, toolbar: item.clickObject as! KMToolBoxItem, [])
             }
         } else {

+ 31 - 159
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift

@@ -331,7 +331,9 @@ extension KMMainViewController {
         if self.isReadMode {
             
         } else {
-            menu.insertItem(aiTranslation, at: menu.items.count)
+            if (listView.currentSelection.selectionType() != .image) {
+                menu.insertItem(aiTranslation, at: menu.items.count)
+            }
         }
         menu.insertItem(NSMenuItem.separator(), at: menu.items.count)
     }
@@ -602,13 +604,6 @@ extension KMMainViewController {
     
     @objc func menuItemAnnotationClick_addStype(sender: NSMenuItem) {
         Task { @MainActor in
-            if (sender.tag == 7 || sender.tag == 8 || sender.tag == 9) {
-                if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
-                    let _ = KMComparativeTableViewController.show(window: self.view.window!)
-                    return
-                }
-            }
-            
             var point = mouseRightMenuEvent?.locationInWindow
             if (point == nil) {
                 point = NSZeroPoint
@@ -1788,6 +1783,7 @@ extension KMMainViewController {
         self.currentWindowController = windowController
         if let _url = url {
             windowController.documentURL = _url
+            windowController.oriDocumentUrl = self.listView.document.documentURL
         } else {
             windowController.documentURL = self.listView.document.documentURL
         }
@@ -1847,10 +1843,12 @@ extension KMMainViewController {
         } else if (type == .conversion_image) {
             windowController = KMConvertImageWindowController()
         }
+        windowController?.subscribeWaterMarkType = type.toSubscribeWaterMarkType()
         
         var url: URL?
         if (documentUrl != nil) {
             url = documentUrl
+            windowController?.oriDocumentUrl = self.listView.document.documentURL
         } else {
             url = self.listView.document.documentURL
         }
@@ -2150,7 +2148,7 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
         self.trackEvent_aiTranslate()
         Task { @MainActor in
             if await (KMLightMemberManager.manager.canPayFunction() == false) {
-                let _ = KMSubscribeWaterMarkWindowController.show(window: self.view.window!, isAI: true, type: .aiTranslate) { isSub, _, isClose in
+                let _ = KMSubscribeWaterMarkWindowController.show(window: self.view.window!, type: .aiTranslate) { isSub, _, isClose in
                     if (isClose) {
                         return
                     }
@@ -2235,10 +2233,6 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
 //            return
 //        }
         Task { @MainActor in
-            if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
-                let _ = KMComparativeTableViewController.show(window: self.view.window!, .shareFlatten)
-                return
-            }
             if await (KMLightMemberManager.manager.canPayFunction() == false) {
                 KMSubscribeWaterMarkWindowController.show(window: self.view.window!, isContinue: true) { isSubscribeSuccess, isWaterMarkExport, isClose in
                     if (isClose) {
@@ -2372,45 +2366,28 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
         
         Task { @MainActor in
             if (type == .compress) { /// 压缩
-                if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
-                    let _ = KMComparativeTableViewController.show(window: self.view.window!, .compress)
-                    
-                    self.toolbarController.cancelSelected(KMToolbarToolCompressItemIdentifier)
-                    return
-                    
-                }
-                
                 if await (KMLightMemberManager.manager.canPayFunction() == false) {
-                    let _ = KMSubscribeWaterMarkWindowController.show(window: self.view.window!, isContinue: true, type: .compress) { isSubscribeSuccess, isWaterMarkExport, isClose in
-                        if (isClose) {
-                            return
-                        }
-                        if (isSubscribeSuccess) {
-                            self.showCompressWindow()
-                            return
-                        }
-                        if (isWaterMarkExport) {
-                            DispatchQueue.main.async {
-                                NSPanel.savePanel(self.view.window!, panel:{ panel in
-                                    panel.directoryURL = self.document?.documentURL.deletingLastPathComponent()
-                                    panel.nameFieldStringValue = (self.document?.documentURL.lastPathComponent)!
-                                }) { response, url in
-                                    if (response == .cancel) {
-                                        return
-                                    }
-                                    guard let _url = KMTools.saveWatermarkDocument(document: self.document!, to: url!, secureOptions: self.secureOptions, removePWD: self.removeSecureFlag) else {
-                                        return
-                                    }
-                                    self.showCompressWindow(url: _url)
-                                }
-                            }
+//                    self.view.window?.contentView?.superview?.beginLoading()
+                    let document = self.listView.document
+                    let secureOptions = self.secureOptions
+                    let removeSecureFlag = self.removeSecureFlag
+                    
+//                    DispatchQueue.global().async { [unowned self] in
+                        guard let _url = KMTools.saveWatermarkDocumentToTemp(document: document!, secureOptions: secureOptions, removePWD: removeSecureFlag) else {
+//                            DispatchQueue.main.async {
+//                                self.view.window?.contentView?.superview?.endLoading()
+//                            }
                             return
                         }
-                    }
+//                        DispatchQueue.main.async {
+//                            self.view.window?.contentView?.superview?.endLoading()
+                            self.showCompressWindow(url: _url)
+//                        }
+//                    }
                     return
                 }
                 
-                if (self.needSaveDocument()) {                
+                if (self.needSaveDocument()) {
                     self.saveDocumentWithProgressAlert { [unowned self] params in
                         self.showCompressWindow()
                     }
@@ -2441,46 +2418,11 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
                     identifier = KMToolbarConversionImageItemIdentifier
                 }
                 
-                if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
-                    if (identifier != nil) {
-                        self.toolbarController.cancelSelected(identifier!)
-                    }
-            
-                    let _ = KMComparativeTableViewController.show(window: self.view.window!, .convert)
-                    return
-                }
-                
                 if await (KMLightMemberManager.manager.canPayFunction() == false) {
-                    let _ = KMSubscribeWaterMarkWindowController.show(window: self.view.window!, isContinue: true, type: type.toSubscribeWaterMarkType()) { isSubscribeSuccess, isWaterMarkExport, isClose in
-                        if (isClose) {
-                            return
-                        }
-                        if (isSubscribeSuccess) {
-                            self.showConvertWindow(type: type, identifier: identifier)
-                            return
-                        }
-                        if (isWaterMarkExport) {
-                            DispatchQueue.main.async {
-                                NSPanel.savePanel(self.view.window!, panel:{ panel in
-//                                    if (!self.my) {
-                                    panel.directoryURL = self.document?.documentURL.deletingLastPathComponent()
-//                                    }
-                                    
-                                    panel.nameFieldStringValue = (self.document?.documentURL.lastPathComponent)!
-                                }) { response, url in
-                                    if (response == .cancel) {
-                                        return
-                                    }
-                                    self.commitEditingIfNeed()
-                                    guard let _url = KMTools.saveWatermarkDocument(document: self.document!, to: url!, secureOptions: self.secureOptions, removePWD: self.removeSecureFlag) else {
-                                        return
-                                    }
-                                    self.showConvertWindow(type: type, documentUrl: _url, identifier: identifier)
-                                }
-                            }
-                            return
-                        }
+                    guard let _url =  KMTools.saveWatermarkDocumentToTemp(document: self.listView.document, secureOptions: self.secureOptions, removePWD: self.removeSecureFlag) else {
+                        return
                     }
+                    self.showConvertWindow(type: type, documentUrl: _url, identifier: identifier)
                     return
                 }
                 
@@ -2495,57 +2437,18 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
             }
             
             if (type == .merge) { /// 合并
-                if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
-                    let _ = KMComparativeTableViewController.show(window: self.view.window!, .merge)
-                    
-                    self.toolbarController.cancelSelected(KMToolbarToolMergeItemIdentifier)
-                    return
-                }
-                
                 if (self.listView.document.allowsCopying == false || self.listView.document.allowsPrinting == false) {
                     if await (KMLightMemberManager.manager.canPayFunction() == false) {
-                        //FIXME: 方案待确认,先不处理保存
-//                        self.showMergeWindow(password)
-                        let _ = KMSubscribeWaterMarkWindowController.show(window: self.view.window!, isContinue: true, type: .merge) { isSubscribeSuccess, isWaterMarkExport, isClose in
-                            if (isClose) {
-                                return
-                            }
-                            
                             KMPasswordInputWindow.openWindow(window: self.view.window!, type: .owner, url: self.listView.document.documentURL) { [unowned self] result , password in
                                 if (result == .cancel) {
                                     return
                                 }
                                  
-                                if (isSubscribeSuccess) {
-                                    if (self.needSaveDocument()) {
-                                        self.saveDocumentWithProgressAlert { [unowned self] params in
-                                            self.showMergeWindow(password)
-                                        }
-                                        return
-                                    }
-                                    
-                                    self.showMergeWindow(password)
-                                    return
-                                }
-                                if (isWaterMarkExport) {
-                                    DispatchQueue.main.async {
-                                        NSPanel.savePanel(self.view.window!, panel:{ panel in
-                                            panel.directoryURL = self.document?.documentURL.deletingLastPathComponent()
-                                            panel.nameFieldStringValue = (self.document?.documentURL.lastPathComponent)!
-                                        }) { response, url in
-                                            if (response == .cancel) {
-                                                return
-                                            }
-                                            guard let _url = KMTools.saveWatermarkDocument(document: self.document!, to: url!, secureOptions: self.secureOptions, removePWD: self.removeSecureFlag) else {
-                                                return
-                                            }
-                                            self.showMergeWindow(url: _url, password)
-                                        }
-                                    }
+                                guard let _url =  KMTools.saveWatermarkDocumentToTemp(document: self.listView.document, secureOptions: self.secureOptions, removePWD: self.removeSecureFlag) else {
                                     return
                                 }
+                                self.showMergeWindow(url: _url, password)
                             }
-                        }
                         return
                     }
                     
@@ -2568,32 +2471,10 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
                 }
                 
                 if await (KMLightMemberManager.manager.canPayFunction() == false) {
-                    let _ = KMSubscribeWaterMarkWindowController.show(window: self.view.window!, isContinue: true, type: .merge) { isSubscribeSuccess, isWaterMarkExport, isClose in
-                        if (isClose) {
-                            return
-                        }
-                        if (isSubscribeSuccess) {
-                            self.showMergeWindow(self.listView.document.password)
-                            return
-                        }
-                        if (isWaterMarkExport) {
-                            DispatchQueue.main.async {
-                                NSPanel.savePanel(self.view.window!, panel:{ panel in
-                                    panel.directoryURL = self.document?.documentURL.deletingLastPathComponent()
-                                    panel.nameFieldStringValue = (self.document?.documentURL.lastPathComponent)!
-                                }) { response, url in
-                                    if (response == .cancel) {
-                                        return
-                                    }
-                                    guard let _url = KMTools.saveWatermarkDocument(document: self.document!, to: url!, secureOptions: self.secureOptions, removePWD: self.removeSecureFlag) else {
-                                        return
-                                    }
-                                    self.showMergeWindow(url: _url, self.listView.document.password)
-                                }
-                            }
-                            return
-                        }
+                    guard let _url =  KMTools.saveWatermarkDocumentToTemp(document: self.listView.document, secureOptions: self.secureOptions, removePWD: self.removeSecureFlag) else {
+                        return
                     }
+                    self.showMergeWindow(url: _url, password)
                     return
                 }
                 
@@ -2608,10 +2489,6 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
             }
             
             if (type == .crop) {
-                if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
-                    let _ = KMComparativeTableViewController.show(window: self.view.window!, .crop)
-                    return
-                }
                 self.recordSaveWatermarkFlag(type: .crop)
                 
                 if (index == 1) {
@@ -2861,11 +2738,6 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
                     return
                 }
             } else if (type == .secure) { /// 安全
-                if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
-                    let _ = KMComparativeTableViewController.show(window: self.view.window!, .secure)
-                    return
-                }
-                
                 if (index == 1) { /// 设置密码
                     if (!self.listView.document!.allowsCopying || !self.listView.document!.allowsPrinting) {
                         KMPasswordInputWindow.openWindow(window: self.view.window!, type: .owner, url: self.listView.document.documentURL) { [weak self]  result, password in

+ 0 - 20
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+MenuAction.swift

@@ -252,11 +252,6 @@ extension KMMainViewController {
     
     @IBAction func menuItemAction_rotateLeft(_ sender: Any) {
         Task { @MainActor in
-            if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
-                let _ = KMComparativeTableViewController.show(window: self.view.window!)
-                return
-            }
-            
             let page : CPDFPage = self.listView?.currentPage() ?? CPDFPage()
             let rotation = page.rotation
             page.leftRotate()
@@ -286,11 +281,6 @@ extension KMMainViewController {
 
     @IBAction func menuItemAction_rotateRight(_ sender: Any) {
         Task { @MainActor in
-            if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
-                let _ = KMComparativeTableViewController.show(window: self.view.window!)
-                return
-            }
-            
             let page : CPDFPage = self.listView?.currentPage() ?? CPDFPage()
             let rotation = page.rotation
             page.rightRotate()
@@ -301,11 +291,6 @@ extension KMMainViewController {
 
     @IBAction func menuItemAction_rotateAllPageLeft(_ sender: Any) {
         Task { @MainActor in
-            if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
-                let _ = KMComparativeTableViewController.show(window: self.view.window!)
-                return
-            }
-            
             var pageItems: [KMThumbnailPageItem] = []
             for index in 0 ... self.listView.document.pageCount - 1 {
                 let page: CPDFPage = self.listView.document.page(at: index)
@@ -320,11 +305,6 @@ extension KMMainViewController {
 
     @IBAction func menuItemAction_rotateAllPageRight(_ sender: Any) {
         Task { @MainActor in
-            if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
-                let _ = KMComparativeTableViewController.show(window: self.view.window!)
-                return
-            }
-            
             var pageItems: [KMThumbnailPageItem] = []
             for index in 0 ... self.listView.document.pageCount - 1 {
                 let page : CPDFPage = self.listView.document.page(at: index)

+ 1 - 0
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController.swift

@@ -846,6 +846,7 @@ import Cocoa
             if let _url = url {
                 let document = PDFDocument(url: _url)
                 let windowController = KMPDFEditAppendWindow(pdfDocument: document, password: password)
+                windowController?.oriDucumentUrl = self.listView.document.documentURL
                 
                 self.toolbarController.cancelSelected(KMToolbarToolMergeItemIdentifier)
                 

File diff suppressed because it is too large
+ 29 - 1
PDF Office/PDF Master/Strings/en.lproj/Localizable.strings