Procházet zdrojové kódy

【2025】【Edit】水印模块完善,组件库接口补充

niehaoyu před 4 měsíci
rodič
revize
627f26ea9e
29 změnil soubory, kde provedl 900 přidání a 182 odebrání
  1. 1 1
      PDF Office/KMComponentLibrary/KMComponentLibrary.xcodeproj/project.pbxproj
  2. 1 1
      PDF Office/KMComponentLibrary/KMComponentLibrary/View/Card/ComponentCardHeader/ComponentCardHeader.xib
  3. 2 2
      PDF Office/KMComponentLibrary/KMComponentLibrary/View/Card/ComponentCardPDFTool/ComponentCardPDFTool.xib
  4. 7 1
      PDF Office/KMComponentLibrary/KMComponentLibrary/View/Card/ComponentCardWatermark/ComponentCardWMProperty.swift
  5. 92 72
      PDF Office/KMComponentLibrary/KMComponentLibrary/View/Card/ComponentCardWatermark/ComponentCardWatermark.swift
  6. 0 4
      PDF Office/PDF Master/Class/KMAdvertisement/Config/KMAdvertisementConfig.swift
  7. 0 2
      PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListViewExtension/CPDFListView+Event.m
  8. 4 2
      PDF Office/PDF Master/KMClass/KMHomeViewController/Views/KMHomeOpenView/KMHomeOpenView.swift
  9. 17 0
      PDF Office/PDF Master/KMClass/KMPDFViewController/KMMainViewController.swift
  10. 12 0
      PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Watermark/watermark_edit.imageset/Contents.json
  11. 89 0
      PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Watermark/watermark_edit.imageset/watermark_edit.pdf
  12. 12 0
      PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Watermark/watermark_template_add.imageset/Contents.json
  13. 91 0
      PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Watermark/watermark_template_add.imageset/watermark_template_add.pdf
  14. 1 3
      PDF Office/PDF Master/KMClass/KMPDFViewController/RightSideViews/Watermark/New/KMEditDocumentController.swift
  15. 21 3
      PDF Office/PDF Master/KMClass/KMPDFViewController/RightSideViews/Watermark/New/KMWatermarkController.swift
  16. 7 1
      PDF Office/PDF Master/KMClass/KMPDFViewController/RightSideViews/Watermark/New/Views/KMNWatermarkPropertyController.swift
  17. 49 0
      PDF Office/PDF Master/KMClass/KMPDFViewController/RightSideViews/Watermark/New/Views/KMWatermarkToolbar.swift
  18. 130 0
      PDF Office/PDF Master/KMClass/KMPDFViewController/RightSideViews/Watermark/New/Views/KMWatermarkToolbar.xib
  19. 0 0
      PDF Office/PDF Master/KMClass/KMPDFViewController/RightSideViews/Watermark/New/Views/Model/KMPDFWatermarkData.swift
  20. 18 8
      PDF Office/PDF Master/KMClass/KMPDFViewController/RightSideViews/Watermark/New/Views/KMWatermarkManager.swift
  21. 73 9
      PDF Office/PDF Master/KMClass/KMPDFViewController/RightSideViews/Watermark/New/Views/Templates/KMNWatermarkTemplateController.swift
  22. 5 0
      PDF Office/PDF Master/KMClass/KMPDFViewController/RightSideViews/Watermark/New/Views/Templates/KMNWatermarkTemplateController.xib
  23. 50 0
      PDF Office/PDF Master/KMClass/KMPDFViewController/RightSideViews/Watermark/New/Views/Templates/KMNWatermarkTemplateItem.swift
  24. 31 5
      PDF Office/PDF Master/KMClass/KMPDFViewController/RightSideViews/Watermark/New/Views/Templates/KMNWatermarkTemplateItem.xib
  25. 19 0
      PDF Office/PDF Master/KMClass/KMPDFViewController/Toolbar/KMPDFSecToolbarController.swift
  26. 19 0
      PDF Office/PDF Master/KMClass/KMPDFViewController/Toolbar/KMPDFToolbarController.swift
  27. 11 2
      PDF Office/PDF Master/KMClass/Tools/Category/NSImage+QuickLook.swift
  28. 26 2
      PDF Office/PDF Reader Pro.xcodeproj/project.pbxproj
  29. 112 64
      PDF Office/PDF Reader Pro.xcodeproj/xcuserdata/kdanmobile.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

+ 1 - 1
PDF Office/KMComponentLibrary/KMComponentLibrary.xcodeproj/project.pbxproj

