Просмотр исходного кода

Merge branch 'develop_PDFReaderProNew' of git.kdan.cc:Mac_PDF/PDF_Office into develop_PDFReaderProNew

niehaoyu 10 месяцев назад
Родитель
Сommit
2cdc7ffb6d
16 измененных файлов с 181 добавлено и 122 удалено
  1. 1 0
      PDF Office/PDF Master/Class/Batch/Tools/KMImageToPDFMethod.swift
  2. 14 10
      PDF Office/PDF Master/Class/Batch/WindowController/KMBatchOperateLeftViewController.swift
  3. 0 47
      PDF Office/PDF Master/Class/Document/KMMainDocument.swift
  4. 14 10
      PDF Office/PDF Master/Class/PDFTools/AddHeaderFooter/VC/KMBatchOperateAddHeaderFooterViewController.swift
  5. 3 1
      PDF Office/PDF Master/Class/PDFTools/Background/tool/KMBackgroundManager.swift
  6. 3 1
      PDF Office/PDF Master/Class/PDFTools/Compare/KMCompareWindowController.swift
  7. 2 1
      PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFKitExtensions/CPDFAnnotationExtensions/CPDFAnnotation+PDFListView.swift
  8. 1 1
      PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFKitExtensions/CPDFAnnotationExtensions/CPDFAnnotationModel.m
  9. 2 1
      PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFKitExtensions/CPDFAnnotationExtensions/CPDFInkAnnotation+PDFListView.swift
  10. 7 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListViewExtension/CPDFListView+Event.m
  11. 13 8
      PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMAnnotationTableViewController.swift
  12. 1 1
      PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbarItemView.swift
  13. 13 3
      PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift
  14. 50 0
      PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+UI.swift
  15. 21 2
      PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController.swift
  16. 36 36
      PDF Office/PDF Master/Class/Preference/Controller/NotesPreferences.xib

+ 1 - 0
PDF Office/PDF Master/Class/Batch/Tools/KMImageToPDFMethod.swift

@@ -63,6 +63,7 @@ class KMImageToPDFMethod: NSObject, KMGOCRManagerDelegate {
         self.completeBlock = complete
         self.OCRResultString = ""
         self.errorArray.removeAllObjects()
+        self.errorOCRArray.removeAllObjects()
         
         if !isCreatPDF {
             appendPDF = CPDFDocument(url: URL(fileURLWithPath: savePath))

+ 14 - 10
PDF Office/PDF Master/Class/Batch/WindowController/KMBatchOperateLeftViewController.swift

@@ -441,17 +441,8 @@ class KMBatchOperateLeftViewController: NSViewController,NSTableViewDelegate,NST
         self.files.remove(at: row)
         self.tableView.reloadData()
     }
+  
     
-    func validateMenuItem(menuItem: NSMenuItem) -> Bool {
-        let action = menuItem.action
-        if action == #selector(menuItem_ShowInFinder(_:)) || action == #selector(menuItem_Delete(_:)) {
-            if tableView.clickedRow == -1 {
-                return false
-            }
-            return true
-        }
-        return true
-    }
     func addOpendFile() {
         let documentArray = NSDocumentController.shared.documents
         var pdfArray = NSMutableArray()
@@ -794,3 +785,16 @@ class KMBatchOperateLeftViewController: NSViewController,NSTableViewDelegate,NST
         self.tableView.reloadData()
     }
 }
+
+extension KMBatchOperateLeftViewController: NSMenuDelegate, NSMenuItemValidation{
+    func validateMenuItem(_ menuItem: NSMenuItem) -> Bool {
+        let action = menuItem.action
+        if action == #selector(menuItem_ShowInFinder(_:)) || action == #selector(menuItem_Delete(_:)) {
+            if tableView.clickedRow == -1 {
+                return false
+            }
+            return true
+        }
+        return true
+    }
+}

+ 0 - 47
PDF Office/PDF Master/Class/Document/KMMainDocument.swift

@@ -199,9 +199,6 @@ typealias KMMainDocumentCloudUploadHanddler = (@escaping(Bool, String)->()) -> (
             mainViewController?.document = pdfDocument
         }
         
