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

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

niehaoyu 2 месяцев назад
Родитель
Сommit
09ee867887

+ 4 - 3
PDF Office/PDF Master/KMClass/KMPDFViewController/RightSideController/Views/OCR/KMOCRController.swift

@@ -9,12 +9,12 @@ import Cocoa
 import KMComponentLibrary
 
 class KMOCRController: NSViewController {
-
-    var pdfView: CPDFListView?
     @IBOutlet weak var typeTabs: ComponentTabs!
     @IBOutlet weak var saveButton: ComponentButton!
     @IBOutlet weak var pageView: KMOCRPageView!
     @IBOutlet weak var areaView: KMOCRAreaView!
+
+    var pdfView: CPDFListView?
     
     var model: KMOCRModel = KMOCRModel() {
         didSet {
@@ -29,7 +29,9 @@ class KMOCRController: NSViewController {
     override func viewDidLoad() {
         super.viewDidLoad()
         // Do view setup here.
+//        self.pageView.reloadData()
         self.model = KMOCRModel()
+        self.model.document = pdfView?.document
         self.updateUI()
         self.reloadData()
     }
@@ -73,7 +75,6 @@ class KMOCRController: NSViewController {
         saveButton.reloadData()
         typeTabs.refreshItems()
     }
-    
 }
 
 //MARK: Action

+ 2 - 0
PDF Office/PDF Master/KMClass/KMPDFViewController/RightSideController/Views/OCR/Model/KMOCRModel.swift

@@ -20,4 +20,6 @@ class KMOCRModel: NSObject {
     var imageCorrection: Bool = false
     var pageRange: String = ""
     var saveAsPDF: Bool = false
+    
+    var document: CPDFDocument?
 }

+ 60 - 10
PDF Office/PDF Master/KMClass/KMPDFViewController/RightSideController/Views/OCR/View/Area/KMOCRAreaView.swift

@@ -8,7 +8,17 @@
 import Cocoa
 import KMComponentLibrary
 
+typealias KMOCRAreaViewValueChangeAction = (_ view: KMOCRAreaView, _ model: KMOCRModel) -> (Void)
+
 class KMOCRAreaView: BaseXibView {
+    @IBOutlet weak var ocrPlanLabel: NSTextField!
+    @IBOutlet weak var OCRPlan1Button: ComponentRadio!
+    @IBOutlet weak var OCRPlan2Button: ComponentRadio!
+    @IBOutlet weak var plan1HelpButton: ComponentToolTipsHelp!
+    @IBOutlet weak var plan2HelpButton: ComponentToolTipsHelp!
+    @IBOutlet weak var OCRPlan1ButtonWidthConstraint: NSLayoutConstraint!
+    @IBOutlet weak var OCRPlan2ButtonWidthConstraint: NSLayoutConstraint!
+    
     @IBOutlet weak var languageLabel: NSTextField!
     @IBOutlet weak var languageSelectButton: ComponentSelect!
     @IBOutlet weak var resultLabel: NSTextField!
@@ -16,6 +26,8 @@ class KMOCRAreaView: BaseXibView {
     @IBOutlet weak var loadingProgress: ComponentProgressCircle!
     @IBOutlet weak var textArea: ComponentTextarea!
     
+    var changeAction: KMOCRAreaViewValueChangeAction?
+    
     var selectIndex: Int = 0
     
     var model: KMOCRModel = KMOCRModel() {
@@ -33,10 +45,20 @@ class KMOCRAreaView: BaseXibView {
     override func updateUIThemeColor() {
         resultLabel.font = ComponentLibrary.shared.getFontFromKey("mac/body-s-medium")
         languageLabel.font = ComponentLibrary.shared.getFontFromKey("mac/body-s-medium")
+        ocrPlanLabel.font = ComponentLibrary.shared.getFontFromKey("mac/body-s-medium")
 
     }
     
     override func updateUILanguage() {
+        plan1HelpButton.toolTip = KMLocalizedString("Online OCR\nThe OCR solution is technically supported by Google.")
+        plan2HelpButton.toolTip = KMLocalizedString("Offline OCR\nThe OCR solution is technically supported by Apple.")
+        
+        ocrPlanLabel.stringValue = KMLocalizedString("OCR Plan")
+        OCRPlan1Button.properties.text = KMLocalizedString("OCR Plan 1 (Online)", comment: "")
+        OCRPlan1Button.reloadData()
+        OCRPlan2Button.properties.text = KMLocalizedString("OCR Plan 2 (Offline)", comment: "")
+        OCRPlan2Button.reloadData()
+        
         languageLabel.stringValue = KMLocalizedString("OCR Language", comment: "")
         resultLabel.stringValue = KMLocalizedString("OCR Result", comment: "")
     }
@@ -47,6 +69,16 @@ class KMOCRAreaView: BaseXibView {
     }
     
     func updateUI() {
+        OCRPlan1Button.properties = ComponentCheckBoxProperty(size: .s, text: KMLocalizedString("OCR Plan 1 (Online)"), checkboxType: .normal)
+        OCRPlan1Button.setTarget(self, action: #selector(OCRPlan1ButtonAction(_:)))
+        OCRPlan1ButtonWidthConstraint.constant = OCRPlan1Button.properties.propertyInfo.viewWidth
+        OCRPlan1Button.reloadData()
+        
+        OCRPlan2Button.properties = ComponentCheckBoxProperty(size: .s, text: KMLocalizedString("OCR Plan 2 (Offline)"), checkboxType: .normal)
+        OCRPlan2Button.setTarget(self, action: #selector(OCRPlan2ButtonAction(_:)))
+        OCRPlan2ButtonWidthConstraint.constant = OCRPlan2Button.properties.propertyInfo.viewWidth
+        OCRPlan2Button.reloadData()
+        
         copyButton.properties = ComponentButtonProperty(type: .text_gray, size: .xxs, onlyIcon: true, icon: NSImage(named: "tools_copy"), keepPressState: false)
         
         languageSelectButton.properties = ComponentSelectProperties(size: .s,
@@ -66,19 +98,21 @@ class KMOCRAreaView: BaseXibView {
     }
  
     func reloadData() {
+        languageSelectButton.selectItemAtIndex(self.selectIndex)
+        
+        self.OCRPlan1Button.properties.checkboxType = .normal
+        self.OCRPlan2Button.properties.checkboxType = .normal
+        if model.ocrType == .google {
+            self.OCRPlan1Button.properties.checkboxType = .selected
+        } else {
+            self.OCRPlan2Button.properties.checkboxType = .selected
+        }
+        self.OCRPlan1Button.reloadData()
+        self.OCRPlan2Button.reloadData()
         
     }
     
     func updateLanguages() {
-        languageSelectButton.properties = ComponentSelectProperties(size: .s,
-                                                              state: .normal,
-                                                              isDisabled: false,
-                                                              isError: false,
-                                                              leftIcon: false,
-                                                              placeholder: nil,
-                                                              errorText: nil,
-                                                              creatable: false,
-                                                              text: NSLocalizedString("", comment: ""))
         var menuItemArr: [ComponentMenuitemProperty] = []
         var languages: [String] = KMOCRManager.manager.languages
         
@@ -101,7 +135,23 @@ class KMOCRAreaView: BaseXibView {
 
 //MARK: Action
 extension KMOCRAreaView {
-
+    func OCRPlan1ButtonAction(_ sender: ComponentCheckBox) {
+        model.ocrType = .google
+        self.reloadData()
+        
+        guard let callBack = changeAction else { return }
+        
+        callBack(self, model)
+    }
+    
+    func OCRPlan2ButtonAction(_ sender: ComponentCheckBox) {
+        model.ocrType = .apple
+        self.reloadData()
+        
+        guard let callBack = changeAction else { return }
+        
+        callBack(self, model)
+    }
 }
 
 extension KMOCRAreaView: ComponentTextareaDelegate {

+ 117 - 9
PDF Office/PDF Master/KMClass/KMPDFViewController/RightSideController/Views/OCR/View/Area/KMOCRAreaView.xib

@@ -8,10 +8,17 @@
     <objects>
         <customObject id="-2" userLabel="File's Owner" customClass="KMOCRAreaView" customModule="PDF_Reader_Pro" customModuleProvider="target">
             <connections>
+                <outlet property="OCRPlan1Button" destination="5MZ-5h-Nkh" id="aX4-dB-5hK"/>
+                <outlet property="OCRPlan1ButtonWidthConstraint" destination="DzQ-6R-pQH" id="kUC-j3-ivd"/>
+                <outlet property="OCRPlan2Button" destination="n6x-S2-fM4" id="sMH-SS-gVt"/>
+                <outlet property="OCRPlan2ButtonWidthConstraint" destination="P6j-Vs-TX7" id="c0O-A5-4Jp"/>
                 <outlet property="copyButton" destination="Dxp-34-1Ns" id="dcB-69-33P"/>
                 <outlet property="languageLabel" destination="ROa-d1-Ye1" id="2Xk-tm-08G"/>
                 <outlet property="languageSelectButton" destination="Ln1-6E-Tp6" id="k4k-k5-fuY"/>
                 <outlet property="loadingProgress" destination="pGx-iv-wrW" id="vX3-Ba-C2N"/>
+                <outlet property="ocrPlanLabel" destination="w7K-g0-9jf" id="9R8-m8-KTP"/>
+                <outlet property="plan1HelpButton" destination="Rp5-f5-BAF" id="lIe-M3-E0Q"/>
+                <outlet property="plan2HelpButton" destination="q51-nB-Qcw" id="N7Y-F3-fDR"/>
                 <outlet property="resultLabel" destination="TZB-q0-LUD" id="9E1-Ye-nOy"/>
                 <outlet property="textArea" destination="iZE-54-5q6" id="PXW-xB-tvO"/>
             </connections>
@@ -23,7 +30,7 @@
             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
             <subviews>
                 <customView translatesAutoresizingMaskIntoConstraints="NO" id="MIj-yf-omb">
-                    <rect key="frame" x="0.0" y="510" width="311" height="72"/>
+                    <rect key="frame" x="0.0" y="390" width="311" height="72"/>
                     <subviews>
                         <customView translatesAutoresizingMaskIntoConstraints="NO" id="r9S-iz-0ao">
                             <rect key="frame" x="0.0" y="32" width="311" height="40"/>
@@ -84,10 +91,10 @@
                     </constraints>
                 </customView>
                 <customView translatesAutoresizingMaskIntoConstraints="NO" id="bjU-wo-yfH">
-                    <rect key="frame" x="0.0" y="40" width="311" height="454"/>
+                    <rect key="frame" x="0.0" y="40" width="311" height="334"/>
                     <subviews>
                         <customView translatesAutoresizingMaskIntoConstraints="NO" id="K8r-qj-Cah">
-                            <rect key="frame" x="0.0" y="414" width="311" height="40"/>
+                            <rect key="frame" x="0.0" y="294" width="311" height="40"/>
                             <subviews>
                                 <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="TZB-q0-LUD">
                                     <rect key="frame" x="14" y="12" width="37" height="16"/>
@@ -114,13 +121,13 @@
                             </constraints>
                         </customView>
                         <customView translatesAutoresizingMaskIntoConstraints="NO" id="Rf8-Qs-MZY">
-                            <rect key="frame" x="0.0" y="0.0" width="311" height="414"/>
+                            <rect key="frame" x="0.0" y="0.0" width="311" height="294"/>
                             <subviews>
                                 <customView translatesAutoresizingMaskIntoConstraints="NO" id="M6l-2G-yR4">
-                                    <rect key="frame" x="0.0" y="0.0" width="311" height="414"/>
+                                    <rect key="frame" x="0.0" y="0.0" width="311" height="294"/>
                                     <subviews>
                                         <customView translatesAutoresizingMaskIntoConstraints="NO" id="pGx-iv-wrW" customClass="ComponentProgressCircle" customModule="KMComponentLibrary">
-                                            <rect key="frame" x="140" y="191" width="32" height="32"/>
+                                            <rect key="frame" x="140" y="131" width="32" height="32"/>
                                             <constraints>
                                                 <constraint firstAttribute="height" constant="32" id="Byd-Nm-lBh"/>
                                                 <constraint firstAttribute="width" constant="32" id="uuj-82-PcR"/>
@@ -133,10 +140,10 @@
                                     </constraints>
                                 </customView>
                                 <customView translatesAutoresizingMaskIntoConstraints="NO" id="wfI-dG-pah">
-                                    <rect key="frame" x="0.0" y="0.0" width="311" height="414"/>
+                                    <rect key="frame" x="0.0" y="0.0" width="311" height="294"/>
                                     <subviews>
                                         <customView translatesAutoresizingMaskIntoConstraints="NO" id="iZE-54-5q6" customClass="ComponentTextarea" customModule="KMComponentLibrary">
-                                            <rect key="frame" x="16" y="0.0" width="279" height="414"/>
+                                            <rect key="frame" x="16" y="0.0" width="279" height="294"/>
                                         </customView>
                                     </subviews>
                                     <constraints>
@@ -169,11 +176,112 @@
                         <constraint firstAttribute="bottom" secondItem="Rf8-Qs-MZY" secondAttribute="bottom" id="jvM-Sb-SOC"/>
                     </constraints>
                 </customView>
+                <customView translatesAutoresizingMaskIntoConstraints="NO" id="KDm-m2-IlB">
+                    <rect key="frame" x="0.0" y="478" width="311" height="104"/>
+                    <subviews>
+                        <customView translatesAutoresizingMaskIntoConstraints="NO" id="RdR-eq-tjd">
+                            <rect key="frame" x="0.0" y="64" width="311" height="40"/>
+                            <subviews>
+                                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="w7K-g0-9jf">
+                                    <rect key="frame" x="14" y="12" width="37" height="16"/>
+                                    <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="LfO-D1-ZWJ">
+                                        <font key="font" usesAppearanceFont="YES"/>
+                                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                    </textFieldCell>
+                                </textField>
+                            </subviews>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="40" id="5IR-7s-l7F"/>
+                                <constraint firstItem="w7K-g0-9jf" firstAttribute="leading" secondItem="RdR-eq-tjd" secondAttribute="leading" constant="16" id="EUU-LJ-DPB"/>
+                                <constraint firstItem="w7K-g0-9jf" firstAttribute="centerY" secondItem="RdR-eq-tjd" secondAttribute="centerY" id="K0u-KF-0Xe"/>
+                            </constraints>
+                        </customView>
+                        <customView translatesAutoresizingMaskIntoConstraints="NO" id="E53-WN-bEg">
+                            <rect key="frame" x="0.0" y="0.0" width="311" height="64"/>
+                            <subviews>
+                                <customView translatesAutoresizingMaskIntoConstraints="NO" id="1s3-ul-oOr">
+                                    <rect key="frame" x="0.0" y="32" width="311" height="32"/>
+                                    <subviews>
+                                        <customView translatesAutoresizingMaskIntoConstraints="NO" id="5MZ-5h-Nkh" customClass="ComponentRadio" customModule="KMComponentLibrary">
+                                            <rect key="frame" x="16" y="0.0" width="72" height="32"/>
+                                            <constraints>
+                                                <constraint firstAttribute="width" constant="72" id="DzQ-6R-pQH"/>
+                                                <constraint firstAttribute="height" constant="32" id="GFt-nM-DDh"/>
+                                            </constraints>
+                                        </customView>
+                                        <customView translatesAutoresizingMaskIntoConstraints="NO" id="Rp5-f5-BAF" customClass="ComponentToolTipsHelp" customModule="KMComponentLibrary">
+                                            <rect key="frame" x="96" y="8" width="16" height="16"/>
+                                            <constraints>
+                                                <constraint firstAttribute="height" constant="16" id="XtG-WL-N7s"/>
+                                                <constraint firstAttribute="width" constant="16" id="q13-NA-vkq"/>
+                                            </constraints>
+                                        </customView>
+                                    </subviews>
+                                    <constraints>
+                                        <constraint firstItem="Rp5-f5-BAF" firstAttribute="centerY" secondItem="5MZ-5h-Nkh" secondAttribute="centerY" id="0fM-Ms-bcY"/>
+                                        <constraint firstItem="5MZ-5h-Nkh" firstAttribute="leading" secondItem="1s3-ul-oOr" secondAttribute="leading" constant="16" id="SDr-hW-RW9"/>
+                                        <constraint firstAttribute="height" constant="32" id="fx4-oR-OQ7"/>
+                                        <constraint firstItem="5MZ-5h-Nkh" firstAttribute="centerY" secondItem="1s3-ul-oOr" secondAttribute="centerY" id="qSH-q3-Vf8"/>
+                                        <constraint firstItem="Rp5-f5-BAF" firstAttribute="leading" secondItem="5MZ-5h-Nkh" secondAttribute="trailing" constant="8" id="uNa-W1-f00"/>
+                                    </constraints>
+                                </customView>
+                                <customView translatesAutoresizingMaskIntoConstraints="NO" id="MAL-9v-fnd">
+                                    <rect key="frame" x="0.0" y="0.0" width="311" height="32"/>
+                                    <subviews>
+                                        <customView translatesAutoresizingMaskIntoConstraints="NO" id="n6x-S2-fM4" customClass="ComponentRadio" customModule="KMComponentLibrary">
+                                            <rect key="frame" x="16" y="0.0" width="72" height="32"/>
+                                            <constraints>
+                                                <constraint firstAttribute="width" constant="72" id="P6j-Vs-TX7"/>
+                                                <constraint firstAttribute="height" constant="32" id="ZH2-nq-eyd"/>
+                                            </constraints>
+                                        </customView>
+                                        <customView translatesAutoresizingMaskIntoConstraints="NO" id="q51-nB-Qcw" customClass="ComponentToolTipsHelp" customModule="KMComponentLibrary">
+                                            <rect key="frame" x="96" y="8" width="16" height="16"/>
+                                            <constraints>
+                                                <constraint firstAttribute="height" constant="16" id="bht-WH-yVT"/>
+                                                <constraint firstAttribute="width" constant="16" id="vsg-3L-U1H"/>
+                                            </constraints>
+                                        </customView>
+                                    </subviews>
+                                    <constraints>
+                                        <constraint firstItem="q51-nB-Qcw" firstAttribute="centerY" secondItem="n6x-S2-fM4" secondAttribute="centerY" id="AmK-qV-Tb5"/>
+                                        <constraint firstItem="q51-nB-Qcw" firstAttribute="leading" secondItem="n6x-S2-fM4" secondAttribute="trailing" constant="8" id="Fcj-1H-0Qi"/>
+                                        <constraint firstItem="n6x-S2-fM4" firstAttribute="leading" secondItem="MAL-9v-fnd" secondAttribute="leading" constant="16" id="i2O-lt-0x0"/>
+                                        <constraint firstAttribute="height" constant="32" id="ibX-Yd-JTi"/>
+                                        <constraint firstItem="n6x-S2-fM4" firstAttribute="centerY" secondItem="MAL-9v-fnd" secondAttribute="centerY" id="nKj-qW-KrM"/>
+                                    </constraints>
+                                </customView>
+                            </subviews>
+                            <constraints>
+                                <constraint firstItem="MAL-9v-fnd" firstAttribute="leading" secondItem="E53-WN-bEg" secondAttribute="leading" id="Boe-WG-9Yd"/>
+                                <constraint firstItem="1s3-ul-oOr" firstAttribute="top" secondItem="E53-WN-bEg" secondAttribute="top" id="L2H-n2-Geb"/>
+                                <constraint firstAttribute="trailing" secondItem="MAL-9v-fnd" secondAttribute="trailing" id="LUv-G5-s4H"/>
+                                <constraint firstAttribute="trailing" secondItem="1s3-ul-oOr" secondAttribute="trailing" id="LgH-sn-i6G"/>
+                                <constraint firstItem="MAL-9v-fnd" firstAttribute="top" secondItem="1s3-ul-oOr" secondAttribute="bottom" id="v7Q-mE-aO9"/>
+                                <constraint firstItem="1s3-ul-oOr" firstAttribute="leading" secondItem="E53-WN-bEg" secondAttribute="leading" id="vmI-1I-EbB"/>
+                            </constraints>
+                        </customView>
+                    </subviews>
+                    <constraints>
+                        <constraint firstAttribute="trailing" secondItem="RdR-eq-tjd" secondAttribute="trailing" id="2uy-Xu-KSv"/>
+                        <constraint firstItem="E53-WN-bEg" firstAttribute="top" secondItem="RdR-eq-tjd" secondAttribute="bottom" id="3nE-aj-8I9"/>
+                        <constraint firstAttribute="height" constant="104" id="4ND-M7-F26"/>
+                        <constraint firstAttribute="bottom" secondItem="E53-WN-bEg" secondAttribute="bottom" id="cBJ-7o-1Hf"/>
+                        <constraint firstAttribute="trailing" secondItem="E53-WN-bEg" secondAttribute="trailing" id="lou-aZ-6jE"/>
+                        <constraint firstItem="RdR-eq-tjd" firstAttribute="top" secondItem="KDm-m2-IlB" secondAttribute="top" id="nTG-Ht-twm"/>
+                        <constraint firstItem="RdR-eq-tjd" firstAttribute="leading" secondItem="KDm-m2-IlB" secondAttribute="leading" id="ncG-p6-M9u"/>
+                        <constraint firstItem="E53-WN-bEg" firstAttribute="leading" secondItem="KDm-m2-IlB" secondAttribute="leading" id="nns-qn-pZf"/>
+                    </constraints>
+                </customView>
             </subviews>
             <constraints>
                 <constraint firstItem="MIj-yf-omb" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" id="4SR-Py-COA"/>
-                <constraint firstItem="MIj-yf-omb" firstAttribute="top" secondItem="c22-O7-iKe" secondAttribute="top" id="5h0-C9-oSR"/>
+                <constraint firstItem="MIj-yf-omb" firstAttribute="top" secondItem="KDm-m2-IlB" secondAttribute="bottom" constant="16" id="UC9-hv-1EC"/>
+                <constraint firstItem="KDm-m2-IlB" firstAttribute="top" secondItem="c22-O7-iKe" secondAttribute="top" id="cIB-I8-itu"/>
+                <constraint firstItem="KDm-m2-IlB" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" id="fdf-ob-LIq"/>
                 <constraint firstAttribute="bottom" secondItem="bjU-wo-yfH" secondAttribute="bottom" constant="40" id="hDa-QG-BWC"/>
+                <constraint firstAttribute="trailing" secondItem="KDm-m2-IlB" secondAttribute="trailing" id="hXJ-rk-FTe"/>
                 <constraint firstItem="bjU-wo-yfH" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" id="iLU-Nf-GaI"/>
                 <constraint firstItem="bjU-wo-yfH" firstAttribute="top" secondItem="MIj-yf-omb" secondAttribute="bottom" constant="16" id="wnH-Wf-Dzr"/>
                 <constraint firstAttribute="trailing" secondItem="bjU-wo-yfH" secondAttribute="trailing" id="y4K-nH-xSX"/>

+ 6 - 11
PDF Office/PDF Master/KMClass/KMPDFViewController/RightSideController/Views/OCR/View/Page/KMOCRPageView.swift

@@ -99,6 +99,10 @@ class KMOCRPageView: BaseXibView {
         correctionSwitch.setTarget(self, action: #selector(switchAction(_:)))
         
         saveAsPDFButton.setTarget(self, action: #selector(saveAsPDFAction(_:)))
+        
+        guard let document = self.model.document else { return }
+        let pageIndex = self.pageSelectButton.getSelectedPageIndex(document)
+        self.model.language = self.pageSelectButton.getSelectedPageString(document, pageIndex.0)
     }
     
     func reloadData() {
@@ -124,15 +128,6 @@ class KMOCRPageView: BaseXibView {
     }
     
     func updateLanguages() {
-        languageSelectButton.properties = ComponentSelectProperties(size: .s,
-                                                              state: .normal,
-                                                              isDisabled: false,
-                                                              isError: false,
-                                                              leftIcon: false,
-                                                              placeholder: nil,
-                                                              errorText: nil,
-                                                              creatable: false,
-                                                              text: NSLocalizedString("", comment: ""))
         var menuItemArr: [ComponentMenuitemProperty] = []
         var languages: [String] = KMOCRManager.manager.languages
         
@@ -197,7 +192,7 @@ extension KMOCRPageView {
 
 extension KMOCRPageView: ComponentSelectDelegate {
     func componentSelectDidSelect(view: ComponentSelect?, menuItemProperty: ComponentMenuitemProperty?) {
-//        if(view == fontNameSelect) {
+        if(view == pageSelectButton) {
 //            if menuItemProperty?.identifier == "1" {
 //                let familyName = fontNameSelect.properties.text ?? "Helvetica"
 //                let styles = CPDFFont.fontNames(forFamilyName: familyName)
@@ -208,6 +203,6 @@ extension KMOCRPageView: ComponentSelectDelegate {
 //                compdfFont = CPDFFont(familyName: compdfFont?.familyName ?? "Helvetica", fontStyle: menuItemProperty?.text ?? "")
 //                annotationPopMode.setAnnotationFont(font: compdfFont ?? CPDFFont.init(familyName: "Helvetica", fontStyle: ""))
 //            }
-//        }
+        }
     }
 }