@@ -572,9 +572,9 @@
 		BB5A9BC82CB64D4700F64C1F /* ComponentCardWatermark */ = {
 			isa = PBXGroup;
 			children = (
+				BB5A9BCB2CB64D4700F64C1F /* ComponentCardWMProperty.swift */,
 				BB5A9BC92CB64D4700F64C1F /* ComponentCardWatermark.swift */,
 				BB5A9BCA2CB64D4700F64C1F /* ComponentCardWatermark.xib */,
-				BB5A9BCB2CB64D4700F64C1F /* ComponentCardWMProperty.swift */,
 			);
 			path = ComponentCardWatermark;
 			sourceTree = "<group>";

+ 1 - 1
PDF Office/KMComponentLibrary/KMComponentLibrary/View/Card/ComponentCardHeader/ComponentCardHeader.xib

@@ -28,7 +28,7 @@
                         <rect key="frame" x="1" y="1" width="156" height="238"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
-                            <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="xFf-g8-Fu5">
+                            <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="xFf-g8-Fu5">
                                 <rect key="frame" x="14" y="210" width="37" height="16"/>
                                 <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="MyG-iK-9mh">
                                     <font key="font" usesAppearanceFont="YES"/>

+ 2 - 2
PDF Office/KMComponentLibrary/KMComponentLibrary/View/Card/ComponentCardPDFTool/ComponentCardPDFTool.xib

@@ -36,7 +36,7 @@
                                 </constraints>
                                 <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="axesIndependently" image="test" id="jhs-UP-tL4"/>
                             </imageView>
-                            <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" allowsExpansionToolTips="YES" translatesAutoresizingMaskIntoConstraints="NO" id="nLl-zS-465">
+                            <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" allowsExpansionToolTips="YES" translatesAutoresizingMaskIntoConstraints="NO" id="nLl-zS-465">
                                 <rect key="frame" x="56" y="16" width="172" height="16"/>
                                 <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
                                 <textFieldCell key="cell" truncatesLastVisibleLine="YES" title="content content content content content content content content" id="ehH-eQ-Oeo">
@@ -45,7 +45,7 @@
                                     <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                 </textFieldCell>
                             </textField>
-                            <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="89z-7H-gqW">
+                            <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="89z-7H-gqW">
                                 <rect key="frame" x="54" y="54" width="56" height="16"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
                                 <textFieldCell key="cell" lineBreakMode="clipping" title="Example" id="Zmc-LK-yn7">

+ 7 - 1
PDF Office/KMComponentLibrary/KMComponentLibrary/View/Card/ComponentCardWatermark/ComponentCardWMProperty.swift

@@ -13,16 +13,22 @@ public class ComponentCardWMProperty: NSObject {
     public var state: ComponentState = .normal //
     public var icon: NSImage? //
     public var text: String? //
+    public var editIcon: NSImage?
+    public var deleteIcon: NSImage?
     
     public var propertyInfo = CardWatermarkPropertyInfo()
     
     public init(state: ComponentState = .normal,
                 icon: NSImage? = nil,
-                text: String? = nil) {
+                text: String? = nil,
+                editIcon: NSImage? = nil,
+                deleteIcon: NSImage? = nil) {
         
         self.state = state
         self.icon = icon
         self.text = text
+        self.editIcon = editIcon
+        self.deleteIcon = deleteIcon
         
     }
     

+ 92 - 72
PDF Office/KMComponentLibrary/KMComponentLibrary/View/Card/ComponentCardWatermark/ComponentCardWatermark.swift

@@ -8,6 +8,14 @@
 import Cocoa
 import AppKit
 
+@objc public protocol ComponentCardWatermarkDelegate: AnyObject {
+    
+    @objc optional func componentSliderDidEdit(_ view: ComponentCardWatermark)
+    
+    @objc optional func componentSliderDidDelete(_ view: ComponentCardWatermark)
+ 
+}
+
 public class ComponentCardWatermark: ComponentBaseXibView {
     @IBOutlet var contendBox: NSBox!
     @IBOutlet var iconImage: NSImageView!
@@ -17,7 +25,6 @@ public class ComponentCardWatermark: ComponentBaseXibView {
     @IBOutlet var editButton: ComponentButton!
     @IBOutlet var deleteButton: ComponentButton!
     
-    
     private var _properties : ComponentCardWMProperty = ComponentCardWMProperty()
     
     private var checkBoxProperty: ComponentCheckBoxProperty = ComponentCheckBoxProperty(size: .s,
@@ -25,7 +32,8 @@ public class ComponentCardWatermark: ComponentBaseXibView {
                                                                                         isDisabled: false,
                                                                                         showhelp: false,
                                                                                         text: nil,
-                                                                                        checkboxType: .selected)
+                                                                                        checkboxType: .normal)
+    
     private var editButtonProperty: ComponentButtonProperty = ComponentButtonProperty(type: .default_tertiary,
                                                                                       size: .xxs,
                                                                                       state: .normal,
@@ -40,15 +48,13 @@ public class ComponentCardWatermark: ComponentBaseXibView {
                                                                                         showLeftIcon: false,
                                                                                         showRightIcon: false)
     
-     
-    
+    weak open var delegate: ComponentCardWatermarkDelegate?
+
     private var action: Selector?   // 点击事件
     private weak var target: AnyObject? // 对象目标
     
     public override func draw(_ dirtyRect: NSRect) {
         super.draw(dirtyRect)
-
-        
         
     }
     
@@ -70,99 +76,120 @@ public class ComponentCardWatermark: ComponentBaseXibView {
     public override func awakeFromNib() {
         super.awakeFromNib()
         
-        self.checkBoxView.properties = self.checkBoxProperty
+        checkBoxView.properties = checkBoxProperty
         
-        self.editButton.properties = self.editButtonProperty
+        editButton.properties = editButtonProperty
+        editButton.setTarget(self, action: #selector(buttonClicked(_:)))
         
-        self.deleteButton.properties = self.deleteButtonProperty
+        deleteButton.properties = deleteButtonProperty
+        deleteButton.setTarget(self, action: #selector(buttonClicked(_:)))
         
     }
     
     //MARK: - Setter and Getter
     public var properties : ComponentCardWMProperty {
         get {
-           return _properties
+            return _properties
         }
         set {
             _properties = newValue
-             
-                ComponentLibrary.shared.configCardWatermarkComponent(properties: _properties)
-           
-            self.setupUI()
-             
-            self.refreshUI()
+            
+            ComponentLibrary.shared.configCardWatermarkComponent(properties: _properties)
+            
+            setupUI()
+            
+            refreshUI()
         }
     }
-     
     
     //MARK: - SetupUI
     func setupUI() {
-
-        self.iconImage.image = self.properties.icon
-        self.infoLabel.stringValue = self.properties.text ?? ""
+        
+        iconImage.image = properties.icon
+        infoLabel.stringValue = properties.text ?? ""
+        
+        if let editIcon = properties.editIcon {
+            editButton.properties.icon = editIcon
+            editButton.reloadData()
+        }
+        
+        if let deleteIcon = properties.deleteIcon {
+            deleteButton.properties.icon = deleteIcon
+            deleteButton.reloadData()
+        }
     }
     
     func refreshUI() {
+        contendBox.cornerRadius = properties.propertyInfo.cornerRadius
         
-        self.contendBox.cornerRadius = self.properties.propertyInfo.cornerRadius
         var borderWidth: CGFloat = 0
         var borderColor: NSColor?
         var fillColor: NSColor?
         var textColor: NSColor?
         var textFont: NSFont?
         
-        if self.properties.state == .normal {
-            borderWidth = self.properties.propertyInfo.borderWidth
-            borderColor = self.properties.propertyInfo.borderColor_nor
-            fillColor = self.properties.propertyInfo.color_nor
-            textColor = self.properties.propertyInfo.textColor
-            textFont = self.properties.propertyInfo.textFont
-        } else if self.properties.state == .hover {
-            borderWidth = self.properties.propertyInfo.borderWidth_hov
-            borderColor = self.properties.propertyInfo.borderColor_hov
-            fillColor = self.properties.propertyInfo.color_hov
-            textColor = self.properties.propertyInfo.textColor_hov
-            textFont = self.properties.propertyInfo.textFont
-        } else if self.properties.state == .pressed {
-            borderWidth = self.properties.propertyInfo.borderWidth_active
-            borderColor = self.properties.propertyInfo.borderColor_active
-            fillColor = self.properties.propertyInfo.color_active
-            textColor = self.properties.propertyInfo.textColor_Active
-            textFont = self.properties.propertyInfo.textFont_active
+        if properties.state == .normal {
+            borderWidth = properties.propertyInfo.borderWidth
+            borderColor = properties.propertyInfo.borderColor_nor
+            fillColor = properties.propertyInfo.color_nor
+            textColor = properties.propertyInfo.textColor
+            textFont = properties.propertyInfo.textFont
+        } else if properties.state == .hover {
+            borderWidth = properties.propertyInfo.borderWidth_hov
+            borderColor = properties.propertyInfo.borderColor_hov
+            fillColor = properties.propertyInfo.color_hov
+            textColor = properties.propertyInfo.textColor_hov
+            textFont = properties.propertyInfo.textFont
+        } else if properties.state == .pressed {
+            borderWidth = properties.propertyInfo.borderWidth_active
+            borderColor = properties.propertyInfo.borderColor_active
+            fillColor = properties.propertyInfo.color_active
+            textColor = properties.propertyInfo.textColor_Active
+            textFont = properties.propertyInfo.textFont_active
         }
         
-        self.contendBox.borderWidth = borderWidth
+        contendBox.borderWidth = borderWidth
         if let color = borderColor {
-            self.contendBox.borderColor = color
+            contendBox.borderColor = color
         }
         if let color = fillColor {
-            self.contendBox.fillColor = color
+            contendBox.fillColor = color
         }
         if let color = textColor {
-            self.infoLabel.textColor = color
+            infoLabel.textColor = color
         }
         if let font = textFont {
-            self.infoLabel.font = font
+            infoLabel.font = font
         }
         
-        self.checkBoxView.isHidden = true
-        self.editButton.isHidden = true
-        self.deleteButton.isHidden = true
-        
-        if self.properties.state == .hover {
-            self.editButton.isHidden = false
-            self.deleteButton.isHidden = false
-        } else if self.properties.state == .pressed {
-            self.checkBoxView.isHidden = false
-            self.editButton.isHidden = false
-            self.deleteButton.isHidden = false
+        checkBoxView.isHidden = true
+        editButton.isHidden = true
+        deleteButton.isHidden = true
+        
+        if properties.state == .hover {
+            editButton.isHidden = false
+            deleteButton.isHidden = false
+        } else if properties.state == .pressed {
+            checkBoxView.properties.checkboxType = .selected
+            checkBoxView.reloadData()
+            checkBoxView.isHidden = false
+            
+            editButton.isHidden = false
+            deleteButton.isHidden = false
+        }
+    }
+    
+    @objc func buttonClicked(_ sender: ComponentButton) {
+        if sender == editButton {
+            delegate?.componentSliderDidEdit?(self)
+        } else if sender == deleteButton {
+            delegate?.componentSliderDidDelete?(self)
         }
-        
     }
     
     //MARK: - Public Method
     public func reloadData() {
-        self.refreshUI()
+        refreshUI()
         
     }
     
@@ -175,11 +202,11 @@ public class ComponentCardWatermark: ComponentBaseXibView {
     public override func mouseEntered(with event: NSEvent) {
         super.mouseEntered(with: event)
         
-        if self.properties.state != .pressed {
-            self.properties.state = .hover
+        if properties.state != .pressed {
+            properties.state = .hover
         }
         
-        self.refreshUI()
+        refreshUI()
     }
     
     public override func mouseMoved(with event: NSEvent) {
@@ -189,24 +216,17 @@ public class ComponentCardWatermark: ComponentBaseXibView {
     
     public override func mouseExited(with event: NSEvent) {
         super.mouseExited(with: event)
-            
-        if self.properties.state != .pressed {
-            self.properties.state = .normal
+        
+        if properties.state != .pressed {
+            properties.state = .normal
         }
-    
-        self.refreshUI()
+        
+        refreshUI()
     }
     
     public override func mouseDown(with event: NSEvent) {
         super.mouseDown(with: event)
         
-        if self.properties.state != .pressed {
-            self.properties.state = .pressed
-        } else {
-            self.properties.state = .hover
-        }
-        self.refreshUI()
-        
     }
     
     public override func mouseUp(with event: NSEvent) {

+ 0 - 4
PDF Office/PDF Master/Class/KMAdvertisement/Config/KMAdvertisementConfig.swift

@@ -114,15 +114,11 @@
     public var language: KMAdvertisementLanguageType = .unknow
     
     func activityBaseURL() -> String {
-        #if DEBUG
         if kTestMode == 1{
             return "http://test-store.kdan.cn:3019"
         } else {
             return "https://store.filmagepro.com:3018"
         }
-        #else
-        return "https://store.filmagepro.com:3018"
-        #endif
     }
     
     public func initParameters(appName: KMAdvertisementAppNameType, subscribeType:KMAdvertisementSubscribeType, platform: KMAdvertisementPlatformType) {

+ 0 - 2
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListViewExtension/CPDFListView+Event.m

@@ -43,8 +43,6 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
 - (void)mouseDown:(NSEvent *)theEvent {
     [self setCursorForMouse:theEvent];
     
-    return [super mouseDown:theEvent];
-    
     NSPoint point = NSZeroPoint;
     CPDFPage *page = [self pageAndPoint:&point forEvent:theEvent nearest:NO];
     if ([self.activeAnnotation isKindOfClass:[CPDFFreeTextAnnotation class]] && ([theEvent clickCount] == 1)) {

+ 4 - 2
PDF Office/PDF Master/KMClass/KMHomeViewController/Views/KMHomeOpenView/KMHomeOpenView.swift

@@ -55,7 +55,9 @@ class KMHomeOpenView: BaseXibView {
         openFileButton.properties = ComponentButtonProperty(type: .primary,
                                                             size: .m,
                                                             state: .normal,
-                                                            buttonText: KMLocalizedString("Open Files", comment: ""))
+                                                            buttonText: KMLocalizedString("Open Files"),
+                                                            keepPressState: false)
+        
         openFileButton.setTarget(self, action: #selector(openFileAction(_:)))
         
         createFileDropdown.properties = ComponentDropdownProperty(type: .default_defaultTertiary,
@@ -63,7 +65,7 @@ class KMHomeOpenView: BaseXibView {
                                                                   state: .normal,
                                                                   split: false,
                                                                   disabled: false,
-                                                                  text: KMLocalizedString("Create PDF", comment: ""))
+                                                                  text: KMLocalizedString("Create PDF"))
         createFileDropdown.componentDelegate = self
     }
     

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

@@ -6,6 +6,7 @@
 //
 
 import Cocoa
+import KMComponentLibrary
 
 @objcMembers class KMMainViewController: KMBaseViewController, NSTextFieldDelegate {
     
@@ -741,6 +742,8 @@ import Cocoa
     
     //MARK: - Watermark水印
     func showWatermarkController() {
+        listView.isHidden = true
+        
         if watermarkViewController == nil {
             watermarkViewController = KMWatermarkController.init()
         }
@@ -764,6 +767,8 @@ import Cocoa
     }
     
     func exitWatermarkController() {
+        listView.isHidden = true
+        
         watermarkViewController?.view.removeFromSuperview()
         watermarkViewController = nil
         
@@ -1004,6 +1009,18 @@ extension KMMainViewController: KMPDFToolbarControllerDelegate {
         
         refreshToolbarView()
     }
+    
+    func kmPDFToolbarControllerDidSelectTextDidBeginEditing(_ controller: KMPDFToolbarController, _ view: ComponentSelect) {
+        
+    }
+    
+    func kmPDFToolbarControllerDidSelectTextDidChange(_ controller: KMPDFToolbarController, _ view: ComponentSelect) {
+        
+    }
+    
+    func kmPDFToolbarControllerDidSelectTextDidEndEditing(_ controller: KMPDFToolbarController, _ view: ComponentSelect) {
+        
+    }
 }
 
 

+ 12 - 0
PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Watermark/watermark_edit.imageset/Contents.json

@@ -0,0 +1,12 @@
+{
+  "images" : [
+    {
+      "filename" : "watermark_edit.pdf",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 89 - 0
PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Watermark/watermark_edit.imageset/watermark_edit.pdf

@@ -0,0 +1,89 @@
+%PDF-1.7
+
+1 0 obj
+  << >>
+endobj
+
+2 0 obj
+  << /Length 3 0 R >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+1.000000 0.000000 -0.000000 1.000000 1.000000 1.000000 cm
+0.062745 0.094118 0.156863 scn
+2.000000 12.500000 m
+6.000000 12.500000 l
+6.000000 14.000000 l
+2.000000 14.000000 l
+0.895431 14.000000 0.000000 13.104569 0.000000 12.000000 c
+0.000000 2.000000 l
+0.000000 0.895431 0.895430 0.000000 2.000000 0.000000 c
+12.000000 0.000000 l
+13.104569 0.000000 14.000000 0.895431 14.000000 2.000000 c
+14.000000 6.000000 l
+12.500000 6.000000 l
+12.500000 2.000000 l
+12.500000 1.723858 12.276142 1.500000 12.000000 1.500000 c
+2.000000 1.500000 l
+1.723858 1.500000 1.500000 1.723858 1.500000 2.000000 c
+1.500000 12.000000 l
+1.500000 12.276142 1.723858 12.500000 2.000000 12.500000 c
+h
+13.898688 12.706384 m
+12.838028 13.767044 l
+4.999901 5.928917 l
+6.060561 4.868258 l
+13.898688 12.706384 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  813
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 16.000000 16.000000 ]
+     /Resources 1 0 R
+     /Contents 2 0 R
+     /Parent 5 0 R
+  >>
+endobj
+
+5 0 obj
+  << /Kids [ 4 0 R ]
+     /Count 1
+     /Type /Pages
+  >>
+endobj
+
+6 0 obj
+  << /Pages 5 0 R
+     /Type /Catalog
+  >>
+endobj
+
+xref
+0 7
+0000000000 65535 f
+0000000010 00000 n
+0000000034 00000 n
+0000000903 00000 n
+0000000925 00000 n
+0000001098 00000 n
+0000001172 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+1231
+%%EOF

+ 12 - 0
PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Watermark/watermark_template_add.imageset/Contents.json

@@ -0,0 +1,12 @@
+{
+  "images" : [
+    {
+      "filename" : "watermark_template_add.pdf",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 91 - 0
PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Watermark/watermark_template_add.imageset/watermark_template_add.pdf

@@ -0,0 +1,91 @@
+%PDF-1.7
+
+1 0 obj
+  << >>
+endobj
+
+2 0 obj
+  << /Length 3 0 R >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+1.000000 0.000000 -0.000000 1.000000 0.000000 0.000000 cm
+0.250980 0.274510 0.325490 scn
+14.500000 8.000000 m
+14.500000 4.410150 11.589850 1.500000 8.000000 1.500000 c
+4.410149 1.500000 1.500000 4.410150 1.500000 8.000000 c
+1.500000 11.589851 4.410149 14.500000 8.000000 14.500000 c
+11.589850 14.500000 14.500000 11.589851 14.500000 8.000000 c
+h
+16.000000 8.000000 m
+16.000000 3.581722 12.418278 0.000000 8.000000 0.000000 c
+3.581722 0.000000 0.000000 3.581722 0.000000 8.000000 c
+0.000000 12.418278 3.581722 16.000000 8.000000 16.000000 c
+12.418278 16.000000 16.000000 12.418278 16.000000 8.000000 c
+h
+7.250049 11.200005 m
+7.250049 8.750005 l
+4.800049 8.750005 l
+4.800049 7.250005 l
+7.250049 7.250005 l
+7.250049 4.800005 l
+8.750049 4.800005 l
+8.750049 7.250005 l
+11.200048 7.250005 l
+11.200048 8.750005 l
+8.750049 8.750005 l
+8.750049 11.200005 l
+7.250049 11.200005 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  907
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 16.000000 16.000000 ]
+     /Resources 1 0 R
+     /Contents 2 0 R
+     /Parent 5 0 R
+  >>
+endobj
+
+5 0 obj
+  << /Kids [ 4 0 R ]
+     /Count 1
+     /Type /Pages
+  >>
+endobj
+
+6 0 obj
+  << /Pages 5 0 R
+     /Type /Catalog
+  >>
+endobj
+
+xref
+0 7
+0000000000 65535 f
+0000000010 00000 n
+0000000034 00000 n
+0000000997 00000 n
+0000001019 00000 n
+0000001192 00000 n
+0000001266 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+1325
+%%EOF

+ 1 - 3
PDF Office/PDF Master/KMClass/KMPDFViewController/RightSideViews/Watermark/New/KMEditDocumentController.swift

@@ -38,9 +38,7 @@ class KMEditDocumentController: NSViewController {
     }
     
     func refreshUI() {
-        
-//        pdfView.setNeedsDisplayDraw(pdfView.currentPage())
-        pdfView.updateRender(true)
+        pdfView.layoutDocumentView()
     }
     
     

+ 21 - 3
PDF Office/PDF Master/KMClass/KMPDFViewController/RightSideViews/Watermark/New/KMWatermarkController.swift

@@ -33,9 +33,7 @@ class KMWatermarkController: NSViewController {
         propertyInfoView.addSubview(propertyController.view)
         propertyController.delegate = self
         
-//        templatesController.view.frame = propertyInfoView.bounds
-//        templatesController.view.autoresizingMask = [.width, .height]
-//        propertyInfoView.addSubview(templatesController.view)
+        templatesController.delegate = self
     }
  
     
@@ -91,4 +89,24 @@ extension KMWatermarkController: KMNWatermarkPropertyControllerDelegate {
         
     }
     
+    func watermarkPropertyControllerDidChangetoTemplate(_ controller: KMNWatermarkPropertyController) {
+        propertyController.view.isHidden = true
+        
+        templatesController.view.frame = propertyInfoView.bounds
+        templatesController.view.autoresizingMask = [.width, .height]
+        propertyInfoView.addSubview(templatesController.view)
+
+    }
+    
+}
+
+extension KMWatermarkController: KMNWatermarkTemplateControllerDelegate {
+    func templateControllerDidAddWatermarkData(_ controller: KMNWatermarkTemplateController) {
+        
+    }
+    
+    func templateControllerDidEditWatermarkData(_ controller: KMNWatermarkTemplateController, _ watermark: KMPDFWatermarkData) {
+        
+    }
 }
+ 

+ 7 - 1
PDF Office/PDF Master/KMClass/KMPDFViewController/RightSideViews/Watermark/New/Views/KMNWatermarkPropertyController.swift

@@ -11,6 +11,8 @@ import KMComponentLibrary
 @objc protocol KMNWatermarkPropertyControllerDelegate: AnyObject {
     
     @objc optional func watermarkPropertyControllerDidUpdate(_ controller: KMNWatermarkPropertyController)
+    
+    @objc optional func watermarkPropertyControllerDidChangetoTemplate(_ controller: KMNWatermarkPropertyController)
  
 }
 
@@ -90,6 +92,7 @@ class KMNWatermarkPropertyController: NSViewController {
         titleLabel.font = ComponentLibrary.shared.getFontFromKey("mac/body-m-bold")
         
         templateButton.properties = ComponentButtonProperty(type: .text_gray, size: .xxs, onlyIcon: true, icon: NSImage(named: "icon_wm_template"), keepPressState: false)
+        templateButton.setTarget(self, action: #selector(templateButtonClicked(_:)))
         
         typeTabs.updateItemProperty([textTabProperty, fileTabProperty])
         typeTabs.delegate = self
@@ -345,6 +348,10 @@ class KMNWatermarkPropertyController: NSViewController {
     
     
     //MARK: - Action
+    @objc func templateButtonClicked(_ sender: ComponentButton) {
+        delegate?.watermarkPropertyControllerDidChangetoTemplate?(self)
+    }
+    
     @objc func checkBoxClicked(_ sender: ComponentCheckBox) {
         if sender == appearanceScaleCheckbox {
             watermarkModel.isScale = appearanceScaleCheckbox.properties.checkboxType == .selected ? true : false
@@ -368,7 +375,6 @@ class KMNWatermarkPropertyController: NSViewController {
         delegate?.watermarkPropertyControllerDidUpdate?(self)
     }
     
-    
     @objc func saveButtonClicked(_ sender: ComponentButton) {
         KMWatermarkManager.defaultManager.addWatermark(watermark: watermarkModel)
     }

+ 49 - 0
PDF Office/PDF Master/KMClass/KMPDFViewController/RightSideViews/Watermark/New/Views/KMWatermarkToolbar.swift

@@ -0,0 +1,49 @@
+//
+//  KMWatermarkToolbar.swift
+//  PDF Reader Pro
+//
+//  Created by Niehaoyu on 2024/11/5.
+//
+
+import Cocoa
+import KMComponentLibrary
+
+class KMWatermarkToolbar: NSViewController {
+
+    @IBOutlet var contendView: NSView!
+    
+    @IBOutlet var titleLabel: NSTextField!
+    @IBOutlet var pageSelectView: ComponentSelect!
+    @IBOutlet var sepDivider: ComponentDivider!
+    @IBOutlet var templateButton: ComponentButton!
+    @IBOutlet var addButton: ComponentButton!
+    @IBOutlet var batchButton: ComponentButton!
+    
+    @IBOutlet var applyButton: ComponentButton!
+    @IBOutlet var exitButton: ComponentButton!
+    
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        // Do view setup here.
+        
+        setupProperty()
+    }
+    
+    func setupProperty() {
+        titleLabel.stringValue = KMLocalizedString("Add Watermark")
+        titleLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("colorText/1")
+        titleLabel.font = ComponentLibrary.shared.getFontFromKey("mac/body-m-medium")
+        
+        templateButton.properties = ComponentButtonProperty(type: .text_gray_opacity, size: .xs, showLeftIcon: true, buttonText: KMLocalizedString("Templates"), icon: NSImage(named: "icon_wm_template"))
+        
+        addButton.properties = ComponentButtonProperty(type: .text_gray_opacity, size: .xs, showLeftIcon: true, buttonText: KMLocalizedString("Add Watermark"), icon: NSImage(named: "toolbar_plus"))
+        
+        batchButton.properties = ComponentButtonProperty(type: .text_gray_opacity, size: .xs, showLeftIcon: true, buttonText: KMLocalizedString("Batch"), icon: NSImage(named: "tools_batch"), keepPressState: false)
+        
+        applyButton.properties = ComponentButtonProperty(type: .primary, size: .xs, buttonText: KMLocalizedString("Apply"), keepPressState: false)
+        
+        exitButton.properties = ComponentButtonProperty(type: .default_tertiary, size: .xs, buttonText: KMLocalizedString("Exit"), keepPressState: false)
+        
+    }
+    
+}

+ 130 - 0
PDF Office/PDF Master/KMClass/KMPDFViewController/RightSideViews/Watermark/New/Views/KMWatermarkToolbar.xib

@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner" customClass="KMWatermarkToolbar" customModule="PDF_Reader_Pro" customModuleProvider="target">
+            <connections>
+                <outlet property="addButton" destination="zB0-WI-wRM" id="nLU-hb-OGg"/>
+                <outlet property="applyButton" destination="nhn-br-DcX" id="Jxl-eC-byl"/>
+                <outlet property="batchButton" destination="crt-PJ-kqP" id="onL-Rc-f2m"/>
+                <outlet property="contendView" destination="nwS-qg-oX3" id="u8n-nS-qnM"/>
+                <outlet property="exitButton" destination="PNU-U6-9TC" id="xBC-GQ-Ueh"/>
+                <outlet property="pageSelectView" destination="8Ba-BS-FWr" id="Lxb-jr-xlP"/>
+                <outlet property="sepDivider" destination="q3T-4u-jHu" id="UYs-kX-cFn"/>
+                <outlet property="templateButton" destination="p4t-zA-6cC" id="0gm-j3-wgA"/>
+                <outlet property="titleLabel" destination="w8E-ki-8er" id="gsk-bG-M5P"/>
+                <outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
+            </connections>
+        </customObject>
+        <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="1071" height="28"/>
+            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+            <subviews>
+                <customView translatesAutoresizingMaskIntoConstraints="NO" id="nwS-qg-oX3">
+                    <rect key="frame" x="0.0" y="0.0" width="1071" height="28"/>
+                    <subviews>
+                        <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="w8E-ki-8er">
+                            <rect key="frame" x="14" y="6" width="37" height="16"/>
+                            <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="xTC-es-R8r">
+                                <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="gMY-5j-MQM">
+                            <rect key="frame" x="276" y="0.0" width="520" height="28"/>
+                            <subviews>
+                                <customView translatesAutoresizingMaskIntoConstraints="NO" id="8Ba-BS-FWr" customClass="ComponentSelect" customModule="KMComponentLibrary">
+                                    <rect key="frame" x="0.0" y="0.0" width="144" height="28"/>
+                                    <constraints>
+                                        <constraint firstAttribute="width" constant="144" id="270-Gl-tKg"/>
+                                        <constraint firstAttribute="height" constant="28" id="hli-m8-PhO"/>
+                                    </constraints>
+                                </customView>
+                                <customView translatesAutoresizingMaskIntoConstraints="NO" id="q3T-4u-jHu" customClass="ComponentDivider" customModule="KMComponentLibrary">
+                                    <rect key="frame" x="156" y="6" width="1" height="16"/>
+                                    <constraints>
+                                        <constraint firstAttribute="height" constant="16" id="7i9-Dg-glP"/>
+                                        <constraint firstAttribute="width" constant="1" id="Tjh-gJ-SBp"/>
+                                    </constraints>
+                                </customView>
+                                <customView translatesAutoresizingMaskIntoConstraints="NO" id="p4t-zA-6cC" customClass="ComponentButton" customModule="KMComponentLibrary">
+                                    <rect key="frame" x="168" y="0.0" width="108" height="28"/>
+                                    <constraints>
+                                        <constraint firstAttribute="width" constant="108" id="AVx-nG-fSZ"/>
+                                        <constraint firstAttribute="height" constant="28" id="F2Q-aY-U4q"/>
+                                    </constraints>
+                                </customView>
+                                <customView translatesAutoresizingMaskIntoConstraints="NO" id="zB0-WI-wRM" customClass="ComponentButton" customModule="KMComponentLibrary">
+                                    <rect key="frame" x="288" y="0.0" width="143" height="28"/>
+                                    <constraints>
+                                        <constraint firstAttribute="width" constant="143" id="3ga-l3-uIg"/>
+                                        <constraint firstAttribute="height" constant="28" id="cty-xN-dwd"/>
+                                    </constraints>
+                                </customView>
+                                <customView translatesAutoresizingMaskIntoConstraints="NO" id="crt-PJ-kqP" customClass="ComponentButton" customModule="KMComponentLibrary">
+                                    <rect key="frame" x="443" y="0.0" width="78" height="28"/>
+                                    <constraints>
+                                        <constraint firstAttribute="width" constant="78" id="4Qp-2p-1rg"/>
+                                        <constraint firstAttribute="height" constant="28" id="JUl-1s-ccl"/>
+                                    </constraints>
+                                </customView>
+                            </subviews>
+                            <constraints>
+                                <constraint firstItem="q3T-4u-jHu" firstAttribute="leading" secondItem="8Ba-BS-FWr" secondAttribute="trailing" constant="12" id="034-vd-9Vb"/>
+                                <constraint firstItem="8Ba-BS-FWr" firstAttribute="leading" secondItem="gMY-5j-MQM" secondAttribute="leading" id="3T3-9M-9sG"/>
+                                <constraint firstItem="8Ba-BS-FWr" firstAttribute="centerY" secondItem="gMY-5j-MQM" secondAttribute="centerY" id="56R-0X-gxA"/>
+                                <constraint firstItem="p4t-zA-6cC" firstAttribute="leading" secondItem="8Ba-BS-FWr" secondAttribute="trailing" constant="24" id="C7z-go-ZUn"/>
+                                <constraint firstItem="zB0-WI-wRM" firstAttribute="centerY" secondItem="gMY-5j-MQM" secondAttribute="centerY" id="Jkx-jb-ScA"/>
+                                <constraint firstItem="crt-PJ-kqP" firstAttribute="leading" secondItem="zB0-WI-wRM" secondAttribute="trailing" constant="12" id="Vz7-Hm-ryi"/>
+                                <constraint firstItem="zB0-WI-wRM" firstAttribute="leading" secondItem="p4t-zA-6cC" secondAttribute="trailing" constant="12" id="WgN-eW-LuZ"/>
+                                <constraint firstAttribute="width" constant="520" id="fi7-hE-SrT"/>
+                                <constraint firstItem="crt-PJ-kqP" firstAttribute="centerY" secondItem="gMY-5j-MQM" secondAttribute="centerY" id="hgP-8r-WKM"/>
+                                <constraint firstItem="p4t-zA-6cC" firstAttribute="centerY" secondItem="gMY-5j-MQM" secondAttribute="centerY" id="nMN-M4-A7L"/>
+                                <constraint firstItem="q3T-4u-jHu" firstAttribute="centerY" secondItem="gMY-5j-MQM" secondAttribute="centerY" id="zhq-4V-cEK"/>
+                            </constraints>
+                        </customView>
+                        <customView translatesAutoresizingMaskIntoConstraints="NO" id="nhn-br-DcX" customClass="ComponentButton" customModule="KMComponentLibrary">
+                            <rect key="frame" x="863" y="0.0" width="92" height="28"/>
+                            <constraints>
+                                <constraint firstAttribute="width" constant="92" id="OXT-xa-KmN"/>
+                                <constraint firstAttribute="height" constant="28" id="aw8-ix-w9m"/>
+                            </constraints>
+                        </customView>
+                        <customView translatesAutoresizingMaskIntoConstraints="NO" id="PNU-U6-9TC" customClass="ComponentButton" customModule="KMComponentLibrary">
+                            <rect key="frame" x="963" y="0.0" width="92" height="28"/>
+                            <constraints>
+                                <constraint firstAttribute="width" constant="92" id="Fu5-XY-e1c"/>
+                                <constraint firstAttribute="height" constant="28" id="jv0-Sn-Rpk"/>
+                            </constraints>
+                        </customView>
+                    </subviews>
+                    <constraints>
+                        <constraint firstItem="PNU-U6-9TC" firstAttribute="centerY" secondItem="nwS-qg-oX3" secondAttribute="centerY" id="9mN-th-de4"/>
+                        <constraint firstAttribute="trailing" secondItem="PNU-U6-9TC" secondAttribute="trailing" constant="16" id="DEh-MU-g80"/>
+                        <constraint firstItem="gMY-5j-MQM" firstAttribute="centerX" secondItem="nwS-qg-oX3" secondAttribute="centerX" id="N68-xO-hfG"/>
+                        <constraint firstItem="nhn-br-DcX" firstAttribute="centerY" secondItem="nwS-qg-oX3" secondAttribute="centerY" id="Puq-68-jHs"/>
+                        <constraint firstItem="w8E-ki-8er" firstAttribute="centerY" secondItem="nwS-qg-oX3" secondAttribute="centerY" id="grp-PP-D25"/>
+                        <constraint firstItem="PNU-U6-9TC" firstAttribute="leading" secondItem="nhn-br-DcX" secondAttribute="trailing" constant="8" id="hur-3w-VBy"/>
+                        <constraint firstItem="w8E-ki-8er" firstAttribute="leading" secondItem="nwS-qg-oX3" secondAttribute="leading" constant="16" id="lNF-hl-ovF"/>
+                        <constraint firstItem="gMY-5j-MQM" firstAttribute="top" secondItem="nwS-qg-oX3" secondAttribute="top" id="mOw-uh-wjZ"/>
+                        <constraint firstAttribute="bottom" secondItem="gMY-5j-MQM" secondAttribute="bottom" id="yeR-L4-nVQ"/>
+                    </constraints>
+                </customView>
+            </subviews>
+            <constraints>
+                <constraint firstItem="nwS-qg-oX3" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" id="JYk-LM-JQj"/>
+                <constraint firstAttribute="bottom" secondItem="nwS-qg-oX3" secondAttribute="bottom" id="qEX-jx-sJj"/>
+                <constraint firstAttribute="trailing" secondItem="nwS-qg-oX3" secondAttribute="trailing" id="trc-0r-lyj"/>
+                <constraint firstItem="nwS-qg-oX3" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" id="v0e-2U-EUI"/>
+            </constraints>
+            <point key="canvasLocation" x="302.5" y="8"/>
+        </customView>
+    </objects>
+</document>

PDF Office/PDF Master/KMClass/KMPDFViewController/RightSideViews/Watermark/New/Views/KMPDFWatermarkData.swift → PDF Office/PDF Master/KMClass/KMPDFViewController/RightSideViews/Watermark/New/Views/Model/KMPDFWatermarkData.swift


+ 18 - 8
PDF Office/PDF Master/KMClass/KMPDFViewController/RightSideViews/Watermark/New/Views/KMWatermarkManager.swift

@@ -65,7 +65,11 @@ class KMWatermarkManager: NSObject {
                 let model = parseDictionary(dict: watermarkDict)
                 self.watermarks.append(model)
             }
-            self.watermarks.sort(){$0.tag > $1.tag}   
+            self.watermarks.sort(){$0.tag > $1.tag}
+            
+#if DEBUG
+            print("watermarkPlistPath=\(watermarkPlistPath ?? "")")
+#endif
         }
     }
     
@@ -101,9 +105,13 @@ class KMWatermarkManager: NSObject {
             return false
         }
         
-        let tag = NSString.tagString()
-        newDict.addEntries(from: [tag : watermarkDict])
-        watermark.tag = tag
+        let key: String = watermark.tag
+        if newDict.object(forKey: key) != nil {
+            newDict.setObject(watermarkDict, forKey: key as NSCopying)
+        } else {
+            newDict.addEntries(from: [key : watermarkDict])
+        }
+        
         let result = newDict.write(toFile: watermarkPlistPath!, atomically: true)
         if (result) {
             if (self.watermarks.count < 1) {
@@ -340,12 +348,14 @@ class KMWatermarkManager: NSObject {
         model.fontStyle = (dict.object(forKey: KMWatermarkKey.textfontStyle.rawValue) as? String) ?? ""
         model.fontSize = (dict.object(forKey: KMWatermarkKey.textFontSize.rawValue) as? CGFloat) ?? 12
  
-        
-        let path = watermarkFolderPath?.stringByAppendingPathComponent(dict.object(forKey: KMWatermarkKey.imagePath.rawValue) as! String)
-        if (FileManager.default.fileExists(atPath: path!)) {
-            model.imagePath = path ?? ""
+        if let pathValue = dict.object(forKey: KMWatermarkKey.imagePath.rawValue) {
+            let path = watermarkFolderPath?.stringByAppendingPathComponent(pathValue as! String)
+            if (FileManager.default.fileExists(atPath: path!)) {
+                model.imagePath = path ?? ""
+            }
         }
         
+        
         model.isScale = (dict.object(forKey: KMWatermarkKey.isScale.rawValue) as? Bool) ?? false
         model.scale = (dict.object(forKey: KMWatermarkKey.scale.rawValue) as? CGFloat) ?? 1
         model.rotation = dict.object(forKey: KMWatermarkKey.rotate.rawValue) as? CGFloat ?? 0

+ 73 - 9
PDF Office/PDF Master/KMClass/KMPDFViewController/RightSideViews/Watermark/New/Views/Templates/KMNWatermarkTemplateController.swift

@@ -6,26 +6,48 @@
 //
 
 import Cocoa
+import KMComponentLibrary
 
-class KMNWatermarkTemplateController: NSViewController {
+@objc protocol KMNWatermarkTemplateControllerDelegate: AnyObject {
+    
+    @objc optional func templateControllerDidAddWatermarkData(_ controller: KMNWatermarkTemplateController)
+    
+    @objc optional func templateControllerDidEditWatermarkData(_ controller: KMNWatermarkTemplateController, _ watermark: KMPDFWatermarkData)
+ 
+}
 
+class KMNWatermarkTemplateController: NSViewController {
+ 
+    @IBOutlet var contendView: NSView!
+    @IBOutlet var titleLabel: NSTextField!
+    @IBOutlet var addButton: ComponentButton!
+    
     
     @IBOutlet var scrollView: NSScrollView!
     @IBOutlet var collectionView: NSCollectionView!
     
+    weak open var delegate: KMNWatermarkTemplateControllerDelegate?
+
     override func viewDidLoad() {
         super.viewDidLoad()
         // Do view setup here.
         
+        configUI()
+        
         reloadData()
     }
     
     func setupProperty() {
         
+        addButton.properties = ComponentButtonProperty(type: .text_gray, size: .xxs, onlyIcon: true, icon: NSImage(named: "watermark_template_add"), keepPressState: false)
+        addButton.setTarget(self, action: #selector(buttonClicked(_:)))
+        
     }
-     
-    
+      
     func configUI() {
+        
+        view.wantsLayer = true
+        view.layer?.backgroundColor = ComponentLibrary.shared.getComponentColorFromKey("colorBg/layout-middle").cgColor
          
         collectionView.backgroundColors = [NSColor.clear]
         collectionView.wantsLayer = true
@@ -39,12 +61,16 @@ class KMNWatermarkTemplateController: NSViewController {
     
     //刷新所有数据
     public func reloadData() {
-        
-        
-        
+         
         collectionView.reloadData()
         
     }
+    
+    @objc func buttonClicked(_ sender: ComponentButton) {
+        if sender == addButton {
+            delegate?.templateControllerDidAddWatermarkData?(self)
+        }
+    }
 }
 
 
@@ -61,10 +87,10 @@ extension KMNWatermarkTemplateController: NSCollectionViewDelegate, NSCollection
         }
         
         let item: KMNWatermarkTemplateItem = collectionView.makeItem(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "KMNWatermarkTemplateItem"), for: indexPath) as! KMNWatermarkTemplateItem
-
+        item.delegate = self
+        item.watermark = KMWatermarkManager.defaultManager.watermarks[indexPath.item]
+        
         return item
-         
-        return NSCollectionViewItem()
     }
     
     public func collectionView(_ collectionView: NSCollectionView, layout collectionViewLayout: NSCollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> NSSize {
@@ -72,6 +98,17 @@ extension KMNWatermarkTemplateController: NSCollectionViewDelegate, NSCollection
         return CGSize(width: 168, height: 237)
     }
      
+    func collectionView(_ collectionView: NSCollectionView, layout collectionViewLayout: NSCollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat {
+        return 8
+    }
+    
+    func collectionView(_ collectionView: NSCollectionView, layout collectionViewLayout: NSCollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat {
+        return 8
+    }
+    
+    func collectionView(_ collectionView: NSCollectionView, layout collectionViewLayout: NSCollectionViewLayout, insetForSectionAt section: Int) -> NSEdgeInsets {
+        return NSEdgeInsets(top: 8, left: 0, bottom: 8, right: 0)
+    }
     
     public func collectionView(_ collectionView: NSCollectionView, didSelectItemsAt indexPaths: Set<IndexPath>) {
 
@@ -82,3 +119,30 @@ extension KMNWatermarkTemplateController: NSCollectionViewDelegate, NSCollection
     }
     
 }
+
+//MARK: - kmNWatermarkTemplateItemDelegate
+extension KMNWatermarkTemplateController: kmNWatermarkTemplateItemDelegate {
+    func kmNWatermarkTemplateItemDidEdit(_ view: KMNWatermarkTemplateItem) {
+        if let watermark = view.watermark {
+            delegate?.templateControllerDidEditWatermarkData?(self, watermark)
+        }
+    }
+    
+    func kmNWatermarkTemplateItemDidDelete(_ view: KMNWatermarkTemplateItem) {
+        if let watermark = view.watermark {
+            let alert = NSAlert()
+            alert.alertStyle = .critical
+            alert.messageText = String(format: KMLocalizedString("Are you sure you want to remove the watermark?"))
+            alert.addButton(withTitle: KMLocalizedString("Delete"))
+            alert.addButton(withTitle: KMLocalizedString("Cancel"))
+            
+            alert.beginSheetModal(for: NSApp.mainWindow!) { (response) in
+                if response == .alertFirstButtonReturn {
+                    KMWatermarkManager.defaultManager.removeWatermark(watermark: watermark)
+                    
+                    self.reloadData()
+                }
+            }
+        }
+    }
+}

+ 5 - 0
PDF Office/PDF Master/KMClass/KMPDFViewController/RightSideViews/Watermark/New/Views/Templates/KMNWatermarkTemplateController.xib

@@ -8,6 +8,11 @@
     <objects>
         <customObject id="-2" userLabel="File's Owner" customClass="KMNWatermarkTemplateController" customModule="PDF_Reader_Pro" customModuleProvider="target">
             <connections>
+                <outlet property="addButton" destination="hsJ-js-mMa" id="AWd-9f-mNi"/>
+                <outlet property="collectionView" destination="hJc-Et-79J" id="Pra-6L-sb8"/>
+                <outlet property="contendView" destination="jGd-4K-rX2" id="gxt-OZ-oKG"/>
+                <outlet property="scrollView" destination="Qjb-H8-5lF" id="yV7-te-Yc3"/>
+                <outlet property="titleLabel" destination="eD9-Wi-qDA" id="YIx-pA-QDh"/>
                 <outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
             </connections>
         </customObject>

+ 50 - 0
PDF Office/PDF Master/KMClass/KMPDFViewController/RightSideViews/Watermark/New/Views/Templates/KMNWatermarkTemplateItem.swift

@@ -6,12 +6,62 @@
 //
 
 import Cocoa
+import KMComponentLibrary
+
+@objc protocol kmNWatermarkTemplateItemDelegate: AnyObject {
+    
+    @objc optional func kmNWatermarkTemplateItemDidEdit(_ view: KMNWatermarkTemplateItem)
+    
+    @objc optional func kmNWatermarkTemplateItemDidDelete(_ view: KMNWatermarkTemplateItem)
+ 
+}
 
 class KMNWatermarkTemplateItem: NSCollectionViewItem {
 
+    @IBOutlet var watermarkItem: ComponentCardWatermark!
+
+    var watermark: KMPDFWatermarkData?
+    
+    weak open var delegate: kmNWatermarkTemplateItemDelegate?
+
+    var watermarkProperty: ComponentCardWMProperty = ComponentCardWMProperty(state: .normal, icon: nil, text: "Sample Text", editIcon: NSImage(named: "watermark_edit"), deleteIcon: NSImage(named: "pageEdit_delete"))
+    
     override func viewDidLoad() {
         super.viewDidLoad()
         // Do view setup here.
+         
+        watermarkItem.properties = watermarkProperty
+        watermarkItem.delegate = self
+        
+    }
+    
+    //Setter
+    override var isSelected: Bool {
+        get{
+            return super.isSelected
+        }
+        set{
+            super.isSelected = newValue
+
+            reloadData()
+        }
     }
     
+    func reloadData() {
+        watermarkItem.properties.state = isSelected ? .pressed : .normal
+        watermarkItem.reloadData()
+        
+    }
+}
+
+
+//MARK: - ComponentCardWatermarkDelegate
+extension KMNWatermarkTemplateItem: ComponentCardWatermarkDelegate {
+    func componentSliderDidEdit(_ view: ComponentCardWatermark) {
+        delegate?.kmNWatermarkTemplateItemDidEdit?(self)
+    }
+    
+    func componentSliderDidDelete(_ view: ComponentCardWatermark) {
+        delegate?.kmNWatermarkTemplateItemDidDelete?(self)
+    }
 }

+ 31 - 5
PDF Office/PDF Master/KMClass/KMPDFViewController/RightSideViews/Watermark/New/Views/Templates/KMNWatermarkTemplateItem.xib

@@ -1,19 +1,45 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11134" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11134"/>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
-        <customObject id="-2" userLabel="File's Owner" customClass="KMNWatermarkTemplateItem" customModuleProvider="target">
+        <customObject id="-2" userLabel="File's Owner" customClass="KMNWatermarkTemplateItem" customModule="PDF_Reader_Pro" customModuleProvider="target">
             <connections>
                 <outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
+                <outlet property="watermarkItem" destination="6On-EJ-1D2" id="w9X-Ch-bE1"/>
             </connections>
         </customObject>
         <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="480" height="272"/>
+            <rect key="frame" x="0.0" y="0.0" width="177" height="252"/>
             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+            <subviews>
+                <customView translatesAutoresizingMaskIntoConstraints="NO" id="g8x-Ly-b4j">
+                    <rect key="frame" x="0.0" y="0.0" width="177" height="252"/>
+                    <subviews>
+                        <customView translatesAutoresizingMaskIntoConstraints="NO" id="6On-EJ-1D2" customClass="ComponentCardWatermark" customModule="KMComponentLibrary">
+                            <rect key="frame" x="0.0" y="0.0" width="177" height="252"/>
+                        </customView>
+                    </subviews>
+                    <constraints>
+                        <constraint firstAttribute="trailing" secondItem="6On-EJ-1D2" secondAttribute="trailing" id="VV0-A9-E0z"/>
+                        <constraint firstItem="6On-EJ-1D2" firstAttribute="top" secondItem="g8x-Ly-b4j" secondAttribute="top" id="cnw-a2-Nm6"/>
+                        <constraint firstAttribute="bottom" secondItem="6On-EJ-1D2" secondAttribute="bottom" id="h4h-0A-MsR"/>
+                        <constraint firstItem="6On-EJ-1D2" firstAttribute="leading" secondItem="g8x-Ly-b4j" secondAttribute="leading" id="hTK-xk-hmR"/>
+                    </constraints>
+                </customView>
+            </subviews>
+            <constraints>
+                <constraint firstItem="g8x-Ly-b4j" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" id="GS2-K0-3Ef"/>
+                <constraint firstItem="g8x-Ly-b4j" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" id="Pno-b8-3gv"/>
+                <constraint firstAttribute="bottom" secondItem="g8x-Ly-b4j" secondAttribute="bottom" id="VKD-94-G9a"/>
+                <constraint firstAttribute="trailing" secondItem="g8x-Ly-b4j" secondAttribute="trailing" id="vVc-jV-WAe"/>
+            </constraints>
+            <point key="canvasLocation" x="-53.5" y="104"/>
         </customView>
     </objects>
 </document>

+ 19 - 0
PDF Office/PDF Master/KMClass/KMPDFViewController/Toolbar/KMPDFSecToolbarController.swift

@@ -12,6 +12,13 @@ import KMComponentLibrary
     
     @objc optional func kmPDFSecToolbarControllerDidItemClicked(_ controller: KMPDFSecToolbarController, _ property: Any)
  
+    @objc optional func kmPDFSecToolbarControllerDidSelectTextDidBeginEditing(_ controller: KMPDFSecToolbarController, _ view: ComponentSelect)
+ 
+    @objc optional func kmPDFSecToolbarControllerDidSelectTextDidChange(_ controller: KMPDFSecToolbarController, _ view: ComponentSelect)
+ 
+    @objc optional func kmPDFSecToolbarControllerDidSelectTextDidEndEditing(_ controller: KMPDFSecToolbarController, _ view: ComponentSelect)
+ 
+    
 }
 
 class KMPDFSecToolbarController: NSViewController {
@@ -301,4 +308,16 @@ extension KMPDFSecToolbarController: ComponentSelectDelegate {
             delegate?.kmPDFSecToolbarControllerDidItemClicked?(self, property)
         }
     }
+    
+    func componentSelectTextDidBeginEditing(_ view: ComponentSelect) {
+        delegate?.kmPDFSecToolbarControllerDidSelectTextDidBeginEditing?(self, view)
+    }
+    
+    func componentSelectTextDidChange(_ view: ComponentSelect) {
+        delegate?.kmPDFSecToolbarControllerDidSelectTextDidChange?(self, view)
+    }
+    
+    func componentSelectTextDidEndEditing(_ view: ComponentSelect) {
+        delegate?.kmPDFSecToolbarControllerDidSelectTextDidEndEditing?(self, view)
+    }
 }

+ 19 - 0
PDF Office/PDF Master/KMClass/KMPDFViewController/Toolbar/KMPDFToolbarController.swift

@@ -12,6 +12,13 @@ import KMComponentLibrary
     
     @objc optional func kmPDFToolbarControllerDidToolbarItemClicked(_ controller: KMPDFToolbarController, _ itemIdentifier: String)
     
+    @objc optional func kmPDFToolbarControllerDidSelectTextDidBeginEditing(_ controller: KMPDFToolbarController, _ view: ComponentSelect)
+ 
+    @objc optional func kmPDFToolbarControllerDidSelectTextDidChange(_ controller: KMPDFToolbarController, _ view: ComponentSelect)
+ 
+    @objc optional func kmPDFToolbarControllerDidSelectTextDidEndEditing(_ controller: KMPDFToolbarController, _ view: ComponentSelect)
+ 
+    
 }
 
 class KMPDFToolbarController: NSViewController {
@@ -843,6 +850,18 @@ extension KMPDFToolbarController: KMPDFSecToolbarControllerDelegate {
             
         }
     }
+    
+    func kmPDFSecToolbarControllerDidSelectTextDidBeginEditing(_ controller: KMPDFSecToolbarController, _ view: ComponentSelect) {
+        delegate?.kmPDFToolbarControllerDidSelectTextDidBeginEditing?(self, view)
+    }
+    
+    func kmPDFSecToolbarControllerDidSelectTextDidChange(_ controller: KMPDFSecToolbarController, _ view: ComponentSelect) {
+        delegate?.kmPDFToolbarControllerDidSelectTextDidChange?(self, view)
+    }
+    
+    func kmPDFSecToolbarControllerDidSelectTextDidEndEditing(_ controller: KMPDFSecToolbarController, _ view: ComponentSelect) {
+        delegate?.kmPDFToolbarControllerDidSelectTextDidEndEditing?(self, view)
+    }
 }
 
 //MARK: - ComponentGroupDelegate:右侧工具栏

+ 11 - 2
PDF Office/PDF Master/KMClass/Tools/Category/NSImage+QuickLook.swift

@@ -10,11 +10,20 @@ import QuickLook
 
 @objc extension NSImage {
     static func previewForFile(path fileURL: URL, ofSize size: CGSize, asIcon: Bool) -> NSImage? {
-        
+//        return nil
+//        
         let dict = [
-            kQLThumbnailOptionIconModeKey: NSNumber(booleanLiteral: asIcon)
+            kQLThumbnailOptionIconModeKey: NSNumber(booleanLiteral: false)
         ] as CFDictionary
         
+        let url = fileURL
+        AppSandboxFileAccess().persistPermissionURL(url as URL)
+        let bookmarkData = try?url.bookmarkData(options: NSURL.BookmarkCreationOptions.withSecurityScope, includingResourceValuesForKeys: nil, relativeTo: nil)
+        if bookmarkData != nil {
+            AppSandboxFileAccess().bookmarkPersistanceDelegate.setBookmarkData(bookmarkData! as Data, for: url as URL)
+            AppSandboxFileAccess().bookmarkPersistanceDelegate.setBookmarkData(bookmarkData! as Data, for: NSURL(fileURLWithPath: url.path) as URL)
+        }
+        
         let ref = QLThumbnailImageCreate(kCFAllocatorDefault, fileURL as CFURL, size, dict)
         if let cgImage = ref?.takeUnretainedValue() {
             let imageSize: NSSize = NSSize(width: CGFloat(cgImage.width), height: CGFloat(cgImage.height))

+ 26 - 2
PDF Office/PDF Reader Pro.xcodeproj/project.pbxproj

@@ -2898,6 +2898,12 @@
 		BB10FAF62AFE2C2900F18D65 /* KMNumberArrayFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB10FAF52AFE2C2900F18D65 /* KMNumberArrayFormatter.swift */; };
 		BB10FAF72AFE2C2900F18D65 /* KMNumberArrayFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB10FAF52AFE2C2900F18D65 /* KMNumberArrayFormatter.swift */; };
 		BB10FAF82AFE2C2900F18D65 /* KMNumberArrayFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB10FAF52AFE2C2900F18D65 /* KMNumberArrayFormatter.swift */; };
+		BB11F0EE2CD9BCE3007656E4 /* KMWatermarkToolbar.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB11F0EC2CD9BCE3007656E4 /* KMWatermarkToolbar.swift */; };
+		BB11F0EF2CD9BCE3007656E4 /* KMWatermarkToolbar.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB11F0EC2CD9BCE3007656E4 /* KMWatermarkToolbar.swift */; };
+		BB11F0F02CD9BCE3007656E4 /* KMWatermarkToolbar.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB11F0EC2CD9BCE3007656E4 /* KMWatermarkToolbar.swift */; };
+		BB11F0F12CD9BCE3007656E4 /* KMWatermarkToolbar.xib in Resources */ = {isa = PBXBuildFile; fileRef = BB11F0ED2CD9BCE3007656E4 /* KMWatermarkToolbar.xib */; };
+		BB11F0F22CD9BCE3007656E4 /* KMWatermarkToolbar.xib in Resources */ = {isa = PBXBuildFile; fileRef = BB11F0ED2CD9BCE3007656E4 /* KMWatermarkToolbar.xib */; };
+		BB11F0F32CD9BCE4007656E4 /* KMWatermarkToolbar.xib in Resources */ = {isa = PBXBuildFile; fileRef = BB11F0ED2CD9BCE3007656E4 /* KMWatermarkToolbar.xib */; };
 		BB13314E2AD78DC0008F6791 /* KMPDFMergeSizeTabelViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB13314D2AD78DC0008F6791 /* KMPDFMergeSizeTabelViewCell.swift */; };
 		BB13314F2AD78DC0008F6791 /* KMPDFMergeSizeTabelViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB13314D2AD78DC0008F6791 /* KMPDFMergeSizeTabelViewCell.swift */; };
 		BB1331502AD78DC0008F6791 /* KMPDFMergeSizeTabelViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB13314D2AD78DC0008F6791 /* KMPDFMergeSizeTabelViewCell.swift */; };
@@ -7040,6 +7046,8 @@
 		BB10FAED2AFE233C00F18D65 /* KMLineInspector.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMLineInspector.swift; sourceTree = "<group>"; };
 		BB10FAF12AFE23BE00F18D65 /* LineInspector.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = LineInspector.xib; sourceTree = "<group>"; };
 		BB10FAF52AFE2C2900F18D65 /* KMNumberArrayFormatter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMNumberArrayFormatter.swift; sourceTree = "<group>"; };
+		BB11F0EC2CD9BCE3007656E4 /* KMWatermarkToolbar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMWatermarkToolbar.swift; sourceTree = "<group>"; };
+		BB11F0ED2CD9BCE3007656E4 /* KMWatermarkToolbar.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMWatermarkToolbar.xib; sourceTree = "<group>"; };
 		BB13314D2AD78DC0008F6791 /* KMPDFMergeSizeTabelViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMPDFMergeSizeTabelViewCell.swift; sourceTree = "<group>"; };
 		BB1331532AD7A6A1008F6791 /* KMFileAttribute.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMFileAttribute.swift; sourceTree = "<group>"; };
 		BB135C2929B6CD9A00FD5965 /* KMTools.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMTools.swift; sourceTree = "<group>"; };
@@ -11943,6 +11951,15 @@
 			path = LineInspector;
 			sourceTree = "<group>";
 		};
+		BB11F0EA2CD9BCC8007656E4 /* Model */ = {
+			isa = PBXGroup;
+			children = (
+				BB162E9A295073B40088E9D1 /* KMWatermarkManager.swift */,
+				BB90E4F52AF3B71800B04B9F /* KMPDFWatermarkData.swift */,
+			);
+			path = Model;
+			sourceTree = "<group>";
+		};
 		BB135C2629B6CD4500FD5965 /* Common */ = {
 			isa = PBXGroup;
 			children = (
@@ -14619,10 +14636,11 @@
 		BBDF180A2CD482D900ACDB15 /* Views */ = {
 			isa = PBXGroup;
 			children = (
-				BB162E9A295073B40088E9D1 /* KMWatermarkManager.swift */,
-				BB90E4F52AF3B71800B04B9F /* KMPDFWatermarkData.swift */,
+				BB11F0EA2CD9BCC8007656E4 /* Model */,
 				BBDF18132CD4853C00ACDB15 /* KMNWatermarkPropertyController.swift */,
 				BBDF18142CD4853C00ACDB15 /* KMNWatermarkPropertyController.xib */,
+				BB11F0EC2CD9BCE3007656E4 /* KMWatermarkToolbar.swift */,
+				BB11F0ED2CD9BCE3007656E4 /* KMWatermarkToolbar.xib */,
 				BB955EC22CD8ECE20042FDE1 /* Templates */,
 			);
 			path = Views;
@@ -15785,6 +15803,7 @@
 				BB9599C72B3164B40062D346 /* KMRedactPropertiesWindowController.xib in Resources */,
 				BBFE6E822930EBD400142C01 /* KMCompressWindowController.xib in Resources */,
 				ADF6B8702A480CCE0090CB78 /* KMComparativeView.xib in Resources */,
+				BB11F0F12CD9BCE3007656E4 /* KMWatermarkToolbar.xib in Resources */,
 				BB5F8A1C29BB15AD00365ADB /* KMEmailSubWindowController.xib in Resources */,
 				9F221EDA29A9EC0900978A59 /* KMFillSignTextPanel.xib in Resources */,
 				BBB2ACE02B5943F800098854 /* Quick Start Guide.pdf in Resources */,
@@ -16412,6 +16431,7 @@
 				65341C782C63CCFE00FE30F9 /* KMSearchReplaceWindowController.xib in Resources */,
 				ADFCEB492B4FBA440001EBAF /* RemoteConfigDefaults.plist in Resources */,
 				9F3D819729A33A290087B5AD /* KMDesignDropdown.xib in Resources */,
+				BB11F0F22CD9BCE3007656E4 /* KMWatermarkToolbar.xib in Resources */,
 				BB52F5932CC245B3007418DB /* KMLinkPopupEmailView.xib in Resources */,
 				BB03D6912B01C7AB008C9976 /* KMPDFEditInsertBlankPageWindow.xib in Resources */,
 				BBE788822CBD2463008086E2 /* WCCompWindowController.xib in Resources */,
@@ -16956,6 +16976,7 @@
 				9F853A042947137500DF644E /* default-icon.pdf in Resources */,
 				ADE86AF42B0AF56C00414DFA /* KMCompareCoveringSettingView.xib in Resources */,
 				9F8539ED2947131F00DF644E /* KMChromiumTabView.xib in Resources */,
+				BB11F0F32CD9BCE4007656E4 /* KMWatermarkToolbar.xib in Resources */,
 				BBE788A12CBD2463008086E2 /* TreeVC.xib in Resources */,
 				AD1D48402AFB81F4007AC1F0 /* KMMergeBlankView.xib in Resources */,
 				BB986AE92AD5376100ADF172 /* WelcomeWindowController.xib in Resources */,
@@ -18260,6 +18281,7 @@
 				AD867FAF29DFBB1200F00440 /* KMAnnotationOutlineCellView.swift in Sources */,
 				AD867F9429D955BF00F00440 /* KMBOTAOutlineCellView.swift in Sources */,
 				F3DB85F22CCA209600D0AFDE /* KMNBaseWindowController.swift in Sources */,
+				BB11F0EE2CD9BCE3007656E4 /* KMWatermarkToolbar.swift in Sources */,
 				9F1FE4A529406E4700E952CA /* CTToolbarView.m in Sources */,
 				BBB7899C2BE8BF2400F7E09C /* CustomCornerView.swift in Sources */,
 				BB162E92294FFE020088E9D1 /* KMWatermarkModel.swift in Sources */,
@@ -19338,6 +19360,7 @@
 				ADDF83272B391A5C00A81A4E /* CPDFDigtalView.m in Sources */,
 				BB00301E298CB799002DD1A0 /* KMPreferenceManager.swift in Sources */,
 				ADA9102F2A272CEA003352F0 /* KMImageOptimization.swift in Sources */,
+				BB11F0EF2CD9BCE3007656E4 /* KMWatermarkToolbar.swift in Sources */,
 				AD9527DC2952EE700039D2BC /* KMPrintPage_C.swift in Sources */,
 				ADBC2D29299DCA76006280C8 /* NSTextField+Layer.swift in Sources */,
 				9F0CB4702967E63100007028 /* KMPropertiesPanelNameSubVC.swift in Sources */,
@@ -20778,6 +20801,7 @@
 				BB0A551F2A30793F00B6E84B /* KMDesignTextField.swift in Sources */,
 				BB146FCE299DC0D100784A6A /* GTMSessionUploadFetcher.m in Sources */,
 				BB10FAF82AFE2C2900F18D65 /* KMNumberArrayFormatter.swift in Sources */,
+				BB11F0F02CD9BCE3007656E4 /* KMWatermarkToolbar.swift in Sources */,
 				65A9712A2CBA1792008DB0F9 /* KMToolbarPageInputItemView.swift in Sources */,
 				BB3198142AC5142900107371 /* NSMenu+KMExtension.swift in Sources */,
 				9F5752EB2B58FF73005DC303 /* KMAnnotationFromViewController.swift in Sources */,

+ 112 - 64
PDF Office/PDF Reader Pro.xcodeproj/xcuserdata/kdanmobile.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -893,22 +893,6 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            uuid = "55C2697B-09B5-4910-B090-7D3847B6A79F"
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "KMComponentLibrary/KMComponentLibrary/View/Card/ComponentCardWatermark/ComponentCardWatermark.swift"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "213"
-            endingLineNumber = "213"
-            landmarkName = "mouseUp(with:)"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
@@ -1835,22 +1819,6 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            uuid = "6F81816D-A78A-48EC-9B32-7E5C651BA773"
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "KMComponentLibrary/KMComponentLibrary/View/Card/ComponentCardWatermark/ComponentCardWatermark.swift"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "201"
-            endingLineNumber = "201"
-            landmarkName = "mouseDown(with:)"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
@@ -2209,28 +2177,28 @@
             filePath = "PDF Master/KMClass/KMPDFViewController/KMMainViewController.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "234"
-            endingLineNumber = "234"
+            startingLineNumber = "235"
+            endingLineNumber = "235"
             landmarkName = "setDocument"
             landmarkType = "24">
             <Locations>
                <Location
-                  uuid = "E3962D60-30EF-4185-BF07-EA1A34784887 - 615b7ea7d301d1da"
+                  uuid = "E3962D60-30EF-4185-BF07-EA1A34784887 - d80aac5b2f97b1f1"
                   shouldBeEnabled = "Yes"
                   ignoreCount = "0"
                   continueAfterRunningActions = "No"
-                  symbolName = "PDF_Reader_Pro.KMMainViewController.setDocument.setter : Swift.Optional&lt;__C.CPDFDocument&gt;"
+                  symbolName = "PDF_Reader_Pro.KMMainViewController.setDocument.getter : Swift.Optional&lt;__C.CPDFDocument&gt;"
                   moduleName = "PDF Reader Pro"
                   usesParentBreakpointCondition = "Yes"
                   urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/KMClass/KMPDFViewController/KMMainViewController.swift"
                   startingColumnNumber = "9223372036854775807"
                   endingColumnNumber = "9223372036854775807"
-                  startingLineNumber = "234"
-                  endingLineNumber = "234"
-                  offsetFromSymbolStart = "72">
+                  startingLineNumber = "235"
+                  endingLineNumber = "235"
+                  offsetFromSymbolStart = "40">
                </Location>
                <Location
-                  uuid = "E3962D60-30EF-4185-BF07-EA1A34784887 - d80aac5b2f97b1d6"
+                  uuid = "E3962D60-30EF-4185-BF07-EA1A34784887 - d80aac5b2f97b1f1"
                   shouldBeEnabled = "Yes"
                   ignoreCount = "0"
                   continueAfterRunningActions = "No"
@@ -2240,8 +2208,8 @@
                   urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/KMClass/KMPDFViewController/KMMainViewController.swift"
                   startingColumnNumber = "9223372036854775807"
                   endingColumnNumber = "9223372036854775807"
-                  startingLineNumber = "234"
-                  endingLineNumber = "234"
+                  startingLineNumber = "235"
+                  endingLineNumber = "235"
                   offsetFromSymbolStart = "28">
                </Location>
             </Locations>
@@ -2273,10 +2241,42 @@
             filePath = "PDF Master/KMClass/KMPDFViewController/KMMainViewController.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "316"
-            endingLineNumber = "316"
+            startingLineNumber = "317"
+            endingLineNumber = "317"
             landmarkName = "leftSidePaneIsOpen()"
             landmarkType = "7">
+            <Locations>
+               <Location
+                  uuid = "D206E0B7-814F-4B14-B67E-A227181643C3 - 3a681dc077fd068d"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Reader_Pro.KMMainViewController.leftSidePaneIsOpen() -&gt; Swift.Bool"
+                  moduleName = "PDF Reader Pro"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/KMClass/KMPDFViewController/KMMainViewController.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "317"
+                  endingLineNumber = "317"
+                  offsetFromSymbolStart = "260">
+               </Location>
+               <Location
+                  uuid = "D206E0B7-814F-4B14-B67E-A227181643C3 - 3a681dc077fd068d"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Reader_Pro.KMMainViewController.leftSidePaneIsOpen() -&gt; Swift.Bool"
+                  moduleName = "PDF Reader Pro"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/KMClass/KMPDFViewController/KMMainViewController.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "317"
+                  endingLineNumber = "317"
+                  offsetFromSymbolStart = "120">
+               </Location>
+            </Locations>
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
@@ -2289,10 +2289,42 @@
             filePath = "PDF Master/KMClass/KMPDFViewController/KMMainViewController.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "324"
-            endingLineNumber = "324"
+            startingLineNumber = "325"
+            endingLineNumber = "325"
             landmarkName = "toggleOpenLeftSide(pdfSideBarType:)"
             landmarkType = "7">
+            <Locations>
+               <Location
+                  uuid = "E9CA18F4-1E31-433F-B721-D83769733F83 - 702999c0d437ed5c"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Reader_Pro.KMMainViewController.toggleOpenLeftSide(pdfSideBarType: PDF_Reader_Pro.KMPDFSidebarType) -&gt; ()"
+                  moduleName = "PDF Reader Pro"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/KMClass/KMPDFViewController/KMMainViewController.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "325"
+                  endingLineNumber = "325"
+                  offsetFromSymbolStart = "244">
+               </Location>
+               <Location
+                  uuid = "E9CA18F4-1E31-433F-B721-D83769733F83 - 702999c0d437ed5c"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Reader_Pro.KMMainViewController.toggleOpenLeftSide(pdfSideBarType: PDF_Reader_Pro.KMPDFSidebarType) -&gt; ()"
+                  moduleName = "PDF Reader Pro"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/KMClass/KMPDFViewController/KMMainViewController.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "325"
+                  endingLineNumber = "325"
+                  offsetFromSymbolStart = "172">
+               </Location>
+            </Locations>
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
@@ -2305,10 +2337,42 @@
             filePath = "PDF Master/KMClass/KMPDFViewController/KMMainViewController.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "343"
-            endingLineNumber = "343"
+            startingLineNumber = "344"
+            endingLineNumber = "344"
             landmarkName = "toggleCloseLeftSide()"
             landmarkType = "7">
+            <Locations>
+               <Location
+                  uuid = "21491771-A89E-431C-A345-8F8239B11B3D - f8e46c602084e37d"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Reader_Pro.KMMainViewController.toggleCloseLeftSide() -&gt; ()"
+                  moduleName = "PDF Reader Pro"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/KMClass/KMPDFViewController/KMMainViewController.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "344"
+                  endingLineNumber = "344"
+                  offsetFromSymbolStart = "172">
+               </Location>
+               <Location
+                  uuid = "21491771-A89E-431C-A345-8F8239B11B3D - f8e46c602084e37d"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Reader_Pro.KMMainViewController.toggleCloseLeftSide() -&gt; ()"
+                  moduleName = "PDF Reader Pro"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/KMClass/KMPDFViewController/KMMainViewController.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "344"
+                  endingLineNumber = "344"
+                  offsetFromSymbolStart = "96">
+               </Location>
+            </Locations>
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
@@ -2375,21 +2439,5 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            uuid = "B69E14ED-D5A9-42DC-8B14-09E60522E2EE"
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "PDF Master/KMClass/KMPDFViewController/RightSideViews/Watermark/New/Views/KMWatermarkManager.swift"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "66"
-            endingLineNumber = "66"
-            landmarkName = "init()"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
    </Breakpoints>
 </Bucket>