-        if let pdfDoc = self.mainViewController?.document {
-            self.convertNotesUsingPDFDocument(pdfDoc)
-        }
         self.view = mainViewController?.view
         
         if let currentBrowser = currentWindowController?.browser {
@@ -902,51 +899,7 @@ typealias KMMainDocumentCloudUploadHanddler = (@escaping(Bool, String)->()) -> (
     @IBAction func showWindow(_ sender: Any?) {
         KMPrint("showWindow")
     }
-    
-    func convertNotesUsingPDFDocument(_ pdfDocument: CPDFDocument) {
-        mainViewController!.beginProgressSheet(withMessage: NSLocalizedString("Converting notes", comment: "Message for progress sheet").appending("..."), maxValue: 0)
-        
-        let count = pdfDocument.pageCount
-        let pdfView = mainViewController?.listView
-        
-        for i in 0..<count {
-            let page = pdfDocument.page(at: i)
-            
-            var addAnnotations = [CPDFAnnotation]()
-            var removeAnnotations = [CPDFAnnotation]()
-            
-            for annotation in page?.annotations ?? [] {
-                var newAnnotation: CPDFAnnotation?
-                if let inkAnnotation = annotation as? CPDFInkAnnotation, inkAnnotation.contents.hasPrefix("<?xml version=\"1.0\" encoding=\"utf-8\"?>") {
-                    let table = KMTableAnnotation(KMNoteBounds: annotation.bounds, document: pdfView!.document)
-                    table.border = annotation.border
-                    table.color = annotation.color
-                    table.createForm(withList: annotation.contents, andPaths: inkAnnotation.bezierPaths())
-                    table.updateAppearanceInk(withIsAdd: false)
-                    newAnnotation = table
-                }
-                if let newAnnotation = newAnnotation {
-                    addAnnotations.append(newAnnotation)
-                    removeAnnotations.append(annotation)
-                }
-            }
-            
-            for i in 0..<addAnnotations.count {
-                let newAnnotation = addAnnotations[i]
-                let annotation = removeAnnotations[i]
-                
-                // this is only to make sure markup annotations generate the lineRects, for thread safety
-                pdfView!.addAnnotation(with: newAnnotation, to: page)
-                pdfView!.remove(annotation)
-            }
-        }
-        
-        mainViewController!.dismissProgressSheet()
         
-        pdfView?.undoManager?.removeAllActions()
-        undoManager?.removeAllActions()
-    }
-    
     // MARK: - Private Methods
     
     private func _PDFBundleFileWrapper(for name: String) -> FileWrapper {

+ 14 - 10
PDF Office/PDF Master/Class/PDFTools/AddHeaderFooter/VC/KMBatchOperateAddHeaderFooterViewController.swift

@@ -547,16 +547,7 @@ class KMBatchOperateAddHeaderFooterViewController: KMBatchOperateBaseViewControl
         reloadTable()
         postNotification()
     }
-    func validateMenuItem(_ menuItem: NSMenuItem) -> Bool {
-        let action = menuItem.action
-        if action == #selector(buttonItemClick_CleanAll(_:)) {
-            if (self.isBates && KMHeaderFooterManager.defaultManager.onlyBatesObjects.count < 1) || (!self.isBates && KMHeaderFooterManager.defaultManager.onlyHeaderFooterObjects.count < 1){
-                return false
-            }
-            return true
-        }
-        return true
-    }
+   
     func headerFooterInterfaceSelectHeaderFooter(headerFooter: KMHeaderFooterObject) {
         self.tableView.reloadData()
         if let index = KMHeaderFooterManager.defaultManager.onlyHeaderFooterObjects.firstIndex(of: headerFooter) {
@@ -664,3 +655,16 @@ class KMBatchOperateAddHeaderFooterViewController: KMBatchOperateBaseViewControl
         NotificationCenter.default.post(name: NSNotification.Name(rawValue: kNeedChangePageRangeNotification), object: nil)
     }
 }
+
+extension KMBatchOperateAddHeaderFooterViewController: NSMenuDelegate, NSMenuItemValidation{
+    func validateMenuItem(_ menuItem: NSMenuItem) -> Bool {
+        let action = menuItem.action
+        if action == #selector(buttonItemClick_CleanAll(_:)) {
+            if (self.isBates && KMHeaderFooterManager.defaultManager.onlyBatesObjects.count < 1) || (!self.isBates && KMHeaderFooterManager.defaultManager.onlyHeaderFooterObjects.count < 1){
+                return false
+            }
+            return true
+        }
+        return true
+    }
+}

+ 3 - 1
PDF Office/PDF Master/Class/PDFTools/Background/tool/KMBackgroundManager.swift

