소스 검색

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

niehaoyu 1 년 전
부모
커밋
f64bdffa65
18개의 변경된 파일1550개의 추가작업 그리고 63개의 파일을 삭제
  1. 1 0
      PDF Office/PDF Master/Class/Common/LineInspector/KMLineInspector.swift
  2. 141 0
      PDF Office/PDF Master/Class/PDFTools/AutoFlow/KMAotuFlowExtension.swift
  3. 113 0
      PDF Office/PDF Master/Class/PDFTools/AutoFlow/KMAutoFlowOptionsSheetController.swift
  4. 233 0
      PDF Office/PDF Master/Class/PDFTools/AutoFlow/KMAutoFlowOptionsSheetController.xib
  5. 1 1
      PDF Office/PDF Master/Class/PDFTools/Convert/NewController/KMToolCompareWindowController.swift
  6. 509 0
      PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/ViewController/FormProperties/KMAnnotationChoiceWidgetAppearanceViewController.swift
  7. 237 0
      PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/ViewController/FormProperties/KMAnnotationChoiceWidgetAppearanceViewController.xib
  8. 10 0
      PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+MenuAction.swift
  9. 3 0
      PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController.swift
  10. 91 45
      PDF Office/PDF Master/Class/Preference/Controller/KMNotesPreferences.swift
  11. 56 0
      PDF Office/PDF Master/Class/Preference/Tools/KMPreferenceCommon.swift
  12. 81 1
      PDF Office/PDF Master/Class/Preference/Tools/KMPreferenceManager.swift
  13. 1 1
      PDF Office/PDF Master/Class/Preference/View/KMLineWell.swift
  14. 3 3
      PDF Office/PDF Master/Class/Purchase/DMG/Verification/KMVerificationMessageViewController.m
  15. 63 5
      PDF Office/PDF Reader Pro.xcodeproj/project.pbxproj
  16. 4 4
      PDF Office/PDF Reader Pro.xcodeproj/xcshareddata/xcschemes/PDF Reader Pro Edition.xcscheme
  17. 1 1
      PDF Office/PDF Reader Pro.xcodeproj/xcuserdata/kdanmobile.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
  18. 2 2
      PDF Office/PDF-Reader-Pro-Edition-Info.plist

+ 1 - 0
PDF Office/PDF Master/Class/Common/LineInspector/KMLineInspector.swift

@@ -195,6 +195,7 @@ class KMLineInspector: NSWindowController {
         self.lineWidthSlider.floatValue = Float(self.lineWidth)
         self.lineWidthField.stringValue = "\(self.lineWidth)"
         self.styleButton.selectedSegment = self.style
+        self.dashPatternField.stringValue = "\(self.dashPattern.count)"
         self.startLineStyleButton.selectedSegment = self.startLineStyle
         self.endLineStyleButton.selectedSegment = self.endLineStyle
     }

+ 141 - 0
PDF Office/PDF Master/Class/PDFTools/AutoFlow/KMAotuFlowExtension.swift

