Quellcode durchsuchen

【2025】【PDFView】代码回撤处理

niehaoyu vor 4 Monaten
Ursprung
Commit
4b94d1a248
20 geänderte Dateien mit 466 neuen und 368 gelöschten Zeilen
  1. 5 5
      PDF Office/PDF Master/AppDelegate.swift
  2. 1 1
      PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/AINewConfigWindowController.xib
  3. 85 85
      PDF Office/PDF Master/Class/ChromiumTabs/KMBrowser.swift
  4. 1 1
      PDF Office/PDF Master/Class/ChromiumTabs/KMBrowserWindow.swift
  5. 41 41
      PDF Office/PDF Master/Class/ChromiumTabs/KMBrowserWindowController+Actions.swift
  6. 4 1
      PDF Office/PDF Master/Class/ChromiumTabs/KMBrowserWindowController.swift
  7. 6 4
      PDF Office/PDF Master/Class/ChromiumTabs/src/Tab Strip/CTTabStripModel.m
  8. 4 4
      PDF Office/PDF Master/Class/Common/OC/Property/KMInfoWindowController.swift
  9. 124 117
      PDF Office/PDF Master/Class/Document/KMMainDocument.swift
  10. 1 1
      PDF Office/PDF Master/Class/PDFTools/KMBookmark/Model/KMBookmark.swift
  11. 72 72
      PDF Office/PDF Master/Class/PDFTools/Measure/Side/KMMeasureSideVC.xib
  12. 11 11
      PDF Office/PDF Master/Class/PDFTools/Merge/OCPart/KMPDFEditAppendWindow.m
  13. 4 4
      PDF Office/PDF Master/Class/PDFTools/Snapshot/Window/SnapshotWindow.xib
  14. 1 1
      PDF Office/PDF Master/Class/PDFWindowController/Form/KMFormListMenuPopWindowController.xib
  15. 1 1
      PDF Office/PDF Master/Class/PDFWindowController/MainWindowController/SKPresentationOptionsSheetController.swift
  16. 4 4
      PDF Office/PDF Master/Class/PDFWindowController/TabWindowController/KMTabbingHintWindowController.xib
  17. 1 1
      PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController.swift
  18. 3 3
      PDF Office/PDF Master/Class/PDFWindowController/ViewController/PageSheet.xib
  19. 0 8
      PDF Office/PDF Reader Pro.xcodeproj/project.pbxproj
  20. 97 3
      PDF Office/PDF Reader Pro.xcodeproj/xcuserdata/kdanmobile.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

+ 5 - 5
PDF Office/PDF Master/AppDelegate.swift

@@ -594,11 +594,11 @@ class AppDelegate: NSObject, NSApplicationDelegate, iRateDelegate{
         }
         
         let document: KMMainDocument = model?.activeTabContents() as! KMMainDocument
-//        if let data = document.pdfViewController?.saveWatermarkFlag, !data {
-//            let represent : NSSharingService = sender.representedObject as! NSSharingService
-//            represent.perform(withItems: [document.fileURL as Any])
-//            return
-//        }
+        if let data = document.mainViewController?.saveWatermarkFlag, !data {
+            let represent : NSSharingService = sender.representedObject as! NSSharingService
+            represent.perform(withItems: [document.fileURL as Any])
+            return
+        }
 
         let represent : NSSharingService = sender.representedObject as! NSSharingService
         represent.perform(withItems: [document.fileURL as Any])

+ 1 - 1
PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/AINewConfigWindowController.xib

@@ -18,7 +18,7 @@
             <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES" fullSizeContentView="YES"/>
             <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
             <rect key="contentRect" x="196" y="240" width="276" height="739"/>
-            <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"/>
             <value key="minSize" type="size" width="276" height="739"/>
             <value key="maxSize" type="size" width="276" height="2739"/>
             <view key="contentView" id="se5-gp-TjO">

+ 85 - 85
PDF Office/PDF Master/Class/ChromiumTabs/KMBrowser.swift

@@ -44,14 +44,14 @@ import Cocoa
             isCloseAllTabViewItem = false
         } else {
             let currentDocument = tabStripModel.tabContents(at: Int32(numberOfTabViewItem-1)) as! KMMainDocument
-//            if (currentDocument.isHome == false) {
-//                currentDocument.mainViewController?.savePageNumberIfNeed()
-//                if let _isEdited = currentDocument.mainViewController?.listView.isEdited(), _isEdited, !currentDocument.isDocumentEdited {
-//                    currentDocument.updateChangeCount(.changeDone)
-//                }
-//            }
+            if (currentDocument.isHome == false) {
+                currentDocument.mainViewController?.savePageNumberIfNeed()
+                if let _isEdited = currentDocument.mainViewController?.listView.isEdited(), _isEdited, !currentDocument.isDocumentEdited {
+                    currentDocument.updateChangeCount(.changeDone)
+                }
+            }
             // 清理数据 [主要清空通知]
-//            currentDocument.mainViewController?.clearData()
+            currentDocument.mainViewController?.clearData()
             self._trackCloseDocumentEvent()
             
             if (currentDocument.isEqual(to: self.currentDocument)) {
@@ -84,44 +84,44 @@ import Cocoa
                         numberOfTabViewItem = numberOfTabViewItem - 1
                         closeTabViewItem()
                     }
-//                } else if (currentDocument.mainViewController != nil) {
-//                    if (currentDocument.mainViewController!.isPDFDocumentEdited || currentDocument.mainViewController!.needSave) {
-//                        if (isPrompt) {
-//                            let alert = NSAlert()
-//                            let message = "Do you want to save the changes made to the document “\(currentDocument.fileURL!.lastPathComponent)”?"
-//                            alert.messageText = message
-//                            alert.informativeText = NSLocalizedString("Your changes will be lost if you don’t save them.", comment: "")
-//                            alert.addButton(withTitle: NSLocalizedString("Save", comment: ""))
-//                            alert.addButton(withTitle: NSLocalizedString("Don‘t Save", comment: ""))
-//                            alert.addButton(withTitle: NSLocalizedString("Cancel", comment: ""))
-//                            let response = alert.runModal()
-//                            if (response == .alertFirstButtonReturn) { // 保存
-//                                currentDocument.save(nil)
-//                                tabStripModel.detachTabContents(at: Int32(numberOfTabViewItem - 1))
-//                                currentDocument.close()
-//                            } else if (response == .alertSecondButtonReturn) { // 不保存
-//                                tabStripModel.detachTabContents(at: Int32(numberOfTabViewItem - 1))
-//                                currentDocument.close()
-//                            } else { // 取消
-//                                self.isCloseAllTabViewItem = false
-//                            }
-//                        } else {
-//                            currentDocument.save(nil)
-//                            currentDocument.close()
-//                        }
-//                        
-//                        if isCloseAllTabViewItem {
-//                            numberOfTabViewItem = numberOfTabViewItem - 1
-//                            closeTabViewItem()
-//                        }
-//                    } else {
-//                        tabStripModel.detachTabContents(at: Int32(numberOfTabViewItem - 1))
-//                        currentDocument.close()
-//                        if isCloseAllTabViewItem {
-//                            numberOfTabViewItem = numberOfTabViewItem - 1
-//                            closeTabViewItem()
-//                        }
-//                    }
+                } else if (currentDocument.mainViewController != nil) {
+                    if (currentDocument.mainViewController!.isPDFDocumentEdited || currentDocument.mainViewController!.needSave) {
+                        if (isPrompt) {
+                            let alert = NSAlert()
+                            let message = "Do you want to save the changes made to the document “\(currentDocument.fileURL!.lastPathComponent)”?"
+                            alert.messageText = message
+                            alert.informativeText = NSLocalizedString("Your changes will be lost if you don’t save them.", comment: "")
+                            alert.addButton(withTitle: NSLocalizedString("Save", comment: ""))
+                            alert.addButton(withTitle: NSLocalizedString("Don‘t Save", comment: ""))
+                            alert.addButton(withTitle: NSLocalizedString("Cancel", comment: ""))
+                            let response = alert.runModal()
+                            if (response == .alertFirstButtonReturn) { // 保存
+                                currentDocument.save(nil)
+                                tabStripModel.detachTabContents(at: Int32(numberOfTabViewItem - 1))
+                                currentDocument.close()
+                            } else if (response == .alertSecondButtonReturn) { // 不保存
+                                tabStripModel.detachTabContents(at: Int32(numberOfTabViewItem - 1))
+                                currentDocument.close()
+                            } else { // 取消
+                                self.isCloseAllTabViewItem = false
+                            }
+                        } else {
+                            currentDocument.save(nil)
+                            currentDocument.close()
+                        }
+                        
+                        if isCloseAllTabViewItem {
+                            numberOfTabViewItem = numberOfTabViewItem - 1
+                            closeTabViewItem()
+                        }
+                    } else {
+                        tabStripModel.detachTabContents(at: Int32(numberOfTabViewItem - 1))
+                        currentDocument.close()
+                        if isCloseAllTabViewItem {
+                            numberOfTabViewItem = numberOfTabViewItem - 1
+                            closeTabViewItem()
+                        }
+                    }
                 } else {
                     tabStripModel.detachTabContents(at: Int32(numberOfTabViewItem - 1))
                     currentDocument.close()
@@ -139,10 +139,10 @@ import Cocoa
         if tabContents(at: Int32(index)) != nil {
             let currentDocument = tabContents(at: Int32(index)) as! KMMainDocument
             if (currentDocument.isHome == false) {
-//                currentDocument.mainViewController?.savePageNumberIfNeed()
-//                if let _isEdited = currentDocument.mainViewController?.listView.isEdited(), _isEdited, !currentDocument.isDocumentEdited {
-//                    currentDocument.updateChangeCount(.changeDone)
-//                }
+                currentDocument.mainViewController?.savePageNumberIfNeed()
+                if let _isEdited = currentDocument.mainViewController?.listView.isEdited(), _isEdited, !currentDocument.isDocumentEdited {
+                    currentDocument.updateChangeCount(.changeDone)
+                }
             }
             
             var canClose = false
@@ -178,39 +178,39 @@ import Cocoa
                         currentDocument.saveForWatermark()
                         canClose = false
                     }
-                } else if (currentDocument.pdfViewController != nil) {
-//                    if (currentDocument.mainViewController!.isPDFDocumentEdited || currentDocument.mainViewController!.needSave) {
-//                        if (isPrompt) {
-//                            let alert = NSAlert()
-//                            let message = "Do you want to save the changes made to the document “\(currentDocument.fileURL!.lastPathComponent)”?"
-//                            alert.messageText = message
-//                            alert.informativeText = NSLocalizedString("Your changes will be lost if you don’t save them.", comment: "")
-//                            alert.addButton(withTitle: NSLocalizedString("Save", comment: ""))
-//                            alert.addButton(withTitle: NSLocalizedString("Don‘t Save", comment: ""))
-//                            alert.addButton(withTitle: NSLocalizedString("Cancel", comment: ""))
-//                            let response = alert.runModal()
-//                            if (response == .alertFirstButtonReturn) { // 保存
-//                                if let home = self.tabContents(at: 0) as? KMMainDocument, home.isHome { // 标记 home 最近列表需要强制刷新
-//                                }
-//                                
-//                                currentDocument.save(nil)
-//                                currentDocument.close()
-//                                canClose = true
-//                            } else if (response == .alertSecondButtonReturn) { // 不保存
-//                                currentDocument.close()
-//                                canClose = true
-//                            } else { // 取消
-//                                canClose = false
-//                            }
-//                        } else {
-//                            currentDocument.save(nil)
-//                            currentDocument.close()
-//                            canClose = true
-//                        }
-//                    } else {
-//                        currentDocument.close()
-//                        canClose = true
-//                    }
+                } else if (currentDocument.mainViewController != nil) {
+                    if (currentDocument.mainViewController!.isPDFDocumentEdited || currentDocument.mainViewController!.needSave) {
+                        if (isPrompt) {
+                            let alert = NSAlert()
+                            let message = "Do you want to save the changes made to the document “\(currentDocument.fileURL!.lastPathComponent)”?"
+                            alert.messageText = message
+                            alert.informativeText = NSLocalizedString("Your changes will be lost if you don’t save them.", comment: "")
+                            alert.addButton(withTitle: NSLocalizedString("Save", comment: ""))
+                            alert.addButton(withTitle: NSLocalizedString("Don‘t Save", comment: ""))
+                            alert.addButton(withTitle: NSLocalizedString("Cancel", comment: ""))
+                            let response = alert.runModal()
+                            if (response == .alertFirstButtonReturn) { // 保存
+                                if let home = self.tabContents(at: 0) as? KMMainDocument, home.isHome { // 标记 home 最近列表需要强制刷新
+                                }
+                                
+                                currentDocument.save(nil)
+                                currentDocument.close()
+                                canClose = true
+                            } else if (response == .alertSecondButtonReturn) { // 不保存
+                                currentDocument.close()
+                                canClose = true
+                            } else { // 取消
+                                canClose = false
+                            }
+                        } else {
+                            currentDocument.save(nil)
+                            currentDocument.close()
+                            canClose = true
+                        }
+                    } else {
+                        currentDocument.close()
+                        canClose = true
+                    }
                 } else {
                     currentDocument.close()
                     canClose = true
@@ -218,7 +218,7 @@ import Cocoa
             }
             if (canClose) {
                 // 清理数据 [主要清空通知]
-//                currentDocument.mainViewController?.clearData()
+                currentDocument.mainViewController?.clearData()
                 self._trackCloseDocumentEvent()
             }
             return canClose