@@ -131,7 +131,9 @@ class KMBackgroundManager: NSObject, NSCoding  {
         
         let tag = fetchAvailableName()//tagString()
         newDict.addEntries(from: [tag : backgroundDict])
-        model.backgroundID = tag
+        if model.backgroundID.count == 0 {
+            model.backgroundID = tag
+        }
         let result = newDict.write(toFile: kBackgroundPlistPath!, atomically: true)
         if (result) {
             if (self.datas.count < 1) {

+ 3 - 1
PDF Office/PDF Master/Class/PDFTools/Compare/KMCompareWindowController.swift

@@ -61,7 +61,6 @@ class KMCompareWindowController: KMBaseWindowController {
     }
     
     func compareAction(config: KMCompareFilesConfig) {
-        compareView.doneButton.isEnabled = false
         self.showWaitting()
 
         guard let pdfOldDocument = config.fileOldAttribute.pdfDocument, let pdfNewDocument = config.fileNewAttribute.pdfDocument else {
@@ -251,6 +250,7 @@ class KMCompareWindowController: KMBaseWindowController {
 
 extension KMCompareWindowController {
     func showWaitting() {
+        compareView.doneButton.isEnabled = false
         if self.maskView == nil {
             self.maskView = KMBookletMaskView(frame: CGRect(x: 0, y: 0, width: self.window?.frame.size.width ?? 0, height: self.window?.frame.size.height ?? 0))
         }
@@ -271,6 +271,8 @@ extension KMCompareWindowController {
         self.window?.beginSheet(progress.window!)
     }
     func hideWaitting() {
+        compareView.doneButton.isEnabled = true
+        
         DispatchQueue.main.async {
             self.progressController?.doubleValue = 99.0
         }

+ 2 - 1
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFKitExtensions/CPDFAnnotationExtensions/CPDFAnnotation+PDFListView.swift

@@ -267,7 +267,8 @@ import Foundation
 //        NSMutableString * = [NSMutableString string];
         var fdfString = ""
         let bounds = self.bounds
-        let (r,g,b,a) = self.color.getRGBAComponents(.deviceRGB)
+        let color = self.color ?? .black
+        let (r,g,b,a) = color.getRGBAComponents(.deviceRGB)
         let border = self.border
         let contents = self.contents
         let modDate = self.modificationDate()

+ 1 - 1
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFKitExtensions/CPDFAnnotationExtensions/CPDFAnnotationModel.m

@@ -1202,7 +1202,7 @@
         NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
         switch (_annotationType) {
             case CAnnotationTypeArrow:
-                endLineStyle = [userDefaults integerForKey:CArrowNoteEndStyleKey];
+                endLineStyle = [userDefaults integerForKey:CArrowNoteEndStyleKey]?:CPDFLineStyleOpenArrow;
                 break;
             default:
                 break;

+ 2 - 1
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFKitExtensions/CPDFAnnotationExtensions/CPDFInkAnnotation+PDFListView.swift

@@ -438,7 +438,8 @@ import Foundation
                 NSGraphicsContext.saveGraphicsState()
                 
                 NSShadow.setShadowWithColor(NSColor(white: 0, alpha: 0.33333), blurRadius: 2.0, yOffset: -2.0)
-                NSColor(calibratedWhite: 0, alpha: self.color.alphaComponent).setStroke()
+                let color = self.color ?? .black
+                NSColor(calibratedWhite: 0, alpha: color.alphaComponent).setStroke()
                 path.stroke()
                 NSGraphicsContext.restoreGraphicsState()
                 NSGraphicsContext.current?.compositingOperation = .clear

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

@@ -123,6 +123,13 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
                     [self showEditableFormAnnotationEditor:self.activeAnnotation];
                 }
                 return;
+            } else if ([newActiveAnnotation isKindOfClass:[CPDFSignatureWidgetAnnotation class]]) {
+                if (self.toolMode == CFormToolMode) {
+                    [self doDragAnnotationWithEvent:theEvent forAnnotation:newActiveAnnotation];
+                } else {
+                    [self showEditableFormAnnotationEditor:newActiveAnnotation];
+                }
+                return;
             }
             if ([self.activeAnnotation isKindOfClass:[KMTableAnnotation class]]) {
                 [self doDragTableAnnotationWithEvent:theEvent];

+ 13 - 8
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMAnnotationTableViewController.swift

@@ -253,6 +253,12 @@ class KMAnnotationTableViewController: NSViewController {
         DistributedNotificationCenter.default().addObserver(self, selector: #selector(themeChanged(_:)), name: Notification.Name(rawValue: "AppleInterfaceThemeChangedNotification"), object: nil)
     }
     
+    override func viewWillAppear() {
+        super.viewWillAppear()
+        
+        reloadData(with: self.point)
+    }
+    
     // MARK: Set & Get
     
     var annotations: [KMTableAnnotation] {
@@ -537,16 +543,15 @@ class KMAnnotationTableViewController: NSViewController {
         table.alternatingColor = self.colorWithCGColor(self.alternateColorView.layer!.backgroundColor)!
         table.writeFormDataToContents()
         
-        if let tableInk = table as? CPDFAnnotation {
-            if lineStyleCount == 1 {
-                let lineType = tableInk.border.dashPattern ?? []
-                if lineType.count == 0 {
-                    let number = NSNumber(value: Float(4))
-                    tableInk.setDashPattern([number])
-                }
+        if lineStyleCount == 1 {
+            let lineType = table.dashPattern()
+            if lineType.count == 0 {
+                let number = NSNumber(value: Float(4))
+                table.setDashPattern([number])
             }
-            tableInk.setBorderStyle(CPDFBorderStyle(rawValue: lineStyleCount) ?? .solid)
         }
+        table.setBorderStyle(CPDFBorderStyle(rawValue: lineStyleCount) ?? .solid)
+
         
         if self.notUpdateBackgroundColor {
             self.notUpdateBackgroundColor = false

+ 1 - 1
PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbarItemView.swift

@@ -830,7 +830,7 @@ extension KMToolbarItemView: KMCustomButtonPopMenuViewControllerDelegate, KMCust
     
     func itemEnable(at index: Int) -> Bool {
         if self.itemIdentifier == KMToolbarToolFormAlignIdentifier {
-            if index < 6 {
+            if index <= 6 {
                 if self.pdfView.activeAnnotations.count >= 2 {
                     return true
                 }

+ 13 - 3
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift

@@ -4623,10 +4623,21 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
                     let isSelected = toolbarItem.isSelected
                     self.toolbarController.toolbarType = isSelected ? .None : .viewSetting
                     toolbarItem.isSelected = !isSelected
+                    if toolbarItem.isSelected {
+                        FMTrackEventManager.defaultManager.trackEvent(event: "SubTbr_PageDisplay", withProperties: ["SubTbr_Btn": "Btn_SubTbr_PageDisplay_ViewSetting"])
+                        self.rightSideViewController.isHidden = false
+                        self.rightSideViewController.mainController = self
+                        self.rightSideViewController.subViewType = .ViewSettings
+                        
+                        self.toolbarController.findItem(KMToolbarViewSettingIdentifier)?.isSelected = true
+                        self.openRightPane()
+                    }else{
+                        self.rightSideViewController.isHidden = true
+                        closeRightPane()
+                    }
                     if toolbarItem.isSelected {
                         FMTrackEventManager.defaultManager.trackEvent(event: "Tbr", withProperties: ["Tbr_Btn": "Btn_Tbr_PageDisplay"])
                     }
-                    self.toolbarController.clickItem(KMToolbarViewSettingIdentifier)
                     let rightItem = self.toolbarController.findItem(KMRightControlToolbarItemIdentifier)
                     if isSelected {
                         rightItem?.isSelected = false
@@ -4696,9 +4707,8 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
                     self.km_beginSheet(windowC: windowC)
                 } else if toolbarItem.itemIdentifier == KMToolbarViewSettingIdentifier {
                     toolbarItem.isSelected = !toolbarItem.isSelected
-                    FMTrackEventManager.defaultManager.trackEvent(event: "SubTbr_PageDisplay", withProperties: ["SubTbr_Btn": "Btn_SubTbr_PageDisplay_ViewSetting"])
                     rightSideViewController.mainController = self
-                    self.rightSideViewController.isHidden = false
+                    self.rightSideViewController.isHidden = toolbarItem.isSelected ? false : true
                     self.rightSideViewController.subViewType = .ViewSettings
                     self.toggleRightPane()
                 } else if toolbarItem.itemIdentifier == KMToolbarSnapshotIdentifier {

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

@@ -131,6 +131,56 @@ extension KMMainViewController {
         }
     }
     
+    func convertNotesUsingPDFDocument(_ pdfDocument: CPDFDocument) {
+        beginProgressSheet(withMessage: NSLocalizedString("Converting notes", comment: "Message for progress sheet").appending("..."), maxValue: 0)
+        
+        let count = pdfDocument.pageCount
+        let pdfView = listView
+        
+        for i in 0..<count {
+            let page = pdfDocument.page(at: i)
+            
+            var addAnnotations = [CPDFAnnotation]()
+            var removeAnnotations = [CPDFAnnotation]()
+            
+            for annotation in page?.annotations ?? [] {
+                var newAnnotation: CPDFAnnotation?
+                if let inkAnnotation = annotation as? CPDFInkAnnotation, inkAnnotation.contents.hasPrefix("<?xml version=\"1.0\" encoding=\"utf-8\"?>") {
+                    let table = KMTableAnnotation(KMNoteBounds: inkAnnotation.bounds, document: pdfView!.document)
+                    table.border = inkAnnotation.border
+                    table.color = inkAnnotation.color
+                    table.createForm(withList: inkAnnotation.contents, andPaths: inkAnnotation.bezierPaths())
+                    table.updateAppearanceInk(withIsAdd: false)
+                    table.contents = annotation.contents
+                    newAnnotation = table
+                }
+                if let newAnnotation = newAnnotation {
+                    addAnnotations.append(newAnnotation)
+                    removeAnnotations.append(annotation)
+                }
+            }
+            
+            for i in 0..<addAnnotations.count {
+                let newAnnotation = addAnnotations[i]
+                let annotation = removeAnnotations[i]
+                
+                // this is only to make sure markup annotations generate the lineRects, for thread safety
+                pdfView!.addAnnotation(with: newAnnotation, to: page)
+                pdfView!.remove(annotation)
+                if newAnnotation.contents != nil {
+                    if newAnnotation.contents.count == 0 {
+                        newAnnotation.autoUpdateString()
+                    }
+                }
+            }
+        }
+        
+        dismissProgressSheet()
+        
+        pdfView?.undoManager?.removeAllActions()
+        undoManager?.removeAllActions()
+    }
+    
     // MARK: - KMInterfaceThemeChangedProtocol
     
     override func interfaceThemeDidChanged(_ appearance: NSAppearance.Name) {

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

@@ -751,6 +751,8 @@ let LOCKED_KEY  = "locked"
                 self?.listView.layoutDocumentView()
             }
         }
+        
+        controller.setCurrentPageIndex(self.listView.currentPageIndex)
     }
     
     func exitRedact() {
@@ -2204,7 +2206,9 @@ let LOCKED_KEY  = "locked"
                 }
                 self.leftSideViewController.refreshUIForAnnoAttributeDidChange(anno, attributes: ["keyPath" : value])
             } else {
-                self.leftSideViewController.refreshUIForAnnoAttributeDidChange(anno, attributes: ["keyPath" : value])
+                if value != CPDFAnnotationBoundsKey && value != CPDFAnnotationStartPointKey && value != CPDFAnnotationEndPointKey && value != CPDFAnnotationPathsKey { // 改变bounds(箭头、直线注释 开始点和结束点, 手绘注释的paths)的操作会卡顿,比如移动
+                    self.leftSideViewController.refreshUIForAnnoAttributeDidChange(anno, attributes: ["keyPath" : value])
+                }
             }
         }
     }
@@ -2388,13 +2392,15 @@ let LOCKED_KEY  = "locked"
     
     //MARK: - PDFListViewDelegate
     func pdfViewDocumentDidLoaded(_ pdfView: CPDFView!) {
-//        KMPrint("pdfViewDocumentDidLoaded")
         
         self.removeBackgroundMaskView()
         if (!self.listView.document!.allowsCopying || !self.listView.document!.allowsPrinting) {
             self.showSecureLimitTip()
         }
         
+        if self.document != nil {
+            self.convertNotesUsingPDFDocument(self.document!)
+        }
         if (self._documentFirstLoad) {
             self.checkShouldAutoOpenLeftVC()
             if (KMPreferenceManager.shared.openLastUnlockedDocumentWhenAppStart) {
@@ -2449,10 +2455,22 @@ let LOCKED_KEY  = "locked"
     
     func pdfViewPerformURL(_ pdfView: CPDFView!, withContent content: String!) {
         KMPrint("pdfViewPerformURL")
+        if content != nil {
+            NSWorkspace.shared.open(URL(string: content)!)
+        } else {
+            let alert = NSAlert()
+            alert.alertStyle = .critical
+            alert.informativeText = NSLocalizedString("The hyperlink is invalid.", comment: "")
+            alert.messageText = ""
+            alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
+            alert.runModal()
+            return
+        }
     }
     
     func pdfViewPerformPrint(_ pdfView: CPDFView!) {
         KMPrint("pdfViewPerformPrint")
+        self.showPrintWindow()
     }
     
     func pdfViewPerformGo(toPage pdfView: CPDFView!) {
@@ -2465,6 +2483,7 @@ let LOCKED_KEY  = "locked"
     
     func pdfViewPerformReset(_ pdfView: CPDFView!) {
         KMPrint("pdfViewPerformReset")
+        self.listView.resetFormAnnotation()
     }
     
     func pdfViewEditingBlockDidChanged(_ pdfView: CPDFView!) {

+ 36 - 36
PDF Office/PDF Master/Class/Preference/Controller/NotesPreferences.xib

@@ -1,12 +1,12 @@
 <?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 version="101100" 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>
-        <customObject id="-2" userLabel="File's Owner" customClass="KMNotesPreferences" customModule="PDF_Master" customModuleProvider="target">
+        <customObject id="-2" userLabel="File's Owner" customClass="KMNotesPreferences" customModule="PDF_Reader_Pro" customModuleProvider="target">
             <connections>
                 <outlet property="alignmentSegmentControl" destination="273" id="j6J-Xf-kb3"/>
                 <outlet property="anchoredColorWell" destination="4" id="9NS-IB-Iup"/>
@@ -68,7 +68,7 @@
                         <accessibilityConnection property="title" destination="3" id="75"/>
                     </connections>
                 </colorWell>
-                <textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="3">
+                <textField focusRingType="none" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="3">
                     <rect key="frame" x="80" y="433" width="37" height="17"/>
                     <autoresizingMask key="autoresizingMask"/>
                     <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Text:" id="65">
@@ -86,7 +86,7 @@
                         <accessibilityConnection property="title" destination="5" id="80"/>
                     </connections>
                 </colorWell>
-                <textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="5">
+                <textField focusRingType="none" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="5">
                     <rect key="frame" x="48" y="401" width="69" height="17"/>
                     <autoresizingMask key="autoresizingMask"/>
                     <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Anchored:" id="64">
@@ -104,7 +104,7 @@
                         <accessibilityConnection property="title" destination="7" id="71"/>
                     </connections>
                 </colorWell>
-                <textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="7">
+                <textField focusRingType="none" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="7">
                     <rect key="frame" x="242" y="433" width="44" height="17"/>
                     <autoresizingMask key="autoresizingMask"/>
                     <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Circle:" id="63">
@@ -122,7 +122,7 @@
                         <accessibilityConnection property="title" destination="9" id="83"/>
                     </connections>
                 </colorWell>
-                <textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="9">
+                <textField focusRingType="none" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="9">
                     <rect key="frame" x="254" y="369" width="32" height="17"/>
                     <autoresizingMask key="autoresizingMask"/>
                     <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Rect:" id="62">
@@ -140,7 +140,7 @@
                         <accessibilityConnection property="title" destination="11" id="78"/>
                     </connections>
                 </colorWell>
-                <textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="11">
+                <textField focusRingType="none" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="11">
                     <rect key="frame" x="365" y="433" width="67" height="17"/>
                     <autoresizingMask key="autoresizingMask"/>
                     <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Highlight:" id="61">
@@ -158,7 +158,7 @@
                         <accessibilityConnection property="title" destination="13" id="68"/>
                     </connections>
                 </colorWell>
-                <textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="13">
+                <textField focusRingType="none" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="13">
                     <rect key="frame" x="363" y="401" width="69" height="17"/>
                     <autoresizingMask key="autoresizingMask"/>
                     <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Underline:" id="60">
@@ -175,7 +175,7 @@
                         <accessibilityConnection property="title" destination="15" id="82"/>
                     </connections>
                 </colorWell>
-                <textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="15">
+                <textField focusRingType="none" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="15">
                     <rect key="frame" x="360" y="369" width="72" height="17"/>
                     <autoresizingMask key="autoresizingMask"/>
                     <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Strikethrough:" id="59">
@@ -193,7 +193,7 @@
                         <accessibilityConnection property="title" destination="17" id="72"/>
                     </connections>
                 </colorWell>
-                <textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="17">
+                <textField focusRingType="none" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="17">
                     <rect key="frame" x="366" y="337" width="67" height="17"/>
                     <autoresizingMask key="autoresizingMask"/>
                     <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Freehand:" id="58">
@@ -202,7 +202,7 @@
                         <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
                     </textFieldCell>
                 </textField>
-                <textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="18">
+                <textField focusRingType="none" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="18">
                     <rect key="frame" x="17" y="461" width="475" height="17"/>
                     <autoresizingMask key="autoresizingMask" widthSizable="YES"/>
                     <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Note colors:" id="57">
@@ -211,7 +211,7 @@
                         <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
                     </textFieldCell>
                 </textField>
-                <textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="19">
+                <textField focusRingType="none" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="19">
                     <rect key="frame" x="17" y="291" width="475" height="17"/>
                     <autoresizingMask key="autoresizingMask" widthSizable="YES"/>
                     <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Note fonts:" id="56">
@@ -233,7 +233,7 @@
                         <accessibilityConnection property="title" destination="22" id="67"/>
                     </connections>
                 </colorWell>
-                <textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="22">
+                <textField focusRingType="none" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="22">
                     <rect key="frame" x="82" y="369" width="35" height="17"/>
                     <autoresizingMask key="autoresizingMask"/>
                     <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Line:" id="55">
@@ -242,7 +242,7 @@
                         <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
                     </textFieldCell>
                 </textField>
-                <customView toolTip="Border styles to use for new text notes" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="23" customClass="KMLineWell" customModule="PDF_Master" customModuleProvider="target">
+                <customView toolTip="Border styles to use for new text notes" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="23" customClass="KMLineWell" customModule="PDF_Reader_Pro" customModuleProvider="target">
                     <rect key="frame" x="122" y="132" width="120" height="48"/>
                     <autoresizingMask key="autoresizingMask"/>
                     <connections>
@@ -250,7 +250,7 @@
                         <accessibilityConnection property="title" destination="24" id="73"/>
                     </connections>
                 </customView>
-                <textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="24">
+                <textField focusRingType="none" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="24">
                     <rect key="frame" x="80" y="148" width="37" height="17"/>
                     <autoresizingMask key="autoresizingMask"/>
                     <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Text:" id="54">
@@ -259,7 +259,7 @@
                         <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
                     </textFieldCell>
                 </textField>
-                <customView toolTip="Line styles to use for new lines" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="25" customClass="KMLineWell" customModule="PDF_Master" customModuleProvider="target">
+                <customView toolTip="Line styles to use for new lines" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="25" customClass="KMLineWell" customModule="PDF_Reader_Pro" customModuleProvider="target">
                     <rect key="frame" x="122" y="76" width="120" height="48"/>
                     <autoresizingMask key="autoresizingMask"/>
                     <connections>
@@ -267,7 +267,7 @@
                         <accessibilityConnection property="title" destination="26" id="70"/>
                     </connections>
                 </customView>
-                <textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="26">
+                <textField focusRingType="none" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="26">
                     <rect key="frame" x="82" y="92" width="35" height="17"/>
                     <autoresizingMask key="autoresizingMask"/>
                     <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Line:" id="53">
@@ -276,7 +276,7 @@
                         <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
                     </textFieldCell>
                 </textField>
-                <customView toolTip="Line styles to use for new freehand notes" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="27" customClass="KMLineWell" customModule="PDF_Master" customModuleProvider="target">
+                <customView toolTip="Line styles to use for new freehand notes" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="27" customClass="KMLineWell" customModule="PDF_Reader_Pro" customModuleProvider="target">
                     <rect key="frame" x="122" y="20" width="120" height="48"/>
                     <autoresizingMask key="autoresizingMask"/>
                     <connections>
@@ -284,7 +284,7 @@
                         <accessibilityConnection property="title" destination="28" id="74"/>
                     </connections>
                 </customView>
-                <textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="28">
+                <textField focusRingType="none" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="28">
                     <rect key="frame" x="50" y="36" width="67" height="17"/>
                     <autoresizingMask key="autoresizingMask"/>
                     <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Freehand:" id="52">
@@ -293,7 +293,7 @@
                         <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
                     </textFieldCell>
                 </textField>
-                <customView toolTip="Line styles to use for new circle highlights" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="29" customClass="KMLineWell" customModule="PDF_Master" customModuleProvider="target">
+                <customView toolTip="Line styles to use for new circle highlights" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="29" customClass="KMLineWell" customModule="PDF_Reader_Pro" customModuleProvider="target">
                     <rect key="frame" x="369" y="132" width="120" height="48"/>
                     <autoresizingMask key="autoresizingMask"/>
                     <connections>
@@ -301,7 +301,7 @@
                         <accessibilityConnection property="title" destination="30" id="79"/>
                     </connections>
                 </customView>
-                <textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="30">
+                <textField focusRingType="none" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="30">
                     <rect key="frame" x="320" y="148" width="44" height="17"/>
                     <autoresizingMask key="autoresizingMask"/>
                     <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Circle:" id="51">
@@ -310,17 +310,17 @@
                         <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
                     </textFieldCell>
                 </textField>
-                <customView toolTip="Line styles to use for new box highlights" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="31" customClass="KMLineWell" customModule="PDF_Master" customModuleProvider="target">
+                <customView toolTip="Line styles to use for new box highlights" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="31" customClass="KMLineWell" customModule="PDF_Reader_Pro" customModuleProvider="target">
                     <rect key="frame" x="369" y="76" width="120" height="48"/>
                     <autoresizingMask key="autoresizingMask"/>
                     <connections>
                         <accessibilityConnection property="title" destination="32" id="77"/>
                     </connections>
                 </customView>
-                <textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="32">
-                    <rect key="frame" x="332" y="92" width="32" height="17"/>
+                <textField focusRingType="none" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="32">
+                    <rect key="frame" x="299" y="92" width="65" height="17"/>
                     <autoresizingMask key="autoresizingMask"/>
-                    <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Rect:" id="50">
+                    <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Freehand:" id="50">
                         <font key="font" metaFont="system"/>
                         <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
                         <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
@@ -330,7 +330,7 @@
                     <rect key="frame" x="12" y="215" width="485" height="5"/>
                     <autoresizingMask key="autoresizingMask" widthSizable="YES"/>
                 </box>
-                <textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="34">
+                <textField focusRingType="none" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="34">
                     <rect key="frame" x="17" y="188" width="475" height="17"/>
                     <autoresizingMask key="autoresizingMask" widthSizable="YES"/>
                     <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Note lines and borders:" id="49">
@@ -348,7 +348,7 @@
                         <accessibilityConnection property="title" destination="36" id="81"/>
                     </connections>
                 </colorWell>
-                <textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="36">
+                <textField focusRingType="none" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="36">
                     <rect key="frame" x="191" y="401" width="95" height="17"/>
                     <autoresizingMask key="autoresizingMask"/>
                     <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Circle interior:" id="48">
@@ -366,7 +366,7 @@
                         <accessibilityConnection property="title" destination="38" id="69"/>
                     </connections>
                 </colorWell>
-                <textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="38">
+                <textField focusRingType="none" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="38">
                     <rect key="frame" x="204" y="337" width="82" height="17"/>
                     <autoresizingMask key="autoresizingMask"/>
                     <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Rect interior:" id="47">
@@ -384,7 +384,7 @@
                         <accessibilityConnection property="title" destination="263" id="265"/>
                     </connections>
                 </colorWell>
-                <textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="263">
+                <textField focusRingType="none" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="263">
                     <rect key="frame" x="32" y="337" width="85" height="17"/>
                     <autoresizingMask key="autoresizingMask"/>
                     <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Line interior:" id="264">
@@ -393,7 +393,7 @@
                         <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
                     </textFieldCell>
                 </textField>
-                <textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="39">
+                <textField focusRingType="none" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="39">
                     <rect key="frame" x="80" y="265" width="37" height="17"/>
                     <autoresizingMask key="autoresizingMask"/>
                     <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Text:" id="46">
@@ -402,7 +402,7 @@
                         <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
                     </textFieldCell>
                 </textField>
-                <textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="40">
+                <textField focusRingType="none" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="40">
                     <rect key="frame" x="48" y="233" width="69" height="17"/>
                     <autoresizingMask key="autoresizingMask"/>
                     <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Anchored:" id="45">
@@ -411,10 +411,10 @@
                         <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
                     </textFieldCell>
                 </textField>
-                <button toolTip="Font to use for new text notes" fixedFrame="YES" imageHugsTitle="YES" translatesAutoresizingMaskIntoConstraints="NO" id="41" customClass="KMFontWell" customModule="PDF_Master" customModuleProvider="target">
+                <button toolTip="Font to use for new text notes" imageHugsTitle="YES" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="41" customClass="KMFontWell" customModule="PDF_Reader_Pro" customModuleProvider="target">
                     <rect key="frame" x="122" y="262" width="295" height="22"/>
                     <autoresizingMask key="autoresizingMask"/>
-                    <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" alignment="center" borderStyle="border" inset="2" id="44" customClass="KMFontWellCell" customModule="PDF_Master" customModuleProvider="target">
+                    <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" alignment="center" borderStyle="border" inset="2" id="44" customClass="KMFontWellCell" customModule="PDF_Reader_Pro" customModuleProvider="target">
                         <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES" changeBackground="YES" changeGray="YES"/>
                         <font key="font" metaFont="system"/>
                     </buttonCell>
@@ -424,10 +424,10 @@
                         <accessibilityConnection property="title" destination="39" id="76"/>
                     </connections>
                 </button>
-                <button toolTip="Font to use for new anchored notes" fixedFrame="YES" imageHugsTitle="YES" translatesAutoresizingMaskIntoConstraints="NO" id="42" customClass="KMFontWell" customModule="PDF_Master" customModuleProvider="target">
+                <button toolTip="Font to use for new anchored notes" imageHugsTitle="YES" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="42" customClass="KMFontWell" customModule="PDF_Reader_Pro" customModuleProvider="target">
                     <rect key="frame" x="122" y="230" width="295" height="22"/>
                     <autoresizingMask key="autoresizingMask"/>
-                    <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" alignment="center" borderStyle="border" inset="2" id="43" customClass="KMFontWellCell" customModule="PDF_Master" customModuleProvider="target">
+                    <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" alignment="center" borderStyle="border" inset="2" id="43" customClass="KMFontWellCell" customModule="PDF_Reader_Pro" customModuleProvider="target">
                         <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES" changeBackground="YES" changeGray="YES"/>
                         <font key="font" metaFont="system"/>
                     </buttonCell>