@@ -0,0 +1,141 @@
+//
+//  KMAotuFlowExtension.swift
+//  PDF Reader Pro
+//
+//  Created by lizhe on 2024/1/16.
+//
+import Cocoa
+
+private var autoFlowTimerKey: UInt8 = 0
+private var fastFlowTimerKey: UInt8 = 0
+
+extension CPDFView {
+
+    var autoFlowTimer: Timer? {
+        get {
+            return objc_getAssociatedObject(self, &autoFlowTimerKey) as? Timer
+        }
+        set {
+            objc_setAssociatedObject(self, &autoFlowTimerKey, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
+        }
+    }
+
+    var fastFlowTimer: Timer? {
+        get {
+            return objc_getAssociatedObject(self, &fastFlowTimerKey) as? Timer
+        }
+        set {
+            objc_setAssociatedObject(self, &fastFlowTimerKey, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
+        }
+    }
+
+    func startAutoFlow() {
+        let timeInterval = KMAutoFlowOptionsSheetController.timeInterval()
+        let timer = Timer.scheduledTimer(timeInterval: TimeInterval(timeInterval), target: self, selector: #selector(updateAutoFlow), userInfo: nil, repeats: true)
+        autoFlowTimer = timer
+
+        CustomAlertView.alertView(message: NSLocalizedString("AutoScroll On", comment: ""), fromView: self, withStyle: .black)
+    }
+
+    @objc func updateAutoFlow() {
+        self.setDisplay(.singlePage)
+        let jumpSpace = KMAutoFlowOptionsSheetController.jumpSpace()
+        if self.displayMode() == .singlePage || self.displayMode() == .twoUp {
+            if canGoToNextPage() {
+                goToNextPage(nil)
+            } else {
+                stopAutoFlow()
+            }
+        } else {
+            if let scrollView = documentView().enclosingScrollView {
+                let clipView = scrollView.contentView
+                var newOrigin = clipView.bounds.origin
+                newOrigin.y = newOrigin.y - CGFloat(jumpSpace)
+
+                clipView.animator().setBoundsOrigin(newOrigin)
+
+                if newOrigin.y <= 0 {
+                    stopAutoFlow()
+                }
+            }
+        }
+    }
+
+    func stopAutoFlow() {
+        autoFlowTimer?.invalidate()
+        autoFlowTimer = nil
+
+        CustomAlertView.alertView(message: NSLocalizedString("AutoScroll Off", comment: ""), fromView: self, withStyle: .black)
+    }
+
+    func isAutoFlow() -> Bool {
+        return autoFlowTimer != nil && autoFlowTimer!.isValid
+    }
+
+    func autoFlow() {
+        if isAutoFlow() {
+            stopAutoFlow()
+        } else {
+            startAutoFlow()
+        }
+    }
+
+    func startFastFlow() {
+        let timeInterval: TimeInterval = 0.1
+        let timer = Timer.scheduledTimer(timeInterval: timeInterval, target: self, selector: #selector(updateFastFlow), userInfo: nil, repeats: true)
+        fastFlowTimer = timer
+    }
+
+    @objc func updateFastFlow() {
+        let jumpSpace: CGFloat = 200
+
+//        if !isScrollUp {
+//            // jumpSpace为负值
+//            let negativeJumpSpace = -jumpSpace
+//            updateScrollView(with: negativeJumpSpace)
+//        } else {
+            updateScrollView(with: jumpSpace)
+//        }
+    }
+
+    func updateScrollView(with jumpSpace: CGFloat) {
+        if self.displayMode() == .singlePage || self.displayMode() == .twoUp {
+            if canGoToNextPage() {
+                goToNextPage(nil)
+            } else {
+                stopFastFlow()
+            }
+        } else {
+            if let scrollView = documentView().enclosingScrollView {
+                let clipView = scrollView.contentView
+                var newOrigin = clipView.bounds.origin
+                newOrigin.y -= jumpSpace
+
+                clipView.animator().setBoundsOrigin(newOrigin)
+
+                if newOrigin.y <= 0 /*&& isScrollUp*/ {
+                    stopFastFlow()
+                } else if newOrigin.y >= documentView().frame.size.height /*&& !isScrollUp*/ {
+                    stopFastFlow()
+                }
+            }
+        }
+    }
+
+    func stopFastFlow() {
+        fastFlowTimer?.invalidate()
+        fastFlowTimer = nil
+    }
+
+    func isFastFlow() -> Bool {
+        return fastFlowTimer != nil && fastFlowTimer!.isValid
+    }
+
+    func fastFlow() {
+        if isFastFlow() {
+            stopFastFlow()
+        } else {
+            startFastFlow()
+        }
+    }
+}

+ 113 - 0
PDF Office/PDF Master/Class/PDFTools/AutoFlow/KMAutoFlowOptionsSheetController.swift

@@ -0,0 +1,113 @@
+//
+//  KMAutoFlowOptionsSheetController.swift
+//  PDF Reader Pro
+//
+//  Created by lizhe on 2024/1/16.
+//
+
+import Cocoa
+
+class KMAutoFlowOptionsSheetController: NSWindowController {
+    @IBOutlet weak var timeIntervalLabel: NSTextField!
+    @IBOutlet weak var timeIntervalSlider: NSSlider!
+    @IBOutlet weak var timeIntervalTextField: NSTextField!
+    @IBOutlet weak var secLabel: NSTextField!
+    @IBOutlet weak var jumpSpaceLabel: NSTextField!
+    @IBOutlet weak var jumpSpaceSlider: NSSlider!
+    @IBOutlet weak var jumpSpaceTextField: NSTextField!
+    @IBOutlet weak var pxLabel: NSTextField!
+    
+    @IBOutlet weak var closeButton: NSButton!
+    @IBOutlet weak var okButton: NSButton!
+    
+    var timeInterval: String?
+    var jumpSpace: String?
+    
+    override init(window: NSWindow?) {
+        super.init(window: window)
+    }
+    
+    required init?(coder: NSCoder) {
+        super.init(coder: coder)
+    }
+    
+    override func windowDidLoad() {
+        super.windowDidLoad()
+        
+        self.closeButton.title = NSLocalizedString("Cancel", comment: "")
+        self.okButton.title = NSLocalizedString("OK", comment: "")
+        self.timeIntervalLabel.stringValue = NSLocalizedString("Time Interval", comment: "")
+        self.jumpSpaceLabel.stringValue = NSLocalizedString("Jump Space", comment: "")
+        self.secLabel.stringValue = NSLocalizedString("sec", comment: "")
+        self.pxLabel.stringValue = NSLocalizedString("px", comment: "")
+        
+        self.timeIntervalTextField.delegate = self
+        self.jumpSpaceTextField.delegate = self
+        
+        let timeInterval = KMAutoFlowOptionsSheetController.timeInterval()
+        let jumpSpace = KMAutoFlowOptionsSheetController.jumpSpace()
+        self.timeInterval = String(timeInterval)
+        self.jumpSpace = String(jumpSpace)
+    }
+    
+    @IBAction func closeButtonAction(_ sender: Any) {
+        self.close()
+    }
+    
+    @IBAction func okButtonAction(_ sender: Any) {
+        let sec = self.timeIntervalTextField.stringValue.isEmpty ? "0" : self.timeIntervalTextField.stringValue
+        var jumpSpaceStr = self.jumpSpaceTextField.stringValue.isEmpty ? "0" : self.jumpSpaceTextField.stringValue
+        //替换”,“
+        jumpSpaceStr = jumpSpaceStr.replacingOccurrences(of: ",", with: "")
+        
+        KMAutoFlowOptionsSheetController.setTimeInterval(Float(sec) ?? 0.0)
+        KMAutoFlowOptionsSheetController.setJumpSpace(Float(jumpSpaceStr) ?? 0.0)
+        
+        self.close()
+    }
+    @IBAction func timeIntervalSliderAction(_ sender: NSSlider) {
+        self.timeIntervalTextField.stringValue = sender.stringValue
+    }
+    
+    @IBAction func jumpSpaceSliderAction(_ sender: NSSlider) {
+        self.jumpSpaceTextField.stringValue = sender.stringValue
+    }
+    
+    
+    class func timeInterval() -> Float {
+        if let storedValue = UserDefaults.standard.object(forKey: "km_pdfview_autoflow_timeinterval") as? Float {
+            return storedValue
+        }
+        return 5.0
+    }
+    
+    class func setTimeInterval(_ timeInterval: Float) {
+        UserDefaults.standard.set(timeInterval, forKey: "km_pdfview_autoflow_timeinterval")
+        UserDefaults.standard.synchronize()
+    }
+    
+    class func jumpSpace() -> Float {
+        if let storedValue = UserDefaults.standard.object(forKey: "km_pdfview_autoflow_jumpspace") as? Float {
+            return storedValue
+        }
+        return 40.0
+    }
+    
+    class func setJumpSpace(_ jumpSpace: Float) {
+        UserDefaults.standard.set(jumpSpace, forKey: "km_pdfview_autoflow_jumpspace")
+        UserDefaults.standard.synchronize()
+    }
+}
+
+extension KMAutoFlowOptionsSheetController: NSTextFieldDelegate {
+    func controlTextDidEndEditing(_ obj: Notification) {
+        let textField: NSTextField = obj.object as! NSTextField;
+        if textField == self.timeIntervalTextField {
+            self.timeIntervalSlider.stringValue = self.timeIntervalTextField.stringValue
+            print("参数改变了")
+        } else if textField == self.jumpSpaceTextField {
+            print("参数改变了2")
+            self.jumpSpaceSlider.stringValue = self.jumpSpaceTextField.stringValue
+        }
+    }
+}

+ 233 - 0
PDF Office/PDF Master/Class/PDFTools/AutoFlow/KMAutoFlowOptionsSheetController.xib

@@ -0,0 +1,233 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner" customClass="KMAutoFlowOptionsSheetController" customModule="PDF_Reader_Pro" customModuleProvider="target">
+            <connections>
+                <outlet property="closeButton" destination="s1O-Cd-eCg" id="2C4-z9-4ge"/>
+                <outlet property="jumpSpaceLabel" destination="BGZ-NV-7Bh" id="f2h-td-NQk"/>
+                <outlet property="jumpSpaceSlider" destination="0Ff-dQ-u9k" id="co2-iX-tkz"/>
+                <outlet property="jumpSpaceTextField" destination="SpP-4y-O15" id="qen-pV-9AS"/>
+                <outlet property="okButton" destination="t7J-DK-BGc" id="K7z-Qg-PFO"/>
+                <outlet property="pxLabel" destination="faS-jX-7gc" id="LGl-no-lqQ"/>
+                <outlet property="secLabel" destination="bsL-ML-8TW" id="aMX-DO-45d"/>
+                <outlet property="timeIntervalLabel" destination="ZTj-Z4-wyT" id="E3m-pQ-g35"/>
+                <outlet property="timeIntervalSlider" destination="q9b-Da-zbl" id="lOx-ZG-5Ml"/>
+                <outlet property="timeIntervalTextField" destination="Ljy-jv-DxZ" id="6lW-V7-tMv"/>
+                <outlet property="window" destination="F0z-JX-Cv5" id="gIp-Ho-8D9"/>
+            </connections>
+        </customObject>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="F0z-JX-Cv5">
+            <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
+            <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
+            <rect key="contentRect" x="196" y="240" width="296" height="235"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="2560" height="1415"/>
+            <view key="contentView" id="se5-gp-TjO">
+                <rect key="frame" x="0.0" y="0.0" width="296" height="235"/>
+                <autoresizingMask key="autoresizingMask"/>
+                <subviews>
+                    <view wantsLayer="YES" translatesAutoresizingMaskIntoConstraints="NO" id="iww-P7-9I4">
+                        <rect key="frame" x="0.0" y="0.0" width="296" height="235"/>
+                        <subviews>
+                            <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ZTj-Z4-wyT">
+                                <rect key="frame" x="28" y="199" width="83" height="16"/>
+                                <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Time Interval" id="fgk-GN-2ma">
+                                    <font key="font" metaFont="system"/>
+                                    <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                    <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                                </textFieldCell>
+                            </textField>
+                            <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="BGZ-NV-7Bh">
+                                <rect key="frame" x="28" y="118" width="79" height="16"/>
+                                <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Jump Space" id="Yzb-NY-UoI">
+                                    <font key="font" metaFont="system"/>
+                                    <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                    <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                                </textFieldCell>
+                            </textField>
+                            <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="t7J-DK-BGc">
+                                <rect key="frame" x="187" y="13" width="96" height="32"/>
+                                <buttonCell key="cell" type="push" title="OK" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="cBI-Qg-Mn4">
+                                    <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                    <font key="font" metaFont="system"/>
+                                    <string key="keyEquivalent" base64-UTF8="YES">
+DQ
+</string>
+                                </buttonCell>
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="82" id="MJK-HE-g4o"/>
+                                </constraints>
+                                <connections>
+                                    <action selector="okButtonAction:" target="-2" id="f8G-4o-5cA"/>
+                                </connections>
+                            </button>
+                            <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="s1O-Cd-eCg">
+                                <rect key="frame" x="85" y="13" width="96" height="32"/>
+                                <buttonCell key="cell" type="push" title="Cancel" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="Ci4-jz-FBT">
+                                    <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                    <font key="font" metaFont="system"/>
+                                    <string key="keyEquivalent" base64-UTF8="YES">
+Gw
+</string>
+                                </buttonCell>
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="82" id="9Od-Aa-mut"/>
+                                </constraints>
+                                <connections>
+                                    <action selector="closeButtonAction:" target="-2" id="xy0-QC-CQf"/>
+                                </connections>
+                            </button>
+                            <slider verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="q9b-Da-zbl">
+                                <rect key="frame" x="28" y="158" width="154" height="28"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="150" id="q80-Mu-LDU"/>
+                                </constraints>
+                                <sliderCell key="cell" continuous="YES" state="on" alignment="left" minValue="1" maxValue="100" doubleValue="5" tickMarkPosition="below" numberOfTickMarks="5" sliderType="linear" id="CeB-dF-tZc"/>
+                                <connections>
+                                    <action selector="timeIntervalSliderAction:" target="-2" id="D9h-gr-3S9"/>
+                                </connections>
+                            </slider>
+                            <slider verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="0Ff-dQ-u9k">
+                                <rect key="frame" x="28" y="77" width="154" height="28"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="150" id="gZ1-J1-Ymn"/>
+                                </constraints>
+                                <sliderCell key="cell" continuous="YES" state="on" alignment="left" minValue="10" maxValue="1000" doubleValue="20" tickMarkPosition="below" numberOfTickMarks="5" sliderType="linear" id="cRs-cv-InS"/>
+                                <connections>
+                                    <action selector="jumpSpaceSliderAction:" target="-2" id="MED-TW-Or6"/>
+                                </connections>
+                            </slider>
+                            <textField focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Ljy-jv-DxZ">
+                                <rect key="frame" x="190" y="163" width="60" height="22"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="22" id="cYp-gZ-5xD"/>
+                                    <constraint firstAttribute="width" constant="60" id="kpB-ps-0sB"/>
+                                </constraints>
+                                <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" alignment="center" title="5" drawsBackground="YES" id="sMy-0h-gPe">
+                                    <numberFormatter key="formatter" formatterBehavior="custom10_4" positiveFormat="#,##0" numberStyle="decimal" minimumIntegerDigits="1" maximumIntegerDigits="2000000000" id="oDK-Pi-YME">
+                                        <real key="minimum" value="1"/>
+                                        <real key="maximum" value="100"/>
+                                    </numberFormatter>
+                                    <font key="font" metaFont="system"/>
+                                    <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                                    <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                </textFieldCell>
+                            </textField>
+                            <textField focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="SpP-4y-O15">
+                                <rect key="frame" x="190" y="82" width="60" height="22"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="60" id="JlW-EP-Edi"/>
+                                    <constraint firstAttribute="height" constant="22" id="TsY-SP-z4G"/>
+                                </constraints>
+                                <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" alignment="center" title="20" drawsBackground="YES" id="t5U-Er-SkE">
+                                    <numberFormatter key="formatter" formatterBehavior="custom10_4" positiveFormat="#,##0" numberStyle="decimal" minimumIntegerDigits="1" maximumIntegerDigits="2000000000" id="q2a-zO-0NW">
+                                        <real key="minimum" value="10"/>
+                                        <real key="maximum" value="1000"/>
+                                    </numberFormatter>
+                                    <font key="font" metaFont="system"/>
+                                    <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                                    <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                </textFieldCell>
+                            </textField>
+                            <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="bsL-ML-8TW">
+                                <rect key="frame" x="252" y="166" width="26" height="16"/>
+                                <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="sec" id="LRS-ss-z06">
+                                    <font key="font" metaFont="system"/>
+                                    <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                    <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                                </textFieldCell>
+                            </textField>
+                            <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="faS-jX-7gc">
+                                <rect key="frame" x="252" y="85" width="19" height="16"/>
+                                <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="px" id="qjn-si-P37">
+                                    <font key="font" metaFont="system"/>
+                                    <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                    <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                                </textFieldCell>
+                            </textField>
+                            <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ZeY-Qw-sjb">
+                                <rect key="frame" x="28" y="150" width="10" height="14"/>
+                                <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="1" id="a6y-aZ-lDi">
+                                    <font key="font" metaFont="smallSystem"/>
+                                    <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                    <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                                </textFieldCell>
+                            </textField>
+                            <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="aNf-cL-SfA">
+                                <rect key="frame" x="158" y="150" width="24" height="14"/>
+                                <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="100" id="bU9-jb-ZfS">
+                                    <font key="font" metaFont="smallSystem"/>
+                                    <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                    <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                                </textFieldCell>
+                            </textField>
+                            <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="DFB-ri-xLo">
+                                <rect key="frame" x="28" y="69" width="17" height="14"/>
+                                <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="10" id="ioz-Vc-g7V">
+                                    <font key="font" metaFont="smallSystem"/>
+                                    <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                    <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                                </textFieldCell>
+                            </textField>
+                            <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Pl1-K2-RSE">
+                                <rect key="frame" x="151" y="69" width="31" height="14"/>
+                                <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="1000" id="W6k-3X-Zne">
+                                    <font key="font" metaFont="smallSystem"/>
+                                    <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                    <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                                </textFieldCell>
+                            </textField>
+                        </subviews>
+                        <constraints>
+                            <constraint firstItem="q9b-Da-zbl" firstAttribute="top" secondItem="ZTj-Z4-wyT" secondAttribute="bottom" constant="15" id="1zd-wg-4Zl"/>
+                            <constraint firstAttribute="trailing" secondItem="t7J-DK-BGc" secondAttribute="trailing" constant="20" id="4Zd-Xh-3R6"/>
+                            <constraint firstItem="aNf-cL-SfA" firstAttribute="trailing" secondItem="q9b-Da-zbl" secondAttribute="trailing" id="5qJ-n2-F8K"/>
+                            <constraint firstItem="ZeY-Qw-sjb" firstAttribute="top" secondItem="q9b-Da-zbl" secondAttribute="bottom" id="6Ab-eX-brR"/>
+                            <constraint firstItem="BGZ-NV-7Bh" firstAttribute="leading" secondItem="ZTj-Z4-wyT" secondAttribute="leading" id="74v-1j-0VX"/>
+                            <constraint firstItem="DFB-ri-xLo" firstAttribute="leading" secondItem="0Ff-dQ-u9k" secondAttribute="leading" id="7dM-wY-HNa"/>
+                            <constraint firstItem="Ljy-jv-DxZ" firstAttribute="leading" secondItem="q9b-Da-zbl" secondAttribute="trailing" constant="10" id="AEr-NC-Qut"/>
+                            <constraint firstAttribute="bottom" secondItem="t7J-DK-BGc" secondAttribute="bottom" constant="20" id="CHt-Hv-Jxq"/>
+                            <constraint firstItem="SpP-4y-O15" firstAttribute="centerY" secondItem="0Ff-dQ-u9k" secondAttribute="centerY" id="CbW-Db-hgD"/>
+                            <constraint firstItem="Ljy-jv-DxZ" firstAttribute="centerY" secondItem="q9b-Da-zbl" secondAttribute="centerY" id="G53-jg-6yM"/>
+                            <constraint firstItem="aNf-cL-SfA" firstAttribute="top" secondItem="q9b-Da-zbl" secondAttribute="bottom" id="LKt-XV-CM7"/>
+                            <constraint firstAttribute="bottom" secondItem="s1O-Cd-eCg" secondAttribute="bottom" constant="20" id="OZA-aO-8yk"/>
+                            <constraint firstItem="SpP-4y-O15" firstAttribute="leading" secondItem="0Ff-dQ-u9k" secondAttribute="trailing" constant="10" id="Soz-f2-xFN"/>
+                            <constraint firstItem="Pl1-K2-RSE" firstAttribute="top" secondItem="0Ff-dQ-u9k" secondAttribute="bottom" id="Trk-9M-eLR"/>
+                            <constraint firstItem="ZTj-Z4-wyT" firstAttribute="top" secondItem="iww-P7-9I4" secondAttribute="top" constant="20" id="Xbf-gp-yao"/>
+                            <constraint firstItem="q9b-Da-zbl" firstAttribute="leading" secondItem="ZTj-Z4-wyT" secondAttribute="leading" id="bGp-uE-uyb"/>
+                            <constraint firstItem="faS-jX-7gc" firstAttribute="leading" secondItem="SpP-4y-O15" secondAttribute="trailing" constant="4" id="eeI-7k-blX"/>
+                            <constraint firstItem="bsL-ML-8TW" firstAttribute="centerY" secondItem="Ljy-jv-DxZ" secondAttribute="centerY" id="gao-fH-bBh"/>
+                            <constraint firstItem="Pl1-K2-RSE" firstAttribute="trailing" secondItem="0Ff-dQ-u9k" secondAttribute="trailing" id="iDD-Pj-Jlu"/>
+                            <constraint firstItem="0Ff-dQ-u9k" firstAttribute="top" secondItem="BGZ-NV-7Bh" secondAttribute="bottom" constant="15" id="iLu-r5-JFP"/>
+                            <constraint firstItem="t7J-DK-BGc" firstAttribute="leading" secondItem="s1O-Cd-eCg" secondAttribute="trailing" constant="20" id="js6-II-lzY"/>
+                            <constraint firstItem="0Ff-dQ-u9k" firstAttribute="leading" secondItem="BGZ-NV-7Bh" secondAttribute="leading" id="lwF-q9-Ksn"/>
+                            <constraint firstItem="bsL-ML-8TW" firstAttribute="leading" secondItem="Ljy-jv-DxZ" secondAttribute="trailing" constant="4" id="nbA-o3-Tzl"/>
+                            <constraint firstItem="DFB-ri-xLo" firstAttribute="top" secondItem="0Ff-dQ-u9k" secondAttribute="bottom" id="ojF-p5-JZH"/>
+                            <constraint firstItem="ZTj-Z4-wyT" firstAttribute="leading" secondItem="iww-P7-9I4" secondAttribute="leading" constant="30" id="v18-T9-1n4"/>
+                            <constraint firstItem="faS-jX-7gc" firstAttribute="centerY" secondItem="SpP-4y-O15" secondAttribute="centerY" id="wA2-t2-gqD"/>
+                            <constraint firstItem="BGZ-NV-7Bh" firstAttribute="top" secondItem="q9b-Da-zbl" secondAttribute="bottom" constant="30" id="xqw-uV-Syq"/>
+                            <constraint firstItem="ZeY-Qw-sjb" firstAttribute="leading" secondItem="q9b-Da-zbl" secondAttribute="leading" id="yYt-Xh-Vir"/>
+                        </constraints>
+                    </view>
+                </subviews>
+                <constraints>
+                    <constraint firstAttribute="trailing" secondItem="iww-P7-9I4" secondAttribute="trailing" id="8hN-kR-6qj"/>
+                    <constraint firstAttribute="bottom" secondItem="iww-P7-9I4" secondAttribute="bottom" id="Evb-c0-rAc"/>
+                    <constraint firstItem="iww-P7-9I4" firstAttribute="top" secondItem="se5-gp-TjO" secondAttribute="top" id="GNK-ck-c7W"/>
+                    <constraint firstItem="iww-P7-9I4" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" id="apa-fO-HMx"/>
+                </constraints>
+            </view>
+            <connections>
+                <outlet property="delegate" destination="-2" id="0bl-1N-AYu"/>
+            </connections>
+            <point key="canvasLocation" x="47" y="86.5"/>
+        </window>
+        <userDefaultsController representsSharedInstance="YES" id="sBo-hf-3Wk"/>
+    </objects>
+</document>

+ 1 - 1
PDF Office/PDF Master/Class/PDFTools/Convert/NewController/KMToolCompareWindowController.swift

@@ -28,7 +28,7 @@ class KMToolCompareWindowController: NSWindowController{
         self.selectIndex = selectNum
     }
     
-    func toolCompareWith(toolType:KMCompareWithToolType, selectNum:Int) -> KMToolCompareWindowController {
+   @objc func toolCompare(toolType:KMCompareWithToolType, selectNum:Int) -> KMToolCompareWindowController {
         if (currentWindowController != nil) {
             return currentWindowController!
         }

+ 509 - 0
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/ViewController/FormProperties/KMAnnotationChoiceWidgetAppearanceViewController.swift

@@ -0,0 +1,509 @@
+//
+//  KMAnnotationChoiceWidgetAppearanceViewController.swift
+//  PDF Reader Pro
+//
+//  Created by wanjun on 2024/1/16.
+//
+
+import Cocoa
+
+private enum KMPDFAnnotationFontWeightType: Int {
+    case ultraLight = 0
+    case thin
+    case light
+    case regular
+    case medium
+    case semibold
+    case bold
+    case heavy
+    case black
+}
+
+class KMAnnotationChoiceWidgetAppearanceViewController: NSViewController {
+    
+    private var _annotations: [CPDFChoiceWidgetAnnotation] = []
+    private var _formMode: CAnnotationType = .radioButton
+    var pdfView: CPDFListView?
+    var annotationModel: CPDFAnnotationModel?
+    
+    // Outlets
+    @IBOutlet private var fillColorLabel: NSTextField!
+    @IBOutlet private var fillColorPickerView: KMColorPickerView!
+    @IBOutlet private var fontViewBottom: NSLayoutConstraint!
+    @IBOutlet private var fontLabel: NSTextField!
+    @IBOutlet private var fontPopUpButton: KMPopUpButton!
+    @IBOutlet private var fontStylePopUpButton: KMPopUpButton!
+    @IBOutlet private var fontSizeComboBox: KMComboBox!
+    @IBOutlet private var fontButton: NSButton!
+    @IBOutlet private var colorPickerView: KMColorPickerView!
+
+    // Properties
+    private var annotation: CPDFChoiceWidgetAnnotation?
+    private var isFromMode: Bool = false
+    private var annotationFont: NSFont?
+    private var fontWeightType: KMPDFAnnotationFontWeightType = .ultraLight
+    
+    deinit {
+        fillColorPickerView.target = nil
+        fillColorPickerView.action = nil
+        colorPickerView.target = nil
+        colorPickerView.action = nil
+        NSColorPanel.shared.setTarget(nil)
+        NSColorPanel.shared.setAction(nil)
+        NSFontManager.shared.target = nil
+        
+        NotificationCenter.default.removeObserver(self)
+        DistributedNotificationCenter.default().removeObserver(self)
+        annotation = nil
+        annotationFont = nil
+    }
+    
+    // MARK: Init
+    
+    override func loadView() {
+        super.loadView()
+        
+        NotificationCenter.default.addObserver(self, selector: #selector(formButtonLabelTextField), name: Notification.Name("KMFormActionButtonLabelTextField"), object: nil)
+        
+        fillColorLabel.stringValue = NSLocalizedString("Colors", comment: "")
+        fillColorLabel.textColor = KMAppearance.Layout.h0Color()
+        fontLabel.stringValue = NSLocalizedString("Fonts", comment: "")
+        fontLabel.textColor = KMAppearance.Layout.h0Color()
+        fillColorPickerView.noContentString = true
+        fillColorPickerView.annotationTypeString = NSLocalizedString("Background Color", comment: "")
+        fillColorPickerView.annotationType = .fromFillColors
+        fillColorPickerView.isFillColor = true
+        fillColorPickerView.isCallColorPanelAction = true
+        
+        colorPickerView.noContentString = true
+        colorPickerView.annotationTypeString = NSLocalizedString("Text Color", comment: "")
+        colorPickerView.annotationType = .fromColors
+        colorPickerView.isCallColorPanelAction = true
+        
+        fontStylePopUpButton.type = .arrowDown
+        fontSizeComboBox.type = .none
+        fontSizeComboBox.comboxRect = fontSizeComboBox.bounds
+        fontPopUpButton.type = .arrowUpDown
+        
+        fontPopUpButton.wantsLayer = true
+        fontStylePopUpButton.wantsLayer = true
+        fontSizeComboBox.wantsLayer = true
+        
+        fontPopUpButton.layer!.borderWidth = 1.0
+        fontStylePopUpButton.layer!.borderWidth = 1.0
+        fontSizeComboBox.layer!.borderWidth = 1.0
+        
+        fontPopUpButton.layer!.cornerRadius = 1.0
+        fontStylePopUpButton.layer!.cornerRadius = 1.0
+        fontSizeComboBox.layer!.cornerRadius = 1.0
+        
+        updateViewColor()
+        
+        reloadData()
+    }
+
+    override func viewDidAppear() {
+        super.viewDidAppear()
+        
+        let showConvertDetails = KMPropertiesViewPopController.showChangeColorDetails()
+        if showConvertDetails, let document = self.view.window?.windowController?.document as? NSDocument,
+            document.fileURL != nil {
+            KMPropertiesViewPopController.defaultManager().showChangeColorDetailsView(colorPickerView.firstButton)
+        }
+        
+        NotificationCenter.default.addObserver(self, selector: #selector(themeChanged(_:)),
+                                               name: Notification.Name("AppleInterfaceThemeChangedNotification"), object: nil)
+    }
+    
+    // MARK: Private Method
+    
+    func reloadData() {
+        var opacity: CGFloat = 1
+        if let color = annotation!.backgroundColor {
+            color.usingColorSpaceName(NSColorSpaceName.calibratedRGB)?.getRed(nil, green: nil, blue: nil, alpha: &opacity)
+        }
+
+        if let fontColor = annotation?.fontColor,
+           annotation != nil /*|| annotation?.type == .widgetPushButtonControl*/ {
+            fillColorPickerView.color = annotation?.backgroundColor
+            colorPickerView.color = fontColor
+        }
+
+        fontSizeComboBox.stringValue = "\(annotation?.font.pointSize) pt"
+
+        DispatchQueue.global(qos: .default).async { [self] in
+            let fonts = NSFontManager.shared.availableFontFamilies
+            var selectedIndex = 0
+            let family = annotation?.font.fontDescriptor.object(forKey: NSFontDescriptor.AttributeName.family) as? String ?? ""
+            let style = annotation?.font.fontDescriptor.object(forKey: NSFontDescriptor.AttributeName.face) as? String ?? ""
+
+            let menu = NSMenu()
+            
+            for (index, fontName) in fonts.enumerated() {
+                if let font = NSFont(name: fontName, size: 12.0) {
+                    let attributes = [NSAttributedString.Key.font: font]
+                    let attributedString = NSAttributedString(string: fontName, attributes: attributes)
+                    let item = NSMenuItem()
+                    item.attributedTitle = attributedString
+                    menu.addItem(item)
+                    if annotation?.font.fontName == font.fontName {
+                        selectedIndex = index
+                    }
+                }
+            }
+
+            DispatchQueue.main.async { [self] in
+                fontPopUpButton.menu = menu
+                fontPopUpButton.selectItem(at: selectedIndex)
+                let selectedStyleIndex = setFontStyleWithFontName(family, currentStyle: style)
+                fontStylePopUpButton.selectItem(at: Int(selectedStyleIndex))
+            }
+        }
+
+        annotationFont = annotation?.font
+
+        let fontManager = NSFontManager.shared
+        fontManager.target = self
+        fontManager.action = #selector(changeFont(_:))
+    }
+    
+    func updateAnnotationMode() {
+        let userDefaults = UserDefaults.standard
+        let note = annotation!
+        let annotationMode = self.formMode
+        
+        switch annotationMode {
+        case .actionButton:
+            userDefaults.setColor(note.backgroundColor, forKey: SKAnnotationActionButtonWidgetBackgroundColorKey)
+            userDefaults.setColor(note.fontColor, forKey: SKAnnotationActionButtonWidgetFontColorKey)
+            userDefaults.set(note.font.fontName, forKey: SKAnnotationActionButtonWidgetFontNameKey)
+            userDefaults.set(note.font.pointSize, forKey: SKAnnotationActionButtonWidgetFontSizeKey)
+        case .comboBox:
+            userDefaults.setColor(note.backgroundColor, forKey: SKAnnotationChoiceWidgetBackgroundColorKey)
+            userDefaults.setColor(note.fontColor, forKey: SKAnnotationChoiceWidgetFontColorKey)
+            userDefaults.set(note.font.fontName, forKey: SKAnnotationChoiceWidgetFontNameKey)
+            userDefaults.set(note.font.pointSize, forKey: SKAnnotationChoiceWidgetFontSizeKey)
+        case .listMenu:
+            userDefaults.setColor(note.backgroundColor, forKey: SKAnnotationChoiceListWidgetBackgroundColorKey)
+            userDefaults.setColor(note.fontColor, forKey: SKAnnotationChoiceListWidgetFontColorKey)
+            userDefaults.set(note.font.fontName, forKey: SKAnnotationChoiceListWidgetFontNameKey)
+            userDefaults.set(note.font.pointSize, forKey: SKAnnotationChoiceListWidgetFontSizeKey)
+        default:
+            break
+        }
+    }
+    
+    func colorWithCGColor(_ cgColor: CGColor?) -> NSColor? {
+        guard let cgColor = cgColor else { return nil }
+        return NSColor(cgColor: cgColor)
+    }
+
+    func updateViewColor() {
+        if KMAppearance.isDarkMode() {
+            let darkBorderColor = NSColor(red: 86/255.0, green: 88/255.0, blue: 90/255.0, alpha: 1.0).cgColor
+            let darkBackgroundColor = NSColor(red: 57/255.0, green: 60/255.0, blue: 62/255.0, alpha: 1.0).cgColor
+
+            fontPopUpButton.layer?.borderColor = darkBorderColor
+            fontStylePopUpButton.layer?.borderColor = darkBorderColor
+            fontSizeComboBox.layer?.borderColor = darkBorderColor
+
+            fontPopUpButton.layer?.backgroundColor = darkBackgroundColor
+            fontStylePopUpButton.layer?.backgroundColor = darkBackgroundColor
+            fontSizeComboBox.layer?.backgroundColor = darkBackgroundColor
+        } else {
+            let lightBorderColor = NSColor(red: 218/255.0, green: 219/255.0, blue: 222/255.0, alpha: 1.0).cgColor
+            let lightBackgroundColor = NSColor.white.cgColor
+
+            fontPopUpButton.layer?.borderColor = lightBorderColor
+            fontStylePopUpButton.layer?.borderColor = lightBorderColor
+            fontSizeComboBox.layer?.borderColor = lightBorderColor
+
+            fontPopUpButton.layer?.backgroundColor = lightBackgroundColor
+            fontStylePopUpButton.layer?.backgroundColor = lightBackgroundColor
+            fontSizeComboBox.layer?.backgroundColor = lightBackgroundColor
+        }
+    }
+
+    func changeStoredFontInfo(_ sender: Any) {
+        for tAnnotation in annotations {
+//            tAnnotation.removeAllAppearanceStreams()
+//            if let font = (sender as AnyObject).convertFont(tAnnotation.font) {
+//                tAnnotation.font = font
+//            }
+        }
+    }
+
+    func setFontStyleWithFontName(_ fontName: String, currentStyle style: String?) -> UInt {
+        var selectIndex: UInt = 0
+        let menu = NSMenu()
+        if let fontFamily = NSFontManager.shared.availableMembers(ofFontFamily: fontName) {
+            for (index, array) in fontFamily.enumerated() {
+                let styleName = array[1] as? String ?? ""
+                if style == styleName {
+                    selectIndex = UInt(index)
+                }
+                let attributeFontDescriptor = NSFontDescriptor(fontAttributes: [NSFontDescriptor.AttributeName.family: fontName, NSFontDescriptor.AttributeName.face: styleName])
+                let font = NSFont(descriptor: attributeFontDescriptor, size: 12.0)
+                let attrited = [NSAttributedString.Key.font: font]
+                let string = NSAttributedString(string: styleName, attributes: attrited)
+                let item = NSMenuItem()
+                item.attributedTitle = string
+                menu.addItem(item)
+            }
+        }
+        if style == nil {
+            selectIndex = 0
+        }
+        fontStylePopUpButton.menu = menu
+        return selectIndex
+    }
+    
+    private func updateAnnotation() {
+        if annotationModel?.annotation != nil {
+            for tAnnotation in annotations {
+                pdfView?.setNeedsDisplayAnnotationViewFor(tAnnotation.page)
+            }
+        }
+    }
+    
+    // MARK: Set & Get
+    
+    var formMode: CAnnotationType {
+        get {
+            return _formMode
+        }
+        set {
+            _formMode = newValue
+            isFromMode = true
+
+            let sud = UserDefaults.standard
+            var note: CPDFChoiceWidgetAnnotation?
+            var bounds = NSRect(x: 0, y: 0, width: 60, height: 25)
+            var backgroundColor: NSColor?
+            var fontColor: NSColor?
+
+            if formMode == .listMenu {
+                bounds = NSRect(x: 0, y: 0, width: 100, height: 80)
+                note = CPDFChoiceWidgetAnnotation(PDFListViewNoteWith: pdfView!.document, listChoice: true)
+
+                backgroundColor = sud.color(forKey: SKAnnotationChoiceListWidgetBackgroundColorKey)
+                note?.backgroundColor = backgroundColor ?? NSColor.clear
+
+                fontColor = sud.color(forKey: SKAnnotationChoiceListWidgetFontColorKey)
+                note?.fontColor = fontColor
+
+                if let font = sud.font(forNameKey: SKAnnotationChoiceListWidgetFontNameKey,
+                                       sizeKey: SKAnnotationChoiceListWidgetFontSizeKey) {
+                    note?.font = font
+                }
+            } else if formMode == .comboBox {
+                bounds = NSRect(x: 0, y: 0, width: 100, height: 25)
+                note = CPDFChoiceWidgetAnnotation(PDFListViewNoteWith: pdfView!.document, listChoice: false)
+
+                backgroundColor = sud.color(forKey: SKAnnotationChoiceWidgetBackgroundColorKey)
+                note?.backgroundColor = backgroundColor ?? NSColor.clear
+
+                fontColor = sud.color(forKey: SKAnnotationChoiceWidgetFontColorKey)
+                note?.fontColor = fontColor
+
+                if let font = sud.font(forNameKey: SKAnnotationChoiceWidgetFontNameKey,
+                                       sizeKey: SKAnnotationChoiceWidgetFontSizeKey) {
+                    note?.font = font
+                }
+            } else if formMode == .actionButton {
+                bounds = NSRect(x: 0, y: 0, width: 100, height: 80)
+//                note = KMPDFAnnotationChoiceWidgetSub(bounds: bounds)
+
+                backgroundColor = sud.color(forKey: SKAnnotationActionButtonWidgetBackgroundColorKey)
+                note?.backgroundColor = backgroundColor ?? NSColor.clear
+
+                fontColor = sud.color(forKey: SKAnnotationActionButtonWidgetFontColorKey)
+                note?.fontColor = fontColor
+
+                if let font = sud.font(forNameKey: SKAnnotationActionButtonWidgetFontNameKey,
+                                       sizeKey: SKAnnotationActionButtonWidgetFontSizeKey) {
+                    note?.font = font
+                }
+            } else {
+                note = CPDFChoiceWidgetAnnotation(document: pdfView?.document)
+            }
+
+            if let note1 = note {
+                self.annotations = [note1]
+                self.annotation = note1
+            }
+        }
+    }
+
+    var annotations: [CPDFChoiceWidgetAnnotation] {
+        get {
+            return _annotations
+        }
+        set {
+            _annotations = newValue
+            annotation = _annotations.first
+        }
+    }
+    
+    // MARK: Button Action
+    
+    @IBAction func colorPickerViewAction(_ sender: Any) {
+        for tAnnotation in annotations {
+//            tAnnotation.removeAllAppearanceStreams()
+            tAnnotation.fontColor = colorPickerView.color
+        }
+        updateAnnotation()
+    }
+
+    @IBAction func fillColorPickerViewAction(_ sender: Any) {
+        for tAnnotation in annotations {
+//            tAnnotation.removeAllAppearanceStreams()
+            tAnnotation.backgroundColor = fillColorPickerView.color
+        }
+        updateAnnotation()
+    }
+    
+    @IBAction func buttonClickedChangeFont(_ sender: Any) {
+//        guard let weakSelf = self else { return }
+
+//        let fontWindowController = KMAnnotationFontWindowController.sharedAnnotationFont()
+//        guard let window = fontWindowController.window else { return }
+//
+//        fontWindowController.annotations = weakSelf.annotations
+//
+//        fontWindowController.annotationAlignCallback = { selectedCount in
+//            for tAnnotation in weakSelf.annotations {
+//                tAnnotation.removeAllAppearanceStreams()
+//
+//                switch selectedCount {
+//                case 0:
+//                    tAnnotation.alignment = .left
+//                case 2:
+//                    tAnnotation.alignment = .center
+//                case 1:
+//                    tAnnotation.alignment = .right
+//                case 3:
+//                    tAnnotation.alignment = .justified
+//                default:
+//                    break
+//                }
+//            }
+//            weakSelf.pdfview.setNeedsDisplay(true)
+//        }
+//
+//        fontWindowController.annotationCallback = { annotation in
+//            // Handle annotation callback if needed
+//        }
+//
+//        window.orderFront(sender)
+    }
+
+    @IBAction func fontColorButtonAction(_ sender: NSButton) {
+        NSColorPanel.shared.setTarget(self)
+        NSColorPanel.shared.setAction(#selector(colorPanelAction(_:)))
+        NSColorPanel.shared.orderFront(nil)
+    }
+
+    @objc func colorPanelAction(_ sender: Any) {
+        let color = NSColorPanel.shared.color
+        for tAnnotation in annotations {
+//                tAnnotation.removeAllAppearanceStreams()
+            tAnnotation.fontColor = color
+        }
+        updateAnnotation()
+    }
+
+    @IBAction func currentFontColorButtonAction(_ sender: NSButton) {
+        if let cgColor = sender.layer?.backgroundColor,
+           let color = colorWithCGColor(cgColor) {
+            for tAnnotation in annotations {
+//                tAnnotation.removeAllAppearanceStreams()
+                tAnnotation.fontColor = color
+            }
+            updateAnnotation()
+        }
+    }
+
+    @IBAction func fontPopUpButtonAction(_ sender: NSPopUpButton) {
+        if let selectedItem = fontPopUpButton.selectedItem {
+            let familyString = selectedItem.attributedTitle?.string ?? ""
+            let selectIndex = setFontStyleWithFontName(familyString, currentStyle: nil)
+            if let styleString = fontStylePopUpButton.selectedItem?.title {
+                fontStylePopUpButton.selectItem(at: Int(selectIndex))
+                
+                for tAnnotation in annotations {
+//                    tAnnotation.removeAllAppearanceStreams()
+                    if let font = annotation!.font {
+                        if let fontSize = font.fontDescriptor.object(forKey: NSFontDescriptor.AttributeName.size) as? NSNumber {
+                            let attributeFontDescriptor = NSFontDescriptor(fontAttributes: [NSFontDescriptor.AttributeName.family: familyString, NSFontDescriptor.AttributeName.face: styleString])
+                            let newFont = NSFont(descriptor: attributeFontDescriptor, size: CGFloat(fontSize.floatValue))
+                            
+                            if let newFont = newFont {
+                                tAnnotation.font = newFont
+                            }
+                        }
+                    }
+                }
+                updateAnnotation()
+            }
+        }
+    }
+    
+    @IBAction func fontSizeComboBoxAction(_ sender: NSComboBox) {
+        for tAnnotation in annotations {
+//            tAnnotation.removeAllAppearanceStreams()
+            if let font = tAnnotation.font {
+                if let newFont = NSFont(name: font.fontName, size: CGFloat(fontSizeComboBox.floatValue)) {
+                    tAnnotation.font = newFont
+                }
+            }
+        }
+        updateAnnotation()
+    }
+
+    @IBAction func fontStylePopUpButtonAction(_ sender: NSPopUpButton) {
+        guard let styleString = fontStylePopUpButton.selectedItem?.title else {
+            return
+        }
+        
+        for tAnnotation in annotations {
+            if let font = tAnnotation.font {
+                if let fontSize = font.fontDescriptor.object(forKey: NSFontDescriptor.AttributeName.size) as? String,
+                   let familyString = font.fontDescriptor.object(forKey: NSFontDescriptor.AttributeName.family) as? String {
+                    
+                    let floatValue = Float(fontSize)
+                    let cgFloatValue = CGFloat(floatValue!)
+
+                    let attributeFontDescriptor = NSFontDescriptor(fontAttributes: [NSFontDescriptor.AttributeName.family: familyString, NSFontDescriptor.AttributeName.face: styleString])
+                    let newFont = NSFont(descriptor: attributeFontDescriptor, size: cgFloatValue)
+                    if newFont != nil {
+                        tAnnotation.font = newFont
+                    }
+                }
+            }
+        }
+        updateAnnotation()
+    }
+    
+    // MARK: NSNotification Action
+    
+    @objc func formButtonLabelTextField() {
+        reloadData()
+    }
+
+    @objc func changeFont(_ sender: Any) {
+//        annotationFont = sender.convertFont(annotationFont)
+        
+        for tAnnotation in annotations {
+//                tAnnotation.removeAllAppearanceStreams()
+//            tAnnotation.setFont(annotationFont)
+        }
+        updateAnnotation()
+    }
+
+    @objc func themeChanged(_ notification: Notification) {
+        DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) { [weak self] in
+            self?.updateViewColor()
+        }
+    }
+}

+ 237 - 0
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/ViewController/FormProperties/KMAnnotationChoiceWidgetAppearanceViewController.xib

@@ -0,0 +1,237 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="18122" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="18122"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner" customClass="KMAnnotationChoiceWidgetAppearanceViewController">
+            <connections>
+                <outlet property="colorPickerView" destination="fb8-83-Upj" id="SRL-RL-w8c"/>
+                <outlet property="fillColorLabel" destination="IId-XT-GX4" id="9EZ-wi-XAX"/>
+                <outlet property="fillColorPickerView" destination="F5z-22-r2f" id="yHQ-CA-vCB"/>
+                <outlet property="fontButton" destination="0qZ-0s-ONw" id="HT1-NO-KaQ"/>
+                <outlet property="fontLabel" destination="1dR-tg-XTu" id="hYu-Ce-ING"/>
+                <outlet property="fontPopUpButton" destination="Dds-CG-9jA" id="7VU-wp-XBn"/>
+                <outlet property="fontSizeComboBox" destination="8Ve-E4-2UE" id="l1Q-Tf-pxQ"/>
+                <outlet property="fontStylePopUpButton" destination="2u3-Kk-MNa" id="eh8-aU-RG9"/>
+                <outlet property="fontViewBottom" destination="TdR-gp-EI8" id="6y1-Y1-ov8"/>
+                <outlet property="view" destination="fWT-Ms-Gfw" id="qDc-if-QUO"/>
+            </connections>
+        </customObject>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <scrollView borderType="none" autohidesScrollers="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" id="fWT-Ms-Gfw">
+            <rect key="frame" x="0.0" y="0.0" width="475" height="512"/>
+            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+            <clipView key="contentView" drawsBackground="NO" copiesOnScroll="NO" id="oGt-vH-jZz" customClass="KMClipView">
+                <rect key="frame" x="0.0" y="0.0" width="475" height="512"/>
+                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                <subviews>
+                    <view translatesAutoresizingMaskIntoConstraints="NO" id="hDQ-zI-HH9">
+                        <rect key="frame" x="0.0" y="265" width="475" height="247"/>
+                        <subviews>
+                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="sUG-di-Kdv">
+                                <rect key="frame" x="16" y="165" width="443" height="72"/>
+                                <subviews>
+                                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="IId-XT-GX4">
+                                        <rect key="frame" x="-2" y="42" width="42" height="20"/>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="20" id="2HK-FU-Gre"/>
+                                        </constraints>
+                                        <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Color" id="52J-2P-Yep">
+                                            <font key="font" metaFont="systemBold" size="14"/>
+                                            <color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
+                                            <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                                        </textFieldCell>
+                                    </textField>
+                                    <customView placeholderIntrinsicWidth="240" placeholderIntrinsicHeight="26" translatesAutoresizingMaskIntoConstraints="NO" id="F5z-22-r2f" customClass="KMColorPickerView">
+                                        <rect key="frame" x="0.0" y="0.0" width="443" height="32"/>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="32" id="uyy-tS-u3h"/>
+                                        </constraints>
+                                        <connections>
+                                            <action selector="fillColorPickerViewAction:" target="-2" id="Yj8-eC-gjW"/>
+                                        </connections>
+                                    </customView>
+                                </subviews>
+                                <constraints>
+                                    <constraint firstItem="IId-XT-GX4" firstAttribute="leading" secondItem="sUG-di-Kdv" secondAttribute="leading" id="7Sc-uq-NCQ"/>
+                                    <constraint firstAttribute="bottom" secondItem="F5z-22-r2f" secondAttribute="bottom" id="Vac-Kh-VwC"/>
+                                    <constraint firstItem="IId-XT-GX4" firstAttribute="top" secondItem="sUG-di-Kdv" secondAttribute="top" constant="10" id="VfL-LY-uQC"/>
+                                    <constraint firstItem="F5z-22-r2f" firstAttribute="top" secondItem="IId-XT-GX4" secondAttribute="bottom" constant="10" id="koz-ic-bTT"/>
+                                    <constraint firstItem="F5z-22-r2f" firstAttribute="leading" secondItem="sUG-di-Kdv" secondAttribute="leading" id="rB4-HU-xS7"/>
+                                    <constraint firstAttribute="trailing" secondItem="F5z-22-r2f" secondAttribute="trailing" id="v6c-CZ-6Jz"/>
+                                </constraints>
+                            </customView>
+                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="QuF-Kd-WRq">
+                                <rect key="frame" x="16" y="10" width="443" height="145"/>
+                                <subviews>
+                                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="1dR-tg-XTu">
+                                        <rect key="frame" x="-2" y="118" width="36" height="17"/>
+                                        <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Font" id="aLz-5f-LzI">
+                                            <font key="font" metaFont="systemBold" size="14"/>
+                                            <color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
+                                            <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                                        </textFieldCell>
+                                    </textField>
+                                    <button translatesAutoresizingMaskIntoConstraints="NO" id="0qZ-0s-ONw">
+                                        <rect key="frame" x="417" y="119" width="16" height="16"/>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="16" id="RQ2-Np-u1f"/>
+                                            <constraint firstAttribute="width" constant="16" id="ebk-LL-wBK"/>
+                                        </constraints>
+                                        <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="KMImageNameUXIconBtnFontsetNor" imagePosition="only" alignment="center" imageScaling="proportionallyUpOrDown" inset="2" id="DMe-4N-iGI">
+                                            <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                            <font key="font" metaFont="system"/>
+                                        </buttonCell>
+                                        <connections>
+                                            <action selector="buttonClicked_ChangeFont:" target="-2" id="ccS-m1-x8A"/>
+                                        </connections>
+                                    </button>
+                                    <popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="2u3-Kk-MNa" customClass="KMPopUpButton">
+                                        <rect key="frame" x="-2" y="3" width="349" height="36"/>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="24" id="A08-h9-JXQ"/>
+                                        </constraints>
+                                        <popUpButtonCell key="cell" type="push" title="UltraLight" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="border" inset="2" arrowPosition="noArrow" selectedItem="b8w-9P-1Ld" id="MeQ-zr-ReI" customClass="KMPopUpButtonCell">
+                                            <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                            <font key="font" metaFont="menu"/>
+                                            <menu key="menu" id="6eM-Of-hda">
+                                                <items>
+                                                    <menuItem title="UltraLight" state="on" id="b8w-9P-1Ld"/>
+                                                    <menuItem title="Thin" id="yDt-lm-uEq"/>
+                                                    <menuItem title="Light" id="yLi-12-iS3"/>
+                                                    <menuItem title="Regular" id="cXt-wI-p25"/>
+                                                    <menuItem title="Medium" id="KOD-mo-89K"/>
+                                                    <menuItem title="Semibold" id="Sq5-xS-RsL"/>
+                                                    <menuItem title="Bold" id="wLQ-Cx-0Yx"/>
+                                                    <menuItem title="Heavy" id="Ry6-wE-uNq"/>
+                                                    <menuItem title="Black" id="lzE-Ia-NkE"/>
+                                                </items>
+                                            </menu>
+                                        </popUpButtonCell>
+                                        <connections>
+                                            <action selector="fontStylePopUpButtonAction:" target="-2" id="Vgt-PU-i4T"/>
+                                        </connections>
+                                    </popUpButton>
+                                    <comboBox verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="8Ve-E4-2UE" customClass="KMComboBox">
+                                        <rect key="frame" x="348" y="10" width="95" height="23"/>
+                                        <constraints>
+                                            <constraint firstAttribute="width" constant="92" id="yqp-xQ-AJY"/>
+                                        </constraints>
+                                        <comboBoxCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" alignment="center" completes="NO" numberOfVisibleItems="5" id="Pzf-xX-zIz" customClass="KMComboBoxCell">
+                                            <font key="font" metaFont="system"/>
+                                            <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                                            <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                            <objectValues>
+                                                <string>4 pt</string>
+                                                <string>6 pt</string>
+                                                <string>8 pt</string>
+                                                <string>9 pt</string>
+                                                <string>10 pt</string>
+                                                <string>11 pt</string>
+                                                <string>12 pt</string>
+                                                <string>13 pt</string>
+                                                <string>14 pt</string>
+                                                <string>15 pt</string>
+                                                <string>16 pt</string>
+                                                <string>17 pt</string>
+                                                <string>18 pt</string>
+                                                <string>24 pt</string>
+                                                <string>36 pt</string>
+                                                <string>48 pt</string>
+                                                <string>64 pt</string>
+                                                <string>72 pt</string>
+                                                <string>98 pt</string>
+                                                <string>144 pt</string>
+                                                <string>288 pt</string>
+                                            </objectValues>
+                                        </comboBoxCell>
+                                        <connections>
+                                            <action selector="fontSizeComboBoxAction:" target="-2" id="fJc-QM-eBL"/>
+                                        </connections>
+                                    </comboBox>
+                                    <popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Dds-CG-9jA" customClass="KMPopUpButton">
+                                        <rect key="frame" x="-2" y="35" width="452" height="36"/>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="24" id="BKI-cy-EMV"/>
+                                        </constraints>
+                                        <popUpButtonCell key="cell" type="push" title="Item 1" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" arrowPosition="noArrow" selectedItem="Lif-0J-Dbd" id="qTm-jx-qUv" customClass="KMPopUpButtonCell">
+                                            <behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
+                                            <font key="font" metaFont="menu"/>
+                                            <menu key="menu" id="u73-CF-6q8">
+                                                <items>
+                                                    <menuItem title="Item 1" state="on" id="Lif-0J-Dbd"/>
+                                                    <menuItem title="Item 2" id="5Fb-ce-SCc"/>
+                                                    <menuItem title="Item 3" id="Dz1-Ef-UYw"/>
+                                                </items>
+                                            </menu>
+                                        </popUpButtonCell>
+                                        <connections>
+                                            <action selector="fontPopUpButtonAction:" target="-2" id="Rlu-Q8-tCK"/>
+                                        </connections>
+                                    </popUpButton>
+                                    <customView placeholderIntrinsicWidth="240" placeholderIntrinsicHeight="26" translatesAutoresizingMaskIntoConstraints="NO" id="fb8-83-Upj" customClass="KMColorPickerView">
+                                        <rect key="frame" x="0.0" y="76" width="443" height="32"/>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="32" id="7uL-Qc-jV3"/>
+                                        </constraints>
+                                        <connections>
+                                            <action selector="colorPickerViewAction:" target="-2" id="p9x-bh-BSb"/>
+                                        </connections>
+                                    </customView>
+                                </subviews>
+                                <constraints>
+                                    <constraint firstItem="0qZ-0s-ONw" firstAttribute="centerY" secondItem="1dR-tg-XTu" secondAttribute="centerY" id="5Ka-ej-yFq"/>
+                                    <constraint firstAttribute="trailing" secondItem="8Ve-E4-2UE" secondAttribute="trailing" constant="3" id="6xe-X0-PK6"/>
+                                    <constraint firstItem="fb8-83-Upj" firstAttribute="leading" secondItem="QuF-Kd-WRq" secondAttribute="leading" id="6ys-v3-pbk"/>
+                                    <constraint firstItem="2u3-Kk-MNa" firstAttribute="leading" secondItem="QuF-Kd-WRq" secondAttribute="leading" constant="5" id="9s6-xg-Vlh"/>
+                                    <constraint firstItem="1dR-tg-XTu" firstAttribute="top" secondItem="QuF-Kd-WRq" secondAttribute="top" constant="10" id="COj-pC-29G"/>
+                                    <constraint firstAttribute="trailing" secondItem="Dds-CG-9jA" secondAttribute="trailing" id="CUi-3K-j4X"/>
+                                    <constraint firstItem="8Ve-E4-2UE" firstAttribute="leading" secondItem="2u3-Kk-MNa" secondAttribute="trailing" constant="8" id="DBP-9U-v39"/>
+                                    <constraint firstItem="2u3-Kk-MNa" firstAttribute="top" secondItem="Dds-CG-9jA" secondAttribute="bottom" constant="8" id="FiD-ZZ-SrT"/>
+                                    <constraint firstItem="fb8-83-Upj" firstAttribute="top" secondItem="1dR-tg-XTu" secondAttribute="bottom" constant="10" id="Tba-tO-wnb"/>
+                                    <constraint firstItem="1dR-tg-XTu" firstAttribute="leading" secondItem="QuF-Kd-WRq" secondAttribute="leading" id="c6f-x3-Kk4"/>
+                                    <constraint firstItem="Dds-CG-9jA" firstAttribute="leading" secondItem="QuF-Kd-WRq" secondAttribute="leading" constant="5" id="cX7-uV-MMh"/>
+                                    <constraint firstItem="8Ve-E4-2UE" firstAttribute="centerY" secondItem="2u3-Kk-MNa" secondAttribute="centerY" id="iwq-am-rdp"/>
+                                    <constraint firstAttribute="bottom" secondItem="2u3-Kk-MNa" secondAttribute="bottom" constant="10" id="lTE-zD-gjx"/>
+                                    <constraint firstAttribute="trailing" secondItem="0qZ-0s-ONw" secondAttribute="trailing" constant="10" id="mZ3-t3-vnc"/>
+                                    <constraint firstAttribute="trailing" secondItem="fb8-83-Upj" secondAttribute="trailing" id="uPT-kR-Aep"/>
+                                    <constraint firstItem="Dds-CG-9jA" firstAttribute="top" secondItem="fb8-83-Upj" secondAttribute="bottom" constant="10" id="udP-n9-Bfd"/>
+                                </constraints>
+                            </customView>
+                        </subviews>
+                        <constraints>
+                            <constraint firstItem="sUG-di-Kdv" firstAttribute="top" secondItem="hDQ-zI-HH9" secondAttribute="top" constant="10" id="2iN-eA-TuC"/>
+                            <constraint firstItem="QuF-Kd-WRq" firstAttribute="leading" secondItem="sUG-di-Kdv" secondAttribute="leading" id="TFJ-MW-cnn"/>
+                            <constraint firstAttribute="bottom" secondItem="QuF-Kd-WRq" secondAttribute="bottom" constant="10" id="TdR-gp-EI8"/>
+                            <constraint firstItem="QuF-Kd-WRq" firstAttribute="top" secondItem="sUG-di-Kdv" secondAttribute="bottom" constant="10" id="V4o-8d-V7y"/>
+                            <constraint firstItem="sUG-di-Kdv" firstAttribute="leading" secondItem="hDQ-zI-HH9" secondAttribute="leading" constant="16" id="WcG-h4-R4g"/>
+                            <constraint firstItem="QuF-Kd-WRq" firstAttribute="trailing" secondItem="sUG-di-Kdv" secondAttribute="trailing" id="e5w-se-dga"/>
+                            <constraint firstAttribute="trailing" secondItem="sUG-di-Kdv" secondAttribute="trailing" constant="16" id="ic3-hn-7bc"/>
+                        </constraints>
+                    </view>
+                </subviews>
+                <constraints>
+                    <constraint firstAttribute="trailing" secondItem="hDQ-zI-HH9" secondAttribute="trailing" id="77z-CO-Rbe"/>
+                    <constraint firstItem="hDQ-zI-HH9" firstAttribute="leading" secondItem="oGt-vH-jZz" secondAttribute="leading" id="FgR-wu-xha"/>
+                    <constraint firstItem="hDQ-zI-HH9" firstAttribute="top" secondItem="oGt-vH-jZz" secondAttribute="top" id="uck-mB-4FT"/>
+                </constraints>
+            </clipView>
+            <scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="F7F-k2-qHB">
+                <rect key="frame" x="-100" y="-100" width="303" height="15"/>
+                <autoresizingMask key="autoresizingMask"/>
+            </scroller>
+            <scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="b8z-Iw-PVb">
+                <rect key="frame" x="459" y="0.0" width="16" height="512"/>
+                <autoresizingMask key="autoresizingMask"/>
+            </scroller>
+            <point key="canvasLocation" x="-112.5" y="172"/>
+        </scrollView>
+    </objects>
+    <resources>
+        <image name="KMImageNameUXIconBtnFontsetNor" width="17" height="16"/>
+    </resources>
+</document>

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

@@ -431,9 +431,19 @@ extension KMMainViewController {
     
     @IBAction func toggleAutoFlow(_ sender: Any?) {
         KMPrint("toggleAutoFlow")
+        if (self.listView.isAutoFlow()) {
+            self.listView.stopAutoFlow()
+        } else {
+            self.listView.startAutoFlow()
+        }
     }
     @IBAction func chooseAutoFlowSetting(_ sender: Any?) {
         KMPrint("chooseAutoFlowSetting")
+        autoFlowOptionsSheetController = KMAutoFlowOptionsSheetController(windowNibName: "KMAutoFlowOptionsSheetController")
+        
+        NSWindow.currentWindow().beginSheet((autoFlowOptionsSheetController?.window)!) { responce in
+            
+        }
     }
     
     @IBAction func toggleReadingBar(_ sender: Any?) {

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

@@ -53,6 +53,9 @@ import Cocoa
     @IBOutlet weak var pageNumberDisplayView: KMPageNumberDisplayView!
     @IBOutlet weak var tipCurrentPageBoxWidthConstraint: NSLayoutConstraint!
     
+    //自动滚动
+    var autoFlowOptionsSheetController: KMAutoFlowOptionsSheetController?
+    
     private var _needSave = false
     var needSave: Bool {
         set {

+ 91 - 45
PDF Office/PDF Master/Class/Preference/Controller/KMNotesPreferences.swift

@@ -78,48 +78,6 @@ class KMNotesPreferences: NSViewController {
         super.loadView()
         
         self._initLayoutUI()
-        
-//        NSUserDefaultsController *sudc = [NSUserDefaultsController sharedUserDefaultsController];
-        
-//        SKLineWell *lineWell = [lineWells1 objectAtIndex:0];
-//        [lineWell bind:SKLineWellLineWidthKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.freeTextNoteLineWidthKey) options:nil];
-//        [lineWell bind:SKLineWellStyleKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.freeTextNoteLineStyleKey) options:nil];
-//        [lineWell bind:SKLineWellDashPatternKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.freeTextNoteDashPatternKey) options:nil];
-//        [lineWell setDisplayStyle:SKLineWellDisplayStyleRectangle];
-        self.textLineWell.lineWidth = 0
-//
-//        [lineWell bind:SKLineWellLineWidthKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.circleNoteLineWidthKey) options:nil];
-//        [lineWell bind:SKLineWellStyleKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.circleNoteLineStyleKey) options:nil];
-//        [lineWell bind:SKLineWellDashPatternKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.circleNoteDashPatternKey) options:nil];
-        self.circleLineWell.displayStyle = .oval
-        self.circleLineWell.lineWidth = 2
-//
-//        lineWell = [lineWells2 objectAtIndex:1];
-//        [lineWell bind:SKLineWellLineWidthKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.squareNoteLineWidthKey) options:nil];
-//        [lineWell bind:SKLineWellStyleKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.squareNoteLineStyleKey) options:nil];
-//        [lineWell bind:SKLineWellDashPatternKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.squareNoteDashPatternKey) options:nil];
-//        [lineWell setDisplayStyle:SKLineWellDisplayStyleRectangle];
-        self.rectLineWell.displayStyle = .rectangle
-        self.rectLineWell.lineWidth = 2
-//
-//        lineWell = [lineWells1 objectAtIndex:1];
-//        [lineWell bind:SKLineWellLineWidthKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.lineNoteLineWidthKey) options:nil];
-//        [lineWell bind:SKLineWellStyleKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.lineNoteLineStyleKey) options:nil];
-//        [lineWell bind:SKLineWellDashPatternKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.lineNoteDashPatternKey) options:nil];
-//        [lineWell bind:SKLineWellStartLineStyleKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.lineNoteStartLineStyleKey) options:nil];
-//        [lineWell bind:SKLineWellEndLineStyleKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.lineNoteEndLineStyleKey) options:nil];
-        self.lineLineWell.displayStyle = .line
-        self.lineLineWell.lineWidth = 2
-        self.lineLineWell.endLineStyle = .openArrow
-//
-//        lineWell = [lineWells1 objectAtIndex:2];
-//        [lineWell bind:SKLineWellLineWidthKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.inkNoteLineWidthKey) options:nil];
-//        [lineWell bind:SKLineWellStyleKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.inkNoteLineStyleKey) options:nil];
-//        [lineWell bind:SKLineWellDashPatternKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.inkNoteDashPatternKey) options:nil];
-//        [lineWell setDisplayStyle:SKLineWellDisplayStyleSimpleLine];
-        self.freehandLineWell.displayStyle = .simpleLine
-        self.freehandLineWell.lineWidth = 2
-        
 //    let fontWell = self.fontWell1
 //        NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:NSUnarchiveFromDataTransformerName, NSValueTransformerNameBindingOption, nil];
 //        [fontWell setHasTextColor:YES];
@@ -288,6 +246,28 @@ class KMNotesPreferences: NSViewController {
             self.alignmentSegmentControl.selectedSegment = 2
         }
         
+        self.textLineWell.displayStyle = .rectangle
+        self.textLineWell.lineWidth = KMPreference.shared.freeTextNoteLineWidth.cgFloat
+        self.textLineWell.style = CPDFBorderStyle(rawValue: KMPreference.shared.freeTextNoteLineStyle) ?? .solid
+        self.textLineWell.dashPattern = KMPreference.shared.freeTextNoteDashPattern as NSArray
+        self.lineLineWell.displayStyle = .line
+        self.lineLineWell.lineWidth = KMPreference.shared.lineNoteLineWidth.cgFloat
+        self.lineLineWell.style = CPDFBorderStyle(rawValue: KMPreference.shared.lineNoteLineStyle) ?? .solid
+        self.lineLineWell.dashPattern = KMPreference.shared.lineNoteDashPattern as NSArray
+        self.lineLineWell.startLineStyle = CPDFLineStyle(rawValue: KMPreference.shared.lineNoteStartLineStyle) ?? .none
+        self.lineLineWell.endLineStyle = CPDFLineStyle(rawValue: KMPreference.shared.lineNoteEndLineStyle) ?? .none
+        self.freehandLineWell.displayStyle = .simpleLine
+        self.freehandLineWell.lineWidth = KMPreference.shared.inkNoteLineWidth.cgFloat
+        self.freehandLineWell.style = CPDFBorderStyle(rawValue: KMPreference.shared.inkNoteLineStyle) ?? .solid
+        self.freehandLineWell.dashPattern = KMPreference.shared.inkNoteDashPattern as NSArray
+        self.circleLineWell.displayStyle = .oval
+        self.circleLineWell.lineWidth = KMPreference.shared.circleNoteLineWidth.cgFloat
+        self.circleLineWell.style = CPDFBorderStyle(rawValue: KMPreference.shared.circleNoteLineStyle) ?? .solid
+        self.circleLineWell.dashPattern = KMPreference.shared.circleNoteDashPattern as NSArray
+        self.rectLineWell.displayStyle = .rectangle
+        self.rectLineWell.lineWidth = KMPreference.shared.squareNoteLineWidth.cgFloat
+        self.rectLineWell.style = CPDFBorderStyle(rawValue: KMPreference.shared.squareNoteLineStyle) ?? .solid
+        self.rectLineWell.dashPattern = KMPreference.shared.squareNoteDashPattern as NSArray
     }
     
     private func _initActions() {
@@ -325,8 +305,16 @@ class KMNotesPreferences: NSViewController {
         self.alignmentSegmentControl.target = self
         self.alignmentSegmentControl.action = #selector(alignmentSegmentAction)
         
+        self.textLineWell.target = self
+        self.textLineWell.action = #selector(textLineWellAction)
+        self.lineLineWell.target = self
+        self.lineLineWell.action = #selector(lineLineWellAction)
+        self.freehandLineWell.target = self
+        self.freehandLineWell.action = #selector(freehandLineWellAction)
         self.circleLineWell.target = self
         self.circleLineWell.action = #selector(circleLineWellAction)
+        self.rectLineWell.target = self
+        self.rectLineWell.action = #selector(rectLineWellAction)
     }
     
     @objc func textColorWellAction(_ sender: NSColorWell) {
@@ -402,10 +390,68 @@ class KMNotesPreferences: NSViewController {
     
     // MARK: - LineWell
     
+    @objc func textLineWellAction(_ sender: KMLineWell) {
+        let action = KMLineInspector.shared.currentLineChangeAction
+        if action == .lineWidth {
+            KMPreference.shared.freeTextNoteLineWidth = Float(sender.lineWidth)
+        } else if action == .style {
+            KMPreference.shared.freeTextNoteLineStyle = sender.style.rawValue
+        } else if action == .dashPattern {
+            KMPreference.shared.freeTextNoteDashPattern = sender.dashPattern as? [CGFloat] ?? []
+        }
+    }
+    
+    @objc func lineLineWellAction(_ sender: KMLineWell) {
+        let action = KMLineInspector.shared.currentLineChangeAction
+        if action == .lineWidth {
+            KMPreference.shared.lineNoteLineWidth = Float(sender.lineWidth)
+        } else if action == .style {
+            KMPreference.shared.lineNoteLineStyle = sender.style.rawValue
+        } else if action == .dashPattern {
+            KMPreference.shared.lineNoteDashPattern = sender.dashPattern as? [CGFloat] ?? []
+        } else if action == .startLineStyle {
+            KMPreference.shared.lineNoteStartLineStyle = sender.startLineStyle.rawValue
+        } else if action == .endLineStyle {
+            KMPreference.shared.lineNoteEndLineStyle = sender.endLineStyle.rawValue
+        }
+    }
+    
+    @objc func freehandLineWellAction(_ sender: KMLineWell) {
+        let action = KMLineInspector.shared.currentLineChangeAction
+        if action == .lineWidth {
+            KMPreference.shared.inkNoteLineWidth = Float(sender.lineWidth)
+        } else if action == .style {
+            KMPreference.shared.inkNoteLineStyle = sender.style.rawValue
+        } else if action == .dashPattern {
+            KMPreference.shared.inkNoteDashPattern = sender.dashPattern as? [CGFloat] ?? []
+        }
+    }
+    
     @objc func circleLineWellAction(_ sender: KMLineWell) {
-        KMPreference.shared.circleNoteLineWidth = Float(sender.lineWidth)
-        KMPreference.shared.circleNoteLineStyle = sender.style.rawValue
-        KMPreference.shared.circleNoteDashPattern = sender.dashPattern as? [CGFloat] ?? []
+//        KMPreference.shared.beginGrouping()
+//        KMPreference.shared.circleNoteLineWidth = Float(sender.lineWidth)
+//        KMPreference.shared.circleNoteLineStyle = sender.style.rawValue
+//        KMPreference.shared.circleNoteDashPattern = sender.dashPattern as? [CGFloat] ?? []
+//        KMPreference.shared.endGrouping()
+        let action = KMLineInspector.shared.currentLineChangeAction
+        if action == .lineWidth {
+            KMPreference.shared.circleNoteLineWidth = Float(sender.lineWidth)
+        } else if action == .style {
+            KMPreference.shared.circleNoteLineStyle = sender.style.rawValue
+        } else if action == .dashPattern {
+            KMPreference.shared.circleNoteDashPattern = sender.dashPattern as? [CGFloat] ?? []
+        }
+    }
+    
+    @objc func rectLineWellAction(_ sender: KMLineWell) {
+        let action = KMLineInspector.shared.currentLineChangeAction
+        if action == .lineWidth {
+            KMPreference.shared.squareNoteLineWidth = Float(sender.lineWidth)
+        } else if action == .style {
+            KMPreference.shared.squareNoteLineStyle = sender.style.rawValue
+        } else if action == .dashPattern {
+            KMPreference.shared.squareNoteDashPattern = sender.dashPattern as? [CGFloat] ?? []
+        }
     }
 }
 

+ 56 - 0
PDF Office/PDF Master/Class/Preference/Tools/KMPreferenceCommon.swift

@@ -0,0 +1,56 @@
+//
+//  KMPreferenceCommon.swift
+//  PDF Reader Pro
+//
+//  Created by tangchao on 2024/1/16.
+//
+
+import Foundation
+
+func KMPreferenceKeyToCKey(pKey: KMPreferenceKey) -> String? {
+    // freeText
+    if pKey == KMPreference.freeTextNoteLineWidthKey {
+        return CFreeTextNoteLineWidthKey
+    } else if pKey == KMPreference.freeTextNoteLineStyleKey {
+        return CFreeTextNoteLineStyleKey
+    } else if pKey == KMPreference.freeTextNoteDashPatternKey {
+        return CFreeTextNoteDashPatternKey
+    }
+    // Line
+    else if pKey == KMPreference.lineNoteLineWidthKey {
+        return CLineNoteLineWidthKey
+    } else if pKey == KMPreference.lineNoteLineStyleKey {
+        return CLineNoteLineStyleKey
+    } else if pKey == KMPreference.lineNoteDashPatternKey {
+        return CLineNoteDashPatternKey
+    } else if pKey == KMPreference.lineNoteStartLineStyleKey {
+        return CLineNoteStartLineStyleKey
+    } else if pKey == KMPreference.lineNoteEndLineStyleKey {
+        return CLineNoteEndLineStyleKey
+    }
+    // freehand
+    else if pKey == KMPreference.inkNoteLineWidthKey {
+        return CInkNoteLineWidthKey
+    } else if pKey == KMPreference.inkNoteLineStyleKey {
+        return CInkNoteLineStyleKey
+    } else if pKey == KMPreference.inkNoteDashPatternKey {
+        return CInkNoteDashPatternKey
+    }
+    // circle
+    else if pKey == KMPreference.circleNoteLineWidthKey {
+        return CCircleNoteLineWidthKey
+    } else if pKey == KMPreference.circleNoteLineStyleKey {
+        return CCircleNoteLineStyleKey
+    } else if pKey == KMPreference.circleNoteDashPatternKey {
+        return CCircleNoteDashPatternKey
+    }
+    // rect
+    else if pKey == KMPreference.squareNoteLineWidthKey {
+        return CSquareNoteLineWidthKey
+    } else if pKey == KMPreference.squareNoteLineStyleKey {
+        return CSquareNoteLineStyleKey
+    } else if pKey == KMPreference.squareNoteDashPatternKey {
+        return CSquareNoteDashPatternKey
+    }
+    return nil
+}

+ 81 - 1
PDF Office/PDF Master/Class/Preference/Tools/KMPreferenceManager.swift

@@ -250,7 +250,12 @@ typealias KMPreference = KMPreferenceManager
         UserDefaults.standard.set(info, forKey: KMPreferenceInfoKey)
         UserDefaults.standard.synchronize()
         
-        self.postNotification(object: [group], userInfo: [key : data])
+        if self._grouping {
+            self._grouping_objects.insert(group)
+            self._grouping_infos[key] = data
+        } else {
+            self.postNotification(object: [group], userInfo: [key : data])
+        }
         
         return true
     }
@@ -1679,6 +1684,11 @@ extension KMPreferenceManager {
         } else if (key == KMMarkupNoteFontSizeKey) {
 //            UserDefaults.standard.set(data, forKey: CFreeTextNoteFontSizeKey)
 //            UserDefaults.standard.synchronize()
+        } else {
+            if let cKey = KMPreferenceKeyToCKey(pKey: key) {
+                UserDefaults.standard.set(data, forKey: cKey)
+                UserDefaults.standard.synchronize()
+            }
         }
     }
     
@@ -1711,6 +1721,7 @@ extension KMPreferenceManager {
     
     private func resetDataToPDFView() {
         let markupGroupInfo: [KMPreferenceKey : Any] = self.getDefaultInfo()[KMPreferenceGroup.markup.rawValue]!
+        // colors
         for key in [KMMarkupColorHighlightKey, KMMarkupColorUnderlineKey, KMMarkupColorStrikthroughKey,
                     KMMarkupColorPenKey, KMMarkupColorNoteKey, KMMarkupColorTextKey,
                     KMMarkupColorRectangleFillKey, KMMarkupColorRectangleBorderKey,
@@ -1718,6 +1729,14 @@ extension KMPreferenceManager {
                     KMMarkupColorLineKey, KMMarkupColorArrowKey] {
             self.syncDataToPDFView(self.dataToColor(colors: markupGroupInfo[key] as! [Double]), forKey: key)
         }
+        // lines
+        for key in [KMFreeTextNoteLineStyleKey, KMFreeTextNoteLineWidthKey, KMFreeTextNoteDashPatternKey,
+                    KMLineNoteLineStyleKey, KMLineNoteLineWidthKey, KMLineNoteDashPatternKey,
+                    KMInkNoteLineStyleKey, KMInkNoteLineWidthKey, KMInkNoteDashPatternKey,
+                    KMCircleNoteLineStyleKey, KMCircleNoteLineWidthKey, KMCircleNoteDashPatternKey,
+                    KMSquareNoteLineStyleKey, KMSquareNoteLineWidthKey, KMSquareNoteDashPatternKey] {
+            self.syncDataToPDFView(markupGroupInfo[key] as Any, forKey: key)
+        }
         
         self.syncDataToPDFView(KMDefaultFontName, forKey: KMMarkupFontTextStringKey)
         self.syncDataToPDFView(NSTextAlignment.left.rawValue, forKey: KMMarkupFontTextAligmentKey)
@@ -1867,3 +1886,64 @@ extension KMPreferenceManager {
         }
     }
 }
+
+// MARK: - Grouping
+
+extension KMPreferenceManager {
+    var grouping: Bool {
+        get {
+            return false
+        }
+    }
+    
+    private static var _groupingInfosKey = "KMGroupingInfosKey"
+    private var _grouping_infos: [KMPreferenceKey : Any] {
+        get {
+            return (objc_getAssociatedObject(self, &Self._groupingInfosKey) as? [KMPreferenceKey : Any]) ?? [:]
+        }
+        set {
+            objc_setAssociatedObject(self, &Self._groupingInfosKey, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
+        }
+    }
+    
+    private static var _groupingObjectsKey = "KMGroupingObjectsKey"
+    private var _grouping_objects: Set<KMPreferenceGroup> {
+        get {
+            return (objc_getAssociatedObject(self, &Self._groupingObjectsKey) as? Set) ?? []
+        }
+        set {
+            objc_setAssociatedObject(self, &Self._groupingObjectsKey, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
+        }
+    }
+    
+    private static var _groupingKey = "KMGroupingKey"
+    private var _grouping: Bool {
+        get {
+            return (objc_getAssociatedObject(self, &Self._groupingKey) as? Bool) ?? false
+        }
+        set {
+            objc_setAssociatedObject(self, &Self._groupingKey, newValue, .OBJC_ASSOCIATION_ASSIGN)
+        }
+    }
+    
+    func beginGrouping() {
+        self._grouping = true
+        self._grouping_objects = []
+        self._grouping_infos = [:]
+    }
+    
+    func endGrouping() {
+        self._grouping = false
+        
+        if self._grouping_objects.isEmpty == false { // 发送通知
+            var objects: [KMPreferenceGroup] = []
+            for data in self._grouping_objects {
+                objects.append(data)
+            }
+            self.postNotification(object: objects, userInfo: self._grouping_infos)
+        }
+        
+        self._grouping_objects = []
+        self._grouping_infos = [:]
+    }
+}

+ 1 - 1
PDF Office/PDF Master/Class/Preference/View/KMLineWell.swift

@@ -762,7 +762,7 @@ extension KMLineWell {
         
         path.lineWidth = self.lineWidth
         if self.style == .dashed {
-            path.setLineDash(self.dashPattern as? [CGFloat], count: self.dashPattern!.count, phase: 0)
+            path.setLineDash(self.dashPattern as? [CGFloat], count: self.dashPattern?.count ?? 0, phase: 0)
         }
         return path
     }

+ 3 - 3
PDF Office/PDF Master/Class/Purchase/DMG/Verification/KMVerificationMessageViewController.m

@@ -481,9 +481,9 @@ NSPopoverDelegate>
     }
 #else
     if (![IAPProductsManager defaultManager].isAvailableAdvancedPDFToOffice) {
-        KMToolCompareWindowController *vc = [KMToolCompareWindowController toolCompareWithType:KMCompareWithToolType_Convert setSelectIndex:0];
-        [vc.window center];
-        [vc showWindow:nil];
+//        KMToolCompareWindowController *vc = [KMToolCompareWindowController toolCompareWithType:KMCompareWithToolType_Convert setSelectIndex:0];
+//        [vc.window center];
+//        [vc showWindow:nil];
     }
 #endif
     

+ 63 - 5
PDF Office/PDF Reader Pro.xcodeproj/project.pbxproj

@@ -829,6 +829,12 @@
 		9F8810882B564E9700F69815 /* KMAnnotationButtonWidgetOptionsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9F8810842B564E9700F69815 /* KMAnnotationButtonWidgetOptionsViewController.xib */; };
 		9F8810892B564E9700F69815 /* KMAnnotationButtonWidgetOptionsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9F8810842B564E9700F69815 /* KMAnnotationButtonWidgetOptionsViewController.xib */; };
 		9F88108A2B564E9700F69815 /* KMAnnotationButtonWidgetOptionsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9F8810842B564E9700F69815 /* KMAnnotationButtonWidgetOptionsViewController.xib */; };
+		9F88108D2B56614600F69815 /* KMAnnotationChoiceWidgetAppearanceViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F88108B2B56614600F69815 /* KMAnnotationChoiceWidgetAppearanceViewController.swift */; };
+		9F88108E2B56614600F69815 /* KMAnnotationChoiceWidgetAppearanceViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F88108B2B56614600F69815 /* KMAnnotationChoiceWidgetAppearanceViewController.swift */; };
+		9F88108F2B56614600F69815 /* KMAnnotationChoiceWidgetAppearanceViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F88108B2B56614600F69815 /* KMAnnotationChoiceWidgetAppearanceViewController.swift */; };
+		9F8810902B56614600F69815 /* KMAnnotationChoiceWidgetAppearanceViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9F88108C2B56614600F69815 /* KMAnnotationChoiceWidgetAppearanceViewController.xib */; };
+		9F8810912B56614600F69815 /* KMAnnotationChoiceWidgetAppearanceViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9F88108C2B56614600F69815 /* KMAnnotationChoiceWidgetAppearanceViewController.xib */; };
+		9F8810922B56614600F69815 /* KMAnnotationChoiceWidgetAppearanceViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9F88108C2B56614600F69815 /* KMAnnotationChoiceWidgetAppearanceViewController.xib */; };
 		9F8DDF2629237910006CDC73 /* Array+KMExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F8DDF2529237910006CDC73 /* Array+KMExtensions.swift */; };
 		9F8DDF2729237910006CDC73 /* Array+KMExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F8DDF2529237910006CDC73 /* Array+KMExtensions.swift */; };
 		9F8DDF2829237910006CDC73 /* Array+KMExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F8DDF2529237910006CDC73 /* Array+KMExtensions.swift */; };
@@ -2374,6 +2380,15 @@
 		ADF9ED3329A850D200C4A943 /* KMAccountInfoView.xib in Resources */ = {isa = PBXBuildFile; fileRef = ADF9ED3229A850D200C4A943 /* KMAccountInfoView.xib */; };
 		ADF9ED3429A850D200C4A943 /* KMAccountInfoView.xib in Resources */ = {isa = PBXBuildFile; fileRef = ADF9ED3229A850D200C4A943 /* KMAccountInfoView.xib */; };
 		ADF9ED3529A850D200C4A943 /* KMAccountInfoView.xib in Resources */ = {isa = PBXBuildFile; fileRef = ADF9ED3229A850D200C4A943 /* KMAccountInfoView.xib */; };
+		ADFA8EFD2B5649AE002595A4 /* KMAutoFlowOptionsSheetController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADFA8EFB2B5649AE002595A4 /* KMAutoFlowOptionsSheetController.swift */; };
+		ADFA8EFE2B5649AE002595A4 /* KMAutoFlowOptionsSheetController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADFA8EFB2B5649AE002595A4 /* KMAutoFlowOptionsSheetController.swift */; };
+		ADFA8EFF2B5649AE002595A4 /* KMAutoFlowOptionsSheetController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADFA8EFB2B5649AE002595A4 /* KMAutoFlowOptionsSheetController.swift */; };
+		ADFA8F002B5649AE002595A4 /* KMAutoFlowOptionsSheetController.xib in Resources */ = {isa = PBXBuildFile; fileRef = ADFA8EFC2B5649AE002595A4 /* KMAutoFlowOptionsSheetController.xib */; };
+		ADFA8F012B5649AE002595A4 /* KMAutoFlowOptionsSheetController.xib in Resources */ = {isa = PBXBuildFile; fileRef = ADFA8EFC2B5649AE002595A4 /* KMAutoFlowOptionsSheetController.xib */; };
+		ADFA8F022B5649AE002595A4 /* KMAutoFlowOptionsSheetController.xib in Resources */ = {isa = PBXBuildFile; fileRef = ADFA8EFC2B5649AE002595A4 /* KMAutoFlowOptionsSheetController.xib */; };
+		ADFA8F042B5666B6002595A4 /* KMAotuFlowExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADFA8F032B5666B6002595A4 /* KMAotuFlowExtension.swift */; };
+		ADFA8F052B5666B6002595A4 /* KMAotuFlowExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADFA8F032B5666B6002595A4 /* KMAotuFlowExtension.swift */; };
+		ADFA8F062B5666B6002595A4 /* KMAotuFlowExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADFA8F032B5666B6002595A4 /* KMAotuFlowExtension.swift */; };
 		ADFCEB322B4F78150001EBAF /* KMFileManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADFCEB312B4F78150001EBAF /* KMFileManager.swift */; };
 		ADFCEB332B4F78150001EBAF /* KMFileManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADFCEB312B4F78150001EBAF /* KMFileManager.swift */; };
 		ADFCEB342B4F78150001EBAF /* KMFileManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADFCEB312B4F78150001EBAF /* KMFileManager.swift */; };