@@ -239,7 +239,7 @@ import Cocoa
             let currentDocument: KMMainDocument = document! as! KMMainDocument
             let index = self.tabStripModel.index(of: currentDocument)
             // 清空数据 [主要清理通知]
-//            currentDocument.mainViewController?.clearData()
+            currentDocument.mainViewController?.clearData()
             self._trackCloseDocumentEvent()
             if index != kNoTab {
                 self.tabStripModel.detachTabContents(at: index)
@@ -280,7 +280,7 @@ import Cocoa
             let index = tabStripModel.index(of: currentCloseDocument)
             tabStripModel.detachTabContents(at: index)
             // 清空数据 [主要清理通知]
-//            currentCloseDocument?.mainViewController?.clearData()
+            currentCloseDocument?.mainViewController?.clearData()
             currentCloseDocument?.close()
             currentCloseDocument = nil
             self._trackCloseDocumentEvent()

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

@@ -32,7 +32,7 @@ class KMBrowserWindow: CTBrowserWindow {
         
         if let browser = (self.windowController as? KMBrowserWindowController)?.browser {
             let document = browser.activeTabContents() as? KMMainDocument
-//            document?.pdfViewController?.hideMeasureFloatingWindows()
+            document?.mainViewController?.hideMeasureFloatingWindows()
         }
     }
 }

+ 41 - 41
PDF Office/PDF Master/Class/ChromiumTabs/KMBrowserWindowController+Actions.swift

