Parcourir la source

【2025】【Edit】裁剪补充

niehaoyu il y a 4 jours
Parent
commit
daf8ec5e32

+ 1 - 1
PDF Office/PDF Master/Class/PDFTools/Crop/Controller/KMCropPreviewController.swift

@@ -484,7 +484,7 @@ class KMCropPreviewController: KMWatermarkAdjectivePreViewBaseController {
         if (sender.tag == 0) {
             /// 裁剪当前页面 - 白边距
             self.tipBox.isHidden = true
-            cropCurrentPage()
+ 
             return
         }
         

+ 4 - 274
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift

@@ -255,10 +255,6 @@ extension KMMainViewController {
     
     func cropMenu() -> NSMenu {
         let menu = NSMenu()
-        _ = menu.insertItem(withTitle: NSLocalizedString("Crop Current Page", comment: ""), action:#selector(cropCurrentPage), target: self, at: 0)
-        _ = menu.insertItem(withTitle: NSLocalizedString("Crop All Pages", comment: ""), action:#selector(cropAllPage), target: self, at: 1)
-        _ = menu.insertItem(withTitle: NSLocalizedString("Auto Crop – Separate", comment: ""), action:#selector(autoCropAll), target: self, at: 2)
-        _ = menu.insertItem(withTitle: NSLocalizedString("Auto Crop – Combined", comment: ""), action:#selector(smartAutoCropAll), target: self, at: 2)
         return menu
     }
     
@@ -527,11 +523,7 @@ extension KMMainViewController {
     func setCropStype() -> NSMenuItem {
         let stypItem = NSMenuItem(title: NSLocalizedString("Crop", comment: ""), action: nil, target: self)
         let stypeMenu = NSMenu()
-        _ = stypeMenu.addItem(withTitle: NSLocalizedString("Crop All Pages", comment: ""), action: #selector(cropAllPageItem), target: self, tag: 0)
-        _ = stypeMenu.addItem(withTitle: NSLocalizedString("Crop Current Page", comment: ""), action: #selector(cropCurrentPageItem), target: self, tag: 1)
-        _ = stypeMenu.addItem(withTitle: NSLocalizedString("Auto Crop – Separate", comment: ""), action: #selector(autoCropAllItem), target: self, tag: 2)
-        _ = stypeMenu.addItem(withTitle: NSLocalizedString("Auto Crop – Combined", comment: ""), action: #selector(smartAutoCropAllItem), target: self, tag: 3)
-        if NSIsEmptyRect(listView.selectionRect){
+         if NSIsEmptyRect(listView.selectionRect){
             _ = stypeMenu.addItem(withTitle: NSLocalizedString("Select Area", comment: ""), action: #selector(selectToolModel), target: self, tag: 4)
             _ = stypeMenu.addItem(withTitle: NSLocalizedString("Crop Options...", comment: ""), action: #selector(customCropModel), target: self, tag: 5)
         }
@@ -816,19 +808,7 @@ extension KMMainViewController {
     @objc func OpenItemAction(sender: NSMenuItem) {
         
     }
-    
-    @objc func cropAllPageItem(sender: NSMenuItem) {
-        self.cropAll(nil)
-    }
-    @objc func cropCurrentPageItem(sender: NSMenuItem) {
-        self.crop(nil)
-    }
-    @objc func autoCropAllItem(sender: NSMenuItem) {
-        self.autoCropAll(nil)
-    }
-    @objc func smartAutoCropAllItem(sender: NSMenuItem) {
-        self.smartAutoCropAll(nil)
-    }
+     
     @objc func customCropModel(sender: NSMenuItem) {
         let pdfDoc: CPDFDocument = self.listView.document
         if !pdfDoc.allowsCopying || !pdfDoc.allowsPrinting {
@@ -1730,226 +1710,6 @@ extension KMMainViewController {
     
     //MARK: - action
     
-    @objc func cropCurrentPage() {
-        var rect = NSIntegralRect(self.listView.currentSelectionRect())
-        var page: CPDFPage?
-        if let data = self.listView.currentSelectionPage() {
-            page = data
-        } else {
-            page = self.listView.currentPage()
-        }
-        
-        if (NSIsEmptyRect(rect)) {
-            rect = KMCropTools.getPageForegroundBox(page!)
-        }
-        
-        let index: UInt = (page?.pageIndex()) ?? 0
-        self._cropPage(at: index, in: rect)
-        
-        // 执行右键操作后,需要取消框选区域
-        if self.listView.toolMode == .selectToolMode {
-            objc_sync_enter(self)
-            self.listView.selectionRect = NSZeroRect
-            self.listView.selectionPageIndex = UInt(NSNotFound)
-            objc_sync_exit(self)
-        }
-        self.handlePageBoundsDidChange(page: page, action: CPDFPage.Action.crop)
-    }
-    
-    @objc private func _cropPage(at index: UInt, in rect: NSRect) {
-        let oldRect = self.listView.document?.page(at: index)?.bounds(for: .cropBox) ?? .zero
-        let undoManager = self.listView.undoManager
-        (undoManager?.prepare(withInvocationTarget: self) as? AnyObject)?._cropPage(at: index, in: oldRect)
-        
-        let page = self.listView.document.page(at: index)
-        let newRect = NSIntersectionRect(rect, (page?.bounds(for: .mediaBox)) ?? .zero)
-        page?.setBounds(newRect, for: .cropBox)
-        
-        /// 刷新预览视图
-        self.listView.layoutDocumentView()
-        self.listView.displayBox = .cropBox
-    }
-    
-    func beginProgressSheet(with message: String, maxValue: UInt) { 
-        let progress = SKProgressController()
-        progress.window?.contentView?.wantsLayer = true
-        progress.message = NSLocalizedString("Converting...", comment: "")
-        self.progressC = progress
-        self.progressC?.message = message
-        if maxValue > 0 {
-            progressC?.indeterminate = false
-            progressC?.maxValue = Double(maxValue)
-        } else {
-            progressC?.indeterminate = true
-        }
-        self.view.km_beginSheet(windowC: progressC!)
-    }
-    
-    // 白边距
-    @objc func smart_cropAllPage() {
-        var size = NSZeroSize
-        for i in 0 ..< self.listView.document.pageCount {
-            let page = self.listView.document.page(at: i)
-            let rect = KMCropTools.getPageForegroundBox(page!)
-            size.width = fmax(size.width, NSWidth(rect))
-            size.height = fmax(size.height, NSHeight(rect))
-        }
-        beginProgressSheet(with: KMLocalizedString("Cropping Pages"), maxValue: min(18, self.listView.document.pageCount))
-        var rectArray: Array<NSRect> = []
-        for i in 0 ..< self.listView.document.pageCount {
-            progressC?.increment(by: Double(i))
-            progressC?.doubleValue = Double(i)
-            let page = self.listView.document.page(at: i)
-            var rect = KMCropTools.getPageForegroundBox(page!)
-            let bounds: NSRect = (page?.bounds(for: .mediaBox))!
-            
-            rectArray.append(rect)
-        }
-        
-        cropPages(to: rectArray)
-        self.handlePageBoundsDidChange(page: nil, action: CPDFPage.Action.crop)
-    }
-    
-    // 自动
-    @objc func auto_cropAllPage() {
-        var size = NSZeroSize
-        for i in 0 ..< self.listView.document.pageCount {
-            let page = self.listView.document.page(at: i)
-            let rect = KMCropTools.getPageForegroundBox(page!)
-            size.width = fmax(size.width, NSWidth(rect))
-            size.height = fmax(size.height, NSHeight(rect))
-        }
-        beginProgressSheet(with: KMLocalizedString("Cropping Pages"), maxValue: min(18, self.listView.document.pageCount))
-        var rectArray: Array<NSRect> = []
-        for i in 0 ..< self.listView.document.pageCount {
-            progressC?.increment(by: Double(i))
-            progressC?.doubleValue = Double(i)
-            let page = self.listView.document.page(at: i)
-            var rect = KMCropTools.getPageForegroundBox(page!)
-            let bounds: NSRect = (page?.bounds(for: .mediaBox))!
-            if (rect.minX - bounds.minX > bounds.maxX-rect.maxX) {
-                rect.origin.x = rect.maxX-size.width
-            }
-            
-            rect.origin.y = rect.maxY-size.height
-            rect.size = size
-            
-            if (NSWidth(rect) > NSWidth(bounds)) {
-                rect.size.width = NSWidth(bounds)
-            }
-            if (NSHeight(rect) > NSHeight(bounds)) {
-                rect.size.height = NSHeight(bounds)
-            }
-            
-            if (NSMinX(rect) < NSMinX(bounds)) {
-                rect.origin.x = NSMinX(bounds)
-            } else if (NSMaxX(rect) > NSMaxX(bounds)) {
-                rect.origin.x = NSMaxX(bounds) - NSWidth(rect)
-            }
-            
-            if (NSMinY(rect) < NSMinY(bounds)) {
-                rect.origin.y = NSMinY(bounds)
-            } else if (NSMaxY(rect) > NSMaxY(bounds)) {
-                rect.origin.y = NSMaxY(bounds) - NSHeight(rect)
-            }
-            
-            rectArray.append(rect)
-        }
-        
-        cropPages(to: rectArray)
-        self.handlePageBoundsDidChange(page: nil, action: CPDFPage.Action.crop)
-    }
-    
-    @objc func cropAllPage() {
-        var rect = [NSIntegralRect(self.listView.currentSelectionRect() ?? .zero), .zero]
-        var rectArray: Array<NSRect> = []
-        let emptySelection = NSIsEmptyRect(rect.first ?? .zero)
-        if (emptySelection) {
-            guard let count = self.listView.document?.pageCount, count > 0 else {
-                KMPrint("listView | document is nil.", beep: true)
-                return
-            }
-            rect[0] = .zero
-            rect[1] = .zero
-            self.beginProgressSheet(withMessage: NSLocalizedString("Cropping Pages", comment: "Message for progress sheet"), maxValue: min(18, count))
-            if (count == 1) {
-                if let page = self.listView.document.page(at: 0) {
-                    rect[0] = KMCropTools.getPageForegroundBox(page)
-                }
-                progressC?.increment(by: 1)
-            } else if (count < 19) {
-                for i in 0 ..< 19 {
-                    if let page = self.listView.document.page(at: UInt(i)) {
-                        rect[i % 2] = NSUnionRect(rect[i % 2], KMCropTools.getPageForegroundBox(page))
-                        progressC?.increment(by: Double(i))
-                    }
-                }
-            } else {
-                let start = [1, (count - 5) / 2, count - 6]
-                var cnt = 0
-                for j in 0 ..< 3 {
-                    for i in 0 ..< 6 {
-                        let k = Int(start[j] + UInt(i))
-                        if let page = self.listView.document.page(at: UInt(k)) {
-                            rect[k % 2] = NSUnionRect(rect[k % 2], KMCropTools.getPageForegroundBox(page))
-                            cnt += 1
-                            progressC?.increment(by: Double(cnt))
-                        }
-                    }
-                }
-            }
-            let w = fmax(NSWidth(rect[0]), NSWidth(rect[1]))
-            let h = fmax(NSHeight(rect[0]), NSHeight(rect[1]))
-            for j in 0 ..< 2 {
-                rect[j] = NSMakeRect(floor(NSMidX(rect[j]) - 0.5 * w), floor(NSMidY(rect[j]) - 0.5 * h), w, h)
-            }
-            rectArray.append(rect.first ?? .zero)
-            rectArray.append(rect.last ?? .zero)
-        } else {
-            rectArray.append(rect.first ?? .zero)
-        }
-        
-        self.cropPages(to: rectArray)
-        // 执行右键操作后,需要取消框选区域
-        if self.listView.toolMode == .selectToolMode {
-            objc_sync_enter(self)
-            self.listView.selectionRect = NSZeroRect
-            self.listView.selectionPageIndex = UInt(NSNotFound)
-            objc_sync_exit(self)
-        }
-        self.handlePageBoundsDidChange(page: nil, action: CPDFPage.Action.crop)
-    }
-    
-    func cropPages(to rects: Array<NSRect>) {
-        let currentPage = self.listView.currentPage()
-        let visibleRect: NSRect = self.listView.convert(self.listView.convert(self.listView.documentView().visibleRect, from: self.listView.documentView()), to: self.listView.currentPage())
-        
-        var oldRectArray: Array<NSRect> = []
-        let rectCount = rects.count
-        for i in 0 ..< self.listView.document.pageCount {
-            let page = self.listView.document.page(at: i)
-            let rect = NSIntersectionRect(rects[Int(i) % rectCount], (page?.bounds(for: .mediaBox))!)
-            let oldRect = page?.bounds(for: .cropBox)
-            oldRectArray.append(oldRect!)
-            
-            page?.setBounds(rect, for: .cropBox)
-        }
-        
-        let undoManager = self.listView.undoManager
-        (undoManager?.prepare(withInvocationTarget: self) as AnyObject).cropPages(to: oldRectArray)
-        
-        /// 刷新预览视图
-        self.listView.layoutDocumentView()
-        
-        self.listView.displayBox = .cropBox
-        
-        self.listView.go(to: currentPage)
-        self.listView.go(to: visibleRect, on: currentPage)
-        DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.25) { [self] in
-            self.dismissProgressSheet()
-        }
-    }
-    
     
     // 开启/关闭左边栏
     @objc func toggleLeftPane() -> Void {
@@ -2115,29 +1875,7 @@ extension KMMainViewController {
             splitView(withTag: menuItem.tag)
         }
     }
-    
-    
-    func handlePageBoundsDidChange(page: CPDFPage?, action: String) {
-        let displayChanged = action == CPDFPage.Action.crop || self.listView.displayBox == .cropBox
-        
-        if (displayChanged) {
-            self.listView.layoutDocumentView()
-        }
-        if (page != nil) {
-            let idx = page!.pageIndex()
-            if (displayChanged) {
-                self.leftSideViewController.updateThumbnail(at: Int(idx))
-            }
-        } else {
-            if (displayChanged) {
-                self.leftSideViewController.allThumbnailsNeedUpdate()
-            }
-        }
-        self.leftSideViewController.updateSnapshotsIfNeed(for: page)
-        
-        if UserDefaults.standard.bool(forKey: SKDisplayPageBoundsKey) {
-        }
-    }
+     
     
     func changeLineAttribute(_ sender: Any?) {
         var inspector = sender as? KMLineInspector
@@ -3889,15 +3627,7 @@ extension KMMainViewController : KMToolbarViewControllerDelegate {
         } else if (toolbarItem.itemIdentifier == KMToolbarConversionCreatePDFItemIdentifier) {
             self.createPdf(index: index)
         } else if (toolbarItem.itemIdentifier == KMToolbarCropIdentifier) {
-            if index == 2 { // 裁剪当前页面
-                self.cropCurrentPage()
-            } else if index == 3 { // Auto Crop – Separate
-                self.smart_cropAllPage()
-            } else if index == 4 { // Auto Crop – Combined
-                self.auto_cropAllPage()
-            } else if index == 5 { // Select Area
-             }
-            FMTrackEventManager.defaultManager.trackEvent(event: "SubTbr_PageDisplay", withProperties: ["SubTbr_Btn": "Btn_SubTbr_PageDisplay_Crop"])
+            
         } else if (toolbarItem.itemIdentifier == KMToolbarToolSecureItemIdentifier) {
             self.clickChildTool(type: .secure, index: index)
             FMTrackEventManager.defaultManager.trackEvent(event: "SubTbr_Editor", withProperties: ["SubTbr_Btn": "Btn_SubTbr_Editor_Security"])

+ 4 - 38
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+MenuAction.swift

@@ -551,19 +551,7 @@ extension KMMainViewController {
 // MARK: - KMSystemPDFMenuProtocol
 
 extension KMMainViewController: KMSystemPDFMenuProtocol {
-    func changeDisplayMode(_ sender: Any?) {
-        
-    }
-    
-    func toggleDisplayAsBook(_ sender: Any?) {
-       
-    }
-    
-    func toggleDisplayPageBreaks(_ sender: Any?) {
-        self.listView.displaysPageBreaks = !(self.listView.displaysPageBreaks ?? false)
-        self.listView.layoutDocumentView()
-    }
-    
+      
     func changeDisplayBox(_ sender: Any?) {
         guard let item = sender as? NSMenuItem else {
             NSSound.beep()
@@ -860,27 +848,6 @@ extension KMMainViewController: KMSystemToolMenuProtocol {
     func decryption(_ sender: Any?) {
      }
     
-    func cropAll(_ sender: Any?) {
-        self.cropAllPage()
-    }
-    
-    func crop(_ sender: Any?) {
-        self.cropCurrentPage()
-    }
-    
-    // 白边距
-    func autoCropAll(_ sender: Any?) {
-        self.smart_cropAllPage()
-    }
-    
-    // 自动
-    func smartAutoCropAll(_ sender: Any?) {
-        self.auto_cropAllPage()
-    }
-    
-    func cropOptionsModel(_ sender: Any?) {
-        KMPrint("cropOptionsModel ...")
-    }
     
     func selectToolModel(_ sender: Any?) {
      }
@@ -1014,7 +981,7 @@ extension KMMainViewController: KMSystemToolMenuProtocol {
             page.leftRotate()
             
             self.rotatePageItems(pageItems: [KMThumbnailPageItem(page: page, rotate: page.rotation, oldRotate: rotation)])
-            self.handlePageBoundsDidChange(page: page, action: CPDFPage.Action.rotate)
+
         }
     }
     
@@ -1033,7 +1000,7 @@ extension KMMainViewController: KMSystemToolMenuProtocol {
             page.rightRotate()
             
             self.rotatePageItems(pageItems: [KMThumbnailPageItem(page: page, rotate: page.rotation, oldRotate: rotation)])
-            self.handlePageBoundsDidChange(page: page, action: CPDFPage.Action.rotate)
+
         }
     }
     
@@ -1053,7 +1020,7 @@ extension KMMainViewController: KMSystemToolMenuProtocol {
             }
             
             self.rotatePageItems(pageItems: pageItems)
-            self.handlePageBoundsDidChange(page: nil, action: CPDFPage.Action.rotate)
+
         }
     }
     
@@ -1073,7 +1040,6 @@ extension KMMainViewController: KMSystemToolMenuProtocol {
             }
             
             self.rotatePageItems(pageItems: pageItems)
-            self.handlePageBoundsDidChange(page: nil, action: CPDFPage.Action.rotate)
         }
     }
     

+ 8 - 8
PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNPDFInsert/KMNPDFInsertPDFWindowController.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="22505" 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="22505"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
@@ -35,7 +35,7 @@
             <windowStyleMask key="styleMask" titled="YES" fullSizeContentView="YES"/>
             <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
             <rect key="contentRect" x="196" y="240" width="557" height="563"/>
-            <rect key="screenRect" x="0.0" y="0.0" width="1512" height="944"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="1920" height="1055"/>
             <view key="contentView" id="se5-gp-TjO">
                 <rect key="frame" x="0.0" y="0.0" width="480" height="372"/>
                 <autoresizingMask key="autoresizingMask"/>
@@ -46,7 +46,7 @@
                             <rect key="frame" x="0.0" y="0.0" width="432" height="340"/>
                             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                             <subviews>
-                                <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="nVt-ye-20v">
+                                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="nVt-ye-20v">
                                     <rect key="frame" x="-2" y="324" width="436" height="16"/>
                                     <textFieldCell key="cell" lineBreakMode="clipping" title="Insert File" id="S0u-WL-oBc">
                                         <font key="font" usesAppearanceFont="YES"/>
@@ -72,7 +72,7 @@
                                                     <constraint firstAttribute="height" constant="32" id="vqe-8f-ty4"/>
                                                 </constraints>
                                             </customView>
-                                            <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="vLC-Uy-bWz">
+                                            <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="vLC-Uy-bWz">
                                                 <rect key="frame" x="-2" y="84" width="436" height="16"/>
                                                 <textFieldCell key="cell" lineBreakMode="clipping" title="Form File" id="ELj-Y5-Gb3">
                                                     <font key="font" usesAppearanceFont="YES"/>
@@ -80,7 +80,7 @@
                                                     <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                                 </textFieldCell>
                                             </textField>
-                                            <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="2mp-wK-3MJ">
+                                            <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="2mp-wK-3MJ">
                                                 <rect key="frame" x="-2" y="8" width="80" height="16"/>
                                                 <textFieldCell key="cell" lineBreakMode="clipping" title="Page Range:" id="fiE-1K-NiO">
                                                     <font key="font" usesAppearanceFont="YES"/>
@@ -132,7 +132,7 @@
                                                     <constraint firstAttribute="height" constant="20" id="X4e-au-sQo"/>
                                                 </constraints>
                                             </customView>
-                                            <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="e7a-sg-bz8">
+                                            <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="e7a-sg-bz8">
                                                 <rect key="frame" x="-2" y="108" width="436" height="16"/>
                                                 <textFieldCell key="cell" lineBreakMode="clipping" title="Form File" id="IcN-r8-Kef">
                                                     <font key="font" usesAppearanceFont="YES"/>
@@ -160,7 +160,7 @@
                                                     <constraint firstAttribute="height" constant="32" id="Bvo-ul-zuG"/>
                                                 </constraints>
                                             </customView>
-                                            <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="dMn-2x-fc2">
+                                            <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="dMn-2x-fc2">
                                                 <rect key="frame" x="194" y="16" width="32" height="16"/>
                                                 <textFieldCell key="cell" lineBreakMode="clipping" title="/200" id="d0w-sT-Tgo">
                                                     <font key="font" usesAppearanceFont="YES"/>

+ 21 - 7
PDF Office/PDF Master/KMClass/KMPDFViewController/EditTool/Crop/KMCropController.swift

@@ -8,21 +8,26 @@
 import Cocoa
 import KMComponentLibrary
 
+@objc protocol KMCropControllerDelegate: AnyObject {
+    
+    @objc optional func kmCropControllerDidCrop(_ controller: KMCropController, _ cropRect: CGRect, _ view: KMPageRangeSelectView)
+}
+
 class KMCropController: NSViewController {
 
     @IBOutlet var contendView: NSView!
     
     @IBOutlet var preInfoView: NSView!
     @IBOutlet var propertyInfoView: NSView!
-    
+     
+    private var documentPreview: KMEditDocumentController = KMEditDocumentController.init()
+    private var propertyController: KMCropPropertyController = KMCropPropertyController.init()
+
+    private var coverController: KMCropCoverController?
     
     var pdfDocument: CPDFDocument?
 
-    var documentPreview: KMEditDocumentController = KMEditDocumentController.init()
-    var propertyController: KMCropPropertyController = KMCropPropertyController.init()
-
-    
-    var coverController: KMCropCoverController?
+    weak open var delegate: KMCropControllerDelegate?
     
     
     override func viewDidLoad() {
@@ -44,6 +49,7 @@ class KMCropController: NSViewController {
         
         propertyController.view.frame = propertyInfoView.bounds
         propertyController.view.autoresizingMask = [.width, .height]
+        propertyController.delegate = self
         propertyInfoView.addSubview(propertyController.view)
         
 //        if coverController == nil {
@@ -68,6 +74,7 @@ class KMCropController: NSViewController {
         let bounds = page?.bounds ?? CGRectZero
         
         documentPreview.pdfView.toolMode = .selectToolMode
+        documentPreview.pdfView.displayBox = .mediaBox
         documentPreview.pdfView.selectionRect = bounds
         documentPreview.pdfView.setNeedsDisplayForVisiblePages()
      
@@ -78,7 +85,7 @@ class KMCropController: NSViewController {
     
 }
 
-
+//MARK: - CPDFListViewDelegate
 extension KMCropController: CPDFListViewDelegate {
     
     func pdfListViewChangedSelectionOrMagnification(_ pdfListView: CPDFListView!) {
@@ -93,3 +100,10 @@ extension KMCropController: CPDFListViewDelegate {
         propertyController.reloadData()
     }
 }
+
+//MARK: - KMCropPropertyControllerDelegate
+extension KMCropController: KMCropPropertyControllerDelegate {
+    func kmCropControllerDidCrop(_ controller: KMCropPropertyController, _ cropRect: CGRect, _ view: KMPageRangeSelectView) {
+        delegate?.kmCropControllerDidCrop?(self, cropRect, view)
+    }
+}

+ 16 - 12
PDF Office/PDF Master/KMClass/KMPDFViewController/EditTool/Crop/Views/KMCropPropertyController.swift

@@ -8,6 +8,11 @@
 import Cocoa
 import KMComponentLibrary
 
+@objc protocol KMCropPropertyControllerDelegate: AnyObject {
+    
+    @objc optional func kmCropControllerDidCrop(_ controller: KMCropPropertyController, _ cropRect: CGRect, _ view: KMPageRangeSelectView)
+}
+
 class KMCropPropertyController: NSViewController {
     
     @IBOutlet var contendView: NSView!
@@ -47,6 +52,8 @@ class KMCropPropertyController: NSViewController {
     
     private var syncChangeBounds: Bool = true //同步修改宽高
     
+    weak open var delegate: KMCropPropertyControllerDelegate?
+    
     var pdfView: CPDFListView?
     
     override func viewDidLoad() {
@@ -151,7 +158,7 @@ class KMCropPropertyController: NSViewController {
         
          
         cropButton.properties = ComponentButtonProperty(type: .primary, size: .m, buttonText: KMLocalizedString("Apply"), keepPressState: false)
-        
+        cropButton.setTarget(self, action: #selector(cropButtonClicked(_:)))
     }
     
     func reloadData() {
@@ -163,8 +170,7 @@ class KMCropPropertyController: NSViewController {
             return
         }
         let pageBounds = page.bounds
-        
-        var selectionRect = pdfView.selectionRect
+        let selectionRect = pdfView.selectionRect
         
         //White Margin
         
@@ -196,8 +202,12 @@ class KMCropPropertyController: NSViewController {
         pageBottomInput.reloadData()
         
         //PageRange
-         
-        
+        if CGRectEqualToRect(pageBounds, selectionRect) {
+            cropButton.properties.isDisabled = true
+        } else {
+            cropButton.properties.isDisabled = false
+        }
+        cropButton.reloadData()
     }
     
     //MARK: - Action
@@ -213,7 +223,7 @@ class KMCropPropertyController: NSViewController {
     }
     
     @objc func cropButtonClicked(_ sender: ComponentButton) {
-        
+        delegate?.kmCropControllerDidCrop?(self, pdfView?.selectionRect ?? CGRectZero, pangeRangeSelectView)
     }
     
 }
@@ -255,9 +265,3 @@ extension KMCropPropertyController: ComponentInputNumberDelegate {
         reloadData()
     }
 }
-
-//MARK: - ComponentSelectDelegate
-extension KMCropPropertyController: ComponentSelectDelegate {
-    
-}
-

+ 178 - 66
PDF Office/PDF Master/KMClass/KMPDFViewController/KMMainViewController.swift

@@ -78,11 +78,11 @@ import KMComponentLibrary
     
     //右边
     var rightSideController: KMRightSideController?
-     
+    
     //MARK: - 旧代码,有需要用到的拿出来,写好备注
     
     @IBOutlet weak var leftView: NSView!
-     
+    
     var model = KMMainModel()
     
     //自动滚动
@@ -99,11 +99,11 @@ import KMComponentLibrary
     //对比
     var isCompareModel: Bool = false {
         didSet {
-         }
+        }
     }
     //合并
     var mergeWindowController: KMMergeWindowController?
- 
+    
     //密码弹窗
     var passwordWindow: KMPasswordInputWindow?
     //对比
@@ -173,7 +173,7 @@ import KMComponentLibrary
     
     var pageNumber: UInt?
     
-     var pdfEditController: KMPDFEditViewController? {
+    var pdfEditController: KMPDFEditViewController? {
         get {
             return self.getPDFEditController()
         }
@@ -190,7 +190,7 @@ import KMComponentLibrary
         let vc = KMNHomeViewController()
         return vc
     }()
- 
+    
     fileprivate var _secureOptions: [CPDFDocumentWriteOption : Any]?
     var secureOptions: [CPDFDocumentWriteOption : Any]? {
         get {
@@ -378,7 +378,7 @@ import KMComponentLibrary
                 listView.annotationType = .addText
                 listView.setShouAddEdit([.text])
                 listView.change(.text)
-                 
+                
             } else if subToolMode == .Edit_Image {
                 if listView.toolMode != .editPDFToolMode {
                     listView.toolMode = .editPDFToolMode
@@ -387,18 +387,18 @@ import KMComponentLibrary
                 listView.annotationType = .addImage
                 listView.setShouAddEdit([.image])
                 listView.change(.image)
-                 
+                
             } else if subToolMode == .Edit_Link {
                 listView.toolMode = .noteToolMode
                 
                 listView.annotationType = .link
                 
             } else if subToolMode == .Edit_Crop {
-//                listView.toolMode = .selectToolMode
+                //                listView.toolMode = .selectToolMode
                 
                 showCropController()
             }
-             
+            
             
         } else if toolbarMode == .Form {
             
@@ -480,7 +480,7 @@ import KMComponentLibrary
         updatePDFViewAnnotationMode()
         
         if viewManager.showRightSide == true {
-             openRightPane()
+            openRightPane()
             
         } else {
             closeRightPane()
@@ -593,7 +593,7 @@ import KMComponentLibrary
             pageEditViewController?.currentUndoManager = listView.undoManager
             toolbarManager.page_pageInfo_Property.text = String(listView.currentPageIndex + 1)
             pdfToolbarController?.refreshSecondToolbarItemsState()
-
+            
         }
     }
     
@@ -885,17 +885,17 @@ import KMComponentLibrary
     //MARK: - Crop裁剪
     func showCropController() {
         listView.isHidden = true
-            
+        
         
         if cropController == nil {
             cropController = KMCropController.init()
         }
         cropController?.view.frame = CGRectMake(44, 0, CGRectGetWidth(bottomContendBox.frame)-44, CGRectGetHeight(bottomContendBox.frame))
         cropController?.view.autoresizingMask = [.maxXMargin, .width, .height]
-//        cropController?.delegate = self
+        cropController?.delegate = self
         bottomContendBox.addSubview(cropController!.view)
         
- 
+        
         updateCropDocument()
     }
     
@@ -917,11 +917,15 @@ import KMComponentLibrary
     
     func removeCropController() {
         listView.isHidden = false
-         
+        
         if cropController != nil {
             cropController?.view.removeFromSuperview()
             cropController = nil
         }
+        
+        toolbarManager.edit_crop_Property.state = .normal
+        pdfToolbarController?.refreshSecondToolbarItemsState()
+        
     }
     
     //MARK: - Watermark水印
@@ -1178,6 +1182,99 @@ import KMComponentLibrary
         
     }
     
+    //MARK: - Crop
+    
+    // 白边距
+    @objc func smart_cropAllPage() {
+   
+        var rectArray: Array<NSRect> = []
+        for i in 0 ..< self.listView.document.pageCount {
+            progressC?.increment(by: Double(i))
+            progressC?.doubleValue = Double(i)
+            let page = self.listView.document.page(at: i)
+            let rect = KMCropTools.getPageForegroundBox(page!)
+            rectArray.append(rect)
+        }
+    }
+    
+    // 自动
+    @objc func auto_cropAllPage() {
+        var size = NSZeroSize
+        for i in 0 ..< self.listView.document.pageCount {
+            let page = self.listView.document.page(at: i)
+            let rect = KMCropTools.getPageForegroundBox(page!)
+            size.width = fmax(size.width, NSWidth(rect))
+            size.height = fmax(size.height, NSHeight(rect))
+        }
+        
+        var rectArray: Array<NSRect> = []
+        for i in 0 ..< self.listView.document.pageCount {
+            progressC?.increment(by: Double(i))
+            progressC?.doubleValue = Double(i)
+            let page = self.listView.document.page(at: i)
+            var rect = KMCropTools.getPageForegroundBox(page!)
+            let bounds: NSRect = (page?.bounds(for: .mediaBox))!
+            if (rect.minX - bounds.minX > bounds.maxX-rect.maxX) {
+                rect.origin.x = rect.maxX-size.width
+            }
+            
+            rect.origin.y = rect.maxY-size.height
+            rect.size = size
+            
+            if (NSWidth(rect) > NSWidth(bounds)) {
+                rect.size.width = NSWidth(bounds)
+            }
+            if (NSHeight(rect) > NSHeight(bounds)) {
+                rect.size.height = NSHeight(bounds)
+            }
+            
+            if (NSMinX(rect) < NSMinX(bounds)) {
+                rect.origin.x = NSMinX(bounds)
+            } else if (NSMaxX(rect) > NSMaxX(bounds)) {
+                rect.origin.x = NSMaxX(bounds) - NSWidth(rect)
+            }
+            
+            if (NSMinY(rect) < NSMinY(bounds)) {
+                rect.origin.y = NSMinY(bounds)
+            } else if (NSMaxY(rect) > NSMaxY(bounds)) {
+                rect.origin.y = NSMaxY(bounds) - NSHeight(rect)
+            }
+            
+            rectArray.append(rect)
+        }
+         
+    }
+    
+    func cropPages(atIndexs pageIndexs: [UInt], to rects: Array<NSRect>) {
+        let currentPage = self.listView.currentPage()
+        let visibleRect: NSRect = self.listView.convert(self.listView.convert(self.listView.documentView().visibleRect, from: self.listView.documentView()), to: self.listView.currentPage())
+        
+        var oldRectArray: Array<NSRect> = []
+        let rectCount = rects.count
+        for i in pageIndexs {
+            if let page = self.listView.document.page(at: i) {
+                let rect = NSIntersectionRect(rects[Int(i) % rectCount], (page.bounds(for: .mediaBox)))
+                let oldRect = page.bounds(for: .cropBox)
+                oldRectArray.append(oldRect)
+                
+                page.setBounds(rect, for: .cropBox)
+            }
+        }
+        
+        let undoManager = self.listView.undoManager
+        (undoManager?.prepare(withInvocationTarget: self) as AnyObject).cropPages(atIndexs: pageIndexs, to: oldRectArray)
+        
+        /// 刷新预览视图
+        self.listView.layoutDocumentView()
+        
+        self.listView.displayBox = .cropBox
+        
+        self.listView.go(to: currentPage)
+        self.listView.go(to: visibleRect, on: currentPage)
+        
+    }
+    
+    
     //MARK: - Share
     @objc private func shareDocument(sender: NSView) {
         let document = self.listView.document ?? CPDFDocument()
@@ -1320,7 +1417,7 @@ import KMComponentLibrary
             represent.perform(withItems: [string])
             return
         }
-
+        
         let represent = sender.representedObject as? NSSharingService
         represent?.perform(withItems: [string])
     }
@@ -1434,7 +1531,7 @@ extension KMMainViewController: KMPDFToolbarControllerDelegate {
         } else if itemIdentifier == KMPDFToolbar_Protect_Identifier {
             
         } else if itemIdentifier == KMPDFToolbar_Tools_Identifier {
-           
+            
         } else if itemIdentifier == KMPDFToolbar_convert_word_Identifier {
             let winC = KMConvertWordWindowController()
             let model = KMDocumentModel(url: listView.document.documentURL)
@@ -1648,7 +1745,7 @@ extension KMMainViewController: KMPDFToolbarControllerDelegate {
                 fileAttribute.bAllPage = false
                 fileAttribute.pagesType = .PagesString
                 fileAttribute.pagesString = view.properties.text ?? ""
-
+                
                 let fetchSelectPages = fileAttribute.fetchSelectPages()
                 if (fetchSelectPages.isEmpty) {
                     let alert = NSAlert()
@@ -1663,9 +1760,9 @@ extension KMMainViewController: KMPDFToolbarControllerDelegate {
                         tIndexPaths.insert(IndexPath(item: (fetchSelectPages[i] - 1), section: 0))
                     }
                     pageEditViewController?.selectionIndexPaths = tIndexPaths
-
+                    
                 }
-
+                
             }
         }
     }
@@ -1869,7 +1966,7 @@ extension KMMainViewController: KMSplitPDFViewControllerDelegate {
     }
 }
 
-//MARK: - Edit相关代理
+//MARK: - Edit编辑相关代理
 extension KMMainViewController: KMEditToolbarViewDelegate {
     func kmEditToolbarViewDidUpdateMode(_ view: KMEditToolbarView) {
         if view.editType == .watermark {
@@ -1964,6 +2061,21 @@ extension KMMainViewController: KMEditToolbarViewDelegate {
     }
 }
 
+//MARK: - KMCropControllerDelegate 裁剪相关代理
+extension KMMainViewController: KMCropControllerDelegate {
+    func kmCropControllerDidCrop(_ controller: KMCropController, _ cropRect: CGRect, _ view: KMPageRangeSelectView) {
+        let indexs = view.getSelectedPageIndex(listView.document)
+        var uIndexs: [UInt] = []
+        for index in indexs {
+            if index > 0 {
+                uIndexs.append(UInt(index-1))
+            }
+        }
+        cropPages(atIndexs: uIndexs, to: [cropRect])
+        removeCropController()
+    }
+}
+
 //MARK: - KMWatermarkControllerDelegate 水印相关代理
 extension KMMainViewController: KMWatermarkControllerDelegate {
     func kmWatermarkControllerDidUpdateMode(_ view: KMWatermarkController) {
@@ -2022,7 +2134,7 @@ extension KMMainViewController: KMBackgroundControllerDelegate {
 extension KMMainViewController: KMHeaderFooterControllerDelegate {
     func kmHeaderFooterControllerDidUpdateMode(_ view: KMHeaderFooterController) {
         editToolbarView?.editSubType = view.editSubType
-
+        
     }
     
     func kmHeaderFooterControllerDidModelDataUpdated(_ view: KMHeaderFooterController) {
@@ -2146,7 +2258,7 @@ extension KMMainViewController: CPDFViewDelegate,CPDFListViewDelegate {
     func pdfViewDidClick(onLink pdfView: CPDFView!, withURL url: String!) {
         if let urlString = url, urlString == kKMPurchaseProductURLString {
             //跳转订阅比较表
-             return
+            return
         }
         
         if url.hasPrefix("smb://") {
@@ -2200,13 +2312,13 @@ extension KMMainViewController: CPDFViewDelegate,CPDFListViewDelegate {
     //MARK: -编辑模块
     func pdfViewEditingSelectionDidChanged(_ pdfView: CPDFView!) {
         // 文本区块 选中文本已经变化
-
+        
     }
     
     func pdfViewEditingAreaDidChanged(_ pdfView: CPDFView!) {
         //编辑模块变化
         rightSideController?.reloadDataWithPDFView(pdfView: (pdfView as! CPDFListView))
-       
+        
         if pdfView is CPDFListView {
             (pdfView as! CPDFListView).isEditImage = false
         }
@@ -2356,7 +2468,7 @@ extension KMMainViewController: CPDFViewDelegate,CPDFListViewDelegate {
         attri.isItalic = model.italic
         
         self.listView.createStringBounds(newRect, with: attri, page: page)
-
+        
     }
     
     func pdfViewMobileEditingBegan(_ point: CGPoint, for pdfView: CPDFView!, forEditing editingAreas: [CPDFEditArea]!) {
@@ -2394,7 +2506,7 @@ extension KMMainViewController: CPDFViewDelegate,CPDFListViewDelegate {
     }
     
     func pdfViewEditingDoubleClick(_ pdfView: CPDFView!, imageArea editArea: CPDFEditArea!) {
-
+        
     }
     
     func pdfListViewKeyDownIsContinue(_ pdfListView: CPDFListView!, theEvent: NSEvent!) -> Bool {
@@ -2557,7 +2669,7 @@ extension KMMainViewController: CPDFViewDelegate,CPDFListViewDelegate {
                     }
                 }
                 if isSameAnnotation == false {
-
+                    
                 } else {
                     self.openRightPane()
                 }
@@ -2567,7 +2679,7 @@ extension KMMainViewController: CPDFViewDelegate,CPDFListViewDelegate {
                 let fristAnnotation  = annotations.first
                 let className =  NSStringFromClass(fristAnnotation!.classForCoder)
                 if self.viewManager.isPDFReadMode {
-
+                    
                     self.closeRightPane()
                 } else {
                     if className != "CPDFStampAnnotation" &&
@@ -2609,12 +2721,12 @@ extension KMMainViewController: CPDFViewDelegate,CPDFListViewDelegate {
             }
         } else if (annotations.count == 0){
             if  pdfListView.annotationType == .unkown {
-                 self.closeRightPane()
+                self.closeRightPane()
             } else {
                 if self.viewManager.isPDFReadMode {
-                     self.closeRightPane()
+                    self.closeRightPane()
                 } else {
-                     self.openRightPane()
+                    self.openRightPane()
                 }
             }
         }
@@ -2622,7 +2734,7 @@ extension KMMainViewController: CPDFViewDelegate,CPDFListViewDelegate {
     
     func pdfListViewChangedAnnotationType(_ pdfListView: CPDFListView!, for annotationType: CAnnotationType) {
         if(annotationType == .unkown) {
-             self.closeRightPane()
+            self.closeRightPane()
         }
         let aType = annotationType
         if aType.isMarkup() || aType == .anchored || aType == .freeText || aType.isSquare() || aType == .link {
@@ -2904,12 +3016,12 @@ extension KMMainViewController: CPDFViewDelegate,CPDFListViewDelegate {
         if self.listView.toolMode == .moveToolMode {
             self.listView.toolMode = .textToolMode
             self.listView.annotationType = .unkown
-
+            
         }
         if (self.model.rightMouseEventing) {
             self.model.rightMouseEventing = false
             
-          
+            
             
         }
         self.leftSideViewController.refreshUIForAddAnnotation(annos: annotations, page: pdfPage)
@@ -2994,11 +3106,11 @@ extension KMMainViewController: CPDFViewDelegate,CPDFListViewDelegate {
     
     //TextEdit
     func pdfListViewDidTextFontChanged(_ pdfListView: CPDFListView!) {
- 
+        
     }
     
     func pdfListViewDidTextColorChanged(_ pdfListView: CPDFListView!, with color: NSColor!) {
- 
+        
     }
     
     func pdfListViewAnnotationMeasureInfoChange(_ pdfListView: CPDFListView!, with annotation: CPDFAnnotation!) {
@@ -3242,7 +3354,7 @@ extension KMMainViewController {
         self.initPDFLeftViewVC()
         self.leftSideViewController.mainViewController = self
         
-     }
+    }
     
     func viewDidAppearFunction() {
         //春季活动
@@ -3333,7 +3445,7 @@ extension KMMainViewController {
     
     func viewDidLoadOld() {
         mwcFlags.settingUpWindow = 1
-       
+        
         self.srHanddler.pdfView = self.listView
         
         self.initToolbar()
@@ -3366,8 +3478,8 @@ extension KMMainViewController {
             self._goToFirstPageForFristAppear()
         }
         
- 
-     
+        
+        
         
         NotificationCenter.default.addObserver(self, selector: #selector(rename(_:)), name: NSNotification.Name.init(rawValue: "KMTabControllerRename"), object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(closeTab(_:)), name: NSNotification.Name.init(rawValue: "KMTabControllerCloseTabs"), object: nil)
@@ -3446,7 +3558,7 @@ extension KMMainViewController {
         leftSideViewController.delegate = self
         self.leftView.addSubview(leftSideViewController.view)
     }
-     
+    
     func addAdsBannerView() {
 #if VERSION_FREE
         if !IAPProductsManager.default().isAvailableAllFunction(){
@@ -3454,7 +3566,7 @@ extension KMMainViewController {
                 return
             }
             if !document.isLocked {
-             }
+            }
             NotificationCenter.default.addObserver(self, selector: #selector(purchaseStateUpdateNoti), name: NSNotification.Name(rawValue: "KMIAPProductPurchasedNotification"), object: nil)
             NotificationCenter.default.addObserver(self, selector: #selector(purchaseStateUpdateNoti), name: NSNotification.Name(rawValue: "kDeviceActivateNotification"), object: nil)
             
@@ -3728,15 +3840,15 @@ extension KMMainViewController {
     
     func loadOpenFileFunctionGuide(_ showType: KMGuideInfoType) -> Void {
         if showType == .openFileNormal && KMGuideInfoWindowController.availableShow(.openFileNormal) {
- 
+            
             self.guideInfoWindowController = KMGuideInfoWindowController.currentWC()
             guard let guideWC = self.guideInfoWindowController else { return }
             
             guideWC.type = .openFileNormal
-//            guideWC.openPanelRect = (self.view.window?.contentView?.convert(leftPanelItem.frame, from: leftPanelItem.superview)) ?? .zero
+            //            guideWC.openPanelRect = (self.view.window?.contentView?.convert(leftPanelItem.frame, from: leftPanelItem.superview)) ?? .zero
             guideWC.window?.collectionBehavior = [.canJoinAllSpaces]
             guideWC.normalGuideFinishHandle = { [weak self] windowVC in
- 
+                
                 
             }
             guideWC.finishHandle = { [weak self] windowVC, type in
@@ -3761,7 +3873,7 @@ extension KMMainViewController {
             
             guideWC.type = .digitalSignGuide
             
-             guideWC.window?.collectionBehavior = [.canJoinAllSpaces]
+            guideWC.window?.collectionBehavior = [.canJoinAllSpaces]
             guideWC.finishHandle = { [weak self] windowVC, type in
                 self?.checkFirstTrialController()
             }
@@ -3780,11 +3892,11 @@ extension KMMainViewController {
                 
                 guideWC.type = .pdfCompareGuide
                 
-                 
+                
                 guard let win = self.view.window else {
                     return
                 }
- 
+                
                 guideWC.finishHandle = { [weak self] winC, type in
                     if type == .windowNewFinish {
                         DispatchQueue.main.async {
@@ -3828,10 +3940,10 @@ extension KMMainViewController {
                 guard let guideWC = self.guideInfoWindowController else { return }
                 
                 guideWC.type = .convertGuide
-                 guard let win = self.view.window else {
+                guard let win = self.view.window else {
                     return
                 }
-                 guideWC.purchaseHandle = { [weak self] windowVC in
+                guideWC.purchaseHandle = { [weak self] windowVC in
 #if VERSION_DMG
                     if IAPProductsManager.default().isAvailableAllFunction() {
                         if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
@@ -3931,7 +4043,7 @@ extension KMMainViewController {
         controller.selectedPages = tPages
         controller.listView = self.listView
         self.addChild(controller)
-     
+        
         controller.view.autoresizingMask = [.width,.height]
         self.listView.isHidden = true
         
@@ -3994,7 +4106,7 @@ extension KMMainViewController {
     open func hasEnterPageEdit() -> Bool {
         return self.getPDFEditController() != nil
     }
-  
+    
     
     // MARK: - 数字签名
     
@@ -4049,7 +4161,7 @@ extension KMMainViewController {
         var currentPageIndex = listView.document?.index(for: listView.currentPage()) ?? 0
         var password: String = ""
         
-         password = listView.document?.password ?? ""
+        password = listView.document?.password ?? ""
         
         digitalSignController = KMPDFDigitalSignViewController()
         
@@ -4070,7 +4182,7 @@ extension KMMainViewController {
                 self?.exitDigitalSign()
             }
         }
-         
+        
     }
     
     // MARK: - Toolbar
@@ -4092,7 +4204,7 @@ extension KMMainViewController {
             }
         }
         if toolbarItem.itemIdentifier != KMDocumentEditToolbarItemIdentifier && toolbarItem.itemIdentifier != KMRightControlToolbarItemIdentifier && toolbarItem.itemIdentifier != KMLeftControlToolbarItemIdentifier {
-
+            
         }
     }
     
@@ -4127,7 +4239,7 @@ extension KMMainViewController {
     }
     
     private func removeBackgroundMaskView() {
-       
+        
     }
     
     private func _goToFirstPageForFristAppear() {
@@ -4321,7 +4433,7 @@ extension KMMainViewController {
             self.mergeWindowController!.mergeAction = { [unowned self] controller, filePath in
                 self.view.window?.endSheet(mergeWindowController!.window!)
             }
- 
+            
             self.view.window?.beginSheet(self.mergeWindowController!.window!)
         }
     }
@@ -4336,7 +4448,7 @@ extension KMMainViewController {
         securityWindowController.batchAction = { [unowned self] controller, files in
             self.view.window?.endSheet((securityWindowController.window)!)
             
- 
+            
             let batchWindowController = KMBatchOperateWindowController.sharedWindowController
             let batchOperateFile = KMBatchOperateFile(filePath: self.document?.documentURL.path ?? "", type: .AddPassword)
             batchWindowController.switchToOperateType(.AddPassword, files: [batchOperateFile])
@@ -4678,8 +4790,8 @@ extension KMMainViewController {
                             } else if self!.listView.editingAreas().count > 0 {
                                 if self?.listView.annotationType == .addImage ||
                                     self?.listView.annotationType == .addText {
-                                 }
-                                 self?.listView.endEditIsRemoveBlock(with: self!.listView.editingAreas().first as? CPDFEditArea)
+                                }
+                                self?.listView.endEditIsRemoveBlock(with: self!.listView.editingAreas().first as? CPDFEditArea)
                                 self?.listView.updateEditing([])
                                 self?.listView.isEditImage = false
                                 self?.listView.setNeedsDisplayPageViewFor(self!.listView.currentPage())
@@ -4691,8 +4803,8 @@ extension KMMainViewController {
                             } else if(self?.listView.annotationType == .addImage || self!.listView.annotationType == .addText) {
                                 if self?.listView.annotationType == .addImage ||
                                     self?.listView.annotationType == .addText {
-                                 }
-                                 self?.listView.setShouAddEdit([])
+                                }
+                                self?.listView.setShouAddEdit([])
                                 self?.listView.change([.text, .image])
                                 self?.listView.annotationType = .editTextImage
                                 self?.closeRightPane()
@@ -4701,7 +4813,7 @@ extension KMMainViewController {
                         } else {
                             if self?.listView.annotationType == .addImage ||
                                 self?.listView.annotationType == .addText {
-                             }
+                            }
                         }
                     }
                 }
@@ -4962,7 +5074,7 @@ extension KMMainViewController {
         }
         if self.listView.toolMode == .editPDFToolMode {
             if editSelectd {
-             }
+            }
         }
     }
     

+ 1 - 1
PDF Office/PDF Master/KMClass/Tools/KMNFileAttribute/KMNFileAttribute.swift

@@ -18,12 +18,12 @@ import Cocoa
     var filePath: String = ""
     var pdfDocument: CPDFDocument?
     var bAllPage = false
-    private var selectPages: [Int] = []
     var pagesString: String = ""
     var isLocked = false
     var password: String?
     
     var pagesType: KMNFileAttributePageType = .AllPages
+    private var selectPages: [Int] = []
     
     func fetchSelectPages() -> [Int] {
         if let doc = self.pdfDocument, doc.isLocked {

+ 252 - 170
PDF Office/PDF Reader Pro.xcodeproj/xcuserdata/kdanmobile.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -14,42 +14,10 @@
             filePath = "PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2913"
-            endingLineNumber = "2913"
+            startingLineNumber = "2443"
+            endingLineNumber = "2443"
             landmarkName = "toolbarViewController(_:zoomModel:)"
             landmarkType = "7">
-            <Locations>
-               <Location
-                  uuid = "CBD5F2A0-D33B-4635-AABA-000A5C35975E - b2a76df9271149d3"
-                  shouldBeEnabled = "Yes"
-                  ignoreCount = "0"
-                  continueAfterRunningActions = "No"
-                  symbolName = "PDF_Reader_Pro.KMMainViewController.toolbarViewController(_: PDF_Reader_Pro.KMToolbarViewController, zoomModel: Swift.Int) -&gt; ()"
-                  moduleName = "PDF Reader Pro"
-                  usesParentBreakpointCondition = "Yes"
-                  urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift"
-                  startingColumnNumber = "9223372036854775807"
-                  endingColumnNumber = "9223372036854775807"
-                  startingLineNumber = "2913"
-                  endingLineNumber = "2913"
-                  offsetFromSymbolStart = "180">
-               </Location>
-               <Location
-                  uuid = "CBD5F2A0-D33B-4635-AABA-000A5C35975E - b2a76df9271149d3"
-                  shouldBeEnabled = "Yes"
-                  ignoreCount = "0"
-                  continueAfterRunningActions = "No"
-                  symbolName = "PDF_Reader_Pro.KMMainViewController.toolbarViewController(_: PDF_Reader_Pro.KMToolbarViewController, zoomModel: Swift.Int) -&gt; ()"
-                  moduleName = "PDF Reader Pro"
-                  usesParentBreakpointCondition = "Yes"
-                  urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift"
-                  startingColumnNumber = "9223372036854775807"
-                  endingColumnNumber = "9223372036854775807"
-                  startingLineNumber = "2913"
-                  endingLineNumber = "2913"
-                  offsetFromSymbolStart = "192">
-               </Location>
-            </Locations>
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
@@ -2305,13 +2273,13 @@
             filePath = "PDF Master/KMClass/KMPDFViewController/KMMainViewController.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "985"
-            endingLineNumber = "985"
+            startingLineNumber = "989"
+            endingLineNumber = "989"
             landmarkName = "removePDFWatermark()"
             landmarkType = "7">
             <Locations>
                <Location
-                  uuid = "14EF9D11-330E-4DB1-A4D2-AA533CF55782 - ae5dbea256bdaf12"
+                  uuid = "14EF9D11-330E-4DB1-A4D2-AA533CF55782 - ae5dbea256bda987"
                   shouldBeEnabled = "Yes"
                   ignoreCount = "0"
                   continueAfterRunningActions = "No"
@@ -2321,12 +2289,12 @@
                   urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/KMClass/KMPDFViewController/KMMainViewController.swift"
                   startingColumnNumber = "9223372036854775807"
                   endingColumnNumber = "9223372036854775807"
-                  startingLineNumber = "938"
-                  endingLineNumber = "938"
-                  offsetFromSymbolStart = "1464">
+                  startingLineNumber = "989"
+                  endingLineNumber = "989"
+                  offsetFromSymbolStart = "2276">
                </Location>
                <Location
-                  uuid = "14EF9D11-330E-4DB1-A4D2-AA533CF55782 - ae5dbea256bdaf12"
+                  uuid = "14EF9D11-330E-4DB1-A4D2-AA533CF55782 - ae5dbea256bda987"
                   shouldBeEnabled = "Yes"
                   ignoreCount = "0"
                   continueAfterRunningActions = "No"
@@ -2336,23 +2304,8 @@
                   urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/KMClass/KMPDFViewController/KMMainViewController.swift"
                   startingColumnNumber = "9223372036854775807"
                   endingColumnNumber = "9223372036854775807"
-                  startingLineNumber = "938"
-                  endingLineNumber = "938"
-                  offsetFromSymbolStart = "1496">
-               </Location>
-               <Location
-                  uuid = "14EF9D11-330E-4DB1-A4D2-AA533CF55782 - ae5dbea256bda903"
-                  shouldBeEnabled = "Yes"
-                  ignoreCount = "0"
-                  continueAfterRunningActions = "No"
-                  symbolName = "PDF_Reader_Pro.KMMainViewController.removePDFWatermark() -&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 = "985"
-                  endingLineNumber = "985"
+                  startingLineNumber = "989"
+                  endingLineNumber = "989"
                   offsetFromSymbolStart = "1496">
                </Location>
             </Locations>
@@ -3300,69 +3253,6 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            uuid = "842AC4D6-5CA6-440F-A002-6D891884C3CD"
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "PDF Master/KMClass/KMPDFViewController/KMMainViewController.swift"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2064"
-            endingLineNumber = "2064"
-            landmarkName = "pdfViewEditingAddImageArea(_:add:add:)"
-            landmarkType = "7">
-            <Locations>
-               <Location
-                  uuid = "842AC4D6-5CA6-440F-A002-6D891884C3CD - 144f1057c5281bee"
-                  shouldBeEnabled = "Yes"
-                  ignoreCount = "0"
-                  continueAfterRunningActions = "No"
-                  symbolName = "PDF_Reader_Pro.KMMainViewController.pdfViewEditingAddImageArea(_: Swift.Optional&lt;__C.CPDFView&gt;, add: Swift.Optional&lt;__C.CPDFPage&gt;, add: __C.CGRect) -&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 = "2017"
-                  endingLineNumber = "2017"
-                  offsetFromSymbolStart = "172">
-               </Location>
-               <Location
-                  uuid = "842AC4D6-5CA6-440F-A002-6D891884C3CD - 144f1057c5281bee"
-                  shouldBeEnabled = "Yes"
-                  ignoreCount = "0"
-                  continueAfterRunningActions = "No"
-                  symbolName = "PDF_Reader_Pro.KMMainViewController.pdfViewEditingAddImageArea(_: Swift.Optional&lt;__C.CPDFView&gt;, add: Swift.Optional&lt;__C.CPDFPage&gt;, add: __C.CGRect) -&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 = "2017"
-                  endingLineNumber = "2017"
-                  offsetFromSymbolStart = "184">
-               </Location>
-               <Location
-                  uuid = "842AC4D6-5CA6-440F-A002-6D891884C3CD - 144f1057c52815fd"
-                  shouldBeEnabled = "Yes"
-                  ignoreCount = "0"
-                  continueAfterRunningActions = "No"
-                  symbolName = "PDF_Reader_Pro.KMMainViewController.pdfViewEditingAddImageArea(_: Swift.Optional&lt;__C.CPDFView&gt;, add: Swift.Optional&lt;__C.CPDFPage&gt;, add: __C.CGRect) -&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 = "2064"
-                  endingLineNumber = "2064"
-                  offsetFromSymbolStart = "184">
-               </Location>
-            </Locations>
-         </BreakpointContent>
-      </BreakpointProxy>
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
@@ -3373,43 +3263,28 @@
             filePath = "PDF Master/KMClass/KMPDFViewController/KMMainViewController.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2044"
-            endingLineNumber = "2044"
+            startingLineNumber = "2315"
+            endingLineNumber = "2315"
             landmarkName = "pdfViewEditingSelectionDidChanged(_:)"
             landmarkType = "7">
             <Locations>
                <Location
-                  uuid = "18021D19-EAF7-4279-A121-953E8941B3AE - ce71ce32deb310a"
+                  uuid = "18021D19-EAF7-4279-A121-953E8941B3AE - d2506868f114a772"
                   shouldBeEnabled = "Yes"
                   ignoreCount = "0"
                   continueAfterRunningActions = "No"
-                  symbolName = "PDF_Reader_Pro.KMMainViewController.pdfViewEditingSelectionDidChanged(Swift.Optional&lt;__C.CPDFView&gt;) -&gt; ()"
+                  symbolName = "PDF_Reader_Pro.KMMainViewController.pdfViewEditingAreaDidChanged(Swift.Optional&lt;__C.CPDFView&gt;) -&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 = "1999"
-                  endingLineNumber = "1999"
-                  offsetFromSymbolStart = "36">
-               </Location>
-               <Location
-                  uuid = "18021D19-EAF7-4279-A121-953E8941B3AE - ce71ce32deb32f5"
-                  shouldBeEnabled = "Yes"
-                  ignoreCount = "0"
-                  continueAfterRunningActions = "No"
-                  symbolName = "PDF_Reader_Pro.KMMainViewController.pdfViewEditingSelectionDidChanged(Swift.Optional&lt;__C.CPDFView&gt;) -&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 = "1998"
-                  endingLineNumber = "1998"
-                  offsetFromSymbolStart = "36">
+                  startingLineNumber = "2316"
+                  endingLineNumber = "2316"
+                  offsetFromSymbolStart = "104">
                </Location>
                <Location
-                  uuid = "18021D19-EAF7-4279-A121-953E8941B3AE - ce71ce32deb34e4"
+                  uuid = "18021D19-EAF7-4279-A121-953E8941B3AE - ce71ce32deb19f7"
                   shouldBeEnabled = "Yes"
                   ignoreCount = "0"
                   continueAfterRunningActions = "No"
@@ -3419,8 +3294,8 @@
                   urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/KMClass/KMPDFViewController/KMMainViewController.swift"
                   startingColumnNumber = "9223372036854775807"
                   endingColumnNumber = "9223372036854775807"
-                  startingLineNumber = "2045"
-                  endingLineNumber = "2045"
+                  startingLineNumber = "2316"
+                  endingLineNumber = "2316"
                   offsetFromSymbolStart = "36">
                </Location>
             </Locations>
@@ -3442,22 +3317,6 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            uuid = "CA1F07F0-52C0-4B88-AC73-5FBF0858023E"
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "842"
-            endingLineNumber = "842"
-            landmarkName = "customCropModel(sender:)"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
@@ -3500,10 +3359,42 @@
             filePath = "PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "353"
-            endingLineNumber = "353"
+            startingLineNumber = "349"
+            endingLineNumber = "349"
             landmarkName = "addReadModelStype()"
             landmarkType = "7">
+            <Locations>
+               <Location
+                  uuid = "C0BF1CBB-778E-4269-B4CB-BE62D03EDE4A - 416b16eb5faf7113"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Reader_Pro.KMMainViewController.setAnnotationToolStype() -&gt; __C.NSMenuItem"
+                  moduleName = "PDF Reader Pro"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "349"
+                  endingLineNumber = "349"
+                  offsetFromSymbolStart = "4772">
+               </Location>
+               <Location
+                  uuid = "C0BF1CBB-778E-4269-B4CB-BE62D03EDE4A - 670ca4c9f4b46187"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Reader_Pro.KMMainViewController.addReadModelStype() -&gt; __C.NSMenuItem"
+                  moduleName = "PDF Reader Pro"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "349"
+                  endingLineNumber = "349"
+                  offsetFromSymbolStart = "68">
+               </Location>
+            </Locations>
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
@@ -3516,10 +3407,42 @@
             filePath = "PDF Master/KMClass/KMPDFViewController/KMMainViewController.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2526"
-            endingLineNumber = "2526"
+            startingLineNumber = "2797"
+            endingLineNumber = "2797"
             landmarkName = "pdfListViewMenu(forEvent:for:click:isMoveSelectAnno:)"
             landmarkType = "7">
+            <Locations>
+               <Location
+                  uuid = "CA957B0F-74F0-4ECF-9BE5-F996315D44F7 - 41b99e031fc7cc15"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Reader_Pro.KMMainViewController.pdfListViewMenu(forEvent: Swift.Optional&lt;__C.CPDFListView&gt;, for: Swift.Optional&lt;__C.NSEvent&gt;, click: Swift.Optional&lt;Swift.AutoreleasingUnsafeMutablePointer&lt;Swift.Optional&lt;__C.NSMenu&gt;&gt;&gt;, isMoveSelectAnno: Swift.Bool) -&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 = "2797"
+                  endingLineNumber = "2797"
+                  offsetFromSymbolStart = "2964">
+               </Location>
+               <Location
+                  uuid = "CA957B0F-74F0-4ECF-9BE5-F996315D44F7 - 41b99e031fc7cc15"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Reader_Pro.KMMainViewController.pdfListViewMenu(forEvent: Swift.Optional&lt;__C.CPDFListView&gt;, for: Swift.Optional&lt;__C.NSEvent&gt;, click: Swift.Optional&lt;Swift.AutoreleasingUnsafeMutablePointer&lt;Swift.Optional&lt;__C.NSMenu&gt;&gt;&gt;, isMoveSelectAnno: Swift.Bool) -&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 = "2797"
+                  endingLineNumber = "2797"
+                  offsetFromSymbolStart = "488">
+               </Location>
+            </Locations>
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
@@ -3532,10 +3455,42 @@
             filePath = "PDF Master/KMClass/KMPDFViewController/KMMainViewController.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2344"
-            endingLineNumber = "2344"
+            startingLineNumber = "2615"
+            endingLineNumber = "2615"
             landmarkName = "pdfListViewMenuValidate(_:menuItem:isTakesEffect:)"
             landmarkType = "7">
+            <Locations>
+               <Location
+                  uuid = "E36E1A66-A8B1-4248-9550-68D820499376 - 3071b91268110fed"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Reader_Pro.KMMainViewController.pdfListViewMenuValidate(_: Swift.Optional&lt;__C.CPDFListView&gt;, menuItem: Swift.Optional&lt;__C.NSMenuItem&gt;, isTakesEffect: Swift.Optional&lt;Swift.UnsafeMutablePointer&lt;ObjectiveC.ObjCBool&gt;&gt;) -&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 = "2616"
+                  endingLineNumber = "2616"
+                  offsetFromSymbolStart = "340">
+               </Location>
+               <Location
+                  uuid = "E36E1A66-A8B1-4248-9550-68D820499376 - 3071b91268110f0c"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Reader_Pro.KMMainViewController.pdfListViewMenuValidate(_: Swift.Optional&lt;__C.CPDFListView&gt;, menuItem: Swift.Optional&lt;__C.NSMenuItem&gt;, isTakesEffect: Swift.Optional&lt;Swift.UnsafeMutablePointer&lt;ObjectiveC.ObjCBool&gt;&gt;) -&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 = "2615"
+                  endingLineNumber = "2615"
+                  offsetFromSymbolStart = "148">
+               </Location>
+            </Locations>
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
@@ -3548,10 +3503,137 @@
             filePath = "PDF Master/KMClass/KMPDFViewController/KMMainViewController.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2485"
-            endingLineNumber = "2485"
+            startingLineNumber = "2756"
+            endingLineNumber = "2756"
             landmarkName = "pdfListViewMenuItemsEditing(at:for:menuItems:)"
             landmarkType = "7">
+            <Locations>
+               <Location
+                  uuid = "829A2007-5055-4924-B2CB-8003D30BE87C - 55adff6b3ed4e3d"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Reader_Pro.KMMainViewController.pdfListViewMenuItemsEditing(at: __C.CGPoint, for: Swift.Optional&lt;__C.CPDFPage&gt;, menuItems: Swift.Optional&lt;Swift.Array&lt;__C.NSMenuItem&gt;&gt;) -&gt; Swift.Optional&lt;Swift.Array&lt;__C.NSMenuItem&gt;&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 = "2757"
+                  endingLineNumber = "2757"
+                  offsetFromSymbolStart = "328">
+               </Location>
+               <Location
+                  uuid = "829A2007-5055-4924-B2CB-8003D30BE87C - 55adff6b3ed4e5e"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Reader_Pro.KMMainViewController.pdfListViewMenuItemsEditing(at: __C.CGPoint, for: Swift.Optional&lt;__C.CPDFPage&gt;, menuItems: Swift.Optional&lt;Swift.Array&lt;__C.NSMenuItem&gt;&gt;) -&gt; Swift.Optional&lt;Swift.Array&lt;__C.NSMenuItem&gt;&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 = "2756"
+                  endingLineNumber = "2756"
+                  offsetFromSymbolStart = "136">
+               </Location>
+            </Locations>
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "C398014D-D90E-4757-A1D5-C25F15C442B2"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "PDF Master/KMClass/KMPDFViewController/Toolbar/KMPDFToolbarController.swift"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "989"
+            endingLineNumber = "989"
+            landmarkName = "componentGroupDidSelect(group:menuItemProperty:)"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "D476A27B-B99D-4890-9B5B-A0A2BD4902BC"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "PDF Master/KMClass/KMPDFViewController/Toolbar/KMPDFToolbarController.swift"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "803"
+            endingLineNumber = "803"
+            landmarkName = "componentSelectZoomDidSelect(view:menuItemProperty:)"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "88C1FB77-918D-43E1-9582-4ED4DDF51ED4"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "PDF Master/KMClass/KMPDFViewController/Toolbar/KMPDFToolbarController.swift"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "566"
+            endingLineNumber = "566"
+            landmarkName = "buttonClicked(_:)"
+            landmarkType = "7">
+            <Locations>
+               <Location
+                  uuid = "88C1FB77-918D-43E1-9582-4ED4DDF51ED4 - 343429274f673007"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Reader_Pro.KMPDFToolbarController.tabsMoreButtonClicked(KMComponentLibrary.ComponentButton) -&gt; ()"
+                  moduleName = "PDF Reader Pro"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/KMClass/KMPDFViewController/Toolbar/KMPDFToolbarController.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "566"
+                  endingLineNumber = "566"
+                  offsetFromSymbolStart = "836">
+               </Location>
+               <Location
+                  uuid = "88C1FB77-918D-43E1-9582-4ED4DDF51ED4 - 65f655ee98db78ef"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Reader_Pro.KMPDFToolbarController.buttonClicked(KMComponentLibrary.ComponentButton) -&gt; ()"
+                  moduleName = "PDF Reader Pro"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/KMClass/KMPDFViewController/Toolbar/KMPDFToolbarController.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "566"
+                  endingLineNumber = "566"
+                  offsetFromSymbolStart = "92">
+               </Location>
+               <Location
+                  uuid = "88C1FB77-918D-43E1-9582-4ED4DDF51ED4 - 65f655ee98db78ef"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Reader_Pro.KMPDFToolbarController.buttonClicked(KMComponentLibrary.ComponentButton) -&gt; ()"
+                  moduleName = "PDF Reader Pro"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/KMClass/KMPDFViewController/Toolbar/KMPDFToolbarController.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "566"
+                  endingLineNumber = "566"
+                  offsetFromSymbolStart = "168">
+               </Location>
+            </Locations>
          </BreakpointContent>
       </BreakpointProxy>
    </Breakpoints>