@@ -4578,6 +4593,9 @@
 		BBFBE74B28DD7DDE008B2335 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BBFBE6C328DD7B98008B2335 /* Main.storyboard */; };
 		BBFBE74C28DD7DE4008B2335 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BBFBE6F228DD7C21008B2335 /* Assets.xcassets */; };
 		BBFBE74D28DD7DE8008B2335 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BBFBE72128DD7C43008B2335 /* Assets.xcassets */; };
+		BBFCCE082B56988C003742B3 /* KMPreferenceCommon.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBFCCE072B56988C003742B3 /* KMPreferenceCommon.swift */; };
+		BBFCCE092B56988C003742B3 /* KMPreferenceCommon.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBFCCE072B56988C003742B3 /* KMPreferenceCommon.swift */; };
+		BBFCCE0A2B56988C003742B3 /* KMPreferenceCommon.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBFCCE072B56988C003742B3 /* KMPreferenceCommon.swift */; };
 		BBFD2B122AEFAAF70016C456 /* KMBatchOperateBaseViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBFD2B112AEFAAF70016C456 /* KMBatchOperateBaseViewController.swift */; };
 		BBFD2B142AEFAB8F0016C456 /* KMOperationQueue.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBFD2B132AEFAB8F0016C456 /* KMOperationQueue.swift */; };
 		BBFD2B162AEFAC9C0016C456 /* KMBatchOperateBaseViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BBFD2B152AEFAC9B0016C456 /* KMBatchOperateBaseViewController.xib */; };