@@ -23,11 +23,11 @@ extension KMBrowserWindowController {
 //        if useNativeFullScreen() {
 //            return interactionMode == .SKNormalMode || interactionMode == .SKPresentationMode
 //        } else {
-//        if let mainVc = (self.document as? KMMainDocument)?.mainViewController {
-//            if mainVc.canEnterFullscreen() == false {
-//                return false
-//            }
-//        }
+        if let mainVc = (self.document as? KMMainDocument)?.mainViewController {
+            if mainVc.canEnterFullscreen() == false {
+                return false
+            }
+        }
         let mode = self.interactionMode
         if mode == .fullScreen || mode == .legacyFullScreen {
             return false
@@ -43,11 +43,11 @@ extension KMBrowserWindowController {
             return false
         }
         
-//        if let mainVc = (self.document as? KMMainDocument)?.pdfViewController {
-//            if mainVc.canEnterPresentation() == false {
-//                return false
-//            }
-//        }
+        if let mainVc = (self.document as? KMMainDocument)?.mainViewController {
+            if mainVc.canEnterPresentation() == false {
+                return false
+            }
+        }
         return can
     }
     
@@ -84,43 +84,43 @@ extension KMBrowserWindowController {
         self.window?.isSwitchingFullScreen = true
         if wasInteractionMode == .legacyFullScreen {
             let doc = self.document as? KMMainDocument
-//            view = doc?.mainViewController?.pdfSplitView
-//            contentView = doc?.mainViewController?.centerContentView
+            view = doc?.mainViewController?.pdfSplitView
+            contentView = doc?.mainViewController?.centerContentView
         } else {
             let doc = self.document as? KMMainDocument
-//            view = doc?.mainViewController?.listView
-//            contentView = doc?.mainViewController?.readContentView
+            view = doc?.mainViewController?.listView
+            contentView = doc?.mainViewController?.readContentView
         }
 
         self.hideLeftSideWindow()
         self.hideRightSideWindow()
 
         let doc = self.document as? KMMainDocument
-//       let mainViewController = doc?.mainViewController
-//        
-//        mainViewController?.presentationTopViewController?.view.removeFromSuperview()
-//
-//        if let v = view {
-//            self.fadeOutFullScreenView(v)
-//            view?.frame = contentView?.bounds ?? .zero
-//            contentView?.addSubview(v)
-//            v.mas_makeConstraints { make in
-//                make?.left.mas_equalTo()(0)
-//                make?.right.mas_equalTo()(0)
-//                make?.top.mas_equalTo()(0)
-//                make?.bottom.mas_equalTo()(0)
-//            }
-//            (v as? CPDFListView)?.isPresentationMode = false
-//            (v as? CPDFListView)?.layoutDocumentView()
-//            (v as? CPDFListView)?.requiresDisplay()
-//            if (v as? CPDFListView)?.isEnterPresentationDrawMode() == true {
-//                (v as? CPDFListView)?.exitPresentationDrawMode()
-//            }
-//        }
-//
-//        if let mainVc = (self.document as? KMMainDocument)?.mainViewController {
-//            mainVc.exitFullscreenMode()
-//        }
+       let mainViewController = doc?.mainViewController
+        
+        mainViewController?.presentationTopViewController?.view.removeFromSuperview()
+
+        if let v = view {
+            self.fadeOutFullScreenView(v)
+            view?.frame = contentView?.bounds ?? .zero
+            contentView?.addSubview(v)
+            v.mas_makeConstraints { make in
+                make?.left.mas_equalTo()(0)
+                make?.right.mas_equalTo()(0)
+                make?.top.mas_equalTo()(0)
+                make?.bottom.mas_equalTo()(0)
+            }
+            (v as? CPDFListView)?.isPresentationMode = false
+            (v as? CPDFListView)?.layoutDocumentView()
+            (v as? CPDFListView)?.requiresDisplay()
+            if (v as? CPDFListView)?.isEnterPresentationDrawMode() == true {
+                (v as? CPDFListView)?.exitPresentationDrawMode()
+            }
+        }
+
+        if let mainVc = (self.document as? KMMainDocument)?.mainViewController {
+            mainVc.exitFullscreenMode()
+        }
         self.window?.isSwitchingFullScreen = false
 
         self.forceSubwindowsOnTop(false)
@@ -169,7 +169,7 @@ extension KMBrowserWindowController {
             return
         }
         
-        let mainVc = (self.document as? KMMainDocument)?.pdfViewController
+        let mainVc = (self.document as? KMMainDocument)?.mainViewController
         let mainWindow = fullScreenWindow.interactionParent
         let collectionBehavior = mainWindow?.collectionBehavior
         
@@ -187,7 +187,7 @@ extension KMBrowserWindowController {
         mainWindow?.alphaValue = 1.0
         mainWindow?.collectionBehavior = collectionBehavior!
         mainWindow?.display()
-//        mainWindow?.makeFirstResponder(mainVc?.listView)
+        mainWindow?.makeFirstResponder(mainVc?.listView)
         mainWindow?.recalculateKeyViewLoop()
         mainWindow?.delegate = self
         mainWindow?.makeKey()

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

@@ -151,6 +151,7 @@ import Cocoa
     
     func showSnapshots(setups: NSArray?) {
         let doc = self.document as? KMMainDocument
+        doc?.mainViewController?.showSnapshots(setups: setups)
 
     }
     
@@ -416,9 +417,11 @@ import Cocoa
         
         if let _userInfo = notification.userInfo, let _newContents = _userInfo[CTTabNewContentsUserInfoKey] as? KMMainDocument {
             _newContents.addWindowController(self)
-            
+            _newContents.mainViewController?.showMeasureFloatingWindowsIfNeed()
+
         }
         if let _userInfo = notification.userInfo, let _oldContents = _userInfo[CTTabContentsUserInfoKey] as? KMMainDocument {
+            _oldContents.mainViewController?.hideMeasureFloatingWindows()
 
         }
     }

+ 6 - 4
PDF Office/PDF Master/Class/ChromiumTabs/src/Tab Strip/CTTabStripModel.m

@@ -769,8 +769,9 @@ const int kNoTab = NSNotFound;
     for (TabContentsData *data in contentsData_) {
         CTTabContents *content = data->contents;
         KMMainDocument *doc = (KMMainDocument *)content;
-        if ([doc.pdfViewController isKindOfClass:[KMPDFViewController class]]) {
-            KMPDFViewController *mainViewCtrl = doc.pdfViewController;
+        if ([doc.mainViewController isKindOfClass:[KMMainViewController class]]) {
+            KMMainViewController *mainViewCtrl = doc.mainViewController;
+            isShow = mainViewCtrl.model.isShowQuickTour;
             if (isShow) break;
         }
         if ([doc.homeViewController isKindOfClass:[KMNHomeViewController class]]) {
@@ -812,8 +813,9 @@ const int kNoTab = NSNotFound;
     for (TabContentsData *data in contentsData_) {
         CTTabContents *content = data->contents;
         KMMainDocument *doc = (KMMainDocument *)content;
-        if ([doc.pdfViewController isKindOfClass:[KMPDFViewController class]]) {
-            KMPDFViewController *mainViewCtrl = doc.pdfViewController;
+        if ([doc.mainViewController isKindOfClass:[KMMainViewController class]]) {
+            KMMainViewController *mainViewCtrl = doc.mainViewController;
+            isShow = mainViewCtrl.model.isShowQuickTour;
             if (isShow) break;
         }
         if ([doc.homeViewController isKindOfClass:[KMNHomeViewController class]]) {

+ 4 - 4
PDF Office/PDF Master/Class/Common/OC/Property/KMInfoWindowController.swift

@@ -191,7 +191,7 @@ class KMInfoWindowController: NSWindowController {
         var physicalSize: Int64 = 0
         
         if let data = doc, data.isKind(of: KMMainDocument.self) {
-            if let pdfDoc = (data as! KMMainDocument).pdfViewController?.document {
+            if let pdfDoc = (data as! KMMainDocument).mainViewController?.document {
                 dictionary.addEntries(from: pdfDoc.documentAttributes())
                 dictionary.setValue(String(format: "%ld.%ld", pdfDoc.majorVersion, pdfDoc.minorVersion), forKey: KMInfoVersionKey)
                 dictionary.setValue(NSNumber(value: pdfDoc.pageCount), forKey: KMInfoPageCountKey)
@@ -246,7 +246,7 @@ class KMInfoWindowController: NSWindowController {
         }
         
         if (doc.isKind(of: KMMainDocument.self)) {
-            guard let pdfDocument = (doc as! KMMainDocument).pdfViewController?.document else {
+            guard let pdfDocument = (doc as! KMMainDocument).mainViewController?.document else {
                 return
             }
             if (pdfDocument.isEqual(to: sender.object)) {
@@ -261,7 +261,7 @@ class KMInfoWindowController: NSWindowController {
             if (self.editDictionary.count > 0) {
                 if let windowController = NSApp.mainWindow?.windowController, windowController.isKind(of: KMBrowserWindowController.self) {
                     let document = (windowController as! KMBrowserWindowController).document as? KMMainDocument
-                    var dic: NSMutableDictionary = NSMutableDictionary(dictionary: document?.pdfViewController?.document?.documentAttributes() ?? [:])
+                    var dic: NSMutableDictionary = NSMutableDictionary(dictionary: document?.mainViewController?.document?.documentAttributes() ?? [:])
                     var isSave = false
                     for key in self.editDictionary.allKeys {
                         if let data = key as? NSString, data.isEqual(to: KMInfoKeywordsStringKey) {
@@ -278,7 +278,7 @@ class KMInfoWindowController: NSWindowController {
                         }
                     }
                     if (isSave) {
-                        document?.pdfViewController?.document?.setDocumentAttributes(dic as? [CPDFDocumentAttribute : Any])
+                        document?.mainViewController?.document?.setDocumentAttributes(dic as? [CPDFDocumentAttribute : Any])
                         document?.save(nil)
                     }
                 }

+ 124 - 117
PDF Office/PDF Master/Class/Document/KMMainDocument.swift

@@ -34,7 +34,7 @@ typealias KMMainDocumentCloudUploadHanddler = (@escaping(Bool, String)->()) -> (
     
     static let kBundleDataFilename = "data"
     
-    var pdfViewController: KMPDFViewController?
+    var mainViewController: KMMainViewController?
     var homeViewController: KMNHomeViewController?
     
     var bookmarkSheetController: KMBookmarkSheetController?
@@ -50,22 +50,22 @@ typealias KMMainDocumentCloudUploadHanddler = (@escaping(Bool, String)->()) -> (
     var currentDocumentSetup: [String: Any] {
         get {
             var tempSetup: [String: Any] = [:]
-//            let tempMainSetup: [String: Any] = mainViewController?.currentSetup() ?? [:]
-//            let filePath = fileURL?.path ?? ""
-//            if filePath.count > 0{
-//                tempSetup.updateValue(filePath, forKey: KMDocumentSetupFileNameKey)
-//            }else {
-//                return tempSetup
-//            }
-//            if let alias = SKAlias.init(url: fileURL){
-//                if let data = alias.data{
-//                    tempSetup.updateValue(data as Any, forKey: KMDocumentSetupAliasKey)
-//                }
-//            }
-//            
-//            if tempSetup.count > 0 {
-//                tempSetup.merge(tempMainSetup) { (_, new) in new }
-//            }
+            let tempMainSetup: [String: Any] = mainViewController?.currentSetup() ?? [:]
+            let filePath = fileURL?.path ?? ""
+            if filePath.count > 0{
+                tempSetup.updateValue(filePath, forKey: KMDocumentSetupFileNameKey)
+            }else {
+                return tempSetup
+            }
+            if let alias = SKAlias.init(url: fileURL){
+                if let data = alias.data{
+                    tempSetup.updateValue(data as Any, forKey: KMDocumentSetupAliasKey)
+                }
+            }
+            
+            if tempSetup.count > 0 {
+                tempSetup.merge(tempMainSetup) { (_, new) in new }
+            }
             return tempSetup
         }
         set {
@@ -116,12 +116,12 @@ typealias KMMainDocumentCloudUploadHanddler = (@escaping(Bool, String)->()) -> (
                     if let data = params.first as? KMResult, data == .cancel {
                         if let shouldClose = params.last as? Bool, shouldClose {
                             DispatchQueue.main.async {
-
+                                self.mainViewController?.browserWindowController?.browser.windowDidBeginToClose()
                             }
                         }
                     } else {
                         DispatchQueue.main.async {
-
+                            self.mainViewController?.browserWindowController?.browser.windowDidBeginToClose()
                         }
                     }
                     return
@@ -194,19 +194,19 @@ typealias KMMainDocumentCloudUploadHanddler = (@escaping(Bool, String)->()) -> (
             browser.windowController.showWindow(self)
         }
         
-        pdfViewController = KMPDFViewController.init()
-        pdfViewController?.myDocument = self
+        mainViewController = KMMainViewController.init()
+        mainViewController?.myDocument = self
         self.mdFlags = MDFlags(exportOption: 0, exportUsingPanel: 0, gettingFileType: 0, convertingNotes: 0, needsPasswordToConvert: 0)
         
         if ((self.fileURL?.path) != nil) {
             let pdfDocument = CPDFDocument.init(url: URL(fileURLWithPath: self.fileURL!.path))
-            pdfViewController?.document = pdfDocument
+            mainViewController?.document = pdfDocument
         }
-        if pdfViewController?.document == nil {
+        if mainViewController?.document == nil {
             return
         }
-        self.view = pdfViewController?.view
-        
+        self.view = mainViewController?.view
+
         if let url = self.fileURL {
             AppSandboxFileAccess().persistPermissionURL(url as URL)
             let bookmarkData = try?url.bookmarkData(options: NSURL.BookmarkCreationOptions.withSecurityScope, includingResourceValuesForKeys: nil, relativeTo: nil)
@@ -223,7 +223,7 @@ typealias KMMainDocumentCloudUploadHanddler = (@escaping(Bool, String)->()) -> (
             let isfirstTab = (activeIndex == 0)
             if ishome && !isfirstTab { // 替换 【标签需要被替换】
                 self.addWindowController(currentWindowController!)
-//                self.mainViewController?.browserWindowController = currentWindowController
+                self.mainViewController?.browserWindowController = currentWindowController
                 
                 // 替换 document
                 currentWindowController?.browser.replaceTabContents(at: Int32(activeIndex), with: self)
@@ -247,10 +247,10 @@ typealias KMMainDocumentCloudUploadHanddler = (@escaping(Bool, String)->()) -> (
                         browser.windowController.showWindow(self)
                         browser.add(self, at: Int32()-1, inForeground: true)
                         self.addWindowController(browser.windowController)
-//                        self.mainViewController?.browserWindowController = browser.windowController as? KMBrowserWindowController
+                        self.mainViewController?.browserWindowController = browser.windowController as? KMBrowserWindowController
                 }else { // 正常拼接到后面
                     self.addWindowController(currentWindowController!)
-//                    self.mainViewController?.browserWindowController = currentWindowController
+                    self.mainViewController?.browserWindowController = currentWindowController
                     currentWindowController?.browser.add(self, at: Int32()-1, inForeground: true)
                 }
             }
@@ -310,10 +310,10 @@ typealias KMMainDocumentCloudUploadHanddler = (@escaping(Bool, String)->()) -> (
             self.save(nil)
         } else if (self.isDocumentEdited) {
             self.save(nil)
-//        } else if (mainViewController != nil) {
-//            if self.mainViewController!.isPDFDocumentEdited || self.mainViewController!.needSave {
-//                self.save(nil)
-//            }
+        } else if (mainViewController != nil) {
+            if self.mainViewController!.isPDFDocumentEdited || self.mainViewController!.needSave {
+                self.save(nil)
+            }
         }
 
         super.canClose(withDelegate: delegate, shouldClose: shouldCloseSelector, contextInfo: contextInfo)
@@ -332,7 +332,7 @@ typealias KMMainDocumentCloudUploadHanddler = (@escaping(Bool, String)->()) -> (
     }
     
     override func saveTo(_ sender: Any?) {
-        guard let pdfDoc = self.pdfViewController?.document else {
+        guard let pdfDoc = self.mainViewController?.listView.document else {
             NSSound.beep()
             return
         }
@@ -453,7 +453,7 @@ typealias KMMainDocumentCloudUploadHanddler = (@escaping(Bool, String)->()) -> (
         if mainWindow != nil {
             let windowController = mainWindow!.windowController
             if windowController?.window?.screen?.isEqual(NSScreen.screens[0]) ?? false{
-//                return mainViewController?.interactionMode ?? .normal
+                return mainViewController?.interactionMode ?? .normal
             }
         }
         
@@ -476,12 +476,12 @@ typealias KMMainDocumentCloudUploadHanddler = (@escaping(Bool, String)->()) -> (
                     if let data = params.first as? KMResult, data == .cancel {
                         if let shouldClose = params.last as? Bool, shouldClose {
                             DispatchQueue.main.async {
-//                                self.mainViewController?.browserWindowController?.browser.windowDidBeginToClose()
+                                self.mainViewController?.browserWindowController?.browser.windowDidBeginToClose()
                             }
                         }
                     } else {
                         DispatchQueue.main.async {
-//                            self.mainViewController?.browserWindowController?.browser.windowDidBeginToClose()
+                            self.mainViewController?.browserWindowController?.browser.windowDidBeginToClose()
                         }
                     }
                     return
@@ -524,7 +524,7 @@ typealias KMMainDocumentCloudUploadHanddler = (@escaping(Bool, String)->()) -> (
     // MARK: Autosaving
     
     override func close() {
-//        mainViewController?.cancelMeasureType()
+        mainViewController?.cancelMeasureType()
         if self.isActive {
             if browser != nil {
                 var activeIndex = 0
@@ -583,9 +583,9 @@ typealias KMMainDocumentCloudUploadHanddler = (@escaping(Bool, String)->()) -> (
     }
     
     func needSaveWatermark() -> Bool {
-//        if let need = self.mainViewController?.saveWatermarkFlag {
-//            return need
-//        }
+        if let need = self.mainViewController?.saveWatermarkFlag {
+            return need
+        }
         return false
     }
     
@@ -597,7 +597,7 @@ typealias KMMainDocumentCloudUploadHanddler = (@escaping(Bool, String)->()) -> (
 
     func pdfChangedNotification(_ notification: Notification) -> Void {
         if !isHome {
-            let mainViewController = pdfViewController
+            let mainViewController = mainViewController
             var document: CPDFDocument!
             
             let dic = notification.object as? NSDictionary
@@ -666,7 +666,7 @@ typealias KMMainDocumentCloudUploadHanddler = (@escaping(Bool, String)->()) -> (
     }
     
     func setDataFromTmpData() {
-        guard let _document = self.pdfViewController?.document else {
+        guard let _document = self.mainViewController?.document else {
             return
         }
         if (_document.permissionsStatus != .owner) {
@@ -678,7 +678,7 @@ typealias KMMainDocumentCloudUploadHanddler = (@escaping(Bool, String)->()) -> (
             self.getPassword(&password, fileId: fileId)
             if (password != nil) {
                 self.isUnlockFromKeychain = true
-//                self.mainViewController?.model.password = password as String?
+                self.mainViewController?.model.password = password as String?
             }
         }
         
@@ -713,6 +713,8 @@ typealias KMMainDocumentCloudUploadHanddler = (@escaping(Bool, String)->()) -> (
             if (password != nil) {
                 self.isUnlockFromKeychain = true
                 document.unlock(withPassword: password! as String)
+                self.mainViewController?.model.password = password as String?
+                
             }
         }
     }
@@ -796,10 +798,10 @@ typealias KMMainDocumentCloudUploadHanddler = (@escaping(Bool, String)->()) -> (
         KMPrint("convertNotes")
     }
     @IBAction func batchRemovePassWord(_ sender: Any?) {
-
+        self.mainViewController?.clickChildTool(type: .secure, index: 2)
     }
     @IBAction func batchRemovPrivatySecurity(_ sender: Any?) {
-
+        self.mainViewController?.removeOwnerPassword()
     }
     @IBAction func printPDFDocument(_ sender: Any?) {
 
@@ -835,8 +837,12 @@ typealias KMMainDocumentCloudUploadHanddler = (@escaping(Bool, String)->()) -> (
 
             switch type {
             case .bookmark:
-                let mainViewController = pdfViewController
-                
+                let mainViewController = mainViewController
+                if let page = mainViewController?.listView.currentPage() {
+                    let index: UInt = page.pageIndex()
+                    bookmark = KMBookmark.bookmark(url: self.fileURL!, pageIndex: index, label: label)
+                }
+
             case .setup: break
                 let setup = currentDocumentSetup
                 bookmark = KMBookmark.bookmark(setup: setup, label: label)
@@ -885,7 +891,7 @@ typealias KMMainDocumentCloudUploadHanddler = (@escaping(Bool, String)->()) -> (
         if let data = self.pdfData {
             fileWrapper.addRegularFile(withContents: data, preferredFilename: aName + ".pdf")
         }
-        if let data = self.pdfViewController?.document?.string()?.data(using: .utf8) {
+        if let data = self.mainViewController?.document?.string()?.data(using: .utf8) {
             fileWrapper.addRegularFile(withContents: data, preferredFilename: Self.kBundleDataFilename + ".txt")
         }
         if let data = try?PropertyListSerialization.data(fromPropertyList: info, format: .xml, options: PropertyListSerialization.WriteOptions(0)) {
@@ -906,34 +912,35 @@ typealias KMMainDocumentCloudUploadHanddler = (@escaping(Bool, String)->()) -> (
         }
         var success = true
         if !self.isHome {
-            if pdfViewController != nil {
-//                pdfViewController?.savePdfAlertView()
-                if pdfViewController?.document != nil {
-//                    self.pdfViewController?.commitEditingIfNeed()
+            if mainViewController != nil {
+                mainViewController?.savePdfAlertView()
+                if mainViewController?.document != nil {
+                    self.mainViewController?.commitEditingIfNeed()
+
                     
-//                    if (mainViewController!.needSave) {
-//                        if let options = self.mainViewController?.secureOptions, !options.isEmpty {
-//                            self.mainViewController!.document?.setDocumentAttributes(self.mainViewController?.documentAttribute)
-//                            success = self.mainViewController!.document!.write(to: url, withOptions: options)
-//                        } else if let flag = self.mainViewController?.removeSecureFlag, flag {
-//                            success = self.mainViewController!.document!.writeDecrypt(to: url)
-//                        } else {
-//                            if(mainViewController?.hasEnterRedact() == true) {
-//                                success = mainViewController?.redactController.redactPdfView.document?.write(to: url) ?? false
-//                            } else {
-//                                success = mainViewController!.document!.write(to: url)
-//                            }
-//                        }
-//                    } else {
-//                        if(mainViewController?.hasEnterRedact() == true) {
-//                            success = mainViewController?.redactController.redactPdfView.document?.write(to: url) ?? false
-//                        } else {
-//                            success = mainViewController!.document!.write(to: url)
-//                        }
-//                    }
-//                    self.mainViewController?.needSave = false
-//                    self.mainViewController?.clearSecureOptions()
-//                    self.mainViewController?.clearRemoveSecureFlag()
+                    if (mainViewController!.needSave) {
+                        if let options = self.mainViewController?.secureOptions, !options.isEmpty {
+                            self.mainViewController!.document?.setDocumentAttributes(self.mainViewController?.documentAttribute)
+                            success = self.mainViewController!.document!.write(to: url, withOptions: options)
+                        } else if let flag = self.mainViewController?.removeSecureFlag, flag {
+                            success = self.mainViewController!.document!.writeDecrypt(to: url)
+                        } else {
+                            if(mainViewController?.hasEnterRedact() == true) {
+                                success = mainViewController?.redactController.redactPdfView.document?.write(to: url) ?? false
+                            } else {
+                                success = mainViewController!.document!.write(to: url)
+                            }
+                        }
+                    } else {
+                        if(mainViewController?.hasEnterRedact() == true) {
+                            success = mainViewController?.redactController.redactPdfView.document?.write(to: url) ?? false
+                        } else {
+                            success = mainViewController!.document!.write(to: url)
+                        }
+                    }
+                    self.mainViewController?.needSave = false
+                    self.mainViewController?.clearSecureOptions()
+                    self.mainViewController?.clearRemoveSecureFlag()
                 }
             }
         } else {
@@ -950,9 +957,9 @@ typealias KMMainDocumentCloudUploadHanddler = (@escaping(Bool, String)->()) -> (
         if success && isNewCreated && NSDocument.SaveOperationType.saveAsOperation == saveOperation {
             isNewCreated = false
         }
-//        if mainViewController != nil {
-//            mainViewController?.savePdfFinishAlertView()
-//        }
+        if mainViewController != nil {
+            mainViewController?.savePdfFinishAlertView()
+        }
     }
     
     private func _km_saveForWatermark(openAccessoryView: Bool = true, subscribeDidClick: (()->Void)? = nil, callback:@escaping (_ needSave: Bool, _ param: Any...)->Void) {
@@ -974,7 +981,7 @@ typealias KMMainDocumentCloudUploadHanddler = (@escaping(Bool, String)->()) -> (
                     }
                     
                     if (isWaterMarkExport) {
-                        guard let _document = self.pdfViewController?.document else {
+                        guard let _document = self.mainViewController?.document else {
                             callback(false, KMResult.failure)
                             return
                         }
@@ -992,18 +999,18 @@ typealias KMMainDocumentCloudUploadHanddler = (@escaping(Bool, String)->()) -> (
                                     callback(false, KMResult.cancel, true)
                                     return
                                 }
-//                                guard let _url = KMTools.saveWatermarkDocument(document: _document, to: url!, secureOptions: self.mainViewController?.secureOptions, documentAttribute: self.mainViewController?.documentAttribute,removePWD: self.mainViewController!.removeSecureFlag) else {
-//                                    callback(false, KMResult.failure)
-//                                    return
-//                                }
-//                                callback(false, KMResult.success)
-//                                if (isOpen) {
-//                                    NSDocumentController.shared.km_safe_openDocument(withContentsOf: _url, display: true) { _, _, _ in
-//                                        
-//                                    }
-//                                } else {
-//                                    NSWorkspace.shared.activateFileViewerSelecting([_url])
-//                                }
+                                guard let _url = KMTools.saveWatermarkDocument(document: _document, to: url!, secureOptions: self.mainViewController?.secureOptions, documentAttribute: self.mainViewController?.documentAttribute,removePWD: self.mainViewController!.removeSecureFlag) else {
+                                    callback(false, KMResult.failure)
+                                    return
+                                }
+                                callback(false, KMResult.success)
+                                if (isOpen) {
+                                    NSDocumentController.shared.km_safe_openDocument(withContentsOf: _url, display: true) { _, _, _ in
+                                        
+                                    }
+                                } else {
+                                    NSWorkspace.shared.activateFileViewerSelecting([_url])
+                                }
                             }
                         }
                         return
@@ -1046,17 +1053,17 @@ typealias KMMainDocumentCloudUploadHanddler = (@escaping(Bool, String)->()) -> (
         if self._canAttachNotesForType(typeName) {
             matrix?.isHidden = false
             let ws = NSWorkspace.shared
-//            let isLocked = self.mainViewController?.listView.document.isLocked ?? false
-//            let allowsPrinting = self.mainViewController?.listView.document.allowsPrinting ?? false
-//            if ws.type(typeName, conformsToType: KMPDFDocumentType) && isLocked == false && allowsPrinting {
-//                (matrix?.cell(withTag: KMExportOption.withEmbeddedNotes.rawValue))?.isEnabled = true
-//            } else {
-//                (matrix?.cell(withTag: KMExportOption.withEmbeddedNotes.rawValue))?.isEnabled = false
-//                if let data = self.mdFlags?.exportOption, data == KMExportOption.withEmbeddedNotes.rawValue {
-//                    self.mdFlags?.exportOption = UInt32(KMExportOption.default.rawValue)
-//                    matrix?.selectCell(withTag: KMExportOption.default.rawValue)
-//                }
-//            }
+            let isLocked = self.mainViewController?.listView.document.isLocked ?? false
+            let allowsPrinting = self.mainViewController?.listView.document.allowsPrinting ?? false
+            if ws.type(typeName, conformsToType: KMPDFDocumentType) && isLocked == false && allowsPrinting {
+                (matrix?.cell(withTag: KMExportOption.withEmbeddedNotes.rawValue))?.isEnabled = true
+            } else {
+                (matrix?.cell(withTag: KMExportOption.withEmbeddedNotes.rawValue))?.isEnabled = false
+                if let data = self.mdFlags?.exportOption, data == KMExportOption.withEmbeddedNotes.rawValue {
+                    self.mdFlags?.exportOption = UInt32(KMExportOption.default.rawValue)
+                    matrix?.selectCell(withTag: KMExportOption.default.rawValue)
+                }
+            }
         } else {
             matrix?.isHidden = true
         }
@@ -1119,7 +1126,7 @@ typealias KMMainDocumentCloudUploadHanddler = (@escaping(Bool, String)->()) -> (
         if self.isHome {
             return NSPrintOperation()
         }
-        let documentURL = self.pdfViewController?.document?.documentURL
+        let documentURL = self.mainViewController?.document?.documentURL
         if documentURL == nil {
             return NSPrintOperation()
         }
@@ -1171,7 +1178,7 @@ extension KMMainDocument {
                 return self.isDocumentEdited
             }
             
-            guard let mainVC = self.pdfViewController else {
+            guard let mainVC = self.mainViewController else {
                 return false
             }
 //            return mainVC.isPDFDocumentEdited || mainVC.needSave
@@ -1181,7 +1188,7 @@ extension KMMainDocument {
             if self.isHome {
                 return false
             }
-            guard let doc = self.pdfViewController?.document else {
+            guard let doc = self.mainViewController?.document else {
                 return false
             }
             let allowsPrinting = doc.allowsPrinting
@@ -1418,18 +1425,18 @@ extension KMMainDocument: SKPDFSynchronizerDelegate {
     }
     
     func synchronizer(_ synchronizer: SKPDFSynchronizer!, foundLocation point: NSPoint, atPageIndex pageIndex: UInt, options: Int) {
-//        guard let pdfDoc = self.mainViewController?.document else { return }
-//        if pageIndex < pdfDoc.pageCount {
-//            if let page = pdfDoc.page(at: pageIndex) {
-//                var adjustedPoint = point
-//                if options & SKPDFSynchronizerFlippedMask != 0 {
-//                    let mediaBox = page.bounds(for: .mediaBox)
-//                    adjustedPoint.y = NSMaxY(mediaBox) - adjustedPoint.y
-//                }
-//                
-//                self.mainViewController?.listView.displayLine(at: adjustedPoint, inPageAtIndex: Int(pageIndex), showReadingBar: options & SKPDFSynchronizerShowReadingBarMask != 0)
-//            }
-//        }
+        guard let pdfDoc = self.mainViewController?.document else { return }
+        if pageIndex < pdfDoc.pageCount {
+            if let page = pdfDoc.page(at: pageIndex) {
+                var adjustedPoint = point
+                if options & SKPDFSynchronizerFlippedMask != 0 {
+                    let mediaBox = page.bounds(for: .mediaBox)
+                    adjustedPoint.y = NSMaxY(mediaBox) - adjustedPoint.y
+                }
+                
+                self.mainViewController?.listView.displayLine(at: adjustedPoint, inPageAtIndex: Int(pageIndex), showReadingBar: options & SKPDFSynchronizerShowReadingBarMask != 0)
+            }
+        }
     }
 }
 

+ 1 - 1
PDF Office/PDF Master/Class/PDFTools/KMBookmark/Model/KMBookmark.swift

@@ -289,7 +289,7 @@ class KMBookmark: NSObject {
                 NSApp.presentError(error!)
             } else {
                 if self.pageIndex > 1 {
-//                    (document as! KMMainDocument).mainViewController?.setPageNumber = self.pageIndex + 1
+                    (document as! KMMainDocument).mainViewController?.setPageNumber = self.pageIndex + 1
                 }
             }
         })

+ 72 - 72
PDF Office/PDF Master/Class/PDFTools/Measure/Side/KMMeasureSideVC.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="Named colors" minToolsVersion="9.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -70,20 +70,20 @@
             <rect key="frame" x="0.0" y="0.0" width="481" height="661"/>
             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
             <clipView key="contentView" drawsBackground="NO" copiesOnScroll="NO" id="k30-Q9-hNL" customClass="KMClipView">
-                <rect key="frame" x="0.0" y="0.0" width="481" height="661"/>
+                <rect key="frame" x="0.0" y="0.0" width="466" height="661"/>
                 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                 <subviews>
                     <view translatesAutoresizingMaskIntoConstraints="NO" id="hrB-1R-XwJ">
-                        <rect key="frame" x="0.0" y="-79" width="481" height="740"/>
+                        <rect key="frame" x="0.0" y="-84" width="466" height="745"/>
                         <subviews>
                             <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="dV9-GQ-3pk">
-                                <rect key="frame" x="16" y="660" width="449" height="80"/>
+                                <rect key="frame" x="16" y="665" width="434" height="80"/>
                                 <view key="contentView" id="KK3-7C-TZH">
-                                    <rect key="frame" x="0.0" y="0.0" width="449" height="80"/>
+                                    <rect key="frame" x="0.0" y="0.0" width="434" height="80"/>
                                     <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                     <subviews>
                                         <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="rz1-qu-YbV">
-                                            <rect key="frame" x="155" y="10" width="140" height="60"/>
+                                            <rect key="frame" x="147" y="10" width="140" height="60"/>
                                             <constraints>
                                                 <constraint firstAttribute="width" constant="140" id="EEd-wg-jEP"/>
                                                 <constraint firstAttribute="height" constant="60" id="l6D-l4-Nrm"/>
@@ -102,10 +102,10 @@
                                 <color key="fillColor" red="0.99999600649999998" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                             </box>
                             <customView hidden="YES" translatesAutoresizingMaskIntoConstraints="NO" id="db4-tx-GKU">
-                                <rect key="frame" x="16" y="616" width="449" height="32"/>
+                                <rect key="frame" x="16" y="621" width="434" height="32"/>
                                 <subviews>
                                     <customView translatesAutoresizingMaskIntoConstraints="NO" id="KJb-7Z-NB6">
-                                        <rect key="frame" x="145" y="0.0" width="160" height="32"/>
+                                        <rect key="frame" x="137" y="0.0" width="160" height="32"/>
                                         <subviews>
                                             <customView translatesAutoresizingMaskIntoConstraints="NO" id="R0Y-iB-Whq">
                                                 <rect key="frame" x="0.0" y="0.0" width="40" height="32"/>
@@ -245,9 +245,9 @@
                                 </constraints>
                             </customView>
                             <customView translatesAutoresizingMaskIntoConstraints="NO" id="stF-lk-Px9">
-                                <rect key="frame" x="16" y="327" width="449" height="64"/>
+                                <rect key="frame" x="16" y="329" width="434" height="64"/>
                                 <subviews>
-                                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ZP8-hL-mPu">
+                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ZP8-hL-mPu">
                                         <rect key="frame" x="-2" y="34" width="52" height="20"/>
                                         <constraints>
                                             <constraint firstAttribute="height" constant="20" id="o0c-hd-VGs"/>
@@ -258,8 +258,8 @@
                                             <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
                                         </textFieldCell>
                                     </textField>
-                                    <comboBox verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="g8X-5L-1kw" customClass="KMComboBox" customModule="PDF_Reader_Pro" customModuleProvider="target">
-                                        <rect key="frame" x="377" y="0.0" width="72" height="23"/>
+                                    <comboBox focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="g8X-5L-1kw" customClass="KMComboBox" customModule="PDF_Reader_Pro" customModuleProvider="target">
+                                        <rect key="frame" x="361" y="1" width="73" height="23"/>
                                         <constraints>
                                             <constraint firstAttribute="width" constant="69" id="Vr5-nw-ODj"/>
                                         </constraints>
@@ -282,7 +282,7 @@
                                         </connections>
                                     </comboBox>
                                     <slider verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="JhQ-39-0CI">
-                                        <rect key="frame" x="-2" y="-1" width="373" height="23"/>
+                                        <rect key="frame" x="-2" y="-1" width="358" height="23"/>
                                         <sliderCell key="cell" state="on" alignment="left" minValue="0.5" maxValue="18" doubleValue="0.5" tickMarkPosition="above" sliderType="linear" id="hVk-ke-xNd"/>
                                         <connections>
                                             <action selector="thicknessSliderAction:" target="-2" id="ZWF-tz-w9A"/>
@@ -302,12 +302,12 @@
                                 </constraints>
                             </customView>
                             <customView translatesAutoresizingMaskIntoConstraints="NO" id="sv1-ye-km4">
-                                <rect key="frame" x="16" y="223" width="449" height="104"/>
+                                <rect key="frame" x="16" y="225" width="434" height="104"/>
                                 <subviews>
                                     <customView translatesAutoresizingMaskIntoConstraints="NO" id="QPc-Pt-nlu">
-                                        <rect key="frame" x="0.0" y="72" width="449" height="32"/>
+                                        <rect key="frame" x="0.0" y="72" width="434" height="32"/>
                                         <subviews>
-                                            <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="YdU-MQ-e0v">
+                                            <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="YdU-MQ-e0v">
                                                 <rect key="frame" x="-2" y="8" width="64" height="16"/>
                                                 <textFieldCell key="cell" lineBreakMode="clipping" title="Line Style" id="plB-2D-Cap">
                                                     <font key="font" usesAppearanceFont="YES"/>
@@ -323,24 +323,24 @@
                                         </constraints>
                                     </customView>
                                     <customView translatesAutoresizingMaskIntoConstraints="NO" id="xhZ-Ey-nMa">
-                                        <rect key="frame" x="0.0" y="36" width="449" height="32"/>
+                                        <rect key="frame" x="0.0" y="36" width="434" height="32"/>
                                         <subviews>
                                             <button translatesAutoresizingMaskIntoConstraints="NO" id="P7u-1k-sU0">
                                                 <rect key="frame" x="0.0" y="6" width="20" height="20"/>
-                                                <constraints>
-                                                    <constraint firstAttribute="height" constant="20" id="4Pd-RI-PEi"/>
-                                                    <constraint firstAttribute="width" constant="20" id="dSK-Tf-Fzw"/>
-                                                </constraints>
                                                 <buttonCell key="cell" type="bevel" title="Button" bezelStyle="rounded" image="AIchange" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="aPC-te-078">
                                                     <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                                     <font key="font" metaFont="system"/>
                                                 </buttonCell>
+                                                <constraints>
+                                                    <constraint firstAttribute="height" constant="20" id="4Pd-RI-PEi"/>
+                                                    <constraint firstAttribute="width" constant="20" id="dSK-Tf-Fzw"/>
+                                                </constraints>
                                                 <connections>
                                                     <action selector="lineStyleButtonAction:" target="-2" id="Y1o-pc-GhN"/>
                                                 </connections>
                                             </button>
                                             <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="O1i-7T-RXp">
-                                                <rect key="frame" x="24" y="8" width="341" height="16"/>
+                                                <rect key="frame" x="24" y="8" width="326" height="16"/>
                                                 <constraints>
                                                     <constraint firstAttribute="height" constant="16" id="74i-6a-oEy"/>
                                                 </constraints>
@@ -357,31 +357,31 @@
                                         </constraints>
                                     </customView>
                                     <customView translatesAutoresizingMaskIntoConstraints="NO" id="Rax-Hz-iCT">
-                                        <rect key="frame" x="0.0" y="0.0" width="449" height="32"/>
+                                        <rect key="frame" x="0.0" y="0.0" width="434" height="32"/>
                                         <subviews>
                                             <button tag="1" translatesAutoresizingMaskIntoConstraints="NO" id="5Ap-Ht-ASC">
                                                 <rect key="frame" x="0.0" y="6" width="20" height="20"/>
-                                                <constraints>
-                                                    <constraint firstAttribute="height" constant="20" id="rBz-4w-kCr"/>
-                                                    <constraint firstAttribute="width" constant="20" id="yTb-3p-2lE"/>
-                                                </constraints>
                                                 <buttonCell key="cell" type="bevel" title="Button" bezelStyle="rounded" image="AIchange" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="XR9-8F-wdf">
                                                     <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                                     <font key="font" metaFont="system"/>
                                                 </buttonCell>
+                                                <constraints>
+                                                    <constraint firstAttribute="height" constant="20" id="rBz-4w-kCr"/>
+                                                    <constraint firstAttribute="width" constant="20" id="yTb-3p-2lE"/>
+                                                </constraints>
                                                 <connections>
                                                     <action selector="lineStyleButtonAction:" target="-2" id="W9a-6t-WpC"/>
                                                 </connections>
                                             </button>
                                             <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="yvy-I6-8US">
-                                                <rect key="frame" x="24" y="8" width="341" height="16"/>
+                                                <rect key="frame" x="24" y="8" width="326" height="16"/>
                                                 <constraints>
                                                     <constraint firstAttribute="height" constant="16" id="7Xq-GM-DqZ"/>
                                                 </constraints>
                                                 <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" id="Gc0-EO-5ne"/>
                                             </imageView>
-                                            <comboBox verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Zsv-cd-gPh" customClass="KMComboBox" customModule="PDF_Reader_Pro" customModuleProvider="target">
-                                                <rect key="frame" x="377" y="4" width="72" height="23"/>
+                                            <comboBox focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Zsv-cd-gPh" customClass="KMComboBox" customModule="PDF_Reader_Pro" customModuleProvider="target">
+                                                <rect key="frame" x="361" y="4" width="73" height="23"/>
                                                 <constraints>
                                                     <constraint firstAttribute="width" constant="69" id="Vjg-K7-yVm"/>
                                                 </constraints>
@@ -431,12 +431,12 @@
                                 </constraints>
                             </customView>
                             <customView translatesAutoresizingMaskIntoConstraints="NO" id="WCX-mL-xfX">
-                                <rect key="frame" x="16" y="159" width="449" height="64"/>
+                                <rect key="frame" x="16" y="161" width="434" height="64"/>
                                 <subviews>
                                     <customView translatesAutoresizingMaskIntoConstraints="NO" id="Q0n-es-MlW">
-                                        <rect key="frame" x="0.0" y="32" width="449" height="32"/>
+                                        <rect key="frame" x="0.0" y="32" width="434" height="32"/>
                                         <subviews>
-                                            <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="N5b-9k-Q9U">
+                                            <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="N5b-9k-Q9U">
                                                 <rect key="frame" x="-2" y="8" width="74" height="16"/>
                                                 <textFieldCell key="cell" lineBreakMode="clipping" title="Start &amp; End" id="vNb-39-gWK">
                                                     <font key="font" usesAppearanceFont="YES"/>
@@ -452,10 +452,10 @@
                                         </constraints>
                                     </customView>
                                     <customView translatesAutoresizingMaskIntoConstraints="NO" id="QsI-2P-QDa">
-                                        <rect key="frame" x="0.0" y="0.0" width="449" height="32"/>
+                                        <rect key="frame" x="0.0" y="0.0" width="434" height="32"/>
                                         <subviews>
                                             <popUpButton translatesAutoresizingMaskIntoConstraints="NO" id="Wib-02-9dq" customClass="KMPopUpButton" customModule="PDF_Reader_Pro" customModuleProvider="target">
-                                                <rect key="frame" x="0.0" y="0.0" width="225" height="32"/>
+                                                <rect key="frame" x="0.0" y="0.0" width="218" height="32"/>
                                                 <popUpButtonCell key="cell" type="square" bezelStyle="shadowlessSquare" alignment="left" lineBreakMode="truncatingTail" inset="2" arrowPosition="noArrow" id="rKK-kz-Z0l" customClass="KMPopUpButtonCell" customModule="PDF_Reader_Pro" customModuleProvider="target">
                                                     <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                                     <font key="font" metaFont="menu"/>
@@ -463,7 +463,7 @@
                                                 </popUpButtonCell>
                                             </popUpButton>
                                             <popUpButton translatesAutoresizingMaskIntoConstraints="NO" id="7Er-ld-5uZ" customClass="KMPopUpButton" customModule="PDF_Reader_Pro" customModuleProvider="target">
-                                                <rect key="frame" x="224" y="0.0" width="225" height="32"/>
+                                                <rect key="frame" x="217" y="0.0" width="217" height="32"/>
                                                 <popUpButtonCell key="cell" type="square" bezelStyle="shadowlessSquare" alignment="left" lineBreakMode="truncatingTail" inset="2" arrowPosition="noArrow" id="Fte-Qa-oBp" customClass="KMPopUpButtonCell" customModule="PDF_Reader_Pro" customModuleProvider="target">
                                                     <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                                     <font key="font" metaFont="menu"/>
@@ -496,10 +496,10 @@
                                 </constraints>
                             </customView>
                             <customView translatesAutoresizingMaskIntoConstraints="NO" id="mVw-xI-3mn">
-                                <rect key="frame" x="16" y="401" width="449" height="51"/>
+                                <rect key="frame" x="16" y="403" width="434" height="54"/>
                                 <subviews>
-                                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="DSM-Hq-Kyw">
-                                        <rect key="frame" x="-2" y="31" width="453" height="20"/>
+                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="DSM-Hq-Kyw">
+                                        <rect key="frame" x="-2" y="34" width="438" height="20"/>
                                         <constraints>
                                             <constraint firstAttribute="height" constant="20" id="bkw-lV-fQT"/>
                                         </constraints>
@@ -510,7 +510,7 @@
                                         </textFieldCell>
                                     </textField>
                                     <comboBox focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="c2Y-hb-2CY" customClass="KMComboBox" customModule="PDF_Reader_Pro" customModuleProvider="target">
-                                        <rect key="frame" x="377" y="0.0" width="72" height="23"/>
+                                        <rect key="frame" x="361" y="2" width="73" height="23"/>
                                         <constraints>
                                             <constraint firstAttribute="width" constant="69" id="ZdS-vc-3EC"/>
                                         </constraints>
@@ -530,7 +530,7 @@
                                         </connections>
                                     </comboBox>
                                     <slider verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ybI-lG-duP">
-                                        <rect key="frame" x="-2" y="-3" width="371" height="28"/>
+                                        <rect key="frame" x="-2" y="-2" width="356" height="28"/>
                                         <sliderCell key="cell" alignment="left" maxValue="1" tickMarkPosition="above" sliderType="linear" id="w59-cx-DIN"/>
                                         <connections>
                                             <action selector="opacitySliderAction:" target="-2" id="TFl-qU-6dK"/>
@@ -550,9 +550,9 @@
                                 </constraints>
                             </customView>
                             <customView translatesAutoresizingMaskIntoConstraints="NO" id="Ylg-k5-0Xf">
-                                <rect key="frame" x="16" y="462" width="449" height="72"/>
+                                <rect key="frame" x="16" y="467" width="434" height="72"/>
                                 <subviews>
-                                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="zk5-HT-4yl">
+                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="zk5-HT-4yl">
                                         <rect key="frame" x="-2" y="42" width="62" height="20"/>
                                         <constraints>
                                             <constraint firstAttribute="height" constant="20" id="o4k-p8-u2b"/>
@@ -564,7 +564,7 @@
                                         </textFieldCell>
                                     </textField>
                                     <customView translatesAutoresizingMaskIntoConstraints="NO" id="cVx-1f-Zop" customClass="KMColorPickerView" customModule="PDF_Reader_Pro" customModuleProvider="target">
-                                        <rect key="frame" x="0.0" y="0.0" width="449" height="32"/>
+                                        <rect key="frame" x="0.0" y="0.0" width="434" height="32"/>
                                         <constraints>
                                             <constraint firstAttribute="height" constant="32" id="Tx6-Nq-7mM"/>
                                         </constraints>
@@ -583,9 +583,9 @@
                                 </constraints>
                             </customView>
                             <customView translatesAutoresizingMaskIntoConstraints="NO" id="29n-Jr-QG2">
-                                <rect key="frame" x="16" y="544" width="449" height="102"/>
+                                <rect key="frame" x="16" y="549" width="434" height="102"/>
                                 <subviews>
-                                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="JsL-wX-Njt">
+                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="JsL-wX-Njt">
                                         <rect key="frame" x="-2" y="72" width="42" height="20"/>
                                         <constraints>
                                             <constraint firstAttribute="height" constant="20" id="z6d-A9-0bg"/>
@@ -597,13 +597,13 @@
                                         </textFieldCell>
                                     </textField>
                                     <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="gqn-lo-y0r">
-                                        <rect key="frame" x="0.0" y="0.0" width="449" height="32"/>
+                                        <rect key="frame" x="0.0" y="0.0" width="434" height="32"/>
                                         <view key="contentView" id="vDH-fx-TXA">
-                                            <rect key="frame" x="0.0" y="0.0" width="449" height="32"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="434" height="32"/>
                                             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                             <subviews>
                                                 <customView translatesAutoresizingMaskIntoConstraints="NO" id="jU9-Gn-EkZ" customClass="KMColorPickerView" customModule="PDF_Reader_Pro" customModuleProvider="target">
-                                                    <rect key="frame" x="0.0" y="0.0" width="449" height="32"/>
+                                                    <rect key="frame" x="0.0" y="0.0" width="434" height="32"/>
                                                     <constraints>
                                                         <constraint firstAttribute="height" constant="32" id="nUi-a5-yYb"/>
                                                     </constraints>
@@ -622,7 +622,7 @@
                                             </constraints>
                                         </view>
                                     </box>
-                                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="n33-LV-rlJ">
+                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="n33-LV-rlJ">
                                         <rect key="frame" x="-2" y="42" width="52" height="20"/>
                                         <constraints>
                                             <constraint firstAttribute="height" constant="20" id="3sz-hc-KDq"/>
@@ -646,10 +646,10 @@
                                 </constraints>
                             </customView>
                             <customView translatesAutoresizingMaskIntoConstraints="NO" id="0Qb-jg-5Ce">
-                                <rect key="frame" x="16" y="20" width="449" height="129"/>
+                                <rect key="frame" x="16" y="20" width="434" height="131"/>
                                 <subviews>
-                                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="04S-yS-pWn">
-                                        <rect key="frame" x="-2" y="99" width="35" height="20"/>
+                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="04S-yS-pWn">
+                                        <rect key="frame" x="-2" y="101" width="35" height="20"/>
                                         <constraints>
                                             <constraint firstAttribute="height" constant="20" id="c2U-EW-hwg"/>
                                         </constraints>
@@ -660,24 +660,21 @@
                                         </textFieldCell>
                                     </textField>
                                     <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="82h-wT-aSq">
-                                        <rect key="frame" x="433" y="101" width="16" height="16"/>
-                                        <constraints>
-                                            <constraint firstAttribute="height" constant="16" id="KAE-r0-pPR"/>
-                                            <constraint firstAttribute="width" constant="16" id="fnd-vZ-GRz"/>
-                                        </constraints>
+                                        <rect key="frame" x="418" y="103" width="16" height="16"/>
                                         <buttonCell key="cell" type="bevel" bezelStyle="regularSquare" image="KMImageNameUXIconBtnFontsetNor" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="Iae-nh-IMf">
                                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                             <font key="font" metaFont="system"/>
                                         </buttonCell>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="16" id="KAE-r0-pPR"/>
+                                            <constraint firstAttribute="width" constant="16" id="fnd-vZ-GRz"/>
+                                        </constraints>
                                         <connections>
                                             <action selector="fontButtonAction:" target="-2" id="pke-Eb-3xP"/>
                                         </connections>
                                     </button>
                                     <popUpButton translatesAutoresizingMaskIntoConstraints="NO" id="VRm-2Z-yAc" customClass="KMPopUpButton" customModule="PDF_Reader_Pro" customModuleProvider="target">
-                                        <rect key="frame" x="0.0" y="1" width="346" height="24"/>
-                                        <constraints>
-                                            <constraint firstAttribute="height" constant="24" id="QdD-zJ-eI1"/>
-                                        </constraints>
+                                        <rect key="frame" x="0.0" y="3" width="331" height="24"/>
                                         <popUpButtonCell key="cell" type="square" title="UltraLight" bezelStyle="shadowlessSquare" alignment="left" lineBreakMode="truncatingTail" state="on" inset="2" arrowPosition="noArrow" selectedItem="Xj8-wD-Eo7" id="0e6-ZT-mEd">
                                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                             <font key="font" usesAppearanceFont="YES"/>
@@ -695,26 +692,29 @@
                                                 </items>
                                             </menu>
                                         </popUpButtonCell>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="24" id="QdD-zJ-eI1"/>
+                                        </constraints>
                                         <connections>
                                             <action selector="fontStylePopUpButtonAction:" target="-2" id="FbC-KN-6Ch"/>
                                         </connections>
                                     </popUpButton>
                                     <popUpButton translatesAutoresizingMaskIntoConstraints="NO" id="FBi-S9-RTC" customClass="KMPopUpButton" customModule="PDF_Reader_Pro" customModuleProvider="target">
-                                        <rect key="frame" x="0.0" y="33" width="449" height="24"/>
-                                        <constraints>
-                                            <constraint firstAttribute="height" constant="24" id="svD-NU-tnJ"/>
-                                        </constraints>
+                                        <rect key="frame" x="0.0" y="35" width="434" height="24"/>
                                         <popUpButtonCell key="cell" type="square" bezelStyle="shadowlessSquare" alignment="left" lineBreakMode="truncatingTail" inset="2" arrowPosition="noArrow" id="Sh9-6x-k3S" customClass="KMPopUpButtonCell" customModule="PDF_Reader_Pro" customModuleProvider="target">
                                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                             <font key="font" usesAppearanceFont="YES"/>
                                             <menu key="menu" id="52H-Tg-hJy"/>
                                         </popUpButtonCell>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="24" id="svD-NU-tnJ"/>
+                                        </constraints>
                                         <connections>
                                             <action selector="fontPopUpButtonAction:" target="-2" id="D3z-rp-QdK"/>
                                         </connections>
                                     </popUpButton>
-                                    <comboBox verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="7m0-hp-PRc" customClass="KMComboBox" customModule="PDF_Reader_Pro" customModuleProvider="target">
-                                        <rect key="frame" x="354" y="1" width="95" height="23"/>
+                                    <comboBox focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="7m0-hp-PRc" customClass="KMComboBox" customModule="PDF_Reader_Pro" customModuleProvider="target">
+                                        <rect key="frame" x="338" y="3" width="96" height="23"/>
                                         <constraints>
                                             <constraint firstAttribute="width" constant="92" id="QPh-ca-xew"/>
                                         </constraints>
@@ -751,7 +751,7 @@
                                         </connections>
                                     </comboBox>
                                     <customView translatesAutoresizingMaskIntoConstraints="NO" id="An2-NL-h4C" customClass="KMColorPickerView" customModule="PDF_Reader_Pro" customModuleProvider="target">
-                                        <rect key="frame" x="0.0" y="67" width="449" height="32"/>
+                                        <rect key="frame" x="0.0" y="69" width="434" height="32"/>
                                         <constraints>
                                             <constraint firstAttribute="height" constant="32" id="Qfn-a0-H2v"/>
                                         </constraints>
@@ -826,8 +826,8 @@
                 <rect key="frame" x="-100" y="-100" width="303" height="15"/>
                 <autoresizingMask key="autoresizingMask"/>
             </scroller>
-            <scroller key="verticalScroller" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="GYX-OK-zPd">
-                <rect key="frame" x="465" y="0.0" width="16" height="661"/>
+            <scroller key="verticalScroller" wantsLayer="YES" verticalHuggingPriority="750" doubleValue="0.94047619047619047" horizontal="NO" id="GYX-OK-zPd">
+                <rect key="frame" x="466" y="0.0" width="15" height="661"/>
                 <autoresizingMask key="autoresizingMask"/>
             </scroller>
             <point key="canvasLocation" x="-160.5" y="1075.5"/>

+ 11 - 11
PDF Office/PDF Master/Class/PDFTools/Merge/OCPart/KMPDFEditAppendWindow.m

@@ -1687,7 +1687,7 @@ static KMPDFEditAppendWindow *windowController = nil;
                 continue;
             }
             
-            KMPDFViewController *mainViewController = document.pdfViewController;
+            KMMainViewController *mainViewController = document.mainViewController;
             if ([self.PDFDocument.documentURL.path isEqualToString:document.fileURL.path]) {
                 continue;
             }
@@ -1696,16 +1696,16 @@ static KMPDFEditAppendWindow *windowController = nil;
                 continue;
             }
             
-//            CPDFDocument *pdfDocument = mainViewController.listView.document;
-//            if (pdfDocument.isLocked || (!pdfDocument.allowsCopying || !pdfDocument.allowsPrinting)) {
-//                [_lockFilePathArr addObject:pdfDocument.documentURL.path];
-//            } else {
-//                KMFileAttribute *file = [[KMFileAttribute alloc] init];
-//                file.filePath = document.fileURL.path;
-//                file.pdfDocument = mainViewController.document;
-//
-//                [_files addObject:file];
-//            }
+            CPDFDocument *pdfDocument = mainViewController.listView.document;
+            if (pdfDocument.isLocked || (!pdfDocument.allowsCopying || !pdfDocument.allowsPrinting)) {
+                [_lockFilePathArr addObject:pdfDocument.documentURL.path];
+            } else {
+                KMFileAttribute *file = [[KMFileAttribute alloc] init];
+                file.filePath = document.fileURL.path;
+                file.pdfDocument = mainViewController.document;
+
+                [_files addObject:file];
+            }
         }
     }
     

+ 4 - 4
PDF Office/PDF Master/Class/PDFTools/Snapshot/Window/SnapshotWindow.xib

@@ -1,9 +1,9 @@
 <?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">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
     <dependencies>
         <deployment version="101300" identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
-        <plugIn identifier="com.apple.pdfkit.ibplugin" version="21507"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
+        <plugIn identifier="com.apple.pdfkit.ibplugin" version="22505"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
@@ -19,7 +19,7 @@
             <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
             <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
             <rect key="contentRect" x="270" y="479" width="1024" height="219"/>
-            <rect key="screenRect" x="0.0" y="0.0" width="1440" height="875"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="1920" height="1055"/>
             <value key="minSize" type="size" width="213" height="107"/>
             <view key="contentView" id="6">
                 <rect key="frame" x="0.0" y="0.0" width="1024" height="219"/>

+ 1 - 1
PDF Office/PDF Master/Class/PDFWindowController/Form/KMFormListMenuPopWindowController.xib

@@ -31,7 +31,7 @@
             <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES"/>
             <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
             <rect key="contentRect" x="196" y="240" width="500" height="290"/>
-            <rect key="screenRect" x="0.0" y="0.0" width="2560" height="1415"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="1920" height="1055"/>
             <view key="contentView" wantsLayer="YES" id="se5-gp-TjO">
                 <rect key="frame" x="0.0" y="0.0" width="500" height="288"/>
                 <autoresizingMask key="autoresizingMask"/>

+ 1 - 1
PDF Office/PDF Master/Class/PDFWindowController/MainWindowController/SKPresentationOptionsSheetController.swift

@@ -552,7 +552,7 @@ class SKPresentationOptionsSheetController: KMBaseWindowController {
             if mainDoc.isEqual(to: document) {
                 continue
             }
-            if let pdfDoc = mainDoc.pdfViewController?.document {
+            if let pdfDoc = mainDoc.mainViewController?.document {
                 if pdfDoc.pageCount == pageCount {
                     documents.add(doc)
                 }

+ 4 - 4
PDF Office/PDF Master/Class/PDFWindowController/TabWindowController/KMTabbingHintWindowController.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>
@@ -25,12 +25,12 @@
             <windowStyleMask key="styleMask" titled="YES" closable="YES"/>
             <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
             <rect key="contentRect" x="196" y="240" width="400" height="210"/>
-            <rect key="screenRect" x="0.0" y="0.0" width="1440" height="875"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="1920" height="1055"/>
             <view key="contentView" wantsLayer="YES" id="se5-gp-TjO">
                 <rect key="frame" x="0.0" y="0.0" width="400" height="210"/>
                 <autoresizingMask key="autoresizingMask"/>
                 <subviews>
-                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Oea-L2-ekE">
+                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Oea-L2-ekE">
                         <rect key="frame" x="30" y="155" width="178" height="19"/>
                         <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="left" title="Open the home page in:" id="jAt-lq-Wvw">
                             <font key="font" metaFont="system" size="16"/>

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

@@ -868,7 +868,7 @@ import Cocoa
                         }
                     }
                     if curDoc != nil {
-//                        curDoc.mainViewController?.SaveTempPDFDocumentToURLPath(tempPath: tempFileURL.path)
+                        curDoc.mainViewController?.SaveTempPDFDocumentToURLPath(tempPath: tempFileURL.path)
                     }
                 }
                 windowVC.window?.becomeMain()

+ 3 - 3
PDF Office/PDF Master/Class/PDFWindowController/ViewController/PageSheet.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">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
     <dependencies>
         <deployment version="1070" 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>
@@ -20,7 +20,7 @@
         <window allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" restorable="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="37" userLabel="Window" customClass="NSPanel">
             <windowStyleMask key="styleMask" titled="YES" closable="YES"/>
             <rect key="contentRect" x="416" y="377" width="192" height="107"/>
-            <rect key="screenRect" x="0.0" y="0.0" width="1440" height="875"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="1920" height="1055"/>
             <view key="contentView" id="38">
                 <rect key="frame" x="0.0" y="0.0" width="192" height="107"/>
                 <autoresizingMask key="autoresizingMask"/>

+ 0 - 8
PDF Office/PDF Reader Pro.xcodeproj/project.pbxproj

@@ -9693,7 +9693,6 @@
 			isa = PBXGroup;
 			children = (
 				AD055E792B88291C0035F824 /* Old */,
-				AD055E562B846C6B0035F824 /* Tool */,
 				AD055E512B7321EB0035F824 /* Manager */,
 				AD055E482B7234530035F824 /* View */,
 				AD055E1D2B70B3660035F824 /* Model */,
@@ -9740,13 +9739,6 @@
 			path = Manager;
 			sourceTree = "<group>";
 		};
-		AD055E562B846C6B0035F824 /* Tool */ = {
-			isa = PBXGroup;
-			children = (
-			);
-			path = Tool;
-			sourceTree = "<group>";
-		};
 		AD055E632B872FA90035F824 /* SKAlias */ = {
 			isa = PBXGroup;
 			children = (

+ 97 - 3
PDF Office/PDF Reader Pro.xcodeproj/xcuserdata/kdanmobile.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -544,7 +544,7 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "293"
             endingLineNumber = "293"
-            landmarkName = "fetchScaleWidth(string:)"
+            landmarkName = "mouseUp(with:)"
             landmarkType = "7">
             <Locations>
                <Location
@@ -625,6 +625,21 @@
                   endingLineNumber = "2520"
                   offsetFromSymbolStart = "56">
                </Location>
+               <Location
+                  uuid = "4EE71E45-EE11-4ED4-9B13-446DBCED49C5 - fafb0387eefddcad"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Reader_Pro.KMMainViewController.mouseUp(with: __C.NSEvent) -&gt; ()"
+                  moduleName = "PDF Reader Pro"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/Class/PDFWindowController/ViewController/KMMainViewController.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "2521"
+                  endingLineNumber = "2521"
+                  offsetFromSymbolStart = "108">
+               </Location>
             </Locations>
          </BreakpointContent>
       </BreakpointProxy>
@@ -1472,8 +1487,8 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "289"
             endingLineNumber = "289"
-            landmarkName = "KMReadModelView"
-            landmarkType = "21">
+            landmarkName = "mouseDown(with:)"
+            landmarkType = "7">
             <Locations>
                <Location
                   uuid = "ED160F9D-7FC1-4104-BB0A-C9A25D2E82DC - 9bc74ed353b84464"
@@ -2097,6 +2112,38 @@
             endingLineNumber = "41"
             landmarkName = "canEnterPresentation()"
             landmarkType = "7">
+            <Locations>
+               <Location
+                  uuid = "EA66C38B-D2A9-4701-9F11-166981AF40A6 - 2c70aba55274e821"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Reader_Pro.KMBrowserWindowController.canEnterPresentation() -&gt; Swift.Bool"
+                  moduleName = "PDF Reader Pro"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/Class/ChromiumTabs/KMBrowserWindowController+Actions.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "41"
+                  endingLineNumber = "41"
+                  offsetFromSymbolStart = "60">
+               </Location>
+               <Location
+                  uuid = "EA66C38B-D2A9-4701-9F11-166981AF40A6 - 2c70aba55274e821"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Reader_Pro.KMBrowserWindowController.canEnterPresentation() -&gt; Swift.Bool"
+                  moduleName = "PDF Reader Pro"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/Class/ChromiumTabs/KMBrowserWindowController+Actions.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "41"
+                  endingLineNumber = "41"
+                  offsetFromSymbolStart = "68">
+               </Location>
+            </Locations>
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
@@ -2240,6 +2287,21 @@
                   endingLineNumber = "652"
                   offsetFromSymbolStart = "56">
                </Location>
+               <Location
+                  uuid = "97C9BA92-03E3-4CE4-96E9-9F3E7B344C8D - 5aeb18d2f0ccd9ce"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Reader_Pro.KMPDFViewController.pdfUpdatedFinish() -&gt; ()"
+                  moduleName = "PDF Reader Pro"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/KMClass/KMPDFViewController/KMPDFViewController.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "652"
+                  endingLineNumber = "652"
+                  offsetFromSymbolStart = "268">
+               </Location>
             </Locations>
          </BreakpointContent>
       </BreakpointProxy>
@@ -2289,6 +2351,38 @@
             endingLineNumber = "72"
             landmarkName = "exitFullscreen()"
             landmarkType = "7">
+            <Locations>
+               <Location
+                  uuid = "2DDDB646-C17B-4DC1-BB14-BC7FD969162C - c12ef80efc01a605"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Reader_Pro.KMBrowserWindowController.exitFullscreen() -&gt; ()"
+                  moduleName = "PDF Reader Pro"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/Class/ChromiumTabs/KMBrowserWindowController+Actions.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "72"
+                  endingLineNumber = "72"
+                  offsetFromSymbolStart = "80">
+               </Location>
+               <Location
+                  uuid = "2DDDB646-C17B-4DC1-BB14-BC7FD969162C - c12ef80efc01a605"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Reader_Pro.KMBrowserWindowController.exitFullscreen() -&gt; ()"
+                  moduleName = "PDF Reader Pro"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/Class/ChromiumTabs/KMBrowserWindowController+Actions.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "72"
+                  endingLineNumber = "72"
+                  offsetFromSymbolStart = "132">
+               </Location>
+            </Locations>
          </BreakpointContent>
       </BreakpointProxy>
    </Breakpoints>