Prechádzať zdrojové kódy

【2025】移除批量相关代码

lizhe 3 týždňov pred
rodič
commit
fb5844edb0
86 zmenil súbory, kde vykonal 36 pridanie a 14548 odobranie
  1. 0 1021
      PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/AIConfigWindowController.swift
  2. 0 676
      PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/AIConfigWindowController.xib
  3. 0 18
      PDF Office/PDF Master/Class/Batch/Catogary/NSArray+Extension.swift
  4. 0 66
      PDF Office/PDF Master/Class/Batch/Catogary/NSButton+CustomAppearance.swift
  5. 0 295
      PDF Office/PDF Master/Class/Batch/Data/KMBatchBaseParameter.swift
  6. 0 160
      PDF Office/PDF Master/Class/Batch/Data/KMBatchConvertParameter.swift
  7. 0 39
      PDF Office/PDF Master/Class/Batch/Data/KMBatchOperateManager.swift
  8. 0 47
      PDF Office/PDF Master/Class/Batch/Data/KMImageModel.swift
  9. 0 383
      PDF Office/PDF Master/Class/Batch/Operation/KMBatchConvertOperation.swift
  10. 0 114
      PDF Office/PDF Master/Class/Batch/Operation/KMCompressOperation.swift
  11. 0 15
      PDF Office/PDF Master/Class/Batch/Tools/KMAddBackgroundOperationQueue.swift
  12. 0 16
      PDF Office/PDF Master/Class/Batch/Tools/KMAddBatesOperationQueue.swift
  13. 0 15
      PDF Office/PDF Master/Class/Batch/Tools/KMAddHeaderFooterOperationQueue.swift
  14. 0 16
      PDF Office/PDF Master/Class/Batch/Tools/KMAddWatermarkOprationQueue.swift
  15. 0 48
      PDF Office/PDF Master/Class/Batch/Tools/KMBatchOperation.swift
  16. 0 174
      PDF Office/PDF Master/Class/Batch/Tools/KMBatchRemoveHeaderFooterOperation.swift
  17. 0 15
      PDF Office/PDF Master/Class/Batch/Tools/KMCompressOperationQueue.swift
  18. 0 15
      PDF Office/PDF Master/Class/Batch/Tools/KMOperationQueue.swift
  19. 0 15
      PDF Office/PDF Master/Class/Batch/Tools/KMRemoveBackgroundOperationQueue.swift
  20. 0 15
      PDF Office/PDF Master/Class/Batch/Tools/KMRemoveBatesOperationQueue.swift
  21. 0 16
      PDF Office/PDF Master/Class/Batch/Tools/KMRemoveHeaderFooterQueue.swift
  22. 0 56
      PDF Office/PDF Master/Class/Batch/View/KMBatchoperateConvertCollectionViewItem.swift
  23. 0 96
      PDF Office/PDF Master/Class/Batch/View/KMBatchoperateConvertCollectionViewItem.xib
  24. 0 92
      PDF Office/PDF Master/Class/Batch/View/KMConvertCollectionViewHeader.swift
  25. 0 79
      PDF Office/PDF Master/Class/Batch/View/KMConvertCollectionViewHeader.xib
  26. 0 512
      PDF Office/PDF Master/Class/Batch/View/KMCustomViewButton.swift
  27. 0 213
      PDF Office/PDF Master/Class/Batch/View/KMSlider.swift
  28. 0 75
      PDF Office/PDF Master/Class/Batch/WindowController/KMAlertWindowController.swift
  29. 0 86
      PDF Office/PDF Master/Class/Batch/WindowController/KMAlertWindowController.xib
  30. 0 37
      PDF Office/PDF Master/Class/Batch/WindowController/KMTextHintWindowController.swift
  31. 0 77
      PDF Office/PDF Master/Class/Batch/WindowController/KMTextHintWindowController.xib
  32. 0 968
      PDF Office/PDF Master/Class/Batch/WindowController/VC/KMBatchOperateConvertViewController.swift
  33. 0 532
      PDF Office/PDF Master/Class/Batch/WindowController/VC/KMBatchOperateConvertViewController.xib
  34. 0 166
      PDF Office/PDF Master/Class/Batch/WindowController/VC/KMBatchOperateRemoveHeaderFooterViewController.swift
  35. 0 52
      PDF Office/PDF Master/Class/Batch/WindowController/VC/KMBatchOperateRemoveHeaderFooterViewController.xib
  36. 0 108
      PDF Office/PDF Master/Class/Batch/WindowController/VC/KMPlanViewController.swift
  37. 0 113
      PDF Office/PDF Master/Class/Batch/WindowController/VC/KMPlanViewController.xib
  38. 1 1
      PDF Office/PDF Master/Class/ChromiumTabs/KMBrowserWindowController+CreateFile.swift
  39. 1 1
      PDF Office/PDF Master/Class/ChromiumTabs/KMBrowserWindowController.swift
  40. 0 286
      PDF Office/PDF Master/Class/PDFTools/AddHeaderFooter/Model/KMBatchAddHeaderFooterOperation.swift
  41. 2 2
      PDF Office/PDF Master/Class/PDFTools/AddPassword/KMSecurityWindowController.xib
  42. 0 18
      PDF Office/PDF Master/Class/PDFTools/AddPassword/Model/KMAddPasswordOperationQueue.swift
  43. 0 127
      PDF Office/PDF Master/Class/PDFTools/AddPassword/Model/KMBatchAddPasswordOperation.swift
  44. 0 27
      PDF Office/PDF Master/Class/PDFTools/AddPassword/Model/KMSetPasswordObject.swift
  45. 0 399
      PDF Office/PDF Master/Class/PDFTools/AddPassword/VC/KMBatchOperateAddPasswordViewController.swift
  46. 0 357
      PDF Office/PDF Master/Class/PDFTools/AddPassword/VC/KMBatchOperateAddPasswordViewController.xib
  47. 2 2
      PDF Office/PDF Master/Class/PDFTools/AddPassword/View/KMSecurityContentView.xib
  48. 0 62
      PDF Office/PDF Master/Class/PDFTools/Compress/Controller/KMBatchOperateCompressViewController.swift
  49. 0 64
      PDF Office/PDF Master/Class/PDFTools/Compress/Controller/KMBatchOperateCompressViewController.xib
  50. 2 2
      PDF Office/PDF Master/Class/PDFTools/Compress/Controller/KMCompressSettingViewController.xib
  51. 3 3
      PDF Office/PDF Master/Class/PDFTools/Compress/Controller/KMCompressWindowController.xib
  52. 0 16
      PDF Office/PDF Master/Class/PDFTools/Convert/Model/KMConvertOperationQueue.swift
  53. 6 6
      PDF Office/PDF Master/Class/PDFTools/Merge/MergeNew/View/KMMergeView.xib
  54. 0 92
      PDF Office/PDF Master/Class/PDFTools/RemovePassword/Model/KMBatchRemovePasswordOperation.swift
  55. 0 15
      PDF Office/PDF Master/Class/PDFTools/RemovePassword/Model/KMRemovePasswordOperationQueue.swift
  56. 2 2
      PDF Office/PDF Master/Class/PDFTools/RemovePassword/New/View/KMRemovePasswordView.xib
  57. 0 177
      PDF Office/PDF Master/Class/PDFTools/RemovePassword/VC/KMBatchOperateRemovePasswordViewController.swift
  58. 0 113
      PDF Office/PDF Master/Class/PDFTools/RemovePassword/VC/KMBatchOperateRemovePasswordViewController.xib
  59. 1 1
      PDF Office/PDF Master/Class/README.md
  60. 0 300
      PDF Office/PDF Master/KMClass/ImageToPDF/Base/KMBatchOperateBaseViewController.swift
  61. 0 22
      PDF Office/PDF Master/KMClass/ImageToPDF/Base/KMBatchOperateBaseViewController.xib
  62. 0 101
      PDF Office/PDF Master/KMClass/ImageToPDF/Base/KMBatchOperateBaseWindowController.swift
  63. 0 30
      PDF Office/PDF Master/KMClass/ImageToPDF/Base/KMBatchOperateBaseWindowController.xib
  64. 0 1349
      PDF Office/PDF Master/KMClass/ImageToPDF/Base/KMBatchOperateLeftViewController.swift
  65. 0 356
      PDF Office/PDF Master/KMClass/ImageToPDF/Base/KMBatchOperateLeftViewController.xib
  66. 0 131
      PDF Office/PDF Master/KMClass/ImageToPDF/Base/KMBatchOperateRightViewController.swift
  67. 0 22
      PDF Office/PDF Master/KMClass/ImageToPDF/Base/KMBatchOperateRightViewController.xib
  68. 0 64
      PDF Office/PDF Master/KMClass/ImageToPDF/Base/KMBatchOperateSplitViewController.swift
  69. 0 32
      PDF Office/PDF Master/KMClass/ImageToPDF/Base/KMBatchOperateSplitViewController.xib
  70. 0 583
      PDF Office/PDF Master/KMClass/ImageToPDF/Base/KMBatchOperateWindowController.swift
  71. 0 32
      PDF Office/PDF Master/KMClass/ImageToPDF/Base/KMBatchOperateWindowController.xib
  72. 0 746
      PDF Office/PDF Master/KMClass/ImageToPDF/Controller/KMBatchOperateImageToPDFViewController.swift
  73. 0 260
      PDF Office/PDF Master/KMClass/ImageToPDF/Controller/KMBatchOperateImageToPDFViewController.xib
  74. 0 342
      PDF Office/PDF Master/KMClass/ImageToPDF/Model/KMBatchOperateFile.swift
  75. 0 390
      PDF Office/PDF Master/KMClass/ImageToPDF/Tools/KMImageToPDFMethod.swift
  76. 0 466
      PDF Office/PDF Master/KMClass/ImageToPDF/View/KMBatchTableCellView.swift
  77. 0 132
      PDF Office/PDF Master/KMClass/ImageToPDF/View/KMNTableHeaderCellView.swift
  78. 0 58
      PDF Office/PDF Master/KMClass/ImageToPDF/View/KMTableHeaderCell.swift
  79. 0 19
      PDF Office/PDF Master/KMClass/ImageToPDF/Window/KMBatchWindow.swift
  80. 3 3
      PDF Office/PDF Master/KMClass/KMHomeViewController/KMNHomeViewController.swift
  81. 1 17
      PDF Office/PDF Master/KMClass/KMPDFViewController/KMMainViewController.swift
  82. 8 0
      PDF Office/PDF Master/KMClass/NewBatch/Manager/KMBatchManager.swift
  83. 2 2
      PDF Office/PDF Master/KMClass/NewBatch/View/Setting/ImageToPDF/KMBatchImageToPDFView.xib
  84. 2 2
      PDF Office/PDF Master/KMClass/Secure/Window/KMPasswordInputWindow.xib
  85. 0 39
      PDF Office/PDF Master/KMClass/Tools/Category/Foundation/NSObject+KMExtension.swift
  86. 0 836
      PDF Office/PDF Reader Pro.xcodeproj/project.pbxproj

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 1021
PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/AIConfigWindowController.swift


+ 0 - 676
PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/AIConfigWindowController.xib

@@ -1,676 +0,0 @@
-<?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="AIConfigWindowController" customModule="PDF_Reader_Pro" customModuleProvider="target">
-            <connections>
-                <outlet property="aiResultTextView" destination="8Pl-WZ-PMg" id="gey-6v-FLW"/>
-                <outlet property="cancelBtn" destination="cjg-NV-eFm" id="8a4-cB-N8M"/>
-                <outlet property="contendBox" destination="2gG-B2-LaH" id="Lf1-cU-PDP"/>
-                <outlet property="fileActionBtn" destination="mcI-kL-lCj" id="Uxw-Be-5YP"/>
-                <outlet property="fileActionLabel" destination="C3P-7I-hTS" id="b1x-TN-k5f"/>
-                <outlet property="fileActionView" destination="OCT-gl-vo1" id="79Y-X1-MLz"/>
-                <outlet property="fileBGView" destination="vhY-2U-dEh" id="cuz-1I-CuS"/>
-                <outlet property="fileContendViewTopConst" destination="XIw-1b-L9B" id="LFi-TT-b0j"/>
-                <outlet property="fileEmptyImage" destination="lXw-Ha-gj9" id="pbe-tp-Q8d"/>
-                <outlet property="fileEmptyTextView" destination="oKN-no-DpZ" id="2Ef-VX-8wb"/>
-                <outlet property="filePDFBGView" destination="m3e-e0-Got" id="v9U-wB-bgm"/>
-                <outlet property="filePDFHoverBtn" destination="CK5-9H-oCH" id="e7G-Ec-wn1"/>
-                <outlet property="filePlaceholdLabel" destination="DZZ-c7-BO4" id="Sot-q9-M5H"/>
-                <outlet property="fileSizeTipLabel" destination="cbF-ht-Wss" id="aYd-dl-v7e"/>
-                <outlet property="fileSizeTipView" destination="smB-nJ-vqw" id="eGC-Qw-0sh"/>
-                <outlet property="fromLanguageBtn" destination="Ugd-ew-8ke" id="aN9-2E-BSn"/>
-                <outlet property="fromLanguageLabel" destination="opL-nV-Ip6" id="7NR-3v-TpZ"/>
-                <outlet property="fromLanguageView" destination="Ht2-c4-DeI" id="gWv-QQ-bgg"/>
-                <outlet property="inputTextCountLabel" destination="rLU-to-koS" id="O2n-ac-wDL"/>
-                <outlet property="pdfCoverImageView" destination="e53-8s-bQz" id="TfH-Z9-wJe"/>
-                <outlet property="pdfCoverView" destination="bg6-NM-Ulw" id="Bls-gI-zpe"/>
-                <outlet property="pdfNameLbl" destination="aMp-WQ-a3z" id="mEh-0x-ohL"/>
-                <outlet property="removePDFBtn" destination="RhY-Ci-lLd" id="kwc-EB-Laa"/>
-                <outlet property="resultBGView" destination="DCc-v0-M7o" id="tEr-RA-yh7"/>
-                <outlet property="resultEmptyImage" destination="pfU-N7-nWJ" id="HoF-vV-a25"/>
-                <outlet property="saveAsPDFBtn" destination="e21-Rh-Sls" id="aMt-YU-eI5"/>
-                <outlet property="saveAsTextBtn" destination="ZjF-9J-AhT" id="gdL-xx-8sD"/>
-                <outlet property="titleLabel" destination="wOE-fG-NKH" id="gpH-es-qPE"/>
-                <outlet property="titleTipBtn" destination="g9S-q1-kux" id="WLz-cB-cbe"/>
-                <outlet property="toLanguageBtn" destination="df8-Rm-DcQ" id="ARV-Jo-Rr7"/>
-                <outlet property="toLanguageLabel" destination="lA6-HV-STg" id="3lf-I2-hIe"/>
-                <outlet property="toLanguageView" destination="AHC-e4-uz8" id="XEw-BW-WHW"/>
-                <outlet property="translateConfigView" destination="WzQ-UG-alX" id="Eal-5I-fIV"/>
-                <outlet property="translateResultLabel" destination="jww-Dg-L78" id="Qkw-2j-4NQ"/>
-                <outlet property="translateResultSubLabel" destination="Ucz-80-lpx" id="98b-Yb-UTP"/>
-                <outlet property="translateResultView" destination="te9-qF-hEX" id="Jhf-Pm-8gZ"/>
-                <outlet property="translateSepLineView" destination="4Yw-6I-7pH" id="ZJX-tG-LgW"/>
-                <outlet property="uploadBGView" destination="BOi-Jk-fgK" id="90Z-7X-eBP"/>
-                <outlet property="uploadDesLabel" destination="WVa-fY-QHd" id="Kc1-7H-Ua4"/>
-                <outlet property="uploadItemBox" destination="J8Z-2N-iYK" id="OX3-sF-k8G"/>
-                <outlet property="uploadPDFBtn" destination="h8f-cp-JuX" id="qKn-Wb-Amd"/>
-                <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" titlebarAppearsTransparent="YES" titleVisibility="hidden" id="F0z-JX-Cv5">
-            <windowStyleMask key="styleMask" titled="YES" fullSizeContentView="YES"/>
-            <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
-            <rect key="contentRect" x="196" y="240" width="795" height="551"/>
-            <rect key="screenRect" x="0.0" y="0.0" width="1920" height="1055"/>
-            <view key="contentView" id="se5-gp-TjO">
-                <rect key="frame" x="0.0" y="0.0" width="795" height="551"/>
-                <autoresizingMask key="autoresizingMask"/>
-                <subviews>
-                    <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="2gG-B2-LaH">
-                        <rect key="frame" x="0.0" y="0.0" width="795" height="551"/>
-                        <view key="contentView" id="5E2-pO-j3A">
-                            <rect key="frame" x="0.0" y="0.0" width="795" height="551"/>
-                            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                            <subviews>
-                                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="wOE-fG-NKH">
-                                    <rect key="frame" x="18" y="515" width="37" height="16"/>
-                                    <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="GIj-9f-Kuy">
-                                        <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>
-                                <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="g9S-q1-kux" customClass="KMButton" customModule="PDF_Reader_Pro" customModuleProvider="target">
-                                    <rect key="frame" x="57" y="515" width="16" height="16"/>
-                                    <buttonCell key="cell" type="bevel" bezelStyle="rounded" image="ic_else_info_large" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="UY8-74-Jal">
-                                        <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                                        <font key="font" metaFont="system"/>
-                                    </buttonCell>
-                                    <constraints>
-                                        <constraint firstAttribute="width" constant="16" id="ciC-Bj-H3A"/>
-                                        <constraint firstAttribute="height" constant="16" id="mgN-Mh-p3u"/>
-                                    </constraints>
-                                </button>
-                                <customView translatesAutoresizingMaskIntoConstraints="NO" id="BOi-Jk-fgK">
-                                    <rect key="frame" x="20" y="467" width="755" height="32"/>
-                                    <subviews>
-                                        <box boxType="custom" borderType="none" borderWidth="0.0" cornerRadius="5" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="J8Z-2N-iYK" customClass="KMBox" customModule="PDF_Reader_Pro" customModuleProvider="target">
-                                            <rect key="frame" x="0.0" y="0.0" width="128" height="32"/>
-                                            <view key="contentView" id="DAf-iA-ILp">
-                                                <rect key="frame" x="0.0" y="0.0" width="128" height="32"/>
-                                                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                                <subviews>
-                                                    <customView translatesAutoresizingMaskIntoConstraints="NO" id="1i8-Yd-8jc">
-                                                        <rect key="frame" x="16" y="4" width="96" height="24"/>
-                                                        <subviews>
-                                                            <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="WVa-fY-QHd">
-                                                                <rect key="frame" x="18" y="4" width="80" height="16"/>
-                                                                <textFieldCell key="cell" lineBreakMode="clipping" alignment="center" title="Upload PDF" id="DJK-9a-Q9Q">
-                                                                    <font key="font" metaFont="system"/>
-                                                                    <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                                                                    <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                                                </textFieldCell>
-                                                            </textField>
-                                                            <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="tVK-9N-vBO">
-                                                                <rect key="frame" x="0.0" y="4" width="16" height="16"/>
-                                                                <constraints>
-                                                                    <constraint firstAttribute="height" constant="16" id="Es7-Yk-pND"/>
-                                                                    <constraint firstAttribute="width" constant="16" id="fPM-UM-fRj"/>
-                                                                </constraints>
-                                                                <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="axesIndependently" image="AIChooseFile" id="DU8-aT-FMV"/>
-                                                            </imageView>
-                                                        </subviews>
-                                                        <constraints>
-                                                            <constraint firstItem="WVa-fY-QHd" firstAttribute="leading" secondItem="tVK-9N-vBO" secondAttribute="trailing" constant="4" id="Cga-Gz-OQT"/>
-                                                            <constraint firstAttribute="height" constant="24" id="DoZ-Un-vlQ"/>
-                                                            <constraint firstItem="WVa-fY-QHd" firstAttribute="centerY" secondItem="1i8-Yd-8jc" secondAttribute="centerY" id="Ky9-KX-h9y"/>
-                                                            <constraint firstItem="tVK-9N-vBO" firstAttribute="centerY" secondItem="1i8-Yd-8jc" secondAttribute="centerY" id="TzZ-pd-c0E"/>
-                                                            <constraint firstAttribute="trailing" secondItem="WVa-fY-QHd" secondAttribute="trailing" id="dc8-Eu-l7T"/>
-                                                            <constraint firstItem="tVK-9N-vBO" firstAttribute="leading" secondItem="1i8-Yd-8jc" secondAttribute="leading" id="gZ3-Io-iqE"/>
-                                                        </constraints>
-                                                    </customView>
-                                                    <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="h8f-cp-JuX" customClass="KMButton" customModule="PDF_Reader_Pro" customModuleProvider="target">
-                                                        <rect key="frame" x="0.0" y="0.0" width="128" height="32"/>
-                                                        <buttonCell key="cell" type="bevel" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="YKy-EF-VLO">
-                                                            <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                                                            <font key="font" metaFont="system"/>
-                                                        </buttonCell>
-                                                        <connections>
-                                                            <action selector="chooseFileAction:" target="-2" id="bVE-K0-hm8"/>
-                                                        </connections>
-                                                    </button>
-                                                </subviews>
-                                                <constraints>
-                                                    <constraint firstItem="h8f-cp-JuX" firstAttribute="leading" secondItem="DAf-iA-ILp" secondAttribute="leading" id="HHq-ho-svr"/>
-                                                    <constraint firstItem="1i8-Yd-8jc" firstAttribute="leading" secondItem="DAf-iA-ILp" secondAttribute="leading" constant="16" id="L8X-ZX-HyD"/>
-                                                    <constraint firstAttribute="bottom" secondItem="h8f-cp-JuX" secondAttribute="bottom" id="OaW-NR-xta"/>
-                                                    <constraint firstItem="h8f-cp-JuX" firstAttribute="top" secondItem="DAf-iA-ILp" secondAttribute="top" id="TF5-AE-3OY"/>
-                                                    <constraint firstAttribute="trailing" secondItem="1i8-Yd-8jc" secondAttribute="trailing" constant="16" id="a34-cA-wWz"/>
-                                                    <constraint firstItem="1i8-Yd-8jc" firstAttribute="centerY" secondItem="DAf-iA-ILp" secondAttribute="centerY" id="fAZ-HI-HsJ"/>
-                                                    <constraint firstAttribute="trailing" secondItem="h8f-cp-JuX" secondAttribute="trailing" id="sTt-CT-FVq"/>
-                                                    <constraint firstItem="1i8-Yd-8jc" firstAttribute="centerX" secondItem="DAf-iA-ILp" secondAttribute="centerX" id="wSY-6A-HHN"/>
-                                                </constraints>
-                                            </view>
-                                            <constraints>
-                                                <constraint firstAttribute="height" constant="32" id="AMA-ZI-UOK"/>
-                                            </constraints>
-                                        </box>
-                                    </subviews>
-                                    <constraints>
-                                        <constraint firstItem="J8Z-2N-iYK" firstAttribute="top" secondItem="BOi-Jk-fgK" secondAttribute="top" id="995-f5-i8n"/>
-                                        <constraint firstAttribute="height" constant="32" id="MrD-mm-hnF"/>
-                                        <constraint firstItem="J8Z-2N-iYK" firstAttribute="leading" secondItem="BOi-Jk-fgK" secondAttribute="leading" id="eVa-9Z-R5m"/>
-                                    </constraints>
-                                </customView>
-                                <customView translatesAutoresizingMaskIntoConstraints="NO" id="4Yw-6I-7pH">
-                                    <rect key="frame" x="20" y="458" width="755" height="1"/>
-                                    <constraints>
-                                        <constraint firstAttribute="height" constant="1" id="oLc-6S-iHA"/>
-                                    </constraints>
-                                </customView>
-                                <customView translatesAutoresizingMaskIntoConstraints="NO" id="WzQ-UG-alX">
-                                    <rect key="frame" x="20" y="414" width="755" height="36"/>
-                                    <subviews>
-                                        <customView translatesAutoresizingMaskIntoConstraints="NO" id="Ht2-c4-DeI">
-                                            <rect key="frame" x="0.0" y="0.0" width="77" height="36"/>
-                                            <subviews>
-                                                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="opL-nV-Ip6">
-                                                    <rect key="frame" x="10" y="10" width="37" height="16"/>
-                                                    <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="v77-Bh-0cb">
-                                                        <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>
-                                                <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="OWN-J3-EAy">
-                                                    <rect key="frame" x="49" y="10" width="16" height="16"/>
-                                                    <constraints>
-                                                        <constraint firstAttribute="width" constant="16" id="Pd6-jD-7Q7"/>
-                                                        <constraint firstAttribute="height" constant="16" id="hyy-b8-mkj"/>
-                                                    </constraints>
-                                                    <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="ic_btn_arrow_down" id="UmJ-ZC-Lxj"/>
-                                                </imageView>
-                                                <button translatesAutoresizingMaskIntoConstraints="NO" id="Ugd-ew-8ke">
-                                                    <rect key="frame" x="0.0" y="0.0" width="77" height="36"/>
-                                                    <buttonCell key="cell" type="bevel" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="sn7-Bz-AVr">
-                                                        <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                                                        <font key="font" metaFont="system"/>
-                                                    </buttonCell>
-                                                    <connections>
-                                                        <action selector="chooseLanguageAction:" target="-2" id="3Mz-6k-a2a"/>
-                                                    </connections>
-                                                </button>
-                                            </subviews>
-                                            <constraints>
-                                                <constraint firstItem="OWN-J3-EAy" firstAttribute="centerY" secondItem="Ht2-c4-DeI" secondAttribute="centerY" id="5yd-Cq-2aL"/>
-                                                <constraint firstAttribute="trailing" secondItem="Ugd-ew-8ke" secondAttribute="trailing" id="D2C-hR-txm"/>
-                                                <constraint firstItem="OWN-J3-EAy" firstAttribute="leading" secondItem="opL-nV-Ip6" secondAttribute="trailing" constant="4" id="JKC-Zw-9b0"/>
-                                                <constraint firstItem="Ugd-ew-8ke" firstAttribute="top" secondItem="Ht2-c4-DeI" secondAttribute="top" id="SuB-wX-c69"/>
-                                                <constraint firstItem="opL-nV-Ip6" firstAttribute="centerY" secondItem="Ht2-c4-DeI" secondAttribute="centerY" id="jen-Z0-rPF"/>
-                                                <constraint firstAttribute="bottom" secondItem="Ugd-ew-8ke" secondAttribute="bottom" id="lOR-2i-fMk"/>
-                                                <constraint firstItem="Ugd-ew-8ke" firstAttribute="leading" secondItem="Ht2-c4-DeI" secondAttribute="leading" id="mAD-M4-d5c"/>
-                                                <constraint firstAttribute="trailing" secondItem="OWN-J3-EAy" secondAttribute="trailing" constant="12" id="pTY-Br-AEN"/>
-                                                <constraint firstItem="opL-nV-Ip6" firstAttribute="leading" secondItem="Ht2-c4-DeI" secondAttribute="leading" constant="12" id="sBj-B3-fIC"/>
-                                            </constraints>
-                                        </customView>
-                                        <button translatesAutoresizingMaskIntoConstraints="NO" id="NJ8-8e-0SF">
-                                            <rect key="frame" x="369" y="9" width="18" height="18"/>
-                                            <buttonCell key="cell" type="bevel" bezelStyle="rounded" image="AIchange" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="jRM-u8-FH3">
-                                                <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                                                <font key="font" metaFont="system"/>
-                                            </buttonCell>
-                                            <connections>
-                                                <action selector="languageChangeAction:" target="-2" id="tQL-Vt-Qbz"/>
-                                            </connections>
-                                        </button>
-                                        <customView translatesAutoresizingMaskIntoConstraints="NO" id="AHC-e4-uz8">
-                                            <rect key="frame" x="407" y="0.0" width="77" height="36"/>
-                                            <subviews>
-                                                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="lA6-HV-STg">
-                                                    <rect key="frame" x="10" y="10" width="37" height="16"/>
-                                                    <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="2yX-ow-5PZ">
-                                                        <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>
-                                                <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Fw8-MV-7u7">
-                                                    <rect key="frame" x="49" y="10" width="16" height="16"/>
-                                                    <constraints>
-                                                        <constraint firstAttribute="height" constant="16" id="EMi-Cj-Het"/>
-                                                        <constraint firstAttribute="width" constant="16" id="Wrh-p9-kWV"/>
-                                                    </constraints>
-                                                    <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="ic_btn_arrow_down" id="mZe-Nh-iE1"/>
-                                                </imageView>
-                                                <button translatesAutoresizingMaskIntoConstraints="NO" id="df8-Rm-DcQ">
-                                                    <rect key="frame" x="0.0" y="0.0" width="77" height="36"/>
-                                                    <buttonCell key="cell" type="bevel" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="YoK-Bu-5Sj">
-                                                        <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                                                        <font key="font" metaFont="system"/>
-                                                    </buttonCell>
-                                                    <connections>
-                                                        <action selector="chooseLanguageAction:" target="-2" id="ECN-Gb-ig4"/>
-                                                    </connections>
-                                                </button>
-                                            </subviews>
-                                            <constraints>
-                                                <constraint firstAttribute="trailing" secondItem="Fw8-MV-7u7" secondAttribute="trailing" constant="12" id="0W5-n9-0B4"/>
-                                                <constraint firstAttribute="trailing" secondItem="df8-Rm-DcQ" secondAttribute="trailing" id="26P-6C-AWw"/>
-                                                <constraint firstAttribute="bottom" secondItem="df8-Rm-DcQ" secondAttribute="bottom" id="9uo-Mk-Jue"/>
-                                                <constraint firstItem="Fw8-MV-7u7" firstAttribute="leading" secondItem="lA6-HV-STg" secondAttribute="trailing" constant="4" id="BPg-BR-uKo"/>
-                                                <constraint firstItem="lA6-HV-STg" firstAttribute="leading" secondItem="AHC-e4-uz8" secondAttribute="leading" constant="12" id="Gsw-ja-c1J"/>
-                                                <constraint firstItem="lA6-HV-STg" firstAttribute="centerY" secondItem="AHC-e4-uz8" secondAttribute="centerY" id="UJf-1c-zyQ"/>
-                                                <constraint firstItem="Fw8-MV-7u7" firstAttribute="centerY" secondItem="AHC-e4-uz8" secondAttribute="centerY" id="mKV-K1-3PR"/>
-                                                <constraint firstItem="df8-Rm-DcQ" firstAttribute="leading" secondItem="AHC-e4-uz8" secondAttribute="leading" id="qTh-CQ-qnY"/>
-                                                <constraint firstItem="df8-Rm-DcQ" firstAttribute="top" secondItem="AHC-e4-uz8" secondAttribute="top" id="t5J-tl-No9"/>
-                                            </constraints>
-                                        </customView>
-                                    </subviews>
-                                    <constraints>
-                                        <constraint firstItem="Ht2-c4-DeI" firstAttribute="top" secondItem="WzQ-UG-alX" secondAttribute="top" id="3tT-4d-kK2"/>
-                                        <constraint firstAttribute="height" constant="36" id="Jbk-op-hjN"/>
-                                        <constraint firstItem="Ht2-c4-DeI" firstAttribute="leading" secondItem="WzQ-UG-alX" secondAttribute="leading" id="NOZ-bN-FDK"/>
-                                        <constraint firstAttribute="bottom" secondItem="AHC-e4-uz8" secondAttribute="bottom" id="R5k-oO-Ynk"/>
-                                        <constraint firstItem="NJ8-8e-0SF" firstAttribute="centerY" secondItem="WzQ-UG-alX" secondAttribute="centerY" id="RFa-fN-riD"/>
-                                        <constraint firstItem="AHC-e4-uz8" firstAttribute="leading" secondItem="NJ8-8e-0SF" secondAttribute="trailing" constant="20" id="SJw-Js-c6L"/>
-                                        <constraint firstItem="AHC-e4-uz8" firstAttribute="top" secondItem="WzQ-UG-alX" secondAttribute="top" id="TC3-jJ-OEd"/>
-                                        <constraint firstItem="NJ8-8e-0SF" firstAttribute="centerX" secondItem="WzQ-UG-alX" secondAttribute="centerX" id="q6h-0x-u06"/>
-                                        <constraint firstAttribute="bottom" secondItem="Ht2-c4-DeI" secondAttribute="bottom" id="vvL-j0-00D"/>
-                                    </constraints>
-                                </customView>
-                                <customView translatesAutoresizingMaskIntoConstraints="NO" id="lpm-YO-38e">
-                                    <rect key="frame" x="20" y="66" width="755" height="348"/>
-                                    <subviews>
-                                        <customView translatesAutoresizingMaskIntoConstraints="NO" id="vhY-2U-dEh">
-                                            <rect key="frame" x="0.0" y="0.0" width="372" height="348"/>
-                                            <subviews>
-                                                <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="lXw-Ha-gj9">
-                                                    <rect key="frame" x="146" y="134" width="80" height="80"/>
-                                                    <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="ai_summary_Empty" id="pt0-aG-mtC"/>
-                                                </imageView>
-                                                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="DZZ-c7-BO4">
-                                                    <rect key="frame" x="14" y="237" width="344" height="100"/>
-                                                    <constraints>
-                                                        <constraint firstAttribute="height" constant="100" id="1kI-fu-NOl"/>
-                                                        <constraint firstAttribute="width" constant="340" id="ev0-ec-2L2"/>
-                                                    </constraints>
-                                                    <textFieldCell key="cell" id="lLa-XN-gkv">
-                                                        <font key="font" metaFont="system"/>
-                                                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                                    </textFieldCell>
-                                                </textField>
-                                                <scrollView borderType="none" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" hasVerticalScroller="NO" translatesAutoresizingMaskIntoConstraints="NO" id="KMZ-te-yuU">
-                                                    <rect key="frame" x="12" y="60" width="348" height="276"/>
-                                                    <clipView key="contentView" drawsBackground="NO" id="fkJ-Lh-puY">
-                                                        <rect key="frame" x="0.0" y="0.0" width="348" height="276"/>
-                                                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                                        <subviews>
-                                                            <textView wantsLayer="YES" importsGraphics="NO" richText="NO" verticallyResizable="YES" spellingCorrection="YES" smartInsertDelete="YES" id="oKN-no-DpZ">
-                                                                <rect key="frame" x="0.0" y="0.0" width="348" height="276"/>
-                                                                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                                                <color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
-                                                                <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                                                <size key="minSize" width="348" height="276"/>
-                                                                <size key="maxSize" width="348" height="10000000"/>
-                                                                <color key="insertionPointColor" name="textInsertionPointColor" catalog="System" colorSpace="catalog"/>
-                                                            </textView>
-                                                        </subviews>
-                                                    </clipView>
-                                                    <scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="pxl-ej-oUf">
-                                                        <rect key="frame" x="-100" y="-100" width="225" height="15"/>
-                                                        <autoresizingMask key="autoresizingMask"/>
-                                                    </scroller>
-                                                    <scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="eNA-33-xLv">
-                                                        <rect key="frame" x="-100" y="-100" width="15" height="135"/>
-                                                        <autoresizingMask key="autoresizingMask"/>
-                                                    </scroller>
-                                                </scrollView>
-                                                <customView translatesAutoresizingMaskIntoConstraints="NO" id="m3e-e0-Got">
-                                                    <rect key="frame" x="16" y="60" width="340" height="276"/>
-                                                    <subviews>
-                                                        <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="CK5-9H-oCH" customClass="KMButton" customModule="PDF_Reader_Pro" customModuleProvider="target">
-                                                            <rect key="frame" x="0.0" y="0.0" width="340" height="276"/>
-                                                            <buttonCell key="cell" type="bevel" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="AQd-ya-Kbw">
-                                                                <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                                                                <font key="font" metaFont="system"/>
-                                                            </buttonCell>
-                                                        </button>
-                                                        <customView translatesAutoresizingMaskIntoConstraints="NO" id="bg6-NM-Ulw">
-                                                            <rect key="frame" x="94" y="39" width="152" height="198"/>
-                                                            <subviews>
-                                                                <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="e53-8s-bQz">
-                                                                    <rect key="frame" x="4" y="4" width="144" height="190"/>
-                                                                    <constraints>
-                                                                        <constraint firstAttribute="width" constant="144" id="NcI-w8-tO9"/>
-                                                                        <constraint firstAttribute="height" constant="190" id="gy1-zN-Y6w"/>
-                                                                    </constraints>
-                                                                    <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyUpOrDown" id="PMD-81-9Up"/>
-                                                                </imageView>
-                                                            </subviews>
-                                                            <constraints>
-                                                                <constraint firstItem="e53-8s-bQz" firstAttribute="centerY" secondItem="bg6-NM-Ulw" secondAttribute="centerY" id="M49-Ly-dCF"/>
-                                                                <constraint firstAttribute="width" constant="152" id="QUu-7l-aEm"/>
-                                                                <constraint firstItem="e53-8s-bQz" firstAttribute="centerX" secondItem="bg6-NM-Ulw" secondAttribute="centerX" id="SC0-2E-3L7"/>
-                                                                <constraint firstAttribute="height" constant="198" id="fFd-z7-fOy"/>
-                                                            </constraints>
-                                                        </customView>
-                                                        <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="aMp-WQ-a3z">
-                                                            <rect key="frame" x="92" y="12" width="156" height="16"/>
-                                                            <textFieldCell key="cell" lineBreakMode="truncatingMiddle" alignment="center" title="Label" id="rp2-ri-asc">
-                                                                <font key="font" metaFont="system"/>
-                                                                <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                                                                <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                                            </textFieldCell>
-                                                        </textField>
-                                                        <button translatesAutoresizingMaskIntoConstraints="NO" id="RhY-Ci-lLd">
-                                                            <rect key="frame" x="236" y="227" width="20" height="20"/>
-                                                            <buttonCell key="cell" type="bevel" bezelStyle="rounded" image="aiPDF_Clear" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="bka-vK-Zfi">
-                                                                <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                                                                <font key="font" metaFont="system"/>
-                                                            </buttonCell>
-                                                            <constraints>
-                                                                <constraint firstAttribute="height" constant="20" id="IQ6-ze-7rg"/>
-                                                                <constraint firstAttribute="width" constant="20" id="w5p-ch-f61"/>
-                                                            </constraints>
-                                                            <connections>
-                                                                <action selector="removePDFAction:" target="-2" id="A46-EW-siC"/>
-                                                            </connections>
-                                                        </button>
-                                                    </subviews>
-                                                    <constraints>
-                                                        <constraint firstItem="aMp-WQ-a3z" firstAttribute="leading" secondItem="bg6-NM-Ulw" secondAttribute="leading" id="3sp-VO-c1M"/>
-                                                        <constraint firstItem="CK5-9H-oCH" firstAttribute="top" secondItem="m3e-e0-Got" secondAttribute="top" id="88b-dk-ux5"/>
-                                                        <constraint firstItem="bg6-NM-Ulw" firstAttribute="centerY" secondItem="m3e-e0-Got" secondAttribute="centerY" id="CML-dz-AIw"/>
-                                                        <constraint firstItem="RhY-Ci-lLd" firstAttribute="top" secondItem="bg6-NM-Ulw" secondAttribute="top" constant="-10" id="FJw-cJ-hYZ"/>
-                                                        <constraint firstAttribute="trailing" secondItem="CK5-9H-oCH" secondAttribute="trailing" id="FK3-R5-nVY"/>
-                                                        <constraint firstItem="bg6-NM-Ulw" firstAttribute="centerX" secondItem="m3e-e0-Got" secondAttribute="centerX" id="HsS-Gr-8YW"/>
-                                                        <constraint firstItem="CK5-9H-oCH" firstAttribute="leading" secondItem="m3e-e0-Got" secondAttribute="leading" id="RHv-OR-ULU"/>
-                                                        <constraint firstItem="aMp-WQ-a3z" firstAttribute="top" secondItem="bg6-NM-Ulw" secondAttribute="bottom" constant="11" id="jpb-l1-Hu0"/>
-                                                        <constraint firstItem="aMp-WQ-a3z" firstAttribute="trailing" secondItem="bg6-NM-Ulw" secondAttribute="trailing" id="pt7-CL-xPw"/>
-                                                        <constraint firstAttribute="bottom" secondItem="CK5-9H-oCH" secondAttribute="bottom" id="s4S-52-b1i"/>
-                                                        <constraint firstItem="RhY-Ci-lLd" firstAttribute="trailing" secondItem="bg6-NM-Ulw" secondAttribute="trailing" constant="10" id="uy1-6O-blb"/>
-                                                    </constraints>
-                                                </customView>
-                                                <customView translatesAutoresizingMaskIntoConstraints="NO" id="OCT-gl-vo1">
-                                                    <rect key="frame" x="295" y="12" width="65" height="32"/>
-                                                    <subviews>
-                                                        <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="C3P-7I-hTS">
-                                                            <rect key="frame" x="14" y="8" width="37" height="16"/>
-                                                            <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="Ahn-eI-DNh">
-                                                                <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>
-                                                        <button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="mcI-kL-lCj" customClass="KMButton" customModule="PDF_Reader_Pro" customModuleProvider="target">
-                                                            <rect key="frame" x="0.0" y="0.0" width="65" height="32"/>
-                                                            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                                            <buttonCell key="cell" type="bevel" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="w74-S1-3t7">
-                                                                <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                                                                <font key="font" metaFont="system"/>
-                                                            </buttonCell>
-                                                            <connections>
-                                                                <action selector="startAIFunction:" target="-2" id="PLk-WB-mMc"/>
-                                                            </connections>
-                                                        </button>
-                                                    </subviews>
-                                                    <constraints>
-                                                        <constraint firstAttribute="trailing" secondItem="C3P-7I-hTS" secondAttribute="trailing" constant="16" id="EVZ-Bb-LvS"/>
-                                                        <constraint firstItem="C3P-7I-hTS" firstAttribute="centerX" secondItem="OCT-gl-vo1" secondAttribute="centerX" id="Hdl-f0-IDp"/>
-                                                        <constraint firstItem="C3P-7I-hTS" firstAttribute="centerY" secondItem="OCT-gl-vo1" secondAttribute="centerY" id="bqA-tW-czd"/>
-                                                        <constraint firstAttribute="height" constant="32" id="d6w-aP-UbR"/>
-                                                        <constraint firstItem="C3P-7I-hTS" firstAttribute="leading" secondItem="OCT-gl-vo1" secondAttribute="leading" constant="16" id="xMU-wH-Lq0"/>
-                                                    </constraints>
-                                                </customView>
-                                                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="rLU-to-koS">
-                                                    <rect key="frame" x="10" y="12" width="49" height="16"/>
-                                                    <textFieldCell key="cell" lineBreakMode="clipping" title="0/2000" id="pqg-CL-IlW">
-                                                        <font key="font" metaFont="system"/>
-                                                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                                    </textFieldCell>
-                                                </textField>
-                                                <customView translatesAutoresizingMaskIntoConstraints="NO" id="smB-nJ-vqw">
-                                                    <rect key="frame" x="0.0" y="318" width="372" height="30"/>
-                                                    <subviews>
-                                                        <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="AX0-Vi-q7q">
-                                                            <rect key="frame" x="8" y="8" width="14" height="14"/>
-                                                            <constraints>
-                                                                <constraint firstAttribute="width" constant="14" id="8DN-Kw-f8j"/>
-                                                                <constraint firstAttribute="height" constant="14" id="Rz5-wk-gRG"/>
-                                                            </constraints>
-                                                            <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="ic_else_alert" id="yZT-EO-BZb"/>
-                                                        </imageView>
-                                                        <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="cbF-ht-Wss">
-                                                            <rect key="frame" x="24" y="9" width="232" height="16"/>
-                                                            <textFieldCell key="cell" lineBreakMode="clipping" title="Please upload a file smaller than 10M." id="bJ2-72-Q1x">
-                                                                <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 firstItem="AX0-Vi-q7q" firstAttribute="leading" secondItem="smB-nJ-vqw" secondAttribute="leading" constant="8" id="ILq-eR-WJN"/>
-                                                        <constraint firstItem="cbF-ht-Wss" firstAttribute="leading" secondItem="AX0-Vi-q7q" secondAttribute="trailing" constant="4" id="MIa-xp-HH7"/>
-                                                        <constraint firstItem="AX0-Vi-q7q" firstAttribute="centerY" secondItem="smB-nJ-vqw" secondAttribute="centerY" id="QJU-VH-lYS"/>
-                                                        <constraint firstAttribute="height" constant="30" id="vWZ-Z6-rmi"/>
-                                                        <constraint firstItem="cbF-ht-Wss" firstAttribute="centerY" secondItem="smB-nJ-vqw" secondAttribute="centerY" constant="-2" id="wQC-Ny-mub"/>
-                                                    </constraints>
-                                                </customView>
-                                            </subviews>
-                                            <constraints>
-                                                <constraint firstItem="rLU-to-koS" firstAttribute="leading" secondItem="vhY-2U-dEh" secondAttribute="leading" constant="12" id="16l-Sz-faF"/>
-                                                <constraint firstAttribute="bottom" secondItem="KMZ-te-yuU" secondAttribute="bottom" constant="60" id="2R1-em-foJ"/>
-                                                <constraint firstAttribute="trailing" secondItem="smB-nJ-vqw" secondAttribute="trailing" id="31h-cR-w8M"/>
-                                                <constraint firstItem="lXw-Ha-gj9" firstAttribute="centerX" secondItem="vhY-2U-dEh" secondAttribute="centerX" id="65s-ZH-mNE"/>
-                                                <constraint firstItem="m3e-e0-Got" firstAttribute="leading" secondItem="vhY-2U-dEh" secondAttribute="leading" constant="16" id="FMN-eA-Nzq"/>
-                                                <constraint firstAttribute="bottom" secondItem="m3e-e0-Got" secondAttribute="bottom" constant="60" id="Fxh-8s-Gjt"/>
-                                                <constraint firstAttribute="bottom" secondItem="OCT-gl-vo1" secondAttribute="bottom" constant="12" id="IFO-3q-XwA"/>
-                                                <constraint firstItem="DZZ-c7-BO4" firstAttribute="leading" secondItem="vhY-2U-dEh" secondAttribute="leading" constant="16" id="MKh-u9-YtY"/>
-                                                <constraint firstItem="m3e-e0-Got" firstAttribute="top" secondItem="vhY-2U-dEh" secondAttribute="top" constant="12" id="Ucy-vb-Dmt"/>
-                                                <constraint firstItem="smB-nJ-vqw" firstAttribute="top" secondItem="vhY-2U-dEh" secondAttribute="top" id="YbY-9a-exx"/>
-                                                <constraint firstAttribute="bottom" secondItem="rLU-to-koS" secondAttribute="bottom" constant="12" id="bG6-zC-Jc7"/>
-                                                <constraint firstItem="smB-nJ-vqw" firstAttribute="leading" secondItem="vhY-2U-dEh" secondAttribute="leading" id="cUp-V2-VIc"/>
-                                                <constraint firstItem="KMZ-te-yuU" firstAttribute="leading" secondItem="vhY-2U-dEh" secondAttribute="leading" constant="12" id="dDa-DL-SZk"/>
-                                                <constraint firstItem="lXw-Ha-gj9" firstAttribute="centerY" secondItem="vhY-2U-dEh" secondAttribute="centerY" id="dGT-Wi-ZSW"/>
-                                                <constraint firstItem="DZZ-c7-BO4" firstAttribute="top" secondItem="vhY-2U-dEh" secondAttribute="top" constant="11" id="fJ7-AY-Dar"/>
-                                                <constraint firstAttribute="trailing" secondItem="KMZ-te-yuU" secondAttribute="trailing" constant="12" id="iR4-gn-qX9"/>
-                                                <constraint firstItem="KMZ-te-yuU" firstAttribute="top" secondItem="vhY-2U-dEh" secondAttribute="top" constant="12" id="l3f-24-Tgc"/>
-                                                <constraint firstAttribute="trailing" secondItem="m3e-e0-Got" secondAttribute="trailing" constant="16" id="tFt-2A-grh"/>
-                                                <constraint firstAttribute="trailing" secondItem="OCT-gl-vo1" secondAttribute="trailing" constant="12" id="zB5-G9-gru"/>
-                                            </constraints>
-                                        </customView>
-                                        <customView translatesAutoresizingMaskIntoConstraints="NO" id="DCc-v0-M7o">
-                                            <rect key="frame" x="384" y="0.0" width="371" height="348"/>
-                                            <subviews>
-                                                <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="pfU-N7-nWJ">
-                                                    <rect key="frame" x="145" y="134" width="80" height="80"/>
-                                                    <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="robot-gray" id="5Zz-fU-Fzh"/>
-                                                </imageView>
-                                                <scrollView borderType="none" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" hasVerticalScroller="NO" translatesAutoresizingMaskIntoConstraints="NO" id="SUH-oQ-4P9">
-                                                    <rect key="frame" x="10" y="12" width="350" height="324"/>
-                                                    <clipView key="contentView" drawsBackground="NO" id="SJg-Fh-mPy">
-                                                        <rect key="frame" x="0.0" y="0.0" width="350" height="324"/>
-                                                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                                        <subviews>
-                                                            <textView wantsLayer="YES" importsGraphics="NO" richText="NO" verticallyResizable="YES" spellingCorrection="YES" smartInsertDelete="YES" id="8Pl-WZ-PMg">
-                                                                <rect key="frame" x="0.0" y="0.0" width="350" height="324"/>
-                                                                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                                                <color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
-                                                                <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                                                <size key="minSize" width="350" height="324"/>
-                                                                <size key="maxSize" width="355" height="10000000"/>
-                                                                <color key="insertionPointColor" name="textInsertionPointColor" catalog="System" colorSpace="catalog"/>
-                                                            </textView>
-                                                        </subviews>
-                                                    </clipView>
-                                                    <constraints>
-                                                        <constraint firstAttribute="width" constant="350" id="vHZ-Mc-9uz"/>
-                                                    </constraints>
-                                                    <scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="L27-IV-ltL">
-                                                        <rect key="frame" x="-100" y="-100" width="225" height="15"/>
-                                                        <autoresizingMask key="autoresizingMask"/>
-                                                    </scroller>
-                                                    <scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="hmn-o9-sSd">
-                                                        <rect key="frame" x="-100" y="-100" width="15" height="324"/>
-                                                        <autoresizingMask key="autoresizingMask"/>
-                                                    </scroller>
-                                                </scrollView>
-                                                <customView translatesAutoresizingMaskIntoConstraints="NO" id="te9-qF-hEX">
-                                                    <rect key="frame" x="0.0" y="0.0" width="371" height="348"/>
-                                                    <subviews>
-                                                        <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="E7R-rj-W7B">
-                                                            <rect key="frame" x="153" y="194" width="64" height="64"/>
-                                                            <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="img_licensecode_successful" id="WmM-Ze-ygh"/>
-                                                        </imageView>
-                                                        <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="jww-Dg-L78">
-                                                            <rect key="frame" x="113" y="162" width="144" height="16"/>
-                                                            <textFieldCell key="cell" lineBreakMode="clipping" title="Translation Completion" id="5TX-Gf-Pdd">
-                                                                <font key="font" metaFont="system"/>
-                                                                <color key="textColor" name="labelColor" 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="Ucz-80-lpx">
-                                                            <rect key="frame" x="43" y="122" width="284" height="32"/>
-                                                            <constraints>
-                                                                <constraint firstAttribute="width" constant="280" id="H14-YK-4dP"/>
-                                                            </constraints>
-                                                            <textFieldCell key="cell" alignment="center" title="You can click the &quot;Save as...&quot; button below to save the translated document." id="uf5-4Y-I3O">
-                                                                <font key="font" metaFont="system"/>
-                                                                <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                                                                <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                                            </textFieldCell>
-                                                        </textField>
-                                                    </subviews>
-                                                    <constraints>
-                                                        <constraint firstItem="Ucz-80-lpx" firstAttribute="top" secondItem="jww-Dg-L78" secondAttribute="bottom" constant="8" id="1Yl-0H-mHl"/>
-                                                        <constraint firstItem="jww-Dg-L78" firstAttribute="top" secondItem="E7R-rj-W7B" secondAttribute="bottom" constant="16" id="9Mp-gz-25U"/>
-                                                        <constraint firstItem="Ucz-80-lpx" firstAttribute="centerX" secondItem="te9-qF-hEX" secondAttribute="centerX" id="F1Y-4j-cNe"/>
-                                                        <constraint firstItem="E7R-rj-W7B" firstAttribute="centerX" secondItem="te9-qF-hEX" secondAttribute="centerX" id="XbW-mn-P1R"/>
-                                                        <constraint firstItem="E7R-rj-W7B" firstAttribute="top" secondItem="te9-qF-hEX" secondAttribute="top" constant="90" id="dNi-mc-i8f"/>
-                                                        <constraint firstItem="jww-Dg-L78" firstAttribute="centerX" secondItem="te9-qF-hEX" secondAttribute="centerX" id="mUh-qd-3hE"/>
-                                                    </constraints>
-                                                </customView>
-                                            </subviews>
-                                            <constraints>
-                                                <constraint firstAttribute="bottom" secondItem="te9-qF-hEX" secondAttribute="bottom" id="56h-35-frA"/>
-                                                <constraint firstItem="te9-qF-hEX" firstAttribute="leading" secondItem="DCc-v0-M7o" secondAttribute="leading" id="7xi-YQ-N4g"/>
-                                                <constraint firstItem="SUH-oQ-4P9" firstAttribute="leading" secondItem="DCc-v0-M7o" secondAttribute="leading" constant="10" id="C0S-Pm-lRh"/>
-                                                <constraint firstItem="pfU-N7-nWJ" firstAttribute="centerY" secondItem="DCc-v0-M7o" secondAttribute="centerY" id="IwG-Gt-FZm"/>
-                                                <constraint firstAttribute="bottom" secondItem="SUH-oQ-4P9" secondAttribute="bottom" constant="12" id="OrN-h3-VCZ"/>
-                                                <constraint firstAttribute="trailing" secondItem="te9-qF-hEX" secondAttribute="trailing" id="a3O-gE-xu1"/>
-                                                <constraint firstItem="te9-qF-hEX" firstAttribute="top" secondItem="DCc-v0-M7o" secondAttribute="top" id="eNI-cE-L7S"/>
-                                                <constraint firstItem="SUH-oQ-4P9" firstAttribute="top" secondItem="DCc-v0-M7o" secondAttribute="top" constant="12" id="lkF-ST-9Ju"/>
-                                                <constraint firstItem="pfU-N7-nWJ" firstAttribute="centerX" secondItem="DCc-v0-M7o" secondAttribute="centerX" id="vc3-5f-WEc"/>
-                                            </constraints>
-                                        </customView>
-                                    </subviews>
-                                    <constraints>
-                                        <constraint firstItem="vhY-2U-dEh" firstAttribute="leading" secondItem="lpm-YO-38e" secondAttribute="leading" id="C78-YF-TZJ"/>
-                                        <constraint firstItem="DCc-v0-M7o" firstAttribute="top" secondItem="lpm-YO-38e" secondAttribute="top" id="FsM-dW-seL"/>
-                                        <constraint firstItem="DCc-v0-M7o" firstAttribute="width" secondItem="vhY-2U-dEh" secondAttribute="width" id="IHt-7g-TfE"/>
-                                        <constraint firstItem="vhY-2U-dEh" firstAttribute="width" secondItem="lpm-YO-38e" secondAttribute="width" multiplier="0.5" constant="-6" id="N7p-I8-Tcl"/>
-                                        <constraint firstAttribute="bottom" secondItem="vhY-2U-dEh" secondAttribute="bottom" id="Ssh-xy-VLC"/>
-                                        <constraint firstAttribute="bottom" secondItem="DCc-v0-M7o" secondAttribute="bottom" id="sDK-yE-dO5"/>
-                                        <constraint firstAttribute="trailing" secondItem="DCc-v0-M7o" secondAttribute="trailing" id="uQZ-Ko-z8k"/>
-                                        <constraint firstItem="vhY-2U-dEh" firstAttribute="top" secondItem="lpm-YO-38e" secondAttribute="top" id="xJV-Jv-lio"/>
-                                        <constraint firstAttribute="height" constant="348" id="yJ8-OP-Y2Z"/>
-                                    </constraints>
-                                </customView>
-                                <customView translatesAutoresizingMaskIntoConstraints="NO" id="7wN-h5-0lr">
-                                    <rect key="frame" x="20" y="20" width="755" height="24"/>
-                                    <subviews>
-                                        <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="cjg-NV-eFm">
-                                            <rect key="frame" x="478" y="-5" width="76" height="32"/>
-                                            <buttonCell key="cell" type="push" title="Cancel" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="hfm-qG-k6w">
-                                                <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                                                <font key="font" metaFont="system"/>
-                                                <string key="keyEquivalent" base64-UTF8="YES">
-Gw
-</string>
-                                            </buttonCell>
-                                            <connections>
-                                                <action selector="cancelAction:" target="-2" id="4CX-AE-9eh"/>
-                                            </connections>
-                                        </button>
-                                        <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ZjF-9J-AhT">
-                                            <rect key="frame" x="548" y="-5" width="110" height="32"/>
-                                            <buttonCell key="cell" type="push" title="Save as Text" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="d7G-ML-86a">
-                                                <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                                                <font key="font" metaFont="system"/>
-                                            </buttonCell>
-                                            <connections>
-                                                <action selector="saveAsTextAction:" target="-2" id="Pp0-wK-rfr"/>
-                                            </connections>
-                                        </button>
-                                        <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="e21-Rh-Sls">
-                                            <rect key="frame" x="652" y="-5" width="110" height="32"/>
-                                            <buttonCell key="cell" type="push" title="Save as PDF" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="MAU-sa-AR7">
-                                                <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                                                <font key="font" metaFont="system"/>
-                                            </buttonCell>
-                                            <connections>
-                                                <action selector="saveAsPDFAction:" target="-2" id="M4l-PJ-03U"/>
-                                            </connections>
-                                        </button>
-                                    </subviews>
-                                    <constraints>
-                                        <constraint firstItem="e21-Rh-Sls" firstAttribute="top" secondItem="7wN-h5-0lr" secondAttribute="top" constant="2" id="7xp-Wr-JJs"/>
-                                        <constraint firstItem="ZjF-9J-AhT" firstAttribute="leading" secondItem="cjg-NV-eFm" secondAttribute="trailing" constant="8" id="9WJ-wJ-rTb"/>
-                                        <constraint firstAttribute="bottom" secondItem="e21-Rh-Sls" secondAttribute="bottom" constant="2" id="IIj-os-1Ef"/>
-                                        <constraint firstItem="ZjF-9J-AhT" firstAttribute="centerY" secondItem="7wN-h5-0lr" secondAttribute="centerY" id="OHk-KW-W5T"/>
-                                        <constraint firstAttribute="trailing" secondItem="e21-Rh-Sls" secondAttribute="trailing" id="VCO-6A-cSJ"/>
-                                        <constraint firstItem="cjg-NV-eFm" firstAttribute="centerY" secondItem="7wN-h5-0lr" secondAttribute="centerY" id="ZMm-V7-rs8"/>
-                                        <constraint firstItem="e21-Rh-Sls" firstAttribute="leading" secondItem="ZjF-9J-AhT" secondAttribute="trailing" constant="8" id="xlw-ma-KiI"/>
-                                    </constraints>
-                                </customView>
-                            </subviews>
-                            <constraints>
-                                <constraint firstItem="lpm-YO-38e" firstAttribute="leading" secondItem="5E2-pO-j3A" secondAttribute="leading" constant="20" id="5rO-Ab-aE3"/>
-                                <constraint firstAttribute="bottom" secondItem="7wN-h5-0lr" secondAttribute="bottom" constant="20" id="6MK-uv-QUU"/>
-                                <constraint firstItem="BOi-Jk-fgK" firstAttribute="leading" secondItem="5E2-pO-j3A" secondAttribute="leading" constant="20" id="7gk-LB-Oqc"/>
-                                <constraint firstItem="WzQ-UG-alX" firstAttribute="leading" secondItem="5E2-pO-j3A" secondAttribute="leading" constant="20" id="MDi-SM-p0q"/>
-                                <constraint firstAttribute="trailing" secondItem="lpm-YO-38e" secondAttribute="trailing" constant="20" id="Pcp-HX-ztg"/>
-                                <constraint firstAttribute="trailing" secondItem="4Yw-6I-7pH" secondAttribute="trailing" constant="20" id="Rbb-Vx-HLi"/>
-                                <constraint firstAttribute="trailing" secondItem="7wN-h5-0lr" secondAttribute="trailing" constant="20" id="Uza-Ig-SAG"/>
-                                <constraint firstItem="g9S-q1-kux" firstAttribute="leading" secondItem="wOE-fG-NKH" secondAttribute="trailing" constant="4" id="W8d-5J-Xb0"/>
-                                <constraint firstItem="lpm-YO-38e" firstAttribute="top" secondItem="5E2-pO-j3A" secondAttribute="top" constant="137" id="XIw-1b-L9B"/>
-                                <constraint firstItem="g9S-q1-kux" firstAttribute="centerY" secondItem="wOE-fG-NKH" secondAttribute="centerY" id="YAL-nG-p6S"/>
-                                <constraint firstAttribute="trailing" secondItem="BOi-Jk-fgK" secondAttribute="trailing" constant="20" id="YPi-aI-zo4"/>
-                                <constraint firstItem="7wN-h5-0lr" firstAttribute="leading" secondItem="5E2-pO-j3A" secondAttribute="leading" constant="20" id="YiL-31-rbG"/>
-                                <constraint firstAttribute="trailing" secondItem="WzQ-UG-alX" secondAttribute="trailing" constant="20" id="fn4-Ho-kl7"/>
-                                <constraint firstItem="BOi-Jk-fgK" firstAttribute="top" secondItem="5E2-pO-j3A" secondAttribute="top" constant="52" id="geW-qd-zko"/>
-                                <constraint firstItem="4Yw-6I-7pH" firstAttribute="top" secondItem="BOi-Jk-fgK" secondAttribute="bottom" constant="8" id="kgP-GR-rmV"/>
-                                <constraint firstItem="lpm-YO-38e" firstAttribute="top" secondItem="WzQ-UG-alX" secondAttribute="bottom" id="r0v-6K-OxU"/>
-                                <constraint firstItem="wOE-fG-NKH" firstAttribute="leading" secondItem="5E2-pO-j3A" secondAttribute="leading" constant="20" id="sg5-cE-e0p"/>
-                                <constraint firstItem="wOE-fG-NKH" firstAttribute="top" secondItem="5E2-pO-j3A" secondAttribute="top" constant="20" id="xlz-uE-hFc"/>
-                                <constraint firstItem="4Yw-6I-7pH" firstAttribute="leading" secondItem="5E2-pO-j3A" secondAttribute="leading" constant="20" id="yPY-hA-U9W"/>
-                            </constraints>
-                        </view>
-                    </box>
-                </subviews>
-                <constraints>
-                    <constraint firstItem="2gG-B2-LaH" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" id="Kbo-DB-wFE"/>
-                    <constraint firstAttribute="trailing" secondItem="2gG-B2-LaH" secondAttribute="trailing" id="Ley-a3-irE"/>
-                    <constraint firstAttribute="bottom" secondItem="2gG-B2-LaH" secondAttribute="bottom" id="Zwu-u3-ZhH"/>
-                    <constraint firstItem="2gG-B2-LaH" firstAttribute="top" secondItem="se5-gp-TjO" secondAttribute="top" id="csr-Tq-5cd"/>
-                </constraints>
-            </view>
-            <connections>
-                <outlet property="delegate" destination="-2" id="0bl-1N-AYu"/>
-            </connections>
-            <point key="canvasLocation" x="129.5" y="-56.5"/>
-        </window>
-    </objects>
-    <resources>
-        <image name="AIChooseFile" width="16" height="16"/>
-        <image name="AIchange" width="18" height="18"/>
-        <image name="aiPDF_Clear" width="17" height="17"/>
-        <image name="ai_summary_Empty" width="80" height="80"/>
-        <image name="ic_btn_arrow_down" width="11" height="11"/>
-        <image name="ic_else_alert" width="14" height="14"/>
-        <image name="ic_else_info_large" width="14" height="14"/>
-        <image name="img_licensecode_successful" width="64" height="64"/>
-        <image name="robot-gray" width="80" height="80"/>
-    </resources>
-</document>

+ 0 - 18
PDF Office/PDF Master/Class/Batch/Catogary/NSArray+Extension.swift

@@ -1,18 +0,0 @@
-//
-//  NSArray+Extension.swift
-//  PDF Reader Pro
-//
-//  Created by kdanmobile on 2023/10/27.
-//
-
-import Foundation
-
-
-extension NSArray{
-    func removeObjects(arr:[Any], set: IndexSet) -> [Any] {
-        var newArr: NSMutableArray = arr as! NSMutableArray
-//        let removeA = newArr.objects(at: set)
-        newArr.removeObjects(at: set)
-        return newArr as! [Any]
-    }
-}

+ 0 - 66
PDF Office/PDF Master/Class/Batch/Catogary/NSButton+CustomAppearance.swift

@@ -1,66 +0,0 @@
-//
-//  NSButton+CustomAppearance.swift
-//  PDF Reader Pro
-//
-//  Created by kdanmobile on 2023/10/26.
-//
-
-import Foundation
-
-let NSButtonAddHoverKey = "NSButtonAddHoverKey"
-let NSButtonTrackingAreaKey = "NSButtonTrackingAreaKey"
-var placeholderImage: NSImage?
-
-extension NSButton{
-    var addHoverEffect: Bool {
-        get {
-            return (objc_getAssociatedObject(self, NSButtonAddHoverKey) as? NSNumber)?.boolValue ?? false
-        }
-        set {
-            removeTrackingArea(self.neededTrackingArea ?? NSTrackingArea())
-            if newValue {
-                addNewTrackingArea()
-            }
-            objc_setAssociatedObject(self, NSButtonAddHoverKey, NSNumber(value: newValue), .OBJC_ASSOCIATION_RETAIN)
-        }
-    }
-    var neededTrackingArea: NSTrackingArea? {
-        get {
-            return objc_getAssociatedObject(self, NSButtonTrackingAreaKey) as? NSTrackingArea
-        }
-        set {
-            objc_setAssociatedObject(self, NSButtonTrackingAreaKey, newValue, .OBJC_ASSOCIATION_RETAIN)
-        }
-    }
-    func addNewTrackingArea() {
-        self.wantsLayer = true
-        let trackingArea = NSTrackingArea(rect: self.bounds, options: [.mouseEnteredAndExited, .inVisibleRect, .activeAlways], owner: self, userInfo: nil)
-        self.addTrackingArea(trackingArea)
-        self.neededTrackingArea = trackingArea
-    }
-    open override func mouseExited(with event: NSEvent) {
-        super.mouseExited(with: event)
-        if self.addHoverEffect {
-            if !self.isEnabled {
-                return
-            }
-            if (self.image != nil) && (self.alternateImage != nil) {
-                self.alternateImage = self.image
-                self.image = placeholderImage
-            }
-        }
-    }
-    
-    open override func mouseEntered(with event: NSEvent) {
-        super.mouseEntered(with: event)
-        if self.addHoverEffect {
-            if !self.isEnabled {
-                return
-            }
-            if (self.image != nil) && (self.alternateImage != nil) {
-                placeholderImage = self.image
-                self.image = self.alternateImage
-            }
-        }
-    }
-}

+ 0 - 295
PDF Office/PDF Master/Class/Batch/Data/KMBatchBaseParameter.swift

@@ -1,295 +0,0 @@
-//
-//  KMBatchBaseParameter.swift
-//  PDF Reader Pro
-//
-//  Created by kdanmobile on 2023/10/25.
-//
-
-import Cocoa
-
-@objcMembers class KMBatchBaseParameter: NSObject{
-    var error: NSError?
-    var operateFile: KMBatchOperateFile?
-    var pageChoice: KMBatchOperatePageChoice = .All {
-        willSet{
-           
-        }
-        didSet {
-            if pageChoice != oldValue {
-                self.localPagesArray = nil
-            }
-        }
-    }
-    var pageRangeString: String? {
-        willSet{
-           
-        }
-        didSet {
-            if pageRangeString != oldValue {
-                self.localPagesArray = nil
-            }
-        }
-    }
-    var progress: Float?
-    var status: KMBatchOperateStatus = .Waiting
-    var savePath: String?
-    var outPutPath: String?
-    var pagesArray: [NSNumber]? {
-        if self.localPagesArray == nil {
-            self.localPagesArray = self.fetchUnlimitPagesArray()
-        }
-        return self.localPagesArray
-    }
-    private var localPagesArray: [NSNumber]?
-    
-    private var _doc: CPDFDocument?
-    
-    init(file:KMBatchOperateFile) {
-        super.init()
-        self.operateFile = file
-    }
-    
-    func fetchUnlimitPagesArray() -> [NSNumber]? {
-        var document = self._doc
-        if document == nil { // 优化重复创建
-            document = CPDFDocument(url: URL(fileURLWithPath: self.operateFile?.filePath ?? ""))
-            self._doc = document
-        }
-        if let data = document?.isLocked, data { // 加锁的话,需要解锁
-            if let data = self.operateFile?.password, data.isEmpty == false {
-                document?.unlock(withPassword: data)
-            }
-        }
-        let pageNumber = document?.pageCount ?? 0
-        if pageNumber <= 0 { // 容错判断
-            return nil
-        }
-        if self.pageChoice == .All {
-            var selectPages: [NSNumber] = []
-            for i in 1...pageNumber {
-                selectPages.append(NSNumber(integerLiteral: Int(i)))
-            }
-            return selectPages
-        } else if self.pageChoice == .Odd {
-            var selectPages: [NSNumber] = []
-            for i in stride(from: 1, through: pageNumber, by: 2) {
-                selectPages.append(NSNumber(integerLiteral: Int(i)))
-            }
-            return selectPages
-        } else if self.pageChoice == .Even {
-            var selectPages: [NSNumber] = []
-            for i in stride(from: 2, through: pageNumber, by: 2) {
-                selectPages.append(NSNumber(integerLiteral: Int(i)))
-            }
-            return selectPages
-        } else {
-            var pageNumbers: [NSNumber] = []
-            var isInvalid = false
-            if self.pageRangeString?.count ?? 0 > 0{
-                for c in self.pageRangeString! {
-                    if c != "0" && c != "1" && c != "2" && c != "3" && c != "4" && c != "5" && c != "6" && c != "7" && c != "8" && c != "9" && c != "," && c != "-" {
-                        isInvalid = true
-                        break
-                    } else {
-                        isInvalid = false
-                    }
-                }
-            }
-            if !isInvalid {
-                if self.pageRangeString == nil {
-                    return nil
-                }
-                if let data = self.pageRangeString?.isEmpty, data { // 数据错误
-                    return nil
-                }
-                
-                let array = self.pageRangeString!.components(separatedBy: ",")
-                for s in array {
-                    if s.isEmpty {
-                        isInvalid = true
-                        break
-                    } else {
-                        let pages = s.components(separatedBy: "-")
-                        if pages.count > 2 {
-                            isInvalid = true
-                            break
-                        } else if pages.count == 1 {
-                            let p = pages[0]
-                            if p.isEmpty || Int(p)! > pageNumber || Int(p)! == 0 {
-                                isInvalid = true
-                                break
-                            } else {
-                                var isEqual = false
-                                for pageNumber in pageNumbers {
-                                    if pageNumber.intValue == Int(p)! {
-                                        isEqual = true
-                                        isInvalid = true
-                                        break
-                                    }
-                                }
-                                if !isEqual {
-                                    pageNumbers.append(NSNumber(integerLiteral: Int(p)!))
-                                }
-                            }
-                        } else if pages.count == 2 {
-                            let p1 = pages[0]
-                            let p2 = pages[1]
-                            if p1.isEmpty || p2.isEmpty || Int(p1)! >= Int(p2)! || Int(p2)! > pageNumber || Int(p1)! == 0 {
-                                isInvalid = true
-                                break
-                            } else {
-                                var isEqual = false
-                                for i in Int(p1)!...Int(p2)! {
-                                    for pageNumber in pageNumbers {
-                                        if pageNumber.intValue == i {
-                                            isEqual = true
-                                            isInvalid = true
-                                            break
-                                        }
-                                    }
-                                }
-                                if !isEqual {
-                                    for i in Int(p1)!...Int(p2)! {
-                                        pageNumbers.append(NSNumber(integerLiteral: i))
-                                    }
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-            if isInvalid {
-                return nil
-            }
-            let tmpArray = NSMutableArray(array: pageNumbers)
-            QuickSort(list: tmpArray, startIndex: 0, endIndex: pageNumbers.count - 1)
-            return tmpArray as? [NSNumber]
-        }
-    }
-    
-    func QuickSort(list: NSMutableArray, startIndex: NSInteger, endIndex: NSInteger) {
-        if startIndex >= endIndex {
-            return
-        }
-        let temp = list[startIndex] as! NSNumber
-        var tempIndex = startIndex
-        
-        for i in (startIndex + 1)...endIndex {
-            let t = list[i] as! NSNumber
-            if temp.intValue > t.intValue {
-                tempIndex = tempIndex + 1
-                list.exchangeObject(at: tempIndex, withObjectAt: i)
-            }
-        }
-        
-        list.exchangeObject(at: tempIndex, withObjectAt: startIndex)
-        QuickSort(list: list, startIndex: startIndex, endIndex: tempIndex-1)
-        QuickSort(list: list, startIndex: tempIndex+1, endIndex: endIndex)
-    }
-    
-    func getUniqueFilePath(filePath: String) -> String {
-        var i = 0
-        var isDirectory = ObjCBool(false)
-        var uniqueFilePath = filePath
-        let fileManager = FileManager.default
-        fileManager.fileExists(atPath: uniqueFilePath, isDirectory: &isDirectory)
-        if isDirectory.boolValue {
-            while fileManager.fileExists(atPath: uniqueFilePath) {
-                i += 1
-                uniqueFilePath = "\(filePath)(\(i))"
-            }
-        } else {
-            while fileManager.fileExists(atPath: uniqueFilePath) {
-                i += 1
-                var path = "\(filePath.deletingPathExtension)(\(i))"
-//                uniqueFilePath = path.stringByAppendingPathComponent(filePath.extension)
-//                path.append(".")
-                path.append(filePath.extension)
-                uniqueFilePath = path
-            }
-        }
-        
-        return uniqueFilePath
-    }
-    
-    func resetState() {
-        status = .Waiting
-        progress = 0
-        error = nil
-        savePath = nil
-        outPutPath = nil
-    }
-    func fetchDestinationFilepath() -> String? {
-        if self.isEqual(self.operateFile?.convertInfo) {
-            // 在子类重写了这个方法,这里永远不会调用,所以不需要写
-        } else if self.isEqual(self.operateFile?.addPasswordInfo) {
-            if self.savePath?.count ?? 0 > 0 && self.operateFile?.filePath.count ?? 0 > 0 {
-                let filePath1 =  self.savePath?.stringByAppendingPathComponent(self.operateFile!.filePath.getLastComponentDeleteExtension + "_SetPassword")
-                self.outPutPath = self.getUniqueFilePath(filePath: filePath1!.stringByAppendingPathExtension("pdf"))
-                return self.outPutPath
-            }
-        } else if self.isEqual(self.operateFile?.removePasswordInfo) {
-            if self.savePath?.count ?? 0 > 0 && self.operateFile?.filePath.count ?? 0 > 0 {
-                let filePath1 =  self.savePath?.stringByAppendingPathComponent(self.operateFile!.filePath.getLastComponentDeleteExtension + "_RemovePassword")
-                self.outPutPath = self.getUniqueFilePath(filePath: filePath1!.stringByAppendingPathExtension("pdf"))
-                return self.outPutPath
-            }
-        } else if self.isEqual(self.operateFile?.addWatermarkInfo) {
-            if self.savePath?.count ?? 0 > 0 && self.operateFile?.filePath.count ?? 0 > 0 {
-                let filePath1 =  self.savePath?.stringByAppendingPathComponent(self.operateFile!.filePath.getLastComponentDeleteExtension + "_Watermark")
-                self.outPutPath = self.getUniqueFilePath(filePath: filePath1!.stringByAppendingPathExtension("pdf"))
-                return self.outPutPath
-            }
-        } else if self.isEqual(self.operateFile?.removeWatermarkInfo) {
-            if self.savePath?.count ?? 0 > 0 && self.operateFile?.filePath.count ?? 0 > 0 {
-                let filePath1 =  self.savePath?.stringByAppendingPathComponent(self.operateFile!.filePath.getLastComponentDeleteExtension + "_RemoveWatermark")
-                self.outPutPath = self.getUniqueFilePath(filePath: filePath1!.stringByAppendingPathExtension("pdf"))
-                return self.outPutPath
-            }
-        } else if self.isEqual(self.operateFile?.addBackgroundInfo) {
-            if self.savePath?.count ?? 0 > 0 && self.operateFile?.filePath.count ?? 0 > 0 {
-                let filePath1 =  self.savePath?.stringByAppendingPathComponent(self.operateFile!.filePath.getLastComponentDeleteExtension + "_AddBackground")
-                self.outPutPath = self.getUniqueFilePath(filePath: filePath1!.stringByAppendingPathExtension("pdf"))
-                return self.outPutPath
-            }
-        } else if self.isEqual(self.operateFile?.removeBackgroundInfo) {
-            if self.savePath?.count ?? 0 > 0 && self.operateFile?.filePath.count ?? 0 > 0 {
-                let filePath1 =  self.savePath?.stringByAppendingPathComponent(self.operateFile!.filePath.getLastComponentDeleteExtension + "_RemoveBackground")
-                self.outPutPath = self.getUniqueFilePath(filePath: filePath1!.stringByAppendingPathExtension("pdf"))
-                return self.outPutPath
-            }
-        } else if self.isEqual(self.operateFile?.addHeaderFooterInfo) {
-            if self.savePath?.count ?? 0 > 0 && self.operateFile?.filePath.count ?? 0 > 0 {
-                let filePath1 =  self.savePath?.stringByAppendingPathComponent(self.operateFile!.filePath.getLastComponentDeleteExtension + "_AddHeaderFooter")
-                self.outPutPath = self.getUniqueFilePath(filePath: filePath1!.stringByAppendingPathExtension("pdf"))
-                return self.outPutPath
-            }
-        } else if self.isEqual(self.operateFile?.removeHeaderFooterInfo) {
-            if self.savePath?.count ?? 0 > 0 && self.operateFile?.filePath.count ?? 0 > 0 {
-                let filePath1 =  self.savePath?.stringByAppendingPathComponent(self.operateFile!.filePath.getLastComponentDeleteExtension + "_RemoveHeaderFooter")
-                self.outPutPath = self.getUniqueFilePath(filePath: filePath1!.stringByAppendingPathExtension("pdf"))
-                return self.outPutPath
-            }
-        } else if self.isEqual(self.operateFile?.addBatesInfo) {
-            if self.savePath?.count ?? 0 > 0 && self.operateFile?.filePath.count ?? 0 > 0 {
-                let filePath1 =  self.savePath?.stringByAppendingPathComponent(self.operateFile!.filePath.getLastComponentDeleteExtension + "_AddBates")
-                self.outPutPath = self.getUniqueFilePath(filePath: filePath1!.stringByAppendingPathExtension("pdf"))
-                return self.outPutPath
-            }
-        } else if self.isEqual(self.operateFile?.removeBatesInfo) {
-            if self.savePath?.count ?? 0 > 0 && self.operateFile?.filePath.count ?? 0 > 0 {
-                let filePath1 =  self.savePath?.stringByAppendingPathComponent(self.operateFile!.filePath.getLastComponentDeleteExtension + "_RemoveBates")
-                self.outPutPath = self.getUniqueFilePath(filePath: filePath1!.stringByAppendingPathExtension("pdf"))
-                return self.outPutPath
-            }
-        } else if self.isEqual(self.operateFile?.compressInfo) {
-            if self.savePath?.count ?? 0 > 0 && self.operateFile?.filePath.count ?? 0 > 0 {
-              
-                let filePath1 =  self.savePath?.stringByAppendingPathComponent(self.operateFile!.filePath.getLastComponentDeleteExtension + "_Compressed")
-                self.outPutPath = self.getUniqueFilePath(filePath: filePath1!.stringByAppendingPathExtension("pdf"))
-                return self.outPutPath
-            }
-        }
-        return nil
-    }
-}

+ 0 - 160
PDF Office/PDF Master/Class/Batch/Data/KMBatchConvertParameter.swift

@@ -1,160 +0,0 @@
-//
-//  KMBatchConvertParameter.swift
-//  PDF Reader Pro
-//
-//  Created by kdanmobile on 2023/10/25.
-//
-
-import Cocoa
-
-class KMBatchConvertParameter: KMBatchBaseParameter {
-    var convertType: KMConvertWithPDFType?
-    var allInOneSheet: Bool? // FP转excel用
-    var isExtreactTabel: Bool? // Com_converter 转excel用
-    var isRetainLayout: Bool? // NO 为流排
-
-    var dpi: Int? // 转图片用
-//    var extensionString: String = "" // FP方式转换需要用到
-    var excelContentOption: CPDFConvertExcelContentOptions?
-    var excelWorksheetOption: CPDFConvertExcelWorksheetOptions?
-    
-    // 是否使用OCR
-    var isAllowOCR = false
-    var ocrLanguage: COCRLanguage?
-    
-    override init(file:KMBatchOperateFile) {
-        super.init(file: file)
-        self.dpi = 150
-    }
-    func extensionString() -> String? {
-        var rtString: String? = nil
-        if self.convertType == .WordStandard || self.convertType == .WordAdvance {
-            rtString = "docx"
-        } else if self.convertType == .Excel {
-            rtString = "xlsx"
-        } else if self.convertType == .PowerPoint {
-            rtString = "pptx"
-        } else if self.convertType == .RTF {
-            rtString = "rtf"
-        } else if self.convertType == .CSV {
-            rtString = "csv"
-        } else if self.convertType == .HTML {
-            rtString = "html"
-        } else if self.convertType == .Text {
-            rtString = "txt"
-        } else if self.convertType == .JPEG {
-            rtString = "jpeg"
-        } else if self.convertType == .JPG {
-            rtString = "jpg"
-        } else if self.convertType == .PNG {
-            rtString = "png"
-        } else if self.convertType == .GIF {
-            rtString = "gif"
-        } else if self.convertType == .TGA {
-            rtString = "tga"
-        } else if self.convertType == .BMP {
-            rtString = "bmp"
-        } else if self.convertType == .TIFF {
-            rtString = "tiff"
-        } else if self.convertType == .JPEG2000 {
-            rtString = "jp2"
-        } else if self.convertType == .Json {
-            rtString = "json"
-        }
-        return rtString
-    }
-    override func fetchDestinationFilepath() -> String? {
-        if self.savePath?.count ?? 0 > 0 && self.operateFile?.filePath.count ?? 0 > 0{
-            if self.convertType == .JPEG || self.convertType == .CSV || self.convertType == .JPG  || self.convertType == .PNG || self.convertType == .GIF || self.convertType == .TIFF || self.convertType == .TGA || self.convertType == .BMP || self.convertType == .JPEG2000{
-                self.outPutPath = self.getUniqueFilePath(filePath: self.savePath!.stringByAppendingPathComponent(self.operateFile!.filePath.deletingPathExtension.lastPathComponent))
-                if self.operateFile?.CSVParameter.isExtreactTabel ?? false {
-                    self.outPutPath = (self.outPutPath! as NSString).appendingPathExtension("zip")
-                    self.outPutPath = self.getUniqueFilePath(filePath: self.outPutPath ?? "")
-                }
-                return self.outPutPath
-            } else if self.convertType == .WordStandard || self.convertType == .WordAdvance || self.convertType == .Excel || self.convertType == .PowerPoint || self.convertType == .RTF || self.convertType == .HTML || self.convertType == .Text || self.convertType == .Json {
-                let filePath1 = self.savePath?.stringByAppendingPathComponent(self.operateFile!.filePath.getLastComponentDeleteExtension)
-                self.outPutPath = self.getUniqueFilePath(filePath: filePath1!.stringByAppendingPathExtension(self.extensionString()!))
-                return self.outPutPath
-            }
-        }
-        return nil
-    }
-    override var outPutPath: String? {
-        set {
-            super.outPutPath = newValue
-        }
-        get {
-            let existOutPutPath = super.outPutPath
-            if ((existOutPutPath?.isEmpty) != nil){
-                if ((self.savePath?.isEmpty) == nil) && ((self.operateFile?.filePath.isEmpty) == nil) {
-                    if self.convertType == .JPEG || self.convertType == .CSV || self.convertType == .JPG || self.convertType == .PNG || self.convertType == .GIF || self.convertType == .TIFF || self.convertType == .TGA || self.convertType == .BMP || self.convertType == .JPEG2000{
-                        return self.getUniqueFilePath(filePath: self.savePath!.stringByAppendingPathComponent(self.operateFile!.filePath.lastPathComponent.deletingPathExtension))
-                    } else if self.convertType == .WordStandard ||
-                                self.convertType == .WordAdvance ||
-                                self.convertType == .Excel ||
-                                self.convertType == .PowerPoint ||
-                                self.convertType == .RTF ||
-                                self.convertType == .HTML ||
-                                self.convertType == .Text || self.convertType == .Json {
-                        let filePath1 = self.savePath!.stringByAppendingPathComponent(self.operateFile!.filePath.lastPathComponent.deletingPathExtension)
-                        return self.getUniqueFilePath(filePath: filePath1.stringByAppendingPathExtension(self.extensionString()!))
-                    }
-                }
-            }
-            return super.outPutPath
-        }
-    }
-
-    override var pagesArray: [NSNumber]? {
-        let fullpagesArray = fetchUnlimitPagesArray()
-        var isLimitConvert = false
-#if VERSION_FREE
-        //         桌机版
-        if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
-            isLimitConvert = false
-        } else {
-            if .PNG == self.convertType ||
-                .JPEG == self.convertType ||
-                .JPG == self.convertType ||
-                .HTML == self.convertType ||
-                .Text == self.convertType ||
-                .WordStandard == self.convertType {
-                isLimitConvert = false
-            } else {
-                isLimitConvert = true
-            }
-        }
-#else
-        //         付费版
-        if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
-            isLimitConvert = false
-        } else {
-            if .PNG == self.convertType ||
-                .JPEG == self.convertType ||
-                .JPG == self.convertType ||
-                .HTML == self.convertType ||
-                .Text == self.convertType ||
-                .WordStandard == self.convertType {
-                isLimitConvert = false
-            } else {
-                isLimitConvert = true
-            }
-        }
-#endif
-        
-        if isLimitConvert {
-            if let cnt = fullpagesArray?.count, cnt > 10 {
-                var newArr: [NSNumber] = []
-                for i in 0 ..< 10 {
-                    let item = fullpagesArray![i]
-                    newArr.append(item)
-                }
-                return newArr
-            } else {
-                return fullpagesArray
-            }
-        }
-        return fullpagesArray
-    }
-}

+ 0 - 39
PDF Office/PDF Master/Class/Batch/Data/KMBatchOperateManager.swift

@@ -1,39 +0,0 @@
-//
-//  KMBatchOperateManager.swift
-//  PDF Reader Pro
-//
-//  Created by kdanmobile on 2023/11/2.
-//
-
-import Foundation
-
-class KMBatchOperateManager: NSObject{
-    var files: [KMBatchOperateFile]?
-    var currentType: KMBatchOperationType?{
-        willSet{
-            
-        }
-        didSet {
-            if currentType != oldValue {
-                if ((self.files?.isEmpty) != nil){
-                    return
-                }
-                for i in 0..<self.files!.count {
-                    let file = self.files![i]
-                    if file.currentOperateType != self.currentType {
-                        file.currentOperateType = self.currentType
-                    }
-                }
-            }
-        }
-    }
-        
-    static let defaultManager: KMBatchOperateManager = {
-        let manager = KMBatchOperateManager()
-        manager.files = (NSMutableArray() as! [KMBatchOperateFile])
-        manager.currentType = .Convert
-        return manager
-    }()
-    
-    
-}

+ 0 - 47
PDF Office/PDF Master/Class/Batch/Data/KMImageModel.swift

@@ -1,47 +0,0 @@
-//
-//  KMImageModel.swift
-//  PDF Reader Pro
-//
-//  Created by liujiajie on 2023/12/5.
-//
-
-import Foundation
-
-func moniker(x: Float) -> String {
-    if x > 1048576 {
-        return "G"
-    }else if x >= 1024 {
-        return "M"
-    }else{
-        return "K"
-    }
-}
-
-func truesize(x: Float) -> Float {
-    if x > 1048576 {
-        return x / 1048576.0
-    }else if x >= 1024 {
-        return x / 1024.0
-    }else{
-        return x
-    }
-}
-
-class KMImageModel: NSObject{
-    var photoPath: String = ""
-    var photoName: String = ""
-    var photoSize: String = ""
-    var photoScale: String = ""
-    
-    init(filepath: String) {
-        super.init()
-        self.photoPath = filepath
-        let attributesDic = try? FileManager.default.attributesOfItem(atPath: filepath)
-        let fileSize = attributesDic?[FileAttributeKey.size] as? Float ?? 0
-        let size = fileSize/1024.0
-        self.photoSize = String(format: "%.1f %@", truesize(x: size), moniker(x: size))
-        self.photoName = filepath.lastPathComponent
-        let img = NSImage(contentsOfFile: filepath)
-        self.photoScale = String(format: "%.0f x %.0f", img?.size.width ?? 0, img?.size.height ?? 0)
-    }
-}

+ 0 - 383
PDF Office/PDF Master/Class/Batch/Operation/KMBatchConvertOperation.swift

@@ -1,383 +0,0 @@
-//
-//  KMBatchConvertOperation.swift
-//  PDF Reader Pro
-//
-//  Created by liujiajie on 2023/11/28.
-//
-
-import Foundation
-
-@objc enum KMConvertWay: Int {
-    case KM = 0
-    case FP
-}
-
-class KMBatchConvertOperation: KMBatchOperation, CPDFConverterDelegate, CPDFConverterFPDelegate{
-    lazy var convertWay: KMConvertWay = {
-        let way: KMConvertWay?
-        if self.operateFile?.convertType == .WordStandard {
-            way = .KM
-        } else {
-            way = .FP
-        }
-        return way!
-    }()
-    var fpPDFConverter: CPDFConverterFP?
-    var converter: CPDFConverter?
-    var pdfDocument: CPDFDocument?
-    var isAllInOneSheet: Bool = false
-    
-    // 是否使用OCR
-    var isAllowOCR = false
-    var ocrLanguage: COCRLanguage?
-    
-    deinit {
-        
-    }
-    
-    init(file: KMBatchOperateFile, convertType: KMConvertWithPDFType) {
-        super.init(file: file)
-        self.operateFile?.convertType = convertType
-        self.hasExcuting = false
-        self.hasFinished = false
-//        self.pdfDocument = CPDFDocument(url: URL(fileURLWithPath: file.filePath))
-//        if ((self.pdfDocument?.isLocked) != nil) {
-//            self.pdfDocument?.unlock(withPassword: file.password)
-//        }
-    }
-    
-    override func start() {
-        if !self.isCancelled {
-            self.pdfDocument = CPDFDocument(url: URL(fileURLWithPath: self.operateFile?.filePath ?? ""))
-            if let data = self.pdfDocument?.isLocked, data {
-                self.pdfDocument?.unlock(withPassword: self.operateFile?.password)
-            }
-            willChangeValue(forKey: "isExecuting")
-            self.hasExcuting = true
-            didChangeValue(forKey: "isExecuting")
-            if !FileManager.default.fileExists(atPath: self.operateFile?.filePath ?? "") {
-                self.delegate?.fileOperateFailed?(self.operateFile!, error: self.errorWithMsg(KMLocalizedString("File Not Exist")), info: self.operateFile!.removePasswordInfo)
-                
-                self.willChangeValue(forKey: "isFinished")
-                self.hasFinished = true
-                self.didChangeValue(forKey: "isFinished")
-                return
-            }
-
-            if self.pdfDocument == nil {
-                self.delegate?.fileOperateFailed?(self.operateFile!, error: self.errorWithMsg(KMLocalizedString("An error occurred while opening this document. The file is damaged and could not be repaired.")), info: self.operateFile!.removeWatermarkInfo)
-                self.willChangeValue(forKey: "isFinished")
-                self.hasFinished = true
-                self.didChangeValue(forKey: "isFinished")
-                return
-            }
-
-            if !self.pdfDocument!.allowsPrinting || !self.pdfDocument!.allowsCopying {
-                self.delegate?.fileOperateFailed?(self.operateFile!, error: self.errorWithMsg(KMLocalizedString("This is a secured document. Editing is not permitted.")), info: self.operateFile!.removeWatermarkInfo)
-                self.willChangeValue(forKey: "isFinished")
-                self.hasFinished = true
-                self.didChangeValue(forKey: "isFinished")
-                return
-            }
-            self.operateFile?.outputFilePath = (self.operateFile?.currentConvertParameter?.fetchDestinationFilepath()) ?? ""
-           
-            if self.operateFile?.currentConvertParameter?.pagesArray?.count ?? 0 < 1 {
-                let error = NSError(domain: "LocalError", code: 0, userInfo: [NSLocalizedDescriptionKey: KMLocalizedString("Invalid page range or the page number is out of range. Please try again.")])
-                self.delegate?.fileOperateFailed?(self.operateFile!, error: error, info: self.operateFile!.currentConvertParameter!)
-                self.willChangeValue(forKey: "isFinished")
-                self.hasFinished = true
-                self.didChangeValue(forKey: "isFinished")
-                return
-            }
-            if self.operateFile?.convertType == .WordAdvance || self.operateFile?.convertType == .WordStandard {
-                self.converter = CPDFConverterWord.init(url: URL(fileURLWithPath: operateFile?.filePath ?? ""), password: operateFile?.password)
-                self.converter!.delegate = self
-                let options = CPDFConvertWordOptions()
-                options.layoutOptions = self.operateFile?.advanceWordParameter.isRetainLayout ?? false ? .retainPageLayout : .retainFlowingText
-                options.isContainAnnotations = true
-                options.isContainImages = true
-                
-                options.isAllowOCR = self.isAllowOCR
-                if (self.isAllowOCR) {
-                    options.isContainOCRBgImage = true
-                    options.isAILayoutAnalysis = true
-                    if let language = self.ocrLanguage {
-                        options.language = language
-                    } else {
-                        options.language = .english
-                    }
-                } else {
-                    options.isContainOCRBgImage = false
-                    options.isAILayoutAnalysis = false
-                }
-                
-                self.converter!.convert(toFilePath: operateFile!.outputFilePath, pageIndexs: operateFile?.currentConvertParameter?.pagesArray, options: options)
-                return
-            }
-            if self.operateFile?.convertType == .Excel {
-                self.converter = CPDFConverterExcel.init(url: URL(fileURLWithPath: operateFile?.filePath ?? ""), password: operateFile?.password)
-                self.converter!.delegate = self
-                let options = CPDFConvertExcelOptions()
-                options.isContainAnnotations = true
-                options.isContainImages = true
-//                options.isContainOCRBgImage = false
-                
-                options.isAllowOCR = self.isAllowOCR
-                if (self.isAllowOCR) {
-                    options.isAILayoutAnalysis = true
-                    if let language = self.ocrLanguage {
-                        options.language = language
-                    } else {
-                        options.language = .english
-                    }
-                } else {
-                    options.isAILayoutAnalysis = false
-                }
-                
-                options.contentOptions = operateFile?.excelParameter.excelContentOption ?? .allContent
-                options.worksheetOptions = operateFile?.excelParameter.excelWorksheetOption ?? .forEachPage
-                
-                self.converter!.convert(toFilePath: operateFile?.outputFilePath, pageIndexs: operateFile?.currentConvertParameter?.pagesArray, options: options)
-                return
-            }
-            if self.operateFile?.convertType == .PowerPoint {
-                self.converter = CPDFConverterPPT.init(url: URL(fileURLWithPath: operateFile?.filePath ?? ""), password: operateFile?.password)
-                self.converter!.delegate = self
-                let options = CPDFConvertPPTOptions()
-                options.isContainAnnotations = true
-                options.isContainImages = true
-                
-                options.isAllowOCR = self.isAllowOCR
-                if (self.isAllowOCR) {
-                    options.isContainOCRBgImage = true
-                    options.isAILayoutAnalysis = true
-                    if let language = self.ocrLanguage {
-                        options.language = language
-                    } else {
-                        options.language = .english
-                    }
-                } else {
-                    options.isContainOCRBgImage = false
-                    options.isAILayoutAnalysis = false
-                }
-                
-                self.converter!.convert(toFilePath: operateFile?.outputFilePath, pageIndexs: operateFile?.currentConvertParameter?.pagesArray, options: options)
-                return
-            }
-            if self.operateFile?.convertType == .CSV  && self.operateFile?.CSVParameter.isExtreactTabel ?? false {
-                self.converter = CPDFConverterCsv.init(url: URL(fileURLWithPath: operateFile?.filePath ?? ""), password: operateFile?.password)
-                self.converter!.delegate = self
-                let options = CPDFConvertCsvOptions()
-                
-                self.converter!.convert(toFilePath: operateFile?.outputFilePath, pageIndexs: operateFile?.currentConvertParameter?.pagesArray, options: options)
-                return
-            }
-            
-            if self.operateFile?.convertType == .RTF {
-                self.converter = CPDFConverterRtf.init(url: URL(fileURLWithPath: operateFile?.filePath ?? ""), password: operateFile?.password)
-                self.converter!.delegate = self
-                let options = CPDFConvertRtfOptions()
-                options.isContainAnnotations = true
-//                options.isAllowOCR = true
-                options.isContainImages = true
-                
-                options.isAllowOCR = self.isAllowOCR
-                if (self.isAllowOCR) {
-                    options.isContainOCRBgImage = true
-                    if let language = self.ocrLanguage {
-                        options.language = language
-                    } else {
-                        options.language = .english
-                    }
-                } else {
-                    options.isContainOCRBgImage = false
-                }
-                
-                self.converter!.convert(toFilePath: operateFile?.outputFilePath, pageIndexs: operateFile?.currentConvertParameter?.pagesArray, options: options)
-                return
-            }
-            if self.operateFile?.convertType == .HTML {
-                self.converter = CPDFConverterHtml.init(url: URL(fileURLWithPath: operateFile?.filePath ?? ""), password: operateFile?.password)
-                self.converter!.delegate = self
-                let options = CPDFConvertHtmlOptions()
-                options.isContainAnnotations = true
-                options.isContainImages = true
-                
-                options.isAllowOCR = self.isAllowOCR
-                if (self.isAllowOCR) {
-                    options.isContainOCRBgImage = true
-                    if let language = self.ocrLanguage {
-                        options.language = language
-                    } else {
-                        options.language = .english
-                    }
-                } else {
-                    options.isContainOCRBgImage = false
-                }
-                
-                self.converter!.convert(toFilePath: operateFile?.outputFilePath, pageIndexs: operateFile?.currentConvertParameter?.pagesArray, options: options)
-                return
-            }
-            if self.operateFile?.convertType == .Text {
-                self.converter = CPDFConverterTxt.init(url: URL(fileURLWithPath: operateFile?.filePath ?? ""), password: operateFile?.password)
-                self.converter!.delegate = self
-                let options = CPDFConvertTxtOptions()
-                options.isAllowOCR = self.isAllowOCR
-                if (self.isAllowOCR) {
-                    if let language = self.ocrLanguage {
-                        options.language = language
-                    } else {
-                        options.language = .english
-                    }
-                }
-                
-                self.converter!.convert(toFilePath: operateFile?.outputFilePath, pageIndexs: operateFile?.currentConvertParameter?.pagesArray, options: options)
-                return
-            }
-            if self.operateFile?.convertType == .Json {
-                if let data = self.operateFile?.JSONParameter.isExtreactTabel, data {
-                    self.converter = CPDFConverterJsonTable(url:  URL(fileURLWithPath: operateFile?.filePath ?? ""), password: self.operateFile?.password)
-                } else {
-                    self.converter = CPDFConverterJson(url:  URL(fileURLWithPath: operateFile?.filePath ?? ""), password: self.operateFile?.password)
-                }
-                self.converter?.delegate = self
-                
-                let options = CPDFConvertJsonOptions()
-                options.isAllowOCR = self.isAllowOCR
-                if (self.isAllowOCR) {
-                    if let language = self.ocrLanguage {
-                        options.language = language
-                    } else {
-                        options.language = .english
-                    }
-                } else {
-
-                }
-                
-                self.converter!.convert(toFilePath: operateFile?.outputFilePath, pageIndexs: operateFile?.currentConvertParameter?.pagesArray, options: options)
-                return
-            }
-            
-            
-            let op: [String:Any] = [CPDFConvertOptionsKey.imageDPI.rawValue:operateFile?.dpi as Any,CPDFConvertOptionsKey.allInOneSheet.rawValue:(operateFile?.currentConvertParameter?.allInOneSheet ?? false)]
-            self.fpPDFConverter = CPDFConverterFP()
-            self.fpPDFConverter!.setDelegate(self)
-            self.fpPDFConverter?.convertPDF(atPath: operateFile?.filePath, pdfPassword: operateFile?.password, pdfPageIndexs: operateFile?.currentConvertParameter?.pagesArray, destDocType: operateFile?.currentConvertParameter?.extensionString(), destDocPath: operateFile?.outputFilePath, moreOptions:op)
-           
-        }else {
-            willChangeValue(forKey: "isFinished")
-            willChangeValue(forKey: "isExecuting")
-            hasExcuting = false
-            hasFinished = true
-            didChangeValue(forKey: "isExecuting")
-            didChangeValue(forKey: "isFinished")
-        }
-    }
-    override func cancel() {
-//        super.cancel()
-        if isExecuting {
-            self.fpPDFConverter?.stopConvertsionIfNeed()
-            self.operateFile?.currentConvertParameter?.status = .Waiting
-            if FileManager.default.fileExists(atPath: (operateFile?.currentConvertParameter?.outPutPath)!) { try? FileManager.default.removeItem(atPath: (operateFile!.currentConvertParameter?.outPutPath)!)
-            }
-            self.delegate?.fileOperateCanceled?(self.operateFile!, info: self.operateFile!.currentConvertParameter!)
-           
-           willChangeValue(forKey: "isFinished")
-           hasFinished = true
-           didChangeValue(forKey: "isFinished")
-       } else {
-           willChangeValue(forKey: "isCancelled")
-           hasCanceled = true
-           didChangeValue(forKey: "isCancelled")
-       }
-    }
-    //MARK: FPPDFConverterDelegate
-    func fppdfConverter(_ converter: Any!, didStartConversion error: Error!) {
-        DispatchQueue.main.async {
-            if (error != nil){
-                self.delegate?.fileOperateFailed?(self.operateFile!, error: error! as NSError, info: (self.operateFile?.currentConvertParameter!)!)
-            }else {
-                self.delegate?.fileBeginOperate?(self.operateFile!, info: (self.operateFile?.currentConvertParameter!)!)
-            }
-        }
-    }
-    func fppdfConverter(_ converter: Any!, didEndConversion error: Error!) {
-//        DispatchQueue.main.async {
-            if (error != nil){
-                self.delegate?.fileOperateFailed?(self.operateFile!, error: error! as NSError, info: (self.operateFile?.currentConvertParameter!)!)
-            }else {
-                self.delegate?.fileOperateSuccessed?(self.operateFile!, info: (self.operateFile?.currentConvertParameter!)!)
-            }
-            self.fpPDFConverter?.setDelegate(nil)
-        if self.viewController?.view.window?.isVisible == true {
-            willChangeValue(forKey: "isFinished")
-            hasFinished = true
-            didChangeValue(forKey: "isFinished")
-        }
-//        }
-    }
-    func fppdfConverter(_ converter: Any!, pageIndex pageIndexA: UInt, progress: UInt) {
-        
-    }
-    func fppdfConverter(_ converter: Any!, convertPDFPageIndex pdfPageIndexA: UInt, writeWordPageIndex wordPageIndexA: UInt, finshedWordPageCount wordPageCountA: UInt) {
-        let totalPages: Int = self.operateFile?.convertInfo?.pagesArray?.count ?? 0
-        self.delegate?.fileOperating?(self.operateFile!, progress: CGFloat(wordPageCountA)/CGFloat(totalPages), info: (self.operateFile?.currentConvertParameter!)!)
-    }
-    //MARK: CPDFConverterDelegate
-    func converter(_ converter: CPDFConverter!, didStartConvert error: Error!) {
-        DispatchQueue.main.async {
-            if (error != nil){
-                self.delegate?.fileOperateFailed?(self.operateFile!, error: error! as NSError, info: (self.operateFile?.currentConvertParameter!)!)
-            }else {
-                self.delegate?.fileBeginOperate?(self.operateFile!, info: (self.operateFile?.currentConvertParameter!)!)
-            }
-        }
-    }
-    func converter(_ converter: CPDFConverter!, pageIndex index: UInt, pageCount count: UInt) {
-        let totalPages: Int = self.operateFile?.convertInfo?.pagesArray?.count ?? 0
-        self.delegate?.fileOperating?(self.operateFile!, progress: CGFloat(index)/CGFloat(totalPages), info: (self.operateFile?.currentConvertParameter!)!)
-    }
-    func converter(_ converter: CPDFConverter!, didEndConvert error: Error!) {
-        if (error != nil){
-            var erroeString = ""
-            let err: NSError = error! as NSError
-            switch err.code {
-            case CPDFConverterEncryptError:
-                erroeString = KMLocalizedString("Password required or incorrect password. Please re-enter your password and try again")
-            case CPDFConverterPermissionError:
-                erroeString = KMLocalizedString("The license doesn't allow the permission");
-            case CPDFConverterMallocError:
-                erroeString = KMLocalizedString("Malloc failure");
-            case CPDFConverterUnknownError:
-                erroeString = KMLocalizedString("Unknown error in processing conversion. Please try again later");
-            case CPDFConverterPDFUnknownError:
-                erroeString = KMLocalizedString("Unknown error in processing PDF. Please try again later");
-            case CPDFConverterPDFFileError:
-                erroeString = KMLocalizedString("File not found or could not be opened. Check if your file exists or choose another file to convert");
-            case CPDFConverterPDFFormatError:
-                erroeString = KMLocalizedString("File not in PDF format or corruptead. Change a PDF file and try again");
-            case CPDFConverterPDFSecurityError:
-                erroeString = KMLocalizedString("Unsupported security scheme");
-                break;
-            case CPDFConverterPDFPageError:
-                erroeString = KMLocalizedString("Page not found or content error");
-                break;
-            default:
-                erroeString = KMLocalizedString("Table not found");
-            }
-            let newError = NSError(domain: "", code: err.code, userInfo: [NSLocalizedFailureReasonErrorKey: erroeString])
-            self.delegate?.fileOperateFailed?(self.operateFile!, error: newError, info: (self.operateFile?.currentConvertParameter!)!)
-        }else {
-            self.delegate?.fileOperateSuccessed?(self.operateFile!, info: (self.operateFile?.currentConvertParameter!)!)
-        }
-        if self.converter != nil && self.converter?.delegate != nil {
-            self.converter?.delegate = nil
-        }
-        if self.viewController?.view.window?.isVisible == true {
-            willChangeValue(forKey: "isFinished")
-            hasFinished = true
-            didChangeValue(forKey: "isFinished")
-        }
-    }
-    
-}

+ 0 - 114
PDF Office/PDF Master/Class/Batch/Operation/KMCompressOperation.swift

@@ -1,114 +0,0 @@
-//
-//  File.swift
-//  PDF Reader Pro
-//
-//  Created by liujiajie on 2023/11/30.
-//
-
-import Foundation
-
-typealias compressCallbackBlock = (_ isSuccess: Bool) -> Void
-
-class KMCompressOperation: KMBatchOperation{
-    var dpiValue: NSNumber = 0
-    var pdfDocument: CPDFDocument?
-    init(file: KMBatchOperateFile, compressValue dpiType: NSNumber) {
-        super.init(file: file)
-        self.dpiValue = dpiType
-       
-    }
-    override func start() {
-        if !self.isCancelled {
-            self.pdfDocument = CPDFDocument(url: URL(fileURLWithPath: self.operateFile?.filePath ?? ""))
-            if let data = self.pdfDocument?.isLocked, data {
-                self.pdfDocument?.unlock(withPassword: self.operateFile?.password)
-            }
-            self.delegate?.fileBeginOperate?(self.operateFile!, info: self.operateFile!.compressInfo)
-            
-            willChangeValue(forKey: "isExecuting")
-            self.hasExcuting = true
-            didChangeValue(forKey: "isExecuting")
-            if !FileManager.default.fileExists(atPath: self.operateFile?.filePath ?? "") {
-                self.delegate?.fileOperateFailed?(self.operateFile!, error: self.errorWithMsg(KMLocalizedString("File Not Exist")), info: self.operateFile!.removePasswordInfo)
-                
-                self.willChangeValue(forKey: "isFinished")
-                self.hasFinished = true
-                self.didChangeValue(forKey: "isFinished")
-                return
-            }
-            
-            if self.pdfDocument == nil {
-                self.delegate?.fileOperateFailed?(self.operateFile!, error: self.errorWithMsg(KMLocalizedString("An error occurred while opening this document. The file is damaged and could not be repaired.")), info: self.operateFile!.removeWatermarkInfo)
-                self.willChangeValue(forKey: "isFinished")
-                self.hasFinished = true
-                self.didChangeValue(forKey: "isFinished")
-                return
-            }
-            self.compressToPath(targetPath: (self.operateFile?.compressInfo.fetchDestinationFilepath()), documentPath: self.operateFile?.filePath ?? "", password: self.operateFile?.password ?? "", compressType: self.dpiValue) { isSuccess in
-                if isSuccess {
-                    self.delegate?.fileOperateSuccessed?(self.operateFile!, info: self.operateFile!.compressInfo)
-                }else{
-                    self.delegate?.fileOperateFailed?(self.operateFile!, error: self.errorWithMsg(KMLocalizedString("Failed")), info: self.operateFile!.compressInfo)
-                }
-            }
-            DispatchQueue.main.async {
-                if self.viewController?.view.window?.isVisible == true {
-                    self.willChangeValue(forKey: "isFinished")
-                    self.hasFinished = true
-                    self.didChangeValue(forKey: "isFinished")
-                }
-            }
-        }else {
-            DispatchQueue.main.async {
-                if self.viewController?.view.window?.isVisible == true {
-                    self.willChangeValue(forKey: "isFinished")
-                    self.willChangeValue(forKey: "isExecuting")
-                    self.hasExcuting = false
-                    self.hasFinished = true
-                    self.didChangeValue(forKey: "isExecuting")
-                    self.didChangeValue(forKey: "isFinished")
-                }
-            }
-        }
-    }
-    override func cancel() {
-        //        super.cancel()
-        if isExecuting {
-            self.operateFile?.compressInfo.status = .Waiting
-            if FileManager.default.fileExists(atPath: (operateFile?.compressInfo.outPutPath)!) { try? FileManager.default.removeItem(atPath: (operateFile!.compressInfo.outPutPath)!)
-            }
-            self.delegate?.fileOperateCanceled?(self.operateFile!, info: self.operateFile!.compressInfo)
-            DispatchQueue.main.async {
-                if self.viewController?.view.window?.isVisible == true {
-                    self.willChangeValue(forKey: "isFinished")
-                    self.hasFinished = true
-                    self.didChangeValue(forKey: "isFinished")
-                }
-            }
-        } else {
-            DispatchQueue.main.async {
-                if self.viewController?.view.window?.isVisible == true {
-                    self.willChangeValue(forKey: "isCancelled")
-                    self.hasCanceled = true
-                    self.didChangeValue(forKey: "isCancelled")
-                }
-            }
-        }
-    }
-    func compressToPath(targetPath: String?, documentPath: String, password: String, compressType: NSNumber?, completeHandler: compressCallbackBlock) {
-        if self.pdfDocument!.isLocked {
-            let unlockSuccess = self.pdfDocument!.unlock(withPassword: password)
-            if !unlockSuccess {
-                completeHandler(false)
-                return
-            }
-        }
-        if compressType == nil {
-            
-            completeHandler(false)
-            return
-        }
-        let isSuccessfully = self.pdfDocument!.writeOptimize(to: URL(fileURLWithPath: targetPath ?? ""), withOptions: [CPDFDocumentOptimizeOption.imageQualityOption: compressType as Any])
-        completeHandler(isSuccessfully)
-    }
-}

+ 0 - 15
PDF Office/PDF Master/Class/Batch/Tools/KMAddBackgroundOperationQueue.swift

@@ -1,15 +0,0 @@
-//
-//  KMAddBackgroundOperationQueue.swift
-//  PDF Reader Pro
-//
-//  Created by liujiajie on 2023/12/1.
-//
-
-import Foundation
-
-class KMAddBackgroundOperationQueue: KMOperationQueue{
-    static let sharedQueue: KMAddBackgroundOperationQueue = {
-        let queue = KMAddBackgroundOperationQueue()
-        return queue
-    }()
-}

+ 0 - 16
PDF Office/PDF Master/Class/Batch/Tools/KMAddBatesOperationQueue.swift

@@ -1,16 +0,0 @@
-//
-//  KMAddBatesOperationQueue.swift
-//  PDF Reader Pro
-//
-//  Created by liujiajie on 2023/12/1.
-//
-
-import Foundation
-
-class KMAddBatesOperationQueue: KMOperationQueue{
-    static let sharedQueue: KMAddBatesOperationQueue = {
-        let queue = KMAddBatesOperationQueue()
-        return queue
-    }()
-}
-

+ 0 - 15
PDF Office/PDF Master/Class/Batch/Tools/KMAddHeaderFooterOperationQueue.swift

@@ -1,15 +0,0 @@
-//
-//  KMAddHeaderFooterOperationQueue.swift
-//  PDF Reader Pro
-//
-//  Created by liujiajie on 2023/12/1.
-//
-
-import Foundation
-
-class KMAddHeaderFooterOperationQueue: KMOperationQueue{
-    static let sharedQueue: KMAddHeaderFooterOperationQueue = {
-        let queue = KMAddHeaderFooterOperationQueue()
-        return queue
-    }()
-}

+ 0 - 16
PDF Office/PDF Master/Class/Batch/Tools/KMAddWatermarkOprationQueue.swift

@@ -1,16 +0,0 @@
-//
-//  KMAddWatermarkOprationQueue.swift
-//  PDF Reader Pro
-//
-//  Created by liujiajie on 2023/12/1.
-//
-
-import Foundation
-
-class KMAddWatermarkOprationQueue: KMOperationQueue{
-    static let sharedQueue: KMAddWatermarkOprationQueue = {
-        let queue = KMAddWatermarkOprationQueue()
-        return queue
-    }()
-}
-

+ 0 - 48
PDF Office/PDF Master/Class/Batch/Tools/KMBatchOperation.swift

@@ -1,48 +0,0 @@
-//
-//  KMBatchOperation.swift
-//  PDF Reader Pro
-//
-//  Created by kdanmobile on 2023/10/31.
-//
-
-import Foundation
-
-@objc(KMBatchOperateProtocol)
-protocol KMBatchOperateProtocol: AnyObject {
-    @objc optional func fileBeginOperate(_ file: KMBatchOperateFile, info: KMBatchBaseParameter)
-    @objc optional func fileOperating(_ file: KMBatchOperateFile, progress: CGFloat, info: KMBatchBaseParameter)
-    @objc optional func fileOperateSuccessed(_ file: KMBatchOperateFile, info: KMBatchBaseParameter)
-    @objc optional func fileOperateFailed(_ file: KMBatchOperateFile, error: NSError, info: KMBatchBaseParameter)
-    @objc optional func fileOperateCanceled(_ file: KMBatchOperateFile, info: KMBatchBaseParameter)
-}
-
-class KMBatchOperation: Operation{
-    var hasCanceled: Bool = false
-    var hasFinished: Bool = false
-    var hasExcuting: Bool = false
-    weak var operateFile: KMBatchOperateFile?
-    weak var delegate: KMBatchOperateProtocol?
-    
-    var viewController: NSViewController?
-    
-    init(file: KMBatchOperateFile) {
-        super.init()
-        self.operateFile = file
-    }
-    override var isCancelled: Bool{
-        return self.hasCanceled
-    }
-    override var isFinished: Bool{
-        return self.hasFinished
-    }
-    override var isExecuting: Bool{
-        return self.hasExcuting
-    }
-    func errorWithMsg(_ errorMsg: String) -> NSError {
-        var errorDict = NSMutableDictionary()
-        errorDict[NSLocalizedDescriptionKey] = errorMsg
-        let error = NSError(domain: "PDFReaderBatchErrorDomain", code: -1, userInfo: (errorDict as! [String : Any]))
-        return error
-    }
-    
-}

+ 0 - 174
PDF Office/PDF Master/Class/Batch/Tools/KMBatchRemoveHeaderFooterOperation.swift

@@ -1,174 +0,0 @@
-//
-//  KMBatchRemoveHeaderFooterOperation.swift
-//  PDF Reader Pro
-//
-//  Created by liujiajie on 2023/12/1.
-//
-
-import Foundation
-
-class KMBatchRemoveHeaderFooterOperation: KMBatchOperation{
-    var isBates: Bool = false
-    var pdfDocument: CPDFDocument?
-    
-    override init(file: KMBatchOperateFile) {
-        super.init(file: file)
-       
-    }
-    override func cancel() {
-        if isExecuting {
-            operateFile!.removeWatermarkInfo.status = .Waiting
-            if FileManager.default.fileExists(atPath: self.currentParameter().outPutPath!) { try? FileManager.default.removeItem(atPath: self.currentParameter().outPutPath!)
-            }
-            self.delegate?.fileOperateCanceled?(self.operateFile!, info: self.operateFile!.removeWatermarkInfo)
-           
-           willChangeValue(forKey: "isFinished")
-           hasFinished = true
-           didChangeValue(forKey: "isFinished")
-       } else {
-           willChangeValue(forKey: "isCancelled")
-           hasCanceled = true
-           didChangeValue(forKey: "isCancelled")
-       }
-    }
-    func currentParameter() -> KMBatchBaseParameter {
-        if self.isBates {
-            return self.operateFile!.removeBatesInfo
-        }
-        return self.operateFile!.removeHeaderFooterInfo
-    }
-    override func start() {
-        self.pdfDocument = CPDFDocument(url: URL(fileURLWithPath: self.operateFile?.filePath ?? ""))
-        if let data = self.pdfDocument?.isLocked, data {
-            self.pdfDocument?.unlock(withPassword: self.operateFile?.password)
-        }
-        if !self.isCancelled {
-            self.delegate?.fileBeginOperate?(self.operateFile!, info: self.currentParameter())
-            willChangeValue(forKey: "isExecuting")
-            self.hasExcuting = true
-            didChangeValue(forKey: "isExecuting")
-            if !FileManager.default.fileExists(atPath: self.operateFile!.filePath) {
-                self.delegate?.fileOperateFailed?(self.operateFile!, error: self.errorWithMsg(KMLocalizedString("File Not Exist")), info: self.operateFile!.currentOperateInfo!)
-                
-                self.willChangeValue(forKey: "isFinished")
-                self.hasFinished = true
-                self.didChangeValue(forKey: "isFinished")
-                return
-            }
-
-            if self.pdfDocument == nil {
-                self.delegate?.fileOperateFailed?(self.operateFile!, error: self.errorWithMsg(KMLocalizedString("An error occurred while opening this document. The file is damaged and could not be repaired.")), info: self.operateFile!.currentOperateInfo!)
-                self.willChangeValue(forKey: "isFinished")
-                self.hasFinished = true
-                self.didChangeValue(forKey: "isFinished")
-                return
-            }
-
-            if !self.pdfDocument!.allowsPrinting || !self.pdfDocument!.allowsCopying {
-                self.delegate?.fileOperateFailed?(self.operateFile!, error: self.errorWithMsg(KMLocalizedString("This is a secured document. Editing is not permitted.")), info: self.operateFile!.currentOperateInfo!)
-                self.willChangeValue(forKey: "isFinished")
-                self.hasFinished = true
-                self.didChangeValue(forKey: "isFinished")
-                return
-            }
-            if self.isBates {
-                KMBatchRemoveHeaderFooterOperation.saveAsPDFRemoveAllHeaderFooterBates(self.pdfDocument!, password: self.operateFile?.password, toPath: self.operateFile!.currentOperateInfo!.fetchDestinationFilepath()!) { result in
-                    if result == 1 {
-                        self.delegate?.fileOperateSuccessed?(self.operateFile!, info: self.currentParameter())
-                    } else {
-                        self.delegate?.fileOperateFailed?(self.operateFile!, error: self.defaultError() as NSError, info: self.currentParameter())
-                    }
-                    self.willChangeValue(forKey: "isFinished")
-                    self.hasFinished = true
-                    self.didChangeValue(forKey: "isFinished")
-                }
-            } else {
-                KMBatchRemoveHeaderFooterOperation.saveAsPDFRemoveAllHeaderFooter(self.pdfDocument!, password: self.operateFile?.password, toPath: self.operateFile!.currentOperateInfo!.fetchDestinationFilepath()!) { result in
-                    if result == 1 {
-                        self.delegate?.fileOperateSuccessed?(self.operateFile!, info: self.currentParameter())
-                    } else {
-                        self.delegate?.fileOperateFailed?(self.operateFile!, error: self.defaultError() as NSError, info: self.currentParameter())
-                    }
-                    self.willChangeValue(forKey: "isFinished")
-                    self.hasFinished = true
-                    self.didChangeValue(forKey: "isFinished")
-                }
-            }
-           
-        }else {
-            willChangeValue(forKey: "isFinished")
-            willChangeValue(forKey: "isExecuting")
-            hasExcuting = false
-            hasFinished = true
-            didChangeValue(forKey: "isExecuting")
-            didChangeValue(forKey: "isFinished")
-        }
-    }
-    class func saveAsPDFRemoveAllHeaderFooterBates(_ pdfDocument: CPDFDocument, password: String?, toPath path: String, completionHandler handler: @escaping (Int) -> Void) {
-//        let filePath = pdfDocument.documentURL.path
-        let document = CPDFDocument(url: pdfDocument.documentURL)
-        if let password = password {
-            document?.unlock(withPassword: password)
-        }
-        
-        let tBates = document?.bates()
-        tBates?.clear()
-        
-        let documentPath = NSTemporaryDirectory()
-        let tempPath = documentPath.stringByAppendingPathComponent(path.lastPathComponent)
-        if FileManager.default.fileExists(atPath: tempPath) {
-            try?FileManager.default.removeItem(atPath: tempPath)
-        }
-        
-        let result = document?.write(to: URL(fileURLWithPath: tempPath))
-        if result ?? false {
-            if FileManager.default.fileExists(atPath: path) {
-                try?FileManager.default.removeItem(atPath: path)
-            }
-            try?FileManager.default.moveItem(atPath: tempPath, toPath: path)
-        } else {
-            try?FileManager.default.removeItem(atPath: tempPath)
-        }
-        DispatchQueue.main.async {
-            if let result = result {
-                handler(result ? 1 : 0)
-            }
-        }
-    }
-    class func saveAsPDFRemoveAllHeaderFooter(_ pdfDocument: CPDFDocument, password: String?, toPath path: String, completionHandler handler: @escaping (Int) -> Void) {
-//        let filePath = pdfDocument.documentURL.path
-        let document = CPDFDocument(url: pdfDocument.documentURL)
-        if let password = password {
-            document?.unlock(withPassword: password)
-        }
-        
-        let tHeaderFooter = document?.headerFooter()
-        tHeaderFooter?.clear()
-        
-        let documentPath = NSTemporaryDirectory()
-        let tempPath = documentPath.stringByAppendingPathComponent(path.lastPathComponent)
-        if FileManager.default.fileExists(atPath: tempPath) {
-            try?FileManager.default.removeItem(atPath: tempPath)
-        }
-        
-        let result = document?.write(to: URL(fileURLWithPath: tempPath))
-        if result ?? false {
-            if FileManager.default.fileExists(atPath: path) {
-                try?FileManager.default.removeItem(atPath: path)
-            }
-            try?FileManager.default.moveItem(atPath: tempPath, toPath: path)
-        } else {
-            try?FileManager.default.removeItem(atPath: tempPath)
-        }
-        DispatchQueue.main.async {
-            if let result = result {
-                handler(result ? 1 : 0)
-            }
-        }
-    }
-    func defaultError() -> Error {
-        return self.errorWithMsg(KMLocalizedString("Failed"))
-    }
-}
-
-

+ 0 - 15
PDF Office/PDF Master/Class/Batch/Tools/KMCompressOperationQueue.swift

@@ -1,15 +0,0 @@
-//
-//  KMCompressOperationQueue.swift
-//  PDF Reader Pro
-//
-//  Created by liujiajie on 2023/12/1.
-//
-
-import Foundation
-
-class KMCompressOperationQueue: KMOperationQueue{
-    static let sharedQueue: KMCompressOperationQueue = {
-        let queue = KMCompressOperationQueue()
-        return queue
-    }()
-}

+ 0 - 15
PDF Office/PDF Master/Class/Batch/Tools/KMOperationQueue.swift

@@ -1,15 +0,0 @@
-//
-//  KMOperationQueue.swift
-//  PDF Reader Pro
-//
-//  Created by kdanmobile on 2023/10/30.
-//
-
-import Foundation
-
-class KMOperationQueue: OperationQueue{
-    override init() {
-        super.init()
-        self.maxConcurrentOperationCount = 1
-    }
-}

+ 0 - 15
PDF Office/PDF Master/Class/Batch/Tools/KMRemoveBackgroundOperationQueue.swift

@@ -1,15 +0,0 @@
-//
-//  KMRemoveBackgroundOperationQueue.swift
-//  PDF Reader Pro
-//
-//  Created by liujiajie on 2023/12/1.
-//
-
-import Foundation
-
-class KMRemoveBackgroundOperationQueue: KMOperationQueue{
-    static let sharedQueue: KMRemoveBackgroundOperationQueue = {
-        let queue = KMRemoveBackgroundOperationQueue()
-        return queue
-    }()
-}

+ 0 - 15
PDF Office/PDF Master/Class/Batch/Tools/KMRemoveBatesOperationQueue.swift

@@ -1,15 +0,0 @@
-//
-//  KMRemoveBatesOperationQueue.swift
-//  PDF Reader Pro
-//
-//  Created by liujiajie on 2023/12/1.
-//
-
-import Foundation
-
-class KMRemoveBatesOperationQueue: KMOperationQueue{
-    static let sharedQueue: KMRemoveBatesOperationQueue = {
-        let queue = KMRemoveBatesOperationQueue()
-        return queue
-    }()
-}

+ 0 - 16
PDF Office/PDF Master/Class/Batch/Tools/KMRemoveHeaderFooterQueue.swift

@@ -1,16 +0,0 @@
-//
-//  KMRemoveHeaderFooterQueue.swift
-//  PDF Reader Pro
-//
-//  Created by liujiajie on 2023/12/1.
-//
-
-import Foundation
-
-class KMRemoveHeaderFooterQueue: KMOperationQueue{
-    static let sharedQueue: KMRemoveHeaderFooterQueue = {
-        let queue = KMRemoveHeaderFooterQueue()
-        return queue
-    }()
-}
-

+ 0 - 56
PDF Office/PDF Master/Class/Batch/View/KMBatchoperateConvertCollectionViewItem.swift

@@ -1,56 +0,0 @@
-//
-//  KMBatchoperateConvertCollectionViewItem.swift
-//  PDF Reader Pro
-//
-//  Created by kdanmobile on 2023/11/1.
-//
-
-import Cocoa
-
-class KMBatchoperateConvertCollectionViewItem: NSCollectionViewItem{
-    var selectLayer: CALayer?
-    
-    @IBOutlet var advancedButton: NSButton!
-    
-    @IBOutlet var containerView: NSView!
-    
-    @IBOutlet var moreInfoTextField: NSTextField!
-    
-    @IBOutlet var icomIV: NSImageView!
-    
-    @IBOutlet var nameTF: NSTextField!
-    
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        self.nameTF!.font = NSFont.systemFont(ofSize: 12)
-        nameTF!.textColor = KMAppearance.Layout.h1Color()
-        moreInfoTextField.font = NSFont.boldSystemFont(ofSize: 9)
-        moreInfoTextField.textColor = KMAppearance.Layout.mColor()
-        view.wantsLayer = true
-        selectLayer = CALayer()
-        view.layer?.addSublayer(selectLayer!)
-        selectLayer?.frame = CGRect(x: 0, y: 0, width: 64, height: 76)
-        selectLayer!.backgroundColor = KMAppearance.Status.selColor().cgColor
-        selectLayer?.cornerRadius = 6
-        selectLayer!.isHidden = true
-        moreInfoTextField.sizeToFit()
-        containerView.wantsLayer = true
-        containerView.layer?.cornerRadius = moreInfoTextField.bounds.height / 2
-    }
-    override var isSelected: Bool{
-        get{
-            return super.isSelected
-        }
-        set{
-            super.isSelected = newValue
-            self.selectLayer?.isHidden = !newValue
-        }
-    }
-    
-    @IBAction func buttonClicked_AdvancedClicked(_ sender: Any) {
-        if !IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
-        }
-    }
-
-}

+ 0 - 96
PDF Office/PDF Master/Class/Batch/View/KMBatchoperateConvertCollectionViewItem.xib

@@ -1,96 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22155" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
-    <dependencies>
-        <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22155"/>
-        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
-    </dependencies>
-    <objects>
-        <customObject id="-2" userLabel="File's Owner" customClass="KMBatchoperateConvertCollectionViewItem" customModule="PDF_Reader_Pro" customModuleProvider="target">
-            <connections>
-                <outlet property="advancedButton" destination="KRi-OD-0UT" id="tqY-HI-Cjh"/>
-                <outlet property="containerView" destination="GfF-v3-vvL" id="fjn-gK-zcG"/>
-                <outlet property="icomIV" destination="tdp-67-GP3" id="0Kc-tg-G3i"/>
-                <outlet property="moreInfoTextField" destination="NDf-YV-Dhg" id="e9Z-jU-iNb"/>
-                <outlet property="nameTF" destination="g9b-M4-eEv" id="7dh-Yb-Wj9"/>
-                <outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
-            </connections>
-        </customObject>
-        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
-        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
-        <customView id="Hz6-mo-xeY">
-            <rect key="frame" x="0.0" y="0.0" width="214" height="84"/>
-            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
-            <subviews>
-                <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="tdp-67-GP3">
-                    <rect key="frame" x="86" y="42" width="32" height="32"/>
-                    <constraints>
-                        <constraint firstAttribute="width" constant="32" id="TkD-JX-AIG"/>
-                        <constraint firstAttribute="height" constant="32" id="vIt-WN-J98"/>
-                    </constraints>
-                    <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="light_ic_propertybar_file_word" id="97I-xg-AOZ"/>
-                </imageView>
-                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="g9b-M4-eEv">
-                    <rect key="frame" x="84" y="20" width="37" height="14"/>
-                    <constraints>
-                        <constraint firstAttribute="height" constant="14" id="LcG-7F-mGw"/>
-                    </constraints>
-                    <textFieldCell key="cell" lineBreakMode="truncatingMiddle" title="Label" id="FWM-k5-5AP">
-                        <font key="font" metaFont="system"/>
-                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                    </textFieldCell>
-                </textField>
-                <button translatesAutoresizingMaskIntoConstraints="NO" id="KRi-OD-0UT">
-                    <rect key="frame" x="194" y="64" width="20" height="20"/>
-                    <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="light_ic_vip" imagePosition="only" alignment="center" imageScaling="proportionallyUpOrDown" inset="2" id="INR-5u-5Tp">
-                        <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                        <font key="font" metaFont="system"/>
-                    </buttonCell>
-                    <connections>
-                        <action selector="buttonClicked_AdvancedClicked:" target="-2" id="TH2-FW-6UV"/>
-                    </connections>
-                </button>
-                <customView translatesAutoresizingMaskIntoConstraints="NO" id="GfF-v3-vvL">
-                    <rect key="frame" x="80" y="4" width="45" height="14"/>
-                    <subviews>
-                        <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="NDf-YV-Dhg">
-                            <rect key="frame" x="4" y="0.0" width="37" height="14"/>
-                            <textFieldCell key="cell" lineBreakMode="truncatingMiddle" title="Label" id="OBa-PH-xou">
-                                <font key="font" metaFont="system"/>
-                                <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="14" id="NYm-4n-LY9"/>
-                        <constraint firstAttribute="trailing" secondItem="NDf-YV-Dhg" secondAttribute="trailing" constant="6" id="fG2-lX-FEB"/>
-                        <constraint firstItem="NDf-YV-Dhg" firstAttribute="leading" secondItem="GfF-v3-vvL" secondAttribute="leading" constant="6" id="fQy-Wr-mAy"/>
-                        <constraint firstItem="NDf-YV-Dhg" firstAttribute="top" secondItem="GfF-v3-vvL" secondAttribute="top" id="mj0-e7-9qk"/>
-                        <constraint firstAttribute="bottom" secondItem="NDf-YV-Dhg" secondAttribute="bottom" id="wHS-hT-TlG"/>
-                    </constraints>
-                </customView>
-            </subviews>
-            <constraints>
-                <constraint firstItem="GfF-v3-vvL" firstAttribute="centerX" secondItem="Hz6-mo-xeY" secondAttribute="centerX" constant="-5" id="0UY-El-fAY"/>
-                <constraint firstAttribute="trailing" secondItem="KRi-OD-0UT" secondAttribute="trailing" id="5Mz-Sh-Gqj"/>
-                <constraint firstItem="GfF-v3-vvL" firstAttribute="centerX" secondItem="tdp-67-GP3" secondAttribute="centerX" id="5Nc-S2-75r"/>
-                <constraint firstItem="KRi-OD-0UT" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" id="IDx-vy-kXI"/>
-                <constraint firstAttribute="bottom" secondItem="GfF-v3-vvL" secondAttribute="bottom" constant="4" id="K6p-cj-wXe"/>
-                <constraint firstItem="GfF-v3-vvL" firstAttribute="top" secondItem="g9b-M4-eEv" secondAttribute="bottom" constant="2" id="Lkj-iK-dQn"/>
-                <constraint firstItem="tdp-67-GP3" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" constant="10" id="QWJ-gW-vMh"/>
-                <constraint firstItem="g9b-M4-eEv" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Hz6-mo-xeY" secondAttribute="leading" id="R5q-iH-hji"/>
-                <constraint firstItem="g9b-M4-eEv" firstAttribute="centerX" secondItem="tdp-67-GP3" secondAttribute="centerX" id="eNY-9I-cxJ"/>
-                <constraint firstItem="g9b-M4-eEv" firstAttribute="centerX" secondItem="tdp-67-GP3" secondAttribute="centerX" id="jpe-bd-JH0"/>
-                <constraint firstItem="g9b-M4-eEv" firstAttribute="top" secondItem="tdp-67-GP3" secondAttribute="bottom" constant="8" id="ro4-p2-fU6"/>
-                <constraint firstItem="GfF-v3-vvL" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Hz6-mo-xeY" secondAttribute="leading" id="xqR-aH-Vjr"/>
-            </constraints>
-            <point key="canvasLocation" x="-276" y="69.5"/>
-        </customView>
-    </objects>
-    <resources>
-        <image name="light_ic_propertybar_file_word" width="32" height="32"/>
-        <image name="light_ic_vip" width="20" height="20"/>
-    </resources>
-</document>

+ 0 - 92
PDF Office/PDF Master/Class/Batch/View/KMConvertCollectionViewHeader.swift

@@ -1,92 +0,0 @@
-//
-//  KMConvertCollectionViewHeader.swift
-//  PDF Reader Pro
-//
-//  Created by kdanmobile on 2023/11/1.
-//
-
-import Cocoa
-
-typealias convertCollectionViewHeaderClickedCallBack = () -> ()
-
-class KMConvertCollectionViewHeader: BaseXibView{
-    
-    @IBOutlet var layerColorView: NSView!
-    
-    @IBOutlet var indicateLabel: NSTextField!
-    
-    @IBOutlet var imageView: NSImageView!
-    
-    @IBOutlet var infoLabel: NSTextField!
-    
-    @IBOutlet var containerView: NSView!
-    
-    var convertHeaderClickedCallBack: convertCollectionViewHeaderClickedCallBack?
-    
-    deinit {
-        NotificationCenter.default.removeObserver(self)
-    }
-
-    override func draw(_ dirtyRect: NSRect) {
-        super.draw(dirtyRect)
-        
-    }
-    
-    override func awakeFromNib() {
-        super.awakeFromNib()
-
-        containerView.wantsLayer = true
-//        containerView.layer?.cornerRadius = 12
-//                if IAPProductsManager.defaultManager().isAvailableAdvancedPDFToOffice {
-//                    containerView.isHidden = true
-//                }
-//        购买状态变化通知
-        self.layerColorView.wantsLayer = true
-        self.layerColorView.layer?.masksToBounds = true
-        self.layerColorView.layer?.cornerRadius = 12
-        self.layerColorView.layer?.backgroundColor = NSColor(red: 1.0, green: 94/255.0, blue: 44/255.0, alpha: 1.0).cgColor
-        
-        self.refreshData()
-        
-        NotificationCenter.default.addObserver(self, selector: #selector(IAPProductRestoreFinishedNotification(notification:)), name: NSNotification.Name(rawValue: "KMIAPProductPurchasedNotification"), object: nil)
-        NotificationCenter.default.addObserver(self, selector: #selector(IAPProductRestoreFinishedNotification(notification:)), name: NSNotification.Name(rawValue: "KMIAPProductRestoreFinishedNotification"), object: nil)
-    }
-    
-    override func setup() { 
-        indicateLabel.font = NSFont.boldSystemFont(ofSize: 14)
-        indicateLabel.textColor = KMAppearance.Layout.h0Color()
-        indicateLabel.stringValue = NSLocalizedString("Convert", comment: "")
-        infoLabel.font = NSFont.boldSystemFont(ofSize: 11)
-        infoLabel.textColor = NSColor.white
-        infoLabel.stringValue = NSLocalizedString("Upgrade to Pro", comment: "")
-        infoLabel.toolTip = NSLocalizedString("Upgrade to Pro", comment: "")
-    }
-    
-    override func mouseUp(with event: NSEvent) {
-        super.mouseUp(with: event)
-        let point = event.locationInWindow
-        let newPoint = convert(point, from: nil)
-        if let data = self.containerView?.frame.contains(newPoint), data {
-            if !IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
-                self.convertHeaderClickedCallBack?()
-            }
-        }
-    }
-    
-    func refreshData() {
-        if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
-            containerView.isHidden = true
-        } else {
-            containerView.isHidden = false
-        }
-    }
-    
-    @objc func IAPProductPurchasedNotification(notification: Notification) {
-        self.refreshData()
-    }
-    
-    @objc func IAPProductRestoreFinishedNotification(notification: Notification) {
-        self.refreshData()
-    }
-    
-}

+ 0 - 79
PDF Office/PDF Master/Class/Batch/View/KMConvertCollectionViewHeader.xib

@@ -1,79 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22155" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
-    <dependencies>
-        <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22155"/>
-        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
-    </dependencies>
-    <objects>
-        <customObject id="-2" userLabel="File's Owner" customClass="KMConvertCollectionViewHeader" customModule="PDF_Reader_Pro" customModuleProvider="target">
-            <connections>
-                <outlet property="containerView" destination="65M-xr-NTJ" id="CbO-vk-fBP"/>
-                <outlet property="imageView" destination="JZM-NO-k0s" id="hEv-AK-w8s"/>
-                <outlet property="indicateLabel" destination="adF-Xf-x0M" id="KPt-Mj-Snn"/>
-                <outlet property="infoLabel" destination="Sft-Vr-raz" id="goo-JB-Rex"/>
-                <outlet property="layerColorView" destination="kE0-nK-XOe" id="upv-Fd-mWo"/>
-            </connections>
-        </customObject>
-        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
-        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
-        <customView identifier="convertHeader" id="c22-O7-iKe">
-            <rect key="frame" x="0.0" y="0.0" width="480" height="272"/>
-            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
-            <subviews>
-                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="adF-Xf-x0M">
-                    <rect key="frame" x="8" y="241" width="37" height="16"/>
-                    <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="ovW-WC-9XR">
-                        <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>
-                <customView translatesAutoresizingMaskIntoConstraints="NO" id="65M-xr-NTJ">
-                    <rect key="frame" x="53" y="237" width="77" height="24"/>
-                    <subviews>
-                        <customView translatesAutoresizingMaskIntoConstraints="NO" id="kE0-nK-XOe">
-                            <rect key="frame" x="0.0" y="0.0" width="77" height="24"/>
-                            <constraints>
-                                <constraint firstAttribute="height" constant="24" id="reR-Nn-XQz"/>
-                            </constraints>
-                        </customView>
-                        <imageView horizontalHuggingPriority="252" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="JZM-NO-k0s">
-                            <rect key="frame" x="12" y="7" width="9" height="10"/>
-                            <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="KMImageNameElseVIP2" id="E3c-ED-XE8"/>
-                        </imageView>
-                        <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Sft-Vr-raz">
-                            <rect key="frame" x="23" y="4" width="41" height="16"/>
-                            <textFieldCell key="cell" lineBreakMode="truncatingTail" alignment="center" title="Label" id="SXE-93-vrI">
-                                <font key="font" metaFont="system"/>
-                                <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                                <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                            </textFieldCell>
-                        </textField>
-                    </subviews>
-                    <constraints>
-                        <constraint firstItem="kE0-nK-XOe" firstAttribute="top" secondItem="65M-xr-NTJ" secondAttribute="top" id="7OJ-cj-vi1"/>
-                        <constraint firstItem="kE0-nK-XOe" firstAttribute="leading" secondItem="65M-xr-NTJ" secondAttribute="leading" id="BsW-k2-MlS"/>
-                        <constraint firstAttribute="height" constant="24" id="DgP-kl-kaC"/>
-                        <constraint firstItem="Sft-Vr-raz" firstAttribute="centerX" secondItem="65M-xr-NTJ" secondAttribute="centerX" constant="5" id="NZ2-Za-Uj7"/>
-                        <constraint firstItem="Sft-Vr-raz" firstAttribute="leading" secondItem="JZM-NO-k0s" secondAttribute="trailing" constant="4" id="OfJ-gA-7hU"/>
-                        <constraint firstItem="JZM-NO-k0s" firstAttribute="centerY" secondItem="65M-xr-NTJ" secondAttribute="centerY" id="bVw-DB-Qaj"/>
-                        <constraint firstItem="Sft-Vr-raz" firstAttribute="centerY" secondItem="65M-xr-NTJ" secondAttribute="centerY" id="d0D-sM-aEA"/>
-                        <constraint firstItem="JZM-NO-k0s" firstAttribute="leading" secondItem="65M-xr-NTJ" secondAttribute="leading" constant="12" id="ewS-dT-5wS"/>
-                        <constraint firstAttribute="trailing" secondItem="kE0-nK-XOe" secondAttribute="trailing" id="mdr-XH-kNT"/>
-                    </constraints>
-                </customView>
-            </subviews>
-            <constraints>
-                <constraint firstItem="65M-xr-NTJ" firstAttribute="centerY" secondItem="adF-Xf-x0M" secondAttribute="centerY" id="0Qe-jR-t0M"/>
-                <constraint firstItem="adF-Xf-x0M" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" constant="10" id="Gms-2W-8tk"/>
-                <constraint firstItem="adF-Xf-x0M" firstAttribute="top" secondItem="c22-O7-iKe" secondAttribute="top" constant="15" id="Ptb-I5-jdh"/>
-                <constraint firstItem="65M-xr-NTJ" firstAttribute="leading" secondItem="adF-Xf-x0M" secondAttribute="trailing" constant="10" id="vGf-Mc-fJj"/>
-            </constraints>
-            <point key="canvasLocation" x="-134" y="121"/>
-        </customView>
-    </objects>
-    <resources>
-        <image name="KMImageNameElseVIP2" width="9" height="10"/>
-    </resources>
-</document>

+ 0 - 512
PDF Office/PDF Master/Class/Batch/View/KMCustomViewButton.swift

@@ -1,512 +0,0 @@
-//
-//  KMCustomViewButton.swift
-//  PDF Reader Pro
-//
-//  Created by tangchao on 2023/11/2.
-//
-
-import Cocoa
-@objc enum KMCustomViewButtonType: Int {
-    case batchToolbar = 0
-    case menuItem
-    case normal
-}
-
-@objc enum KMCustomViewButtonState: Int {
-    case normal = 0
-    case mouseIn
-    case hightLighted
-}
-
-@objc protocol KMCustomButtonViewPopDataSource: NSObjectProtocol {
-    /// pop框有多少行
-    func numberOfLine(in button: KMCustomViewButton) -> Int
-    /// pop框某行显示的文字
-    func string(for button: KMCustomViewButton, index: Int) -> String?
-    /// 某行是否需要下划线
-    func needInsertSeperateLine(_ button: KMCustomViewButton, index: Int) -> Bool
-    /// 某行是否需要选取
-    func needHightLightLine(_ button: KMCustomViewButton, index: Int) -> Bool
-}
-
-@objc protocol KMCustomButtonViewPopDelegate: NSObjectProtocol {
-    func customViewButton(_ button: KMCustomViewButton, didSelectIndex index: Int)
-}
-
-@objcMembers class KMCustomViewButton: NSView {
-    /// constraint
-    var frontImageLeftConstraint: MASConstraint? //左边图片距离左边约束
-    var frontImageTopConstraint: MASConstraint? //左边图片顶部约束
-    var titleLeftConstraint: MASConstraint? //标题距离左边约束
-    var titleTopConstraint: MASConstraint? //标题顶部约束
-    var backImageLeftConstraint: MASConstraint? //右边图片距离左边约束
-    
-    /// view
-    lazy var imageView: NSImageView = {
-        let view = NSImageView()
-        return view
-    }()
-    lazy var titleTextField: NSTextField = {
-        let view = NSTextField()
-        view.isBordered = false
-        view.drawsBackground = true
-        view.backgroundColor = .clear
-        view.isEditable = false
-        return view
-    }()
-    lazy var indicateImageView: NSImageView = {
-        let view = NSImageView()
-        return view
-    }()
-    weak var layoutReferenceView: NSView?
-    
-    /// layer
-    var backLayer: CALayer?
-    
-    /// state
-    var isSelected = false {
-        didSet {
-            if (self.isSelected) {
-                self._toolbarButtonSelected(true)
-                if let color = self.selectColor {
-                    self.backLayer?.backgroundColor = color.cgColor
-                }
-            } else {
-                self._toolbarButtonSelected(true)
-                self.backLayer?.backgroundColor = .clear
-            }
-        }
-    }
-    
-    var mouseInColor: NSColor?
-    var highLightColor: NSColor?
-    var selectColor: NSColor?
-    
-    /// popover
-    var popOver: NSPopover?
-    
-    var enable = false
-    
-    /// title Attribute
-    var titleAttributeDict: [String : Any]?
-    
-    weak var dataSource: KMCustomButtonViewPopDataSource? {
-        didSet {
-            NotificationCenter.default.removeObserver(self)
-            NotificationCenter.default.addObserver(self, selector: #selector(_closePop), name: NSNotification.Name("KMCloseCustomViewButtonPopNotification"), object: nil)
-        }
-    }
-    weak var delegate: KMCustomButtonViewPopDelegate?
-    
-    private var _showMenuFlag = false
-    
-    private var _type: KMCustomViewButtonType = .batchToolbar
-    private var _state: KMCustomViewButtonState = .normal {
-        didSet {
-            if (self._state == .normal) {
-                if (self.isSelected) {
-                    self.backLayer?.backgroundColor = self.selectColor != nil ? self.selectColor!.cgColor : .clear
-                } else {
-                    self._toolbarButtonSelected(true)
-                    self.backLayer?.backgroundColor = .clear
-                }
-            } else if (self._state == .mouseIn) {
-                self._toolbarButtonSelected(true)
-                if (self.isSelected) {
-                    self.backLayer?.backgroundColor = self.selectColor != nil ? self.selectColor!.cgColor : (self.mouseInColor ?? NSColor.clear).cgColor
-                } else {
-                    self.backLayer?.backgroundColor = (self.mouseInColor ?? NSColor.clear).cgColor
-                }
-            } else if (self._state == .hightLighted) {
-                if (self.isSelected) {
-                    self.backLayer?.backgroundColor = self.selectColor != nil ? self.selectColor!.cgColor : (self.highLightColor ?? NSColor.clear).cgColor
-                } else {
-                    self.backLayer?.backgroundColor = (self.highLightColor ?? NSColor.clear).cgColor
-                }
-            }
-            
-            if (self.titleAttributeDict != nil) {
-                self.titleTextField.textColor = self.titleAttributeDict?["\(self._state.rawValue)"] as? NSColor
-            }
-        }
-    }
-    
-    private weak var _target: AnyObject?
-    private var _action: Selector?
-    
-    deinit {
-        KMPrint("KMCustomViewButton deinit.")
-        NotificationCenter.default.removeObserver(self)
-    }
-    
-    /**
-     * 初始化方法
-     * @param frontImage 头部图片
-     * @param backImage 尾部图片
-     * @param title 标题
-     * @param title 样式
-     *
-     */
-    convenience init(frontImage: NSImage?, backImage: NSImage?, title: String?, type: KMCustomViewButtonType) {
-        if frontImage == nil && backImage == nil && title == nil {
-//            return
-        }
-        self.init()
-        self.wantsLayer = true
-        self.enable = false
-        
-        self._addTrackingArea()
-        self.layoutReferenceView = self
-        var leftMargin = 0.0
-         if (frontImage != nil) {
-             self.addSubview(self.imageView)
-             self.imageView.image = frontImage
-             leftMargin = 8
-             self.imageView.mas_makeConstraints { make in
-                 self.frontImageLeftConstraint = make?.left.equalTo()(self.layoutReferenceView)?.offset()(leftMargin)
-                 make?.centerY.top().equalTo()(self.layoutReferenceView)
-                 self.frontImageTopConstraint = make?.top.equalTo()(self.layoutReferenceView)?.offset()(3)
-             }
-             self.layoutReferenceView = self.imageView
-         }
-        
-        if (title != nil) {
-            self.addSubview(self.titleTextField)
-            self.titleTextField.stringValue = title!
-            self.titleTextField.font = .systemFont(ofSize: 12)
-            self.titleTextField.textColor = KMAppearance.Layout.h0Color()
-            self.titleTextField.mas_makeConstraints { make in
-                if self.isEqual(to: self.layoutReferenceView) {
-                    leftMargin = 30
-                    self.titleLeftConstraint = make?.left.equalTo()(self)?.offset()(leftMargin)
-                    self.titleTopConstraint = make?.top.equalTo()(self)?.offset()(3)
-                    make?.centerY.equalTo()(self)
-                } else {
-                    leftMargin = 8
-                    self.titleLeftConstraint = make?.left.equalTo()(self.imageView.mas_right)?.offset()(leftMargin)
-                    make?.centerY.equalTo()(self)
-                }
-            }
-            self.layoutReferenceView = self.titleTextField
-        }
-        
-        if (backImage != nil) {
-            self.addSubview(self.indicateImageView)
-            self.indicateImageView.image = backImage
-            self.indicateImageView.mas_makeConstraints { make in
-                self.backImageLeftConstraint = make?.left.equalTo()(self.layoutReferenceView?.mas_right)?.offset()(2)
-                make?.centerY.equalTo()(self)
-            }
-            self.layoutReferenceView = self.indicateImageView
-        }
-        
-        self.layoutReferenceView?.mas_makeConstraints({ make in
-            make?.right.equalTo()(self)?.offset()(-leftMargin)
-        })
-        self.configuAppearance(type: type)
-        self._type = type
-        self._state = .normal
-        self.isSelected = false
-    }
-    
-    override func mouseEntered(with event: NSEvent) {
-        if (self.enable) {
-            super.mouseEntered(with: event)
-            self._showPop()
-            if (self.dataSource == nil) {
-                NotificationCenter.default.post(name: NSNotification.Name("KMCloseCustomViewButtonPopNotification"), object: nil)
-            }
-            self._state = .mouseIn
-        }
-    }
-    
-    // MARK: - Public Methods
-    
-    /// 设置设置target-action
-    func addTarget(_ target: AnyObject?, action: Selector?) {
-        self._target = target
-        self._action = action
-    }
-    
-    /// 关闭pop
-    func closePop() {
-        self._closePop()
-    }
-    
-    override func mouseExited(with event: NSEvent) {
-        if (self.enable) {
-            super.mouseExited(with: event)
-            if (self._showMenuFlag) {
-            } else {
-                self._state = .normal
-            }
-        }
-    }
-    
-    override func mouseDown(with event: NSEvent) {
-        if (self.enable) {
-            super.mouseDown(with: event)
-            self._state = .hightLighted
-        }
-    }
-    
-    override func mouseUp(with event: NSEvent) {
-        if (self.enable) {
-            super.mouseUp(with: event)
-            if (self._showMenuFlag) {
-            } else {
-                self._state = .normal
-            }
-            /// 响应事件
-            if let data = (self._target as? NSObject)?.responds(to: self._action), data {
-                (self._target as? NSObject)?.perform(self._action, with: self)
-            }
-        }
-    }
-}
-
-// MARK: - Private Methods
-
-extension KMCustomViewButton {
-    private func _toolbarButtonSelected(_ isSelected: Bool) {
-        //    if (isSelected) {
-        //        if ([self.titleTextField.stringValue isEqualToString:NSLocalizedString(@"Convert")]) {
-        //            self.imageView.image = [NSImage imageNamed:@"KMImageNameUXIconBatchConvert"];
-        //        } else if ([self.titleTextField.stringValue isEqualToString:NSLocalizedString(@"Merge")]) {
-        //            self.imageView.image = [NSImage imageNamed:@"KMImageNameUXIconBatchMerge"];
-        //        } else if ([self.titleTextField.stringValue isEqualToString:NSLocalizedString(@"Compress")]) {
-        //            self.imageView.image = [NSImage imageNamed:@"KMImageNameUXIconBatchOptimize"];
-        //        } else if ([self.titleTextField.stringValue isEqualToString:NSLocalizedString(@"OCR")]) {
-        //            self.imageView.image = [NSImage imageNamed:@"KMImageNameUXIconBatchConvertOCR"];
-        //        } else if ([self.titleTextField.stringValue isEqualToString:NSLocalizedString(@"Security")]) {
-        //            self.imageView.image = [NSImage imageNamed:@"KMImageNameUXIconBatchSafe"];
-        //        } else if ([self.titleTextField.stringValue isEqualToString:NSLocalizedString(@"Watermark")]) {
-        //            self.imageView.image = [NSImage imageNamed:@"KMImageNameUXIconBatchWatermark"];
-        //        } else if ([self.titleTextField.stringValue isEqualToString:NSLocalizedString(@"Background")]) {
-        //            self.imageView.image = [NSImage imageNamed:@"KMImageNameUXIconBatchBackground"];
-        //        } else if ([self.titleTextField.stringValue isEqualToString:NSLocalizedString(@"Header & Footer")]) {
-        //            self.imageView.image = [NSImage imageNamed:@"KMImageNameUXIconBatchHeaderandfooter"];
-        //        } else if ([self.titleTextField.stringValue isEqualToString:NSLocalizedString(@"Bates Numbers")]) {
-        //            self.imageView.image = [NSImage imageNamed:@"KMImageNameUXIconBatchBates"];
-        //        }
-        //    } else {
-        if self.titleTextField.stringValue == KMLocalizedString("Convert") {
-            self.imageView.image = NSImage(named: "KMImageNameUXIconBatchConvertNor")
-        } else if self.titleTextField.stringValue == KMLocalizedString("Merge") {
-            self.imageView.image = NSImage(named: "KMImageNameUXIconBatchMergeNor")
-        } else if self.titleTextField.stringValue == KMLocalizedString("Compress") {
-            self.imageView.image = NSImage(named: "KMImageNameUXIconBatchOptimizeNor")
-        } else if self.titleTextField.stringValue == KMLocalizedString("OCR") {
-            self.imageView.image = NSImage(named: "KMImageNameUXIconBatchConvertOCRNor")
-        } else if self.titleTextField.stringValue == KMLocalizedString("Security") {
-            self.imageView.image = NSImage(named: "KMImageNameUXIconBatchSafeNor")
-        } else if self.titleTextField.stringValue == KMLocalizedString("Watermark") {
-            self.imageView.image = NSImage(named: "KMImageNameUXIconBatchWatermarkNor")
-        } else if self.titleTextField.stringValue == KMLocalizedString("Background") {
-            self.imageView.image = NSImage(named: "KMImageNameUXIconBatchBackgroundNor")
-        } else if self.titleTextField.stringValue == KMLocalizedString("Header & Footer") {
-            self.imageView.image = NSImage(named: "KMImageNameUXIconBatchHeaderandfooterNor")
-        } else if self.titleTextField.stringValue == KMLocalizedString("Bates Numbers") {
-            self.imageView.image = NSImage(named: "KMImageNameUXIconBatchBatesNor")
-        }
-
-        //    }
-    }
-    
-    @objc private func _closePop() {
-        self.popOver?.close()
-        self._state = .normal
-    }
-    
-    private func _showPop() {
-        if (self.delegate == nil || self.dataSource == nil) {
-            return
-        }
-        
-        let menuViewController = KMCustomButtonPopMenuViewController()
-        menuViewController.delegate = self
-        menuViewController.dataSources = self
-        if (self.popOver == nil) {
-            self.popOver = NSPopover()
-        }
-        
-        self.popOver?.delegate = self
-        self.popOver?.contentViewController = menuViewController
-        self.popOver?.animates = false
-        self.popOver?.behavior = .semitransient
-        self.popOver?.contentSize = menuViewController.view.frame.size
-        
-        var sourcesRect = self.bounds
-        sourcesRect = self.convert(sourcesRect, to: nil)
-        sourcesRect.origin.y -= 20
-        sourcesRect.size.height+=20
-        self.window?.popover = self.popOver
-        self.window?.sourcesRect = sourcesRect
-        self.popOver?.show(relativeTo: KMRectInset(self.bounds, 0, 5), of: self, preferredEdge: .minY)
-    }
-    
-    private func _addTrackingArea() {
-        let trackingArea = NSTrackingArea(rect: self.bounds, options: [.mouseEnteredAndExited, .inVisibleRect, .activeAlways,.mouseMoved], owner: self)
-        self.addTrackingArea(trackingArea)
-    }
-}
-
-// MARK: - NSPopoverDelegate
-
-extension KMCustomViewButton: NSPopoverDelegate {
-    func popoverDidShow(_ notification: Notification) {
-        self._showMenuFlag = true
-    }
-    
-    func popoverDidClose(_ notification: Notification) {
-        self._showMenuFlag = false
-        self._state = .normal
-    }
-}
-
-// MARK: - KMCustomButtonPopMenuViewControllerDelegate, KMCustomButtonPopMenuViewControllerDataSources
-
-extension KMCustomViewButton: KMCustomButtonPopMenuViewControllerDelegate, KMCustomButtonPopMenuViewControllerDataSources {
-    func customViewButtonPopDidSelectIndex(_ index: Int) {
-        if let _ = self.delegate?.customViewButton(self, didSelectIndex: index) {
-            self._closePop()
-        }
-    }
-    
-    func numberOfLine() -> Int {
-        if let data = self.dataSource?.numberOfLine(in: self) {
-            return data
-        }
-        return 0
-    }
-    
-    /// pop框某行显示的文字
-    func stringForLine(at index: Int) -> String? {
-        if let data = self.dataSource?.string(for: self, index: index) {
-            return data
-        }
-        return nil;
-    }
-    
-    /// 某行是否需要下划线
-    func needInsertSeperateLine(at index: Int) -> Bool {
-        if let data = self.dataSource?.needInsertSeperateLine(self, index: index) {
-            return data
-        }
-        return false
-    }
-    
-    /// 某行是否需要选取
-    func needHightLightLine(at index: Int) -> Bool {
-        if let data = self.dataSource?.needHightLightLine(self, index: index) {
-            return data
-        }
-        return false
-    }
-    
-    func imageForLine(at index: Int) -> NSImage? {
-        return nil
-    }
-    
-    func itemEnable(at index: Int) -> Bool {
-        return true
-    }
-}
-
-// MARK: - Appearance
-
-extension KMCustomViewButton {
-    func configuAppearance(type: KMCustomViewButtonType) {
-        if (type == .batchToolbar) {
-            self.backLayer = CALayer()
-            self.backLayer?.frame = self.layer?.frame ?? NSRect.zero
-            self.backLayer?.autoresizingMask = [.layerWidthSizable, .layerHeightSizable]
-            self.layer?.addSublayer(self.backLayer!)
-            self.backLayer?.cornerRadius = 6.0;
-            self.selectColor = KMAppearance.Status.selColor()
-            self.highLightColor = KMAppearance.Status.selColor()
-            self.mouseInColor = KMAppearance.Status.selColor()
-        } else if (type == .menuItem) {
-            self.alignCenter(margin: 10)
-            self.changeTopMargin(5)
-        }
-    }
-    
-    /// 调整按钮左右间距并居中
-    func alignCenter(margin: CGFloat) {
-        self.changeLeftMargin(margin)
-        self.changeRightMargin(margin)
-    }
-    
-    /// 调整顶部间距离
-    func changeTopMargin(_ topMargin: CGFloat) {
-        let v = self._leftestView()
-        if self.imageView.isEqual(to: v) {
-            self.imageView.mas_updateConstraints { make in
-                make?.top.equalTo()(self)?.offset()(topMargin)
-            }
-        } else if self.titleTextField.isEqual(to: v) {
-            self.titleTextField.mas_updateConstraints { make in
-                make?.top.equalTo()(self)?.offset()(topMargin)
-            }
-        } else if self.indicateImageView.isEqual(to: v) {
-            
-        }
-    }
-    /// 调整按钮左边间距
-    func changeLeftMargin(_ leftMargin: CGFloat) {
-        let v = self._leftestView()
-        if self.imageView.isEqual(to: v) {
-            self.imageView.mas_updateConstraints { make in
-                self.frontImageLeftConstraint = make?.left.equalTo()(self)?.offset()(leftMargin)
-            }
-        } else if self.titleTextField.isEqual(to: v) {
-            self.titleTextField.mas_updateConstraints { make in
-                self.titleLeftConstraint = make?.left.equalTo()(self)?.offset()(leftMargin)
-            }
-        } else if self.indicateImageView.isEqual(to: v) {
-            self.indicateImageView.mas_updateConstraints { make in
-                self.backImageLeftConstraint = make?.left.equalTo()(self)?.offset()(leftMargin)
-            }
-        }
-    }
-    /// 调整按钮右边间距
-    func changeRightMargin(_ rightMargin: CGFloat) {
-        let v = self._rightestView()
-        if self.imageView.isEqual(to: v) {
-            self.imageView.mas_updateConstraints { make in
-                make?.right.equalTo()(self)?.offset()(-rightMargin)
-            }
-        } else if self.titleTextField.isEqual(to: v) {
-            self.titleTextField.mas_updateConstraints { make in
-                make?.right.equalTo()(self)?.offset()(-rightMargin)
-            }
-        } else if self.indicateImageView.isEqual(to: v) {
-            self.indicateImageView.mas_updateConstraints { make in
-                make?.right.equalTo()(self)?.offset()(-rightMargin)
-            }
-        }
-    }
-    
-    private func _leftestView() -> NSView? {
-        if self.subviews.contains(self.imageView) {
-            return self.imageView
-        } else if self.subviews.contains(self.titleTextField) {
-            return self.titleTextField
-        } else if (self.subviews.contains(self.indicateImageView)) {
-            return self.indicateImageView
-        }
-        return nil
-    }
-    
-    private func _rightestView() -> NSView? {
-        if self.subviews.contains(self.indicateImageView) {
-            return self.indicateImageView
-        } else if self.subviews.contains(self.titleTextField) {
-            return self.titleTextField
-        } else if self.subviews.contains(self.imageView) {
-            return self.imageView
-        }
-        return nil
-    }
-}

+ 0 - 213
PDF Office/PDF Master/Class/Batch/View/KMSlider.swift

@@ -1,213 +0,0 @@
-//
-//  KMSlider.swift
-//  PDF Reader Pro
-//
-//  Created by kdanmobile on 2023/10/31.
-//
-
-import Cocoa
-@objc(SJTSliderDelegate)
-protocol SJTSliderDelegate: AnyObject {
-    func tipForValue(inSlider slider: KMSlider, value: Double) -> String
-    func valueDidSelect(inSlider slider: KMSlider)
-}
-
-let SJTSliderTipPopoverMinWidthX = 60.0;
-let SJTSliderTipPopoverMinWidthY = 40.0;
-let SJTSliderTipPopoverMinHeightX = 38.0;
-let SJTSliderTipPopoverMinHeightY = 24.0;
-let SJTSliderMinHeight = 21.0;
-let SJTSliderMinHeightWithTickMark = 26.0;
-let SJTSliderMinWidth = 100.0;
-let SJTSliderTickMarkMinWidth = 5.0;
-let SJTSliderPositioningRectkey = "positioningRect"
-
-class KMSlider: NSSlider, NSPopoverDelegate{
-    var tipEnabled: Bool = false
-    var tipAutoAlignment: Bool = false
-    var tipAlignment: NSTextAlignment = .left
-    var tipAppearance: NSAppearance?
-    var delegate: SJTSliderDelegate?
-    private var tipPopover: NSPopover?
-    
-    required init?(coder: NSCoder) {
-        super.init(coder: coder)
-        self.initView()
-    }
-    
-    func initView() {
-        self.isContinuous = true
-        self.tipEnabled = true
-        self.tipAutoAlignment = true
-        self.tipAlignment = .center
-        self.tipAppearance = NSAppearance(named: NSAppearance.Name.vibrantLight)
-        let trackingArea = NSTrackingArea(rect: NSZeroRect, options: [.inVisibleRect, .mouseEnteredAndExited, .mouseMoved, .activeInActiveApp], owner: self, userInfo: nil)
-        self.addTrackingArea(trackingArea)
-        
-        let tipView = NSTextField()
-        tipView.isBordered = false
-        tipView.backgroundColor = NSColor.clear
-        tipView.isEditable = false
-        tipView.isSelectable = false
-        tipView.alignment = .center
-        let contentView = NSView()
-        contentView.addSubview(tipView)
-        
-        self.tipPopover = NSPopover()
-        self.tipPopover?.contentViewController = NSViewController()
-        self.tipPopover?.contentViewController?.view = contentView
-        self.tipPopover?.delegate = self
-    }
-    
-    override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
-        if object as? NSObject == self.tipPopover && keyPath == SJTSliderPositioningRectkey {
-            self.adjustTipAlignment()
-        }
-    }
-    
-    override func sendAction(_ action: Selector?, to target: Any?) -> Bool {
-        if tipEnabled {
-            showTipPopover(animated: false)
-        }
-        
-        let event = NSApplication.shared.currentEvent
-        if event?.type == NSEvent.EventType.leftMouseUp {
-            delegate?.valueDidSelect(inSlider: self)
-        }
-        
-        return super.sendAction(action, to: target)
-    }
-    
-    func adjustTipAlignment() {
-        guard let tipContentView = self.tipPopover?.contentViewController?.view else {
-            return
-        }
-        guard let tipView = tipContentView.subviews.first as? NSTextField else {
-            return
-        }
-        
-        var tipAlignment: NSTextAlignment = .center
-        if self.tipAutoAlignment {
-            var tipContentFrame = tipContentView.convert(tipContentView.bounds, to: nil)
-            tipContentFrame = tipContentView.window?.convertToScreen(tipContentFrame) ?? NSRect.zero
-            tipContentFrame = self.window?.convertFromScreen(tipContentFrame) ?? NSRect.zero
-            if let tipTargetFrame = self.tipPopover?.positioningRect {
-                if NSMaxX(tipContentFrame) < NSMinX(tipTargetFrame) {
-                    tipAlignment = .right
-                } else if NSMinX(tipContentFrame) > NSMaxX(tipTargetFrame) {
-                    tipAlignment = .left
-                }
-            }
-        } else {
-            tipAlignment = self.tipAlignment
-        }
-        tipView.alignment = tipAlignment
-    }
-    
-    func showTipPopover(animated: Bool) {
-        let tip = self.tipForValue(self.doubleValue)
-        if !tip.isEmpty {
-            let contentView = self.tipPopover?.contentViewController?.view
-            if let tipView = contentView?.subviews[0] as? NSTextField {
-                let knobRect = (self.cell as? NSSliderCell)?.knobRect(flipped: self.isFlipped)
-                var preferredEdge: NSRectEdge?
-                var newcell: NSSliderCell = self.cell as! NSSliderCell
-                if newcell.sliderType == .circular {
-                    let tickMartCenter = NSMakePoint(NSMidX(knobRect!), NSMidY(knobRect!))
-                    let viewCenter = NSMakePoint(NSMidX(self.bounds), NSMidY(self.bounds))
-                    let cutoffValue = sqrt(((viewCenter.x - tickMartCenter.x) * (viewCenter.x - tickMartCenter.x) + (viewCenter.y - tickMartCenter.y) * (viewCenter.y - tickMartCenter.y)) / 2) as CGFloat
-                    
-                    if viewCenter.x-tickMartCenter.x > cutoffValue {
-                        preferredEdge = NSRectEdge.minX
-                    } else if tickMartCenter.y-viewCenter.y > cutoffValue {
-                        preferredEdge = NSRectEdge.maxY
-                    } else if tickMartCenter.x-viewCenter.x > cutoffValue {
-                        preferredEdge = NSRectEdge.maxX
-                    } else {
-                        preferredEdge = NSRectEdge.minY
-                    }
-                } else if self.isVertical {
-                    if self.tickMarkPosition == NSSlider.TickMarkPosition.leading {
-                        preferredEdge = NSRectEdge.minX
-                    } else {
-                        preferredEdge = NSRectEdge.maxX
-                    }
-                } else {
-                    if self.tickMarkPosition == NSSlider.TickMarkPosition.below {
-                        preferredEdge = self.isFlipped ? NSRectEdge.maxY : NSRectEdge.minY
-                    } else {
-                        preferredEdge = self.isFlipped ? NSRectEdge.minY : NSRectEdge.maxY
-                    }
-                }
-                
-                self.tipPopover?.appearance = self.tipAppearance
-                tipView.stringValue = tip
-                tipView.sizeToFit()
-                var tipViewFrame = tipView.bounds
-                var contentViewSize = tipView.bounds.size
-                var minWidth, minHeight: Int
-                
-                if preferredEdge == NSRectEdge.minX || preferredEdge == NSRectEdge.maxX {
-                    minWidth = Int(SJTSliderTipPopoverMinWidthX)
-                    minHeight = Int(SJTSliderTipPopoverMinHeightX)
-                } else {
-                    minWidth = Int(SJTSliderTipPopoverMinWidthY)
-                    minHeight = Int(SJTSliderTipPopoverMinHeightY)
-                }
-                
-                if Int(tipViewFrame.size.width) < minWidth {
-                    tipViewFrame.size.width = CGFloat(minWidth)
-                    tipViewFrame.origin.x = (CGFloat(minWidth)-tipViewFrame.size.width)/2
-                    contentViewSize.width = CGFloat(minWidth)
-                }
-                
-                if Int(tipViewFrame.size.height) < minHeight {
-                    tipViewFrame.origin.y = (CGFloat(minHeight)-tipViewFrame.size.height)/2
-                    contentViewSize.height = CGFloat(minHeight)
-                }
-                
-                contentView?.setFrameSize(contentViewSize)
-                tipView.frame = tipViewFrame
-                self.tipPopover?.contentSize = contentViewSize
-                
-                self.tipPopover?.animates = animated
-                self.tipPopover?.show(relativeTo: knobRect!, of: self, preferredEdge: preferredEdge!)
-            }
-        }
-    }
-    
-    func tipForValue(_ value: Double) -> String {
-        if let tip = self.delegate?.tipForValue(inSlider: self, value: self.doubleValue) {
-           return tip
-        }
-        return String(format: "%0.f", self.doubleValue)
-    }
-    
-    func closeTipPopover(animated: Bool) {
-        if ((self.tipPopover?.isShown) != nil) {
-            self.tipPopover?.animates = animated 
-            self.tipPopover?.close()
-        }
-    }
-}
-
-extension KMSlider {
-    override func mouseDown(with event: NSEvent) {
-        if self.tipEnabled {
-            self.showTipPopover(animated: true)
-        }
-        super.mouseDown(with: event)
-    }
-    
-    override func mouseEntered(with theEvent: NSEvent) {
-        if self.tipEnabled {
-            self.showTipPopover(animated: true)
-        }
-    }
-    
-    override func mouseExited(with theEvent: NSEvent) {
-        self.closeTipPopover(animated: true)
-    }
-}
-
-

+ 0 - 75
PDF Office/PDF Master/Class/Batch/WindowController/KMAlertWindowController.swift

@@ -1,75 +0,0 @@
-//
-//  KMAlertWindowController.swift
-//  PDF Reader Pro
-//
-//  Created by kdanmobile on 2023/10/27.
-//
-
-import Cocoa
-
-typealias alertConfirmCallback = () -> ()
-
-let kShowRemoveAllFilesHintinterfaceKey = "kShowRemoveAllFilesHintinterfaceKey"
-
-class KMAlertWindowController: NSWindowController{
-    var alertConfirmCallback: alertConfirmCallback?
-    
-    @IBOutlet var titleLabel: NSTextField!
-    
-    @IBOutlet var alertCheckButton: NSButton!
-    
-    @IBOutlet var cancelButton: NSButton!
-    
-    @IBOutlet var actionButton: NSButton!
-    
-    @objc class func swiftLoad() {
-        let dict: NSDictionary = UserDefaults.standard.dictionaryRepresentation() as NSDictionary
-        var X = false
-        for  key  in dict.allKeys {
-            if let data = key as? String, data == kShowRemoveAllFilesHintinterfaceKey{
-                X = true
-            }
-        }
-        if !X {
-            UserDefaults().set(true, forKey: kShowRemoveAllFilesHintinterfaceKey)
-        }
-    }
-    override func windowDidLoad() {
-        super.windowDidLoad()
-        self.titleLabel.stringValue = NSLocalizedString("Remove All", comment: "")
-        self.alertCheckButton.title = NSLocalizedString("No longer prompt", comment: "")
-        self.cancelButton.title = NSLocalizedString("Cancel", comment: "")
-        self.actionButton.title = NSLocalizedString("Remove All", comment: "")
-    }
-    
-    @IBAction func buttonClicked_Cancel(_ sender: NSButton) {
-        self.setNeedShowRemoveAllFilesHint()
-        self.dismissSheet(sender)
-    }
-    
-    @IBAction func buttonClicked_OK(_ sender: NSButton) {
-        self.setNeedShowRemoveAllFilesHint()
-        setNeedShowRemoveAllFilesHint()
-        self.alertConfirmCallback?()
-        self.dismissSheet(sender)
-    }
-    
-    func setNeedShowRemoveAllFilesHint() {
-        UserDefaults.standard.set(self.alertCheckButton.state == .on ? false : true, forKey: kShowRemoveAllFilesHintinterfaceKey) 
-        UserDefaults.standard.synchronize()
-    }
-    
-    func dismissSheet(_ sender: NSButton) {
-        if #available(macOS 10.13, *) {
-            self.window?.endSheet(sender.window!)
-        } else {
-            NSApp.endSheet(self.window!)
-        }
-        self.window?.orderOut(self)
-    }
-    
-    class func needShowRemoveAllFilesHint() -> Bool {
-        return UserDefaults().bool(forKey: kShowRemoveAllFilesHintinterfaceKey)
-    }
-    
-}

+ 0 - 86
PDF Office/PDF Master/Class/Batch/WindowController/KMAlertWindowController.xib

@@ -1,86 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="23504" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
-    <dependencies>
-        <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="23504"/>
-        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
-    </dependencies>
-    <objects>
-        <customObject id="-2" userLabel="File's Owner" customClass="NSAlertWindowController" customModule="PDF_Reader_Pro" customModuleProvider="target">
-            <connections>
-                <outlet property="actionButton" destination="ysS-2k-HPo" id="qaJ-km-j4F"/>
-                <outlet property="alertCheckButton" destination="Ss5-2o-1Dn" id="QAq-RC-Zd2"/>
-                <outlet property="cancelButton" destination="zsE-FI-kaQ" id="wtU-IL-c6h"/>
-                <outlet property="titleLabel" destination="oE7-Dp-pX1" id="q2v-ya-T4a"/>
-                <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" visibleAtLaunch="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="480" height="270"/>
-            <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="480" height="123"/>
-                <autoresizingMask key="autoresizingMask"/>
-                <subviews>
-                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="oE7-Dp-pX1">
-                        <rect key="frame" x="22" y="89" width="40" height="16"/>
-                        <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="F1Y-TD-Qwj">
-                            <font key="font" metaFont="systemBold"/>
-                            <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                            <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                        </textFieldCell>
-                    </textField>
-                    <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Ss5-2o-1Dn">
-                        <rect key="frame" x="22" y="52" width="65" height="18"/>
-                        <buttonCell key="cell" type="check" title="Check" bezelStyle="regularSquare" imagePosition="left" inset="2" id="tpt-Dh-7Fl">
-                            <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
-                            <font key="font" metaFont="system"/>
-                        </buttonCell>
-                    </button>
-                    <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="zsE-FI-kaQ">
-                        <rect key="frame" x="323" y="11" width="75" height="32"/>
-                        <buttonCell key="cell" type="push" title="Button" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="qpU-aB-hza">
-                            <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                            <font key="font" metaFont="system"/>
-                        </buttonCell>
-                        <connections>
-                            <action selector="buttonClicked_Cancel:" target="-2" id="kba-bs-Qsg"/>
-                        </connections>
-                    </button>
-                    <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ysS-2k-HPo">
-                        <rect key="frame" x="398" y="11" width="75" height="32"/>
-                        <buttonCell key="cell" type="push" title="Button" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="bUa-ym-CA2">
-                            <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                            <font key="font" metaFont="system"/>
-                            <string key="keyEquivalent" base64-UTF8="YES">
-DQ
-</string>
-                        </buttonCell>
-                        <connections>
-                            <action selector="buttonClicked_OK:" target="-2" id="IrN-3B-w5a"/>
-                        </connections>
-                    </button>
-                </subviews>
-                <constraints>
-                    <constraint firstItem="Ss5-2o-1Dn" firstAttribute="leading" secondItem="oE7-Dp-pX1" secondAttribute="leading" id="AYz-zn-Tfh"/>
-                    <constraint firstItem="Ss5-2o-1Dn" firstAttribute="top" secondItem="oE7-Dp-pX1" secondAttribute="bottom" constant="20" id="QuX-dn-jrK"/>
-                    <constraint firstItem="oE7-Dp-pX1" firstAttribute="top" secondItem="se5-gp-TjO" secondAttribute="top" constant="18" id="SRI-Wr-uxY"/>
-                    <constraint firstItem="oE7-Dp-pX1" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" constant="24" id="SSp-26-c91"/>
-                    <constraint firstAttribute="trailing" secondItem="ysS-2k-HPo" secondAttribute="trailing" constant="14" id="V1E-Gh-5w6"/>
-                    <constraint firstItem="zsE-FI-kaQ" firstAttribute="top" secondItem="Ss5-2o-1Dn" secondAttribute="bottom" constant="15" id="e23-IR-hgF"/>
-                    <constraint firstItem="ysS-2k-HPo" firstAttribute="centerY" secondItem="zsE-FI-kaQ" secondAttribute="centerY" id="kaY-5L-ENc"/>
-                    <constraint firstAttribute="bottom" secondItem="ysS-2k-HPo" secondAttribute="bottom" constant="18" id="nOi-GR-wAx"/>
-                    <constraint firstItem="ysS-2k-HPo" firstAttribute="leading" secondItem="zsE-FI-kaQ" secondAttribute="trailing" constant="14" id="xam-1O-CR5"/>
-                </constraints>
-            </view>
-            <connections>
-                <outlet property="delegate" destination="-2" id="0bl-1N-AYu"/>
-            </connections>
-            <point key="canvasLocation" x="-100" y="114"/>
-        </window>
-    </objects>
-</document>

+ 0 - 37
PDF Office/PDF Master/Class/Batch/WindowController/KMTextHintWindowController.swift

@@ -1,37 +0,0 @@
-//
-//  KMTextHintWindowController.swift
-//  PDF Reader Pro
-//
-//  Created by kdanmobile on 2023/11/2.
-//
-
-import Cocoa
-
-class KMTextHintWindowController: NSWindowController{
-    
-    @IBOutlet var headerTextField: NSTextField!
-    
-    @IBOutlet var detailTextfield: NSTextField!
-    
-    @IBOutlet var actionButton: NSButton!
-    
-    override func windowDidLoad() {
-        super.windowDidLoad()
-        self.actionButton.title = NSLocalizedString("OK", comment: "")
-        self.headerTextField.stringValue = NSLocalizedString("Cannot add conversion tasks.", comment: "")
-        self.detailTextfield.stringValue = NSLocalizedString("The conversion is in progress... Please wait for the conversion to be completed before proceeding.", comment: "")
-    }
-    
-    @IBAction func buttonClicked_Action(_ sender: NSButton) {
-        if #available(macOS 10.13, *) {
-            self.window?.endSheet(sender.window!)
-        } else {
-            NSApp.endSheet(self.window!)
-        }
-        self.window?.orderOut(self)
-    }
-    func updateTitleString(titleString: String, detailString: String) {
-        self.headerTextField.stringValue = titleString
-        self.detailTextfield.stringValue = detailString
-    }
-}

+ 0 - 77
PDF Office/PDF Master/Class/Batch/WindowController/KMTextHintWindowController.xib

@@ -1,77 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22154" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
-    <dependencies>
-        <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22154"/>
-        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
-    </dependencies>
-    <objects>
-        <customObject id="-2" userLabel="File's Owner" customClass="KMTextHintWindowController" customModule="PDF_Master" customModuleProvider="target">
-            <connections>
-                <outlet property="actionButton" destination="x5y-RO-Lmv" id="rq1-LN-0Xl"/>
-                <outlet property="detailTextfield" destination="ry0-kd-mg3" id="hOn-CU-p3h"/>
-                <outlet property="headerTextField" destination="l42-pQ-rSZ" id="LEa-NJ-HMr"/>
-                <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" visibleAtLaunch="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="385" height="258"/>
-            <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="385" height="133"/>
-                <autoresizingMask key="autoresizingMask"/>
-                <subviews>
-                    <textField focusRingType="none" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="l42-pQ-rSZ">
-                        <rect key="frame" x="22" y="99" width="184" height="16"/>
-                        <textFieldCell key="cell" selectable="YES" title="Cannot add conversion task" id="NfC-Cv-b95">
-                            <font key="font" metaFont="systemBold"/>
-                            <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                            <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                        </textFieldCell>
-                    </textField>
-                    <textField focusRingType="none" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="ry0-kd-mg3">
-                        <rect key="frame" x="22" y="46" width="341" height="45"/>
-                        <textFieldCell key="cell" selectable="YES" id="wDd-jS-7Pi">
-                            <font key="font" metaFont="cellTitle"/>
-                            <string key="title">The current conversion is in progress...
-Please wait for the conversion to be completed before proceeding.</string>
-                            <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                            <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                        </textFieldCell>
-                    </textField>
-                    <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="x5y-RO-Lmv">
-                        <rect key="frame" x="303" y="11" width="75" height="32"/>
-                        <buttonCell key="cell" type="push" title="Button" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="5pj-EG-tmU">
-                            <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                            <font key="font" metaFont="system"/>
-                            <string key="keyEquivalent" base64-UTF8="YES">
-DQ
-</string>
-                        </buttonCell>
-                        <connections>
-                            <action selector="buttonClicked_Action:" target="-2" id="zpF-T3-a6t"/>
-                        </connections>
-                    </button>
-                </subviews>
-                <constraints>
-                    <constraint firstAttribute="trailing" secondItem="ry0-kd-mg3" secondAttribute="trailing" constant="24" id="7Av-f2-oJO"/>
-                    <constraint firstItem="ry0-kd-mg3" firstAttribute="leading" secondItem="l42-pQ-rSZ" secondAttribute="leading" id="9X3-pO-YU0"/>
-                    <constraint firstAttribute="trailing" secondItem="x5y-RO-Lmv" secondAttribute="trailing" constant="14" id="D6Q-bI-Xh9"/>
-                    <constraint firstItem="l42-pQ-rSZ" firstAttribute="top" secondItem="se5-gp-TjO" secondAttribute="top" constant="18" id="EQb-qq-tfG"/>
-                    <constraint firstItem="ry0-kd-mg3" firstAttribute="top" secondItem="l42-pQ-rSZ" secondAttribute="bottom" constant="8" id="W21-yo-QVO"/>
-                    <constraint firstItem="x5y-RO-Lmv" firstAttribute="top" secondItem="ry0-kd-mg3" secondAttribute="bottom" constant="8" id="WzS-9m-BQr"/>
-                    <constraint firstAttribute="bottom" secondItem="x5y-RO-Lmv" secondAttribute="bottom" constant="18" id="Z74-pW-WEo"/>
-                    <constraint firstItem="l42-pQ-rSZ" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" constant="24" id="a2c-AF-SJc"/>
-                </constraints>
-            </view>
-            <connections>
-                <outlet property="delegate" destination="-2" id="0bl-1N-AYu"/>
-            </connections>
-            <point key="canvasLocation" x="-147.5" y="107"/>
-        </window>
-    </objects>
-</document>

+ 0 - 968
PDF Office/PDF Master/Class/Batch/WindowController/VC/KMBatchOperateConvertViewController.swift

@@ -1,968 +0,0 @@
-//
-//  KMBatchOperateConvertViewController.swift
-//  PDF Reader Pro
-//
-//  Created by kdanmobile on 2023/11/1.
-//
-
-import Cocoa
-
-typealias detailInfoViewMouseDownCallback = (_ mouseDown: Bool) -> ()
-
-class KMDetailInfoView: NSView{
-    var mouseDownCallback: detailInfoViewMouseDownCallback?
-    override func mouseDown(with event: NSEvent) {
-        super.mouseDown(with: event)
-        guard let callBack = mouseDownCallback else { return }
-        callBack(true)
-    }
-}
-
-class KMBatchOperateConvertViewController: KMBatchOperateBaseViewController{
-    var dataSourcesArray: [KMConvertWithPDFType]?
-    @IBOutlet var bottomView: NSView!
-    
-    @IBOutlet var convertButton: NSButton!
-    
-    @IBOutlet var buttonBottemOffset: NSLayoutConstraint!
-    @IBOutlet var detailInfoLabel: NSTextField!
-    @IBOutlet var detailInfoBox: NSBox!
-    
-    @IBOutlet var separateStypeTopOffset: NSLayoutConstraint!
-    
-    @IBOutlet var separateStypeBox: NSBox!
-    @IBOutlet var wordButtonOne: NSButton!
-    @IBOutlet var wordButtonTwo: NSButton!
-    
-    @IBOutlet var excelStyleBox: NSBox!
-    @IBOutlet var allContentMenu: NSPopUpButton!
-    @IBOutlet var allContentMenu2: NSMenuItem!
-    @IBOutlet var allContentMenu3: NSMenuItem!
-    @IBOutlet var onlyTextBtn: NSButton!
-    @IBOutlet var onlyTableBtn: NSButton!
-    @IBOutlet var allContentBtn: NSButton!
-    @IBOutlet var tableMenu1: NSMenuItem!
-    @IBOutlet var tableMenu2: NSMenuItem!
-    @IBOutlet var tableMenu3: NSMenuItem!
-    @IBOutlet var tableMenu: NSPopUpButton!
-        
-    @IBOutlet var csvExtractButton: NSButton!
-    
-    @IBOutlet var ocrBox: NSBox!
-    @IBOutlet var ocrLabel: NSTextField!
-    @IBOutlet var ocrButton: NSButton!
-    @IBOutlet var ocrLanguageBox: NSPopUpButton!
-    @IBOutlet var ocrTopOffset: NSLayoutConstraint!
-
-    @IBOutlet var headerView: KMConvertCollectionViewHeader!
-    @IBOutlet var headerTopOffset: NSLayoutConstraint!
-
-    @IBOutlet var formatLabel: NSTextField!
-    @IBOutlet var formatSelectButton: NSPopUpButton!
-        
-    var excelContentOption: CPDFConvertExcelContentOptions?
-    var excelWorksheetOption: CPDFConvertExcelWorksheetOptions?
-    var haveFiles: Bool = false
-    
-    private var ocrLanguage_: COCRLanguage = .english
-    
-    deinit {
-        NotificationCenter.default.removeObserver(self)
-    }
-    override var interfaceStatus: KMBatchOperateInterfaceStatus?{
-        set{
-            super.interfaceStatus = newValue
-            self.convertButton.isEnabled = true
-            if newValue == .Processing  {
-                formatSelectButton.isEnabled = false
-                self.convertButton.title = NSLocalizedString("Cancel", comment: "")
-                self.convertButton.tag = 2
-                self.convertButton.setTitleColor(KMAppearance.Layout.w0Color())
-                self.convertButton.layer?.backgroundColor = KMAppearance.Interactive.m0Color().cgColor
-                if self.convertType == .WordStandard {
-                    self.convertButton.title = NSLocalizedString("Convert", comment: "")
-                    self.convertButton.layer?.backgroundColor = KMAppearance.Interactive.m0Color().withAlphaComponent(0.4).cgColor
-                    self.convertButton.isEnabled = false
-                }
-            } else {
-                DispatchQueue.main.asyncAfter(deadline: .now() + 0.4) {
-                    var files: [URL] = []
-                    for url in self.successFilePathURLArray! {
-                        if FileManager.default.fileExists(atPath: url.path) {
-                            files.append(url)
-                        }
-                    }
-                    if files.count > 0 {
-                        let workspace = NSWorkspace.shared
-                        workspace.activateFileViewerSelecting(files)
-                    }
-                }
-                formatSelectButton.isEnabled = true
-                self.convertButton.title = NSLocalizedString("Convert", comment: "")
-                self.convertButton.tag = 1
-                self.convertButton.setTitleColor(KMAppearance.Layout.w0Color())
-                self.convertButton.layer?.backgroundColor = KMAppearance.Interactive.m0Color().cgColor
-            }
-        }
-        get{
-            return super.interfaceStatus
-        }
-    }
-    override var convertType: KMConvertWithPDFType?{
-        set{
-            super.convertType = newValue
-            changeAllFilesToConvertType(convertType!)
-            fetchFileListViewController()?.reloadConvertInterface(withType: convertType!)
-        }
-        get{
-            return super.convertType
-        }
-    }
-    func changeAllFilesToConvertType(_ type: KMConvertWithPDFType) {
-        for i in 0..<self.files!.count {
-            let file = self.files![i]
-            file.convertType = type
-        }
-    }
-    
-    func switchToConvertType(_ convertType: KMConvertWithPDFType) {
-        self.convertType = convertType
-        self.manualSelectRow(convertType)
-        self.updateBottomView()
-    }
-    
-    func manualSelectRow(_ convertType: KMConvertWithPDFType) {
-        var index = -1
-        updateFormatView()
-        for i in 0..<self.dataSourcesArray!.count {
-            let number = self.dataSourcesArray![i]
-            if number.rawValue == convertType.rawValue {
-                index = i
-                break
-            }
-        }
-        if index != -1 {
-            self.formatSelectButton.selectItem(at: index)
-        }
-    }
-    
-    func updateBottomView() {
-        var isShowUpgrade = false
-        
-#if VERSION_FREE
-#if VERSION_DMG
-        // 桌机版
-        if IAPProductsManager.default().isAvailableAllFunction() {
-            if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
-            } else {
-                isShowUpgrade = true
-            }
-        } else {
-            isShowUpgrade = true
-        }
-#else
-        // 免费版
-        if IAPProductsManager.default().isAvailableAllFunction() {
-            if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
-            } else {
-                isShowUpgrade = true
-            }
-        } else {
-            isShowUpgrade = true
-        }
-        
-#endif
-#else
-        if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
-        } else {
-            isShowUpgrade = true
-        }
-#endif
-//        if !isShowUpgrade {
-//            headerView.isHidden = true
-//            headerTopOffset.constant = 0
-//        } else {
-//            headerView.isHidden = false
-//            headerTopOffset.constant = self.headerView.frame.height
-//        }
-
-        var moreLabelString = ""
-#if VERSION_FREE
-        if !IAPProductsManager.default().isAvailableAllFunction() {
-            moreLabelString = String(format: "%@ %@", KMLocalizedString("The first 10 pages for free"), KMLocalizedString("Unlimited Convert"))
-        }else {
-            if !IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
-                if .WordAdvance == self.convertType ||
-                    .WordStandard == self.convertType ||
-                    .Excel == self.convertType ||
-                    .PowerPoint == self.convertType ||
-                    .CSV == self.convertType ||
-                    .RTF == self.convertType ||
-                    .GIF == self.convertType ||
-                    .TIFF == self.convertType ||
-                    .JPEG2000 == self.convertType ||
-                    .BMP == self.convertType ||
-                    .TGA == self.convertType  ||
-                    .Json == self.convertType {
-                    moreLabelString = String(format: "%@ %@", KMLocalizedString("The first 10 pages for free"), KMLocalizedString("Unlimited Convert"))
-                }
-            }
-        }
-#else
-        // 付费版
-        if !IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
-            if .WordAdvance == self.convertType ||
-                .WordStandard == self.convertType ||
-                .Excel == self.convertType ||
-                .PowerPoint == self.convertType ||
-                .CSV == self.convertType ||
-                .RTF == self.convertType ||
-                .GIF == self.convertType ||
-                .TIFF == self.convertType ||
-                .JPEG2000 == self.convertType ||
-                .BMP == self.convertType ||
-                .TGA == self.convertType ||
-                .Json == self.convertType {
-                moreLabelString = String(format: "%@ %@", KMLocalizedString("The first 10 pages for free"), KMLocalizedString("Unlimited Convert"))
-            }
-        }
-#endif
-        
-        self.detailInfoLabel.stringValue = moreLabelString
-        if let range = moreLabelString.range(of: NSLocalizedString("Unlimited Convert", comment: "")) {
-            let newR: NSRange = moreLabelString.nsRange(from: range)!
-            let attributedStr = NSMutableAttributedString(string: moreLabelString)
-            attributedStr.addAttribute(.foregroundColor, value: NSColor.labelColor, range: NSRange(location: 0, length: newR.location - 1))
-            attributedStr.addAttribute(.foregroundColor, value: NSColor(red: 8/255, green: 124/255, blue: 1, alpha: 1), range: newR)
-            attributedStr.addAttribute(.underlineStyle, value: NSUnderlineStyle.single.rawValue, range: newR)
-            detailInfoLabel.attributedStringValue = attributedStr
-        }
-        
-        if moreLabelString.count > 0 {
-            detailInfoBox.isHidden = false
-            buttonBottemOffset.constant = 45
-        } else {
-            detailInfoBox.isHidden = true
-            buttonBottemOffset.constant = 10
-        }
-        
-        if self.convertType == .WordAdvance {
-            separateStypeBox.isHidden = false
-            excelStyleBox.isHidden = true
-            csvExtractButton.isHidden = true
-            ocrBox.isHidden = false
-
-            wordButtonOne.title = NSLocalizedString("Retain Flowing Text", comment: "")
-            wordButtonTwo.title = NSLocalizedString("Retain Page Layout", comment: "")
-            
-            ocrTopOffset.constant = 15 + separateStypeBox.frame.height
-        } else if self.convertType == .Excel {
-            separateStypeBox.isHidden = true
-            excelStyleBox.isHidden = false
-            csvExtractButton.isHidden = true
-            ocrBox.isHidden = false
-            
-            ocrTopOffset.constant = 15 + excelStyleBox.frame.height
-        } else if .Json == convertType {
-            wordButtonOne.title = NSLocalizedString("Extract text content", comment: "")
-            wordButtonTwo.title = NSLocalizedString("Extract tables", comment: "")
-            
-            separateStypeBox.isHidden = false
-            excelStyleBox.isHidden = true
-            csvExtractButton.isHidden = true
-            ocrBox.isHidden = false
-            
-            ocrTopOffset.constant = 15 + separateStypeBox.frame.height
-        } else if (.PowerPoint == convertType ||
-            .RTF == convertType ||
-            .HTML == convertType ||
-            .Text == convertType)  {
-            
-            separateStypeBox.isHidden = true
-            excelStyleBox.isHidden = true
-            csvExtractButton.isHidden = true
-            ocrBox.isHidden = false
-
-            ocrTopOffset.constant = 15
-        } else if self.convertType == .CSV {
-            separateStypeBox.isHidden = true
-            excelStyleBox.isHidden = true
-            csvExtractButton.isHidden = false
-            ocrBox.isHidden = true
-            
-            self.csvExtractButton.title = NSLocalizedString("Extract Tables Only", comment: "")
-        } else {
-            separateStypeBox.isHidden = true
-            excelStyleBox.isHidden = true
-            csvExtractButton.isHidden = true
-            ocrBox.isHidden = true
-        }
-        
-    }
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        self.prepareData()
-        updateFormatView()
-        self.view.wantsLayer = true
-        convertButton.wantsLayer = true
-        convertButton.font = NSFont.systemFont(ofSize: 13)
-        convertButton.layer?.cornerRadius = 1.0
-        interfaceStatus = .PrepareProcess
-                
-        allContentBtn.state = .on
-        allContentMenu.isEnabled = true
-        tableMenu.isEnabled = false
-        excelContentOption = .allContent
-        excelWorksheetOption = .forEachPage
-        
-        onlyTextBtn.title = NSLocalizedString("Only Text", comment: "")
-        onlyTableBtn.title = NSLocalizedString("Only Table", comment: "")
-        allContentBtn.title = NSLocalizedString("All Content", comment: "")
-        onlyTextBtn.toolTip = NSLocalizedString("Only Text", comment: "")
-        onlyTableBtn.toolTip = NSLocalizedString("Only Table", comment: "")
-        allContentBtn.toolTip = NSLocalizedString("All Content", comment: "")
-        tableMenu1.title = NSLocalizedString("Create Sheet for each Table", comment: "")
-        tableMenu2.title = NSLocalizedString("Create Sheet for each Page", comment: "")
-        allContentMenu2.title = NSLocalizedString("Create Sheet for each Page", comment: "")
-        tableMenu3.title = NSLocalizedString("Create single Sheet for File", comment: "")
-        allContentMenu3.title = NSLocalizedString("Create single Sheet for File", comment: "")
-        formatLabel.stringValue = NSLocalizedString("Format:", comment: "")
-        ocrBox.title = NSLocalizedString("OCR Settings", comment: "")
-        ocrBox.titleFont = .SFProTextBoldFont(14.0)
-        formatLabel.font = .SFProTextBoldFont(14.0)
-        
-        headerView.convertHeaderClickedCallBack = { [weak self] in
-            self?.moreConvertInfoAction()
-        }
-        
-        self.ocrButton.title = NSLocalizedString("Recognize text", comment: "")
-        self.ocrLabel.stringValue = NSLocalizedString("Language Option", comment: "") + ":"
-        ocrLanguageBox.selectItem(at: 2)
-        ocrLabel.textColor = KMAppearance.Layout.h2Color()
-        ocrLanguageBox.isEnabled = false
-        ocrButton.state = .off
-        
-        self.updateViewColor()
-       
-        NotificationCenter.default.addObserver(self, selector: #selector(batchFilesCountNotification(notification:)), name: Notification.Name(rawValue: "KMBatchFilesCountNotification"), object: nil)
-        NotificationCenter.default.addObserver(self, selector: #selector(IAPProductPurchasedNotification(notification:)), name: NSNotification.Name("KMIAPProductPurchasedNotification"), object: nil)
-        NotificationCenter.default.addObserver(self, selector: #selector(IAPProductRestoreFinishedNotification(notification:)), name: NSNotification.Name("KMIAPProductRestoreFinishedNotification"), object: nil)
-//        NotificationCenter.default.addObserver(self, selector: #selector(themeChanged(notification:)), name: NSNotification.Name("AppleInterfaceThemeChangedNotification"), object: nil)
-        DistributedNotificationCenter.default().addObserver(self, selector: #selector(themeChanged(notification:)), name: NSNotification.Name("AppleInterfaceThemeChangedNotification"), object: nil)
-        NotificationCenter.default.addObserver(self, selector: #selector(deviceActivateStatusChanged(notification:)), name: NSNotification.Name("kDeviceActivateNotification"), object: nil)
-    }
-    
-    
-    @objc func batchFilesCountNotification(notification: NSNotification) {
-        let arr: Array? = notification.object as? [KMBatchOperateFile]
-        self.files? = arr ?? []
-        if files!.count > 0 {
-            self.convertButton.setTitleColor(NSColor.white)
-            self.convertButton.layer?.backgroundColor = KMAppearance.Interactive.m0Color().cgColor
-            self.haveFiles = true
-        } else {
-            self.convertButton.setTitleColor(KMAppearance.Layout.w0Color().withAlphaComponent(0.6))
-            self.convertButton.layer?.backgroundColor = KMAppearance.Interactive.m0Color().withAlphaComponent(0.4).cgColor
-            self.haveFiles = false
-        }
-    }
-    
-    @objc func themeChanged(notification: NSNotification) {
-        DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
-            self.updateViewColor()
-        }
-    }
-    
-    @objc func IAPProductRestoreFinishedNotification(notification: NSNotification) {
-        DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
-            self.updateBottomView()
-            self.prepareData()
-            self.updateFormatView()
-        }
-    }
-    
-    @objc func IAPProductPurchasedNotification(notification: NSNotification) {
-        DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
-            self.updateBottomView()
-            self.prepareData()
-            self.updateFormatView()
-        }
-    }
-    
-    @objc func deviceActivateStatusChanged(notification: NSNotification) {
-        DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
-            self.updateBottomView()
-            self.prepareData()
-            self.updateFormatView()
-        }
-    }
-    
-    func updateViewColor() {
-        self.view.wantsLayer = true
-        if KMAppearance.isDarkMode() {
-            self.view.layer?.backgroundColor = NSColor(red: 0.055, green: 0.067, blue: 0.078, alpha: 1).cgColor
-        } else {
-            self.view.layer?.backgroundColor = NSColor(red: 0.922, green: 0.925, blue: 0.941, alpha: 1).cgColor 
-        }
-    }
-    
-    func convertActionVC() {
-        var vc: KMToolCompareWindowController? = nil
-        if(.WordStandard == self.convertType ||
-            .WordAdvance == self.convertType) {
-            vc = KMToolCompareWindowController(toolType: .Convert, selectNum: 1)
-        } else if (.Excel == self.convertType) {
-            vc = KMToolCompareWindowController(toolType: .Convert, selectNum: 2)
-        } else if (.PowerPoint == self.convertType) {
-            vc = KMToolCompareWindowController(toolType: .Convert, selectNum: 3)
-        } else if (self.convertType == .JPG || self.convertType == .PNG || self.convertType == .GIF || self.convertType == .TIFF || self.convertType == .TGA || self.convertType == .BMP){
-            vc = KMToolCompareWindowController(toolType: .Convert, selectNum: 4)
-        } else {
-            vc = KMToolCompareWindowController(toolType: .Convert, selectNum: 0)
-        }
-        vc?.showWindow(nil)
-    }
-    
-    func prepareData() {
-        let arr: [KMConvertWithPDFType] = [.Excel, .PowerPoint, .RTF, .CSV, .HTML, .Text, .JPEG, .JPG, .PNG, .GIF, .TIFF, .TGA, .BMP, .JPEG2000, .Json]
-        self.dataSourcesArray = arr
-        
-        var needShowAdvance = true
-        var needShowDefault = true
-        
-#if VERSION_FREE
-        // 桌机版
-        if IAPProductsManager.default().isAvailableAllFunction() {
-            if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
-                needShowAdvance = true
-                needShowDefault = false
-            }
-        }
-#else
-        if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
-            needShowAdvance = true
-            needShowDefault = false
-        }
-#endif
-        
-        if needShowDefault {
-            var wordType: KMConvertWithPDFType = .WordStandard
-            self.dataSourcesArray?.insert(wordType, at: 0)
-        }
-        
-        if needShowAdvance {
-            var wordType: KMConvertWithPDFType = .WordAdvance
-            self.dataSourcesArray?.insert(wordType, at: 0)
-        }
-    }
-    
-    func updateFormatView() {
-        var isShowAdvanced = false
-            
-#if VERSION_FREE
-#if VERSION_DMG
-        // 桌机版
-        isShowAdvanced = true
-        if IAPProductsManager.default().isAvailableAllFunction() {
-            if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
-                isShowAdvanced = false
-            }
-        }
-#else
-        // 免费版
-        isShowAdvanced = true
-        if IAPProductsManager.default().isAvailableAllFunction() {
-            if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
-                isShowAdvanced = false
-            }
-        }
-        
-#endif
-#else
-        isShowAdvanced = true
-        if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
-            isShowAdvanced = false
-        }
-#endif
-        self.formatSelectButton.removeAllItems()
-
-        for i in 0..<self.dataSourcesArray!.count {
-            let number = self.dataSourcesArray![i]
-            let item = NSMenuItem()
-            item.target = self
-            
-            if(number == .WordAdvance) {
-                if isShowAdvanced {
-                    let originStr = " \(NSLocalizedString("Advanced", comment: "")) "
-                    let str = NSLocalizedString("Word (.docx)", comment: "")
-                    
-                    let attributedStr = NSMutableAttributedString(string: "\(str)  \(originStr)")
-                    
-                    attributedStr.addAttribute(NSAttributedString.Key.backgroundColor, value: NSColor(red: 245.0/255.0, green: 142.0/255.0, blue: 38.0/255.0, alpha: 1.0), range: NSMakeRange(str.count + 2, originStr.count))
-                    
-                    attributedStr.addAttribute(NSAttributedString.Key.foregroundColor, value: NSColor.white, range: NSMakeRange(str.count + 2, originStr.count))
-                    
-                    item.attributedTitle = attributedStr
-                } else {
-                    item.title = "Word (.docx)"
-                }
-                item.tag = KMConvertWithPDFType.WordAdvance.rawValue
-            } else if(number == .WordStandard) {
-                if isShowAdvanced {
-                    let originStr = " \(NSLocalizedString("Standard", comment: "")) "
-                    let str = NSLocalizedString("Word (.docx)", comment: "")
-                    
-                    let attributedStr = NSMutableAttributedString(string: "\(str)  \(originStr)")
-                    
-                    attributedStr.addAttribute(NSAttributedString.Key.backgroundColor, value: NSColor(red: 40/255.0, green: 193.0/255.0, blue: 107.0/255.0, alpha: 1.0), range: NSMakeRange(str.count + 2, originStr.count))
-                    
-                    attributedStr.addAttribute(NSAttributedString.Key.foregroundColor, value: NSColor.white, range: NSMakeRange(str.count + 2, originStr.count))
-                    
-                    item.attributedTitle = attributedStr
-                } else {
-                    item.title = "Word (.docx)"
-                }
-                item.tag = KMConvertWithPDFType.WordStandard.rawValue
-            } else if(number == .Excel) {
-                item.title = "Excel (.xlsx)"
-                item.tag = KMConvertWithPDFType.Excel.rawValue
-            } else if(number == .PowerPoint) {
-                item.title = "PowerPoint (.pptx)"
-                item.tag = KMConvertWithPDFType.PowerPoint.rawValue
-            } else if(number == .RTF) {
-                item.title = "RTF (.rtf)"
-                item.tag = KMConvertWithPDFType.RTF.rawValue
-            } else if(number == .CSV) {
-                item.title = "CSV (.csv)"
-                item.tag = KMConvertWithPDFType.CSV.rawValue
-            } else if(number == .HTML) {
-                item.title = "Html (.html)"
-                item.tag = KMConvertWithPDFType.HTML.rawValue
-            } else if(number == .Text) {
-                item.title = "Text (.txt)"
-                item.tag = KMConvertWithPDFType.Text.rawValue
-            } else if(number == .JPEG) {
-                item.title = "JPEG (.jpeg)"
-                item.tag = KMConvertWithPDFType.JPEG.rawValue
-            } else if(number == .JPG) {
-                item.title = "JPG (.jpg)"
-                item.tag = KMConvertWithPDFType.JPG.rawValue
-            } else if(number == .PNG) {
-                item.title = "PNG (.png)"
-                item.tag = KMConvertWithPDFType.PNG.rawValue
-            } else if(number == .GIF) {
-                item.title = "GIF (.gif)"
-                item.tag = KMConvertWithPDFType.GIF.rawValue
-            } else if(number == .TIFF) {
-                item.title = "TIFF (.tiff)"
-                item.tag = KMConvertWithPDFType.TIFF.rawValue
-            } else if(number == .TGA) {
-                item.title = "TGA (.tga)"
-                item.tag = KMConvertWithPDFType.TGA.rawValue
-            } else if(number == .BMP) {
-                item.title = "BMP (.bmp)"
-                item.tag = KMConvertWithPDFType.BMP.rawValue
-            } else if(number == .JPEG2000) {
-                item.title = "JPEG-2000 (.jp2)"
-                item.tag = KMConvertWithPDFType.JPEG2000.rawValue
-            } else if(number == .Json) {
-                item.title = "Json(.json)"
-                item.tag = KMConvertWithPDFType.Json.rawValue
-            }
-            
-            self.formatSelectButton.menu?.addItem(item)
-
-        }
-       
-    }
-    
-    @IBAction func buttonClicked_Convert(_ sender: NSButton) {
-        if !self.haveFiles { return }
-       self.view.window?.makeFirstResponder(nil)
-        for i in 0..<self.files!.count {
-            let file = self.files?[i]
-//            file?.excelParameter.allInOneSheet = true // 看代码是没有用
-            file?.advanceWordParameter.isRetainLayout = (self.wordButtonTwo.state == .on) ? true : false
-//            file?.excelParameter.isExtreactTabel = (self.extractButton.state == .on) ? true : false // 看代码是没有用
-            file?.CSVParameter.isExtreactTabel = (self.csvExtractButton.state == .on) ? true : false
-            file?.excelParameter.excelContentOption = self.excelContentOption
-            file?.excelParameter.excelWorksheetOption = self.excelWorksheetOption
-
-            file?.JSONParameter.isExtreactTabel = self.wordButtonTwo.state == .on
-            var isAllowOCR = self.ocrBox.isHidden == false
-            if isAllowOCR {
-                isAllowOCR = self.ocrButton.state == .on
-            }
-            file?.isAllowOCR = isAllowOCR
-            file?.ocrLanguage = isAllowOCR ? self.ocrLanguage_ : .chinese
-       }
-       if sender.tag == 1 {
-           self.beginBatchOperation()
-       } else {
-           self.cancelBatchOperation()
-       }
-        
-    }
-    
-    @IBAction func moreButtonAction(_ sender: NSButton) {
-        self.moreConvertInfoAction()
-    }
-    
-    @IBAction func layoutButtonAction(_ sender: Any) {
-    }
-    
-    @IBAction func buttonClicked_Cancel(_ sender: Any) {
-        let basePath = NSSearchPathForDirectoriesInDomains(.applicationSupportDirectory, .userDomainMask, true).last ?? ""
-        let newPath = (basePath as NSString).appendingPathComponent(Bundle.main.bundleIdentifier ?? "")
-        let filePath = newPath.stringByAppendingPathComponent("convert.pdf")
-        if FileManager.default.fileExists(atPath: filePath) {
-            try? FileManager.default.removeItem(atPath: filePath)
-        }
-    }
-    
-    func transform(withString string: String) { 
-        if string == NSLocalizedString("Create Sheet for each Table", comment: "") {
-            self.excelWorksheetOption = .forEachTable
-        } else if string == NSLocalizedString("Create Sheet for each Page", comment: "") {
-            self.excelWorksheetOption = .forEachPage
-        } else if string == NSLocalizedString("Create single Sheet for File", comment: "") {
-            self.excelWorksheetOption = .forTheDocument
-        }
-    }
-    
-    @IBAction func buttonClicked_excelStyle(_ sender: NSButton) {
-        if sender == onlyTextBtn {
-            onlyTextBtn.state = NSControl.StateValue.on
-            onlyTableBtn.state = NSControl.StateValue.off
-            allContentBtn.state = NSControl.StateValue.off
-            tableMenu.isEnabled = false
-            allContentMenu.isEnabled = false
-            excelContentOption = .onlyText
-            excelWorksheetOption = .forEachTable
-        } else if sender == onlyTableBtn {
-            onlyTableBtn.state = NSControl.StateValue.on
-            onlyTextBtn.state = NSControl.StateValue.off
-            allContentBtn.state = NSControl.StateValue.off
-            tableMenu.isEnabled = true
-            allContentMenu.isEnabled = false
-            excelContentOption = .onlyTable
-            transform(withString: tableMenu.selectedItem?.title ?? "")
-        } else if sender == allContentBtn {
-            allContentBtn.state = NSControl.StateValue.on
-            onlyTextBtn.state = NSControl.StateValue.off
-            onlyTableBtn.state = NSControl.StateValue.off
-            tableMenu.isEnabled = false
-            allContentMenu.isEnabled = true
-            excelContentOption = .allContent
-            transform(withString: allContentMenu.selectedItem?.title ?? "")
-        }
-    }
-    
-    @IBAction func buttonClicked_tableMenu(_ sender: NSPopUpButton) {
-        transform(withString: self.tableMenu.selectedItem!.title)
-    }
-    
-    @IBAction func buttonClickec_allContentMenu(_ sender: NSButton) {
-        transform(withString: self.allContentMenu.selectedItem!.title)
-    }
-    
-    func intConvertType(num: Int) -> KMConvertWithPDFType {
-        var type: KMConvertWithPDFType?
-        switch num {
-        case 0:
-            type = .WordAdvance
-        case 1:
-            type = .WordStandard
-        case 2:
-            type = .Excel
-        case 3:
-            type = .PowerPoint
-        case 4:
-            type = .RTF
-        case 5:
-            type = .CSV
-        case 6:
-            type = .HTML
-        case 7:
-            type = .Text
-        case 8:
-            type = .JPEG
-        case 9:
-            type = .JPG
-        case 10:
-            type = .PNG
-        case 11:
-            type = .GIF
-        case 12:
-            type = .TIFF
-        case 13:
-            type = .TGA
-        case 14:
-            type = .BMP
-        case 15:
-            type = .JPEG2000
-        case 16:
-            type = .Json
-        default:
-            type = .WordAdvance
-        }
-        return type!
-    }
-    
-    func moreConvertInfoAction() {
-        if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() == false {
-#if VERSION_DMG
-            if IAPProductsManager.default().isAvailableAllFunction() && IAPProductsManager.default().isAvailableAdvancedPDFToOffice() == false {
-                let limitWC = KMPurchaseLimitWindowController.currentLimitWC()
-                limitWC.continueBlock = { windowController in
-                    
-                }
-                limitWC.window?.center()
-                limitWC.showWindow(nil)
-            }else{
-                let winC = KMPurchaseCompareWindowController.sharedInstance()
-                if let viewC = self.view.window?.contentViewController, viewC.kEventTag == 1 {
-                    winC?.kEventName = "Onbrd_ConvertPDF_BuyNow"
-                } else {
-                    if convertType == .WordStandard || convertType == .WordAdvance {
-                        winC?.kEventName = "Onbrd_PDFtoWord_BuyNow"
-                    } else if convertType == .Excel {
-                        winC?.kEventName = "Onbrd_PDFtoExcel_BuyNow"
-                    } else if convertType == .PowerPoint {
-                        winC?.kEventName = "Onbrd_PDFtoPPT_BuyNow"
-                    }
-                }
-                
-                winC?.showWindow(nil)
-            }
-#else
-            if IAPProductsManager.default().isAvailableAllFunction() {
-                self.convertActionVC()
-            } else {
-                KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
-            }
-#endif
-        }
-    }
-    
-    @IBAction func buttonClicked_FormatSelect(_ sender: NSButton) {
-        guard let item = self.formatSelectButton.selectedItem else { return }
-        convertType =  KMConvertWithPDFType(rawValue: item.tag) ?? .WordAdvance
-        
-        updateBottomView()
-    }
-    
-    @IBAction func comboxClicked_OcrLanguage(_ sender: AnyObject?) {
-        switch (ocrLanguageBox.indexOfSelectedItem) {
-            case 0: //chinese
-                self.ocrLanguage_ = .chinese
-                break
-            case 1: //chinese zht
-                self.ocrLanguage_ = .chineseTraditional
-                break
-            case 2: //English
-                self.ocrLanguage_ = .english
-                break
-            case 3:
-                //Japanese
-                self.ocrLanguage_ = .japanese
-                break
-            case 4:
-                //Kroean
-                self.ocrLanguage_ = .korean
-                break
-            case 5:
-                //Serbian
-                self.ocrLanguage_ = .serbian
-                break
-            case 6:
-                //Occitan
-                self.ocrLanguage_ = .occitan
-                break
-            case 7:
-                //Danish
-                self.ocrLanguage_ = .danish
-                break
-            case 8:
-                //German
-                self.ocrLanguage_ = .german
-                break
-            case 9:
-                //French
-                self.ocrLanguage_ = .french
-                break
-            case 10:
-                //Italian
-                self.ocrLanguage_ = .italian
-                break
-            case 11:
-                //Spanish
-                self.ocrLanguage_ = .spanish
-                break
-            case 12:
-                //Portuguese
-                self.ocrLanguage_ = .portuguese
-                break
-            case 13:
-                //Maori
-                self.ocrLanguage_ = .maori
-                break
-            case 14:
-                //Malay
-                self.ocrLanguage_ = .malay
-                break
-            case 15:
-                //Malay
-                self.ocrLanguage_ = .maltese
-                break
-            case 16:
-                //Dutch
-                self.ocrLanguage_ = .dutch
-                break
-            case 17:
-                //Norwegian
-                self.ocrLanguage_ = .norwegian
-                break
-            case 18:
-                //Polish
-                self.ocrLanguage_ = .polish
-                break
-            case 19:
-                //Romanian
-                self.ocrLanguage_ = .romanian
-                break
-            case 20:
-                //Slovak
-                self.ocrLanguage_ = .slovak
-                break
-            case 21:
-                //Slovenian
-                self.ocrLanguage_ = .slovenian
-                break
-            case 22:
-                //Albanian
-                self.ocrLanguage_ = .albanian
-                break
-            case 23:
-                //Swedish
-                self.ocrLanguage_ = .swedish
-                break
-            case 24:
-                //Swahili
-                self.ocrLanguage_ = .swahili
-                break
-            case 25:
-                //Tagalog
-                self.ocrLanguage_ = .tagalog
-                break
-            case 26:
-                //Turish
-                self.ocrLanguage_ = .turish
-                break
-            case 27:
-                //Uzbek
-                self.ocrLanguage_ = .uzbek
-                break
-            case 28:
-                //Vietnamese
-                self.ocrLanguage_ = .vietnamese
-                break
-            case 29:
-                //Afrikaans
-                self.ocrLanguage_ = .afrikaans
-                break
-            case 30:
-                //Azerbaijani
-                self.ocrLanguage_ = .azerbaijani
-                break
-            case 31:
-                //Bosnian
-                self.ocrLanguage_ = .bosnian
-                break
-            case 32:
-                //Czech
-                self.ocrLanguage_ = .czech
-                break
-            case 33: //Welsh
-                self.ocrLanguage_ = .welsh
-                break
-            case 34: //Estonian
-                self.ocrLanguage_ = .estonian
-                break
-             case 35: //Irish
-                self.ocrLanguage_ = .irish
-                break
-             case 36: //Croatian
-                self.ocrLanguage_ = .croatian
-                break
-            case 37: //Hungarian
-                self.ocrLanguage_ = .hungarian
-                break
-            case 38: //Indonesian
-                self.ocrLanguage_ = .indonesian
-                break
-            case 39: //Icelandic
-                self.ocrLanguage_ = .icelandic
-                break
-            case 40: //Kurdish
-                self.ocrLanguage_ = .kurdish
-                break
-            case 41: //Lithuanian
-                self.ocrLanguage_ = .lithuanian
-                break
-            case 42: //Latvian
-                self.ocrLanguage_ = .latvian
-                break
-            case 43: //Marathi
-                self.ocrLanguage_ = .marathi
-                break
-            case 44: //Nepali
-                self.ocrLanguage_ = .nepali
-                break
-            case 45: //Latvia
-                self.ocrLanguage_ = .latvian
-                break
-            case 46: //Bihari
-                self.ocrLanguage_ = .bihari
-                break
-            case 47: //Maithili
-                self.ocrLanguage_ = .maithili
-                break
-            case 48: //Angika
-                self.ocrLanguage_ = .angika
-                break
-            case 49: //Bhojpuri
-                self.ocrLanguage_ = .bhojpuri
-                break
-            case 50: //Magahi
-                self.ocrLanguage_ = .magahi
-                break
-            case 51: //Nagpur
-                self.ocrLanguage_ = .nagpur
-                break
-            case 52: //Newari
-                self.ocrLanguage_ = .newari
-                break
-            case 53: //GoanKonkani
-                self.ocrLanguage_ = .goanKonkani
-                break
-            case 54: //SaudiArabia
-                self.ocrLanguage_ = .saudiArabia
-                break
-            default:
-                self.ocrLanguage_ = .english
-                break
-        }
-    }
-    
-    @IBAction func comboxClicked_SupoortOCR(_ sender: AnyObject?) {
-        if(ocrButton.state == .on) {
-            ocrLabel.textColor = KMAppearance.titleColor()
-            ocrLanguageBox.isEnabled = true
-        } else {
-            ocrLabel.textColor = KMAppearance.Layout.h2Color()
-            ocrLanguageBox.isEnabled = false
-        }
-    }
-
-}

+ 0 - 532
PDF Office/PDF Master/Class/Batch/WindowController/VC/KMBatchOperateConvertViewController.xib

@@ -1,532 +0,0 @@
-<?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="KMBatchOperateConvertViewController" customModule="PDF_Reader_Pro" customModuleProvider="target">
-            <connections>
-                <outlet property="allContentBtn" destination="VoX-ly-4XH" id="PVH-D9-NeK"/>
-                <outlet property="allContentMenu" destination="9la-KC-6B2" id="d9B-pP-9td"/>
-                <outlet property="allContentMenu2" destination="epp-Ft-5F3" id="9o8-nw-lSR"/>
-                <outlet property="allContentMenu3" destination="RxJ-Yy-qz7" id="FSC-QF-WOS"/>
-                <outlet property="bottomView" destination="RWh-gu-eYa" id="KeF-AW-TCH"/>
-                <outlet property="buttonBottemOffset" destination="yC0-C8-0aE" id="5ql-8T-3i8"/>
-                <outlet property="convertButton" destination="x4l-h4-1bj" id="DJs-wX-FIh"/>
-                <outlet property="csvExtractButton" destination="9oz-Jm-qNR" id="T9O-7L-M90"/>
-                <outlet property="detailInfoBox" destination="GqZ-ul-wVr" id="tFD-y6-ph7"/>
-                <outlet property="detailInfoLabel" destination="l7W-85-8as" id="7kd-CC-Lre"/>
-                <outlet property="excelStyleBox" destination="uy4-Qr-7eJ" id="UVa-tb-rL2"/>
-                <outlet property="formatLabel" destination="QnU-CY-IXa" id="hcD-VO-BLv"/>
-                <outlet property="formatSelectButton" destination="bc9-E7-QFg" id="lgt-rc-w6w"/>
-                <outlet property="headerTopOffset" destination="H2J-A1-Bx6" id="fUs-4x-p13"/>
-                <outlet property="headerView" destination="HlZ-Fb-Ttq" id="v6P-ZX-gnM"/>
-                <outlet property="ocrBox" destination="pvL-bb-6g1" id="AoN-uI-Y21"/>
-                <outlet property="ocrButton" destination="vDb-Tm-oup" id="C4l-tk-hjZ"/>
-                <outlet property="ocrLabel" destination="IFE-Qi-wNe" id="3Mg-jE-3zh"/>
-                <outlet property="ocrLanguageBox" destination="ZQH-wQ-34k" id="eFf-Wz-CCH"/>
-                <outlet property="ocrTopOffset" destination="L8N-CK-ccH" id="2xB-yp-jVX"/>
-                <outlet property="onlyTableBtn" destination="59f-KE-FoA" id="pYD-sK-Hix"/>
-                <outlet property="onlyTextBtn" destination="Anw-sw-a1x" id="3k9-8P-VvS"/>
-                <outlet property="separateStypeBox" destination="ibJ-Ae-4ze" id="dxe-Hl-NkN"/>
-                <outlet property="separateStypeTopOffset" destination="XRr-NV-gpp" id="hO5-6y-NMY"/>
-                <outlet property="tableMenu" destination="7w3-37-Dma" id="3VC-uN-Xzo"/>
-                <outlet property="tableMenu1" destination="lcq-HI-HHW" id="2sz-ab-Y9Q"/>
-                <outlet property="tableMenu2" destination="QJe-3b-BWC" id="TKX-NV-lII"/>
-                <outlet property="tableMenu3" destination="BUS-Uj-jcM" id="k8d-5F-id7"/>
-                <outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
-                <outlet property="wordButtonOne" destination="25B-gC-8fw" id="A0z-HC-5HA"/>
-                <outlet property="wordButtonTwo" destination="W18-qh-sPN" id="CZ7-SD-BVU"/>
-            </connections>
-        </customObject>
-        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
-        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
-        <customView id="Hz6-mo-xeY">
-            <rect key="frame" x="0.0" y="0.0" width="340" height="575"/>
-            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
-            <subviews>
-                <customView translatesAutoresizingMaskIntoConstraints="NO" id="RWh-gu-eYa">
-                    <rect key="frame" x="0.0" y="0.0" width="340" height="525"/>
-                    <subviews>
-                        <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="x4l-h4-1bj">
-                            <rect key="frame" x="16" y="16" width="308" height="32"/>
-                            <buttonCell key="cell" type="square" title="Button" bezelStyle="shadowlessSquare" alignment="center" imageScaling="proportionallyDown" inset="2" id="46F-Eo-5Pf">
-                                <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                                <font key="font" metaFont="system"/>
-                            </buttonCell>
-                            <constraints>
-                                <constraint firstAttribute="height" constant="32" id="SUn-Xj-aci"/>
-                            </constraints>
-                            <connections>
-                                <action selector="buttonClicked_Convert:" target="-2" id="Lwc-MC-9me"/>
-                            </connections>
-                        </button>
-                        <box borderType="none" title="Box" titlePosition="noTitle" translatesAutoresizingMaskIntoConstraints="NO" id="CFq-W0-Zmt">
-                            <rect key="frame" x="10" y="419" width="320" height="96"/>
-                            <view key="contentView" id="nMO-Go-Yia">
-                                <rect key="frame" x="0.0" y="0.0" width="320" height="96"/>
-                                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                <subviews>
-                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="QnU-CY-IXa">
-                                        <rect key="frame" x="8" y="80" width="47" height="16"/>
-                                        <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Format" id="L4l-l6-Cwv">
-                                            <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>
-                                    <popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="bc9-E7-QFg">
-                                        <rect key="frame" x="7" y="46" width="312" height="25"/>
-                                        <popUpButtonCell key="cell" type="push" title="Item 1" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="RIX-yd-XXl" id="Siz-N1-JOg">
-                                            <behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
-                                            <font key="font" metaFont="menu"/>
-                                            <menu key="menu" id="dXR-xd-dYt">
-                                                <items>
-                                                    <menuItem title="Item 1" state="on" id="RIX-yd-XXl"/>
-                                                    <menuItem title="Item 2" id="W0F-qa-ZHd"/>
-                                                    <menuItem title="Item 3" id="adR-qy-9Fm"/>
-                                                </items>
-                                            </menu>
-                                        </popUpButtonCell>
-                                        <connections>
-                                            <action selector="buttonClicked_FormatSelect:" target="-2" id="K8W-uV-ctS"/>
-                                        </connections>
-                                    </popUpButton>
-                                    <box boxType="custom" borderType="none" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="GqZ-ul-wVr">
-                                        <rect key="frame" x="10" y="0.0" width="300" height="34"/>
-                                        <view key="contentView" id="haw-ei-juA">
-                                            <rect key="frame" x="0.0" y="0.0" width="300" height="34"/>
-                                            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                            <subviews>
-                                                <button translatesAutoresizingMaskIntoConstraints="NO" id="NEt-WC-ZBS">
-                                                    <rect key="frame" x="0.0" y="17" width="20" height="14"/>
-                                                    <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="KMImageNameElsei" imagePosition="only" alignment="center" imageScaling="proportionallyUpOrDown" inset="2" id="DQY-j6-yh4">
-                                                        <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                                                        <font key="font" metaFont="system"/>
-                                                    </buttonCell>
-                                                    <constraints>
-                                                        <constraint firstAttribute="height" constant="14" id="JCq-cE-ega"/>
-                                                        <constraint firstAttribute="width" constant="20" id="hrx-ih-W3K"/>
-                                                    </constraints>
-                                                </button>
-                                                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="l7W-85-8as">
-                                                    <rect key="frame" x="23" y="0.0" width="279" height="34"/>
-                                                    <textFieldCell key="cell" title="Export PDF to Word and other Microsoft Office formats" id="pwH-2G-D1M">
-                                                        <font key="font" metaFont="system"/>
-                                                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                                    </textFieldCell>
-                                                </textField>
-                                            </subviews>
-                                            <constraints>
-                                                <constraint firstItem="NEt-WC-ZBS" firstAttribute="leading" secondItem="haw-ei-juA" secondAttribute="leading" id="D3V-5c-ElV"/>
-                                                <constraint firstItem="l7W-85-8as" firstAttribute="leading" secondItem="NEt-WC-ZBS" secondAttribute="trailing" constant="5" id="Ffb-YH-5wo"/>
-                                                <constraint firstItem="l7W-85-8as" firstAttribute="top" secondItem="haw-ei-juA" secondAttribute="top" id="Hka-Ev-E5G"/>
-                                                <constraint firstItem="NEt-WC-ZBS" firstAttribute="top" secondItem="haw-ei-juA" secondAttribute="top" constant="3" id="bg5-ad-4rW"/>
-                                                <constraint firstAttribute="bottom" secondItem="l7W-85-8as" secondAttribute="bottom" id="g3J-er-rb6"/>
-                                                <constraint firstAttribute="trailing" secondItem="l7W-85-8as" secondAttribute="trailing" id="x9L-68-hz5"/>
-                                            </constraints>
-                                        </view>
-                                        <constraints>
-                                            <constraint firstAttribute="height" constant="34" id="ILE-hQ-Iyc"/>
-                                            <constraint firstAttribute="width" constant="300" id="q5e-jH-xM1"/>
-                                        </constraints>
-                                    </box>
-                                    <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="biN-Zz-5e3">
-                                        <rect key="frame" x="10" y="0.0" width="0.0" height="34"/>
-                                        <buttonCell key="cell" type="bevel" bezelStyle="rounded" alignment="left" imageScaling="proportionallyDown" inset="2" id="wYM-9n-8ZO">
-                                            <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                                            <font key="font" usesAppearanceFont="YES"/>
-                                        </buttonCell>
-                                        <connections>
-                                            <action selector="moreButtonAction:" target="-2" id="Wu5-Fl-JfF"/>
-                                        </connections>
-                                    </button>
-                                </subviews>
-                                <constraints>
-                                    <constraint firstItem="bc9-E7-QFg" firstAttribute="top" secondItem="QnU-CY-IXa" secondAttribute="bottom" constant="10" id="53r-r1-ZQH"/>
-                                    <constraint firstAttribute="trailing" secondItem="bc9-E7-QFg" secondAttribute="trailing" constant="5" id="93s-sv-o8l"/>
-                                    <constraint firstItem="GqZ-ul-wVr" firstAttribute="height" secondItem="biN-Zz-5e3" secondAttribute="height" id="FHD-N9-tJo"/>
-                                    <constraint firstAttribute="bottom" secondItem="GqZ-ul-wVr" secondAttribute="bottom" id="LQN-an-5kT"/>
-                                    <constraint firstItem="GqZ-ul-wVr" firstAttribute="leading" secondItem="biN-Zz-5e3" secondAttribute="leading" id="MQX-t5-zBw"/>
-                                    <constraint firstItem="QnU-CY-IXa" firstAttribute="leading" secondItem="nMO-Go-Yia" secondAttribute="leading" constant="10" id="TOW-8a-8Rx"/>
-                                    <constraint firstItem="bc9-E7-QFg" firstAttribute="leading" secondItem="nMO-Go-Yia" secondAttribute="leading" constant="10" id="UD0-7R-LSZ"/>
-                                    <constraint firstItem="GqZ-ul-wVr" firstAttribute="top" secondItem="biN-Zz-5e3" secondAttribute="top" id="XaJ-lm-CAt"/>
-                                    <constraint firstAttribute="trailing" secondItem="GqZ-ul-wVr" secondAttribute="trailing" constant="10" id="ejK-cM-cb5"/>
-                                    <constraint firstItem="GqZ-ul-wVr" firstAttribute="leading" secondItem="nMO-Go-Yia" secondAttribute="leading" constant="10" id="fgK-eh-Ajk"/>
-                                    <constraint firstItem="QnU-CY-IXa" firstAttribute="top" secondItem="nMO-Go-Yia" secondAttribute="top" id="w1N-FH-Di4"/>
-                                    <constraint firstAttribute="bottom" secondItem="bc9-E7-QFg" secondAttribute="bottom" constant="50" id="yC0-C8-0aE"/>
-                                </constraints>
-                            </view>
-                        </box>
-                        <box hidden="YES" boxType="custom" borderWidth="0.0" title="Box" titlePosition="noTitle" translatesAutoresizingMaskIntoConstraints="NO" id="ibJ-Ae-4ze">
-                            <rect key="frame" x="10" y="362" width="320" height="52"/>
-                            <view key="contentView" id="wyk-JI-a7n">
-                                <rect key="frame" x="0.0" y="0.0" width="320" height="52"/>
-                                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                <subviews>
-                                    <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="25B-gC-8fw">
-                                        <rect key="frame" x="8" y="35" width="302" height="18"/>
-                                        <buttonCell key="cell" type="radio" title="Convert each page to a separate worksheet" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="1mv-Zc-aNk">
-                                            <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
-                                            <font key="font" metaFont="system"/>
-                                        </buttonCell>
-                                        <connections>
-                                            <action selector="layoutButtonAction:" target="-2" id="W2W-Va-Sr2"/>
-                                        </connections>
-                                    </button>
-                                    <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="W18-qh-sPN">
-                                        <rect key="frame" x="8" y="9" width="302" height="18"/>
-                                        <buttonCell key="cell" type="radio" title="Convert all pages to a single worksheet(.xlsx)" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="QLl-EC-oIz">
-                                            <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
-                                            <font key="font" metaFont="system"/>
-                                        </buttonCell>
-                                        <connections>
-                                            <action selector="layoutButtonAction:" target="-2" id="5Cx-BB-9kO"/>
-                                        </connections>
-                                    </button>
-                                </subviews>
-                                <constraints>
-                                    <constraint firstItem="25B-gC-8fw" firstAttribute="leading" secondItem="wyk-JI-a7n" secondAttribute="leading" constant="10" id="EFI-6h-dha"/>
-                                    <constraint firstItem="W18-qh-sPN" firstAttribute="top" secondItem="25B-gC-8fw" secondAttribute="bottom" constant="10" id="Eaa-QX-1gw"/>
-                                    <constraint firstAttribute="trailing" secondItem="W18-qh-sPN" secondAttribute="trailing" constant="10" id="LN1-3J-vta"/>
-                                    <constraint firstAttribute="trailing" secondItem="25B-gC-8fw" secondAttribute="trailing" constant="10" id="dJS-w9-UUK"/>
-                                    <constraint firstItem="W18-qh-sPN" firstAttribute="leading" secondItem="25B-gC-8fw" secondAttribute="leading" id="hd6-TT-VK4"/>
-                                    <constraint firstAttribute="bottom" secondItem="W18-qh-sPN" secondAttribute="bottom" constant="10" id="nVA-WT-W5R"/>
-                                    <constraint firstItem="25B-gC-8fw" firstAttribute="top" secondItem="wyk-JI-a7n" secondAttribute="top" id="vf6-GK-v3D"/>
-                                </constraints>
-                            </view>
-                            <font key="titleFont" metaFont="system"/>
-                        </box>
-                        <box boxType="custom" borderWidth="0.0" title="Box" titlePosition="noTitle" translatesAutoresizingMaskIntoConstraints="NO" id="uy4-Qr-7eJ">
-                            <rect key="frame" x="10" y="336" width="320" height="78"/>
-                            <view key="contentView" id="R8m-s9-ne3">
-                                <rect key="frame" x="0.0" y="0.0" width="320" height="78"/>
-                                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                <subviews>
-                                    <popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="9la-KC-6B2">
-                                        <rect key="frame" x="105" y="56" width="142" height="25"/>
-                                        <popUpButtonCell key="cell" type="push" title="For Each Page" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="epp-Ft-5F3" id="xeQ-6P-lCV">
-                                            <behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
-                                            <font key="font" metaFont="menu"/>
-                                            <menu key="menu" id="6O0-Xm-V8H">
-                                                <items>
-                                                    <menuItem title="For Each Page" state="on" id="epp-Ft-5F3"/>
-                                                    <menuItem title="For The Document" id="RxJ-Yy-qz7"/>
-                                                </items>
-                                            </menu>
-                                        </popUpButtonCell>
-                                        <constraints>
-                                            <constraint firstAttribute="width" relation="lessThanOrEqual" constant="135" id="JWV-qB-ggN"/>
-                                            <constraint firstAttribute="height" constant="20" id="fWe-45-Ym6"/>
-                                        </constraints>
-                                        <connections>
-                                            <action selector="buttonClickec_allContentMenu:" target="-2" id="eQx-K2-gok"/>
-                                        </connections>
-                                    </popUpButton>
-                                    <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="VoX-ly-4XH">
-                                        <rect key="frame" x="8" y="61" width="94" height="18"/>
-                                        <buttonCell key="cell" type="radio" title="All Content" bezelStyle="regularSquare" imagePosition="left" alignment="left" lineBreakMode="truncatingTail" inset="2" id="vYi-ot-xSI">
-                                            <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
-                                            <font key="font" metaFont="system"/>
-                                        </buttonCell>
-                                        <connections>
-                                            <action selector="buttonClicked_excelStyle:" target="-2" id="z6r-Vr-kIi"/>
-                                        </connections>
-                                    </button>
-                                    <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="59f-KE-FoA">
-                                        <rect key="frame" x="8" y="35" width="86" height="18"/>
-                                        <buttonCell key="cell" type="radio" title="only table" bezelStyle="regularSquare" imagePosition="left" alignment="left" lineBreakMode="truncatingTail" inset="2" id="Qhk-fv-bR7">
-                                            <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
-                                            <font key="font" metaFont="system"/>
-                                        </buttonCell>
-                                        <connections>
-                                            <action selector="buttonClicked_excelStyle:" target="-2" id="jC6-Bt-tvq"/>
-                                        </connections>
-                                    </button>
-                                    <popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="7w3-37-Dma">
-                                        <rect key="frame" x="96" y="30" width="152" height="25"/>
-                                        <popUpButtonCell key="cell" type="push" title="For Each Table" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="lcq-HI-HHW" id="92O-me-cxZ">
-                                            <behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
-                                            <font key="font" metaFont="menu"/>
-                                            <menu key="menu" id="6Xh-fa-iPu">
-                                                <items>
-                                                    <menuItem title="For Each Table" state="on" id="lcq-HI-HHW"/>
-                                                    <menuItem title="For Each Page" id="QJe-3b-BWC"/>
-                                                    <menuItem title="For The Document" id="BUS-Uj-jcM"/>
-                                                </items>
-                                            </menu>
-                                        </popUpButtonCell>
-                                        <constraints>
-                                            <constraint firstAttribute="width" constant="145" id="2cD-S3-EPI"/>
-                                            <constraint firstAttribute="height" constant="20" id="tN7-9c-6nd"/>
-                                        </constraints>
-                                        <connections>
-                                            <action selector="buttonClicked_tableMenu:" target="-2" id="Wev-Mw-MFp"/>
-                                        </connections>
-                                    </popUpButton>
-                                    <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Anw-sw-a1x">
-                                        <rect key="frame" x="8" y="9" width="78" height="18"/>
-                                        <buttonCell key="cell" type="radio" title="only text" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="GYl-AV-Fif">
-                                            <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
-                                            <font key="font" metaFont="system"/>
-                                        </buttonCell>
-                                        <connections>
-                                            <action selector="buttonClicked_excelStyle:" target="-2" id="kyH-M4-bUS"/>
-                                        </connections>
-                                    </button>
-                                </subviews>
-                                <constraints>
-                                    <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="7w3-37-Dma" secondAttribute="trailing" constant="5" id="3Vs-yd-50a"/>
-                                    <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="9la-KC-6B2" secondAttribute="trailing" constant="5" id="5G0-D3-f0t"/>
-                                    <constraint firstItem="7w3-37-Dma" firstAttribute="leading" secondItem="59f-KE-FoA" secondAttribute="trailing" constant="5" id="5UM-UZ-9rH"/>
-                                    <constraint firstItem="VoX-ly-4XH" firstAttribute="top" secondItem="R8m-s9-ne3" secondAttribute="top" id="7IR-OH-PXt"/>
-                                    <constraint firstItem="Anw-sw-a1x" firstAttribute="top" secondItem="59f-KE-FoA" secondAttribute="bottom" constant="10" id="88R-46-dUI"/>
-                                    <constraint firstItem="VoX-ly-4XH" firstAttribute="leading" secondItem="Anw-sw-a1x" secondAttribute="leading" id="GFm-Yb-rbl"/>
-                                    <constraint firstItem="7w3-37-Dma" firstAttribute="centerY" secondItem="59f-KE-FoA" secondAttribute="centerY" id="LLa-va-0D2"/>
-                                    <constraint firstAttribute="bottom" secondItem="Anw-sw-a1x" secondAttribute="bottom" constant="10" id="Pte-Pe-9kf"/>
-                                    <constraint firstItem="59f-KE-FoA" firstAttribute="top" secondItem="VoX-ly-4XH" secondAttribute="bottom" constant="10" id="Qmy-0r-aD3"/>
-                                    <constraint firstItem="9la-KC-6B2" firstAttribute="leading" secondItem="VoX-ly-4XH" secondAttribute="trailing" constant="6" id="agh-7W-MJp"/>
-                                    <constraint firstItem="9la-KC-6B2" firstAttribute="centerY" secondItem="VoX-ly-4XH" secondAttribute="centerY" id="cgJ-uu-G2E"/>
-                                    <constraint firstItem="59f-KE-FoA" firstAttribute="leading" secondItem="R8m-s9-ne3" secondAttribute="leading" constant="10" id="ddc-zV-4eK"/>
-                                    <constraint firstItem="Anw-sw-a1x" firstAttribute="leading" secondItem="R8m-s9-ne3" secondAttribute="leading" constant="10" id="eZv-fc-0wH"/>
-                                </constraints>
-                            </view>
-                            <font key="titleFont" metaFont="system"/>
-                        </box>
-                        <button hidden="YES" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="9oz-Jm-qNR">
-                            <rect key="frame" x="13" y="397" width="312" height="18"/>
-                            <buttonCell key="cell" type="check" title="Check" bezelStyle="regularSquare" imagePosition="left" inset="2" id="SV4-we-las">
-                                <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
-                                <font key="font" metaFont="system"/>
-                            </buttonCell>
-                            <connections>
-                                <action selector="exctractTableButtonAction:" target="-2" id="vsi-QQ-bog"/>
-                            </connections>
-                        </button>
-                        <box borderType="none" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="pvL-bb-6g1">
-                            <rect key="frame" x="10" y="165" width="320" height="101"/>
-                            <view key="contentView" id="wNe-bc-ZiD">
-                                <rect key="frame" x="0.0" y="0.0" width="320" height="87"/>
-                                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                <subviews>
-                                    <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="vDb-Tm-oup">
-                                        <rect key="frame" x="8" y="60" width="302" height="18"/>
-                                        <buttonCell key="cell" type="check" title="Recognize text if needed" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="MNt-dJ-hbb">
-                                            <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
-                                            <font key="font" metaFont="system"/>
-                                        </buttonCell>
-                                        <connections>
-                                            <action selector="comboxClicked_SupoortOCR:" target="-2" id="Pkn-i5-sfR"/>
-                                        </connections>
-                                    </button>
-                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="IFE-Qi-wNe">
-                                        <rect key="frame" x="18" y="35" width="294" height="16"/>
-                                        <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Document Language:" id="cJh-KZ-pao">
-                                            <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>
-                                    <popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ZQH-wQ-34k">
-                                        <rect key="frame" x="17" y="6" width="302" height="25"/>
-                                        <popUpButtonCell key="cell" type="push" title="Chinese" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="h06-Ib-rxa" id="0oz-2F-PI6">
-                                            <behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
-                                            <font key="font" metaFont="menu"/>
-                                            <menu key="menu" id="uEU-3H-ucq">
-                                                <items>
-                                                    <menuItem title="Chinese" state="on" id="h06-Ib-rxa" userLabel="Chinese"/>
-                                                    <menuItem title="Chinese Traditional" id="chF-RA-wDe" userLabel="Chinese Traditional"/>
-                                                    <menuItem title="English" id="8hu-ir-Ndh" userLabel="English"/>
-                                                    <menuItem title="Japanese" id="Fiq-Av-dqP" userLabel="Japanese">
-                                                        <modifierMask key="keyEquivalentModifierMask"/>
-                                                    </menuItem>
-                                                    <menuItem title="Kroean" id="uf4-zB-8p6" userLabel="Kroean">
-                                                        <modifierMask key="keyEquivalentModifierMask"/>
-                                                    </menuItem>
-                                                    <menuItem title="Serbian" id="kpU-Ws-Z3L" userLabel="Kroean">
-                                                        <modifierMask key="keyEquivalentModifierMask"/>
-                                                    </menuItem>
-                                                    <menuItem title="Occitan" id="Xxa-I1-Oqn" userLabel="Kroean">
-                                                        <modifierMask key="keyEquivalentModifierMask"/>
-                                                    </menuItem>
-                                                    <menuItem title="Danish" id="l4S-2D-9rw" userLabel="Kroean">
-                                                        <modifierMask key="keyEquivalentModifierMask"/>
-                                                    </menuItem>
-                                                    <menuItem title="German" id="s5j-Fc-ihr" userLabel="Kroean">
-                                                        <modifierMask key="keyEquivalentModifierMask"/>
-                                                    </menuItem>
-                                                    <menuItem title="French" id="b8N-F6-5kG" userLabel="Kroean">
-                                                        <modifierMask key="keyEquivalentModifierMask"/>
-                                                    </menuItem>
-                                                    <menuItem title="Italian" id="TLu-CY-s1V" userLabel="Kroean">
-                                                        <modifierMask key="keyEquivalentModifierMask"/>
-                                                    </menuItem>
-                                                    <menuItem title="Spanish" id="ook-Eu-Xcd" userLabel="Kroean">
-                                                        <modifierMask key="keyEquivalentModifierMask"/>
-                                                    </menuItem>
-                                                    <menuItem title="Portuguese" id="jJH-VU-eqt" userLabel="Kroean">
-                                                        <modifierMask key="keyEquivalentModifierMask"/>
-                                                    </menuItem>
-                                                    <menuItem title="Maori" id="V8j-Im-KoN" userLabel="Kroean">
-                                                        <modifierMask key="keyEquivalentModifierMask"/>
-                                                    </menuItem>
-                                                    <menuItem title="Malay" id="58g-hN-gBd" userLabel="Kroean">
-                                                        <modifierMask key="keyEquivalentModifierMask"/>
-                                                    </menuItem>
-                                                    <menuItem title="Maltese" id="Xdi-rt-1ku" userLabel="Kroean">
-                                                        <modifierMask key="keyEquivalentModifierMask"/>
-                                                    </menuItem>
-                                                    <menuItem title="Dutch" id="MWB-to-QTq" userLabel="Kroean">
-                                                        <modifierMask key="keyEquivalentModifierMask"/>
-                                                    </menuItem>
-                                                    <menuItem title="Norwegian" id="rEv-88-Acb" userLabel="Kroean">
-                                                        <modifierMask key="keyEquivalentModifierMask"/>
-                                                    </menuItem>
-                                                    <menuItem title="Polish" id="Icz-Mh-Y2a" userLabel="Kroean">
-                                                        <modifierMask key="keyEquivalentModifierMask"/>
-                                                    </menuItem>
-                                                    <menuItem title="Romanian" id="jVe-z8-N69" userLabel="Kroean">
-                                                        <modifierMask key="keyEquivalentModifierMask"/>
-                                                    </menuItem>
-                                                    <menuItem title="Slovak" id="HlV-xP-IoS" userLabel="Kroean">
-                                                        <modifierMask key="keyEquivalentModifierMask"/>
-                                                    </menuItem>
-                                                    <menuItem title="Slovenian" id="K3k-kB-82u" userLabel="Kroean">
-                                                        <modifierMask key="keyEquivalentModifierMask"/>
-                                                    </menuItem>
-                                                    <menuItem title="Albanian" id="u0f-oV-yiD" userLabel="Kroean">
-                                                        <modifierMask key="keyEquivalentModifierMask"/>
-                                                    </menuItem>
-                                                    <menuItem title="Swedish" id="zbw-fh-qQn" userLabel="Kroean">
-                                                        <modifierMask key="keyEquivalentModifierMask"/>
-                                                    </menuItem>
-                                                    <menuItem title="Swahili" id="D22-Be-6mV" userLabel="Kroean">
-                                                        <modifierMask key="keyEquivalentModifierMask"/>
-                                                    </menuItem>
-                                                    <menuItem title="Tagalog" id="ebF-cB-yXV" userLabel="Kroean">
-                                                        <modifierMask key="keyEquivalentModifierMask"/>
-                                                    </menuItem>
-                                                    <menuItem title="Turish" id="8Ot-Ha-Jmn" userLabel="Kroean">
-                                                        <modifierMask key="keyEquivalentModifierMask"/>
-                                                    </menuItem>
-                                                    <menuItem title="Uzbek" id="Gi4-P0-CHK" userLabel="Kroean">
-                                                        <modifierMask key="keyEquivalentModifierMask"/>
-                                                    </menuItem>
-                                                    <menuItem title="Vietnamese" id="8Zx-GA-4TJ" userLabel="Kroean">
-                                                        <modifierMask key="keyEquivalentModifierMask"/>
-                                                    </menuItem>
-                                                    <menuItem title="Afrikaans" id="RHP-sw-e8r" userLabel="Kroean">
-                                                        <modifierMask key="keyEquivalentModifierMask"/>
-                                                    </menuItem>
-                                                    <menuItem title="Azerbaijani" id="BHw-fI-TEP" userLabel="Kroean">
-                                                        <modifierMask key="keyEquivalentModifierMask"/>
-                                                    </menuItem>
-                                                    <menuItem title="Bosnian" id="akK-tI-0rz" userLabel="Kroean">
-                                                        <modifierMask key="keyEquivalentModifierMask"/>
-                                                    </menuItem>
-                                                    <menuItem title="Czech" state="on" id="PJY-db-M4G" userLabel="Kroean">
-                                                        <modifierMask key="keyEquivalentModifierMask"/>
-                                                    </menuItem>
-                                                    <menuItem title="Welsh" id="Ubj-Ys-WfZ" userLabel="Kroean">
-                                                        <modifierMask key="keyEquivalentModifierMask"/>
-                                                    </menuItem>
-                                                    <menuItem title="Estonian" id="lwX-M6-vHr" userLabel="Kroean">
-                                                        <modifierMask key="keyEquivalentModifierMask"/>
-                                                    </menuItem>
-                                                    <menuItem title="Irish" id="mG8-SE-ehK" userLabel="Kroean">
-                                                        <modifierMask key="keyEquivalentModifierMask"/>
-                                                    </menuItem>
-                                                    <menuItem title="Croatian" id="pcM-PR-FB2" userLabel="Kroean">
-                                                        <modifierMask key="keyEquivalentModifierMask"/>
-                                                    </menuItem>
-                                                    <menuItem title="Hungarian" id="Cex-eb-5ua" userLabel="Kroean">
-                                                        <modifierMask key="keyEquivalentModifierMask"/>
-                                                    </menuItem>
-                                                    <menuItem title="Indonesian" id="xQr-TX-wz0" userLabel="Kroean">
-                                                        <modifierMask key="keyEquivalentModifierMask"/>
-                                                    </menuItem>
-                                                    <menuItem title="Icelandic" id="Ysy-I7-jyD" userLabel="Kroean">
-                                                        <modifierMask key="keyEquivalentModifierMask"/>
-                                                    </menuItem>
-                                                    <menuItem title="Kurdish" id="d5t-t7-aHq" userLabel="Kroean">
-                                                        <modifierMask key="keyEquivalentModifierMask"/>
-                                                    </menuItem>
-                                                    <menuItem title="Lithuanian" id="oOx-wK-DWY" userLabel="Kroean">
-                                                        <modifierMask key="keyEquivalentModifierMask"/>
-                                                    </menuItem>
-                                                    <menuItem title="Latvian" id="QBy-HC-9ku" userLabel="Kroean">
-                                                        <modifierMask key="keyEquivalentModifierMask"/>
-                                                    </menuItem>
-                                                </items>
-                                            </menu>
-                                        </popUpButtonCell>
-                                        <connections>
-                                            <action selector="comboxClicked_OcrLanguage:" target="-2" id="3cw-Om-M5h"/>
-                                        </connections>
-                                    </popUpButton>
-                                </subviews>
-                                <constraints>
-                                    <constraint firstItem="IFE-Qi-wNe" firstAttribute="leading" secondItem="wNe-bc-ZiD" secondAttribute="leading" constant="20" id="B27-hJ-q5f"/>
-                                    <constraint firstItem="ZQH-wQ-34k" firstAttribute="top" secondItem="IFE-Qi-wNe" secondAttribute="bottom" constant="5" id="Kfy-M6-Bh6"/>
-                                    <constraint firstAttribute="trailing" secondItem="vDb-Tm-oup" secondAttribute="trailing" constant="10" id="PXa-0N-aJm"/>
-                                    <constraint firstItem="vDb-Tm-oup" firstAttribute="top" secondItem="wNe-bc-ZiD" secondAttribute="top" constant="10" id="S9T-JK-XTw"/>
-                                    <constraint firstItem="vDb-Tm-oup" firstAttribute="leading" secondItem="wNe-bc-ZiD" secondAttribute="leading" constant="10" id="Tnm-60-Hy3"/>
-                                    <constraint firstItem="ZQH-wQ-34k" firstAttribute="leading" secondItem="wNe-bc-ZiD" secondAttribute="leading" constant="20" id="WeF-kH-63V"/>
-                                    <constraint firstAttribute="bottom" secondItem="ZQH-wQ-34k" secondAttribute="bottom" constant="10" id="YAA-Jk-tjZ"/>
-                                    <constraint firstItem="IFE-Qi-wNe" firstAttribute="top" secondItem="vDb-Tm-oup" secondAttribute="bottom" constant="10" id="gC2-2w-smP"/>
-                                    <constraint firstAttribute="trailing" secondItem="IFE-Qi-wNe" secondAttribute="trailing" constant="10" id="xXo-xV-TKi"/>
-                                    <constraint firstAttribute="trailing" secondItem="ZQH-wQ-34k" secondAttribute="trailing" constant="5" id="zQ6-lv-0WI"/>
-                                </constraints>
-                            </view>
-                            <font key="titleFont" metaFont="system"/>
-                        </box>
-                    </subviews>
-                    <constraints>
-                        <constraint firstItem="uy4-Qr-7eJ" firstAttribute="leading" secondItem="CFq-W0-Zmt" secondAttribute="leading" id="9tb-dn-kCc"/>
-                        <constraint firstItem="x4l-h4-1bj" firstAttribute="leading" secondItem="RWh-gu-eYa" secondAttribute="leading" constant="16" id="Are-V0-PQm"/>
-                        <constraint firstItem="CFq-W0-Zmt" firstAttribute="leading" secondItem="RWh-gu-eYa" secondAttribute="leading" constant="10" id="Fly-4m-Ynh"/>
-                        <constraint firstAttribute="bottom" secondItem="x4l-h4-1bj" secondAttribute="bottom" constant="16" id="Ggj-4b-dqX"/>
-                        <constraint firstItem="pvL-bb-6g1" firstAttribute="top" secondItem="CFq-W0-Zmt" secondAttribute="bottom" constant="153" id="L8N-CK-ccH"/>
-                        <constraint firstItem="uy4-Qr-7eJ" firstAttribute="trailing" secondItem="ibJ-Ae-4ze" secondAttribute="trailing" id="NAZ-nW-e1r"/>
-                        <constraint firstItem="ibJ-Ae-4ze" firstAttribute="top" secondItem="CFq-W0-Zmt" secondAttribute="bottom" constant="5" id="Pav-L9-vBx"/>
-                        <constraint firstItem="uy4-Qr-7eJ" firstAttribute="trailing" secondItem="CFq-W0-Zmt" secondAttribute="trailing" id="RoD-jM-w5N"/>
-                        <constraint firstItem="9oz-Jm-qNR" firstAttribute="top" secondItem="CFq-W0-Zmt" secondAttribute="bottom" constant="5" id="XRr-NV-gpp"/>
-                        <constraint firstItem="ibJ-Ae-4ze" firstAttribute="trailing" secondItem="CFq-W0-Zmt" secondAttribute="trailing" id="cNS-X6-XWf"/>
-                        <constraint firstAttribute="trailing" secondItem="CFq-W0-Zmt" secondAttribute="trailing" constant="10" id="cwL-Vr-eAK"/>
-                        <constraint firstItem="uy4-Qr-7eJ" firstAttribute="leading" secondItem="ibJ-Ae-4ze" secondAttribute="leading" id="hKq-no-OjG"/>
-                        <constraint firstItem="x4l-h4-1bj" firstAttribute="centerX" secondItem="RWh-gu-eYa" secondAttribute="centerX" id="lpV-Kh-Jid"/>
-                        <constraint firstItem="ibJ-Ae-4ze" firstAttribute="leading" secondItem="CFq-W0-Zmt" secondAttribute="leading" id="mmF-XJ-CIc"/>
-                        <constraint firstAttribute="trailing" secondItem="pvL-bb-6g1" secondAttribute="trailing" constant="10" id="nJu-Su-AG1"/>
-                        <constraint firstItem="uy4-Qr-7eJ" firstAttribute="top" secondItem="CFq-W0-Zmt" secondAttribute="bottom" constant="5" id="nl5-jL-QDs"/>
-                        <constraint firstItem="CFq-W0-Zmt" firstAttribute="top" secondItem="RWh-gu-eYa" secondAttribute="top" constant="10" id="q5y-Gb-u7k"/>
-                        <constraint firstAttribute="trailing" secondItem="9oz-Jm-qNR" secondAttribute="trailing" constant="15" id="sUG-ph-5Sf"/>
-                        <constraint firstItem="pvL-bb-6g1" firstAttribute="leading" secondItem="CFq-W0-Zmt" secondAttribute="leading" id="uhB-ye-18Z"/>
-                        <constraint firstItem="9oz-Jm-qNR" firstAttribute="leading" secondItem="RWh-gu-eYa" secondAttribute="leading" constant="15" id="wac-k3-MeM"/>
-                    </constraints>
-                </customView>
-                <customView translatesAutoresizingMaskIntoConstraints="NO" id="HlZ-Fb-Ttq" customClass="KMConvertCollectionViewHeader" customModule="PDF_Reader_Pro" customModuleProvider="target">
-                    <rect key="frame" x="0.0" y="525" width="340" height="50"/>
-                    <constraints>
-                        <constraint firstAttribute="height" constant="50" id="H2J-A1-Bx6"/>
-                    </constraints>
-                </customView>
-            </subviews>
-            <constraints>
-                <constraint firstAttribute="trailing" secondItem="RWh-gu-eYa" secondAttribute="trailing" id="Fbn-Qw-gUP"/>
-                <constraint firstAttribute="trailing" secondItem="HlZ-Fb-Ttq" secondAttribute="trailing" id="K0e-fR-D2S"/>
-                <constraint firstItem="RWh-gu-eYa" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" id="Kfu-cW-k4f"/>
-                <constraint firstItem="RWh-gu-eYa" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" constant="50" id="Rpg-0R-LrK"/>
-                <constraint firstItem="HlZ-Fb-Ttq" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" id="tyE-Qz-Reg"/>
-                <constraint firstAttribute="bottom" secondItem="RWh-gu-eYa" secondAttribute="bottom" id="xVC-9U-dqH"/>
-                <constraint firstItem="HlZ-Fb-Ttq" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" id="xeB-em-JnJ"/>
-            </constraints>
-            <point key="canvasLocation" x="117" y="280.5"/>
-        </customView>
-    </objects>
-    <resources>
-        <image name="KMImageNameElsei" width="15" height="14"/>
-    </resources>
-</document>

+ 0 - 166
PDF Office/PDF Master/Class/Batch/WindowController/VC/KMBatchOperateRemoveHeaderFooterViewController.swift

@@ -1,166 +0,0 @@
-//
-//  KMBatchOperateRemoveHeaderFooterViewController.swift
-//  PDF Reader Pro
-//
-//  Created by tangchao on 2023/11/6.
-//
-
-import Cocoa
-
-class KMBatchOperateRemoveHeaderFooterViewController: KMBatchOperateBaseViewController {
-    
-    var isBates = false
-    
-    @IBOutlet var actionButton: NSButton!
-    private var _haveFiles = false
-
-    deinit {
-        NotificationCenter.default.removeObserver(self)
-        DistributedNotificationCenter.default().removeObserver(self)
-        KMPrint("KMBatchOperateRemoveHeaderFooterViewController deinit.")
-    }
-    
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        
-        self._localizedlanguage()
-        self._configuiUI()
-        DistributedNotificationCenter.default.addObserver(self, selector: #selector(_themeChanged), name: Notification.Name("AppleInterfaceThemeChangedNotification"), object: nil)
-        NotificationCenter.default.addObserver(self, selector: #selector(batchFilesCountNotification(notification:)), name: Notification.Name(rawValue: "KMBatchFilesCountNotification"), object: nil)
-    }
-    
-    override var interfaceStatus: KMBatchOperateInterfaceStatus? {
-        set {
-            if (newValue == .PrepareProcess) {
-                super.interfaceStatus = newValue
-                DispatchQueue.main.asyncAfter(deadline: .now()+0.4) {
-                    var files: [URL] = []
-                    for url in self.successFilePathURLArray ?? [] {
-                        if (FileManager.default.fileExists(atPath: url.path)) {
-                            files.append(url)
-                        }
-                    }
-                    if(files.count > 0) {
-                        let workspace = NSWorkspace.shared
-                        workspace.activateFileViewerSelecting(files)
-                    }
-                }
-                self.actionButton.tag = 1
-                if (self.isBates) {
-                    self.actionButton.title = KMLocalizedString("Remove Bates Numbers")
-                } else {
-                    self.actionButton.title = KMLocalizedString("Remove Header & Footer")
-                }
-                
-                self.actionButton.setTitleColor(KMAppearance.Layout.w0Color())
-            } else {
-                self.actionButton.tag = 0
-                self.actionButton.title = KMLocalizedString("Cancel")
-                self.actionButton.setTitleColor(KMAppearance.Layout.w0Color())
-            }
-        }
-        get {
-            return super.interfaceStatus
-        }
-    }
-    
-    @IBAction func buttonClicked_Action(_ sender: NSButton) {
-        if (!self._haveFiles) {
-            return
-        }
-
-        if (sender.tag == 1) {
-            self.beginBatchOperation()
-        } else if (sender.tag == 0) {
-            self.cancelBatchOperation()
-        }
-    }
-    @objc func batchFilesCountNotification(notification: Notification) {
-        let arr: Array? = notification.object as? [KMBatchOperateFile]
-        self.files? = arr ?? []
-        if arr?.count ?? 0 > 0{
-            self.actionButton.setTitleColor(KMAppearance.Layout.w0Color())
-            self.actionButton.layer?.backgroundColor = KMAppearance.Interactive.m0Color().cgColor
-        }else {
-            self.actionButton.setTitleColor(KMAppearance.Layout.w0Color().withAlphaComponent(0.6))
-            self.actionButton.layer?.backgroundColor = KMAppearance.Interactive.m0Color().withAlphaComponent(0.6).cgColor
-        }
-    }
-}
-
-// MARK: - Private Methods
-
-extension KMBatchOperateRemoveHeaderFooterViewController {
-    private func _localizedlanguage() {
-        if (self.isBates) {
-            self.actionButton.title = KMLocalizedString("Remove Bates Numbers")
-        } else {
-            self.actionButton.title = KMLocalizedString("Remove Header & Footer")
-        }
-    }
-    
-    private func _configuiUI() {
-        self.view.wantsLayer = true
-        self.actionButton.wantsLayer = true
-        if let cnt = self.files?.count, cnt > 0 {
-            self._haveFiles = true
-        } else {
-            self._haveFiles = false
-        }
-        self.actionButton.layer?.cornerRadius = 1.0
-        self._updateViewColor()
-        
-        
-        NotificationCenter.default.addObserver(self, selector: #selector(_batchFilesCountNotification), name: Notification.Name("KMBatchFilesCountNotification"), object: nil)
-    }
-    
-    private func _updateViewColor() {
-        if(KMAppearance.isDarkMode()){
-            self.view.layer?.backgroundColor = NSColor(red: 0.149, green: 0.157, blue: 0.169, alpha: 1).cgColor
-        } else {
-            self.view.layer?.backgroundColor = NSColor(red: 0.988, green: 0.992, blue: 1.000, alpha: 1).cgColor
-        }
-        self._updateBtnColor()
-    }
-    
-    @objc private func _batchFilesCountNotification(_ notification: Notification) {
-        let files = notification.object as? NSArray
-        
-        if let cnt = files?.count, cnt > 0 {
-            self._haveFiles = true
-        } else {
-            self._haveFiles = false
-        }
-        self._updateBtnColor()
-    }
-    
-    private func _updateBtnColor() {
-        if(KMAppearance.isDarkMode()){
-            if (self._haveFiles) {
-                self.actionButton.layer?.backgroundColor = NSColor(red: 0.306, green: 0.498, blue: 0.859, alpha: 1).cgColor
-                self.actionButton.setTitleColor(KMAppearance.Layout.w0Color())
-            } else {
-                self.actionButton.layer?.backgroundColor = NSColor(red: 0.306, green: 0.498, blue: 0.859, alpha: 0.6).cgColor
-                self.actionButton.setTitleColor(KMAppearance.Layout.w0Color().withAlphaComponent(0.6))
-            }
-        }else {
-            if (self._haveFiles) {
-                self.actionButton.layer?.backgroundColor = NSColor(red: 0.153, green: 0.235, blue: 0.384, alpha: 1).cgColor
-                self.actionButton.setTitleColor(KMAppearance.Layout.w0Color())
-            } else {
-                self.actionButton.layer?.backgroundColor = NSColor(red: 0.153, green: 0.235, blue: 0.384, alpha: 0.6).cgColor
-                self.actionButton.setTitleColor(KMAppearance.Layout.w0Color().withAlphaComponent(0.6))
-            }
-        }
-    }
-    
-    @objc private func _themeChanged(_ notification: NSNotification) {
-        DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
-            self._updateViewColor()
-        }
-    }
-}
-
-//extension KMBatchOperateRemoveHeaderFooterViewController: KMBatchOperateProtocol {
-    
-//}

+ 0 - 52
PDF Office/PDF Master/Class/Batch/WindowController/VC/KMBatchOperateRemoveHeaderFooterViewController.xib

@@ -1,52 +0,0 @@
-<?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="KMBatchOperateRemoveHeaderFooterViewController" customModule="PDF_Reader_Pro" customModuleProvider="target">
-            <connections>
-                <outlet property="actionButton" destination="rij-IY-bAZ" id="uRb-Ty-y7n"/>
-                <outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
-            </connections>
-        </customObject>
-        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
-        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
-        <customView id="Hz6-mo-xeY">
-            <rect key="frame" x="0.0" y="0.0" width="480" height="272"/>
-            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
-            <subviews>
-                <box verticalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="MnA-Ka-GT9">
-                    <rect key="frame" x="0.0" y="269" width="480" height="5"/>
-                    <constraints>
-                        <constraint firstAttribute="height" constant="1" id="102-8I-TP4"/>
-                    </constraints>
-                </box>
-                <button tag="1" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="rij-IY-bAZ">
-                    <rect key="frame" x="16" y="120" width="448" height="32"/>
-                    <buttonCell key="cell" type="bevel" title="Button" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="0XI-EU-sYm">
-                        <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                        <font key="font" metaFont="system"/>
-                        <connections>
-                            <action selector="buttonClicked_Action:" target="-2" id="cVo-x6-zlz"/>
-                        </connections>
-                    </buttonCell>
-                    <constraints>
-                        <constraint firstAttribute="height" constant="32" id="04g-cN-UNw"/>
-                    </constraints>
-                </button>
-            </subviews>
-            <constraints>
-                <constraint firstAttribute="trailing" secondItem="MnA-Ka-GT9" secondAttribute="trailing" id="068-Rf-l61"/>
-                <constraint firstItem="rij-IY-bAZ" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="16" id="083-Bo-yPl"/>
-                <constraint firstItem="rij-IY-bAZ" firstAttribute="centerY" secondItem="Hz6-mo-xeY" secondAttribute="centerY" id="47P-zc-TBC"/>
-                <constraint firstItem="MnA-Ka-GT9" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" id="P3k-a3-y1n"/>
-                <constraint firstItem="MnA-Ka-GT9" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" id="byk-0o-f2g"/>
-                <constraint firstItem="rij-IY-bAZ" firstAttribute="centerX" secondItem="Hz6-mo-xeY" secondAttribute="centerX" id="syj-W5-Ijr"/>
-            </constraints>
-            <point key="canvasLocation" x="6" y="121"/>
-        </customView>
-    </objects>
-</document>

+ 0 - 108
PDF Office/PDF Master/Class/Batch/WindowController/VC/KMPlanViewController.swift

@@ -1,108 +0,0 @@
-//
-//  KMPlanViewController.swift
-//  PDF Reader Pro
-//
-//  Created by liujiajie on 2023/12/6.
-//
-
-import Cocoa
-
-@objc(KMPlanTableCellView)
-protocol KMPlanTableCellViewDelegate: AnyObject {
-    func tableCellViewCheckButtonDidChange(_ cell: KMPlanTableCellView)
-}
-
-
-class KMPlanTableCellView: NSTableCellView{
-    var delegate: KMPlanTableCellViewDelegate?
-    var language: String = ""
-    @IBOutlet var planTextField: NSTextField!
-    @IBOutlet var planButton: NSButton!
-    
-    @IBAction func planButtonAction(_ sender: NSButton) {
-        self.delegate?.tableCellViewCheckButtonDidChange(self)
-    }
-}
-
-
-class KMPlanViewController: NSViewController,KMPlanTableCellViewDelegate,NSOutlineViewDelegate,NSOutlineViewDataSource{
-    
-    @IBOutlet var outlineView: NSOutlineView!
-    lazy var palns: Array<String> = {
-        let palns = [KMLocalizedString("Plan 1 (Online)"), KMLocalizedString("Plan 2 (Offline)")]
-        return palns
-    }()
-    
-    override init(nibName nibNameOrNil: NSNib.Name?, bundle nibBundleOrNil: Bundle?) {
-        super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
-        
-    }
-    
-    required init?(coder: NSCoder) {
-        super.init(coder: coder)
-    }
-    
-    override func awakeFromNib() {
-        super.awakeFromNib()
-        self.outlineView.reloadData()
-    }
-    //MARK: NSOutlineViewDataSource
-    func outlineView(_ outlineView: NSOutlineView, numberOfChildrenOfItem item: Any?) -> Int {
-        return self.palns.count
-    }
-    func outlineView(_ outlineView: NSOutlineView, child index: Int, ofItem item: Any?) -> Any {
-        return self.palns[index]
-    }
-    func outlineView(_ outlineView: NSOutlineView, isItemExpandable item: Any) -> Bool {
-        return false
-    }
-    // NSOutlineViewDelegate
-    func outlineView(_ outlineView: NSOutlineView, viewFor tableColumn: NSTableColumn?, item: Any) -> NSView? {
-        let result = outlineView.makeView(withIdentifier: NSUserInterfaceItemIdentifier("PlanDataCell"), owner: self) as! KMPlanTableCellView
-        let plan = UserDefaults.standard.integer(forKey: "KMOCRCurrentPlanKey")
-        if plan == transformCellNum(cellContent: item as! String) {
-            result.planButton.state = .on
-        } else {
-            result.planButton.state = .off
-        }
-        result.planTextField.stringValue = item as! String
-        result.language = item as! String
-        result.delegate = self 
-        return result
-    }
-    func outlineView(_ outlineView: NSOutlineView, shouldSelectItem item: Any) -> Bool {
-        return false
-    }
-
-    //MARK: KMPlanTableCellViewDelegate
-    func tableCellViewCheckButtonDidChange(_ cell: KMPlanTableCellView) {
-        let plan = transformCellNum(cellContent: cell.planTextField.stringValue)
-        if cell.planButton.state == .on{
-            UserDefaults.standard.set(plan, forKey: "KMOCRCurrentPlanKey")
-        } else {
-            if plan == 0 {
-                UserDefaults.standard.set(1, forKey: "KMOCRCurrentPlanKey")
-            } else {
-                UserDefaults.standard.set(0, forKey: "KMOCRCurrentPlanKey")
-            }
-            UserDefaults.standard.synchronize()
-        }
-        self.outlineView.reloadData() 
-        NotificationCenter.default.post(name: NSNotification.Name("KMOCRSelectedPlanChangeNotification"), object: nil)
-    }
-    
-    func transformCellNum(cellContent:String) -> Int {
-        var index = 0
-        for i in 0..<(self.palns.count) {
-            let str: String = self.palns[i]
-            if cellContent == str {
-                index = i
-                break
-            }
-        }
-        return index
-    }
-    
-}
-
-

+ 0 - 113
PDF Office/PDF Master/Class/Batch/WindowController/VC/KMPlanViewController.xib

@@ -1,113 +0,0 @@
-<?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">
-    <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="KMPlanViewController" customModule="PDF_Reader_Pro" customModuleProvider="target">
-            <connections>
-                <outlet property="outlineView" destination="8Es-2J-byF" id="AwP-3B-KvW"/>
-                <outlet property="view" destination="Hz6-mo-xeY" id="QPl-vD-Dbq"/>
-            </connections>
-        </customObject>
-        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
-        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
-        <customView id="Hz6-mo-xeY">
-            <rect key="frame" x="0.0" y="0.0" width="180" height="70"/>
-            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
-            <subviews>
-                <scrollView autohidesScrollers="YES" horizontalLineScroll="24" horizontalPageScroll="10" verticalLineScroll="24" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xEa-P5-7CN">
-                    <rect key="frame" x="0.0" y="0.0" width="180" height="70"/>
-                    <clipView key="contentView" drawsBackground="NO" copiesOnScroll="NO" id="laq-aG-Vai">
-                        <rect key="frame" x="1" y="1" width="178" height="68"/>
-                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                        <subviews>
-                            <outlineView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" selectionHighlightStyle="sourceList" multipleSelection="NO" autosaveColumns="NO" rowHeight="24" viewBased="YES" indentationPerLevel="13" indentationMarkerFollowsCell="NO" outlineTableColumn="i9s-MT-kLZ" id="8Es-2J-byF">
-                                <rect key="frame" x="0.0" y="0.0" width="178" height="68"/>
-                                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                <size key="intercellSpacing" width="3" height="0.0"/>
-                                <color key="backgroundColor" name="_sourceListBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                <color key="gridColor" red="0.90196078431372551" green="0.90196078431372551" blue="0.90196078431372551" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
-                                <tableColumns>
-                                    <tableColumn width="146" minWidth="16" maxWidth="1000" id="i9s-MT-kLZ">
-                                        <tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border">
-                                            <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
-                                            <color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
-                                        </tableHeaderCell>
-                                        <textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" title="Text Cell" id="XPk-BR-SFd">
-                                            <font key="font" metaFont="system"/>
-                                            <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
-                                            <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                        </textFieldCell>
-                                        <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
-                                        <prototypeCellViews>
-                                            <tableCellView identifier="PlanDataCell" id="C0I-oH-B2j" customClass="KMPlanTableCellView" customModule="PDF_Reader_Pro" customModuleProvider="target">
-                                                <rect key="frame" x="11" y="0.0" width="155" height="24"/>
-                                                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                                <subviews>
-                                                    <textField focusRingType="none" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Z85-c4-CJv">
-                                                        <rect key="frame" x="20" y="4" width="96" height="16"/>
-                                                        <textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" focusRingType="none" title="Table View Cell" drawsBackground="YES" id="5bQ-tJ-9hg">
-                                                            <font key="font" metaFont="system"/>
-                                                            <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
-                                                            <color key="backgroundColor" white="1" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
-                                                        </textFieldCell>
-                                                    </textField>
-                                                    <button focusRingType="none" translatesAutoresizingMaskIntoConstraints="NO" id="wMd-Rw-rLw">
-                                                        <rect key="frame" x="-2" y="3" width="18" height="18"/>
-                                                        <buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" focusRingType="none" inset="2" id="JhA-XH-n3a">
-                                                            <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
-                                                            <font key="font" metaFont="system"/>
-                                                        </buttonCell>
-                                                        <connections>
-                                                            <action selector="planButtonAction:" target="C0I-oH-B2j" id="cXB-Of-7y5"/>
-                                                        </connections>
-                                                    </button>
-                                                </subviews>
-                                                <constraints>
-                                                    <constraint firstItem="Z85-c4-CJv" firstAttribute="leading" secondItem="wMd-Rw-rLw" secondAttribute="trailing" constant="6" id="58S-2o-88N"/>
-                                                    <constraint firstItem="wMd-Rw-rLw" firstAttribute="centerY" secondItem="C0I-oH-B2j" secondAttribute="centerY" id="G90-2z-Pji"/>
-                                                    <constraint firstItem="Z85-c4-CJv" firstAttribute="centerY" secondItem="C0I-oH-B2j" secondAttribute="centerY" id="pBF-7Q-gcL"/>
-                                                    <constraint firstItem="wMd-Rw-rLw" firstAttribute="leading" secondItem="C0I-oH-B2j" secondAttribute="leading" id="rop-lB-TZX"/>
-                                                </constraints>
-                                                <connections>
-                                                    <outlet property="planButton" destination="wMd-Rw-rLw" id="5gq-xc-CLK"/>
-                                                    <outlet property="planTextField" destination="Z85-c4-CJv" id="8ME-ek-6wq"/>
-                                                </connections>
-                                            </tableCellView>
-                                        </prototypeCellViews>
-                                    </tableColumn>
-                                </tableColumns>
-                                <connections>
-                                    <outlet property="dataSource" destination="-2" id="tJE-Ia-tjx"/>
-                                    <outlet property="delegate" destination="-2" id="Ep1-OK-VfO"/>
-                                </connections>
-                            </outlineView>
-                        </subviews>
-                        <nil key="backgroundColor"/>
-                    </clipView>
-                    <constraints>
-                        <constraint firstAttribute="height" constant="70" id="oe5-nl-Fh0"/>
-                    </constraints>
-                    <scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="9SF-O5-3Wq">
-                        <rect key="frame" x="1" y="119" width="238" height="15"/>
-                        <autoresizingMask key="autoresizingMask"/>
-                    </scroller>
-                    <scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="NO" id="1Gw-AD-G7g">
-                        <rect key="frame" x="224" y="17" width="15" height="102"/>
-                        <autoresizingMask key="autoresizingMask"/>
-                    </scroller>
-                </scrollView>
-            </subviews>
-            <constraints>
-                <constraint firstItem="xEa-P5-7CN" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" id="Ata-Vr-6R7"/>
-                <constraint firstItem="xEa-P5-7CN" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" id="WG3-be-ffU"/>
-                <constraint firstAttribute="bottom" secondItem="xEa-P5-7CN" secondAttribute="bottom" id="o9g-Mo-brU"/>
-                <constraint firstAttribute="trailing" secondItem="xEa-P5-7CN" secondAttribute="trailing" id="xOr-C1-JaL"/>
-            </constraints>
-            <point key="canvasLocation" x="132.5" y="153.5"/>
-        </customView>
-    </objects>
-</document>

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

@@ -11,7 +11,7 @@ extension KMBrowserWindowController {
     
     func newFromImageFile() {
         let openPanel = NSOpenPanel()
-        openPanel.allowedFileTypes = KMImageToPDFMethod.supportedImageTypes()
+        openPanel.allowedFileTypes = KMBatchManager.supportedImageTypes()
         //MARK: 允许多选还是单选,如果是付费用户允许多选
         openPanel.allowsMultipleSelection = true
         openPanel.message = KMLocalizedString("Select images to create a new document. To select multiple files press cmd ⌘ button on keyboard and click on the target files one by one.")

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

@@ -465,7 +465,7 @@ import Cocoa
                 }
             }
             if imageUrls.isEmpty == false {
-                NSApplication.ShowImageToPDFWindow(urls: imageUrls)
+                self.showBatchWindow(type: .imageToPDF, files: imageUrls)
             }
         }
     }

+ 0 - 286
PDF Office/PDF Master/Class/PDFTools/AddHeaderFooter/Model/KMBatchAddHeaderFooterOperation.swift

@@ -1,286 +0,0 @@
-//
-//  KMBatchAddHeaderFooterOperation.swift
-//  PDF Reader Pro
-//
-//  Created by liujiajie on 2023/11/7.
-//
-
-import Foundation
-
-let supportDirectory = NSSearchPathForDirectoriesInDomains(.applicationSupportDirectory, .userDomainMask, true).last
-let mainBundleIdentifier = Bundle.main.bundleIdentifier ?? ""
-let kTempSavePath = supportDirectory?.stringByAppendingPathComponent(mainBundleIdentifier)
-
-class KMBatchAddHeaderFooterOperation: KMBatchOperation{
-    var headerFooter: KMHeaderFooterModel?
-    var pdfDocument: CPDFDocument?
-    var password: String?
-    
-    init(file: KMBatchOperateFile, headerFooter: KMHeaderFooterModel) {
-        super.init(file: file)
-        self.headerFooter = headerFooter
-        
-    }
-    func currentParameter() -> KMBatchBaseParameter {
-         return operateFile!.addHeaderFooterInfo
-    }
-    override func start() {
-        self.pdfDocument = CPDFDocument(url: URL(fileURLWithPath: self.operateFile?.filePath ?? ""))
-        self.password = self.operateFile?.password
-        if let data = self.pdfDocument?.isLocked, data {
-            self.pdfDocument?.unlock(withPassword: self.operateFile?.password)
-        }
-        if !self.isCancelled {
-            self.delegate?.fileBeginOperate?(self.operateFile!, info: self.currentParameter())
-            willChangeValue(forKey: "isExecuting")
-            self.hasExcuting = true
-            didChangeValue(forKey: "isExecuting")
-            if !FileManager.default.fileExists(atPath: self.operateFile!.filePath) {
-                self.delegate?.fileOperateFailed?(self.operateFile!, error: self.errorWithMsg(KMLocalizedString("File Not Exist")), info: self.operateFile!.removeBatesInfo)
-                
-                self.willChangeValue(forKey: "isFinished")
-                self.hasFinished = true
-                self.didChangeValue(forKey: "isFinished")
-                return
-            }
-            
-            if self.pdfDocument == nil {
-                self.delegate?.fileOperateFailed?(self.operateFile!, error: self.errorWithMsg(KMLocalizedString("An error occurred while opening this document. The file is damaged and could not be repaired.")), info: self.operateFile!.removeWatermarkInfo)
-                self.willChangeValue(forKey: "isFinished")
-                self.hasFinished = true
-                self.didChangeValue(forKey: "isFinished")
-                return
-            }
-            
-            if !self.pdfDocument!.allowsPrinting || !self.pdfDocument!.allowsCopying {
-                self.delegate?.fileOperateFailed?(self.operateFile!, error: self.errorWithMsg(KMLocalizedString("This is a secured document. Editing is not permitted.")), info: self.operateFile!.removeWatermarkInfo)
-                self.willChangeValue(forKey: "isFinished")
-                self.hasFinished = true
-                self.didChangeValue(forKey: "isFinished")
-                return
-            }
-            if let filepath = self.operateFile?.currentOperateInfo?.fetchDestinationFilepath() {
-                self.saveAsPDFToPath(filepath)
-            }
-            
-        }else {
-            willChangeValue(forKey: "isFinished")
-            willChangeValue(forKey: "isExecuting")
-            hasExcuting = false
-            hasFinished = true
-            didChangeValue(forKey: "isExecuting")
-            didChangeValue(forKey: "isFinished")
-        }
-    }
-    override func cancel() {
-        //        super.cancel()
-        if isExecuting {
-            operateFile!.removeWatermarkInfo.status = .Waiting
-            if FileManager.default.fileExists(atPath: self.currentParameter().outPutPath!) { try? FileManager.default.removeItem(atPath: self.currentParameter().outPutPath!)
-            }
-            self.delegate?.fileOperateCanceled?(self.operateFile!, info: self.currentParameter())
-            
-            willChangeValue(forKey: "isFinished")
-            hasFinished = true
-            didChangeValue(forKey: "isFinished")
-        } else {
-            willChangeValue(forKey: "isCancelled")
-            hasCanceled = true
-            didChangeValue(forKey: "isCancelled")
-        }
-    }
-    
-    func saveAsPDFToPath(_ path: String) {
-        var filePath = self.pdfDocument?.documentURL?.path
-        let password = self.password
-        if filePath == nil {
-            let str = String(format: "%@.pdf", KMLocalizedString("Untitled"))
-            let writeSuccess = self.pdfDocument!.write(to: URL(fileURLWithPath: (kTempSavePath?.stringByAppendingPathComponent(str))!))
-            if writeSuccess {
-                let newDocument: CPDFDocument = CPDFDocument(url: URL(fileURLWithPath: (kTempSavePath?.stringByAppendingPathComponent(str))!))
-                filePath = newDocument.documentURL?.path
-            } else {
-                NSSound.beep()
-                return
-            }
-        }
-        
-        guard let document = CPDFDocument(url: URL(fileURLWithPath: filePath!)) else {
-            return
-        }
-        
-        if password?.count ?? 0 > 0 {
-            document.unlock(withPassword: password)
-        }
-        
-//        let font = NSFont.boldSystemFont(ofSize: self.headerFooter?.getTextFontSize() ?? 16)
-//        let style = NSMutableParagraphStyle()
-//        style.alignment = .center
-//        style.lineBreakMode = .byCharWrapping
-//        var dictionary = [NSAttributedString.Key: Any]()
-//        dictionary[.paragraphStyle] = style
-//        dictionary[.font] = font
-//        let size = "text".boundingRect(with: CGSize(width: CGFloat(MAXFLOAT), height: CGFloat(MAXFLOAT)), options: [.usesLineFragmentOrigin, .usesFontLeading], attributes: dictionary).size
-//        
-//        if self.headerFooter!.isBates {
-//            var bates: CPDFHeaderFooter = document.bates()
-//            bates.margin = NSEdgeInsets(top: max(CGFloat(self.headerFooter!.topMargin) - size.height, 0), left: CGFloat(self.headerFooter!.leftMargin), bottom: max(CGFloat(self.headerFooter!.bottomMargin) - size.height, 0), right: CGFloat(self.headerFooter!.rightMargin))
-//            
-//            var arr = [NSNumber]()
-//            for i in 0..<(self.operateFile?.addBatesInfo.pagesArray?.count ?? 0) {
-//                var tmp = self.operateFile?.addBatesInfo.pagesArray?[i].intValue
-//                tmp! -= 1
-//                let number = NSNumber(value: tmp ?? 0)
-//                arr.append(number)
-//            }
-//            if arr.count < 1 {
-//                let error = NSError(domain: "LocalError", code: 0, userInfo: [NSLocalizedDescriptionKey: KMLocalizedString("Invalid page range or the page number is out of range. Please try again.")])
-//                self.delegate?.fileOperateFailed?(self.operateFile!, error: error, info: self.operateFile!.addBatesInfo)
-//                
-//                willChangeValue(forKey: "isFinished")
-//                self.hasFinished = true
-//                didChangeValue(forKey: "isFinished")
-//                return
-//            }
-//            let pagesString = arr.map{ "\($0)" }.joined(separator: ",")
-//            if pagesString.count > 0 {
-//                bates.pageString = pagesString
-//            } else {
-//                let pageString = String(format: "0-%ld", document.pageCount-1)
-//                bates.pageString = pageString
-//            }
-//            
-//            let topLeftString = self.headerFooter?.topLeftString
-//            let topCenterString = self.headerFooter?.topCenterString
-//            let topRightString = self.headerFooter?.topRightString
-//            let bottomLeftString = self.headerFooter?.bottomLeftString
-//            let bottomCenterString = self.headerFooter?.bottomCenterString
-//            let bottomRightString = self.headerFooter?.bottomRightString
-//            let items = [topLeftString, topCenterString, topRightString, bottomLeftString, bottomCenterString, bottomRightString]
-//            for i in 0..<items.count {
-//                let text = items[i]
-//                bates.setText(text, at: UInt(Int(i)))
-//                bates.setTextColor(self.headerFooter?.getTextColor(), at: UInt(Int(i)))
-//                bates.setFontSize(self.headerFooter?.getTextFontSize() ?? 16.0, at: UInt(Int(i)))
-//            }
-//            
-//            bates.update()
-//        } else {
-//            let headerFooterNew = document.headerFooter()
-//            headerFooterNew?.margin = NSEdgeInsets(top: max(CGFloat(self.headerFooter!.topMargin)-size.height, 0), left: CGFloat(self.headerFooter!.leftMargin), bottom: max(CGFloat(self.headerFooter!.bottomMargin)-size.height, 0), right: CGFloat(self.headerFooter!.rightMargin))
-//            
-//            var arr = [NSNumber]()
-//            for i in 0..<(self.operateFile?.addHeaderFooterInfo.pagesArray?.count ?? 0) {
-//                var tmp = self.operateFile?.addHeaderFooterInfo.pagesArray?[i].intValue
-//                tmp! -= 1
-//                let number = NSNumber(value: tmp ?? 0)
-//                arr.append(number)
-//            }
-//            if arr.count < 1 {
-//                let error = NSError(domain: "LocalError", code: 0, userInfo: [NSLocalizedDescriptionKey: KMLocalizedString("Invalid page range or the page number is out of range. Please try again.")])
-//                self.delegate?.fileOperateFailed?(self.operateFile!, error: error, info: self.operateFile!.addHeaderFooterInfo)
-//                willChangeValue(forKey: "isFinished")
-//                self.hasFinished = true
-//                didChangeValue(forKey: "isFinished")
-//                return
-//            }
-//            let pagesString = arr.map{ "\($0)" }.joined(separator: ",")
-//            if pagesString.count > 0 {
-//                headerFooterNew?.pageString = pagesString
-//            } else {
-//                let pageString = String(format: "0-%ld", document.pageCount-1)
-//                headerFooterNew?.pageString = pageString
-//            }
-//            let num: Int = Int(self.headerFooter?.startString ?? "0") ?? 0
-//            let pageCount = Int(document.pageCount) + num - 1
-//            
-//            let topLeftString = convertPageFormat(oldString: self.headerFooter!.topLeftString, startPage: self.headerFooter!.startString,pageCount: "\(pageCount)")
-//            let topCenterString = convertPageFormat(oldString: self.headerFooter!.topCenterString, startPage: self.headerFooter!.startString,pageCount: "\(pageCount)")
-//            let topRightString = convertPageFormat(oldString: self.headerFooter!.topRightString, startPage: self.headerFooter!.startString,pageCount: "\(pageCount)")
-//            let bottomLeftString = convertPageFormat(oldString: self.headerFooter!.bottomLeftString, startPage: self.headerFooter!.startString, pageCount: "\(pageCount)")
-//            let bottomCenterString = convertPageFormat(oldString: self.headerFooter!.bottomCenterString, startPage: self.headerFooter!.startString,pageCount: "\(pageCount)")
-//            let bottomRightString = convertPageFormat(oldString: self.headerFooter!.bottomRightString, startPage: self.headerFooter!.startString,pageCount: "\(pageCount)")
-//            let items = [topLeftString, topCenterString, topRightString, bottomLeftString, bottomCenterString, bottomRightString]
-//            for i in 0..<items.count {
-//                let text = items[i]
-//                headerFooterNew?.setText(text, at: UInt(i))
-//                headerFooterNew?.setTextColor(self.headerFooter!.getTextColor(), at: UInt(Int(i)))
-//                headerFooterNew?.setFontSize(self.headerFooter!.getTextFontSize(), at: UInt(Int(i)))
-//            }
-//            
-//            headerFooterNew?.update()
-//        }
-//        
-//        let documentPath = NSTemporaryDirectory()
-//        let tempPath = documentPath.appending(filePath!.lastPathComponent)
-//        if FileManager.default.fileExists(atPath: tempPath) {
-//            try? FileManager.default.removeItem(atPath: tempPath)
-//        }
-//        
-//        let result = document.write(to: URL(fileURLWithPath: tempPath))
-//        if result {
-//            if FileManager.default.fileExists(atPath: path) {
-//                try? FileManager.default.removeItem(atPath: path)
-//            }
-//            try? FileManager.default.moveItem(atPath: tempPath, toPath: path)
-//        } else {
-//            try? FileManager.default.removeItem(atPath: tempPath)
-//        }
-//        if result {
-//            self.delegate?.fileOperateSuccessed?(self.operateFile!, info: self.currentParameter())
-//        } else {
-//            self.delegate?.fileOperateFailed?(self.operateFile!, error: self.defaultError(), info: self.currentParameter())
-//        }
-//        
-//        willChangeValue(forKey: "isFinished")
-//        self.hasFinished = true
-//        didChangeValue(forKey: "isFinished")
-    }
-    func defaultError() -> NSError {
-        return errorWithMsg(NSLocalizedString("Failed", comment: ""))
-    }
-}
-
-func convertPageFormat(oldString: String, startPage: String, pageCount: String) -> String {
-    let pageFormatArray = ["1", "1 of n", "1/n", "Page 1", "Page 1 of n"]
-    var newString = oldString
-    for pageFormat in pageFormatArray {
-        let format = "<<(pageFormat)>>"
-        if newString.contains(format) {
-            var tString: String? = nil
-            if pageFormat == "1" {
-                tString = "<<\(startPage)>>"
-            } else if pageFormat == "1 of n" {
-                tString = "\(startPage) of \(pageCount)"
-            } else if pageFormat == "1/n" {
-                tString = "\(startPage)/\(pageCount)"
-            } else if pageFormat == "Page 1" {
-                tString = "Page <<\(startPage)>>"
-            } else if pageFormat == "Page 1 of n" {
-                tString = "Page <<\(startPage)>> of \(pageCount)"
-            }
-            
-            newString = newString.replacingOccurrences(of: format, with: tString ?? "")
-        }
-    }
-    
-    newString = convertDateFormat(oldString: newString)
-    return newString
-}
-func convertDateFormat(oldString: String) -> String { 
-    var newString = oldString
-    for dateFormat in KMHeaderFooterManager.getdateFormatArray() {
-        if newString.contains(dateFormat) {
-            let formatString = dateFormat.replacingOccurrences(of: "m", with: "M")
-            let replace = "<<\(dateFormat)>>"
-            
-            let date = Date()
-            let dateFormatter = DateFormatter()
-            dateFormatter.dateFormat = formatString
-            let dateString = dateFormatter.string(from: date)
-            newString = newString.replacingOccurrences(of: replace, with: dateString)
-        }
-    }
-    
-    return newString
-}

+ 2 - 2
PDF Office/PDF Master/Class/PDFTools/AddPassword/KMSecurityWindowController.xib

@@ -1,8 +1,8 @@
 <?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">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="23504" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="23504"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>

+ 0 - 18
PDF Office/PDF Master/Class/PDFTools/AddPassword/Model/KMAddPasswordOperationQueue.swift

@@ -1,18 +0,0 @@
-//
-//  KMAddPasswordOperationQueue.swift
-//  PDF Reader Pro
-//
-//  Created by liujiajie on 2023/11/6.
-//
-
-import Foundation
-
-class KMAddPasswordOperationQueue: KMOperationQueue{
-    static let sharedQueue: KMAddPasswordOperationQueue = {
-        let queue = KMAddPasswordOperationQueue()
-        return queue
-    }()
-}
-
-
-

+ 0 - 127
PDF Office/PDF Master/Class/PDFTools/AddPassword/Model/KMBatchAddPasswordOperation.swift

@@ -1,127 +0,0 @@
-//
-//  KMBatchAddPasswordOperation.swift
-//  PDF Reader Pro
-//
-//  Created by liujiajie on 2023/11/6.
-//
-
-import Foundation
-
-class KMBatchAddPasswordOperation: KMBatchOperation{
-    var passwordObj: KMSetPasswordObject?
-    var pdfDocument: CPDFDocument?
-    
-    init(file: KMBatchOperateFile, password: KMSetPasswordObject) {
-        super.init(file: file)
-        self.passwordObj = password
-        
-    }
-    override func start() {
-        self.pdfDocument = CPDFDocument(url: URL(fileURLWithPath: self.operateFile?.filePath ?? ""))
-        if let data = self.pdfDocument?.isLocked, data {
-            self.pdfDocument?.unlock(withPassword: self.operateFile?.password)
-        }
-        if !self.isCancelled {
-            self.delegate?.fileBeginOperate?(self.operateFile!, info: self.operateFile!.removeWatermarkInfo)
-            willChangeValue(forKey: "isExecuting")
-            self.hasExcuting = true
-            didChangeValue(forKey: "isExecuting")
-            if !FileManager.default.fileExists(atPath: self.operateFile!.filePath) {
-                self.delegate?.fileOperateFailed?(self.operateFile!, error: self.errorWithMsg(KMLocalizedString("File Not Exist")), info: self.operateFile!.removeBatesInfo)
-                
-                self.willChangeValue(forKey: "isFinished")
-                self.hasFinished = true
-                self.didChangeValue(forKey: "isFinished")
-                return
-            }
-
-            if self.pdfDocument == nil {
-                self.delegate?.fileOperateFailed?(self.operateFile!, error: self.errorWithMsg(KMLocalizedString("An error occurred while opening this document. The file is damaged and could not be repaired.")), info: self.operateFile!.removeWatermarkInfo)
-                self.willChangeValue(forKey: "isFinished")
-                self.hasFinished = true
-                self.didChangeValue(forKey: "isFinished")
-                return
-            }
-
-            if !self.pdfDocument!.allowsPrinting || !self.pdfDocument!.allowsCopying {
-                self.delegate?.fileOperateFailed?(self.operateFile!, error: self.errorWithMsg(KMLocalizedString("This is a secured document. Editing is not permitted.")), info: self.operateFile!.removeWatermarkInfo)
-                self.willChangeValue(forKey: "isFinished")
-                self.hasFinished = true
-                self.didChangeValue(forKey: "isFinished")
-                return
-            }
-            var options: [CPDFDocumentWriteOption : Any] = [:]
-            var attribute: [CPDFDocumentAttribute : Any] = [:]
-
-            if let data = self.passwordObj?.needOpenPassword, data {
-                options.updateValue(self.passwordObj?.openPassword ?? "", forKey: .userPasswordOption)
-            } else {
-                if let password = self.operateFile?.password, password.isEmpty == false {
-                    options.updateValue(password, forKey: .userPasswordOption)
-                }
-            }
-            if let data = self.passwordObj?.needOwnerPassword, data {
-                options.updateValue(self.passwordObj?.canPrint ?? true, forKey: .allowsPrintingOption)
-                options.updateValue(self.passwordObj?.canCopy ?? true, forKey: .allowsCopyingOption)
-                options.updateValue(self.passwordObj?.ownerPassword ?? "", forKey: .ownerPasswordOption)
-            } else {
-                if let data = self.passwordObj?.needOpenPassword, data {
-                    options.updateValue(self.passwordObj?.openPassword ?? "", forKey: .ownerPasswordOption)
-                } else {
-                    if let password = self.operateFile?.password, password.isEmpty == false {
-                        options.updateValue(password, forKey: .ownerPasswordOption)
-                    }
-                }
-            }
-            if self.passwordObj?.title.count ?? 0 > 0 {
-                attribute.updateValue(self.passwordObj?.title ?? "", forKey: .titleAttribute)
-            }
-            if self.passwordObj?.author.count ?? 0 > 0 {
-                attribute.updateValue(self.passwordObj?.author ?? "", forKey: .authorAttribute)
-            }
-            if self.passwordObj?.theme.count ?? 0 > 0 {
-                attribute.updateValue(self.passwordObj?.theme ?? "", forKey: .subjectAttribute)
-            }
-            if self.passwordObj?.keyword.count ?? 0 > 0 {
-                attribute.updateValue(self.passwordObj?.keyword ?? "", forKey: .keywordsAttribute)
-            }
-            self.pdfDocument?.setDocumentAttributes(attribute)
-            let isSuccess = self.pdfDocument?.write(toFile: self.operateFile?.addPasswordInfo.fetchDestinationFilepath(), withOptions: options)
-            
-            if isSuccess! {
-                self.delegate?.fileOperateSuccessed?(self.operateFile!, info: self.operateFile!.addPasswordInfo)
-            } else {
-                self.delegate?.fileOperateFailed?(self.operateFile!, error: self.errorWithMsg(KMLocalizedString("Failed")), info: self.operateFile!.addPasswordInfo)
-            }
-            self.willChangeValue(forKey: "isFinished")
-            self.hasFinished = true
-            self.didChangeValue(forKey: "isFinished")
-        }else {
-            willChangeValue(forKey: "isFinished")
-            willChangeValue(forKey: "isExecuting")
-            hasExcuting = false
-            hasFinished = true
-            didChangeValue(forKey: "isExecuting")
-            didChangeValue(forKey: "isFinished")
-        }
-    }
-    override func cancel() {
-//        super.cancel()
-        if isExecuting {
-            operateFile!.removeWatermarkInfo.status = .Waiting
-            if FileManager.default.fileExists(atPath: operateFile!.addPasswordInfo.outPutPath!) { try? FileManager.default.removeItem(atPath: operateFile!.addPasswordInfo.outPutPath!)
-            }
-            self.delegate?.fileOperateCanceled?(self.operateFile!, info: self.operateFile!.addPasswordInfo)
-           
-           willChangeValue(forKey: "isFinished")
-           hasFinished = true
-           didChangeValue(forKey: "isFinished")
-       } else {
-           willChangeValue(forKey: "isCancelled")
-           hasCanceled = true
-           didChangeValue(forKey: "isCancelled")
-       }
-    }
-}
-
-

+ 0 - 27
PDF Office/PDF Master/Class/PDFTools/AddPassword/Model/KMSetPasswordObject.swift

@@ -1,27 +0,0 @@
-//
-//  KMSetPasswordObject.swift
-//  PDF Reader Pro
-//
-//  Created by liujiajie on 2023/11/6.
-//
-
-import Foundation
-
-class KMSetPasswordObject: NSObject{
-    var needOpenPassword: Bool = false
-    var needOwnerPassword: Bool = false
-    var canCopy: Bool = true
-    var canPrint: Bool = true
-    var openPassword: String = ""
-    var ownerPassword: String = ""
-    var title: String = ""
-    var author: String = ""
-    var theme: String = ""
-    var keyword: String = ""
-    
-    override init() {
-        super.init()
-        
-    }
-    
-}

+ 0 - 399
PDF Office/PDF Master/Class/PDFTools/AddPassword/VC/KMBatchOperateAddPasswordViewController.swift

@@ -1,399 +0,0 @@
-//
-//  KMBatchOperateAddPasswordViewController.swift
-//  PDF Reader Pro
-//
-//  Created by liujiajie on 2023/11/6.
-//
-
-import Cocoa
-
-class KMBatchOperateAddPasswordViewController: KMBatchOperateBaseViewController, NSTextFieldDelegate{
-    
-    @IBOutlet var titleLabel: NSTextField!
-    
-    @IBOutlet var openPasswordButton: NSButton!
-    
-    @IBOutlet var openPasswordTextField: NSSecureTextField!
-    
-    @IBOutlet var openPasswordHelpButton: NSButton!
-    
-    @IBOutlet var ownerPasswordButton: NSButton!
-    
-    @IBOutlet var ownerPasswordTextField: NSSecureTextField!
-    
-    @IBOutlet var ownerPasswordHelpButton: NSButton!
-    
-    @IBOutlet var ownerPasswordTF: NSTextField!
-    
-    @IBOutlet var forbidPrintButton: NSButton!
-    
-    @IBOutlet var forbidCopyButton: NSButton!
-    
-    @IBOutlet var forbidPrintLabel: NSTextField!
-    
-    @IBOutlet var forbidCopyLabel: NSTextField!
-    
-    @IBOutlet var fileDecriptionLabel: NSTextField!
-    
-    @IBOutlet var fileTitleLabel: NSTextField!
-    
-    @IBOutlet var fileTitleTextField: NSTextField!
-    
-    @IBOutlet var fileAuthorLabel: NSTextField!
-    
-    @IBOutlet var fileAuthorTextField: NSTextField!
-    
-    @IBOutlet var fileThemeLabel: NSTextField!
-    
-    @IBOutlet var fileThemeTextField: NSTextField!
-    
-    @IBOutlet var fileKeywordLabel: NSTextField!
-    
-    @IBOutlet var fileKeywordTextField: NSTextField!
-    
-    @IBOutlet var actionButton: NSButton!
-    
-    @IBOutlet var openPasswordLabel: NSTextField!
-    
-    lazy var passwordObject: KMSetPasswordObject? = {
-        let obj = KMSetPasswordObject()
-        return obj
-    }()
-    var popOver: NSPopover?
-    var haveFiles: Bool = false
-    var isAction: Bool = false
-    override var interfaceStatus: KMBatchOperateInterfaceStatus?{
-        set{
-            super.interfaceStatus = newValue
-            if newValue == .PrepareProcess {
-                DispatchQueue.main.asyncAfter(deadline: .now() + 0.4) {
-                    let files = NSMutableArray()
-                    for url in self.successFilePathURLArray! {
-                        if FileManager.default.fileExists(atPath: url.path) {
-                            files.add(url)
-                        }
-                    }
-                    if files.count > 0 {
-                        let workspace = NSWorkspace.shared
-                        workspace.activateFileViewerSelecting(files as! [URL])
-                    }
-                }
-                self.actionButton.tag = 1
-                self.actionButton.title = KMLocalizedString("Encrypt")
-                self.actionButton.setTitleColor(KMAppearance.Layout.w0Color())
-            } else {
-                self.actionButton.tag = 0
-                self.actionButton.title = KMLocalizedString("Cancel")
-                self.actionButton.setTitleColor(KMAppearance.Layout.w0Color())
-            }
-        }
-        get{
-            return super.interfaceStatus
-        }
-    }
-    
-    deinit {
-        NotificationCenter.default.removeObserver(self)
-        DistributedNotificationCenter.default().removeObserver(self)
-    }
-    
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        localizedLanguage()
-        configuUI()
-        prepareDelegate()
-        NotificationCenter.default.addObserver(self, selector: #selector(batchFilesCountNotification(notification:)), name: Notification.Name(rawValue: "KMBatchFilesCountNotification"), object: nil)
-//        NotificationCenter.default.addObserver(self, selector: #selector(themeChanged(notification:)), name: Notification.Name(rawValue: "AppleInterfaceThemeChangedNotification"), object: nil)
-        DistributedNotificationCenter.default().addObserver(self, selector: #selector(themeChanged(notification:)), name: NSNotification.Name("AppleInterfaceThemeChangedNotification"), object: nil)
-    }
-    
-    func prepareDelegate() {
-        self.openPasswordTextField.delegate = self
-        self.ownerPasswordTextField.delegate = self
-        self.fileTitleTextField.delegate = self
-        self.fileAuthorTextField.delegate = self
-        self.fileThemeTextField.delegate = self
-        self.fileKeywordTextField.delegate = self
-    }
-    
-    func localizedLanguage() {
-        self.titleLabel.stringValue = KMLocalizedString("Password Security Settings")
-        self.openPasswordButton.title = KMLocalizedString("")
-        self.openPasswordLabel.stringValue = KMLocalizedString("Require a password to open the document.")
-        self.ownerPasswordTF.stringValue = KMLocalizedString("Restrict printing and copying of the document.")
-        self.forbidPrintLabel.stringValue = KMLocalizedString("Restrict document printing")
-        self.forbidCopyLabel.stringValue = KMLocalizedString("Restrict content copying")
-        self.fileDecriptionLabel.stringValue =  KMLocalizedString("Document Description")
-        self.fileTitleLabel.stringValue = KMLocalizedString("Title:")
-        self.fileAuthorLabel.stringValue = KMLocalizedString("Author:")
-        self.fileThemeLabel.stringValue = KMLocalizedString("Subject:")
-        self.fileKeywordLabel.stringValue = KMLocalizedString("Keywords:")
-        
-        self.actionButton.title = KMLocalizedString("Encrypt")
-    }
-    
-    func configuUI() {
-        self.view.wantsLayer = true
-        self.updateViewColor()
-        self.isAction = false
-        let textFieldArr: [NSTextField] = [openPasswordTextField, ownerPasswordTextField, fileTitleTextField, fileAuthorTextField, fileThemeTextField, fileKeywordTextField]
-        
-        for textField in textFieldArr {
-            textField.backgroundColor = KMAppearance.Layout.l1Color()
-            textField.wantsLayer = true
-            textField.layer?.borderWidth = 1.0
-            textField.layer?.borderColor = KMAppearance.Interactive.s0Color().cgColor
-            textField.layer?.cornerRadius = 1.0
-        }
-        self.fileDecriptionLabel.textColor = KMAppearance.Layout.h0Color()
-        self.titleLabel.textColor = KMAppearance.Layout.h0Color()
-        self.fileTitleLabel.textColor = KMAppearance.Layout.h1Color()
-        self.fileAuthorLabel.textColor = KMAppearance.Layout.h1Color()
-        self.fileThemeLabel.textColor = KMAppearance.Layout.h1Color()
-        self.fileKeywordLabel.textColor = KMAppearance.Layout.h1Color()
-        self.actionButton.wantsLayer = true
-        if self.files?.count ?? 0 > 0 {
-            self.actionButton.layer?.backgroundColor = KMAppearance.Interactive.m0Color().cgColor
-            self.actionButton.setTitleColor(KMAppearance.Layout.w0Color())
-            self.haveFiles = true
-        } else {
-            self.actionButton.setTitleColor(KMAppearance.Layout.w0Color().withAlphaComponent(0.6))
-            self.actionButton.layer?.backgroundColor = KMAppearance.Interactive.m0Color().withAlphaComponent(0.6).cgColor
-            self.haveFiles = false
-        }
-        self.actionButton.layer?.cornerRadius = 1.0
-        self.openPasswordButton.state = .off
-        self.openPasswordTextField.isEnabled = false
-        self.ownerPasswordButton.state = .off
-        self.forbidPrintButton.state = .off
-        self.forbidCopyButton.state = .off
-        self.ownerPasswordTextField.isEnabled = false
-        self.forbidCopyButton.isEnabled = false
-        self.forbidPrintButton.isEnabled = false
-        if self.forbidPrintButton.isEnabled {
-            self.forbidPrintLabel.textColor = NSColor.labelColor
-        } else {
-            self.forbidPrintLabel.textColor = NSColor.gray
-        }
-        if self.forbidCopyButton.isEnabled {
-            self.forbidCopyLabel.textColor = NSColor.labelColor
-        } else {
-            self.forbidCopyLabel.textColor = NSColor.gray
-        }
-        encryptButtonEnabled()
-    }
-    @objc func batchFilesCountNotification(notification: Notification) {
-        let arr: Array? = notification.object as? [KMBatchOperateFile]
-        self.files? = arr ?? []
-        if (arr?.count ?? 0 > 0){
-            self.haveFiles = true
-        }
-        encryptButtonEnabled()
-    }
-    @objc func themeChanged(notification: Notification) {
-        DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
-            self.updateViewColor()
-        }
-    }
-    func updateViewColor() {
-        if KMAppearance.isDarkMode() {
-            self.view.layer?.backgroundColor = NSColor(red: 0.055, green: 0.067, blue: 0.078, alpha: 1).cgColor
-        } else {
-            self.view.layer?.backgroundColor = NSColor(red: 0.922, green: 0.925, blue: 0.941, alpha: 1).cgColor
-        }
-    }
-    func encryptButtonEnabled() {
-        if openPasswordTextField.stringValue.count > 0 && openPasswordButton.state == .on {
-            if ownerPasswordButton.state == .on {
-                if ownerPasswordTextField.stringValue.count > 0 {
-                    if forbidPrintButton.state == .on || forbidCopyButton.state == .on {
-                        self.isAction = true
-                    } else {
-                        self.isAction = false
-                    }
-                } else {
-                    self.isAction = false
-                }
-            } else {
-                self.isAction = true
-            }
-        } else {
-            if ownerPasswordTextField.stringValue.count > 0 && ownerPasswordButton.state == .on {
-                if forbidPrintButton.state == .on || forbidCopyButton.state == .on {
-                    if openPasswordButton.state == .on {
-                        if openPasswordTextField.stringValue.count > 0 {
-                            self.isAction = true
-                        } else {
-                            self.isAction = false
-                        }
-                    } else {
-                        self.isAction = true
-                    }
-                } else {
-                    self.isAction = false
-                }
-            } else {
-                self.isAction = false
-            }
-        }
-        if self.files?.count ?? 0 > 0 {
-            if self.isAction {
-                self.actionButton.layer?.backgroundColor = KMAppearance.Interactive.m0Color().cgColor
-                self.actionButton.setTitleColor(KMAppearance.Layout.w0Color())
-            } else {
-                self.actionButton.setTitleColor(KMAppearance.Layout.w0Color().withAlphaComponent(0.6))
-                self.actionButton.layer?.backgroundColor = KMAppearance.Interactive.m0Color().withAlphaComponent(0.6).cgColor
-            }
-        } else {
-            self.actionButton.setTitleColor(KMAppearance.Layout.w0Color().withAlphaComponent(0.6))
-            self.actionButton.layer?.backgroundColor = KMAppearance.Interactive.m0Color().withAlphaComponent(0.6).cgColor
-        }
-    }
-    override func beginQueueOperation() {
-        hiddenWindowCloseButtonIfNeeded()
-        self.successFilePathURLArray?.removeAll()
-        for i in 0..<(self.files?.count ?? 0) {
-            let file = self.files?[i]
-            if file?.fileType == .PDF {
-                file?.currentOperateInfo?.savePath = self.choosePath
-                if file?.status == .Waiting {
-                    let operation = KMBatchAddPasswordOperation(file: file!, password: self.passwordObject!)
-                    operation.delegate = self
-                    self.queue?.addOperation(operation)
-                }
-            }
-        }
-        if self.queue?.operations.count ?? 0 > 0 {
-            self.interfaceStatus = .Processing
-        }
-    }
-    
-    @IBAction func buttonAction_NeedOpenPassword(_ sender: NSButton) {
-        if sender.state == NSControl.StateValue.on { openPasswordTextField.isEnabled = true
-            view.window?.makeFirstResponder(openPasswordTextField)
-            passwordObject?.needOpenPassword = true
-        } else {
-            openPasswordTextField.isEnabled = false
-            passwordObject?.needOpenPassword = false
-        }
-        encryptButtonEnabled()
-    }
-    
-    @IBAction func buttonAction_NeedOwnerPassword(_ sender: NSButton) {
-        if sender.state == NSControl.StateValue.on {
-            passwordObject?.needOwnerPassword = true
-            forbidCopyButton.state = NSControl.StateValue.on 
-            forbidPrintButton.state = NSControl.StateValue.on
-            passwordObject?.canPrint = false
-            passwordObject?.canCopy = false
-            ownerPasswordTextField.isEnabled = true
-            view.window?.makeFirstResponder(ownerPasswordTextField)
-            forbidPrintButton.isEnabled = true
-            forbidCopyButton.isEnabled = true
-        } else {
-            passwordObject?.needOwnerPassword = false
-            forbidCopyButton.state = NSControl.StateValue.off
-            forbidPrintButton.state = NSControl.StateValue.off
-            passwordObject?.canPrint = true
-            passwordObject?.canCopy = true
-            forbidPrintButton.isEnabled = false
-            forbidCopyButton.isEnabled = false
-            ownerPasswordTextField.isEnabled = false
-        }
-        encryptButtonEnabled()
-        if forbidPrintButton.isEnabled {
-            forbidPrintLabel.textColor = NSColor.labelColor
-        } else {
-            forbidPrintLabel.textColor = NSColor.gray
-        }
-        if forbidCopyButton.isEnabled {
-            forbidCopyLabel.textColor = NSColor.labelColor
-        } else {
-            forbidCopyLabel.textColor = NSColor.gray
-        }
-    }
-    
-    @IBAction func buttonAction_ForbidPrint(_ sender: NSButton) {
-        if (sender.state == .on){
-            self.passwordObject?.canPrint = false;
-        }else{
-            self.passwordObject?.canPrint = true;
-        }
-        self.encryptButtonEnabled()
-    }
-    
-    @IBAction func buttonAction_ForbidCopy(_ sender: NSButton) {
-        if (sender.state == .on){
-            self.passwordObject?.canCopy = false;
-        }else{
-            self.passwordObject?.canCopy = true;
-        }
-        self.encryptButtonEnabled()
-    }
-    
-    @IBAction func buttonAction_AddPassword(_ sender: NSButton) {
-        if !self.haveFiles { return } 
-        if !self.isAction { return }
-        // 点击开始
-        if sender.tag == 1 {
-            if openPasswordButton.state == .off && ownerPasswordButton.state == .off {
-                let alert = NSAlert()
-                alert.alertStyle = .critical
-                alert.messageText = String(format: NSLocalizedString("Please select at least one encryption level.", comment: ""))
-                alert.runModal()
-                return
-            }
-            if ownerPasswordButton.state == .on && openPasswordButton.state == .on && openPasswordTextField.stringValue == ownerPasswordTextField.stringValue {
-                let alert = NSAlert()
-                alert.alertStyle = .critical
-                alert.messageText = String(format: NSLocalizedString("The Open and Owner passwords cannot be the same. Please change either the Open or the Owner Password.", comment: ""))
-                alert.runModal()
-                return
-            }
-            
-            if openPasswordButton.state == .on && openPasswordTextField.stringValue.count < 1 {
-                NSSound.beep()
-                return
-            }
-            
-            self.beginBatchOperation()
-        } else if sender.tag == 0 {
-            self.cancelBatchOperation()
-        }
-    }
-    
-    @IBAction func buttonClickedHelp(_ sender: NSButton) {
-        var tag: Int = sender.tag 
-        let popViewController = KMToolbarItemPopViewController(nibName: "KMToolbarItemPopViewController", bundle: nil)
-        self.popOver = NSPopover()
-        self.popOver?.contentViewController = popViewController
-        self.popOver?.animates = false
-        self.popOver?.behavior = .transient
-        self.popOver?.contentSize = popViewController.view.frame.size
-        if tag == 0 {
-            popViewController.updateWithHelpTip(helpTip: KMLocalizedString("Require a password to open the document."))
-        } else if tag == 1 {
-            popViewController.updateWithHelpTip(helpTip: KMLocalizedString("Restrict printing and copying of the document. A password will be required in order to change these permission settings."))
-        }
-        self.popOver?.show(relativeTo: sender.frame, of: self.view, preferredEdge: .maxY)
-    }
-    
-    func controlTextDidChange(_ obj: Notification) {
-        let textField: NSTextField = obj.object as! NSTextField
-        if textField.isEqual(self.openPasswordTextField) {
-            self.passwordObject?.openPassword = self.openPasswordTextField.stringValue
-        } else if textField.isEqual(self.ownerPasswordTextField) {
-            self.passwordObject?.ownerPassword = self.ownerPasswordTextField.stringValue
-        } else if textField.isEqual(self.fileTitleTextField) {
-            self.passwordObject?.title = self.fileTitleTextField.stringValue
-        } else if textField.isEqual(self.fileAuthorTextField) {
-            self.passwordObject?.author = self.fileAuthorTextField.stringValue
-        } else if textField.isEqual(self.fileThemeTextField) {
-            self.passwordObject?.theme = self.fileThemeTextField.stringValue
-        } else if textField.isEqual(self.fileKeywordTextField) {
-            self.passwordObject?.keyword = self.fileKeywordTextField.stringValue
-        }
-        encryptButtonEnabled()
-    }
-    
-}

+ 0 - 357
PDF Office/PDF Master/Class/PDFTools/AddPassword/VC/KMBatchOperateAddPasswordViewController.xib

@@ -1,357 +0,0 @@
-<?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="KMBatchOperateAddPasswordViewController" customModule="PDF_Reader_Pro" customModuleProvider="target">
-            <connections>
-                <outlet property="actionButton" destination="6pu-SN-0Ge" id="yB9-Xh-Yoi"/>
-                <outlet property="fileAuthorLabel" destination="5Ia-uJ-1zk" id="rYR-7F-PxF"/>
-                <outlet property="fileAuthorTextField" destination="Knr-KG-HzN" id="9Iw-Gg-U53"/>
-                <outlet property="fileDecriptionLabel" destination="0TH-K7-3B0" id="iSK-1c-Zrp"/>
-                <outlet property="fileKeywordLabel" destination="yxH-ic-i9s" id="4az-a6-QXe"/>
-                <outlet property="fileKeywordTextField" destination="QQz-ZP-vnb" id="xre-0v-mfr"/>
-                <outlet property="fileThemeLabel" destination="53H-47-woj" id="JQe-WV-2GF"/>
-                <outlet property="fileThemeTextField" destination="0db-BN-jf9" id="7DN-yl-zXO"/>
-                <outlet property="fileTitleLabel" destination="gMK-hN-4n6" id="88n-m5-1tP"/>
-                <outlet property="fileTitleTextField" destination="3Ld-O7-I8s" id="42G-bJ-uVL"/>
-                <outlet property="forbidCopyButton" destination="1rb-ti-m6k" id="R45-Ub-vna"/>
-                <outlet property="forbidCopyLabel" destination="vSh-Gt-ruS" id="mJy-2f-awo"/>
-                <outlet property="forbidPrintButton" destination="wJg-Pz-iES" id="r3j-d5-u9B"/>
-                <outlet property="forbidPrintLabel" destination="njT-1c-KYv" id="fDa-ZH-on9"/>
-                <outlet property="openPasswordButton" destination="zcv-1e-IOd" id="InZ-bP-Ym7"/>
-                <outlet property="openPasswordHelpButton" destination="TgC-xP-uhJ" id="cKl-Yc-qpH"/>
-                <outlet property="openPasswordLabel" destination="ejq-fj-BBb" id="Aco-LZ-PNN"/>
-                <outlet property="openPasswordTextField" destination="Wnl-ub-aCR" id="Go6-g3-ljl"/>
-                <outlet property="ownerPasswordButton" destination="cdX-ec-fUT" id="pOV-l4-kwz"/>
-                <outlet property="ownerPasswordHelpButton" destination="Izf-13-UPi" id="Sqx-rU-YNG"/>
-                <outlet property="ownerPasswordTF" destination="DhJ-5m-2ap" id="c78-bi-wQ0"/>
-                <outlet property="ownerPasswordTextField" destination="k7w-MX-pe3" id="s6V-KA-Ddj"/>
-                <outlet property="titleLabel" destination="WH9-YI-qOJ" id="3eJ-G2-uon"/>
-                <outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
-            </connections>
-        </customObject>
-        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
-        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
-        <customView id="Hz6-mo-xeY">
-            <rect key="frame" x="0.0" y="0.0" width="418" height="593"/>
-            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
-            <subviews>
-                <box verticalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="HXv-Cq-aqK">
-                    <rect key="frame" x="0.0" y="590" width="418" height="5"/>
-                    <constraints>
-                        <constraint firstAttribute="height" constant="1" id="0dB-En-scn"/>
-                    </constraints>
-                </box>
-                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="WH9-YI-qOJ">
-                    <rect key="frame" x="14" y="566" width="390" height="17"/>
-                    <textFieldCell key="cell" title="Label" id="01P-7a-fqT">
-                        <font key="font" metaFont="systemBold" size="14"/>
-                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                    </textFieldCell>
-                </textField>
-                <textField focusRingType="none" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="DhJ-5m-2ap">
-                    <rect key="frame" x="34" y="470" width="350" height="16"/>
-                    <textFieldCell key="cell" selectable="YES" enabled="NO" title="Restrict printing and copying of the document." id="eLv-e1-44C">
-                        <font key="font" metaFont="system"/>
-                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                    </textFieldCell>
-                </textField>
-                <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="cdX-ec-fUT">
-                    <rect key="frame" x="14" y="467" width="370" height="22"/>
-                    <buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="fYE-Gs-o9N">
-                        <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
-                        <font key="font" metaFont="system"/>
-                    </buttonCell>
-                    <constraints>
-                        <constraint firstAttribute="height" constant="18" id="QA3-bf-off"/>
-                    </constraints>
-                    <connections>
-                        <action selector="buttonAction_NeedOwnerPassword:" target="-2" id="xDg-9d-QCS"/>
-                    </connections>
-                </button>
-                <textField focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Wnl-ub-aCR" customClass="NSSecureTextField">
-                    <rect key="frame" x="33" y="505" width="176" height="24"/>
-                    <constraints>
-                        <constraint firstAttribute="height" constant="24" id="AUi-Ff-HBA"/>
-                        <constraint firstAttribute="width" constant="176" id="oeF-Ld-GaV"/>
-                    </constraints>
-                    <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" drawsBackground="YES" id="3rY-bw-uKI" customClass="NSSecureTextFieldCell">
-                        <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="k7w-MX-pe3" customClass="NSSecureTextField">
-                    <rect key="frame" x="33" y="437" width="176" height="24"/>
-                    <constraints>
-                        <constraint firstAttribute="height" constant="24" id="NBw-0c-qhR"/>
-                    </constraints>
-                    <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" drawsBackground="YES" id="L8w-40-rH1">
-                        <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>
-                <button horizontalHuggingPriority="750" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="TgC-xP-uhJ">
-                    <rect key="frame" x="215" y="503" width="25" height="25"/>
-                    <buttonCell key="cell" type="help" bezelStyle="helpButton" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="DBq-uY-dmU">
-                        <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                        <font key="font" metaFont="system"/>
-                    </buttonCell>
-                    <connections>
-                        <action selector="buttonClickedHelp:" target="-2" id="bYR-z0-fAk"/>
-                    </connections>
-                </button>
-                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="njT-1c-KYv">
-                    <rect key="frame" x="51" y="412" width="160" height="15"/>
-                    <textFieldCell key="cell" title="Check" id="bK5-w5-VVt">
-                        <font key="font" metaFont="cellTitle"/>
-                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                    </textFieldCell>
-                </textField>
-                <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="wJg-Pz-iES">
-                    <rect key="frame" x="31" y="411" width="180" height="18"/>
-                    <buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="bI6-cv-q19">
-                        <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
-                        <font key="font" metaFont="cellTitle"/>
-                    </buttonCell>
-                    <connections>
-                        <action selector="buttonAction_ForbidPrint:" target="-2" id="fhT-XJ-Af4"/>
-                    </connections>
-                </button>
-                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="vSh-Gt-ruS">
-                    <rect key="frame" x="51" y="385" width="160" height="15"/>
-                    <textFieldCell key="cell" title="Check" id="xYq-1H-Njs">
-                        <font key="font" metaFont="cellTitle"/>
-                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                    </textFieldCell>
-                </textField>
-                <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="1rb-ti-m6k">
-                    <rect key="frame" x="31" y="384" width="180" height="18"/>
-                    <buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="UOi-0Z-iom">
-                        <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
-                        <font key="font" metaFont="cellTitle"/>
-                    </buttonCell>
-                    <connections>
-                        <action selector="buttonAction_ForbidCopy:" target="-2" id="3Ih-xU-ieg"/>
-                    </connections>
-                </button>
-                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="0TH-K7-3B0">
-                    <rect key="frame" x="14" y="339" width="390" height="17"/>
-                    <textFieldCell key="cell" title="Label" id="s8M-4s-ydW">
-                        <font key="font" metaFont="systemBold" size="14"/>
-                        <color key="textColor" name="labelColor" 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="gMK-hN-4n6">
-                    <rect key="frame" x="14" y="314" width="35" height="15"/>
-                    <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="Qs0-ho-o0r">
-                        <font key="font" metaFont="cellTitle"/>
-                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                    </textFieldCell>
-                </textField>
-                <textField focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="3Ld-O7-I8s">
-                    <rect key="frame" x="16" y="283" width="386" height="24"/>
-                    <constraints>
-                        <constraint firstAttribute="height" constant="24" id="ivi-a1-T3K"/>
-                    </constraints>
-                    <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" drawsBackground="YES" id="XbP-en-1Nr">
-                        <font key="font" metaFont="system"/>
-                        <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
-                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                    </textFieldCell>
-                    <connections>
-                        <outlet property="nextKeyView" destination="Knr-KG-HzN" id="eQC-mk-IOO"/>
-                    </connections>
-                </textField>
-                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="5Ia-uJ-1zk">
-                    <rect key="frame" x="14" y="258" width="35" height="15"/>
-                    <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="a3j-bi-Gjh">
-                        <font key="font" metaFont="cellTitle"/>
-                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                    </textFieldCell>
-                </textField>
-                <textField focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Knr-KG-HzN">
-                    <rect key="frame" x="16" y="227" width="386" height="24"/>
-                    <constraints>
-                        <constraint firstAttribute="height" constant="24" id="rqX-rD-fdB"/>
-                    </constraints>
-                    <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" drawsBackground="YES" id="p1e-Hj-tWT">
-                        <font key="font" metaFont="system"/>
-                        <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
-                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                    </textFieldCell>
-                    <connections>
-                        <outlet property="nextKeyView" destination="0db-BN-jf9" id="0j8-WR-hHO"/>
-                    </connections>
-                </textField>
-                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="53H-47-woj">
-                    <rect key="frame" x="14" y="202" width="35" height="15"/>
-                    <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="JBs-PL-iXs">
-                        <font key="font" metaFont="cellTitle"/>
-                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                    </textFieldCell>
-                </textField>
-                <textField focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="0db-BN-jf9">
-                    <rect key="frame" x="16" y="171" width="386" height="24"/>
-                    <constraints>
-                        <constraint firstAttribute="height" constant="24" id="GDb-y2-og8"/>
-                    </constraints>
-                    <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" drawsBackground="YES" id="18v-Gn-Til">
-                        <font key="font" metaFont="system"/>
-                        <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
-                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                    </textFieldCell>
-                    <connections>
-                        <outlet property="nextKeyView" destination="QQz-ZP-vnb" id="FxR-nb-L1q"/>
-                    </connections>
-                </textField>
-                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="yxH-ic-i9s">
-                    <rect key="frame" x="14" y="146" width="35" height="15"/>
-                    <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="xuB-7I-TLF">
-                        <font key="font" metaFont="cellTitle"/>
-                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                    </textFieldCell>
-                </textField>
-                <textField focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="QQz-ZP-vnb">
-                    <rect key="frame" x="16" y="115" width="386" height="24"/>
-                    <constraints>
-                        <constraint firstAttribute="height" constant="24" id="fy5-n5-lXx"/>
-                    </constraints>
-                    <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" drawsBackground="YES" id="NMZ-jD-mce">
-                        <font key="font" metaFont="system"/>
-                        <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
-                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                    </textFieldCell>
-                    <connections>
-                        <outlet property="nextKeyView" destination="3Ld-O7-I8s" id="zEt-tu-o7z"/>
-                    </connections>
-                </textField>
-                <button tag="1" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="6pu-SN-0Ge">
-                    <rect key="frame" x="16" y="20" width="386" height="32"/>
-                    <buttonCell key="cell" type="bevel" title="Button" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="fpW-aA-Di7">
-                        <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                        <font key="font" metaFont="system"/>
-                    </buttonCell>
-                    <constraints>
-                        <constraint firstAttribute="height" constant="32" id="O2D-z7-Imx"/>
-                    </constraints>
-                    <connections>
-                        <action selector="buttonAction_AddPassword:" target="-2" id="DRL-ld-zed"/>
-                    </connections>
-                </button>
-                <button tag="1" horizontalHuggingPriority="750" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Izf-13-UPi">
-                    <rect key="frame" x="215" y="435" width="25" height="25"/>
-                    <buttonCell key="cell" type="help" bezelStyle="helpButton" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="kcE-c4-G1l">
-                        <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                        <font key="font" metaFont="system"/>
-                    </buttonCell>
-                    <connections>
-                        <action selector="buttonClickedHelp:" target="-2" id="lK8-g3-IgU"/>
-                    </connections>
-                </button>
-                <textField focusRingType="none" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="ejq-fj-BBb">
-                    <rect key="frame" x="34" y="537" width="350" height="16"/>
-                    <textFieldCell key="cell" selectable="YES" enabled="NO" title="Multiline Label" id="WNY-wr-3jj">
-                        <font key="font" metaFont="system"/>
-                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                    </textFieldCell>
-                </textField>
-                <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="zcv-1e-IOd">
-                    <rect key="frame" x="14" y="536" width="370" height="18"/>
-                    <buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="jC9-nW-5fz">
-                        <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
-                        <font key="font" metaFont="cellTitle"/>
-                    </buttonCell>
-                    <connections>
-                        <action selector="buttonAction_NeedOpenPassword:" target="-2" id="3rn-4K-wFy"/>
-                    </connections>
-                </button>
-            </subviews>
-            <constraints>
-                <constraint firstItem="ejq-fj-BBb" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="36" id="0gB-a4-bUY"/>
-                <constraint firstItem="Knr-KG-HzN" firstAttribute="leading" secondItem="0TH-K7-3B0" secondAttribute="leading" id="0xb-e4-mwE"/>
-                <constraint firstItem="WH9-YI-qOJ" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="16" id="11X-dT-yaA"/>
-                <constraint firstAttribute="trailing" secondItem="3Ld-O7-I8s" secondAttribute="trailing" constant="16" id="2Fp-2S-8di"/>
-                <constraint firstItem="53H-47-woj" firstAttribute="leading" secondItem="0TH-K7-3B0" secondAttribute="leading" id="39E-Nu-NC1"/>
-                <constraint firstItem="6pu-SN-0Ge" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="16" id="43F-Jx-n9f"/>
-                <constraint firstItem="0db-BN-jf9" firstAttribute="trailing" secondItem="3Ld-O7-I8s" secondAttribute="trailing" id="4NC-HZ-zBd"/>
-                <constraint firstItem="ejq-fj-BBb" firstAttribute="centerX" secondItem="Hz6-mo-xeY" secondAttribute="centerX" id="4yi-ZM-tQO"/>
-                <constraint firstItem="6pu-SN-0Ge" firstAttribute="centerX" secondItem="Hz6-mo-xeY" secondAttribute="centerX" id="5Vq-yI-eKa"/>
-                <constraint firstAttribute="trailing" secondItem="0TH-K7-3B0" secondAttribute="trailing" constant="16" id="5ez-NR-zKR"/>
-                <constraint firstItem="wJg-Pz-iES" firstAttribute="leading" secondItem="k7w-MX-pe3" secondAttribute="leading" id="5mv-2L-KM2"/>
-                <constraint firstItem="gMK-hN-4n6" firstAttribute="leading" secondItem="0TH-K7-3B0" secondAttribute="leading" id="6Nl-uD-5Ud"/>
-                <constraint firstItem="QQz-ZP-vnb" firstAttribute="trailing" secondItem="3Ld-O7-I8s" secondAttribute="trailing" id="86N-Ff-BWa"/>
-                <constraint firstItem="njT-1c-KYv" firstAttribute="trailing" secondItem="wJg-Pz-iES" secondAttribute="trailing" id="88u-of-u8D"/>
-                <constraint firstItem="njT-1c-KYv" firstAttribute="top" secondItem="k7w-MX-pe3" secondAttribute="bottom" constant="10" id="8Vc-OK-U0T"/>
-                <constraint firstAttribute="bottom" secondItem="6pu-SN-0Ge" secondAttribute="bottom" constant="20" id="Bdy-eC-F4k"/>
-                <constraint firstItem="vSh-Gt-ruS" firstAttribute="trailing" secondItem="njT-1c-KYv" secondAttribute="trailing" id="EIS-oZ-Wkp"/>
-                <constraint firstItem="k7w-MX-pe3" firstAttribute="trailing" secondItem="Wnl-ub-aCR" secondAttribute="trailing" id="Em9-Ti-dkb"/>
-                <constraint firstItem="0db-BN-jf9" firstAttribute="leading" secondItem="0TH-K7-3B0" secondAttribute="leading" id="FS0-0v-Jnv"/>
-                <constraint firstAttribute="trailing" secondItem="HXv-Cq-aqK" secondAttribute="trailing" id="Fhp-8N-7dr"/>
-                <constraint firstItem="DhJ-5m-2ap" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="36" id="HIV-ZV-glm"/>
-                <constraint firstItem="3Ld-O7-I8s" firstAttribute="leading" secondItem="0TH-K7-3B0" secondAttribute="leading" id="IwR-8b-ari"/>
-                <constraint firstItem="vSh-Gt-ruS" firstAttribute="centerY" secondItem="1rb-ti-m6k" secondAttribute="centerY" id="OF6-Kz-K88"/>
-                <constraint firstItem="TgC-xP-uhJ" firstAttribute="leading" secondItem="Wnl-ub-aCR" secondAttribute="trailing" constant="9" id="QF7-Jz-yOl"/>
-                <constraint firstItem="Knr-KG-HzN" firstAttribute="top" secondItem="5Ia-uJ-1zk" secondAttribute="bottom" constant="7" id="RsC-Ya-rWB"/>
-                <constraint firstItem="vSh-Gt-ruS" firstAttribute="top" secondItem="njT-1c-KYv" secondAttribute="bottom" constant="12" id="SlQ-SL-1db"/>
-                <constraint firstItem="yxH-ic-i9s" firstAttribute="leading" secondItem="0TH-K7-3B0" secondAttribute="leading" id="Swv-UE-QpO"/>
-                <constraint firstItem="0TH-K7-3B0" firstAttribute="top" secondItem="1rb-ti-m6k" secondAttribute="bottom" constant="30" id="TDN-aO-Gs3"/>
-                <constraint firstItem="wJg-Pz-iES" firstAttribute="centerY" secondItem="njT-1c-KYv" secondAttribute="centerY" id="TFu-TZ-LDb"/>
-                <constraint firstItem="DhJ-5m-2ap" firstAttribute="trailing" secondItem="zcv-1e-IOd" secondAttribute="trailing" id="TjJ-og-ZZQ"/>
-                <constraint firstItem="k7w-MX-pe3" firstAttribute="top" secondItem="DhJ-5m-2ap" secondAttribute="bottom" constant="9" id="UgC-hm-rP4"/>
-                <constraint firstItem="njT-1c-KYv" firstAttribute="trailing" secondItem="k7w-MX-pe3" secondAttribute="trailing" id="UkT-47-fwm"/>
-                <constraint firstItem="0TH-K7-3B0" firstAttribute="leading" secondItem="WH9-YI-qOJ" secondAttribute="leading" id="W8B-5t-ctm"/>
-                <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="cdX-ec-fUT" secondAttribute="trailing" constant="16" id="XQQ-no-Kgt"/>
-                <constraint firstItem="Wnl-ub-aCR" firstAttribute="top" secondItem="ejq-fj-BBb" secondAttribute="bottom" constant="8" id="YNh-GX-cmG"/>
-                <constraint firstItem="ejq-fj-BBb" firstAttribute="centerY" secondItem="zcv-1e-IOd" secondAttribute="centerY" id="af5-LC-VaO"/>
-                <constraint firstItem="3Ld-O7-I8s" firstAttribute="top" secondItem="gMK-hN-4n6" secondAttribute="bottom" constant="7" id="ask-Ui-mVT"/>
-                <constraint firstItem="vSh-Gt-ruS" firstAttribute="leading" secondItem="njT-1c-KYv" secondAttribute="leading" id="bfD-9C-MXM"/>
-                <constraint firstItem="Izf-13-UPi" firstAttribute="leading" secondItem="TgC-xP-uhJ" secondAttribute="leading" id="dff-Sw-Y1w"/>
-                <constraint firstItem="zcv-1e-IOd" firstAttribute="leading" secondItem="WH9-YI-qOJ" secondAttribute="leading" id="duE-Ua-bjN"/>
-                <constraint firstItem="QQz-ZP-vnb" firstAttribute="top" secondItem="yxH-ic-i9s" secondAttribute="bottom" constant="7" id="eb1-Es-4OZ"/>
-                <constraint firstItem="gMK-hN-4n6" firstAttribute="top" secondItem="0TH-K7-3B0" secondAttribute="bottom" constant="10" id="f43-ax-22b"/>
-                <constraint firstItem="ejq-fj-BBb" firstAttribute="trailing" secondItem="zcv-1e-IOd" secondAttribute="trailing" id="fR2-AU-XwF"/>
-                <constraint firstItem="DhJ-5m-2ap" firstAttribute="centerY" secondItem="cdX-ec-fUT" secondAttribute="centerY" id="fTw-WW-ob0"/>
-                <constraint firstItem="yxH-ic-i9s" firstAttribute="top" secondItem="0db-BN-jf9" secondAttribute="bottom" constant="10" id="g5f-Vd-LEE"/>
-                <constraint firstItem="Knr-KG-HzN" firstAttribute="trailing" secondItem="3Ld-O7-I8s" secondAttribute="trailing" id="gI6-CQ-Pcf"/>
-                <constraint firstItem="Wnl-ub-aCR" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="33" id="gia-rH-4wb"/>
-                <constraint firstItem="Izf-13-UPi" firstAttribute="centerY" secondItem="k7w-MX-pe3" secondAttribute="centerY" id="iEU-wK-LMz"/>
-                <constraint firstItem="53H-47-woj" firstAttribute="top" secondItem="Knr-KG-HzN" secondAttribute="bottom" constant="10" id="jsW-Pz-cuX"/>
-                <constraint firstItem="5Ia-uJ-1zk" firstAttribute="leading" secondItem="0TH-K7-3B0" secondAttribute="leading" id="kRS-wo-vVs"/>
-                <constraint firstItem="DhJ-5m-2ap" firstAttribute="top" secondItem="Wnl-ub-aCR" secondAttribute="bottom" constant="19" id="kuC-Qr-cZP"/>
-                <constraint firstItem="ejq-fj-BBb" firstAttribute="top" secondItem="WH9-YI-qOJ" secondAttribute="bottom" constant="13" id="lwv-4E-StG"/>
-                <constraint firstAttribute="trailing" secondItem="WH9-YI-qOJ" secondAttribute="trailing" constant="16" id="m8B-Qj-8cf"/>
-                <constraint firstItem="cdX-ec-fUT" firstAttribute="trailing" secondItem="zcv-1e-IOd" secondAttribute="trailing" id="nvt-vu-9j1"/>
-                <constraint firstItem="TgC-xP-uhJ" firstAttribute="centerY" secondItem="Wnl-ub-aCR" secondAttribute="centerY" id="o8b-z6-ZkW"/>
-                <constraint firstItem="HXv-Cq-aqK" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" id="oah-3j-P1J"/>
-                <constraint firstItem="1rb-ti-m6k" firstAttribute="leading" secondItem="k7w-MX-pe3" secondAttribute="leading" id="oe7-cD-fl5"/>
-                <constraint firstItem="njT-1c-KYv" firstAttribute="leading" secondItem="k7w-MX-pe3" secondAttribute="leading" constant="20" id="soV-8M-KQc"/>
-                <constraint firstItem="6pu-SN-0Ge" firstAttribute="top" relation="greaterThanOrEqual" secondItem="QQz-ZP-vnb" secondAttribute="bottom" constant="30" id="src-7L-b71"/>
-                <constraint firstItem="WH9-YI-qOJ" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" constant="10" id="t9b-rH-phK"/>
-                <constraint firstItem="vSh-Gt-ruS" firstAttribute="trailing" secondItem="1rb-ti-m6k" secondAttribute="trailing" id="v52-mi-OvO"/>
-                <constraint firstItem="5Ia-uJ-1zk" firstAttribute="top" secondItem="3Ld-O7-I8s" secondAttribute="bottom" constant="10" id="vt4-Aw-hoQ"/>
-                <constraint firstItem="QQz-ZP-vnb" firstAttribute="leading" secondItem="0TH-K7-3B0" secondAttribute="leading" id="vz9-e1-IZG"/>
-                <constraint firstItem="k7w-MX-pe3" firstAttribute="leading" secondItem="Wnl-ub-aCR" secondAttribute="leading" id="xLb-Es-zZw"/>
-                <constraint firstItem="0db-BN-jf9" firstAttribute="top" secondItem="53H-47-woj" secondAttribute="bottom" constant="7" id="ygQ-8W-hkW"/>
-                <constraint firstItem="cdX-ec-fUT" firstAttribute="leading" secondItem="WH9-YI-qOJ" secondAttribute="leading" id="zYG-Dp-bfj"/>
-                <constraint firstItem="HXv-Cq-aqK" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" id="zZu-gO-ENB"/>
-            </constraints>
-            <point key="canvasLocation" x="-174" y="306"/>
-        </customView>
-    </objects>
-</document>

+ 2 - 2
PDF Office/PDF Master/Class/PDFTools/AddPassword/View/KMSecurityContentView.xib

@@ -1,8 +1,8 @@
 <?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">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="23504" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="23504"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>

+ 0 - 62
PDF Office/PDF Master/Class/PDFTools/Compress/Controller/KMBatchOperateCompressViewController.swift

@@ -1,62 +0,0 @@
-//
-//  KMBatchOperateCompressViewController.swift
-//  PDF Reader Pro
-//
-//  Created by lizhe on 2024/11/15.
-//
-
-import Cocoa
-import KMComponentLibrary
-
-class KMBatchOperateCompressViewController: KMBatchOperateBaseViewController {
-
-    @IBOutlet weak var titleLabel: NSTextField!
-    @IBOutlet weak var compressView: KMCompressContentView!
-    @IBOutlet weak var compressButton: ComponentButton!
-    
-    var model: KMCompressSettingModel = KMCompressSettingModel(modelsType: .standard) {
-        didSet {
-            self.reloadData()
-        }
-    }
-    
-    
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        // Do view setup here.
-        self.updateUI()
-    }
-}
-
-//UI
-extension KMBatchOperateCompressViewController {
-    func updateUI() {
-        compressButton.properties = ComponentButtonProperty(type: .primary, size: .xs, buttonText: KMLocalizedString("Compress"), keepPressState: false)
-        compressButton.setTarget(self, action: #selector(compressButtonAction(_:)))
-        
-        self.compressView.selectTypeAction = {[unowned self] view, tModel in
-            self.model = tModel
-        }
-    }
-}
-
-//MARK: Data
-extension KMBatchOperateCompressViewController {
-    func reloadData() {
-        
-    }
-}
-
-//MARK: Action
-extension KMBatchOperateCompressViewController {
-    @IBAction func compressButtonAction(_ sender: Any) {
-//        KMCompressManager.shared.compress(documentURL: self.documentURL,
-//                                          limit: limit,
-//                                          model: self.model,
-//                                          view: (self.window?.contentView)!) { [unowned self] isFinish, resultURL in
-//            if isFinish {
-//                self.closeWindow()
-//            }
-//        }
-    }
-}

+ 0 - 64
PDF Office/PDF Master/Class/PDFTools/Compress/Controller/KMBatchOperateCompressViewController.xib

@@ -1,64 +0,0 @@
-<?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="KMBatchOperateCompressViewController" customModule="PDF_Reader_Pro" customModuleProvider="target">
-            <connections>
-                <outlet property="compressButton" destination="tmk-ty-lj0" id="qV4-q3-wu3"/>
-                <outlet property="compressView" destination="nlU-Iu-DXD" id="iw0-Th-bxT"/>
-                <outlet property="titleLabel" destination="y0T-QN-EWu" id="Rbt-QN-OZz"/>
-                <outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
-            </connections>
-        </customObject>
-        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
-        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
-        <customView id="Hz6-mo-xeY">
-            <rect key="frame" x="0.0" y="0.0" width="528" height="446"/>
-            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
-            <subviews>
-                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="y0T-QN-EWu">
-                    <rect key="frame" x="14" y="414" width="45" height="16"/>
-                    <textFieldCell key="cell" lineBreakMode="clipping" title="Modes" id="mpx-gV-Hhf">
-                        <font key="font" metaFont="system"/>
-                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                    </textFieldCell>
-                </textField>
-                <customView translatesAutoresizingMaskIntoConstraints="NO" id="nlU-Iu-DXD" customClass="KMCompressContentView" customModule="PDF_Reader_Pro" customModuleProvider="target">
-                    <rect key="frame" x="16" y="72" width="496" height="334"/>
-                </customView>
-                <customView translatesAutoresizingMaskIntoConstraints="NO" id="e38-p7-5FM">
-                    <rect key="frame" x="0.0" y="0.0" width="528" height="72"/>
-                    <subviews>
-                        <customView translatesAutoresizingMaskIntoConstraints="NO" id="tmk-ty-lj0" customClass="ComponentButton" customModule="KMComponentLibrary">
-                            <rect key="frame" x="16" y="16" width="496" height="40"/>
-                        </customView>
-                    </subviews>
-                    <constraints>
-                        <constraint firstItem="tmk-ty-lj0" firstAttribute="top" secondItem="e38-p7-5FM" secondAttribute="top" constant="16" id="EQu-vH-pgV"/>
-                        <constraint firstAttribute="bottom" secondItem="tmk-ty-lj0" secondAttribute="bottom" constant="16" id="GWF-90-hR3"/>
-                        <constraint firstItem="tmk-ty-lj0" firstAttribute="leading" secondItem="e38-p7-5FM" secondAttribute="leading" constant="16" id="kJf-3S-Aks"/>
-                        <constraint firstAttribute="height" constant="72" id="mGX-Ss-0qo"/>
-                        <constraint firstAttribute="trailing" secondItem="tmk-ty-lj0" secondAttribute="trailing" constant="16" id="w4q-nl-b2e"/>
-                    </constraints>
-                </customView>
-            </subviews>
-            <constraints>
-                <constraint firstItem="y0T-QN-EWu" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" constant="16" id="8wn-dj-NMN"/>
-                <constraint firstAttribute="bottom" secondItem="nlU-Iu-DXD" secondAttribute="bottom" constant="72" id="9fy-f3-6D5"/>
-                <constraint firstItem="y0T-QN-EWu" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="16" id="P1B-uw-Pwo"/>
-                <constraint firstItem="e38-p7-5FM" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" id="T0E-li-2F2"/>
-                <constraint firstItem="nlU-Iu-DXD" firstAttribute="top" secondItem="y0T-QN-EWu" secondAttribute="bottom" constant="8" id="g2W-3l-VJN"/>
-                <constraint firstAttribute="trailing" secondItem="e38-p7-5FM" secondAttribute="trailing" id="gxH-zs-cVQ"/>
-                <constraint firstAttribute="bottom" secondItem="e38-p7-5FM" secondAttribute="bottom" id="qSv-si-saC"/>
-                <constraint firstItem="nlU-Iu-DXD" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="16" id="sFh-Fm-fyS"/>
-                <constraint firstAttribute="trailing" secondItem="nlU-Iu-DXD" secondAttribute="trailing" constant="16" id="x5p-Ld-uf2"/>
-            </constraints>
-            <point key="canvasLocation" x="163" y="233"/>
-        </customView>
-    </objects>
-</document>

+ 2 - 2
PDF Office/PDF Master/Class/PDFTools/Compress/Controller/KMCompressSettingViewController.xib

@@ -1,8 +1,8 @@
 <?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">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="23504" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="23504"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>

+ 3 - 3
PDF Office/PDF Master/Class/PDFTools/Compress/Controller/KMCompressWindowController.xib

@@ -1,8 +1,8 @@
 <?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">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="23504" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="23504"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
@@ -18,7 +18,7 @@
             <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
             <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
             <rect key="contentRect" x="196" y="240" width="480" height="415"/>
-            <rect key="screenRect" x="0.0" y="0.0" width="1920" height="1055"/>
+            <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="480" height="415"/>
                 <autoresizingMask key="autoresizingMask"/>

+ 0 - 16
PDF Office/PDF Master/Class/PDFTools/Convert/Model/KMConvertOperationQueue.swift

@@ -1,16 +0,0 @@
-//
-//  KMConvertOperationQueue.swift
-//  PDF Reader Pro
-//
-//  Created by liujiajie on 2023/11/10.
-//
-
-import Foundation
-
-class KMConvertOperationQueue: KMOperationQueue{
-    static let sharedQueue: KMConvertOperationQueue = {
-        let queue = KMConvertOperationQueue()
-        return queue
-    }()
-    
-}

+ 6 - 6
PDF Office/PDF Master/Class/PDFTools/Merge/MergeNew/View/KMMergeView.xib

@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22155" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="23504" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22155"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="23504"/>
         <capability name="Named colors" minToolsVersion="9.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
-        <customObject id="-2" userLabel="File's Owner" customClass="KMMergeView" customModule="PDF_Master" customModuleProvider="target">
+        <customObject id="-2" userLabel="File's Owner" customClass="KMMergeView" customModule="PDF_Reader_Pro" customModuleProvider="target">
             <connections>
                 <outlet property="A3SizeButton" destination="hWH-Ju-iVA" id="OFZ-CZ-CNu"/>
                 <outlet property="A4SizeButton" destination="2ei-fd-tJ7" id="PuB-tK-Ox7"/>
@@ -73,7 +73,7 @@
                                         <nil key="backgroundColor"/>
                                     </clipView>
                                     <scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="1ke-nn-DeN">
-                                        <rect key="frame" x="1" y="119" width="223" height="15"/>
+                                        <rect key="frame" x="1" y="473" width="478" height="15"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                     </scroller>
                                     <scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="HpQ-2Y-xBG">
@@ -81,7 +81,7 @@
                                         <autoresizingMask key="autoresizingMask"/>
                                     </scroller>
                                 </scrollView>
-                                <customView translatesAutoresizingMaskIntoConstraints="NO" id="Fxn-3r-IMx" customClass="KMMergeBlankView" customModule="PDF_Master" customModuleProvider="target">
+                                <customView translatesAutoresizingMaskIntoConstraints="NO" id="Fxn-3r-IMx" customClass="KMMergeBlankView" customModule="PDF_Reader_Pro" customModuleProvider="target">
                                     <rect key="frame" x="0.0" y="0.0" width="480" height="489"/>
                                 </customView>
                             </subviews>
@@ -148,7 +148,7 @@ Gw
                                 <action selector="addFilesButtonAction:" target="-2" id="OAa-Jy-bwC"/>
                             </connections>
                         </button>
-                        <box title="Box" titlePosition="noTitle" translatesAutoresizingMaskIntoConstraints="NO" id="KWE-mW-EZE" customClass="KMBox" customModule="PDF_Master" customModuleProvider="target">
+                        <box title="Box" titlePosition="noTitle" translatesAutoresizingMaskIntoConstraints="NO" id="KWE-mW-EZE" customClass="KMBox" customModule="PDF_Reader_Pro" customModuleProvider="target">
                             <rect key="frame" x="531" y="56" width="288" height="495"/>
                             <view key="contentView" id="toF-G7-jgB">
                                 <rect key="frame" x="4" y="5" width="280" height="487"/>

+ 0 - 92
PDF Office/PDF Master/Class/PDFTools/RemovePassword/Model/KMBatchRemovePasswordOperation.swift

@@ -1,92 +0,0 @@
-//
-//  KMBatchRemovePasswordOperation.swift
-//  PDF Reader Pro
-//
-//  Created by liujiajie on 2023/11/6.
-//
-
-import Foundation
-
-class KMBatchRemovePasswordOperation: KMBatchOperation{
-    var pdfDocument: PDFDocument?
-    
-    override init(file: KMBatchOperateFile) {
-        super.init(file: file)
-        
-    }
-    override func start() {
-        self.pdfDocument = PDFDocument(url: URL(fileURLWithPath: self.operateFile?.filePath ?? ""))
-        if let data = self.pdfDocument?.isLocked, data {
-            self.pdfDocument?.unlock(withPassword: self.operateFile?.password ?? "")
-        }
-        if !self.isCancelled {
-            self.delegate?.fileBeginOperate?(self.operateFile!, info: self.operateFile!.removePasswordInfo)
-            willChangeValue(forKey: "isExecuting")
-            self.hasExcuting = true
-            didChangeValue(forKey: "isExecuting")
-            if !FileManager.default.fileExists(atPath: self.operateFile!.filePath) {
-                self.delegate?.fileOperateFailed?(self.operateFile!, error: self.errorWithMsg(KMLocalizedString("File Not Exist")), info: self.operateFile!.removePasswordInfo)
-                
-                self.willChangeValue(forKey: "isFinished")
-                self.hasFinished = true
-                self.didChangeValue(forKey: "isFinished")
-                return
-            }
-
-            if self.pdfDocument == nil {
-                self.delegate?.fileOperateFailed?(self.operateFile!, error: self.errorWithMsg(KMLocalizedString("An error occurred while opening this document. The file is damaged and could not be repaired.")), info: self.operateFile!.removeWatermarkInfo)
-                self.willChangeValue(forKey: "isFinished")
-                self.hasFinished = true
-                self.didChangeValue(forKey: "isFinished")
-                return
-            }
-
-            if !self.pdfDocument!.allowsPrinting || !self.pdfDocument!.allowsCopying {
-                self.delegate?.fileOperateFailed?(self.operateFile!, error: self.errorWithMsg(KMLocalizedString("This is a secured document. Editing is not permitted.")), info: self.operateFile!.removeWatermarkInfo)
-                self.willChangeValue(forKey: "isFinished")
-                self.hasFinished = true
-                self.didChangeValue(forKey: "isFinished")
-                return
-            }
-            let document = CPDFDocument(url: URL(fileURLWithPath: self.operateFile!.filePath))
-            if let password = self.operateFile?.password {
-                document?.unlock(withPassword: password)
-            }
-            let result: Bool = ((document?.writeDecrypt(to: URL(fileURLWithPath: (self.operateFile?.removePasswordInfo.fetchDestinationFilepath())!))) != nil)
-            if result {
-                self.delegate?.fileOperateSuccessed?(self.operateFile!, info: self.operateFile!.removePasswordInfo)
-            } else {
-                self.delegate?.fileOperateFailed?(self.operateFile!, error: self.errorWithMsg(KMLocalizedString("Failed")), info: self.operateFile!.removePasswordInfo)
-            }
-            self.willChangeValue(forKey: "isFinished") 
-            self.hasFinished = true
-            self.didChangeValue(forKey: "isFinished")
-        }else {
-            willChangeValue(forKey: "isFinished")
-            willChangeValue(forKey: "isExecuting")
-            hasExcuting = false
-            hasFinished = true
-            didChangeValue(forKey: "isExecuting")
-            didChangeValue(forKey: "isFinished")
-        }
-    }
-    
-    override func cancel() {
-//        super.cancel()
-        if isExecuting {
-            operateFile!.removeWatermarkInfo.status = .Waiting
-            if FileManager.default.fileExists(atPath: operateFile!.removePasswordInfo.fetchDestinationFilepath()!) { try? FileManager.default.removeItem(atPath: operateFile!.removePasswordInfo.fetchDestinationFilepath()!)
-            }
-            self.delegate?.fileOperateCanceled?(self.operateFile!, info: self.operateFile!.removePasswordInfo)
-           
-           willChangeValue(forKey: "isFinished")
-           hasFinished = true
-           didChangeValue(forKey: "isFinished")
-       } else {
-           willChangeValue(forKey: "isCancelled")
-           hasCanceled = true
-           didChangeValue(forKey: "isCancelled")
-       }
-    }
-    
-}

+ 0 - 15
PDF Office/PDF Master/Class/PDFTools/RemovePassword/Model/KMRemovePasswordOperationQueue.swift

@@ -1,15 +0,0 @@
-//
-//  KMRemovePasswordOperationQueue.swift
-//  PDF Reader Pro
-//
-//  Created by liujiajie on 2023/11/6.
-//
-
-import Foundation
-
-class KMRemovePasswordOperationQueue: KMOperationQueue{
-    static let sharedQueue: KMRemovePasswordOperationQueue = {
-        let queue = KMRemovePasswordOperationQueue()
-        return queue
-    }()
-}

+ 2 - 2
PDF Office/PDF Master/Class/PDFTools/RemovePassword/New/View/KMRemovePasswordView.xib

@@ -1,8 +1,8 @@
 <?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">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="23504" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="23504"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>

+ 0 - 177
PDF Office/PDF Master/Class/PDFTools/RemovePassword/VC/KMBatchOperateRemovePasswordViewController.swift

@@ -1,177 +0,0 @@
-//
-//  KMBatchOperateRemovePasswordViewController.swift
-//  PDF Reader Pro
-//
-//  Created by liujiajie on 2023/11/6.
-//
-
-import Cocoa
-
-class KMBatchOperateRemovePasswordViewController: KMBatchOperateBaseViewController{
-    
-    @IBOutlet var titleLabel: NSTextField!
-    
-    @IBOutlet var firstHintDetailLabel: NSTextField!
-    
-    @IBOutlet var secondHintDetailLabel: NSTextField!
-    
-    @IBOutlet var actionButton: NSButton!
-    
-    var haveFiles: Bool = false
-    
-    override var interfaceStatus: KMBatchOperateInterfaceStatus?{
-        set{
-            super.interfaceStatus = newValue
-            if newValue == .PrepareProcess {
-                DispatchQueue.main.asyncAfter(deadline: .now() + 0.4) {
-                    let files = NSMutableArray()
-                    for url in self.successFilePathURLArray! {
-                        if FileManager.default.fileExists(atPath: url.path) {
-                            files.add(url)
-                        }
-                    }
-                    if files.count > 0 {
-                        let workspace = NSWorkspace.shared
-                        workspace.activateFileViewerSelecting(files as! [URL])
-                    }
-                }
-                self.actionButton.tag = 1
-                self.actionButton.title = KMLocalizedString("Remove Password")
-                self.actionButton.setTitleColor(KMAppearance.Layout.w0Color())
-            } else {
-                self.actionButton.tag = 0
-                self.actionButton.title = KMLocalizedString("Cancel")
-                self.actionButton.setTitleColor(KMAppearance.Layout.w0Color())
-            }
-        }
-        get{
-            return super.interfaceStatus
-        }
-    }
-    
-    deinit {
-        NotificationCenter.default.removeObserver(self)
-        DistributedNotificationCenter.default().removeObserver(self)
-    }
-    
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        localizedLanguage()
-        configuUI()
-        DistributedNotificationCenter.default().addObserver(self, selector: #selector(themeChanged(notification:)), name: NSNotification.Name("AppleInterfaceThemeChangedNotification"), object: nil)
-        NotificationCenter.default.addObserver(self, selector: #selector(batchFilesCountNotification(notification:)), name: Notification.Name(rawValue: "KMBatchFilesCountNotification"), object: nil)
-    }
-    
-    @objc func themeChanged(notification: Notification) {
-        DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
-            self.updateViewColor()
-        }
-    }
-    
-    @objc func batchFilesCountNotification(notification: Notification) {
-        let arr: Array? = notification.object as? [KMBatchOperateFile]
-        self.files? = arr ?? []
-        if arr?.count ?? 0 > 0{
-            self.actionButton.setTitleColor(KMAppearance.Layout.w0Color())
-            self.actionButton.layer?.backgroundColor = KMAppearance.Interactive.m0Color().cgColor
-            self.haveFiles = true
-        }else {
-            self.actionButton.setTitleColor(KMAppearance.Layout.w0Color().withAlphaComponent(0.6))
-            self.actionButton.layer?.backgroundColor = KMAppearance.Interactive.m0Color().withAlphaComponent(0.6).cgColor
-            self.haveFiles = false
-        }
-    }
-    
-    func updateViewColor() {
-        if KMAppearance.isDarkMode() {
-            self.view.layer?.backgroundColor = NSColor(red: 0.055, green: 0.067, blue: 0.078, alpha: 1).cgColor
-        } else {
-            self.view.layer?.backgroundColor = NSColor(red: 0.922, green: 0.925, blue: 0.941, alpha: 1).cgColor
-        }
-    }
-    
-    func localizedLanguage() {
-        self.titleLabel.stringValue = KMLocalizedString("Remove Password")
-        
-        self.firstHintDetailLabel.stringValue =  KMLocalizedString("PDF Password Remover is an easy-to-use PDF security remover, which helps users decrypt PDF protections and remove restrictions on printing, editing and copying.")
-        
-        self.secondHintDetailLabel.stringValue = KMLocalizedString("If open password is required, you need to enter the right password first and then remove protections from PDF files.")
-        self.actionButton.title = KMLocalizedString("Remove Password")
-    }
-    
-    func configuUI() {
-        self.view.wantsLayer = true
-        self.updateViewColor()
-        self.titleLabel.textColor = KMAppearance.Layout.h0Color()
-        
-        self.secondHintDetailLabel.textColor = KMAppearance.Layout.h0Color()
-        self.firstHintDetailLabel.textColor = KMAppearance.Layout.h0Color()
-        
-        self.actionButton.wantsLayer = true
-        if (self.files?.count ?? 0 > 0) {
-            self.actionButton.layer?.backgroundColor = KMAppearance.Interactive.m0Color().cgColor
-            self.actionButton.setTitleColor(KMAppearance.Layout.w0Color())
-            self.haveFiles = true
-        } else {
-            self.actionButton.setTitleColor(KMAppearance.Layout.w0Color().withAlphaComponent(0.6))
-            self.actionButton.layer?.backgroundColor = KMAppearance.Interactive.m0Color().withAlphaComponent(0.6).cgColor
-            self.haveFiles = false
-        }
-        self.actionButton.layer?.cornerRadius = 1.0;
-    }
-    
-    @IBAction func buttonAction_RemovePassword(_ sender: Any) {
-        if self.files?.count ?? 0 < 1 {
-            return;
-        }
-        if !IAPProductsManager.default().isAvailableAllFunction(){
-            let winC = KMPurchaseCompareWindowController.sharedInstance()
-            winC?.kEventName = "Onbrd_Security_BuyNow"
-            winC?.showWindow(nil)
-            return
-        }
-        //MARK: 判断是否能用pro功能
-        for i in 0..<self.files!.count {
-            let file = self.files?[i]
-            file?.removePasswordInfo.resetState()
-        }
-        if self.files!.count < 1 {
-            NSSound.beep()
-            return
-        }
-        
-        self.fetchFileListViewController()!.reloadData()
-        
-        let openPanel = NSOpenPanel()
-        openPanel.canChooseFiles = false
-        openPanel.canChooseDirectories = true
-        openPanel.canCreateDirectories = true
-        openPanel.beginSheetModal(for: self.view.window!) { (result) in
-            if result == NSApplication.ModalResponse.OK {
-                for fileURL in openPanel.urls {
-                    self.choosePath = fileURL.path
-                    self.beginBatchOperation()
-                }
-            }
-        }
-    }
-    override func beginBatchOperation() {
-        hiddenWindowCloseButtonIfNeeded()
-        self.successFilePathURLArray?.removeAll()
-        for i in 0..<(self.files?.count ?? 0) {
-            let file = self.files?[i]
-            if file?.fileType == .PDF {
-                file?.currentOperateInfo?.savePath = self.choosePath
-                if file?.status == .Waiting {
-                    let operation = KMBatchRemovePasswordOperation(file: file!)
-                    operation.delegate = self
-                    self.queue?.addOperation(operation)
-                }
-            }
-        }
-        if self.queue?.operations.count ?? 0 > 0 {
-            self.interfaceStatus = .Processing
-        }
-    }
-}
-

+ 0 - 113
PDF Office/PDF Master/Class/PDFTools/RemovePassword/VC/KMBatchOperateRemovePasswordViewController.xib

@@ -1,113 +0,0 @@
-<?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="KMBatchOperateRemovePasswordViewController" customModule="PDF_Reader_Pro" customModuleProvider="target">
-            <connections>
-                <outlet property="actionButton" destination="FAD-8e-i2O" id="nlZ-Ka-ffE"/>
-                <outlet property="firstHintDetailLabel" destination="oGI-lg-f8q" id="rNt-zA-PrH"/>
-                <outlet property="secondHintDetailLabel" destination="iHp-Eg-Rp8" id="uPK-QX-ps9"/>
-                <outlet property="titleLabel" destination="8fW-1j-U3i" id="NKo-mO-KQ6"/>
-                <outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
-            </connections>
-        </customObject>
-        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
-        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
-        <customView id="Hz6-mo-xeY">
-            <rect key="frame" x="0.0" y="0.0" width="449" height="409"/>
-            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
-            <subviews>
-                <box verticalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="Sac-PK-Oqg">
-                    <rect key="frame" x="0.0" y="406" width="449" height="5"/>
-                    <constraints>
-                        <constraint firstAttribute="height" constant="1" id="zp6-JQ-zF0"/>
-                    </constraints>
-                </box>
-                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="8fW-1j-U3i">
-                    <rect key="frame" x="14" y="382" width="42" height="17"/>
-                    <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="mmw-A2-Gtx">
-                        <font key="font" metaFont="systemBold" size="14"/>
-                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                    </textFieldCell>
-                </textField>
-                <textField focusRingType="none" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="oGI-lg-f8q">
-                    <rect key="frame" x="32" y="357" width="383" height="15"/>
-                    <textFieldCell key="cell" title="sdfsdfjslkdfjlskdjfalskdfjalskdfjasldkfjasdlkfajsdflkajsdflaksdfjalkdsf" id="oIb-54-AfR">
-                        <font key="font" metaFont="cellTitle"/>
-                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                    </textFieldCell>
-                </textField>
-                <button tag="1" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="FAD-8e-i2O">
-                    <rect key="frame" x="16" y="20" width="417" height="32"/>
-                    <buttonCell key="cell" type="bevel" title="Button" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="MaU-Lj-yvq">
-                        <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                        <font key="font" metaFont="system"/>
-                    </buttonCell>
-                    <constraints>
-                        <constraint firstAttribute="height" constant="32" id="Cej-28-VyJ"/>
-                    </constraints>
-                    <connections>
-                        <action selector="buttonAction_RemovePassword:" target="-2" id="wqp-xf-KlD"/>
-                    </connections>
-                </button>
-                <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Oad-Gb-eVw">
-                    <rect key="frame" x="16" y="356" width="14" height="14"/>
-                    <constraints>
-                        <constraint firstAttribute="height" constant="14" id="jlc-F3-otn"/>
-                        <constraint firstAttribute="width" constant="14" id="oAT-FM-lot"/>
-                    </constraints>
-                    <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="KMImageNameElse1" id="rMW-t9-IWy"/>
-                </imageView>
-                <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="uqG-Wq-AxS">
-                    <rect key="frame" x="16" y="333" width="14" height="14"/>
-                    <constraints>
-                        <constraint firstAttribute="width" constant="14" id="nOa-f3-gTx"/>
-                        <constraint firstAttribute="height" constant="14" id="tcy-5q-ebj"/>
-                    </constraints>
-                    <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="KMImageNameElse2" id="OaI-M7-PPm"/>
-                </imageView>
-                <textField focusRingType="none" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="iHp-Eg-Rp8">
-                    <rect key="frame" x="32" y="304" width="403" height="45"/>
-                    <textFieldCell key="cell" id="44T-0r-UiT">
-                        <font key="font" metaFont="cellTitle"/>
-                        <string key="title">asdfasdflajdsflkadsfjalkdsfjalkdsfjasdlfkajdsflkajsdflakdjflasdfasdflajdsflkadsfjalkdsfjalkdsfjasdlfkajdsflkajsdflakdjflakdfasdfasdflajdsflkadsfjalkdsfjalkdsfjasdlfkajdsflkajsdflakdjflakdfakdf</string>
-                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                    </textFieldCell>
-                </textField>
-            </subviews>
-            <constraints>
-                <constraint firstItem="Oad-Gb-eVw" firstAttribute="leading" secondItem="8fW-1j-U3i" secondAttribute="leading" id="Ayw-Pw-jGT"/>
-                <constraint firstItem="Oad-Gb-eVw" firstAttribute="top" secondItem="8fW-1j-U3i" secondAttribute="bottom" constant="12" id="DSu-Sp-P3v"/>
-                <constraint firstItem="iHp-Eg-Rp8" firstAttribute="top" secondItem="oGI-lg-f8q" secondAttribute="bottom" constant="8" id="DeY-Rg-GoR"/>
-                <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="oGI-lg-f8q" secondAttribute="trailing" constant="16" id="Gud-UZ-gw6"/>
-                <constraint firstAttribute="trailing" secondItem="Sac-PK-Oqg" secondAttribute="trailing" id="J9p-z2-svR"/>
-                <constraint firstItem="FAD-8e-i2O" firstAttribute="leading" secondItem="8fW-1j-U3i" secondAttribute="leading" id="KDt-cN-ICm"/>
-                <constraint firstItem="Sac-PK-Oqg" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" id="KVr-oq-pgw"/>
-                <constraint firstAttribute="bottom" secondItem="FAD-8e-i2O" secondAttribute="bottom" constant="20" id="Lev-aA-NVx"/>
-                <constraint firstItem="oGI-lg-f8q" firstAttribute="leading" secondItem="Oad-Gb-eVw" secondAttribute="trailing" constant="4" id="Mxm-r9-XoH"/>
-                <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="iHp-Eg-Rp8" secondAttribute="trailing" constant="16" id="PRs-fX-NFH"/>
-                <constraint firstItem="oGI-lg-f8q" firstAttribute="top" secondItem="Oad-Gb-eVw" secondAttribute="top" constant="-2" id="SiD-IP-90i"/>
-                <constraint firstItem="FAD-8e-i2O" firstAttribute="top" relation="greaterThanOrEqual" secondItem="iHp-Eg-Rp8" secondAttribute="bottom" constant="10" id="ZWP-YW-DbG"/>
-                <constraint firstItem="uqG-Wq-AxS" firstAttribute="leading" secondItem="8fW-1j-U3i" secondAttribute="leading" id="c6I-mQ-0OK"/>
-                <constraint firstItem="Sac-PK-Oqg" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" id="d9D-px-leZ"/>
-                <constraint firstItem="iHp-Eg-Rp8" firstAttribute="top" secondItem="uqG-Wq-AxS" secondAttribute="top" constant="-2" id="mt1-FZ-Q1U"/>
-                <constraint firstItem="8fW-1j-U3i" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" constant="10" id="nYv-JN-qfs"/>
-                <constraint firstItem="iHp-Eg-Rp8" firstAttribute="leading" secondItem="oGI-lg-f8q" secondAttribute="leading" id="qGl-wk-z8K"/>
-                <constraint firstItem="FAD-8e-i2O" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="16" id="vNb-R7-Nk7"/>
-                <constraint firstItem="FAD-8e-i2O" firstAttribute="centerX" secondItem="Hz6-mo-xeY" secondAttribute="centerX" id="x65-8R-2BQ"/>
-            </constraints>
-            <point key="canvasLocation" x="-157.5" y="437.5"/>
-        </customView>
-    </objects>
-    <resources>
-        <image name="KMImageNameElse1" width="14" height="14"/>
-        <image name="KMImageNameElse2" width="14" height="14"/>
-    </resources>
-</document>

+ 1 - 1
PDF Office/PDF Master/Class/README.md

@@ -127,7 +127,7 @@
 
 ## 批量
 
-* KMBatchOperateWindowController
+* KMBatchWindowController
 
 ## 图片转PDF
 

+ 0 - 300
PDF Office/PDF Master/KMClass/ImageToPDF/Base/KMBatchOperateBaseViewController.swift

@@ -1,300 +0,0 @@
-//
-//  KMBatchOperateBaseViewController.swift
-//  PDF Reader Pro
-//
-//  Created by kdanmobile on 2023/10/30.
-//
-
-import Cocoa
-
-//var kBatchQueueOperationsChanged = "kBatchQueueOperationsChanged"
-private var kBatchQueueOperationsChanged = 0x000101
-class KMBatchOperateBaseViewController: KMNBaseViewController, KMBatchOperateProtocol{
-    var operateType: KMBatchOperationType?
-    var convertType: KMConvertWithPDFType?
-    var files: [KMBatchOperateFile]?
-    lazy var queue: KMOperationQueue? = {
-        var queue: KMOperationQueue?
-        if !((self.view.window as? KMBatchWindow)?.isBatch ?? false) {
-            queue = KMOperationQueue()
-        } else {
-            if self.operateType == .Convert {
-                queue = KMConvertOperationQueue.sharedQueue
-            } else if self.operateType == .Compress {
-                queue = KMCompressOperationQueue.sharedQueue
-            } else if self.operateType == .AddPassword {
-                queue = KMAddPasswordOperationQueue.sharedQueue
-            } else if self.operateType == .RemovePassword {
-                queue = KMRemovePasswordOperationQueue.sharedQueue
-            } else if self.operateType == .AddWatermark {
-                queue = KMAddWatermarkOprationQueue.sharedQueue
-            } else if self.operateType == .RemoveWatermark {
-               
-            } else if self.operateType == .AddBackground {
-                queue = KMAddBackgroundOperationQueue.sharedQueue
-            } else if self.operateType == .RemoveBackground {
-                queue = KMRemoveBackgroundOperationQueue.sharedQueue
-            } else if self.operateType == .AddHeaderFooter {
-                queue = KMAddHeaderFooterOperationQueue.sharedQueue
-            } else if self.operateType == .RemoveHeaderFooter {
-                queue = KMRemoveHeaderFooterQueue.sharedQueue
-            } else if self.operateType == .AddBates {
-                queue = KMAddBatesOperationQueue.sharedQueue
-            } else if self.operateType == .RemoveBates {
-                queue = KMRemoveBatesOperationQueue.sharedQueue
-            }
-        }
-        return queue
-    }()
-    lazy var successFilePathURLArray: [URL]? = {
-        let arr = NSMutableArray()
-        return (arr as! [URL])
-    }()
-    var name: String = ""
-    var interfaceStatus: KMBatchOperateInterfaceStatus?
-    var choosePath: String = ""
-    
-    init(files: [KMBatchOperateFile]) {
-        super.init(nibName: String(describing: type(of: self)), bundle: nil)
-        self.files = (files)
-    }
-    
-    required init?(coder: NSCoder) {
-        super.init(coder: coder)
-    }
-    deinit {
-//        queue?.removeObserver(self, forKeyPath: "operations")
-    }
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        self.queue?.addObserver(self, forKeyPath: "operations", options: .new, context: &kBatchQueueOperationsChanged)
-    }
-    
-    func operateCompleted() {
-        showWindowCloseButton()
-        if successFilePathURLArray!.count > 0 {
-            NSWorkspace.shared.activateFileViewerSelecting(successFilePathURLArray!)
-        }
-        self.interfaceStatus = .PrepareProcess
-    }
-    func showWindowCloseButton() {
-        let btn = self.view.window?.standardWindowButton(NSWindow.ButtonType.closeButton)
-        btn?.isHidden = false
-    }
-    func beginBatchOperation() {
-        for i in 0..<self.files!.count {
-            let file = self.files?[i]
-            file?.currentOperateInfo?.resetState()
-        }
-        if self.files!.count < 1 {
-            NSSound.beep()
-            return
-        }
-        
-        self.fetchFileListViewController()!.reloadData()
-        
-        let openPanel = NSOpenPanel()
-        openPanel.canChooseFiles = false
-        openPanel.canChooseDirectories = true
-        openPanel.canCreateDirectories = true
-        openPanel.beginSheetModal(for: self.view.window!) { (result) in
-            if result == NSApplication.ModalResponse.OK {
-                for fileURL in openPanel.urls {
-                    self.choosePath = fileURL.path
-                    self.beginQueueOperation()
-                }
-            }
-        }
-    }
-    func fetchFileListViewController() -> KMBatchOperateLeftViewController? {
-        guard let vc = self.view.window?.contentViewController as? KMBatchOperateSplitViewController,
-              let viewController = vc.splitViewItems.first?.viewController as? KMBatchOperateLeftViewController
-        else {
-            return nil
-        }
-        return viewController
-    }
-    func beginQueueOperation() {//业务逻辑转移到数据处理层
-        // hiddenWindowCloseButtonIfNeeded()
-        self.successFilePathURLArray?.removeAll()
-        for i in 0..<self.files!.count {
-            let file = self.files![i]
-            if file.fileType == .PDF {
-                if self.operateType == .Convert {
-                    file.convertType = self.convertType ?? .WordAdvance
-                }
-                file.currentOperateInfo?.savePath = self.choosePath
-                let operation = operationWithFile(file)
-                operation.delegate = self
-                self.queue?.addOperation(operation)
-            }
-        }
-        if self.queue?.operations.count ?? 0 > 0 {
-            self.interfaceStatus = .Processing
-        }
-    }
-    func operationWithFile(_ file: KMBatchOperateFile) -> KMBatchOperation {
-        var operation: KMBatchOperation?
-        if self.operateType == .Convert {
-            let batchOperate = KMBatchConvertOperation(file: file, convertType: self.convertType!)
-            batchOperate.isAllowOCR = file.isAllowOCR
-            batchOperate.ocrLanguage = file.ocrLanguage
-            batchOperate.viewController = self
-            return batchOperate
-        } else if self.operateType == .Compress {
-            let batchOperate = KMCompressOperation(file: file, compressValue: 60)
-            batchOperate.viewController = self
-            return batchOperate
-        } else if self.operateType == .AddPassword {
-            // handle AddPassword operation
-        } else if self.operateType == .RemovePassword {
-            return KMBatchRemovePasswordOperation(file: file)
-        } else if self.operateType == .AddWatermark {
-            // handle AddWatermark operation
-        } else if self.operateType == .RemoveWatermark {
-            
-        } else if self.operateType == .AddBackground {
-            // handle AddBackground operation
-        } else if self.operateType == .RemoveBackground {
-      
-        } else if self.operateType == .AddHeaderFooter {
-            // handle AddHeaderFooter operation
-        } else if self.operateType == .RemoveHeaderFooter {
-            return KMBatchRemoveHeaderFooterOperation(file: file)
-        } else if self.operateType == .AddBates {
-            
-        } else if self.operateType == .RemoveBates {
-            var op = KMBatchRemoveHeaderFooterOperation(file: file)
-            op.isBates = true
-            return op
-        } else {
-            
-        }
-        return operation ?? KMBatchOperation(file: file)
-    }
-    func cancelBatchOperation() {
-        for i in 0..<(self.queue?.operations.count)! {
-            let operation = self.queue?.operations[i]
-            if !operation!.isExecuting {
-                operation?.cancel()
-            } else {
-                // Do nothing
-            }
-        }
-        self.interfaceStatus = .PrepareProcess
-    }
-    func hiddenWindowCloseButtonIfNeeded() {
-        let btn = self.view.window?.standardWindowButton(NSWindow.ButtonType.closeButton)
-        btn?.isHidden = true
-    }
-    func allPageNumbers(_ pageString: String) -> [NSNumber] {
-        let array = pageString.components(separatedBy: ",")
-        let pageNumbers = NSMutableArray()
-        var isInvalid = false
-        for s in array {
-            if s == "" {
-                isInvalid = true
-                break
-            } else {
-                let pages = s.components(separatedBy: "-")
-                if pages.count > 2 {
-                    isInvalid = true 
-                    break
-                } else if pages.count == 1 {
-                    let p = pages[0]
-                    if p == "" || Int(p) == 0 {
-                        isInvalid = true 
-                        break
-                    } else {
-                        var isEqual = false
-                        for pageNumber in pageNumbers {
-                            if (pageNumber as AnyObject).intValue == Int(p) {
-                                isEqual = true
-                                isInvalid = true 
-                                break
-                            }
-                        }
-                        if !isEqual {
-                            pageNumbers.add(NSNumber(value: Int(p)!))
-                        }
-                    }
-                } else if pages.count == 2 {
-                    let p1 = pages[0]
-                    let p2 = pages[1]
-                    if p1 == "" || p2 == "" || Int(p1)! >= Int(p2)! || Int(p1) == 0 {
-                        isInvalid = true
-                        break
-                    } else {
-                        var isEqual = false
-                        for i in Int(p1)!...Int(p2)! {
-                            for pageNumber in pageNumbers {
-                                if (pageNumber as AnyObject).intValue == i {
-                                    isEqual = true
-                                    isInvalid = true
-                                    break
-                                }
-                            }
-                        }
-                        if !isEqual {
-                            for i in Int(p1)!...Int(p2)! {
-                                pageNumbers.add(NSNumber(value: i))
-                            }
-                        }
-                    }
-                }
-            }
-        }
-        return pageNumbers as! [NSNumber]
-    }
-    override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
-        if keyPath == "operations" && context == &kBatchQueueOperationsChanged {
-            if self.queue?.operations.count == 0 {
-                DispatchQueue.main.async {
-                    self.operateCompleted()
-                }
-            }
-        } else {
-            super.observeValue(forKeyPath: keyPath, of: object, change: change, context: context)
-        }
-    }
-}
-
-extension KMBatchOperateBaseViewController{
-    func fileBeginOperate(_ file: KMBatchOperateFile, info: KMBatchBaseParameter) {
-        DispatchQueue.main.async {
-            info.status = .processing
-            self.fetchFileListViewController()?.reloadFile(file)
-        }
-    }
-    func fileOperating(_ file: KMBatchOperateFile, progress: CGFloat, info: KMBatchBaseParameter) {
-        DispatchQueue.main.async {
-            info.progress = Float(progress)
-            self.fetchFileListViewController()?.reloadFile(file)
-        }
-    }
-    func fileOperateSuccessed(_ file: KMBatchOperateFile, info: KMBatchBaseParameter) {
-        DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.3) {
-            info.status = .Success
-            if info.outPutPath?.count ?? 0 > 0{
-                let url: URL = URL(fileURLWithPath: info.outPutPath!)
-                self.successFilePathURLArray?.append(url)
-            }
-            self.fetchFileListViewController()?.reloadFile(file)
-        }
-    }
-    func fileOperateFailed(_ file: KMBatchOperateFile, error: NSError, info: KMBatchBaseParameter) {
-        DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.3) {
-            info.status = .Failed
-            info.error = error
-            self.fetchFileListViewController()?.reloadData()
-        }
-    }
-    func fileOperateCanceled(_ file: KMBatchOperateFile, info: KMBatchBaseParameter) {
-        DispatchQueue.main.async {
-            info.status = .Waiting
-            info.error = nil
-            self.fetchFileListViewController()?.reloadFile(file)
-        }
-    }
-}
-

+ 0 - 22
PDF Office/PDF Master/KMClass/ImageToPDF/Base/KMBatchOperateBaseViewController.xib

@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22155" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
-    <dependencies>
-        <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22155"/>
-        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
-    </dependencies>
-    <objects>
-        <customObject id="-2" userLabel="File's Owner" customClass="KMBatchOperateBaseViewController" customModule="PDF_Master" customModuleProvider="target">
-            <connections>
-                <outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
-            </connections>
-        </customObject>
-        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
-        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
-        <customView id="Hz6-mo-xeY">
-            <rect key="frame" x="0.0" y="0.0" width="480" height="272"/>
-            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
-            <point key="canvasLocation" x="94" y="-128"/>
-        </customView>
-    </objects>
-</document>

+ 0 - 101
PDF Office/PDF Master/KMClass/ImageToPDF/Base/KMBatchOperateBaseWindowController.swift

@@ -1,101 +0,0 @@
-//
-//  KMBatchOperateBaseWindowController.swift
-//  PDF Reader Pro
-//
-//  Created by kdanmobile on 2023/10/26.
-//
-
-import Cocoa
-
-@objcMembers class KMBatchOperateBaseWindowController: KMNBaseWindowController{
-    var files: [KMBatchOperateFile]?
-    var operateType: KMBatchOperationType?{
-        willSet{
-            
-        }
-        didSet {
-            switch operateType {
-            case .Convert:
-                self.window!.title = NSLocalizedString("Convert", comment: "")
-            case .Merge:
-                self.window!.title = NSLocalizedString("Merge", comment: "")
-            case .Compress:
-                self.window!.title = NSLocalizedString("Compress", comment: "")
-            case .AddPassword:
-                self.window!.title = NSLocalizedString("Set Passwords", comment: "")
-            case .RemovePassword:
-                self.window!.title = NSLocalizedString("Remove Security", comment: "")
-            case .AddWatermark:
-                self.window!.title = NSLocalizedString("Add Watermark", comment: "")
-            case .RemoveWatermark:
-                self.window!.title = NSLocalizedString("Remove Watermark", comment: "")
-            case .AddBackground:
-                self.window!.title = NSLocalizedString("Add Background", comment: "")
-            case .RemoveBackground:
-                self.window!.title = NSLocalizedString("Remove Background", comment: "")
-            case .AddHeaderFooter:
-                self.window!.title = NSLocalizedString("Add Header & Footer", comment: "")
-            case .RemoveHeaderFooter:
-                self.window!.title = NSLocalizedString("Remove Header & Footer", comment: "")
-            case .AddBates:
-                self.window!.title = NSLocalizedString("Add Bates Numbers", comment: "")
-            case .RemoveBates:
-                self.window!.title = NSLocalizedString("Remove Bates Numbers", comment: "")
-            case .CreatePDF:
-                self.window!.title = NSLocalizedString("", comment: "")
-            default :
-                self.window!.title = NSLocalizedString("Convert", comment: "")
-            }
-        }
-    }
-    
-    override func windowDidLoad() {
-        super.windowDidLoad()
-        self.configuUI()
-        files = NSMutableArray() as? [KMBatchOperateFile]
-        
-        window?.titlebarAppearsTransparent = true
-    }
-    
-    override func updateUIThemeColor() {
-        super.updateUIThemeColor()
-        
-        KMMainThreadExecute {
-            self.window?.backgroundColor = KMNColorTools.colorBg_layoutMiddle()
-        }
-    }
-    
-    func configuUI() {
-        let splitViewController = KMBatchOperateSplitViewController(nibName: "KMBatchOperateSplitViewController", bundle: nil)
-        contentViewController = splitViewController
-    }
-    func switchToOperateType(_ operateType: KMBatchOperationType, files: [KMBatchOperateFile]) {
-        self.files = files 
-        (self.contentViewController as? KMBatchOperateSplitViewController)?.switchToOperateType(operateType: operateType, files: files)
-        self.operateType = operateType
-    }
-    func checkNeedPasswordSwitchToOperateType(operateType: KMBatchOperationType, files: [KMBatchOperateFile]) {
-        self.files = files
-        (self.contentViewController as! KMBatchOperateSplitViewController).checkNeedPasswordSwitchToOperateType(operateType, files: files) 
-        self.operateType = operateType
-    }
-    func switchToConvertType(convertType: KMConvertWithPDFType) {
-        (self.contentViewController as! KMBatchOperateSplitViewController).switchToConvertType(convertType)
-    }
-    
-    func backgroundInterfaceSelectBackGround(background: KMBackgroundModel) {
-        (self.contentViewController as! KMBatchOperateSplitViewController).backgroundInterfaceSelectBackground(background)
-    }
-    func headerFooterInterfaceSelectHeaderFooter(headerFooter: KMHeaderFooterModel) {
-        (self.contentViewController as! KMBatchOperateSplitViewController).headerFooterInterfaceSelectHeaderFooter(headerFooter)
-    }
-    func batesInterfaceSelectBates(headerFooter: KMHeaderFooterModel) {
-        (self.contentViewController as! KMBatchOperateSplitViewController).headerFooterInterfaceSelectHeaderFooter(headerFooter)
-    }
-    
-    
-    
-}
-
-
-

+ 0 - 30
PDF Office/PDF Master/KMClass/ImageToPDF/Base/KMBatchOperateBaseWindowController.xib

@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22155" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
-    <dependencies>
-        <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22155"/>
-        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
-    </dependencies>
-    <objects>
-        <customObject id="-2" userLabel="File's Owner" customClass="KMBatchOperateBaseWindowController">
-            <connections>
-                <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" customClass="KMBatchWindow" customModule="PDF_Master" customModuleProvider="target">
-            <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
-            <rect key="contentRect" x="422" y="270" width="480" height="270"/>
-            <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="480" height="270"/>
-                <autoresizingMask key="autoresizingMask"/>
-            </view>
-            <connections>
-                <outlet property="delegate" destination="-2" id="0bl-1N-AYu"/>
-            </connections>
-            <point key="canvasLocation" x="-27" y="114"/>
-        </window>
-    </objects>
-</document>

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 1349
PDF Office/PDF Master/KMClass/ImageToPDF/Base/KMBatchOperateLeftViewController.swift


+ 0 - 356
PDF Office/PDF Master/KMClass/ImageToPDF/Base/KMBatchOperateLeftViewController.xib

@@ -1,356 +0,0 @@
-<?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="KMBatchOperateLeftViewController" customModule="PDF_Reader_Pro" customModuleProvider="target">
-            <connections>
-                <outlet property="DPIColumn" destination="AKG-QZ-eeC" id="Glj-ry-TZJ"/>
-                <outlet property="addFileBox" destination="Zqp-U9-Ixm" id="0hL-DT-F1P"/>
-                <outlet property="blankView" destination="G6v-if-4fr" id="0kN-km-HnU"/>
-                <outlet property="deleteFileButton" destination="0F7-Ym-8wO" id="o5S-Qq-ATj"/>
-                <outlet property="deleteMenuItem" destination="1Q4-gp-Cqq" id="E6c-72-nML"/>
-                <outlet property="dimensionsTableColumn" destination="BoK-gf-WJ0" id="mSb-dx-7lD"/>
-                <outlet property="fileNameTableColumn" destination="TTZ-qf-vYt" id="n4b-bH-idi"/>
-                <outlet property="headerOperateView" destination="yD5-qe-EWK" id="JKv-Jb-TvN"/>
-                <outlet property="indexTableColumn" destination="dvO-PE-2DL" id="Vfs-iI-K2r"/>
-                <outlet property="pageRangeTableColumn" destination="1OD-xa-ZwP" id="6Nl-wU-NzL"/>
-                <outlet property="showInFinderMenuItem" destination="pcS-mu-f3A" id="kvn-d6-7Az"/>
-                <outlet property="sizeTableColumn" destination="Jv9-CS-hrB" id="PCA-0X-l78"/>
-                <outlet property="stateTableColumn" destination="vhM-02-bDl" id="STX-VS-KmA"/>
-                <outlet property="tableView" destination="iqp-fI-b2v" id="VOu-Ji-UNl"/>
-                <outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
-            </connections>
-        </customObject>
-        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
-        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
-        <customView misplaced="YES" id="Hz6-mo-xeY">
-            <rect key="frame" x="0.0" y="0.0" width="616" height="560"/>
-            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
-            <subviews>
-                <customView translatesAutoresizingMaskIntoConstraints="NO" id="yD5-qe-EWK">
-                    <rect key="frame" x="0.0" y="496" width="718" height="64"/>
-                    <subviews>
-                        <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="0F7-Ym-8wO">
-                            <rect key="frame" x="662" y="12" width="32" height="32"/>
-                            <buttonCell key="cell" type="square" title="Button" bezelStyle="shadowlessSquare" image="KMImageNameUXIconBtnDeletNor" imagePosition="only" alignment="center" alternateImage="KMImageNameUXIconBtnDeletHov" imageScaling="proportionallyDown" inset="2" id="F2E-HK-Xqi">
-                                <behavior key="behavior" lightByContents="YES"/>
-                                <font key="font" metaFont="system"/>
-                            </buttonCell>
-                            <constraints>
-                                <constraint firstAttribute="height" constant="32" id="I4I-Jh-3OK"/>
-                                <constraint firstAttribute="width" constant="32" id="nPO-97-IsQ"/>
-                            </constraints>
-                            <connections>
-                                <action selector="buttonClicked_DeleteFile:" target="-2" id="Bv8-Ml-MTp"/>
-                            </connections>
-                        </button>
-                        <box boxType="custom" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="Zqp-U9-Ixm">
-                            <rect key="frame" x="24" y="12" width="129" height="32"/>
-                            <view key="contentView" id="0Xp-Dg-iUq">
-                                <rect key="frame" x="1" y="1" width="127" height="30"/>
-                                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                            </view>
-                            <constraints>
-                                <constraint firstAttribute="width" constant="129" id="5CG-mS-WM2"/>
-                                <constraint firstAttribute="height" constant="32" id="Xe8-ks-3uk"/>
-                            </constraints>
-                        </box>
-                    </subviews>
-                    <constraints>
-                        <constraint firstAttribute="trailing" secondItem="0F7-Ym-8wO" secondAttribute="trailing" constant="24" id="1DK-aB-Ulg"/>
-                        <constraint firstAttribute="height" constant="64" id="1XQ-Cb-Icy"/>
-                        <constraint firstItem="Zqp-U9-Ixm" firstAttribute="top" secondItem="yD5-qe-EWK" secondAttribute="top" constant="20" id="8v1-1i-Hyy"/>
-                        <constraint firstItem="0F7-Ym-8wO" firstAttribute="top" secondItem="yD5-qe-EWK" secondAttribute="top" constant="20" id="Nz3-Mo-cBx"/>
-                        <constraint firstItem="Zqp-U9-Ixm" firstAttribute="leading" secondItem="yD5-qe-EWK" secondAttribute="leading" constant="24" id="fEf-fb-EFw"/>
-                    </constraints>
-                </customView>
-                <scrollView autohidesScrollers="YES" horizontalLineScroll="17" horizontalPageScroll="10" verticalLineScroll="17" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cSo-1J-C87">
-                    <rect key="frame" x="24" y="0.0" width="670" height="496"/>
-                    <clipView key="contentView" ambiguous="YES" id="5QZ-3D-5sN">
-                        <rect key="frame" x="1" y="1" width="668" height="479"/>
-                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                        <subviews>
-                            <tableView verticalHuggingPriority="750" ambiguous="YES" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" tableStyle="plain" columnSelection="YES" multipleSelection="NO" autosaveColumns="NO" rowSizeStyle="automatic" headerView="Mlr-rw-6rm" viewBased="YES" id="iqp-fI-b2v" customClass="KMTableView" customModule="PDF_Reader_Pro" customModuleProvider="target">
-                                <rect key="frame" x="0.0" y="0.0" width="847" height="454"/>
-                                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                <color key="gridColor" red="1" green="0.64784158279075421" blue="0.26014074763814632" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-                                <tableColumns>
-                                    <tableColumn identifier="index" width="40" minWidth="40" maxWidth="40" id="dvO-PE-2DL">
-                                        <tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left" title="序号">
-                                            <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
-                                            <color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
-                                        </tableHeaderCell>
-                                        <textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" title="Text Cell" id="czc-3c-yCB">
-                                            <font key="font" metaFont="system"/>
-                                            <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
-                                            <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                        </textFieldCell>
-                                        <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
-                                        <prototypeCellViews>
-                                            <tableCellView id="mJ1-Fh-j8e">
-                                                <rect key="frame" x="0.0" y="0.0" width="40" height="17"/>
-                                                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                            </tableCellView>
-                                        </prototypeCellViews>
-                                    </tableColumn>
-                                    <tableColumn identifier="fileName" width="219" minWidth="219" maxWidth="1000" id="TTZ-qf-vYt">
-                                        <tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left" title="文件名">
-                                            <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
-                                            <color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
-                                        </tableHeaderCell>
-                                        <textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" title="Text Cell" id="ctm-0t-PP7">
-                                            <font key="font" metaFont="system"/>
-                                            <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
-                                            <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                        </textFieldCell>
-                                        <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
-                                        <prototypeCellViews>
-                                            <tableCellView id="Mgh-hp-ErW">
-                                                <rect key="frame" x="40" y="0.0" width="219" height="17"/>
-                                                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                            </tableCellView>
-                                        </prototypeCellViews>
-                                    </tableColumn>
-                                    <tableColumn identifier="pageRange" width="140" minWidth="140" maxWidth="140" id="1OD-xa-ZwP">
-                                        <tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left" title="页码范围">
-                                            <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
-                                            <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
-                                        </tableHeaderCell>
-                                        <textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" alignment="left" title="Text Cell" id="LCE-83-k0h">
-                                            <font key="font" metaFont="system"/>
-                                            <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
-                                            <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                        </textFieldCell>
-                                        <prototypeCellViews>
-                                            <tableCellView id="nlT-SK-XE6" customClass="KMBatchTableCellView" customModule="PDF_Reader_Pro" customModuleProvider="target">
-                                                <rect key="frame" x="259" y="0.0" width="140" height="17"/>
-                                                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                            </tableCellView>
-                                        </prototypeCellViews>
-                                    </tableColumn>
-                                    <tableColumn identifier="size" width="88" minWidth="88" maxWidth="88" id="Jv9-CS-hrB">
-                                        <tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left" title="大小">
-                                            <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
-                                            <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
-                                        </tableHeaderCell>
-                                        <textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" alignment="left" title="Text Cell" id="1c7-xc-JTb">
-                                            <font key="font" metaFont="system"/>
-                                            <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
-                                            <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                        </textFieldCell>
-                                        <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
-                                        <prototypeCellViews>
-                                            <tableCellView id="TSm-ys-xdB">
-                                                <rect key="frame" x="399" y="0.0" width="88" height="17"/>
-                                                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                            </tableCellView>
-                                        </prototypeCellViews>
-                                    </tableColumn>
-                                    <tableColumn identifier="status" width="56" minWidth="56" maxWidth="56" id="vhM-02-bDl">
-                                        <tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left" title="状态">
-                                            <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
-                                            <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
-                                        </tableHeaderCell>
-                                        <textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" alignment="left" title="Text Cell" id="L91-kp-t6V">
-                                            <font key="font" metaFont="system"/>
-                                            <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
-                                            <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                        </textFieldCell>
-                                        <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
-                                        <prototypeCellViews>
-                                            <tableCellView id="sVm-ab-mJ4">
-                                                <rect key="frame" x="487" y="0.0" width="56" height="17"/>
-                                                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                                <subviews>
-                                                    <customView translatesAutoresizingMaskIntoConstraints="NO" id="QVD-OT-qtp">
-                                                        <rect key="frame" x="0.0" y="0.0" width="56" height="17"/>
-                                                    </customView>
-                                                </subviews>
-                                                <constraints>
-                                                    <constraint firstItem="QVD-OT-qtp" firstAttribute="top" secondItem="sVm-ab-mJ4" secondAttribute="top" id="DUg-iq-yMw"/>
-                                                    <constraint firstAttribute="trailing" secondItem="QVD-OT-qtp" secondAttribute="trailing" id="NLx-yZ-Jn2"/>
-                                                    <constraint firstItem="QVD-OT-qtp" firstAttribute="leading" secondItem="sVm-ab-mJ4" secondAttribute="leading" id="qjh-3z-1lQ"/>
-                                                    <constraint firstAttribute="bottom" secondItem="QVD-OT-qtp" secondAttribute="bottom" id="rqk-AF-SwC"/>
-                                                </constraints>
-                                            </tableCellView>
-                                        </prototypeCellViews>
-                                    </tableColumn>
-                                    <tableColumn identifier="dpi" width="140" minWidth="140" maxWidth="140" id="AKG-QZ-eeC">
-                                        <tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left" title="DPI">
-                                            <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
-                                            <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
-                                        </tableHeaderCell>
-                                        <textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" alignment="left" title="Text Cell" id="9SD-ap-m6M">
-                                            <font key="font" metaFont="system"/>
-                                            <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
-                                            <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                        </textFieldCell>
-                                        <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
-                                        <prototypeCellViews>
-                                            <tableCellView id="tdZ-lu-oAc" customClass="KMBatchTableCellView" customModule="PDF_Reader_Pro" customModuleProvider="target">
-                                                <rect key="frame" x="543" y="0.0" width="140" height="17"/>
-                                                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                            </tableCellView>
-                                        </prototypeCellViews>
-                                    </tableColumn>
-                                    <tableColumn identifier="dimensions" width="164" minWidth="164" maxWidth="164" id="BoK-gf-WJ0">
-                                        <tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="center" title="Dimensions">
-                                            <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
-                                            <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
-                                        </tableHeaderCell>
-                                        <textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" alignment="left" title="Text Cell" id="w2B-Sb-stM">
-                                            <font key="font" metaFont="system"/>
-                                            <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
-                                            <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                        </textFieldCell>
-                                        <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
-                                        <prototypeCellViews>
-                                            <tableCellView id="nvT-ce-HBH" customClass="KMBatchTableCellView" customModule="PDF_Reader_Pro" customModuleProvider="target">
-                                                <rect key="frame" x="683" y="0.0" width="164" height="17"/>
-                                                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                            </tableCellView>
-                                        </prototypeCellViews>
-                                    </tableColumn>
-                                </tableColumns>
-                                <connections>
-                                    <outlet property="dataSource" destination="-2" id="R8X-VN-ypP"/>
-                                    <outlet property="delegate" destination="-2" id="Ie9-A1-7mB"/>
-                                    <outlet property="menu" destination="e6T-xh-hi0" id="ai6-yI-pn2"/>
-                                </connections>
-                            </tableView>
-                        </subviews>
-                    </clipView>
-                    <constraints>
-                        <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="400" id="I8C-3u-ERA"/>
-                        <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="670" id="LUW-2r-W1h"/>
-                    </constraints>
-                    <scroller key="horizontalScroller" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="RBU-7C-fCt">
-                        <rect key="frame" x="1" y="480" width="668" height="15"/>
-                        <autoresizingMask key="autoresizingMask"/>
-                    </scroller>
-                    <scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="32b-Um-caF">
-                        <rect key="frame" x="224" y="17" width="15" height="102"/>
-                        <autoresizingMask key="autoresizingMask"/>
-                    </scroller>
-                    <tableHeaderView key="headerView" wantsLayer="YES" id="Mlr-rw-6rm" customClass="KMTableHeaderView" customModule="PDF_Reader_Pro" customModuleProvider="target">
-                        <rect key="frame" x="0.0" y="0.0" width="847" height="25"/>
-                        <autoresizingMask key="autoresizingMask"/>
-                    </tableHeaderView>
-                </scrollView>
-                <customView translatesAutoresizingMaskIntoConstraints="NO" id="G6v-if-4fr" customClass="KMBlankView" customModule="PDF_Reader_Pro" customModuleProvider="target">
-                    <rect key="frame" x="0.0" y="0.0" width="718" height="496"/>
-                    <subviews>
-                        <customView translatesAutoresizingMaskIntoConstraints="NO" id="9GJ-Lf-bRA">
-                            <rect key="frame" x="222" y="153" width="275" height="190"/>
-                            <subviews>
-                                <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="aT2-4b-2xG">
-                                    <rect key="frame" x="67" y="50" width="140" height="140"/>
-                                    <constraints>
-                                        <constraint firstAttribute="height" constant="140" id="1br-FU-oB3"/>
-                                        <constraint firstAttribute="width" constant="140" id="Hmk-dG-xR7"/>
-                                    </constraints>
-                                    <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="KMImageNameEmptyListNor" id="ZKZ-Y3-Edy"/>
-                                </imageView>
-                                <textField focusRingType="none" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="6Hf-rN-RVl">
-                                    <rect key="frame" x="86" y="33" width="102" height="17"/>
-                                    <textFieldCell key="cell" title="Multiline Label" id="ssO-57-xns">
-                                        <font key="font" metaFont="systemSemibold" size="14"/>
-                                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                    </textFieldCell>
-                                </textField>
-                                <textField focusRingType="none" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="tU6-rc-cEb">
-                                    <rect key="frame" x="86" y="8" width="102" height="17"/>
-                                    <textFieldCell key="cell" alignment="center" title="Multiline Label" id="7H4-19-ztf">
-                                        <font key="font" metaFont="system" size="14"/>
-                                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                    </textFieldCell>
-                                </textField>
-                                <button hidden="YES" translatesAutoresizingMaskIntoConstraints="NO" id="8eZ-ia-mtv">
-                                    <rect key="frame" x="67" y="50" width="140" height="140"/>
-                                    <buttonCell key="cell" type="bevel" title="Button" bezelStyle="rounded" image="KMImageNameEmptyListNor" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="o8j-Uh-3Zt">
-                                        <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                                        <font key="font" metaFont="system"/>
-                                    </buttonCell>
-                                    <constraints>
-                                        <constraint firstAttribute="height" constant="140" id="FAQ-AI-aUg"/>
-                                        <constraint firstAttribute="width" constant="140" id="GF5-QU-DL3"/>
-                                    </constraints>
-                                    <connections>
-                                        <action selector="blankViewAddFileAction:" target="-2" id="wjH-6m-Pc1"/>
-                                    </connections>
-                                </button>
-                            </subviews>
-                            <constraints>
-                                <constraint firstItem="tU6-rc-cEb" firstAttribute="top" secondItem="6Hf-rN-RVl" secondAttribute="bottom" constant="8" id="0lT-Bd-z3W"/>
-                                <constraint firstItem="aT2-4b-2xG" firstAttribute="top" secondItem="9GJ-Lf-bRA" secondAttribute="top" id="5f3-wl-J3a"/>
-                                <constraint firstAttribute="bottom" secondItem="tU6-rc-cEb" secondAttribute="bottom" constant="8" id="7jP-8F-Yc5"/>
-                                <constraint firstItem="6Hf-rN-RVl" firstAttribute="centerX" secondItem="9GJ-Lf-bRA" secondAttribute="centerX" id="KME-rV-lsa"/>
-                                <constraint firstItem="6Hf-rN-RVl" firstAttribute="top" secondItem="aT2-4b-2xG" secondAttribute="bottom" id="KWr-uj-plt"/>
-                                <constraint firstItem="tU6-rc-cEb" firstAttribute="centerX" secondItem="9GJ-Lf-bRA" secondAttribute="centerX" id="NWN-9j-uqf"/>
-                                <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="tU6-rc-cEb" secondAttribute="trailing" id="d8X-Ae-XwQ"/>
-                                <constraint firstAttribute="width" constant="275" id="mYh-dT-Msb"/>
-                                <constraint firstItem="8eZ-ia-mtv" firstAttribute="top" secondItem="aT2-4b-2xG" secondAttribute="top" id="toA-2V-wdv"/>
-                                <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="6Hf-rN-RVl" secondAttribute="trailing" id="uRe-aH-NNZ"/>
-                                <constraint firstItem="8eZ-ia-mtv" firstAttribute="centerX" secondItem="9GJ-Lf-bRA" secondAttribute="centerX" id="xuT-ew-DiJ"/>
-                                <constraint firstItem="aT2-4b-2xG" firstAttribute="centerX" secondItem="9GJ-Lf-bRA" secondAttribute="centerX" id="yFN-Mz-HoM"/>
-                            </constraints>
-                        </customView>
-                    </subviews>
-                    <constraints>
-                        <constraint firstItem="9GJ-Lf-bRA" firstAttribute="centerY" secondItem="G6v-if-4fr" secondAttribute="centerY" id="IdB-UE-f2e"/>
-                        <constraint firstItem="9GJ-Lf-bRA" firstAttribute="centerX" secondItem="G6v-if-4fr" secondAttribute="centerX" id="kJE-tO-m7r"/>
-                    </constraints>
-                    <connections>
-                        <outlet property="addButton" destination="8eZ-ia-mtv" id="ZcV-Ci-ZIe"/>
-                        <outlet property="imageView" destination="aT2-4b-2xG" id="sQG-IE-mUv"/>
-                        <outlet property="secondTitleLabel" destination="tU6-rc-cEb" id="X2z-T7-8wA"/>
-                        <outlet property="titleLabel" destination="6Hf-rN-RVl" id="xFn-Ai-3qy"/>
-                    </connections>
-                </customView>
-            </subviews>
-            <constraints>
-                <constraint firstItem="cSo-1J-C87" firstAttribute="top" secondItem="yD5-qe-EWK" secondAttribute="bottom" id="1E9-OU-iH1"/>
-                <constraint firstItem="G6v-if-4fr" firstAttribute="top" secondItem="yD5-qe-EWK" secondAttribute="bottom" id="BMV-w3-Izh"/>
-                <constraint firstAttribute="bottom" secondItem="cSo-1J-C87" secondAttribute="bottom" id="C10-cX-Uaf"/>
-                <constraint firstAttribute="trailing" secondItem="G6v-if-4fr" secondAttribute="trailing" id="F0T-RF-MT0"/>
-                <constraint firstAttribute="trailing" secondItem="yD5-qe-EWK" secondAttribute="trailing" id="GiE-TH-mjf"/>
-                <constraint firstAttribute="trailing" secondItem="cSo-1J-C87" secondAttribute="trailing" constant="24" id="LI9-Qj-pnl"/>
-                <constraint firstItem="G6v-if-4fr" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" id="byv-Of-n7n"/>
-                <constraint firstItem="yD5-qe-EWK" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" id="cjX-bE-yQ3"/>
-                <constraint firstItem="cSo-1J-C87" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="24" id="dk3-8n-swZ"/>
-                <constraint firstAttribute="bottom" secondItem="G6v-if-4fr" secondAttribute="bottom" id="qqx-eK-gkx"/>
-                <constraint firstItem="yD5-qe-EWK" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" id="tcr-Fi-EVL"/>
-            </constraints>
-            <point key="canvasLocation" x="-73.5" y="561.5"/>
-        </customView>
-        <menu id="e6T-xh-hi0">
-            <items>
-                <menuItem title="Item 1" id="pcS-mu-f3A">
-                    <modifierMask key="keyEquivalentModifierMask"/>
-                    <connections>
-                        <action selector="menuItem_ShowInFinder:" target="-2" id="AZl-x4-Mk3"/>
-                    </connections>
-                </menuItem>
-                <menuItem title="Item" id="1Q4-gp-Cqq">
-                    <modifierMask key="keyEquivalentModifierMask"/>
-                    <connections>
-                        <action selector="menuItem_Delete:" target="-2" id="ALB-dP-f3g"/>
-                    </connections>
-                </menuItem>
-            </items>
-            <point key="canvasLocation" x="-240" y="137"/>
-        </menu>
-    </objects>
-    <resources>
-        <image name="KMImageNameEmptyListNor" width="200" height="200"/>
-        <image name="KMImageNameUXIconBtnDeletHov" width="16" height="16"/>
-        <image name="KMImageNameUXIconBtnDeletNor" width="16" height="16"/>
-    </resources>
-</document>

+ 0 - 131
PDF Office/PDF Master/KMClass/ImageToPDF/Base/KMBatchOperateRightViewController.swift

@@ -1,131 +0,0 @@
-//
-//  KMBatchOperateRightViewController.swift
-//  PDF Reader Pro
-//
-//  Created by kdanmobile on 2023/10/26.
-//
-
-import Cocoa
-
-class KMBatchOperateRightViewController: NSViewController{
-    lazy var compressViewController: KMBatchOperateCompressViewController? = {
-        let vc = KMBatchOperateCompressViewController(files: self.files)
-        vc.operateType = .Compress
-        return vc
-    }()
-    lazy var convertViewController: KMBatchOperateConvertViewController? = {
-        let vc = KMBatchOperateConvertViewController(files: self.files)
-        vc.operateType = .Convert
-        return vc
-    }()
-    lazy var addPasswordViewController: KMBatchOperateAddPasswordViewController? = {
-        let vc = KMBatchOperateAddPasswordViewController(files: self.files)
-        vc.operateType = .AddPassword
-        return vc
-    }()
-    lazy var removePasswordViewController: KMBatchOperateRemovePasswordViewController? = {
-        let vc = KMBatchOperateRemovePasswordViewController(files: self.files)
-        vc.operateType = .RemovePassword
-        return vc
-    }()
-    lazy var imageToPDFViewController: KMBatchOperateImageToPDFViewController? = {
-        let vc = KMBatchOperateImageToPDFViewController(files: self.files)
-        vc.operateType = .CreatePDF
-        return vc
-    }()
-    
-    var _currentType: KMBatchOperationType?
-    var currentType: KMBatchOperationType?{
-        get{
-            return _currentType
-        }
-        set{
-            if _currentType != newValue{
-                _currentType = newValue
-                for i in 0..<self.view.subviews.count {
-                    let v = self.view.subviews[i]
-                    v.removeFromSuperview()
-                }
-                if newValue == .Convert {
-                    self.view.addSubview(self.convertViewController!.view)
-                    self.convertViewController?.view.mas_makeConstraints({ make in
-                        make?.edges.equalTo()(self.view)
-                    })
-                } else if _currentType == .AddHeaderFooter {
-                     
-                } else if _currentType == .RemoveHeaderFooter {
-                     
-                } else if _currentType == .AddBates {
-                     
-                } else if _currentType == .RemoveBates {
-                    
-                } else if _currentType == .AddPassword {
-                    self.view.addSubview(self.addPasswordViewController!.view)
-                    self.addPasswordViewController?.view.mas_makeConstraints({ make in
-                        make?.edges.equalTo()(self.view)
-                    })
-                } else if _currentType == .RemovePassword {
-                    self.view.addSubview(self.removePasswordViewController!.view)
-                    self.removePasswordViewController?.view.mas_makeConstraints({ make in
-                        make?.edges.equalTo()(self.view)
-                    })
-                } else if _currentType == .Compress {
-                    self.view.addSubview(self.compressViewController!.view)
-                    self.compressViewController?.view.mas_makeConstraints({ make in
-                        make?.edges.equalTo()(self.view)
-                    })
-                } else if _currentType == .CreatePDF {
-                    self.view.addSubview(self.imageToPDFViewController!.view)
-                    self.imageToPDFViewController?.view.mas_makeConstraints({ make in
-                        make?.edges.equalTo()(self.view)
-                    })
-                }
-            }
-        }
-    }
-
-    var files: [KMBatchOperateFile] = []
-    
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        
-    }
-    
-    func switchToOperateType(operateType: KMBatchOperationType, files: [KMBatchOperateFile]) {
-        self.files = files
-        self.imageToPDFViewController?.files = self.files
-        self.currentType = operateType
-    }
-    
-    func switchToOperateType(operateType: KMBatchOperationType) {
-        self.currentType = operateType
-    }
-    
-    func switchToConvertType(_ convertType: KMConvertWithPDFType) {
-        if self.currentType == .Convert {
-            self.convertViewController?.switchToConvertType(convertType)
-        }
-    }
-    
-    func watermarkInterfaceSelectWatermark(_ watermark: KMWatermarkModel) {
-        if self.currentType == .AddWatermark {
-
-        }
-    }
-    
-    func backgroundInterfaceSelectBackground(_ background: KMBackgroundModel) {
-        if self.currentType == .AddBackground {
-
-        }
-    }
-    
-    func headerFooterInterfaceSelectHeaderFooter(_ headerFooter: KMHeaderFooterModel) {
-        if self.currentType == .AddHeaderFooter {
-         }
-    }
-    
-    func batesInterfaceSelectBates(_ headerFooter: KMHeaderFooterModel) {
-        if self.currentType == .AddBates {
-         }
-    }
-}

+ 0 - 22
PDF Office/PDF Master/KMClass/ImageToPDF/Base/KMBatchOperateRightViewController.xib

@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22154" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
-    <dependencies>
-        <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22154"/>
-        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
-    </dependencies>
-    <objects>
-        <customObject id="-2" userLabel="File's Owner" customClass="KMBatchOperateRightViewController">
-            <connections>
-                <outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
-            </connections>
-        </customObject>
-        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
-        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
-        <customView id="Hz6-mo-xeY">
-            <rect key="frame" x="0.0" y="0.0" width="480" height="272"/>
-            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
-            <point key="canvasLocation" x="4" y="120"/>
-        </customView>
-    </objects>
-</document>

+ 0 - 64
PDF Office/PDF Master/KMClass/ImageToPDF/Base/KMBatchOperateSplitViewController.swift

@@ -1,64 +0,0 @@
-//
-//  KMBatchOperateSplitViewController.swift
-//  PDF Reader Pro
-//
-//  Created by kdanmobile on 2023/10/26.
-//
-
-import Cocoa
-
-class KMBatchOperateSplitViewController: NSSplitViewController{
-    var leftFileListViewController: KMBatchOperateLeftViewController?
-    var rightPropertiesViewController: KMBatchOperateRightViewController?
-    
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        self.leftFileListViewController = KMBatchOperateLeftViewController()
-        self.rightPropertiesViewController = KMBatchOperateRightViewController()
-        let item1 = NSSplitViewItem(viewController: self.leftFileListViewController!)
-        let item2 = NSSplitViewItem(viewController: self.rightPropertiesViewController!)
-        item1.minimumThickness = 400
-        item2.minimumThickness = 270
-        item2.maximumThickness = 270
-        self.addSplitViewItem(item1)
-        self.addSplitViewItem(item2)
-        self.addNewTrackingArea()
-    }
-    
-    func addNewTrackingArea() {
-        let trackingArea = NSTrackingArea(rect: self.view.frame, options: [.mouseEnteredAndExited, .inVisibleRect, .activeAlways, .mouseMoved], owner: self, userInfo: nil)
-        self.view.addTrackingArea(trackingArea)
-    }
-    
-    func switchToOperateType(operateType: KMBatchOperationType, files: [KMBatchOperateFile]) {
-        self.leftFileListViewController?.switchToOperateType(operateType, files: files)
-        self.rightPropertiesViewController?.switchToOperateType(operateType: operateType, files: files )
-    }
-    func checkNeedPasswordSwitchToOperateType(_ operateType: KMBatchOperationType, files: [KMBatchOperateFile]) {
-        self.leftFileListViewController?.checkNeedPasswordSwitchToOperateType(operateType, files: files)
-        self.rightPropertiesViewController?.switchToOperateType(operateType: operateType, files: files)
-    }
-    func switchToOperateType(_ operateType: KMBatchOperationType) {
-        self.rightPropertiesViewController?.files = self.leftFileListViewController?.files ?? []
-        self.leftFileListViewController!.switchToOperateType(operateType)
-        self.rightPropertiesViewController!.switchToOperateType(operateType: operateType)
-    }
-    func switchToConvertType(_ convertType: KMConvertWithPDFType) {
-        self.rightPropertiesViewController?.files = self.leftFileListViewController?.files ?? []
-        self.leftFileListViewController!.reloadConvertInterface(withType: convertType)
-        self.rightPropertiesViewController!.switchToConvertType(convertType)
-    }
-    func watermarkInterfaceSelectWatermark(_ watermark: KMWatermarkModel) {
-        
-        
-    }
-    func backgroundInterfaceSelectBackground(_ background: KMBackgroundModel) {
-        self.rightPropertiesViewController?.backgroundInterfaceSelectBackground(background)
-    }
-    func headerFooterInterfaceSelectHeaderFooter(_ headerFooter: KMHeaderFooterModel) {
-        self.rightPropertiesViewController?.headerFooterInterfaceSelectHeaderFooter(headerFooter)
-    }
-    func batesInterfaceSelectBates(_ headerFooter: KMHeaderFooterModel) {
-        self.rightPropertiesViewController?.batesInterfaceSelectBates(headerFooter)
-    }
-}

+ 0 - 32
PDF Office/PDF Master/KMClass/ImageToPDF/Base/KMBatchOperateSplitViewController.xib

@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22155" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
-    <dependencies>
-        <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22155"/>
-        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
-    </dependencies>
-    <objects>
-        <customObject id="-2" userLabel="File's Owner" customClass="KMBatchOperateSplitViewController">
-            <connections>
-                <outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
-            </connections>
-        </customObject>
-        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
-        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
-        <customView id="Hz6-mo-xeY">
-            <rect key="frame" x="0.0" y="0.0" width="345" height="77"/>
-            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
-            <point key="canvasLocation" x="54.5" y="21.5"/>
-        </customView>
-        <progressIndicator wantsLayer="YES" maxValue="100" indeterminate="YES" controlSize="small" style="spinning" id="cHA-ap-xhe">
-            <rect key="frame" x="0.0" y="0.0" width="16" height="16"/>
-            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
-            <point key="canvasLocation" x="-88" y="252"/>
-        </progressIndicator>
-        <progressIndicator wantsLayer="YES" maxValue="100" doubleValue="65" controlSize="small" style="spinning" id="4AN-28-vbF">
-            <rect key="frame" x="0.0" y="0.0" width="16" height="16"/>
-            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
-            <point key="canvasLocation" x="45" y="256"/>
-        </progressIndicator>
-    </objects>
-</document>

+ 0 - 583
PDF Office/PDF Master/KMClass/ImageToPDF/Base/KMBatchOperateWindowController.swift

@@ -1,583 +0,0 @@
-//
-//  KMBatchOperateWindowController.swift
-//  PDF Reader Pro
-//
-//  Created by kdanmobile on 2023/10/24.
-//
-
-import Cocoa
-import PDFKit
-
-let kBatchOperateToolbarIdentifier = "kBatchOperateToolbarIdentifier"
-
-let kBatchOperateToolbar_ConvertIdentifier = "kBatchOperateToolbar_ConvertIdentifier"
-let kBatchOperateToolbar_MergeIdentifier = "kBatchOperateToolbar_MergeIdentifier"
-let kBatchOperateToolbar_CompressIdentifier = "kBatchOperateToolbar_CompressIdentifier"
-let kBatchOperateToolbar_OCRIdentifier = "kBatchOperateToolbar_OCRIdentifier"
-let kBatchOperateToolbar_SecurityIdentifier = "kBatchOperateToolbar_SecurityIdentifier"
-let kBatchOperateToolbar_WatermarkIdentifier = "kBatchOperateToolbar_WatermarkIdentifier"
-
-let kBatchOperateToolbar_BackgroundIdentifier = "kBatchOperateToolbar_BackgroundIdentifier"
-let kBatchOperateToolbar_HeadFooterIdentifier = "kBatchOperateToolbar_HeadFooterIdentifier"
-let kBatchOperateToolbar_BatesIdentifier = "kBatchOperateToolbar_BatesIdentifier"
-
-
-@objcMembers final class KMBatchOperateWindowController: KMBatchOperateBaseWindowController, NSWindowDelegate, KMCustomButtonViewPopDelegate, KMCustomButtonViewPopDataSource, NSToolbarDelegate{
-    func numberOfLine(in button: KMCustomViewButton) -> Int {
-        return 2
-    }
-    
-    func string(for button: KMCustomViewButton, index: Int) -> String? {
-        if button.isEqual(self.convertToolbarItemView) {
-            if index == 0 {
-                return NSLocalizedString("Create PDF", comment: "")
-            } else {
-                return NSLocalizedString("Export to other format", comment: "")
-            }
-        } else if button.isEqual(self.securityToolbarItemView) {
-            if index == 0 {
-                return NSLocalizedString("Set Passwords", comment: "")
-            } else {
-                return NSLocalizedString("Remove Security", comment: "")
-            }
-        } else if button.isEqual(self.watermarkToolbarItemView) {
-            if index == 0 {
-                return NSLocalizedString("Add Watermark", comment: "")
-            } else {
-                return NSLocalizedString("Remove Watermark", comment: "")
-            }
-        } else if button.isEqual(self.backgroundToolbarItemView) {
-            if index == 0 {
-                return NSLocalizedString("Add Background", comment: "")
-            } else {
-                return NSLocalizedString("Remove Background", comment: "")
-            }
-        } else if button.isEqual(self.headerfooterToolbarItemView) {
-            if index == 0 {
-                return NSLocalizedString("Add Header & Footer", comment: "")
-            } else {
-                return NSLocalizedString("Remove Header & Footer", comment: "")
-            }
-        } else if button.isEqual(self.batesToolbarItemView) {
-            if index == 0 {
-                return NSLocalizedString("Add Bates Numbers", comment: "")
-            } else {
-                return NSLocalizedString("Remove Bates Numbers", comment: "")
-            }
-        }
-        return ""
-    }
-    
-    func needInsertSeperateLine(_ button: KMCustomViewButton, index: Int) -> Bool {
-        return false
-    }
-    
-    func needHightLightLine(_ button: KMCustomViewButton, index: Int) -> Bool {
-        if button.isEqual(self.convertToolbarItemView) {
-            if index == 0 {
-                if self.operateType == .CreatePDF {
-                    return true
-                }
-            } else if index == 1 {
-                if self.operateType == .Convert {
-                    return true
-                }
-            }
-        } else if button.isEqual(self.securityToolbarItemView) {
-            if index == 0 {
-                if self.operateType == .AddPassword {
-                    return true
-                }
-            } else if index == 1 {
-                if self.operateType == .RemovePassword {
-                    return true
-                }
-            }
-        } else if button.isEqual(self.watermarkToolbarItemView) {
-            if index == 0 {
-                if self.operateType == .AddWatermark {
-                    return true
-                }
-            } else if index == 1 {
-                if self.operateType == .RemoveWatermark {
-                    return true
-                }
-            }
-        } else if button.isEqual(self.backgroundToolbarItemView) {
-            if index == 0 {
-                if self.operateType == .AddBackground {
-                    return true
-                }
-            } else if index == 1 {
-                if self.operateType == .RemoveBackground {
-                    return true
-                }
-            }
-        } else if button.isEqual(self.headerfooterToolbarItemView) {
-            if index == 0 {
-                if self.operateType == .AddHeaderFooter {
-                    return true
-                }
-            } else if index == 1 {
-                if self.operateType == .RemoveHeaderFooter {
-                    return true
-                }
-            }
-        } else if button.isEqual(self.batesToolbarItemView) {
-            if index == 0 {
-                if self.operateType == .AddBates {
-                    return true
-                }
-            } else if index == 1 {
-                if self.operateType == .RemoveBates {
-                    return true
-                }
-            }
-        }
-        return false
-    }
-    
-    func customViewButton(_ button: KMCustomViewButton, didSelectIndex index: Int) {
-        if button.isEqual(self.convertToolbarItemView) {
-            if index == 0 {
-                self.createPDF(sender: "")
-            } else if index == 1 {
-                self.convertPDFToOtherFormat(sender: "")
-            }
-        } else if button.isEqual(self.securityToolbarItemView) {
-            if index == 0 {
-                self.setPDFPassword(sender: "")
-            } else if index == 1 {
-                self.removePDFPassword(sender: "")
-            }
-        } else if button.isEqual(self.watermarkToolbarItemView) {
-            if index == 0 {
-                self.addWatermark(sender: "")
-            } else if index == 1 {
-                self.removeWatermark(sender: "")
-            }
-        } else if button.isEqual(self.backgroundToolbarItemView) {
-            if index == 0 {
-                self.addBackgroud(sender: "")
-            } else if index == 1 {
-                self.removeBackground(sender: "")
-            }
-        } else if button.isEqual(self.headerfooterToolbarItemView) {
-            if index == 0 {
-                self.addHeaderFooter(sender: "")
-            } else if index == 1 {
-                self.removeHeaderFooter(sender: "")
-            }
-        } else if button.isEqual(self.batesToolbarItemView) {
-            if index == 0 {
-                self.addBates(sender: "")
-            } else if index == 1 {
-                self.removeBates(sender: "")
-            }
-        }
-    }
-    
-
-    lazy var convertToolbarItemView: KMCustomViewButton = {
-        let item = KMCustomViewButton.init(frontImage: NSImage(named: "KMImageNameUXIconBatchConvert"), backImage: nil, title: NSLocalizedString("Convert", comment: ""), type: .batchToolbar)
-        item.addTarget(self, action: #selector(convertPDFToOtherFormat(sender:)))
-        self.window?.contentView?.addSubview(item)
-        return item
-    }()
-    lazy var mergeToolbarItemView: KMCustomViewButton = {
-        let item = KMCustomViewButton.init(frontImage: NSImage(named: "KMImageNameUXIconBatchMerge"), backImage: nil, title: NSLocalizedString("Merge", comment: ""), type: .batchToolbar)
-        item.addTarget(self, action: #selector(merge(sender:)))
-        self.window?.contentView?.addSubview(item)
-        return item
-    }()
-    lazy var compressToolbarItemView: KMCustomViewButton = {
-        let item = KMCustomViewButton.init(frontImage: NSImage(named: "KMImageNameUXIconBatchOptimize"), backImage: nil, title: NSLocalizedString("Compress", comment: ""), type: .batchToolbar)
-        item.addTarget(self, action: #selector(compress(sender:)))
-        self.window?.contentView?.addSubview(item)
-        return item
-    }()
-    lazy var ocrToolbarItemView: KMCustomViewButton = {
-        let item = KMCustomViewButton.init(frontImage: NSImage(named: "KMImageNameUXIconBatchConvertOCR"), backImage: nil, title: NSLocalizedString("OCR", comment: ""), type: .batchToolbar)
-        item.addTarget(self, action: #selector(ocr(sender:)))
-        self.window?.contentView?.addSubview(item)
-        return item
-    }()
-    lazy var securityToolbarItemView: KMCustomViewButton = {
-        let item = KMCustomViewButton.init(frontImage: NSImage(named: "KMImageNameUXIconBatchSafe"), backImage: NSImage(named: "KMImageNameUXIconBtnTriDownNor"), title: NSLocalizedString("Security", comment: ""), type: .batchToolbar)
-        item.delegate = self
-        item.dataSource = self
-        self.window?.contentView?.addSubview(item)
-        
-        item.mas_makeConstraints { make in
-            make?.center.equalTo()(self.window?.contentView)
-        }
-        return item
-    }()
-    
-    lazy var watermarkToolbarItemView: KMCustomViewButton = {
-        let item = KMCustomViewButton.init(frontImage: NSImage(named: "KMImageNameUXIconBatchWatermark"), backImage: NSImage(named: "KMImageNameUXIconBtnTriDownNor"), title: NSLocalizedString("Watermark", comment: ""), type: .batchToolbar)
-        item.delegate = self
-        item.dataSource = self
-        self.window?.contentView?.addSubview(item)
-        item.mas_makeConstraints { make in
-            make?.center.equalTo()(self.window?.contentView)
-        }
-        return item
-    }()
-    
-    lazy var backgroundToolbarItemView: KMCustomViewButton = {
-        let item = KMCustomViewButton.init(frontImage: NSImage(named: "KMImageNameUXIconBatchBackground"), backImage: NSImage(named: "KMImageNameUXIconBtnTriDownNor"), title: NSLocalizedString("Background", comment: ""), type: .batchToolbar)
-        item.delegate = self
-        item.dataSource = self
-        self.window?.contentView?.addSubview(item)
-        item.mas_makeConstraints { make in
-            make?.center.equalTo()(self.window?.contentView)
-        }
-        return item
-    }()
-    
-    lazy var headerfooterToolbarItemView: KMCustomViewButton = {
-        let item = KMCustomViewButton.init(frontImage: NSImage(named: "KMImageNameUXIconBatchHeaderandfooter"), backImage: NSImage(named: "KMImageNameUXIconBtnTriDownNor"), title: NSLocalizedString("Header & Footer", comment: ""), type: .batchToolbar)
-        item.delegate = self
-        item.dataSource = self
-        self.window?.contentView?.addSubview(item)
-        item.mas_makeConstraints { make in
-            make?.center.equalTo()(self.window?.contentView)
-        }
-        return item
-    }()
-    
-    lazy var batesToolbarItemView: KMCustomViewButton = {
-        let item = KMCustomViewButton.init(frontImage: NSImage(named: "KMImageNameUXIconBatchBates"), backImage: NSImage(named: "KMImageNameUXIconBtnTriDownNor"), title: NSLocalizedString("Bates Numbers", comment: ""), type: .batchToolbar)
-        item.delegate = self
-        item.dataSource = self
-        self.window?.contentView?.addSubview(item)
-        item.mas_makeConstraints { make in
-            make?.center.equalTo()(self.window?.contentView)
-        }
-        return item
-    }()
-    lazy var toolbarItemViews: NSMutableArray = {
-        let arr = [self.convertToolbarItemView,
-                   self.mergeToolbarItemView,
-                   self.compressToolbarItemView,
-                   self.ocrToolbarItemView,
-                   self.securityToolbarItemView,
-                   self.watermarkToolbarItemView,
-                   self.backgroundToolbarItemView,
-                   self.headerfooterToolbarItemView,
-                   self.batesToolbarItemView
-        ]
-        return NSMutableArray(array: arr)
-    }()
-    
-    override var operateType: KMBatchOperationType?{
-        willSet{
-            
-        }
-        didSet {
-            if operateType == oldValue{
-                return
-            }else{
-                super.operateType = operateType
-            }
-            for i in 0..<self.toolbarItemViews.count {
-                let btn = self.toolbarItemViews[i] as! KMCustomViewButton 
-                btn.isSelected = false
-            }
-            switch operateType {
-            case .CreatePDF:
-                self.convertToolbarItemView.isSelected = true
-            case .Convert:
-                self.convertToolbarItemView.isSelected = true
-            case .Merge:
-                self.mergeToolbarItemView.isSelected = true
-            case .Compress:
-                self.compressToolbarItemView.isSelected = true
-            case .OCR:
-                self.ocrToolbarItemView.isSelected = true
-            case .AddPassword,.RemovePassword:
-                self.securityToolbarItemView.isSelected = true
-            case .AddWatermark,.RemoveWatermark:
-                self.watermarkToolbarItemView.isSelected = true
-            case .AddBackground,.RemoveBackground:
-                self.backgroundToolbarItemView.isSelected = true
-            case .AddHeaderFooter,.RemoveHeaderFooter:
-                self.headerfooterToolbarItemView.isSelected = true
-            case .AddBates,.RemoveBates:
-                self.batesToolbarItemView.isSelected = true
-            default :
-                self.convertToolbarItemView.isSelected = true
-            }
-            (self.contentViewController as! KMBatchOperateSplitViewController).switchToOperateType(operateType!)
-        }
-    }
-   
-    static let sharedWindowController: KMBatchOperateWindowController = {
-        let wc = KMBatchOperateWindowController(windowNibName: "KMBatchOperateWindowController")
-        let actualWindow = wc.window as! KMBatchWindow
-        actualWindow.isBatch = true
-        
-        wc.switchToOperateType(.Convert, files:KMBatchOperateManager.defaultManager.files!)
-        
-        wc.switchToConvertType(convertType: IAPProductsManager.default().isAvailableAdvancedPDFToOffice() ? .WordAdvance : .WordStandard)
-        
-        wc.updateViewColor()
-        
-        return wc
-    }()
-    
-    override func switchToOperateType(_ operateType: KMBatchOperationType, files: [KMBatchOperateFile]) {
-        super.switchToOperateType(operateType, files: files)
-        self.operateType = operateType
-    }
-    
-    func updateViewColor() {
-        var color = NSColor(red: 0.149, green: 0.157, blue: 0.169, alpha: 1)
-        if KMAppearance.isDarkMode() {
-            color = NSColor(red: 0.149, green: 0.157, blue: 0.169, alpha: 1)
-        } else {
-            color = NSColor(red: 0.988, green: 0.992, blue: 1.0, alpha: 1)
-        }
-        if let themeView = self.window?.contentView?.superview {
-            for subView in themeView.subviews {
-                if NSStringFromClass(type(of: subView)) == "NSTitlebarContainerView" {
-                    subView.layer?.backgroundColor = color.cgColor
-                    break
-                }
-            }
-        }
-    }
-    
-    func windowShouldClose(_ sender: NSWindow) -> Bool {
-        if self.operateType == .Compress {
-            let vc: KMBatchOperateRightViewController = (self.contentViewController as! KMBatchOperateSplitViewController).rightPropertiesViewController!
-            let compress = vc.compressViewController
-            var begin = false
-            for info in compress!.files! {
-                if info.status == KMBatchOperateStatus.processing {
-                    begin = true
-                    break
-                }
-            }
-            if begin {
-                let alert = NSAlert()
-                alert.alertStyle = .critical
-                alert.messageText = NSLocalizedString("Do you want to cancel compressing?", comment: "")
-                alert.informativeText = NSLocalizedString("Documents which have been compressed will still be retained.", comment: "")
-                alert.addButton(withTitle: NSLocalizedString("Cancel Compressing", comment: ""))
-                alert.addButton(withTitle: NSLocalizedString("Continue compressing", comment: ""))
-                alert.beginSheetModal(for: self.window!, completionHandler: { (response) in
-                    if response == .alertFirstButtonReturn {
-                        compress!.cancelBatchOperation()
-                        self.close()
-                    } else if response == .alertSecondButtonReturn {
-                        compress!.beginBatchOperation()
-                    }
-                })
-                return false
-            }
-        }
-        return true
-    }
-    
-    override func windowDidLoad() {
-        super.windowDidLoad()
-        if #available(macOS 11.0, *) {
-            self.window?.toolbarStyle = NSWindow.ToolbarStyle.expanded
-        }
-        self.updateViewColor()
-        self.window?.titlebarAppearsTransparent = true
-        //        self.toolbarItemViews
-        DispatchQueue.main.async {
-            self.configuToolbar()
-        }
-//        NotificationCenter.default.addObserver(self, selector: #selector(themeChanged(notification:)), name: NSNotification.Name("AppleInterfaceThemeChangedNotification"), object: nil)
-        DistributedNotificationCenter.default().addObserver(self, selector: #selector(themeChanged(notification:)), name: NSNotification.Name("AppleInterfaceThemeChangedNotification"), object: nil)
-    }
-    @objc func themeChanged(notification: NSNotification) {
-        DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
-            self.updateViewColor()
-        }
-    }
-    
-    func configuToolbar() {
-        let toolbar = NSToolbar(identifier: kBatchOperateToolbarIdentifier)
-        toolbar.delegate = self
-        self.window?.toolbar = toolbar
-        toolbar.allowsUserCustomization = false
-        toolbar.displayMode = .iconOnly
-    }
-    
-    @objc func convertPDFToOtherFormat(sender: Any) {
-        self.operateType = .Convert
-    }
-    
-    @objc func createPDF(sender: Any) {
-        self.operateType = .CreatePDF
-    }
-    
-    @objc func merge(sender: Any) {
-        self.operateType = .Merge
-    }
-    
-    @objc func compress(sender: Any) {
-        self.operateType = .Compress
-    }
-    
-    @objc func ocr(sender: Any) {
-        self.operateType = .OCR
-    }
-    @objc func setPDFPassword(sender: Any) {
-        self.operateType = .AddPassword
-    }
-    @objc func removePDFPassword(sender: Any) {
-        self.operateType = .RemovePassword
-    }
-    @objc func addWatermark(sender: Any) {
-        self.operateType = .AddWatermark
-    }
-    @objc func removeWatermark(sender: Any) {
-        self.operateType = .RemoveWatermark
-    }
-    @objc func addBackgroud(sender: Any) {
-        self.operateType = .AddBackground
-    }
-    @objc func removeBackground(sender: Any) {
-        self.operateType = .RemoveBackground
-    }
-    @objc func addHeaderFooter(sender: Any) {
-        self.operateType = .AddHeaderFooter
-    }
-    @objc func removeHeaderFooter(sender: Any) {
-        self.operateType = .RemoveHeaderFooter
-    }
-    @objc func addBates(sender: Any) {
-        self.operateType = .AddBates
-    }
-    @objc func removeBates(sender: Any) {
-        self.operateType = .RemoveBates
-    }
-    
-    func toolbarAllowedItemIdentifiers(_ toolbar: NSToolbar) -> [NSToolbarItem.Identifier] {
-        let arr = [NSToolbarItem.Identifier.flexibleSpace,
-                   NSToolbarItem.Identifier(rawValue: kBatchOperateToolbar_ConvertIdentifier),
-                   NSToolbarItem.Identifier.flexibleSpace,
-                   NSToolbarItem.Identifier(rawValue: kBatchOperateToolbar_CompressIdentifier),
-                   NSToolbarItem.Identifier.flexibleSpace,
-                   NSToolbarItem.Identifier(rawValue: kBatchOperateToolbar_SecurityIdentifier),
-                   NSToolbarItem.Identifier.flexibleSpace,
-                   NSToolbarItem.Identifier(rawValue: kBatchOperateToolbar_WatermarkIdentifier),
-                   NSToolbarItem.Identifier.flexibleSpace,
-                   NSToolbarItem.Identifier(rawValue: kBatchOperateToolbar_BackgroundIdentifier),
-                   NSToolbarItem.Identifier.flexibleSpace,
-                   NSToolbarItem.Identifier(rawValue: kBatchOperateToolbar_HeadFooterIdentifier),
-                   NSToolbarItem.Identifier.flexibleSpace,
-                   NSToolbarItem.Identifier(rawValue: kBatchOperateToolbar_BatesIdentifier),
-                   NSToolbarItem.Identifier.flexibleSpace
-        ]
-        return arr
-    }
-    func toolbarDefaultItemIdentifiers(_ toolbar: NSToolbar) -> [NSToolbarItem.Identifier] {
-        let arr = [
-            NSToolbarItem.Identifier(rawValue: kBatchOperateToolbar_ConvertIdentifier),
-            NSToolbarItem.Identifier(rawValue: kBatchOperateToolbar_CompressIdentifier),
-            NSToolbarItem.Identifier(rawValue: kBatchOperateToolbar_SecurityIdentifier),
-            NSToolbarItem.Identifier(rawValue: kBatchOperateToolbar_WatermarkIdentifier),
-            NSToolbarItem.Identifier(rawValue: kBatchOperateToolbar_BackgroundIdentifier),
-            NSToolbarItem.Identifier(rawValue: kBatchOperateToolbar_HeadFooterIdentifier),
-            NSToolbarItem.Identifier(rawValue: kBatchOperateToolbar_BatesIdentifier)
-        ]
-        return arr
-    }
-    func toolbar(_ toolbar: NSToolbar, itemForItemIdentifier itemIdentifier: NSToolbarItem.Identifier, willBeInsertedIntoToolbar flag: Bool) -> NSToolbarItem? {
-        let item = NSToolbarItem(itemIdentifier: itemIdentifier)
-        if itemIdentifier.rawValue == kBatchOperateToolbar_ConvertIdentifier {
-            item.view = self.convertToolbarItemView
-            item.toolTip = NSLocalizedString("Convert", comment: "")
-            let menuItem = NSMenuItem(title: NSLocalizedString("Convert", comment: ""), action: #selector(convertPDFToOtherFormat(sender:)), keyEquivalent: "")
-            menuItem.target = self
-            item.menuFormRepresentation = menuItem
-        } else if itemIdentifier.rawValue == kBatchOperateToolbar_MergeIdentifier {
-            item.view = self.mergeToolbarItemView
-            item.toolTip = NSLocalizedString("Merge", comment: "")
-            let menuItem = NSMenuItem(title: NSLocalizedString("Merge", comment: ""), action: #selector(merge(sender:)), keyEquivalent: "")
-            menuItem.target = self
-            item.menuFormRepresentation = menuItem
-        } else if itemIdentifier.rawValue == kBatchOperateToolbar_CompressIdentifier {
-            item.view = self.compressToolbarItemView
-            item.toolTip = NSLocalizedString("Compress", comment: "")
-            let menuItem = NSMenuItem(title: NSLocalizedString("Compress", comment: ""), action: #selector(compress(sender:)), keyEquivalent: "")
-            menuItem.target = self
-            item.menuFormRepresentation = menuItem
-        } else if itemIdentifier.rawValue == kBatchOperateToolbar_OCRIdentifier {
-            item.view = self.ocrToolbarItemView
-            item.toolTip = NSLocalizedString("OCR", comment: "")
-            let menuItem = NSMenuItem(title: NSLocalizedString("OCR", comment: ""), action: #selector(ocr(sender:)), keyEquivalent: "")
-            menuItem.target = self
-            item.menuFormRepresentation = menuItem
-        } else if itemIdentifier.rawValue == kBatchOperateToolbar_SecurityIdentifier {
-            item.view = self.securityToolbarItemView
-            let menuItem = NSMenuItem(title: NSLocalizedString("Security", comment: ""), action: nil, keyEquivalent: "")
-            let menu = NSMenu()
-            menu.addItem(withTitle: NSLocalizedString("Set Passwords", comment: ""), action: #selector(setPDFPassword(sender:)), keyEquivalent: "")
-            menu.addItem(withTitle: NSLocalizedString("Remove Security", comment: ""), action: #selector(removePDFPassword(sender:)), keyEquivalent: "")
-            menuItem.submenu = menu
-            menuItem.target = self
-            item.menuFormRepresentation = menuItem
-        } else if itemIdentifier.rawValue == kBatchOperateToolbar_WatermarkIdentifier {
-            item.view = self.watermarkToolbarItemView
-            let menuItem = NSMenuItem(title: NSLocalizedString("Watermark", comment: ""), action: nil, keyEquivalent: "")
-            let menu = NSMenu()
-            menu.addItem(withTitle: NSLocalizedString("Add Watermark", comment: ""), action: #selector(addWatermark(sender:)), keyEquivalent: "")
-            menu.addItem(withTitle: NSLocalizedString("Remove Watermark", comment: ""), action: #selector(removeWatermark(sender:)), keyEquivalent: "")
-            menuItem.submenu = menu
-            menuItem.target = self
-            item.menuFormRepresentation = menuItem
-        } else if itemIdentifier.rawValue == kBatchOperateToolbar_BackgroundIdentifier {
-            item.view = self.backgroundToolbarItemView
-            let menuItem = NSMenuItem(title: NSLocalizedString("Background", comment: ""), action: nil, keyEquivalent: "")
-            let menu = NSMenu()
-            menu.addItem(withTitle: NSLocalizedString("Add Background", comment: ""), action: #selector(addBackgroud(sender:)), keyEquivalent: "")
-            menu.addItem(withTitle: NSLocalizedString("Remove Background", comment: ""), action: #selector(removeBackground(sender:)), keyEquivalent: "")
-            menuItem.submenu = menu
-            menuItem.target = self
-            item.menuFormRepresentation = menuItem
-        } else if itemIdentifier.rawValue == kBatchOperateToolbar_HeadFooterIdentifier {
-            item.view = self.headerfooterToolbarItemView
-            let menuItem = NSMenuItem(title: NSLocalizedString("Header & Footer", comment: ""), action: nil, keyEquivalent: "")
-            let menu = NSMenu()
-            menu.addItem(withTitle: NSLocalizedString("Add Header & Footer", comment: ""), action: #selector(addHeaderFooter(sender:)), keyEquivalent: "")
-            menu.addItem(withTitle: NSLocalizedString("Remove Header & Footer", comment: ""), action: #selector(removeHeaderFooter(sender:)), keyEquivalent: "")
-            menuItem.submenu = menu
-            menuItem.target = self
-            item.menuFormRepresentation = menuItem
-        } else if itemIdentifier.rawValue == kBatchOperateToolbar_BatesIdentifier {
-            item.view = self.batesToolbarItemView
-            let menuItem = NSMenuItem(title: NSLocalizedString("Bates Numbers", comment: ""), action: nil, keyEquivalent: "")
-            let menu = NSMenu()
-            menu.addItem(withTitle: NSLocalizedString("Add Bates Numbers", comment: ""), action: #selector(addBates(sender:)), keyEquivalent: "")
-            menu.addItem(withTitle: NSLocalizedString("Remove Bates Numbers", comment: ""), action: #selector(removeBates(sender:)), keyEquivalent: "")
-            menuItem.submenu = menu
-            menuItem.target = self
-            item.menuFormRepresentation = menuItem
-        }
-        return item
-    }
-    func showIsConvertingHint() {
-        let texHintWindowController = KMTextHintWindowController(windowNibName: "KMTextHintWindowController")
-        self.window?.beginSheet(texHintWindowController.window!)
-    }
-    func windowDidBecomeKey(_ notification: Notification) {
-        for i in 0..<self.toolbarItemViews.count {
-            var btn = self.toolbarItemViews[i] as! KMCustomViewButton
-            btn.enable = true
-        }
-    }
-    func windowDidResignKey(_ notification: Notification) {
-        for i in 0..<self.toolbarItemViews.count {
-            let btn = self.toolbarItemViews[i] as! KMCustomViewButton
-            btn.enable = false
-        }
-    }
-}

+ 0 - 32
PDF Office/PDF Master/KMClass/ImageToPDF/Base/KMBatchOperateWindowController.xib

@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
-    <dependencies>
-        <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
-        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
-    </dependencies>
-    <objects>
-        <customObject id="-2" userLabel="File's Owner" customClass="KMBatchOperateWindowController">
-            <connections>
-                <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" restorable="NO" releasedWhenClosed="NO" animationBehavior="default" id="F0z-JX-Cv5" customClass="KMBatchWindow" customModule="PDF_Reader_Pro" customModuleProvider="target">
-            <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
-            <rect key="contentRect" x="463" y="248" width="880" height="600"/>
-            <rect key="screenRect" x="0.0" y="0.0" width="1440" height="875"/>
-            <value key="minSize" type="size" width="880" height="600"/>
-            <value key="minFullScreenContentSize" type="size" width="880" height="600"/>
-            <view key="contentView" id="se5-gp-TjO">
-                <rect key="frame" x="0.0" y="0.0" width="880" height="600"/>
-                <autoresizingMask key="autoresizingMask"/>
-            </view>
-            <connections>
-                <outlet property="delegate" destination="-2" id="0bl-1N-AYu"/>
-            </connections>
-            <point key="canvasLocation" x="49" y="110"/>
-        </window>
-    </objects>
-</document>

+ 0 - 746
PDF Office/PDF Master/KMClass/ImageToPDF/Controller/KMBatchOperateImageToPDFViewController.swift

@@ -1,746 +0,0 @@
-//
-//  KMBatchOperateImageToPDFViewController.swift
-//  PDF Reader Pro
-//
-//  Created by liujiajie on 2023/12/5.
-//
-
-import Cocoa
-import KMComponentLibrary
-
-class KMBatchOperateImageToPDFViewController: KMBatchOperateBaseViewController {
-    @IBOutlet weak var headerBox: NSBox!
-    @IBOutlet weak var titleLabel: NSTextField!
-    @IBOutlet weak var headerBottomLine: ComponentDivider!
-    
-    @IBOutlet var outputTypeLabel: NSTextField!
-    @IBOutlet var ocrLabel: NSTextField!
-    
-    @IBOutlet weak var newPDFBox: NSBox!
-    @IBOutlet weak var mergeAllBox: NSBox!
-    @IBOutlet weak var appendBox: NSBox!
-    @IBOutlet weak var appendBackBox: NSBox!
-    
-    @IBOutlet weak var ocrSelectBox: NSBox!
-    @IBOutlet weak var languageBox: NSBox!
-    @IBOutlet weak var ocrPlanBox: NSBox!
-    @IBOutlet weak var ocrPlan2Box: NSBox!
-    @IBOutlet weak var hLine: NSView!
-    @IBOutlet weak var extractTextBox: NSBox!
-    
-    @IBOutlet weak var bottomBox: NSBox!
-    @IBOutlet weak var bottomTopLine: ComponentDivider!
-    @IBOutlet weak var applyButton: ComponentButton!
-    
-    var password: String = ""
-    
-    lazy var method: KMImageToPDFMethod = {
-        let method = KMImageToPDFMethod()
-        method.imageTopdfDelegate = self
-        return method
-    }()
-    
-    private lazy var topLine: NSView = {
-        let view = NSView()
-        view.wantsLayer = true
-        return view
-    }()
-    
-    private var createNewPDFRadio_: ComponentRadio = {
-        let view = ComponentRadio()
-        view.properties = ComponentCheckBoxProperty(size: .s, state: .normal,  isDisabled: false, showhelp: false, text: KMLocalizedString("New PDF Document", comment: ""), checkboxType: .normal)
-        return view
-    }()
-    
-    private lazy var mergeAllCheckBox_: ComponentCheckBox = {
-        let view = ComponentCheckBox()
-        view.properties = ComponentCheckBoxProperty(size: .s, state: .normal,   isDisabled: false, showhelp: false, text: KMLocalizedString("Merge All", comment: ""),checkboxType: .normal)
-        return view
-    }()
-    
-    private var appendRadio_: ComponentRadio = {
-        let view = ComponentRadio()
-        view.properties = ComponentCheckBoxProperty(size: .s, state: .normal, isDisabled: false, showhelp: false, text: KMLocalizedString("Append To Existing File", comment: ""), checkboxType: .normal)
-        return view
-    }()
-    
-    private var appendBackInput: ComponentInputWithAddon = {
-        let view = ComponentInputWithAddon()
-        view.properties = ComponentInputWithAddonProperty(size: .s, isDisabled: true, addonType: .button)
-        return view
-    }()
-    
-    private lazy var appendBackInput_: ComponentInput = {
-        let view = ComponentInput()
-        return view
-    }()
-    
-    private lazy var appendBackButtonInput_: ComponentInputAddon = {
-        let view = ComponentInputAddon()
-        return view
-    }()
-    
-    private lazy var ocrCheckBox_: ComponentCheckBox = {
-        let view = ComponentCheckBox()
-        view.properties = ComponentCheckBoxProperty(size: .s, state: .normal, isDisabled: false, showhelp: false, text: KMLocalizedString("Recognize text if needed", comment: ""), checkboxType: .normal)
-        return view
-    }()
-    
-    private lazy var languageView_: ComponentSelect = {
-        let view = ComponentSelect()
-        
-        view.properties = ComponentSelectProperties(size: .s, state: .normal, isDisabled: false, isError: false, leftIcon: false, placeholder: nil, errorText: nil, creatable: false, text: KMLocalizedString("", comment: ""))
-        view.delegate = self
-        return view
-    }()
-    
-    private var ocrPlanRadio_: ComponentRadio = {
-        let view = ComponentRadio()
-        view.properties = ComponentCheckBoxProperty(size: .s, state: .normal, isDisabled: false, showhelp: true, text: KMLocalizedString("OCR Plan 1-Online", comment: ""), checkboxType: .normal)
-        view.toolTip = KMLocalizedString("The OCR service works via an internet connection. We would suggest you to perform OCR using a VPN connection while the service is limited.")
-        return view
-    }()
-    
-    private var ocrPlanRadio2_: ComponentRadio = {
-        let view = ComponentRadio()
-        view.properties = ComponentCheckBoxProperty(size: .s, state: .normal, isDisabled: false, showhelp: true, text: KMLocalizedString("OCR Plan 2-Online", comment: ""), checkboxType: .normal)
-        view.toolTip = KMLocalizedString("The OCR service works via an internet connection. We would suggest you to perform OCR using a VPN connection while the service is limited.")
-        return view
-    }()
-    
-    private var vLine_: ComponentDivider = {
-        let view = ComponentDivider()
-        view.properties = ComponentDividerProperty(type: .horizontal, dash: false)
-        return view
-    }()
-    
-    private lazy var extractTextCheckBox_: ComponentCheckBox = {
-        let view = ComponentCheckBox()
-        view.properties = ComponentCheckBoxProperty(size: .s, state: .normal, isDisabled: false, showhelp: false, text: KMLocalizedString("Extract Text (.txt)", comment: ""), checkboxType: .normal)
-        return view
-    }()
-    
-    override var interfaceStatus: KMBatchOperateInterfaceStatus?{
-        set{
-            super.interfaceStatus = newValue
-            if newValue == .PrepareProcess {
-                DispatchQueue.main.asyncAfter(deadline: .now() + 0.4) {
-                    let files = NSMutableArray()
-                    for url in self.successFilePathURLArray! {
-                        if FileManager.default.fileExists(atPath: url.path) {
-                            files.add(url)
-                        }
-                    }
-                    if files.count > 0 {
-                        let workspace = NSWorkspace.shared
-                        workspace.activateFileViewerSelecting(files as! [URL])
-                    }
-                }
-                self._updateActionButtonEnable(true)
-            } else {
-                self._updateActionButtonEnable(false)
-            }
-        }
-        get{
-            return super.interfaceStatus
-        }
-    }
-    
-    private func _updateActionButtonEnable(_ enabled: Bool) {
-        applyButton.properties.isDisabled = !enabled
-        applyButton.reloadData()
-    }
-    
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        
-        headerBox.borderWidth = 0
-        titleLabel.font = ComponentLibrary.shared.getFontFromKey("mac/body-m-bold")
-        createNewPDFRadio_.properties.checkboxType = .selected
-        createNewPDFRadio_.reloadData()
-        
-        appendBackBox.borderWidth = 0
-        let color = KMNColorTools.compField_colorBorderDis()
-        appendBackBox.borderColor = color
-        let inputWithAddonProperty = ComponentInputProperty(size: .s,
-                                                            state: .normal,
-                                                            isError: false,
-                                                            showPrefix: false,
-                                                            showSuffix: false,
-                                                            showClear: false,
-                                                            isDisabled: true,
-                                                            placeholder: KMLocalizedString("Select File..."),
-                                                            text: "",
-                                                            creatable: false)
-        appendBackInput_.properties = inputWithAddonProperty
-        appendBackInput_.properties.propertyInfo.cornerRadius_topRight = 0
-        appendBackInput_.properties.propertyInfo.cornerRadius_bottomRight = 0
-        appendBackInput_.properties.isDisabled = true
-        appendBackInput_.reloadData()
-        
-        appendBackButtonInput_.properties = ComponentInputAddonProperty(size: .s,
-                                                                state: .normal,
-                                                                addOnBefore: false,
-                                                                onlyRead: false,
-                                                                addonType: .imageWithColor,
-                                                                 iconImage: NSImage(named: "KMFolderIcon"))
-        appendBackButtonInput_.properties.isDisabled = true
-        appendBackButtonInput_.reloadData()
-        appendBackButtonInput_.setTarget(self, action: #selector(buttonItemClicked_AppendOtherPDF))
-        appendBackBox.contentView?.addSubview(appendBackInput_)
-        appendBackBox.contentView?.addSubview(appendBackButtonInput_)
-        let boxH: CGFloat = 30
-        appendBackInput_.frame = NSMakeRect(0, 0, 204, boxH)
-        appendBackButtonInput_.frame = NSMakeRect(NSMaxX(appendBackInput_.frame), 0, boxH+2, boxH)
-        let hView = NSView()
-        appendBackBox.contentView?.addSubview(hView)
-        hView.frame = NSMakeRect(NSMaxX(appendBackInput_.frame), 0, 1, 32)
-        hView.wantsLayer = true
-        hView.layer?.backgroundColor = color.cgColor
-        hView.isHidden = true
-        
-        ocrLabel.font = ComponentLibrary.shared.getFontFromKey("mac/body-s-medium")
-        ocrSelectBox.borderWidth = 0
-        ocrSelectBox.contentView = ocrCheckBox_
-        ocrCheckBox_.setTarget(self, action: #selector(buttonClicked_OCRSelect))
-        languageView_.properties.isDisabled = true
-        languageView_.reloadData()
-        ocrPlanRadio_.setTarget(self, action: #selector(ocrPlanAction))
-        ocrPlanRadio_.properties.isDisabled = true
-        ocrPlanRadio_.properties.checkboxType = .selected
-        ocrPlanRadio_.reloadData()
-        ocrPlanRadio2_.setTarget(self, action: #selector(ocrPlanAction))
-        ocrPlanRadio2_.properties.isDisabled = true
-        ocrPlanRadio2_.reloadData()
-        extractTextCheckBox_.properties.isDisabled = true
-        extractTextCheckBox_.reloadData()
-        
-        bottomBox.borderWidth = 0
-        applyButton.properties = ComponentButtonProperty(type: .primary, size: .m, onlyIcon: false, buttonText: KMLocalizedString("Apply"))
-        applyButton.setTarget(self, action: #selector(buttonClicked_ImageToPDF))
-        
-        view.addSubview(topLine)
-        topLine.km_add_top_constraint()
-        topLine.km_add_height_constraint(constant: 1)
-        topLine.km_add_left_constraint()
-        topLine.km_add_right_constraint()
-        
-        self.localizedLanguage()
-        self.configuUI()
-        
-        if let cnt = self.files?.count, cnt > 0 {
-            self._updateActionButtonEnable(true)
-        } else {
-            self._updateActionButtonEnable(false)
-        }
-    }
-    
-    override func addNotifations() {
-        super.addNotifations()
-        
-        NotificationCenter.default.addObserver(self, selector: #selector(batchFilesCountNotification(notification:)), name: NSNotification.Name("KMBatchFilesCountNotification"), object: nil)
-    }
-    
-    override func updateUILanguage() {
-        super.updateUILanguage()
-        
-        KMMainThreadExecute {
-            self.titleLabel.stringValue = KMLocalizedString("Image to PDF")
-            self.ocrLabel.stringValue = KMLocalizedString("Text Recognition Settings")
-        }
-    }
-    
-    override func updateUIThemeColor() {
-        super.updateUIThemeColor()
-        
-        KMMainThreadExecute {
-            self.topLine.layer?.backgroundColor = KMNColorTools.colorBorder_divider().cgColor
-            
-            let titleColor = ComponentLibrary.shared.getComponentColorFromKey("colorText/2")
-            self.titleLabel.textColor = titleColor
-            self.headerBottomLine.properties = ComponentDividerProperty()
-            self.ocrLabel.textColor = titleColor
-            self.languageBox.borderColor = KMNColorTools.compField_colorBorderDis()
-            self.bottomTopLine.properties = ComponentDividerProperty()
-            
-            self.updateViewColor()
-        }
-    }
-    
-    func localizedLanguage() {
-        self.outputTypeLabel.stringValue = KMLocalizedString("Output")
-        
-        let languages = KMGOCRManager.languages() as NSArray
-        let strings = languages.value(forKeyPath: KMGOCRLanguageStringKey) as? [String]
-        var menuItemArr: [ComponentMenuitemProperty] = []
-        for language in strings ?? [] {
-            let itemProperty: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
-                                                                                    itemSelected: false,
-                                                                                    isDisabled: false,
-                                                                                    keyEquivalent: nil,
-                                                                                    text: language)
-            menuItemArr.append(itemProperty)
-        }
-
-        languageView_.updateMenuItemsArr(menuItemArr)
-        
-        languageView_.selectItemAtIndex(0)
-        languageView_.properties.creatable = false
-        languageView_.properties.text = menuItemArr.first?.text
-        languageView_.reloadData()
-        
-        self.updateLanguageButton((KMGOCRManager.default().selectedLanguages?.value(forKeyPath: KMGOCRLanguageStringKey) as? [String]))
-        self.OCRSelectedPlanChangeAction()
-    }
-    func configuUI() {
-        self.view.wantsLayer = true
-        
-        newPDFBox.borderWidth = 0
-        newPDFBox.contentView = createNewPDFRadio_
-        createNewPDFRadio_.setTarget(self, action: #selector(buttonClicked_CreateNewPDF))
-        
-        mergeAllBox.borderWidth = 0
-        mergeAllBox.contentView = mergeAllCheckBox_
-        
-        appendBox.borderWidth = 0
-        appendBox.contentView = appendRadio_
-        appendRadio_.setTarget(self, action: #selector(buttonClicked_AppendOtherPDF))
-        
-        languageBox.borderWidth = 1
-        languageBox.cornerRadius = ComponentLibrary.shared.getComponentValueFromKey("comp-field/radius") as? CGFloat ?? 4
-        languageBox.contentView = languageView_
-        
-        ocrPlanBox.borderWidth = 0
-        ocrPlanBox.contentView?.addSubview(ocrPlanRadio_)
-        ocrPlanRadio_.km_add_leading_constraint()
-        ocrPlanRadio_.km_add_centerY_constraint()
-        ocrPlanRadio_.km_add_height_constraint(equalTo: ocrPlanBox.contentView)
-        ocrPlanRadio_.km_add_width_constraint(constant: ocrPlanRadio_.properties.propertyInfo.viewWidth + 10)
-        
-        ocrPlan2Box.borderWidth = 0
-        ocrPlan2Box.contentView?.addSubview(ocrPlanRadio2_)
-        ocrPlanRadio2_.km_add_leading_constraint()
-        ocrPlanRadio2_.km_add_centerY_constraint()
-        ocrPlanRadio2_.km_add_height_constraint(equalTo: ocrPlan2Box.contentView)
-        ocrPlanRadio2_.km_add_width_constraint(constant: ocrPlanRadio2_.properties.propertyInfo.viewWidth + 10)
-        
-        hLine.addSubview(vLine_)
-        vLine_.frame = hLine.bounds
-        vLine_.autoresizingMask = [.width, .height]
-        
-        extractTextBox.borderWidth = 0
-        extractTextBox.contentView = extractTextCheckBox_
-    }
-    
-    func updateViewColor() {
-        self.view.layer?.backgroundColor = ComponentLibrary.shared.getComponentColorFromKey("colorBg-layout-middle").cgColor
-    }
-    
-    func updateLanguageButton(_ languages: [String]?) {
-        if languages?.count ?? 0 < 1 {
-            self.languageView_.properties.text = " " + KMLocalizedString("Auto Detection")
-            self.languageView_.reloadData()
-            return
-        }
-        var languageName: String = ""
-        if languages?.count ?? 0 > 0 {
-            for i in 0..<(languages?.count ?? 0) {
-                let language = languages?[i]
-                if i == 0 {
-                    languageName = language ?? ""
-                } else {
-                    languageName = languageName.appendingFormat(",%@", language ?? "")
-                }
-            }
-        } else {
-            languageName = ""
-        }
-        
-        self.languageView_.properties.text = " " + languageName
-        self.languageView_.reloadData()
-    }
-    
-    func converArrType(arr: Array<KMBatchOperateFile>, keyString: String) -> [String] {
-        let newArr = NSMutableArray()
-        for item in arr {
-            newArr.add(item.filePath)
-        }
-        return newArr as! [String]
-    }
-    
-    func isConnectionAvailable() -> Bool {
-        if Reachability.forInternetConnection().currentReachabilityStatus().rawValue == 0 {
-            return false
-        }
-        return true
-    }
-    
-    func beginImageToPDF() {
-        if self.files?.count ?? 0 < 1 {
-            return
-        }
-        let photoArray = converArrType(arr: self.files!, keyString: "")
-        var path: String = ""
-        var isMerge = false
-        var isCreatNewPDF = false
-        var isOCR = false
-        if ocrCheckBox_.properties.checkboxType == .selected {
-            isOCR = true
-        }
-        
-        var isSaveAs = false
-        if extractTextCheckBox_.properties.checkboxType == .selected {
-            isSaveAs = true
-        }
-        
-        let plan = UserDefaults.standard.integer(forKey: "KMOCRCurrentPlanKey")
-        if isOCR && !self.isConnectionAvailable() && plan == 0 {
-            let alert = NSAlert()
-            alert.alertStyle = .critical
-            alert.messageText = KMLocalizedString("Connection Error", comment: "")
-            alert.informativeText = KMLocalizedString("Please make sure your internet connection is available.", comment: "")
-            alert.addButton(withTitle: KMLocalizedString("OK", comment: ""))
-            if alert.responds(to: #selector(alert.beginSheetModal(for:completionHandler:))) {
-                alert.beginSheetModal(for: self.view.window!, completionHandler: nil)
-            } else {
-                alert.runModal()
-            }
-            return
-        }
-        
-        if createNewPDFRadio_.properties.checkboxType == .selected {
-            if (self.choosePath.count < 1) {
-                let alert = NSAlert()
-                alert.alertStyle = .critical
-                alert.messageText = String(format: KMLocalizedString("Output Folder cannot be empty.", comment: ""))
-                alert.runModal()
-                return
-            }
-            
-            path = self.choosePath
-            
-            if mergeAllCheckBox_.properties.checkboxType == .selected {
-                isMerge = true
-            }
-            isCreatNewPDF = true
-            
-        } else {
-            let appenString = appendBackInput_.properties.text
-            if appenString.isEmpty {
-                let alert = NSAlert()
-                alert.alertStyle = .critical
-                alert.messageText = String(format: KMLocalizedString("Select a File", comment: ""))
-                alert.runModal()
-                return
-            }
-            
-            path = appenString
-            isMerge = true
-            isCreatNewPDF = false
-        }
-        
-        let planDisabled = ocrPlanRadio_.properties.isDisabled
-        ocrPlanRadio_.properties.isDisabled = true
-        ocrPlanRadio_.reloadData()
-        ocrPlanRadio2_.properties.isDisabled = true
-        ocrPlanRadio2_.reloadData()
-        self.method.password = self.password
-        self.interfaceStatus = .Processing
-        
-        self.method.saveAsTestPath = self.choosePath
-        self.method.exportPDFFile(fileArray: photoArray, savePath: path, isOCR: isOCR, isCreatPDF: isCreatNewPDF, isMerge: isMerge, isSaveAsText: isSaveAs) { [weak self] savePath, errorArr, errorOCRArray in
-            
-            self?.ocrPlanRadio_.properties.isDisabled = planDisabled
-            self?.ocrPlanRadio_.reloadData()
-            self?.ocrPlanRadio2_.properties.isDisabled = planDisabled
-            self?.ocrPlanRadio2_.reloadData()
-            self?.applyButton.properties.isDisabled = false
-            self?.applyButton.properties.state = .normal
-            self?.applyButton.reloadData()
-            
-            self?.interfaceStatus = .PrepareProcess
-            if errorArr.count > 0 {
-                let dict: [String: Any] = ["isMerge": false, "isSuccess": false]
-                NotificationCenter.default.post(name: NSNotification.Name(rawValue: "KMBatchOperateImageToPDFSuccessNotification"), object: self, userInfo: dict)
-                
-                let alert = NSAlert()
-                alert.messageText = KMLocalizedString("Conversion Failed", comment: "")
-                alert.addButton(withTitle: KMLocalizedString("OK", comment: ""))
-                alert.informativeText = "\(errorArr)"
-                alert.alertStyle = .informational
-                alert.runModal()
-            } else {
-                if errorOCRArray.count > 0 {
-                    var contextString = KMLocalizedString("Some problems occurred during the last operation:", comment: "")
-                    for filePath in errorOCRArray {
-                        contextString += "\n" + (filePath as AnyObject).lastPathComponent
-                    }
-                    
-                    let alert = NSAlert()
-                    alert.messageText = KMLocalizedString("Converted Successfully", comment: "")
-                    alert.addButton(withTitle: KMLocalizedString("OK", comment: ""))
-                    alert.informativeText = contextString
-                    alert.alertStyle = .informational
-                    let response = alert.runModal()
-                    if response == .OK {
-                        self?.viewFileAtFinder(fileName: savePath)
-                    }
-                } else {
-                    self?.viewFileAtFinder(fileName: savePath)
-                }
-            }
-        }
-    }
-    
-    func viewFileAtFinder(fileName: String) {
-        let dict = ["isMerge": true, "isSuccess": true]
-        NotificationCenter.default.post(name: Notification.Name("KMBatchOperateImageToPDFSuccessNotification"), object: self, userInfo: dict)
-        let workspace = NSWorkspace.shared
-        let url = URL(fileURLWithPath: fileName)
-        workspace.activateFileViewerSelecting([url])
-    }
-    
-    // MARK: - Actions
-    
-    @objc func ocrPlanAction(_ sender: ComponentRadio) {
-        for radio in [ocrPlanRadio_, ocrPlanRadio2_] {
-            if radio.isEqual(to: sender) {
-                radio.properties.checkboxType = .selected
-                radio.reloadData()
-                
-                KMGOCRManager.default().ocrType = .google
-                KMDataManager.ud_set(0, forKey: "KMOCRCurrentPlanKey")
-            } else {
-                radio.properties.checkboxType = .normal
-                radio.reloadData()
-                
-                KMGOCRManager.default().ocrType = .apple
-                KMDataManager.ud_set(1, forKey: "KMOCRCurrentPlanKey")
-            }
-        }
-        
-        self.OCRSelectedPlanChangeAction()
-    }
-    
-    @IBAction func buttonClicked_CreateNewPDF(_ sender: ComponentRadio) {
-        if (sender.properties.checkboxType == .selected) {
-            mergeAllCheckBox_.properties.isDisabled = false
-            mergeAllCheckBox_.reloadData()
-            
-            appendRadio_.properties.checkboxType = .normal
-            appendRadio_.reloadData()
-            
-            appendBackInput_.properties.isDisabled = true
-            appendBackInput_.reloadData()
-            appendBackButtonInput_.properties.isDisabled = true
-            appendBackButtonInput_.reloadData()
-        }
-    }
-    
-    @IBAction func buttonClicked_AppendOtherPDF(_ sender: ComponentRadio) {
-        if (sender.properties.checkboxType == .selected) {
-            createNewPDFRadio_.properties.checkboxType = .normal
-            createNewPDFRadio_.reloadData()
-            
-            mergeAllCheckBox_.properties.checkboxType = .normal
-            mergeAllCheckBox_.properties.isDisabled = true
-            mergeAllCheckBox_.reloadData()
-            
-            appendBackInput_.properties.isDisabled = false
-            appendBackInput_.reloadData()
-            appendBackButtonInput_.properties.isDisabled = false
-            appendBackButtonInput_.reloadData()
-        }
-    }
-    
-    @IBAction func buttonClicked_OCRSelect(_ sender: ComponentCheckBox) {
-        //MARK: 判断是否付费用户
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
-            ocrCheckBox_.properties.checkboxType = .normal
-            ocrCheckBox_.reloadData()
-            return
-        }
-        if (sender.properties.checkboxType == .selected) {
-            languageView_.properties.isDisabled = false
-            languageView_.reloadData()
-            ocrPlanRadio_.properties.isDisabled = false
-            ocrPlanRadio_.reloadData()
-            ocrPlanRadio2_.properties.isDisabled = false
-            ocrPlanRadio2_.reloadData()
-            extractTextCheckBox_.properties.isDisabled = false
-            extractTextCheckBox_.reloadData()
-        } else {
-            languageView_.properties.isDisabled = true
-            languageView_.reloadData()
-            ocrPlanRadio_.properties.isDisabled = true
-            ocrPlanRadio_.reloadData()
-            ocrPlanRadio2_.properties.isDisabled = true
-            ocrPlanRadio2_.reloadData()
-            extractTextCheckBox_.properties.isDisabled = true
-            extractTextCheckBox_.reloadData()
-        }
-    }
-    
-    @IBAction func buttonClicked_ImageToPDF(_ sender: ComponentButton) {
-        //MARK: 判断是否付费用户,展示iap界面
-        if self.files?.count ?? 0 < 1 {
-            return
-        }
-        if IAPProductsManager.default().isAvailableAllFunction() == false && self.files?.count ?? 0 > 1{
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
-            return
-        }
-        if sender.properties.state == .pressed {
-            self.choosePath = ""
-            var hasTask = false
-            for i in 0..<(self.files?.count ?? 0) {
-                let file = self.files?[i]
-                file?.currentOperateInfo?.resetState()
-                if file?.fileType == .Image {
-                    hasTask = true
-                }
-            }
-            if !hasTask {
-                NSSound.beep()
-                return
-            }
-            
-            var isOCR = false
-            if ocrCheckBox_.properties.checkboxType == .selected {
-                isOCR = true
-            }
-            
-            var isSaveAs = false
-            if extractTextCheckBox_.properties.checkboxType == .selected {
-                isSaveAs = true
-            }
-            
-            let plan = UserDefaults.standard.integer(forKey: "KMOCRCurrentPlanKey")
-            if isOCR && !isConnectionAvailable() && plan == 0 {
-                let alert = NSAlert()
-                alert.alertStyle = .critical
-                alert.messageText = KMLocalizedString("Connection Error", comment: "")
-                alert.informativeText = KMLocalizedString("Please make sure your internet connection is available.", comment: "")
-                alert.addButton(withTitle: KMLocalizedString("OK", comment: ""))
-                if let window = self.view.window {
-                    alert.beginSheetModal(for: window, completionHandler: nil)
-                } else {
-                    alert.runModal()
-                }
-                return
-            }
-            
-            if createNewPDFRadio_.properties.checkboxType != .selected {
-                let appenString = appendBackInput_.properties.text
-                if appenString.isEmpty {
-                    let alert = NSAlert()
-                    alert.alertStyle = .critical
-                    alert.messageText = KMLocalizedString("Select a File", comment: "")
-                    alert.runModal()
-                    return
-                }
-            }
-            
-            let openPanel = NSOpenPanel()
-            openPanel.canChooseFiles = false
-            openPanel.canChooseDirectories = true
-            openPanel.canCreateDirectories = true
-            openPanel.beginSheetModal(for: self.view.window!) { (result) in
-                if result == .OK {
-                    for fileURL in openPanel.urls {
-                        self.choosePath = fileURL.path
-                        self.beginImageToPDF()
-                    }
-                }
-            }
-        } else { // Do something else }
-            
-            
-        }
-    }
-    
-    @IBAction func buttonItemClicked_AppendOtherPDF(_ sender: NSButton) {
-        let isDisabled = appendBackButtonInput_.properties.isDisabled
-        if isDisabled {
-            return
-        }
-        
-        let openPanel = NSOpenPanel()
-        openPanel.allowedFileTypes = ["pdf"]
-        openPanel.canChooseDirectories = false
-        openPanel.allowsMultipleSelection = false
-        openPanel.beginSheetModal(for: self.view.window!) { (result) in
-            if result == .OK {
-                guard let url = openPanel.url else { return }
-                guard let document = PDFDocument(url: url) else {
-                    let alert = NSAlert()
-                    alert.alertStyle = .critical
-                    alert.messageText = KMLocalizedString("An error occurred while opening this document. The file is damaged and could not be repaired.", comment: "")
-                    alert.runModal()
-                    return
-                }
-                if !document.allowsCopying || !document.allowsPrinting {
-                    let alert = NSAlert()
-                    alert.alertStyle = .critical
-                    alert.messageText = KMLocalizedString("This is a secured document. Editing is not permitted.", comment: "")
-                    alert.runModal()
-                    return
-                }
-                
-                if document.isLocked {
-                    NSWindowController.checkPassword(url: url, type: .owner) { [weak self] success, resultPassword in
-                        if success {
-                            self?.password = resultPassword
-                            
-                            self?.appendBackInput_.properties.text = url.path
-                            self?.appendBackInput_.reloadData()
-                        }
-                    }
-                } else {
-                    self.appendBackInput_.properties.text = url.path
-                    self.appendBackInput_.reloadData()
-                }
-            }
-        }
-    }
-    
-    // "Choose automatic language detection for better OCR results."
-    //MARK: -Notification
-    
-    @objc func batchFilesCountNotification(notification: Notification)  {
-        let files: Array? = notification.object as? [KMBatchOperateFile]
-        self.files? = files ?? []
-        let cnt = self.files?.count ?? 0
-        if cnt > 0 {
-            self._updateActionButtonEnable(true)
-        } else {
-            self._updateActionButtonEnable(false)
-        }
-    }
-    
-    func OCRSelectedPlanChangeAction() {
-        KMGOCRManager.default().selectedLanguages = NSMutableArray()
-        self.updateLanguageButton(KMGOCRManager.default().selectedLanguages?.value(forKeyPath: KMGOCRLanguageStringKey) as? [String])
-    }
-}
-
-// MARK: - KMImageToPDFMethodDelegate
-
-extension KMBatchOperateImageToPDFViewController: KMImageToPDFMethodDelegate {
-    func imageToPDFMethod(_ method: KMImageToPDFMethod, progress: Float) {
-        
-    }
-}
-
-// MARK: - ComponentSelectDelegate
-
-extension KMBatchOperateImageToPDFViewController: ComponentSelectDelegate {
-    func componentSelectDidSelect(view: ComponentSelect?, menuItemProperty: ComponentMenuitemProperty?) {
-        let idx = view?.indexOfSelect() ?? 0
-        
-        let languages = KMGOCRManager.languages() as NSArray
-        let lanuage = languages[idx]
-        KMGOCRManager.default().selectedLanguages = [lanuage]
-    }
-}

+ 0 - 260
PDF Office/PDF Master/KMClass/ImageToPDF/Controller/KMBatchOperateImageToPDFViewController.xib

@@ -1,260 +0,0 @@
-<?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="KMBatchOperateImageToPDFViewController" customModule="PDF_Reader_Pro" customModuleProvider="target">
-            <connections>
-                <outlet property="appendBackBox" destination="ivy-HJ-F2X" id="OyN-cN-p8x"/>
-                <outlet property="appendBox" destination="HpT-QS-341" id="hRt-mm-Ukm"/>
-                <outlet property="applyButton" destination="HSI-hW-pYn" id="YQY-2l-Can"/>
-                <outlet property="bottomBox" destination="dja-8H-Uup" id="udk-GK-Wkh"/>
-                <outlet property="bottomTopLine" destination="4wO-ha-sYg" id="9wl-jh-5lh"/>
-                <outlet property="extractTextBox" destination="nfj-9v-ZqH" id="ErV-XO-Hur"/>
-                <outlet property="hLine" destination="wXl-jv-vC2" id="Z4J-x2-xgU"/>
-                <outlet property="headerBottomLine" destination="7MQ-kJ-8ar" id="LD2-vq-MD6"/>
-                <outlet property="headerBox" destination="yvT-Vr-HYw" id="JJC-0R-pz6"/>
-                <outlet property="languageBox" destination="6qO-Xk-6yr" id="bW6-w0-uTt"/>
-                <outlet property="mergeAllBox" destination="hCw-K3-67H" id="t5s-f5-eUc"/>
-                <outlet property="newPDFBox" destination="n89-YE-ldr" id="4dT-WC-jg5"/>
-                <outlet property="ocrLabel" destination="hyp-2H-elp" id="7wX-ia-0Rp"/>
-                <outlet property="ocrPlan2Box" destination="f7o-yZ-THg" id="AE8-1e-sun"/>
-                <outlet property="ocrPlanBox" destination="f52-b5-1Ge" id="5ZG-fZ-vaS"/>
-                <outlet property="ocrSelectBox" destination="Ivj-XV-tDI" id="fgU-5z-ksd"/>
-                <outlet property="outputTypeLabel" destination="aPB-Pb-64w" id="BBp-lK-MNk"/>
-                <outlet property="titleLabel" destination="N3m-4e-rSU" id="X1q-p2-qWf"/>
-                <outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
-            </connections>
-        </customObject>
-        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
-        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
-        <customView id="Hz6-mo-xeY">
-            <rect key="frame" x="0.0" y="0.0" width="480" height="566"/>
-            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
-            <subviews>
-                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="aPB-Pb-64w">
-                    <rect key="frame" x="14" y="497" width="42" height="17"/>
-                    <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="dr8-xu-eZp">
-                        <font key="font" metaFont="systemBold" size="14"/>
-                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                    </textFieldCell>
-                </textField>
-                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="hyp-2H-elp">
-                    <rect key="frame" x="14" y="318" width="35" height="17"/>
-                    <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="OCR" id="SLY-wg-469">
-                        <font key="font" metaFont="systemBold" size="14"/>
-                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                        <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
-                    </textFieldCell>
-                </textField>
-                <box boxType="custom" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="n89-YE-ldr">
-                    <rect key="frame" x="16" y="465" width="448" height="20"/>
-                    <view key="contentView" id="crJ-bx-eAh">
-                        <rect key="frame" x="1" y="1" width="446" height="18"/>
-                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                    </view>
-                    <constraints>
-                        <constraint firstAttribute="height" constant="20" id="z2q-Q0-gnl"/>
-                    </constraints>
-                </box>
-                <box boxType="custom" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="hCw-K3-67H">
-                    <rect key="frame" x="40" y="437" width="424" height="20"/>
-                    <view key="contentView" id="yiI-lc-fK0">
-                        <rect key="frame" x="1" y="1" width="422" height="18"/>
-                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                    </view>
-                    <constraints>
-                        <constraint firstAttribute="height" constant="20" id="ueV-j9-1cC"/>
-                    </constraints>
-                </box>
-                <box boxType="custom" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="HpT-QS-341">
-                    <rect key="frame" x="16" y="399" width="448" height="20"/>
-                    <view key="contentView" id="R0v-fU-j7b">
-                        <rect key="frame" x="1" y="1" width="446" height="18"/>
-                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                    </view>
-                    <constraints>
-                        <constraint firstAttribute="height" constant="20" id="lRF-0h-cQW"/>
-                    </constraints>
-                </box>
-                <box boxType="custom" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="ivy-HJ-F2X">
-                    <rect key="frame" x="16" y="359" width="448" height="32"/>
-                    <view key="contentView" id="hXZ-UD-kdJ">
-                        <rect key="frame" x="1" y="1" width="446" height="30"/>
-                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                    </view>
-                    <constraints>
-                        <constraint firstAttribute="height" constant="32" id="mDb-QA-Oor"/>
-                    </constraints>
-                </box>
-                <box boxType="custom" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="Ivj-XV-tDI">
-                    <rect key="frame" x="16" y="286" width="448" height="20"/>
-                    <view key="contentView" id="EXi-zS-eDm">
-                        <rect key="frame" x="1" y="1" width="446" height="18"/>
-                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                    </view>
-                    <constraints>
-                        <constraint firstAttribute="height" constant="20" id="axj-MY-ljb"/>
-                    </constraints>
-                </box>
-                <box boxType="custom" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="6qO-Xk-6yr">
-                    <rect key="frame" x="16" y="246" width="448" height="32"/>
-                    <view key="contentView" id="k0A-6r-Dwg">
-                        <rect key="frame" x="1" y="1" width="446" height="30"/>
-                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                    </view>
-                    <constraints>
-                        <constraint firstAttribute="height" constant="32" id="zDk-wa-gZE"/>
-                    </constraints>
-                </box>
-                <box boxType="custom" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="f52-b5-1Ge">
-                    <rect key="frame" x="16" y="206" width="448" height="32"/>
-                    <view key="contentView" id="0Ci-tL-ey8">
-                        <rect key="frame" x="1" y="1" width="446" height="30"/>
-                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                    </view>
-                    <constraints>
-                        <constraint firstAttribute="height" constant="32" id="cqS-bf-yFu"/>
-                    </constraints>
-                </box>
-                <box boxType="custom" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="f7o-yZ-THg">
-                    <rect key="frame" x="16" y="174" width="448" height="32"/>
-                    <view key="contentView" id="Wjc-K2-hqV">
-                        <rect key="frame" x="1" y="1" width="446" height="30"/>
-                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                    </view>
-                    <constraints>
-                        <constraint firstAttribute="height" constant="32" id="JSA-2Y-Xvu"/>
-                    </constraints>
-                </box>
-                <customView translatesAutoresizingMaskIntoConstraints="NO" id="wXl-jv-vC2">
-                    <rect key="frame" x="16" y="165" width="448" height="1"/>
-                    <constraints>
-                        <constraint firstAttribute="height" constant="1" id="fL6-p3-0Rf"/>
-                    </constraints>
-                </customView>
-                <box boxType="custom" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="nfj-9v-ZqH">
-                    <rect key="frame" x="16" y="120" width="448" height="32"/>
-                    <view key="contentView" id="uKI-2s-Sl0">
-                        <rect key="frame" x="1" y="1" width="446" height="30"/>
-                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                    </view>
-                    <constraints>
-                        <constraint firstAttribute="height" constant="32" id="Hfb-Gk-cjx"/>
-                    </constraints>
-                </box>
-                <box boxType="custom" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="dja-8H-Uup">
-                    <rect key="frame" x="0.0" y="0.0" width="480" height="72"/>
-                    <view key="contentView" id="uX6-hg-iIn">
-                        <rect key="frame" x="1" y="1" width="478" height="70"/>
-                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                        <subviews>
-                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="4wO-ha-sYg" customClass="ComponentDivider" customModule="KMComponentLibrary">
-                                <rect key="frame" x="0.0" y="69" width="478" height="1"/>
-                                <constraints>
-                                    <constraint firstAttribute="height" constant="1" id="nJk-GK-xd7"/>
-                                </constraints>
-                            </customView>
-                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="HSI-hW-pYn" customClass="ComponentButton" customModule="KMComponentLibrary">
-                                <rect key="frame" x="16" y="16" width="446" height="38"/>
-                            </customView>
-                        </subviews>
-                        <constraints>
-                            <constraint firstAttribute="trailing" secondItem="HSI-hW-pYn" secondAttribute="trailing" constant="16" id="0Rl-C2-wUp"/>
-                            <constraint firstItem="HSI-hW-pYn" firstAttribute="leading" secondItem="uX6-hg-iIn" secondAttribute="leading" constant="16" id="1qC-Q1-6tY"/>
-                            <constraint firstAttribute="trailing" secondItem="4wO-ha-sYg" secondAttribute="trailing" id="Q74-WU-Vvw"/>
-                            <constraint firstItem="4wO-ha-sYg" firstAttribute="leading" secondItem="uX6-hg-iIn" secondAttribute="leading" id="gNK-sS-DQK"/>
-                            <constraint firstItem="4wO-ha-sYg" firstAttribute="top" secondItem="uX6-hg-iIn" secondAttribute="top" id="hs1-L9-CGh"/>
-                            <constraint firstItem="HSI-hW-pYn" firstAttribute="top" secondItem="uX6-hg-iIn" secondAttribute="top" constant="16" id="l4t-Lg-Wdn"/>
-                            <constraint firstAttribute="bottom" secondItem="HSI-hW-pYn" secondAttribute="bottom" constant="16" id="rv9-Lq-usl"/>
-                        </constraints>
-                    </view>
-                    <constraints>
-                        <constraint firstAttribute="height" constant="72" id="L4J-pn-V8v"/>
-                    </constraints>
-                </box>
-                <box boxType="custom" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="yvT-Vr-HYw">
-                    <rect key="frame" x="0.0" y="526" width="480" height="40"/>
-                    <view key="contentView" id="kWL-fg-PgX">
-                        <rect key="frame" x="1" y="1" width="478" height="38"/>
-                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                        <subviews>
-                            <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="N3m-4e-rSU">
-                                <rect key="frame" x="221" y="11" width="37" height="16"/>
-                                <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="Sym-H3-uOC">
-                                    <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>
-                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="7MQ-kJ-8ar" customClass="ComponentDivider" customModule="KMComponentLibrary">
-                                <rect key="frame" x="0.0" y="0.0" width="478" height="1"/>
-                                <constraints>
-                                    <constraint firstAttribute="height" constant="1" id="Sby-Oh-ryd"/>
-                                </constraints>
-                            </customView>
-                        </subviews>
-                        <constraints>
-                            <constraint firstItem="7MQ-kJ-8ar" firstAttribute="leading" secondItem="kWL-fg-PgX" secondAttribute="leading" id="1O0-je-ZDP"/>
-                            <constraint firstItem="N3m-4e-rSU" firstAttribute="centerY" secondItem="kWL-fg-PgX" secondAttribute="centerY" id="5d0-dl-3hC"/>
-                            <constraint firstAttribute="trailing" secondItem="7MQ-kJ-8ar" secondAttribute="trailing" id="OU7-cS-TMd"/>
-                            <constraint firstAttribute="bottom" secondItem="7MQ-kJ-8ar" secondAttribute="bottom" id="kag-NF-2g7"/>
-                            <constraint firstItem="N3m-4e-rSU" firstAttribute="centerX" secondItem="kWL-fg-PgX" secondAttribute="centerX" id="x7t-5L-61C"/>
-                        </constraints>
-                    </view>
-                    <constraints>
-                        <constraint firstAttribute="height" constant="40" id="x7e-jB-MYY"/>
-                    </constraints>
-                </box>
-            </subviews>
-            <constraints>
-                <constraint firstItem="f7o-yZ-THg" firstAttribute="top" secondItem="f52-b5-1Ge" secondAttribute="bottom" id="8Xt-Pa-Sgd"/>
-                <constraint firstItem="6qO-Xk-6yr" firstAttribute="top" secondItem="Ivj-XV-tDI" secondAttribute="bottom" constant="8" id="8YG-3N-WCa"/>
-                <constraint firstAttribute="trailing" secondItem="Ivj-XV-tDI" secondAttribute="trailing" constant="16" id="AL5-lm-JS9"/>
-                <constraint firstItem="Ivj-XV-tDI" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="16" id="AZw-Ex-mSQ"/>
-                <constraint firstAttribute="trailing" secondItem="dja-8H-Uup" secondAttribute="trailing" id="DPv-In-aGx"/>
-                <constraint firstItem="f7o-yZ-THg" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="16" id="DSP-jU-5v6"/>
-                <constraint firstItem="wXl-jv-vC2" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="16" id="FXt-Gu-oLI"/>
-                <constraint firstAttribute="trailing" secondItem="f7o-yZ-THg" secondAttribute="trailing" constant="16" id="JUv-MP-Y9l"/>
-                <constraint firstAttribute="trailing" secondItem="HpT-QS-341" secondAttribute="trailing" constant="16" id="Liv-T3-5cT"/>
-                <constraint firstItem="nfj-9v-ZqH" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="16" id="O8F-CD-d5w"/>
-                <constraint firstItem="hCw-K3-67H" firstAttribute="top" secondItem="n89-YE-ldr" secondAttribute="bottom" constant="8" id="PSB-NV-7Vv"/>
-                <constraint firstAttribute="trailing" secondItem="ivy-HJ-F2X" secondAttribute="trailing" constant="16" id="QLZ-zy-81z"/>
-                <constraint firstItem="ivy-HJ-F2X" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="16" id="QWz-1v-vc9"/>
-                <constraint firstItem="dja-8H-Uup" firstAttribute="top" relation="greaterThanOrEqual" secondItem="nfj-9v-ZqH" secondAttribute="bottom" constant="48" id="RhM-Uu-BBI"/>
-                <constraint firstItem="nfj-9v-ZqH" firstAttribute="top" secondItem="wXl-jv-vC2" secondAttribute="bottom" constant="13" id="RzD-gh-paa"/>
-                <constraint firstItem="yvT-Vr-HYw" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" id="USs-od-fj8"/>
-                <constraint firstItem="aPB-Pb-64w" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" constant="52" id="UbP-Fa-eTV"/>
-                <constraint firstAttribute="trailing" secondItem="yvT-Vr-HYw" secondAttribute="trailing" id="VAs-z3-Iqh"/>
-                <constraint firstAttribute="trailing" secondItem="f52-b5-1Ge" secondAttribute="trailing" constant="16" id="VLF-tB-JZU"/>
-                <constraint firstItem="HpT-QS-341" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="16" id="VU4-bS-vNC"/>
-                <constraint firstAttribute="trailing" secondItem="nfj-9v-ZqH" secondAttribute="trailing" constant="16" id="aOM-Mo-oU4"/>
-                <constraint firstAttribute="trailing" secondItem="wXl-jv-vC2" secondAttribute="trailing" constant="16" id="ajI-ou-mFa"/>
-                <constraint firstItem="dja-8H-Uup" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" id="b6T-F7-enh"/>
-                <constraint firstItem="n89-YE-ldr" firstAttribute="top" secondItem="aPB-Pb-64w" secondAttribute="bottom" constant="12" id="bk0-kf-ulW"/>
-                <constraint firstItem="aPB-Pb-64w" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="16" id="cm2-wz-AP3"/>
-                <constraint firstItem="yvT-Vr-HYw" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" id="f5F-4S-nh2"/>
-                <constraint firstItem="HpT-QS-341" firstAttribute="top" secondItem="hCw-K3-67H" secondAttribute="bottom" constant="18" id="fkc-6M-xhx"/>
-                <constraint firstAttribute="trailing" secondItem="hCw-K3-67H" secondAttribute="trailing" constant="16" id="gew-aC-Sr2"/>
-                <constraint firstItem="n89-YE-ldr" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="16" id="hJr-kb-qE4"/>
-                <constraint firstItem="6qO-Xk-6yr" firstAttribute="top" secondItem="f52-b5-1Ge" secondAttribute="bottom" constant="-72" id="i1G-kk-ozl"/>
-                <constraint firstItem="wXl-jv-vC2" firstAttribute="top" secondItem="f7o-yZ-THg" secondAttribute="bottom" constant="8" id="jXt-VN-8sG"/>
-                <constraint firstItem="f52-b5-1Ge" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="16" id="jru-xm-jbV"/>
-                <constraint firstItem="hyp-2H-elp" firstAttribute="leading" secondItem="aPB-Pb-64w" secondAttribute="leading" id="mdU-8E-lPS"/>
-                <constraint firstItem="hCw-K3-67H" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="40" id="pnQ-vB-MVe"/>
-                <constraint firstAttribute="bottom" secondItem="dja-8H-Uup" secondAttribute="bottom" id="rEm-pS-vKQ"/>
-                <constraint firstAttribute="trailing" secondItem="n89-YE-ldr" secondAttribute="trailing" constant="16" id="sNQ-CU-t7j"/>
-                <constraint firstItem="6qO-Xk-6yr" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="16" id="v0b-Qg-CLa"/>
-                <constraint firstAttribute="trailing" secondItem="6qO-Xk-6yr" secondAttribute="trailing" constant="16" id="xzz-Ta-7f4"/>
-                <constraint firstItem="hyp-2H-elp" firstAttribute="top" secondItem="ivy-HJ-F2X" secondAttribute="bottom" constant="24" id="ygA-il-Zjf"/>
-                <constraint firstItem="ivy-HJ-F2X" firstAttribute="top" secondItem="HpT-QS-341" secondAttribute="bottom" constant="8" id="zMh-lw-EYt"/>
-                <constraint firstItem="Ivj-XV-tDI" firstAttribute="top" secondItem="hyp-2H-elp" secondAttribute="bottom" constant="12" id="zg4-S2-2eI"/>
-            </constraints>
-            <point key="canvasLocation" x="-141" y="224"/>
-        </customView>
-    </objects>
-</document>

+ 0 - 342
PDF Office/PDF Master/KMClass/ImageToPDF/Model/KMBatchOperateFile.swift

@@ -1,342 +0,0 @@
-//
-//  KMBatchOperateFile.swift
-//  PDF Reader Pro
-//
-//  Created by kdanmobile on 2023/10/25.
-//
-
-import Cocoa
-
-@objcMembers class KMBatchOperateFile: NSObject{
-    /**基本信息*/
-    var password: String = ""
-    var filePath: String = ""
-    var outputFilePath: String = ""
-    
-    var fileSize: Float = 0
-    var dimensions: Float = 0
-    lazy var sizeString: String = {
-        guard let dict = try? FileManager.default.attributesOfItem(atPath: self.filePath) as NSDictionary else {
-            return "0"
-        }
-        fileSize = Float(dict.fileSize())
-        let _sizeString = self.fileSizeString(fSize: fileSize)
-        
-        return _sizeString
-    }()
-    var fileType: KMBatchOperateFileType?
-    
-    // 是否使用OCR
-    var isAllowOCR = false
-    var ocrLanguage: COCRLanguage?
-    
-    /*当前正在进行的任务状态*/
-    var error: NSError? {
-        return self.currentOperateInfo?.error
-    }
-    var status: KMBatchOperateStatus?{
-        return self.currentOperateInfo?.status
-    }
-    var dpi: Int? {
-        if self.currentOperateType == .Convert{
-            return self.currentConvertParameter?.dpi
-        }
-        return 0
-    }
-    var progress: Float?{
-        return self.currentOperateInfo?.progress
-    }
-    var currentOperateType: KMBatchOperationType?
-    var convertType: KMConvertWithPDFType = .WordAdvance
-    /*当前的操作详细信息**/
-    lazy var createPDFInfo: KMBatchBaseParameter = {
-        let info = KMBatchBaseParameter(file: self)
-        return info
-    }()
-    var convertInfo: KMBatchConvertParameter?{
-        return self.currentConvertParameter
-    }
-    lazy var mergeInfo: KMBatchBaseParameter = {
-        let info = KMBatchBaseParameter(file: self)
-        return info
-    }()
-    lazy var compressInfo: KMBatchBaseParameter = {
-        let info = KMBatchBaseParameter(file: self)
-        return info
-    }()
-    lazy var ocrInfo: KMBatchBaseParameter = {
-        let info = KMBatchBaseParameter(file: self)
-        return info
-    }()
-    lazy var addPasswordInfo: KMBatchBaseParameter = {
-        let info = KMBatchBaseParameter(file: self)
-        return info
-    }()
-    lazy var removePasswordInfo: KMBatchBaseParameter = {
-        let info = KMBatchBaseParameter(file: self)
-        return info
-    }()
-    lazy var addWatermarkInfo: KMBatchBaseParameter = {
-        let info = KMBatchBaseParameter(file: self)
-        return info
-    }()
-    lazy var removeWatermarkInfo: KMBatchBaseParameter = {
-        let info = KMBatchBaseParameter(file: self)
-        return info
-    }()
-    lazy var addBackgroundInfo: KMBatchBaseParameter = {
-        let info = KMBatchBaseParameter(file: self)
-        return info
-    }()
-    lazy var removeBackgroundInfo: KMBatchBaseParameter = {
-        let info = KMBatchBaseParameter(file: self)
-        return info
-    }()
-    lazy var addHeaderFooterInfo: KMBatchBaseParameter = {
-        let info = KMBatchBaseParameter(file: self)
-        return info
-    }()
-    lazy var removeHeaderFooterInfo: KMBatchBaseParameter = {
-        let info = KMBatchBaseParameter(file: self)
-        return info
-    }()
-    lazy var addBatesInfo: KMBatchBaseParameter = {
-        let info = KMBatchBaseParameter(file: self)
-        return info
-    }()
-    lazy var removeBatesInfo: KMBatchBaseParameter = {
-        let info = KMBatchBaseParameter(file: self)
-        return info
-    }()
-    var currentOperateInfo: KMBatchBaseParameter?{
-        switch self.currentOperateType {
-        case .CreatePDF:
-            return self.createPDFInfo
-        case .Convert:
-            return self.convertInfo
-        case .Merge:
-            return self.mergeInfo
-        case .Compress:
-            return self.compressInfo
-        case .OCR:
-            return self.ocrInfo
-        case .AddPassword:
-            return self.addPasswordInfo
-        case .RemovePassword:
-            return self.removePasswordInfo
-        case .AddWatermark:
-            return self.addWatermarkInfo
-        case .RemoveWatermark:
-            return self.removeWatermarkInfo
-        case .AddBackground:
-            return self.addBackgroundInfo
-        case .RemoveBackground:
-            return self.removeBackgroundInfo
-        case .AddHeaderFooter:
-            return self.addHeaderFooterInfo
-        case .RemoveHeaderFooter:
-            return self.removeHeaderFooterInfo
-        case .AddBates:
-            return self.addBatesInfo
-        case .RemoveBates:
-            return self.removeBatesInfo
-        case .none:
-            return nil
-        case .some(.NotDetermined):
-            return nil
-        }
-    }
-    /*转换详细信息**/
-    lazy var standardWordParameter: KMBatchConvertParameter = {
-        let paramter = KMBatchConvertParameter(file: self)
-        paramter.convertType = .WordStandard
-        return paramter
-    }()
-    lazy var advanceWordParameter: KMBatchConvertParameter = {
-        let paramter = KMBatchConvertParameter(file: self)
-        paramter.convertType = .WordAdvance
-        return paramter
-    }()
-    lazy var excelParameter: KMBatchConvertParameter = {
-        let paramter = KMBatchConvertParameter(file: self)
-        paramter.convertType = .Excel
-        return paramter
-    }()
-    lazy var PPTParameter: KMBatchConvertParameter = {
-        let paramter = KMBatchConvertParameter(file: self)
-        paramter.convertType = .PowerPoint
-        return paramter
-    }()
-    lazy var RTFParameter: KMBatchConvertParameter = {
-        let paramter = KMBatchConvertParameter(file: self)
-        paramter.convertType = .RTF
-        return paramter
-    }()
-    lazy var CSVParameter: KMBatchConvertParameter = {
-        let paramter = KMBatchConvertParameter(file: self)
-        paramter.convertType = .CSV
-        return paramter
-    }()
-    lazy var HTMLParameter: KMBatchConvertParameter = {
-        let paramter = KMBatchConvertParameter(file: self)
-        paramter.convertType = .HTML
-        return paramter
-    }()
-    lazy var TXTParameter: KMBatchConvertParameter = {
-        let paramter = KMBatchConvertParameter(file: self)
-        paramter.convertType = .Text
-        return paramter
-    }()
-    lazy var JPEGParameter: KMBatchConvertParameter = {
-        let paramter = KMBatchConvertParameter(file: self)
-        paramter.convertType = .JPEG
-        return paramter
-    }()
-    lazy var JPGParameter: KMBatchConvertParameter = {
-        let paramter = KMBatchConvertParameter(file: self)
-        paramter.convertType = .JPG
-        return paramter
-    }()
-    lazy var PNGParameter: KMBatchConvertParameter = {
-        let paramter = KMBatchConvertParameter(file: self)
-        paramter.convertType = .PNG
-        return paramter
-    }()
-    lazy var GIFParameter: KMBatchConvertParameter = {
-        let paramter = KMBatchConvertParameter(file: self)
-        paramter.convertType = .GIF
-        return paramter
-    }()
-    lazy var TIFFParameter: KMBatchConvertParameter = {
-        let paramter = KMBatchConvertParameter(file: self)
-        paramter.convertType = .TIFF
-        return paramter
-    }()
-    lazy var TGAParameter: KMBatchConvertParameter = {
-        let paramter = KMBatchConvertParameter(file: self)
-        paramter.convertType = .TGA
-        return paramter
-    }()
-    lazy var BMPParameter: KMBatchConvertParameter = {
-        let paramter = KMBatchConvertParameter(file: self)
-        paramter.convertType = .BMP
-        return paramter
-    }()
-    lazy var JPEG2000Parameter: KMBatchConvertParameter = {
-        let paramter = KMBatchConvertParameter(file: self)
-        paramter.convertType = .JPEG2000
-        return paramter
-    }()
-    lazy var JSONParameter: KMBatchConvertParameter = {
-        let paramter = KMBatchConvertParameter(file: self)
-        paramter.convertType = .Json
-        return paramter
-    }()
-    
-    init(filePath: String) {
-        super.init()
-        self.filePath = filePath
-        
-        let UTTypeString = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, filePath.customPathExtension as CFString, nil)?.takeRetainedValue() as String?
-        let TypeCFString = UTTypeString as CFString?
-        if UTTypeConformsTo(TypeCFString!, kUTTypePDF) {
-            self.fileType = .PDF
-        } else if UTTypeConformsTo(TypeCFString!, kUTTypeImage) {
-            self.fileType = .Image
-        } else {
-            self.fileType = .Unknow
-        }
-    }
-    init(filePath: String, type: KMBatchOperationType) {
-        super.init()
-        self.filePath = filePath
-        self.currentOperateType = type
-        let UTTypeString = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, filePath.customPathExtension as CFString, nil)?.takeRetainedValue() as String?
-        let TypeCFString = UTTypeString as CFString?
-        if UTTypeConformsTo(TypeCFString!, kUTTypePDF) {
-            self.fileType = .PDF
-        } else if UTTypeConformsTo(TypeCFString!, kUTTypeImage) {
-            self.fileType = .Image
-        } else {
-            self.fileType = .Unknow
-        }
-    }
-    override func isEqual(_ other: Any?) -> Bool {
-        if let other = other as? Self {
-            if self.filePath == other.filePath {
-                return true
-            }
-            return false
-        }
-        return false
-    }
-    
-    func pagesArrayIntersect(with anArray: [Any]) -> [Any] {
-        let document = CPDFDocument(url: URL(fileURLWithPath: self.filePath))
-        document?.unlock(withPassword: self.password)
-        var pageNumbersArr = [Any]()
-        let count: Int = Int(document?.pageCount ?? 0)
-        if count > 0 {
-            for j in 0..<count {
-                pageNumbersArr.append(j+1)
-            }
-        }
-        
-        let set1 = NSMutableSet(array: anArray)
-        let set2 = NSMutableSet(array: pageNumbersArr)
-        set1.intersect(set2 as! Set<AnyHashable>)
-        let setArray = set1.allObjects as [Any]
-        let sortedArray = setArray.sorted { (obj1, obj2) -> Bool in
-            let number1 = obj1 as? NSNumber ?? NSNumber()
-            let number2 = obj2 as? NSNumber ?? NSNumber()
-            return number1.compare(number2) == .orderedAscending
-        }
-        
-        return sortedArray
-    }
-    
-    var currentConvertParameter: KMBatchConvertParameter? {
-        if self.convertType == .WordStandard {
-            return self.standardWordParameter
-        } else if self.convertType == .WordAdvance {
-            return self.advanceWordParameter
-        } else if self.convertType == .Excel {
-            return self.excelParameter
-        } else if self.convertType == .PowerPoint {
-            return self.PPTParameter
-        } else if self.convertType == .RTF {
-            return self.RTFParameter
-        } else if self.convertType == .CSV {
-            return self.CSVParameter
-        } else if self.convertType == .HTML {
-            return self.HTMLParameter
-        } else if self.convertType == .Text {
-            return self.TXTParameter
-        } else if self.convertType == .JPEG {
-            return self.JPEGParameter
-        } else if self.convertType == .JPG {
-            return self.JPGParameter
-        } else if self.convertType == .PNG {
-            return self.PNGParameter
-        } else if self.convertType == .GIF {
-            return self.GIFParameter
-        } else if self.convertType == .TIFF {
-            return self.TIFFParameter
-        } else if self.convertType == .TGA {
-            return self.TGAParameter
-        } else if self.convertType == .BMP {
-            return self.BMPParameter
-        } else if self.convertType == .JPEG2000 {
-            return self.JPEG2000Parameter
-        } else if self.convertType == .Json {
-            return self.JSONParameter
-        }
-        return nil
-    }
-    func fileSizeString(fSize: Float) -> String {
-        let fileSize = fSize / 1024 
-        let size = fileSize >= 1024 ? (fileSize < 1048576 ? fileSize/1024.0 : fileSize/1048576.0) : fileSize
-        let unit: String = fileSize >= 1024 ? (fileSize < 1048576 ? "M" : "G") : "K"
-        return String(format: "%0.1f ", size) + unit
-    }
-}

+ 0 - 390
PDF Office/PDF Master/KMClass/ImageToPDF/Tools/KMImageToPDFMethod.swift

@@ -1,390 +0,0 @@
-//
-//  KMImageToPDFMethod.swift
-//  PDF Reader Pro
-//
-//  Created by kdanmobile on 2023/10/26.
-//
-
-import Foundation
-
-let kImageToPDFFolderPath = kTempSavePath?.stringByAppendingPathComponent("ImageToPDF")
-
-@objc(KMImageToPDFMethod)
-protocol KMImageToPDFMethodDelegate: AnyObject {
-    func imageToPDFMethod(_ method: KMImageToPDFMethod, progress: Float)
-}
-
-typealias ImageToPDFResultBlock = (_ savePath: String, _ errorArr: Array<Any>, _ errorOCRArray: Array<Any>) -> Void
-
-class KMImageToPDFMethod: NSObject, KMGOCRManagerDelegate {
-    var imageTopdfDelegate: KMImageToPDFMethodDelegate?
-    var password: String = ""
-    var convertIndex: Int = 0
-    var photoArray: Array<Any>?
-    var errorArray: NSMutableArray!
-    var isOCR = false
-    var isCreatPDF = false
-    var isMerge = false
-    var isSaveAsText = false
-    var saveAsTestPath = ""
-    
-    var results: NSMutableArray!
-    var fileSavePath = ""
-    var OCRResultString = ""
-    
-    var completeBlock: ImageToPDFResultBlock?
-    
-    var errorOCRArray: NSMutableArray!
-    
-    var appendPDF: CPDFDocument?
-    
-    override init() {
-        super.init()
-        if !FileManager.default.fileExists(atPath: kImageToPDFFolderPath ?? "") {
-            try? FileManager.default.createDirectory(at: URL(fileURLWithPath: kImageToPDFFolderPath ?? "") , withIntermediateDirectories: false, attributes: nil)
-        }
-        self.errorArray = NSMutableArray()
-        self.results = NSMutableArray()
-        self.errorOCRArray = NSMutableArray()
-    }
-    
-    deinit {
-        NotificationCenter.default.removeObserver(self)
-        imageTopdfDelegate = nil
-    }
-    
-    func exportPDFFile(fileArray: Array<Any>, savePath: String, isOCR: Bool, isCreatPDF: Bool, isMerge: Bool, isSaveAsText: Bool, complete: @escaping ImageToPDFResultBlock) {
-        self.convertIndex = 0
-        self.photoArray = fileArray
-        self.isOCR = isOCR
-        self.isCreatPDF = isCreatPDF
-        self.isMerge = isMerge
-        self.isSaveAsText = isSaveAsText
-        self.fileSavePath = savePath
-        self.completeBlock = complete
-        self.OCRResultString = ""
-        self.errorArray.removeAllObjects()
-        self.errorOCRArray.removeAllObjects()
-        
-        if !isCreatPDF {
-            appendPDF = CPDFDocument(url: URL(fileURLWithPath: savePath))
-            if ((appendPDF?.unlock(withPassword:self.password)) != nil) {
-                
-            }
-        }
-        
-        if isOCR {
-            let languages = KMGOCRManager.default().selectedLanguages.value(forKeyPath: KMGOCRLanguageCodeKey) as! [Any]
-            var images = [AnyObject]()
-            for i in 0 ..< (photoArray?.count ?? 0) {
-                let filePaht: String = photoArray?[i] as! String
-                if filePaht.count > 0 && FileManager.default.fileExists(atPath: filePaht) {
-                    let image = NSImage(contentsOfFile: filePaht)
-                    images.append(image!)
-                } else {
-                    self.errorArray.add(filePaht)
-                }
-            }
-            if images.count < 1 {
-                self.completeBlock?("", self.errorArray as! Array<Any>, self.errorOCRArray as! Array<Any>)
-                return
-            }
-            let plan = UserDefaults.standard.integer(forKey: "KMOCRCurrentPlanKey")
-            if plan == 0 {
-                KMGOCRManager.default().ocrType = .google
-            } else {
-                KMGOCRManager.default().ocrType = .apple
-            }
-            KMGOCRManager.default().delegate = self
-            KMGOCRManager.default().recognitionImages(images as! [NSImage], withLanguages: languages)
-        } else {
-            if isMerge {
-                NotificationCenter.default.addObserver(self, selector: #selector(pdfDocumentPageWrite(notification:)), name: NSNotification.Name("PDFDocumentDidBeginPageWriteNotification"), object: nil)
-                self.imageToPDFFile_MergeToOneFile(path: savePath, complete: complete)
-            } else {
-                self.imageToPDFFile_SeparateToFiles(path: savePath, complete: complete)
-            }
-        }
-    }
-    
-    func imageToPDFFile_MergeToOneFile(path: String, complete: @escaping ImageToPDFResultBlock) {
-        var pdf: CPDFDocument?
-        var newPath: String = ""
-        if self.isCreatPDF {
-            pdf = CPDFDocument()
-            newPath = path.stringByAppendingPathComponent("Untitled").stringByAppendingPathExtension("pdf")
-            newPath = getUniqueFilePath(newPath)
-        } else {
-            newPath = path
-            pdf = self.appendPDF
-        }
-        
-        for pageCount in 0..<(photoArray?.count ?? 0) {
-            var isDir: ObjCBool = false
-            let filePath = photoArray?[pageCount] as! String
-            if FileManager.default.fileExists(atPath: filePath, isDirectory: &isDir) && !isDir.boolValue {
-                let image = NSImage(contentsOfFile: filePath)!
-                _ = pdf?.km_insertPage(image.size, withImage: filePath, at: pdf?.pageCount ?? 0)
-            }
-        }
-        
-        var isSucceed = false
-        if (pdf?.pageCount ?? 0) < 1 {
-            
-        } else {
-            var options: [CPDFDocumentWriteOption : Any] = [:]
-            if pdf!.isEncrypted {
-                options.updateValue(password, forKey: .userPasswordOption)
-                options.updateValue(password, forKey: .userPasswordOption)
-                isSucceed = pdf?.write(toFile: newPath, withOptions: options) ?? false
-            } else {
-                isSucceed = pdf?.write(toFile: newPath) ?? false
-            }
-        }
-        
-        if !isSucceed {
-            self.errorArray.add((newPath as NSString).lastPathComponent)
-        }
-        
-        DispatchQueue.main.async {
-            complete(newPath, self.errorArray as! Array<Any>, self.errorOCRArray as! Array<Any>)
-        }
-        
-    }
-    func imageToPDFFile_SeparateToFiles(path: String, complete: @escaping(ImageToPDFResultBlock)) {
-        if convertIndex >= photoArray?.count ?? 0 {
-            complete(path, Array<Any>(), errorOCRArray as! Array<Any>)
-            return
-        }
-        let filePath: String = photoArray?[convertIndex] as! String
-        let savePath = path
-        var isDir: ObjCBool = false
-        if FileManager.default.fileExists(atPath: filePath , isDirectory: &isDir) && !isDir.boolValue {
-            let model = KMImageModel(filepath: filePath )
-            let tString = model.photoName.deletingPathExtension.lastPathComponent//model.photoName.deletingPathExtension
-            
-            var newpath = path.stringByAppendingPathComponent(tString).stringByAppendingPathExtension("pdf")
-            newpath = getUniqueFilePath(newpath)
-            
-            let pdf = CPDFDocument()
-            
-            if let imag = NSImage(contentsOfFile: filePath ) {
-                _ = pdf?.km_insertPage(imag.size, withImage: filePath , at: pdf?.pageCount ?? 0)
-            }
-            
-//            DispatchQueue.global().async {
-                var isSucceed = false
-                
-                isSucceed = pdf?.write(toFile: newpath) ?? false
-                var pre: Float = 0
-                if self.photoArray?.count ?? 0 > 0{
-                    pre = Float(self.convertIndex + 1) / Float(self.photoArray?.count ?? 1)
-                }else{
-                    pre = 0
-                }
-                
-                if !isSucceed {
-                    self.errorArray.add(filePath)
-                }
-                
-                if self.convertIndex < (self.photoArray?.count ?? 0) - 1 {
-                    self.convertIndex += 1
-                    self.imageToPDFFile_SeparateToFiles(path: savePath, complete: complete)
-                    
-                    DispatchQueue.main.async {
-                        self.imageTopdfDelegate?.imageToPDFMethod(self, progress: pre)
-                    }
-                } else {
-                    DispatchQueue.main.async {
-                        complete(newpath, self.errorArray as! Array<Any>, self.errorOCRArray as! Array<Any>)
-                    }
-                }
-//            }
-            
-        } else {
-            if convertIndex < (photoArray?.count ?? 0) - 1 {
-                self.convertIndex += 1
-                self.imageToPDFFile_SeparateToFiles(path: savePath, complete: complete)
-            } else {
-                DispatchQueue.main.async {
-                    complete(path, self.errorArray as! Array<Any>, self.errorOCRArray as! Array<Any>)
-                }
-            }
-        }
-    }
-    
-    func getUniqueFilePath(_ filePath: String) -> String {
-        var i = 0
-        var uniqueFilePath = filePath
-        let fileManager = FileManager.default
-        while fileManager.fileExists(atPath: uniqueFilePath) {
-            i += 1
-            let path = String(format: "%@(%d)", filePath.deletingPathExtension,i)
-            uniqueFilePath = path.stringByAppendingPathExtension(filePath.pathExtension)
-        }
-        
-        return uniqueFilePath
-    }
-    
-    @objc func pdfDocumentPageWrite(notification: NSNotification) {
-        if ((notification.userInfo?.isEmpty) != nil) { return }
-        let num = notification.userInfo!["PDFDocumentPageIndex"] as! NSNumber
-        let pdfDocument = notification.object as! CPDFDocument
-        
-        let pre = Float(num.intValue + 1) / (Float(pdfDocument.pageCount) * 1.0)
-        DispatchQueue.main.async {
-            self.imageTopdfDelegate?.imageToPDFMethod(self, progress: pre)
-        }
-    }
-    
-    //MARK: KMGOCRManagerDelegate
-    func gocrManagerDidStartOCR(_ manager: KMGOCRManager!) {
-        
-    }
-    func gocrManagerDidFinishOCR(_ manager: KMGOCRManager!) {
-        
-    }
-    func gocrManager(_ manager: KMGOCRManager!, didCancelOCRImageAt index: Int) {
-        
-    }
-    func gocrManager(_ manager: KMGOCRManager!, didStartOCRImageAt index: Int) {
-        
-    }
-    func gocrManager(_ manager: KMGOCRManager!, didFinishOCRImageAt index: Int, results: [KMGOCRResult]!) {
-        if (results != nil) {
-            self.dealWithResults(results, OCRImageAtIndex: index)
-        }
-    }
-    func gocrManager(_ manager: KMGOCRManager!, didFailureOCRImageAt index: Int, error: Error!) {
-        let results = Array<KMGOCRResult>()
-        self.errorOCRArray.add(self.photoArray?[index] as Any)
-        self.dealWithResults(results, OCRImageAtIndex: index)
-    }
-    
-    
-    func dealWithResults(_ results: [KMGOCRResult]?, OCRImageAtIndex index: Int) {
-        if isOCR {
-            if isMerge {
-                self.results.add(results as Any)
-                var key = index
-                if isCreatPDF {
-                    key = Int((self.appendPDF?.pageCount ?? 0) + UInt(index))
-                }
-                var contents = ""
-                if OCRResultString.count > 0 {
-                    contents = self.OCRResultString
-                }
-                var str: String = ""
-                if results!.count > 0 {
-                    guard let firstResult: KMGOCRResult = results?.first else {
-                        return
-                    }
-                    str = firstResult.text
-                }
-                
-                contents = contents + "\n"
-                contents = contents + "Page" + "\(key + 1)"
-                contents = contents + "\n----------\n"
-                contents = contents + str
-                self.OCRResultString = contents
-                if isCreatPDF {
-                    if index >= (photoArray?.count ?? 0) - 1 {
-                        var savePath = self.fileSavePath.stringByAppendingPathComponent("Untitled OCR").stringByAppendingPathExtension("pdf")
-                        savePath = self.getUniqueFilePath(savePath)
-                        if self.isSaveAsText {
-                            var savetextPath = self.fileSavePath.stringByAppendingPathComponent("Untitled OCR").stringByAppendingPathExtension("txt")
-                            savetextPath = self.getUniqueFilePath(savetextPath)
-                            try? self.OCRResultString.write(to: URL(fileURLWithPath: savetextPath), atomically: true, encoding: .utf8)
-                            NSWorkspace.shared.selectFile(savetextPath, inFileViewerRootedAtPath: "")
-                        }
-                        KMGOCRManager.default().createPDFFile(savePath, imagePaths: self.photoArray, results: (self.results as! [Any]), scale: 1.0)
-                        DispatchQueue.main.async {
-                            self.completeBlock?(savePath, self.errorArray as! Array<Any>, self.errorOCRArray as! Array<Any>)
-                        }
-                    } else {
-                        let pre = Float(index + 1) / (Float(photoArray?.count ?? 0) * 1.0)
-                        DispatchQueue.main.async {
-                            self.imageTopdfDelegate?.imageToPDFMethod(self, progress: pre)
-                        }
-                    }
-                } else {
-                    if index >= (photoArray?.count ?? 0) - 1 {
-                        var savePath = kImageToPDFFolderPath?.stringByAppendingPathComponent("Untitled OCR").stringByAppendingPathExtension("pdf")
-                        KMGOCRManager.default().createPDFFile(savePath, imagePaths: self.photoArray, results: (self.results as! [Any]), scale: 1.0)
-                        DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 3){
-                            if FileManager.default.fileExists(atPath: savePath ?? "") {
-                                let appPDF = self.appendPDF
-                                let newPdf = CPDFDocument.init(url: URL(fileURLWithPath: savePath ?? ""))
-                                for i in 0 ..< (newPdf?.pageCount ?? 0) {
-                                    let page = newPdf?.page(at: i)
-                                    appPDF?.insertPageObject(page, at: appPDF?.pageCount ?? 0)
-                                }
-                                var isSuccessfully = false
-                                let attributes = NSMutableDictionary(dictionary: appPDF!.documentAttributes()!, copyItems: true)
-                                if ((appPDF?.isEncrypted) != nil) {
-                                    attributes.setValue(self.password, forKey: (kCGPDFContextUserPassword as NSString) as String)
-                                    attributes.setValue(self.password, forKey: (kCGPDFContextOwnerPassword as NSString) as String)
-                                    isSuccessfully = appPDF?.write(toFile: self.fileSavePath, withOptions: (attributes as? [CPDFDocumentWriteOption : Any])) ?? false
-                                } else {
-                                    isSuccessfully = appPDF?.write(toFile: self.fileSavePath) ?? false
-                                }
-                                if self.isSaveAsText {
-                                    var savetextPath = kImageToPDFFolderPath?.stringByAppendingPathComponent("Untitled OCR").stringByAppendingPathExtension("txt")
-                                    if self.saveAsTestPath.isEmpty == false {
-                                        savetextPath = self.saveAsTestPath.stringByAppendingPathComponent("Untitled OCR").stringByAppendingPathExtension("txt")
-                                    }
-                                    savetextPath = self.getUniqueFilePath(savetextPath ?? "")
-                                    try? self.OCRResultString.write(to: URL(fileURLWithPath: savetextPath ?? ""), atomically: true, encoding: .utf8)
-                                    NSWorkspace.shared.selectFile(savetextPath, inFileViewerRootedAtPath: "")
-                                }
-                                try? FileManager.default.removeItem(atPath: savePath ?? "")
-                                DispatchQueue.main.async {
-                                    self.completeBlock?(self.fileSavePath, self.errorArray as! Array<Any>, self.errorOCRArray as! Array<Any>)
-                                }
-                            }
-                        }
-                    }else{
-                        let pre = Float(index + 1) / (Float(photoArray?.count ?? 0) * 1.0)
-                        DispatchQueue.main.async {
-                            self.imageTopdfDelegate?.imageToPDFMethod(self, progress: pre)
-                        }
-                    }
-                }
-            } else {
-                let filePath: String = photoArray?[index] as! String
-                let model = KMImageModel(filepath: filePath)
-                let tString = model.photoName.deletingPathExtension.lastPathComponent
-                var savePath = fileSavePath.stringByAppendingPathComponent(tString).stringByAppendingPathExtension("pdf")
-                savePath = getUniqueFilePath(savePath)
-                KMGOCRManager.default().createPDFFile(savePath, imagePaths: [filePath], results: [results as Any], scale: 1.0)
-                var tFileName = fileSavePath.stringByAppendingPathComponent(tString).stringByAppendingPathExtension("txt")
-                tFileName = getUniqueFilePath(tFileName)
-                if isSaveAsText {
-                    var string: String = ""
-                    if results!.count > 0 {
-                        guard let firstResult: KMGOCRResult = results?.first else {
-                            return
-                        }
-                        string = firstResult.text
-                        try? string.write(toFile: tFileName, atomically: true, encoding: .utf8)
-                    }
-                }
-                if index < (photoArray?.count ?? 0) - 1 {
-                    let pre = Float(index + 1) / Float(photoArray?.count ?? 1)
-                    DispatchQueue.main.async {
-                        self.imageTopdfDelegate?.imageToPDFMethod(self, progress: pre)
-                    }
-                } else {
-                    DispatchQueue.main.async {
-                        self.completeBlock?(savePath, self.errorArray as! Array<Any>, self.errorOCRArray as! Array<Any>)
-                    }
-                }
-            }
-        }
-    }
-    
-    static func supportedImageTypes() -> [String] {
-        return ["jpg", "cur", "bmp", "jpeg", "gif", "png", "tiff", "tif", "ico", "icns", "tga", "psd", "eps", "hdr", "jp2", "jpc", "pict", "sgi"]
-    }
-    
-}

+ 0 - 466
PDF Office/PDF Master/KMClass/ImageToPDF/View/KMBatchTableCellView.swift

@@ -1,466 +0,0 @@
-//
-//  KMBatchTableCellView.swift
-//  PDF Reader Pro
-//
-//  Created by kdanmobile on 2023/10/27.
-//
-
-import Cocoa
-
-typealias batchTableCellComboboxMouseDownCallback = (_ mouseDown: Bool) -> ()
-typealias batchTableCellRemoveFileCallBack = (_ file: KMBatchOperateFile) -> ()
-
-@objc enum KMBatchTableCellViewType: Int {
-    case Size = 0
-    case PageRange
-    case FileName
-    case Status
-    case DPI
-    case Dimensions
-}
-
-class KMBatchTableCellCombobox: KMComboBox{
-    var mouseDownCallback: batchTableCellComboboxMouseDownCallback?
-    override func mouseDown(with event: NSEvent) {
-        super.mouseDown(with: event)
-        if (self.mouseDownCallback != nil) {
-            self.mouseDownCallback!(true)
-        }
-    }
-}
-
-class KMBatchTableCellView: NSTableCellView,NSComboBoxDelegate{
-    var removeFileCallBack: batchTableCellRemoveFileCallBack?
-    var pageRangeCombobox: KMBatchTableCellCombobox?
-    var errorTextField: NSTextField?
-    var statusView: NSView?
-    var removeButton: KMButton?
-    var progressIndicator: NSProgressIndicator?
-    var type: KMBatchTableCellViewType?
-    var file: KMBatchOperateFile?
-    var DPIComboBox: KMBatchTableCellCombobox?
-    var indicateImageView: NSImageView?
-    var comboBoxContent: String?
-    
-    var fileIv: NSImageView?
-    
-    deinit {
-        DistributedNotificationCenter.default().removeObserver(self)
-    }
-    
-    convenience init(type: KMBatchTableCellViewType) {
-        self.init()
-        switch type {
-        case .Size:
-            configuUIForSize()
-        case .Dimensions:
-            configuUIForSize()
-        case .PageRange:
-            configuUIForPageRange()
-        case .FileName:
-            configuUIForFileName()
-        case .Status:
-            configuUIForStatus()
-        case .DPI:
-            configuUIForDPI()
-        default:
-            break
-        }
-        DistributedNotificationCenter.default().addObserver(self, selector: #selector(themeChanged(notification:)), name: NSNotification.Name("AppleInterfaceThemeChangedNotification"), object: nil)
-        self.type = type
-    }
-    func configuUIForSize() {
-        let tf = NSTextField(frame: .zero)
-        self.textField = tf
-        self.textField?.isBordered = false
-        self.textField?.drawsBackground = true
-        self.textField?.backgroundColor = NSColor.clear
-        self.textField?.isEditable = false
-        self.addSubview(self.textField!)
-        self.textField?.mas_makeConstraints({ make in
-//            make?.top.equalTo()(self)?.offset()(13)
-            make?.left.equalTo()(self)?.offset()(8)
-            make?.centerY.equalTo()(self)
-            
-        })
-        self.textField?.textColor = KMAppearance.Layout.h0Color()
-        self.textField?.font = NSFont.systemFont(ofSize: 12)
-    }
-    func configuUIForPageRange() {
-        self.pageRangeCombobox = KMBatchTableCellCombobox(frame: .zero)
-        self.pageRangeCombobox?.focusRingType = .none
-        self.pageRangeCombobox?.type = .none
-        self.pageRangeCombobox?.wantsLayer = true
-        self.pageRangeCombobox?.layer?.backgroundColor = KMAppearance.Layout.l1Color().cgColor
-        self.pageRangeCombobox?.layer?.borderWidth = 1.0
-        self.pageRangeCombobox?.layer?.borderColor = KMAppearance.Interactive.s0Color().cgColor
-        self.pageRangeCombobox?.layer?.cornerRadius = 1.0
-        self.pageRangeCombobox?.backgroundColor = KMAppearance.Layout.l1Color()
-        self.addSubview(self.pageRangeCombobox!)
-        self.pageRangeCombobox?.mas_makeConstraints({ make in
-            make?.left.equalTo()(self)
-            make?.right.equalTo()(self)?.offset()(-20)
-            make?.top.equalTo()(self)?.offset()(10)
-        })
-        let choiceArray = [
-            "  \(NSLocalizedString("All Pages", comment: ""))",
-            "  \(NSLocalizedString("Odd Pages Only", comment: ""))",
-            "  \(NSLocalizedString("Even Pages Only", comment: ""))",
-            "  \(NSLocalizedString("e.g. 1,3-5,10", comment: ""))"
-        ]
-        self.pageRangeCombobox?.addItems(withObjectValues: choiceArray)
-        let placeholderString = "  \(NSLocalizedString("e.g. 1,3-5,10", comment: ""))"
-        //        self.pageRangeCombobox!.cell.placeholderString = placeholderString
-        self.pageRangeCombobox?.selectItem(at: 0)
-        self.pageRangeCombobox?.isEditable = false
-        self.pageRangeCombobox?.delegate = self
-        self.comboBoxContent = placeholderString
-        
-        self.updateViewColor()
-        self.pageRangeCombobox?.mouseDownCallback = { [weak self] mouseDown in
-            let itemIdex = self?.pageRangeCombobox?.indexOfSelectedItem ?? 0
-            if itemIdex == 3 {//KMBatchOperatePageChoice.Input
-                if self?.comboBoxContent == placeholderString {
-                    self?.pageRangeCombobox?.stringValue = ""
-                } else {
-                    self?.pageRangeCombobox?.stringValue = (self?.comboBoxContent) ?? ""
-                }
-            }
-        }
-    }
-    func configuUIForFileName() {
-        var iv = NSImageView()
-        fileIv = iv
-        self.addSubview(iv)
-        iv.mas_makeConstraints { make in
-            make?.centerY.equalTo()(self)
-            make?.left.equalTo()(self)?.offset()(8)
-            make?.size.mas_equalTo()(NSMakeSize(40, 56))
-        }
-        
-        var tf = NSTextField(frame: .zero)
-        self.textField = tf
-        self.textField?.isBordered = false
-        self.textField?.drawsBackground = true
-        self.textField?.backgroundColor = NSColor.clear
-        self.textField?.isEditable = false
-        self.textField?.maximumNumberOfLines = 1
-        self.textField?.lineBreakMode = .byTruncatingMiddle
-        self.addSubview(self.textField!)
-        self.textField?.mas_makeConstraints({ make in
-//            make?.top.equalTo()(self)?.offset()(13)
-            make?.centerY.equalTo()(self)
-            make?.left.equalTo()(iv.mas_right)?.offset()(4)
-            make?.right.equalTo()(self)?.offset()(-10)
-        })
-        self.textField?.font = NSFont.systemFont(ofSize: 12)
-        self.textField?.textColor = KMAppearance.Layout.h0Color()
-        self.errorTextField = NSTextField(frame: .zero)
-        self.errorTextField?.isBordered = false
-        self.errorTextField?.drawsBackground = true
-        self.errorTextField?.backgroundColor = NSColor.clear
-        self.errorTextField?.isEditable = false
-        self.errorTextField?.font = NSFont.systemFont(ofSize: 12)
-        self.errorTextField?.textColor = KMAppearance.Status.errColor()
-        self.errorTextField?.lineBreakMode = .byTruncatingMiddle
-        self.addSubview(self.errorTextField!)
-        self.errorTextField?.mas_makeConstraints({ make in
-            make?.top.equalTo()(self.textField?.mas_bottom)
-            make?.left.equalTo()(self)
-            make?.bottom.equalTo()(self)?.offset()(-11)
-            make?.right.equalTo()(self.mas_right)
-        })
-    }
-    func configuUIForStatus() {
-        self.statusView = NSView(frame: .zero)
-        self.statusView?.wantsLayer = true
-        self.addSubview(self.statusView!)
-        self.statusView?.mas_makeConstraints({ make in
-            make?.left.equalTo()(self)?.offset()(8)
-            make?.width.equalTo()(16)
-            make?.height.equalTo()(16)
-            make?.centerY.equalTo()(self)
-        })
-        self.indicateImageView = NSImageView(frame: .zero)
-        self.statusView?.addSubview(self.indicateImageView!)
-        
-        self.indicateImageView?.mas_makeConstraints({ make in
-            make?.edges.equalTo()(self.statusView)
-        })
-        self.progressIndicator = NSProgressIndicator(frame: .zero)
-        self.statusView?.addSubview(self.progressIndicator!)
-        
-        self.progressIndicator?.mas_makeConstraints({ make in
-            make?.edges.equalTo()(self.statusView)
-        })
-        self.progressIndicator?.maxValue = 1.0
-        self.progressIndicator?.minValue = 0
-        self.progressIndicator?.style = .spinning
-        self.progressIndicator?.controlSize = .small
-        self.removeButton = KMButton(image: NSImage(named: KMImageNameUXIconBtnCloseNor)!, target: self, action: #selector(deleteFile(sender:)))
-        self.removeButton?.isBordered = false
-        self.removeButton?.isHidden = true
-//        self.addSubview(self.removeButton!)
-//        self.removeButton?.mas_makeConstraints({ make in
-//            //            make?.left.equalTo()(self)?.offset()(10)
-//            make?.centerY.equalTo()(self)
-//            make?.right.equalTo()(self)?.offset()(0)
-//            make?.width.equalTo()(20)
-//            make?.height.equalTo()(20)
-//        })
-        self.removeButton!.mouseMoveCallback = { [weak self] mouseEntered in
-            if mouseEntered {
-                self?.removeButton?.image = NSImage(named: KMImageNameUXIconBtnCloseHov)
-            } else {
-                self?.removeButton?.image = NSImage(named: KMImageNameUXIconBtnCloseNor)
-            }
-        }
-    }
-    func configuUIForDPI() {
-        self.DPIComboBox = KMBatchTableCellCombobox(frame: .zero)
-        self.DPIComboBox?.focusRingType = .none
-        self.DPIComboBox?.type = .none
-        self.DPIComboBox?.wantsLayer = true
-        self.DPIComboBox?.layer?.backgroundColor = KMAppearance.Layout.l1Color().cgColor
-        self.DPIComboBox?.layer?.borderWidth = 1.0
-        self.DPIComboBox?.layer?.borderColor = KMAppearance.Interactive.s0Color().cgColor
-        self.DPIComboBox?.layer?.cornerRadius = 1.0
-        self.DPIComboBox?.backgroundColor = KMAppearance.Layout.l1Color()
-        self.addSubview(self.DPIComboBox!)
-        
-        let DPIArray = ["50 dpi", "72 dpi", "96 dpi", "150 dpi", "300 dpi", "600 dpi"]
-        self.DPIComboBox?.addItems(withObjectValues: DPIArray)
-        self.DPIComboBox?.selectItem(at: 0)
-        self.DPIComboBox?.isEditable = false
-     
-        self.DPIComboBox?.delegate = self
-        self.DPIComboBox?.mas_makeConstraints({ make in
-            make?.left.equalTo()(self)
-            make?.right.equalTo()(self)?.offset()(-20)
-            make?.top.equalTo()(self)?.offset()(11)
-            make?.bottom.equalTo()(self)?.offset()(-11)
-        })
-    }
-    @objc func themeChanged(notification: NSNotification) {
-        DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
-            self.updateViewColor()
-        }
-    }
-    @objc func deleteFile(sender: Any) {
-        if (self.removeFileCallBack != nil) {
-            self.removeFileCallBack!(self.file!)
-        }
-    }
-    func updateViewColor() {
-        if KMAppearance.isDarkMode() {
-            self.DPIComboBox?.backgroundColor = NSColor(red: 0.224, green: 0.235, blue: 0.243, alpha: 1)
-            self.DPIComboBox?.layer!.backgroundColor = NSColor(red: 0.224, green: 0.235, blue: 0.243, alpha: 1).cgColor
-            self.DPIComboBox?.layer!.borderColor = NSColor(red: 0.337, green: 0.345, blue: 0.353, alpha: 1).cgColor
-            self.pageRangeCombobox?.backgroundColor = NSColor(red: 0.224, green: 0.235, blue: 0.243, alpha: 1)
-            self.pageRangeCombobox?.layer!.backgroundColor = NSColor(red: 0.224, green: 0.235, blue: 0.243, alpha: 1).cgColor
-            self.pageRangeCombobox?.layer!.borderColor = NSColor(red: 0.337, green: 0.345, blue: 0.353, alpha: 1).cgColor
-        } else {
-            self.DPIComboBox?.backgroundColor = NSColor.white
-            self.DPIComboBox?.layer!.backgroundColor = NSColor.white.cgColor
-            self.DPIComboBox?.layer!.borderColor = NSColor(red: 0.855, green: 0.859, blue: 0.871, alpha: 1).cgColor
-            self.pageRangeCombobox?.backgroundColor = NSColor.white
-            self.pageRangeCombobox?.layer!.backgroundColor = NSColor.white.cgColor
-            self.pageRangeCombobox?.layer!.borderColor = NSColor(red: 0.855, green: 0.859, blue: 0.871, alpha: 1).cgColor
-        }
-    }
-    func updateInterface(_ file: KMBatchOperateFile) {
-        self.file = file
-        if self.type == .Size {
-            self.textField?.stringValue = file.sizeString
-        } else if self.type == .FileName {
-            if (file.error != nil) {
-                self.errorTextField?.stringValue = file.error!.localizedDescription
-                self.errorTextField?.isHidden = false
-            } else {
-                self.errorTextField?.isHidden = true
-            }
-            let theImage = NSImage(contentsOfFile: file.filePath)
-
-            var image: NSImage?
-            var size = theImage?.size ?? .zero
-            
-            let ivW: CGFloat = 40
-            let ivH: CGFloat = 56
-            let max = max(size.width, size.height)
-            if max > 0 {
-                if size.width > size.height {
-                    size.width = ivW
-                    size.height = (size.height / max) * ivW
-                } else {
-                    size.height = ivH
-                    size.width = (size.width / max) * ivH
-                }
-            }
-            
-            image = NSImage.image(with: size, drawingHandler: { rect in
-                let theRect = rect
-                let path = NSBezierPath(rect: theRect)
-                path.lineWidth = 1
-                KMNColorTools.colorBorder_3Default().setStroke()
-                
-                theImage?.draw(in: theRect)
-                
-                path.stroke()
-                return true
-            })
-            
-            self.fileIv?.image = image
-            self.textField?.stringValue = file.filePath.lastPathComponent
-        } else if self.type == .PageRange {
-            self.pageRangeCombobox?.isEnabled = self.file!.status != .processing
-            self.pageRangeCombobox?.delegate = nil
-            self.pageRangeCombobox?.selectItem(at: file.currentOperateInfo?.pageChoice.rawValue ?? 0)
-            self.pageRangeCombobox?.isEditable = false
-            if file.currentOperateInfo?.pageChoice == .Input {
-                self.pageRangeCombobox?.isEditable = true
-                self.pageRangeCombobox?.stringValue = file.currentOperateInfo?.pageRangeString ?? ""
-            }
-            self.pageRangeCombobox?.delegate = self
-        } else if self.type == .Status {
-            if file.status == .Waiting {
-                self.indicateImageView?.isHidden = false
-                self.progressIndicator?.isHidden = true
-                
-                self.indicateImageView?.image = NSImage(named: "KMImageNameImageToPDFWait")
-            } else if file.status == .Success {
-                self.indicateImageView?.isHidden = false
-                self.progressIndicator?.isHidden = true
-                self.indicateImageView?.image = NSImage(named: "KMImageNameUXIconProgressComplete")
-            } else if file.status == .Failed {
-                self.indicateImageView?.isHidden = false
-                self.progressIndicator?.isHidden = true
-                self.indicateImageView?.image = NSImage(named: "KMImageNameUXIconProgressFailure")
-            } else if file.status == .processing {
-                self.indicateImageView?.isHidden = true
-                self.progressIndicator?.isHidden = false
-                self.progressIndicator?.startAnimation(nil)
-            } else {
-                self.indicateImageView?.isHidden = false
-                self.progressIndicator?.isHidden = true
-                
-                self.indicateImageView?.image = NSImage(named: "KMImageNameImageToPDFWait")
-            }
-        } else if self.type == .DPI {
-            switch self.file?.dpi {
-            case 50:
-                self.DPIComboBox?.selectItem(at: 0)
-            case 72:
-                self.DPIComboBox?.selectItem(at: 1)
-            case 96:
-                self.DPIComboBox?.selectItem(at: 2)
-            case 150:
-                self.DPIComboBox?.selectItem(at: 3)
-            case 300:
-                self.DPIComboBox?.selectItem(at: 4)
-            case 600:
-                self.DPIComboBox?.selectItem(at: 5)
-            default:
-                break
-            }
-            self.DPIComboBox?.isEnabled = self.file?.status != .processing
-        } else if self.type == .Dimensions {
-            
-        }
-    }
-    func updateInterface( file: KMBatchOperateFile, progress: Float) {
-        updateInterface(file)
-        if progress > 0 && file.status == .processing {
-            self.progressIndicator?.doubleValue = Double(progress)
-            self.progressIndicator?.startAnimation(nil)
-            self.progressIndicator?.isIndeterminate = false
-        }
-    }
-    func updateInterface(isProgress progress: Int) {
-        if progress == -1 {
-            self.indicateImageView?.isHidden = false
-            self.progressIndicator?.isHidden = true
-            self.indicateImageView?.image = NSImage(named: "KMImageNameUXIconProgressFailure")
-        } else if progress == 0 {
-            self.indicateImageView?.isHidden = false
-            self.progressIndicator?.isHidden = true
-            self.indicateImageView?.image = NSImage(named: KMImageNameUXIconProgressWaiting)
-        } else {
-            self.indicateImageView?.isHidden = false
-            self.progressIndicator?.isHidden = true
-            self.indicateImageView?.image = NSImage(named: "KMImageNameUXIconProgressComplete")
-        }
-    }
-    func controlTextDidEndEditing(_ obj: Notification) {
-        if let data = self.pageRangeCombobox?.isEqual(obj.object), data {
-            self.file?.currentOperateInfo?.pageRangeString = self.pageRangeCombobox!.stringValue
-            if self.file?.currentOperateInfo?.pagesArray == nil {
-                let alert = NSAlert()
-                alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
-                alert.alertStyle = .critical
-                alert.messageText = self.file!.filePath.lastPathComponent.lastPathComponent + NSLocalizedString("Invalid page range or the page number is out of range. Please try again.", comment: "")
-                alert.beginSheetModal(for: self.window!, completionHandler: nil)
-                self.pageRangeCombobox?.selectItem(at: 0)
-                self.file?.currentOperateInfo?.pageChoice = .All
-            }
-        }
-    }
-    func controlTextDidChange(_ obj: Notification) {
-        let comboBox: NSComboBox = obj.object as! NSComboBox;
-        if comboBox.isEqual(self.pageRangeCombobox) {
-            self.comboBoxContent = comboBox.stringValue;
-        }
-    }
-    
-    func comboBoxSelectionDidChange(_ notification: Notification) {
-        if notification.object as? NSComboBox == self.pageRangeCombobox {
-            self.pageRangeCombobox?.delegate = nil
-            self.file?.currentOperateInfo!.pageChoice = self.tromsformPageChoice(index: self.pageRangeCombobox?.indexOfSelectedItem ?? 0)
-            if self.pageRangeCombobox?.indexOfSelectedItem == KMBatchOperatePageChoice.Input.rawValue {
-                self.pageRangeCombobox?.isEditable = true
-                self.pageRangeCombobox?.isSelectable = true
-                self.window?.makeFirstResponder(self.pageRangeCombobox)
-            } else {
-                self.pageRangeCombobox?.resignFirstResponder()
-                self.pageRangeCombobox?.isEditable = false
-                self.pageRangeCombobox?.isSelectable = false
-            }
-            self.pageRangeCombobox?.delegate = self
-        } else if notification.object as? NSComboBox == self.DPIComboBox {
-            switch self.DPIComboBox?.indexOfSelectedItem
-            {
-            case 0:
-                self.file?.currentConvertParameter?.dpi = 50
-            case 1:
-                self.file?.currentConvertParameter?.dpi = 72
-            case 2:
-                self.file?.currentConvertParameter?.dpi = 96
-            case 3:
-                self.file?.currentConvertParameter?.dpi = 150
-            case 4:
-                self.file?.currentConvertParameter?.dpi = 300
-            case 5:
-                self.file?.currentConvertParameter?.dpi = 600
-            default:
-                break
-            }
-        }
-    }
-    func tromsformPageChoice(index: Int) -> KMBatchOperatePageChoice {
-        var pageChoice: KMBatchOperatePageChoice?
-        switch index {
-        case 0:
-            pageChoice = .All
-        case 1:
-            pageChoice = .Odd
-        case 2:
-            pageChoice = .Even
-        case 3:
-            pageChoice = .Input
-        default:
-            pageChoice = .All
-        }
-        return pageChoice ?? .All
-    }
-    
-}
-

+ 0 - 132
PDF Office/PDF Master/KMClass/ImageToPDF/View/KMNTableHeaderCellView.swift

@@ -1,132 +0,0 @@
-//
-//  KMNTableHeaderCellView.swift
-//  PDF Reader Pro
-//
-//  Created by User-Tangchao on 2024/11/7.
-//
-
-import Cocoa
-
-class KMNTableHeaderCellView: NSTableCellView {
-    private var contentBox: NSBox = {
-        let box = NSBox()
-        box.boxType = .custom
-        box.titlePosition = .noTitle
-        box.contentViewMargins = .zero
-        box.borderWidth = 0
-        return box
-    }()
-    
-    private var titleLabel_: NSTextField = {
-        let view = NSTextField(labelWithString: "")
-        return view
-    }()
-    
-    private var leftVLine_: NSView = {
-        let view = NSView()
-        return view
-    }()
-    
-    private var rightVLine_: NSView = {
-        let view = NSView()
-        return view
-    }()
-    
-    private var bottomLine_: NSView = {
-        let view = NSView()
-        return view
-    }()
-    
-    private var button_: NSButton = {
-        let view = NSButton()
-        view.isBordered = false
-        view.title = ""
-        return view
-    }()
-    
-    var titleLabel: NSTextField {
-        get {
-            return self.titleLabel_
-        }
-    }
-    
-    var leftLine: NSView {
-        get {
-            return self.leftVLine_
-        }
-    }
-    
-    var rightLine: NSView {
-        get {
-            return self.rightVLine_
-        }
-    }
-    
-    var bottomLine: NSView {
-        get {
-            return self.bottomLine_
-        }
-    }
-    
-    var itemClick: KMCommonClickBlock?
-
-    override func draw(_ dirtyRect: NSRect) {
-        super.draw(dirtyRect)
-
-        // Drawing code here.
-    }
-    
-    convenience init() {
-        self.init(frame: .init(x: 0, y: 0, width: 40, height: 40))
-        
-        initSubviews()
-    }
-    
-    override func awakeFromNib() {
-        super.awakeFromNib()
-        
-        initSubviews()
-    }
-    
-    func initSubviews() {
-        addSubview(contentBox)
-        contentBox.km_add_inset_constraint()
-        
-        contentBox.contentView?.addSubview(leftVLine_)
-        contentBox.contentView?.addSubview(titleLabel_)
-        contentBox.contentView?.addSubview(rightVLine_)
-        contentBox.contentView?.addSubview(bottomLine_)
-        
-        leftVLine_.km_add_leading_constraint()
-        leftVLine_.km_add_top_constraint(constant: 4)
-        leftVLine_.km_add_bottom_constraint(constant: -4)
-        leftVLine_.km_add_width_constraint(constant: 0.5)
-        
-        titleLabel_.km_add_leading_constraint(constant: 8)
-        titleLabel_.km_add_centerY_constraint()
-        
-        rightVLine_.km_add_trailing_constraint()
-        rightVLine_.km_add_top_constraint(constant: 4)
-        rightVLine_.km_add_bottom_constraint(constant: -4)
-        rightVLine_.km_add_width_constraint(constant: 0.5)
-        
-        bottomLine_.km_add_bottom_constraint(constant: 0)
-        bottomLine_.km_add_leading_constraint(constant: 0)
-        bottomLine_.km_add_trailing_constraint(constant: 0)
-        bottomLine_.km_add_height_constraint(constant: 1)
-        
-        contentBox.fillColor = .clear
-        
-        contentBox.addSubview(button_)
-        button_.bounds = contentBox.contentView?.bounds ?? .zero
-        button_.autoresizingMask = [.width, .height]
-        button_.target = self
-        button_.action = #selector(_buttonAction)
-    }
-    
-    // MARK: - Private Methods
-    
-    @objc private func _buttonAction() {
-        self.itemClick?(1)
-    }
-}

+ 0 - 58
PDF Office/PDF Master/KMClass/ImageToPDF/View/KMTableHeaderCell.swift

@@ -1,58 +0,0 @@
-//
-//  KMTableHeaderCell.swift
-//  PDF Reader Pro
-//
-//  Created by kdanmobile on 2023/10/26.
-//
-
-import Cocoa
-
-class KMTableHeaderCell: NSTableHeaderCell{
-    override init(textCell string: String) {
-        super.init(textCell: string)
-        self.drawsBackground = false
-    }
-    
-    required init(coder: NSCoder) {
-        super.init(coder: coder)
-    }
-    
-    override func draw(withFrame cellFrame: NSRect, in controlView: NSView) {
-        super.draw(withFrame: cellFrame, in: controlView)
-        cellFrame.fill()
-        KMAppearance.Layout.l_2Color().set()
-        self.drawInterior(withFrame: cellFrame, inView: controlView)
-    }
-    
-    func drawInterior(withFrame cellFrame: NSRect, inView controlView: NSView) {
-        var titleRect = self.titleRect(forBounds: cellFrame)
-        titleRect.fill()
-        KMAppearance.Layout.l_2Color().set()
-        
-        let layoutManager = NSLayoutManager()
-        let lineHeight = layoutManager.defaultLineHeight(for: self.font!)
-        titleRect.origin.y = (titleRect.size.height - lineHeight) / 2.0
-        titleRect.size.height = lineHeight
-        
-        if self.alignment == NSTextAlignment.left {
-            self.attributedStringValue.draw(with: titleRect, options: .usesLineFragmentOrigin)
-        } else if self.alignment == NSTextAlignment.center {
-            let width = self.widthOfString(self.title, withFont: self.font!)
-            titleRect.origin.x += (titleRect.size.width - width) / 2.0
-            titleRect.size.width = width
-            self.attributedStringValue.draw(with: titleRect, options: .usesLineFragmentOrigin)
-        } else {
-            self.attributedStringValue.draw(with: titleRect, options: .usesLineFragmentOrigin)
-        }
-    }
-    func drawSortIndicator(withFrame cellFrame: NSRect, inView controlView: NSView, ascending: Bool, priority: Int) { 
-        
-    }
-    override func sortIndicatorRect(forBounds rect: NSRect) -> NSRect {
-        return NSRect.zero
-    }
-    func widthOfString(_ string: String, withFont font: NSFont) -> CGFloat {
-        let attributes = [NSAttributedString.Key.font: font]
-        return NSAttributedString(string: string, attributes: attributes).size().width
-    }
-}

+ 0 - 19
PDF Office/PDF Master/KMClass/ImageToPDF/Window/KMBatchWindow.swift

@@ -1,19 +0,0 @@
-//
-//  KMBatchWindow.swift
-//  PDF Reader Pro
-//
-//  Created by kdanmobile on 2023/10/24.
-//
-
-import Cocoa
-import PDFKit
-
-@objcMembers class KMBatchWindow: NSWindow{
-
-    var isBatch: Bool?
-    override func awakeFromNib() {
-        super.awakeFromNib()
-        self.animationBehavior = .alertPanel
-    }
-}
-

+ 3 - 3
PDF Office/PDF Master/KMClass/KMHomeViewController/KMNHomeViewController.swift

@@ -412,7 +412,7 @@ extension KMNHomeViewController {
     
     func imageToPDFAction() {
         let openPanel = NSOpenPanel()
-        openPanel.allowedFileTypes = KMImageToPDFMethod.supportedImageTypes()
+        openPanel.allowedFileTypes = KMBatchManager.supportedImageTypes()
         //MARK: 允许多选还是单选,如果是付费用户允许多选
         openPanel.allowsMultipleSelection = true
         openPanel.message = NSLocalizedString("Select images to create a new document. To select multiple files press cmd ⌘ button on keyboard and click on the target files one by one.", comment: "")
@@ -459,7 +459,7 @@ extension KMNHomeViewController {
         }
         let openPanel = NSOpenPanel()
         
-        var arr = KMImageToPDFMethod.supportedImageTypes()
+        var arr = KMBatchManager.supportedImageTypes()
         arr.append("pdf")
         openPanel.allowedFileTypes = arr
         openPanel.allowsMultipleSelection = false
@@ -477,7 +477,7 @@ extension KMNHomeViewController {
     
     func fastTool_ConvertPDF() {    // 转换PDF
         let openPanel = NSOpenPanel()
-        var arr = KMImageToPDFMethod.supportedImageTypes()
+        var arr = KMBatchManager.supportedImageTypes()
         arr.append("pdf")
         openPanel.allowedFileTypes = ["pdf","PDF"]
         //MARK: 允许多选还是单选,如果是付费用户允许多选

+ 1 - 17
PDF Office/PDF Master/KMClass/KMPDFViewController/KMMainViewController.swift

@@ -1771,13 +1771,6 @@ struct KMNMWCFlags {
         securityWindowController.documentURL = self.listView.document?.documentURL
         securityWindowController.batchAction = { [unowned self] controller, files in
             self.view.window?.endSheet((securityWindowController.window)!)
-            
-            
-//            let batchWindowController = KMBatchOperateWindowController.sharedWindowController
-//            let batchOperateFile = KMBatchOperateFile(filePath: self.document?.documentURL.path ?? "", type: .AddPassword)
-//            batchWindowController.switchToOperateType(.AddPassword, files: [batchOperateFile])
-//            batchWindowController.window?.makeKeyAndOrderFront("")
-            
             self.showBatchWindow(type: .security, files: [URL(fileURLWithPath: self.document?.documentURL.path ?? "")])
         }
         
@@ -2881,14 +2874,6 @@ struct KMNMWCFlags {
         progressC = nil
     }
     
-    func converFilesToPath(files: Array<KMBatchOperateFile>) -> [String] {
-        let newArr = NSMutableArray()
-        for item in files {
-            newArr.add(item.filePath)
-        }
-        return newArr as! [String]
-    }
-    
     //MARK: - 打印
     internal func showPrintWindow(pageRange: KMPrintPageRange = KMPrintPageRange(type: .allPage, selectPages: [])) {
         self.saveDocument()
@@ -4382,8 +4367,7 @@ extension KMMainViewController: KMPDFToolbarControllerDelegate {
                 self.showConvertWindow(.jpeg)
                 
             } else if itemIdentifier == KMPDFToolbar_convert_imageToPDF_Identifier {
-                NSApplication.ShowImageToPDFWindow()
-                
+                self.showBatchWindow(type: .imageToPDF, files: [])
             }
             self.refreshToolbarRightViewInfo()
             

+ 8 - 0
PDF Office/PDF Master/KMClass/NewBatch/Manager/KMBatchManager.swift

@@ -18,6 +18,10 @@ enum KMBatchManagerSate: Int, CaseIterable {
 let kBacthFilesProcessNotification = "kBacthFilesProcessNotification"
 let kBacthProcessNotification = "kBacthProcessNotification"
 
+let supportDirectory = NSSearchPathForDirectoriesInDomains(.applicationSupportDirectory, .userDomainMask, true).last
+let mainBundleIdentifier = Bundle.main.bundleIdentifier ?? ""
+let kTempSavePath = supportDirectory?.stringByAppendingPathComponent(mainBundleIdentifier)
+
 class KMBatchManager: NSObject {
     public static let manager = KMBatchManager()
     fileprivate(set) var state: KMBatchManagerSate = .unknow
@@ -1076,6 +1080,10 @@ extension KMBatchManager {
         }
         return isContainFiles
     }
+    
+    static func supportedImageTypes() -> [String] {
+        return ["jpg", "cur", "bmp", "jpeg", "gif", "png", "tiff", "tif", "ico", "icns", "tga", "psd", "eps", "hdr", "jp2", "jpc", "pict", "sgi"]
+    }
 }
 
 //MARK: Alert

+ 2 - 2
PDF Office/PDF Master/KMClass/NewBatch/View/Setting/ImageToPDF/KMBatchImageToPDFView.xib

@@ -1,8 +1,8 @@
 <?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">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="23504" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="23504"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>

+ 2 - 2
PDF Office/PDF Master/KMClass/Secure/Window/KMPasswordInputWindow.xib

@@ -1,8 +1,8 @@
 <?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">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="23504" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="23504"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>

+ 0 - 39
PDF Office/PDF Master/KMClass/Tools/Category/Foundation/NSObject+KMExtension.swift

@@ -551,46 +551,7 @@ typealias KMApp = NSApplication
 
 extension NSApplication {
     public static let interfaceThemeChangedNotification = NSNotification.Name("AppleInterfaceThemeChangedNotification")
-    
-    public static func ShowImageToPDFWindow(urls: [URL] = [], callback:((NSWindowController)->Void)? = nil) {
-        var files: [KMBatchOperateFile] = []
-        for fileURL in urls {
-            let img = NSImage(contentsOfFile: fileURL.path)
-            if NSDocument.isDamage(url: fileURL) {
-                let alert = NSAlert()
-                alert.alertStyle = .critical
-                alert.messageText = String(format: KMLocalizedString("The file \"%@\" could not be opened."), fileURL.path.lastPathComponent)
-                alert.informativeText = NSLocalizedString("It may be damaged or use a file format that PDF Reader Pro doesn’t recognize.", comment: "")
-                alert.addButton(withTitle: NSLocalizedString("Cancel", comment: ""))
-                alert.beginSheetModal(for: NSApp.mainWindow!) { _ in }
-                continue
-            }
-            let file = KMBatchOperateFile(filePath: fileURL.path, type: .CreatePDF)
-            files.append(file)
-        }
-        Task { @MainActor in
-            let baseWindowController = KMBatchWindowController.manager
-            baseWindowController.window?.makeKeyAndOrderFront(nil)
-            baseWindowController.type = .imageToPDF
-            baseWindowController.inputData = urls
-
-            guard let block = callback else {
-                return
-            }
-            block(baseWindowController)
-        }
-    }
-    
-    public static func ShowImageToPDFWindow(urls: [URL] = []) async -> NSWindowController {
-        return await withCheckedContinuation({ continuation in
-            self.ShowImageToPDFWindow(urls: urls) { windowC in
-                continuation.resume(returning: windowC)
-            }
-        })
-    }
-    
     // 新建空白文档
-    
     public static func newBlankDocument() {
         let panel = NSSavePanel()
         panel.allowedFileTypes = ["pdf"]

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 836
PDF Office/PDF Reader Pro.xcodeproj/project.pbxproj