@@ -5186,6 +5204,8 @@
 		9F8539F52947137400DF644E /* newtab.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = newtab.pdf; sourceTree = "<group>"; };
 		9F8810832B564E9700F69815 /* KMAnnotationButtonWidgetOptionsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMAnnotationButtonWidgetOptionsViewController.swift; sourceTree = "<group>"; };
 		9F8810842B564E9700F69815 /* KMAnnotationButtonWidgetOptionsViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMAnnotationButtonWidgetOptionsViewController.xib; sourceTree = "<group>"; };
+		9F88108B2B56614600F69815 /* KMAnnotationChoiceWidgetAppearanceViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMAnnotationChoiceWidgetAppearanceViewController.swift; sourceTree = "<group>"; };
+		9F88108C2B56614600F69815 /* KMAnnotationChoiceWidgetAppearanceViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMAnnotationChoiceWidgetAppearanceViewController.xib; sourceTree = "<group>"; };
 		9F8DDF2529237910006CDC73 /* Array+KMExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Array+KMExtensions.swift"; sourceTree = "<group>"; };
 		9F8DDF2B2924B855006CDC73 /* KMPDFToolsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMPDFToolsViewController.swift; sourceTree = "<group>"; };
 		9F8DDF2C2924B855006CDC73 /* KMPDFToolsViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMPDFToolsViewController.xib; sourceTree = "<group>"; };
@@ -5721,6 +5741,9 @@
 		ADF6B87D2A485A8F0090CB78 /* KMComparativeViewCollectionItemItem.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMComparativeViewCollectionItemItem.xib; sourceTree = "<group>"; };
 		ADF9ED2E29A8507400C4A943 /* KMAccountInfoView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KMAccountInfoView.swift; sourceTree = "<group>"; };
 		ADF9ED3229A850D200C4A943 /* KMAccountInfoView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMAccountInfoView.xib; sourceTree = "<group>"; };
+		ADFA8EFB2B5649AE002595A4 /* KMAutoFlowOptionsSheetController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMAutoFlowOptionsSheetController.swift; sourceTree = "<group>"; };
+		ADFA8EFC2B5649AE002595A4 /* KMAutoFlowOptionsSheetController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMAutoFlowOptionsSheetController.xib; sourceTree = "<group>"; };
+		ADFA8F032B5666B6002595A4 /* KMAotuFlowExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMAotuFlowExtension.swift; sourceTree = "<group>"; };
 		ADFCEB312B4F78150001EBAF /* KMFileManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMFileManager.swift; sourceTree = "<group>"; };
 		ADFCEB352B4F78220001EBAF /* KMFile.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMFile.swift; sourceTree = "<group>"; };
 		ADFCEB3A2B4FB8C80001EBAF /* FirebaseRemoteConfig.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = FirebaseRemoteConfig.framework; sourceTree = "<group>"; };
@@ -6586,7 +6609,7 @@
 		BBFBE6D528DD7B98008B2335 /* PDF Reader ProUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "PDF Reader ProUITests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
 		BBFBE6D928DD7B98008B2335 /* PDF_MasterUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PDF_MasterUITests.swift; sourceTree = "<group>"; };
 		BBFBE6DB28DD7B98008B2335 /* PDF_MasterUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PDF_MasterUITestsLaunchTests.swift; sourceTree = "<group>"; };
-		BBFBE6EC28DD7C20008B2335 /* PDF Reader Pro Edition.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "PDF Reader Pro Edition.app"; sourceTree = BUILT_PRODUCTS_DIR; };
+		BBFBE6EC28DD7C20008B2335 /* PDF Reaer Pro.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "PDF Reaer Pro.app"; sourceTree = BUILT_PRODUCTS_DIR; };
 		BBFBE6EE28DD7C20008B2335 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
 		BBFBE6F028DD7C20008B2335 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
 		BBFBE6F228DD7C21008B2335 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
@@ -6607,6 +6630,7 @@
 		BBFBE73528DD7C43008B2335 /* PDF Reader Pro DMGUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "PDF Reader Pro DMGUITests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
 		BBFBE73928DD7C43008B2335 /* PDF_ Master_DMGUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "PDF_ Master_DMGUITests.swift"; sourceTree = "<group>"; };
 		BBFBE73B28DD7C43008B2335 /* PDF_ Master_DMGUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "PDF_ Master_DMGUITestsLaunchTests.swift"; sourceTree = "<group>"; };
+		BBFCCE072B56988C003742B3 /* KMPreferenceCommon.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMPreferenceCommon.swift; sourceTree = "<group>"; };
 		BBFD2B112AEFAAF70016C456 /* KMBatchOperateBaseViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMBatchOperateBaseViewController.swift; sourceTree = "<group>"; };
 		BBFD2B132AEFAB8F0016C456 /* KMOperationQueue.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMOperationQueue.swift; sourceTree = "<group>"; };
 		BBFD2B152AEFAC9B0016C456 /* KMBatchOperateBaseViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = KMBatchOperateBaseViewController.xib; sourceTree = "<group>"; };
@@ -7332,6 +7356,7 @@
 		9F1F82C6292F631A0092C4B4 /* PDFTools */ = {
 			isa = PBXGroup;
 			children = (
+				AD2BF23B2B5647C80029F03F /* AutoFlow */,
 				BBD922282B50D43800DB9585 /* Rate */,
 				BB24FFDA2B28576500A59054 /* TTS */,
 				BB1969D42B28429A00922736 /* Snapshot */,
@@ -7758,6 +7783,8 @@
 				9F69DBB92B55014F003D4C45 /* KMAnnotationButtonWidgetAppearanceViewController.xib */,
 				9F8810832B564E9700F69815 /* KMAnnotationButtonWidgetOptionsViewController.swift */,
 				9F8810842B564E9700F69815 /* KMAnnotationButtonWidgetOptionsViewController.xib */,
+				9F88108B2B56614600F69815 /* KMAnnotationChoiceWidgetAppearanceViewController.swift */,
+				9F88108C2B56614600F69815 /* KMAnnotationChoiceWidgetAppearanceViewController.xib */,
 			);
 			path = FormProperties;
 			sourceTree = "<group>";
@@ -8038,6 +8065,16 @@
 			path = "Preview Content";
 			sourceTree = "<group>";
 		};
+		AD2BF23B2B5647C80029F03F /* AutoFlow */ = {
+			isa = PBXGroup;
+			children = (
+				ADFA8F032B5666B6002595A4 /* KMAotuFlowExtension.swift */,
+				ADFA8EFB2B5649AE002595A4 /* KMAutoFlowOptionsSheetController.swift */,
+				ADFA8EFC2B5649AE002595A4 /* KMAutoFlowOptionsSheetController.xib */,
+			);
+			path = AutoFlow;
+			sourceTree = "<group>";
+		};
 		AD2D74AA29F0CE8500EDC5E4 /* Cancellation */ = {
 			isa = PBXGroup;
 			children = (
@@ -9691,6 +9728,7 @@
 			children = (
 				BB00301C298CB799002DD1A0 /* KMPreferenceManager.swift */,
 				BBA93D2C29BEBAA60044E0DD /* KMPreferenceEnum.swift */,
+				BBFCCE072B56988C003742B3 /* KMPreferenceCommon.swift */,
 			);
 			path = Tools;
 			sourceTree = "<group>";
@@ -11994,7 +12032,7 @@
 				BBFBE6BA28DD7B97008B2335 /* PDF Reader Pro.app */,
 				BBFBE6CB28DD7B98008B2335 /* PDF Reader ProTests.xctest */,
 				BBFBE6D528DD7B98008B2335 /* PDF Reader ProUITests.xctest */,
-				BBFBE6EC28DD7C20008B2335 /* PDF Reader Pro Edition.app */,
+				BBFBE6EC28DD7C20008B2335 /* PDF Reaer Pro.app */,
 				BBFBE6FC28DD7C21008B2335 /* PDF Reader Pro ProTests.xctest */,
 				BBFBE70628DD7C21008B2335 /* PDF Reader Pro ProUITests.xctest */,
 				BBFBE71B28DD7C43008B2335 /* PDF Reader Pro.app */,
@@ -12357,7 +12395,7 @@
 			);
 			name = "PDF Reader Pro Edition";
 			productName = "PDF Master Pro";
-			productReference = BBFBE6EC28DD7C20008B2335 /* PDF Reader Pro Edition.app */;
+			productReference = BBFBE6EC28DD7C20008B2335 /* PDF Reaer Pro.app */;
 			productType = "com.apple.product-type.application";
 		};
 		BBFBE6FB28DD7C21008B2335 /* PDF Reader Pro ProTests */ = {
@@ -12557,6 +12595,7 @@
 				BBFBE6C228DD7B98008B2335 /* Assets.xcassets in Resources */,
 				AD1D483E2AFB81F4007AC1F0 /* KMMergeBlankView.xib in Resources */,
 				9F1FE4DE29406E4700E952CA /* .gclient in Resources */,
+				9F8810902B56614600F69815 /* KMAnnotationChoiceWidgetAppearanceViewController.xib in Resources */,
 				AD8810A329A8459000178CA1 /* KMComparativeTableViewController.xib in Resources */,
 				AD867F9829D955D200F00440 /* KMBOTAOutlineCellView.xib in Resources */,
 				9F1F82BF292E01860092C4B4 /* KMCloudEmptyCollectionViewItem.xib in Resources */,
@@ -12774,6 +12813,7 @@
 				9F78EFBE28F7C1CC001E66F4 /* KMHomeViewController.xib in Resources */,
 				9F3D818A29A0A9A70087B5AD /* KMDesignButton.xib in Resources */,
 				9F512CD22B469A7700EC0BC3 /* KMPageDisplayThemeCollectionViewItem.xib in Resources */,
+				ADFA8F002B5649AE002595A4 /* KMAutoFlowOptionsSheetController.xib in Resources */,
 				9FDD0F9F2952FF4D000C4DAD /* global.json in Resources */,
 				BB8810972B4F7CD100AFA63E /* KMVerificationTrialViewController.xib in Resources */,
 				ADE614B129779C6D00F62ED7 /* KMImageTitleButton.xib in Resources */,
@@ -13111,6 +13151,7 @@
 				9F3D819729A33A290087B5AD /* KMDesignDropdown.xib in Resources */,
 				BB03D6912B01C7AB008C9976 /* KMPDFEditInsertBlankPageWindow.xib in Resources */,
 				BBFE6E792930E53000142C01 /* KMMergePopoverViewController.xib in Resources */,
+				9F8810912B56614600F69815 /* KMAnnotationChoiceWidgetAppearanceViewController.xib in Resources */,
 				9FDD0F972952FF4D000C4DAD /* $metadata.json in Resources */,
 				BB7F7C0429AA586900A3E4E7 /* signAddBack.png in Resources */,
 				BB1969D22B2833FF00922736 /* KMProgressWindowController.xib in Resources */,
@@ -13277,6 +13318,7 @@
 				AD8810B629A846B100178CA1 /* KMVerficationCodeWindowController.xib in Resources */,
 				BB2EDF74296ECE17003BCF58 /* KMPageEditThumbnailItem.xib in Resources */,
 				BB897232294B08DE0045787C /* KMWatermarkViewController.xib in Resources */,
+				ADFA8F012B5649AE002595A4 /* KMAutoFlowOptionsSheetController.xib in Resources */,
 				9FBA0EE528FEC253001117AF /* KMProductPromotionViewController.xib in Resources */,
 				BB5BE4F22B060EB500D51BF2 /* KMLanguageViewController.xib in Resources */,
 				BBA2109129ACBFDB00E6B346 /* nosign.pdf in Resources */,
@@ -13525,6 +13567,7 @@
 				ADE3C1C629A4C13700793B13 /* KMPrintAccessoryController_OC.xib in Resources */,
 				ADEC7A83299397F8009A8256 /* SF-Pro-Text-Regular.otf in Resources */,
 				9FD0FA2E29CD3ED400F2AB0D /* KMRightSideEmptyVC.xib in Resources */,
+				9F8810922B56614600F69815 /* KMAnnotationChoiceWidgetAppearanceViewController.xib in Resources */,
 				9F94748129FA24200042F949 /* Credits.rtf in Resources */,
 				AD1D480D2AFB18DA007AC1F0 /* KMCompressWIndowControllerNew.xib in Resources */,
 				AD85D1A92AF09864000F4D28 /* KMHomeQuickToolsWindowController.xib in Resources */,
@@ -13742,6 +13785,7 @@
 				BB5DF1EE2959C5CB0025CDA1 /* KMHeaderFooterPreviewController.xib in Resources */,
 				ADBC2D17299CCD10006280C8 /* KMTextfieldButton.xib in Resources */,
 				9F512CD42B469A7700EC0BC3 /* KMPageDisplayThemeCollectionViewItem.xib in Resources */,
+				ADFA8F022B5649AE002595A4 /* KMAutoFlowOptionsSheetController.xib in Resources */,
 				BB1BFF6F2AEA030F003EB179 /* KMBatchOperateSplitViewController.xib in Resources */,
 				BB8810992B4F7CD100AFA63E /* KMVerificationTrialViewController.xib in Resources */,
 				BBC348382955A118008D2CD1 /* KMCreateBackgroundController.xib in Resources */,
@@ -14466,6 +14510,7 @@
 				9F0CB52D298656D900007028 /* KMDesignToken+BorderWidthRight.swift in Sources */,
 				BBCE57142A72713A00508EFC /* NSViewController+KMExtension.swift in Sources */,
 				8997011F28F41AB8009AF911 /* KMLeftSideViewController.swift in Sources */,
+				ADFA8EFD2B5649AE002595A4 /* KMAutoFlowOptionsSheetController.swift in Sources */,
 				BB162E97295062CD0088E9D1 /* KMPageRangeTools.swift in Sources */,
 				BB24FFDD2B28578C00A59054 /* KMTTSWindowController.swift in Sources */,
 				ADD1B6EC2946C04C00C3FFF7 /* KMPrintChoosePageSizePamphletView.swift in Sources */,
@@ -14628,6 +14673,7 @@
 				BBEC00A4295BD42D00A26C98 /* KMHeaderFooterPageInfoView.swift in Sources */,
 				BBD1F787296FAC7C00343885 /* KMPageEditSettingBaseView.swift in Sources */,
 				ADE86AC02B034C7100414DFA /* KMBackgroundWindowController.swift in Sources */,
+				ADFA8F042B5666B6002595A4 /* KMAotuFlowExtension.swift in Sources */,
 				BB03D69C2B0249A2008C9976 /* KMPDFEditInsertPageWindow.swift in Sources */,
 				AD1CA3FF2A0603EE0070541F /* KMAnnotationScreenCollectionView.swift in Sources */,
 				ADD1B6DF2946BFD500C3FFF7 /* KMPrintChoosePageSizeSizeView.swift in Sources */,
@@ -14732,6 +14778,7 @@
 				BBC8A76D2B05EDDF00FA9377 /* KMThumbnail.swift in Sources */,
 				BBF62C702B0347AF007B7E86 /* SplitWindowController.swift in Sources */,
 				AD1CA3F72A05FCB60070541F /* KMAnnotationScreenViewController.swift in Sources */,
+				BBFCCE082B56988C003742B3 /* KMPreferenceCommon.swift in Sources */,
 				ADB2D6E6294740F30029D2B3 /* KMPrintPaperSetWindowController.swift in Sources */,
 				BB897271294DB6BE0045787C /* KMWatermarkAdjectivePlainView.swift in Sources */,
 				ADBC2D37299F0A5A006280C8 /* KMPrintHelpViewController.swift in Sources */,
@@ -14993,6 +15040,7 @@
 				BB146FCF299DC0D100784A6A /* GTMMIMEDocument.m in Sources */,
 				9F1F82EA2935D02E0092C4B4 /* KMComboBox.swift in Sources */,
 				ADDEEA722AD3EFE200EF675D /* KMButton.swift in Sources */,
+				9F88108D2B56614600F69815 /* KMAnnotationChoiceWidgetAppearanceViewController.swift in Sources */,
 				BB49ECE5293EF54800C82CA2 /* KMCustomPDFView.swift in Sources */,
 				9F0CB48F29683DEE00007028 /* KMPropertiesPanelLineSubVC.swift in Sources */,
 				BB6719E92AD2A57C003D44D5 /* CPDFLinkAnnotation+PDFListView.swift in Sources */,
@@ -15183,6 +15231,7 @@
 				899700F728F4051B009AF911 /* KMAnnotationViewController.swift in Sources */,
 				9F1FE4C429406E4700E952CA /* CTPageTransition.c in Sources */,
 				BBB9B311299A5D6D004F3235 /* KMCloudDownloadOperationQueue.m in Sources */,
+				BBFCCE092B56988C003742B3 /* KMPreferenceCommon.swift in Sources */,
 				ADDF834E2B391A5C00A81A4E /* DSignatureCertifyDetailViewController.swift in Sources */,
 				BBF729902B1960FF00576AC5 /* KMCompressOperationQueue.swift in Sources */,
 				BBF8A3FE2AE8B04100788BAC /* KMBatchOperateFile.swift in Sources */,
@@ -15625,6 +15674,7 @@
 				ADDEEA832AD4DAB200EF675D /* KMSignatureWindowController.swift in Sources */,
 				9F39B9452A661ED500930ACA /* KMHomeScrollView.swift in Sources */,
 				BB2EDF55296E815E003BCF58 /* KMPageEditBaseItemView.swift in Sources */,
+				ADFA8F052B5666B6002595A4 /* KMAotuFlowExtension.swift in Sources */,
 				BB89727A294DFD1E0045787C /* KMWatermarkTextView.swift in Sources */,
 				BB5726F12B20707D0089D283 /* CPDFMarkupAnnotation+PDFListView.swift in Sources */,
 				9F1F82D3292F6D510092C4B4 /* KMPDFInsertPreviewViewController.swift in Sources */,
@@ -15854,6 +15904,7 @@
 				9F8810862B564E9700F69815 /* KMAnnotationButtonWidgetOptionsViewController.swift in Sources */,
 				AD88109729A78ADC00178CA1 /* KMVerificationCodeView.swift in Sources */,
 				BBC347FE295448DE008D2CD1 /* KMWatermarkTemplateModel.swift in Sources */,
+				ADFA8EFE2B5649AE002595A4 /* KMAutoFlowOptionsSheetController.swift in Sources */,
 				9FB220F82B186C9800A5B208 /* KMAnnotationGeneralViewController.swift in Sources */,
 				BB88107D2B4F7A1F00AFA63E /* KMActivityALertViewController.m in Sources */,
 				BB6B436C2A04935000E02B54 /* KMPDFThumbViewBaseController.swift in Sources */,
@@ -15940,6 +15991,7 @@
 				ADAFDA572AEB451600F084BC /* KMHomeContentView.swift in Sources */,
 				BBFE6E66293097A600142C01 /* KMPageRangePickerWindowController.swift in Sources */,
 				BBEC00E6295C4D3C00A26C98 /* KMBatesPageInfoView.swift in Sources */,
+				9F88108E2B56614600F69815 /* KMAnnotationChoiceWidgetAppearanceViewController.swift in Sources */,
 				BB276A512B0376B300AB5578 /* KMBatchOperateRemoveHeaderFooterViewController.swift in Sources */,
 				F37322E8292DF9410013862C /* CPDFAnnotationModel.m in Sources */,
 				BBDA8A6A2A31B50C006A2C4E /* KMCustomStepperView.swift in Sources */,
@@ -16190,6 +16242,7 @@
 				9F78EFC828F7E965001E66F4 /* KMHomeViewController+UI.swift in Sources */,
 				AD3AAD432B0B7B6C00DE5FE7 /* KMCompareManager.swift in Sources */,
 				9FBA0EFB2900188F001117AF /* KMFastToolCollectionView.swift in Sources */,
+				ADFA8F062B5666B6002595A4 /* KMAotuFlowExtension.swift in Sources */,
 				9F1F82DC292F84D60092C4B4 /* KMHomeInsertActionViewController.swift in Sources */,
 				ADB5E5142A371131007110A8 /* KMSubscribeWaterMarkWindowController.swift in Sources */,
 				ADE86ACA2B034CB200414DFA /* KMAddBackgroundView.swift in Sources */,
@@ -16455,6 +16508,7 @@
 				AD867FB529DFBB2700F00440 /* KMAnnotationOutlineSectionView.swift in Sources */,
 				ADBC373E29CA9AE100D93208 /* KMComparativeManager.swift in Sources */,
 				BB5F8A1329BB04F000365ADB /* GBDeviceInfo_Common.m in Sources */,
+				BBFCCE0A2B56988C003742B3 /* KMPreferenceCommon.swift in Sources */,
 				BB2F9AB12AFCAE1F00F9DD93 /* KMProfileTitleCellView.swift in Sources */,
 				BB2F615A2966B69D001CB369 /* KMWatermarkPropertyHomeController.swift in Sources */,
 				89752E1F2942CB04003FF08E /* KMSearchMode.swift in Sources */,
@@ -16525,6 +16579,7 @@
 				BB1331502AD78DC0008F6791 /* KMPDFMergeSizeTabelViewCell.swift in Sources */,
 				ADDDCE232B43A32A005B4AB5 /* AppSandboxFileAccessPersist.m in Sources */,
 				AD199DFA2B26A36500D56FEE /* KMPrintPosterPreviewView.swift in Sources */,
+				ADFA8EFF2B5649AE002595A4 /* KMAutoFlowOptionsSheetController.swift in Sources */,
 				BB88109C2B4F7CD100AFA63E /* KMVerificationTrialViewController.m in Sources */,
 				BB2EDF6C296ECE17003BCF58 /* KMPageEditInsertTypeItemView.swift in Sources */,
 				BBD7FE052A1323A400F96075 /* KMEditImagePropertyViewController.swift in Sources */,
@@ -17200,6 +17255,7 @@
 				BB986AED2AD53AE800ADF172 /* KMInfoWindowController.swift in Sources */,
 				BB0A55122A302DB700B6E84B /* KMTextField.swift in Sources */,
 				9F0CB5032986560D00007028 /* KMDesignToken+BorderTop.swift in Sources */,
+				9F88108F2B56614600F69815 /* KMAnnotationChoiceWidgetAppearanceViewController.swift in Sources */,
 				9F0CB4CB2986533F00007028 /* KMDesignToken+Sizing.swift in Sources */,
 				BB1B0AC72B4FC6E900889528 /* KMGuideInfoWindow.swift in Sources */,
 				ADD1B70C29471FA500C3FFF7 /* KMPrintChoosePresenter.swift in Sources */,
@@ -17743,6 +17799,7 @@
 				);
 				GENERATE_INFOPLIST_FILE = YES;
 				INFOPLIST_FILE = "PDF-Reader-Pro-Edition-Info.plist";
+				INFOPLIST_KEY_CFBundleDisplayName = "PDF Reader Pro";
 				INFOPLIST_KEY_NSContactsUsageDescription = "Your consent is required before you could access the function.";
 				INFOPLIST_KEY_NSHumanReadableCopyright = "";
 				INFOPLIST_KEY_NSMainStoryboardFile = Main;
@@ -17760,7 +17817,7 @@
 				MARKETING_VERSION = 1.1.0;
 				OTHER_SWIFT_FLAGS = "-DVERSION_PRO";
 				PRODUCT_BUNDLE_IDENTIFIER = com.brother.pdfreaderpro.mac;
-				PRODUCT_NAME = "$(TARGET_NAME)";
+				PRODUCT_NAME = "PDF Reaer Pro";
 				PROVISIONING_PROFILE_SPECIFIER = "";
 				SWIFT_EMIT_LOC_STRINGS = YES;
 				SWIFT_OBJC_BRIDGING_HEADER = "PDF Master/PDF_Reader_Pro Edition-Bridging-Header.h";
@@ -17799,6 +17856,7 @@
 				GCC_PREPROCESSOR_DEFINITIONS = "VERSION_PRO=1";
 				GENERATE_INFOPLIST_FILE = YES;
 				INFOPLIST_FILE = "PDF-Reader-Pro-Edition-Info.plist";
+				INFOPLIST_KEY_CFBundleDisplayName = "PDF Reader Pro";
 				INFOPLIST_KEY_NSContactsUsageDescription = "Your consent is required before you could access the function.";
 				INFOPLIST_KEY_NSHumanReadableCopyright = "";
 				INFOPLIST_KEY_NSMainStoryboardFile = Main;
@@ -17816,7 +17874,7 @@
 				MARKETING_VERSION = 1.1.0;
 				OTHER_SWIFT_FLAGS = "-DVERSION_PRO";
 				PRODUCT_BUNDLE_IDENTIFIER = com.brother.pdfreaderpro.mac;
-				PRODUCT_NAME = "$(TARGET_NAME)";
+				PRODUCT_NAME = "PDF Reaer Pro";
 				PROVISIONING_PROFILE_SPECIFIER = "";
 				SWIFT_EMIT_LOC_STRINGS = YES;
 				SWIFT_OBJC_BRIDGING_HEADER = "PDF Master/PDF_Reader_Pro Edition-Bridging-Header.h";

+ 4 - 4
PDF Office/PDF Reader Pro.xcodeproj/xcshareddata/xcschemes/PDF Reader Pro Edition.xcscheme

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Scheme
    LastUpgradeVersion = "1520"
-   version = "1.7">
+   version = "1.8">
    <BuildAction
       parallelizeBuildables = "YES"
       buildImplicitDependencies = "YES">
@@ -15,7 +15,7 @@
             <BuildableReference
                BuildableIdentifier = "primary"
                BlueprintIdentifier = "BBFBE6EB28DD7C20008B2335"
-               BuildableName = "PDF Reader Pro Edition.app"
+               BuildableName = "PDF Reaer Pro.app"
                BlueprintName = "PDF Reader Pro Edition"
                ReferencedContainer = "container:PDF Reader Pro.xcodeproj">
             </BuildableReference>
@@ -68,7 +68,7 @@
          <BuildableReference
             BuildableIdentifier = "primary"
             BlueprintIdentifier = "BBFBE6EB28DD7C20008B2335"
-            BuildableName = "PDF Reader Pro Edition.app"
+            BuildableName = "PDF Reaer Pro.app"
             BlueprintName = "PDF Reader Pro Edition"
             ReferencedContainer = "container:PDF Reader Pro.xcodeproj">
          </BuildableReference>
@@ -85,7 +85,7 @@
          <BuildableReference
             BuildableIdentifier = "primary"
             BlueprintIdentifier = "BBFBE6EB28DD7C20008B2335"
-            BuildableName = "PDF Reader Pro Edition.app"
+            BuildableName = "PDF Reaer Pro.app"
             BlueprintName = "PDF Reader Pro Edition"
             ReferencedContainer = "container:PDF Reader Pro.xcodeproj">
          </BuildableReference>

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

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Bucket
-   uuid = "BF64BADD-A23F-49AC-863F-CAF093A6E4D7"
+   uuid = "E7C3B034-85F9-4E63-8599-7CB8F874E11A"
    type = "1"
    version = "2.0">
    <Breakpoints>

+ 2 - 2
PDF Office/PDF-Reader-Pro-Edition-Info.plist

@@ -2,6 +2,8 @@
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
 <dict>
+	<key>ATSApplicationFontsPath</key>
+	<string>Fonts</string>
 	<key>CFBundleDocumentTypes</key>
 	<array>
 		<dict>
@@ -307,8 +309,6 @@
 	</dict>
 	<key>FirebaseAppDelegateProxyEnabled</key>
 	<false/>
-	<key>ATSApplicationFontsPath</key>
-	<string>Fonts</string>
 	<key>NSAppTransportSecurity</key>
 	<dict>
 		<key>NSAllowsArbitraryLoads</key>