Browse Source

【2025】【PageEdit】补充页面编辑UI

dinglingui 4 months ago
parent
commit
3934cd6590
19 changed files with 2639 additions and 120 deletions
  1. 11 11
      PDF Office/PDF Master/Class/PDFTools/PageEdit/Window/KMPDFEditInsertPageWindow.xib
  2. 115 0
      PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNPDFExtract/KMNExtractPDFWindowController.swift
  3. 137 0
      PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNPDFExtract/KMNExtractPDFWindowController.xib
  4. 443 4
      PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNPDFInsert/KMNPDFInsertBlankWindowController.swift
  5. 33 5
      PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNPDFInsert/KMNPDFInsertBlankWindowController.xib
  6. 178 4
      PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNPDFInsert/KMNPDFInsertClipboardWindowController.swift
  7. 13 0
      PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNPDFInsert/KMNPDFInsertClipboardWindowController.xib
  8. 235 82
      PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNPDFInsert/KMNPDFInsertPDFWindowController.swift
  9. 2 2
      PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNPDFInsert/KMNPDFInsertPDFWindowController.xib
  10. 418 0
      PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNPDFSplit/KMNSplitPDFWindowController.swift
  11. 342 0
      PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNPDFSplit/KMNSplitPDFWindowController.xib
  12. 205 0
      PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNThumbnailView/KMNPageEditViewController.swift
  13. 70 10
      PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNThumbnailView/KMNThumbnailBaseViewController.swift
  14. 34 1
      PDF Office/PDF Master/KMClass/KMPDFViewController/KMPDFViewController.swift
  15. 1 1
      PDF Office/PDF Master/KMClass/Tools/Base/KMNBaseWindowController.swift
  16. 194 0
      PDF Office/PDF Master/KMClass/Tools/KMNFileAttribute/KMNFileAttribute.swift
  17. 128 0
      PDF Office/PDF Master/KMClass/Tools/Tool/KMNPageSizeTool.swift
  18. 8 0
      PDF Office/PDF Master/KMClass/Tools/Tool/KMNTools.swift
  19. 72 0
      PDF Office/PDF Reader Pro.xcodeproj/project.pbxproj

+ 11 - 11
PDF Office/PDF Master/Class/PDFTools/PageEdit/Window/KMPDFEditInsertPageWindow.xib

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
     <dependencies>
         <deployment identifier="macosx"/>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21701"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     </dependencies>
     <objects>
     <objects>
@@ -39,7 +39,7 @@
             <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES"/>
             <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES"/>
             <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
             <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
             <rect key="contentRect" x="196" y="240" width="512" height="452"/>
             <rect key="contentRect" x="196" y="240" width="512" height="452"/>
-            <rect key="screenRect" x="0.0" y="0.0" width="1440" height="875"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="2560" height="1415"/>
             <value key="minSize" type="size" width="512" height="452"/>
             <value key="minSize" type="size" width="512" height="452"/>
             <value key="maxSize" type="size" width="512" height="381"/>
             <value key="maxSize" type="size" width="512" height="381"/>
             <view key="contentView" wantsLayer="YES" id="se5-gp-TjO">
             <view key="contentView" wantsLayer="YES" id="se5-gp-TjO">
@@ -76,13 +76,13 @@ DQ
                         <rect key="frame" x="248" y="218" width="16" height="16"/>
                         <rect key="frame" x="248" y="218" width="16" height="16"/>
                     </progressIndicator>
                     </progressIndicator>
                     <box title="Box" titlePosition="noTitle" translatesAutoresizingMaskIntoConstraints="NO" id="DRX-og-Eei">
                     <box title="Box" titlePosition="noTitle" translatesAutoresizingMaskIntoConstraints="NO" id="DRX-og-Eei">
-                        <rect key="frame" x="17" y="57" width="478" height="162"/>
+                        <rect key="frame" x="17" y="57" width="478" height="164"/>
                         <view key="contentView" id="IYV-VX-8fc">
                         <view key="contentView" id="IYV-VX-8fc">
-                            <rect key="frame" x="4" y="5" width="470" height="154"/>
+                            <rect key="frame" x="3" y="3" width="472" height="158"/>
                             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                             <subviews>
                             <subviews>
                                 <button translatesAutoresizingMaskIntoConstraints="NO" id="KpR-Eb-k9K">
                                 <button translatesAutoresizingMaskIntoConstraints="NO" id="KpR-Eb-k9K">
-                                    <rect key="frame" x="14" y="124" width="53" height="20"/>
+                                    <rect key="frame" x="14" y="128" width="53" height="20"/>
                                     <constraints>
                                     <constraints>
                                         <constraint firstAttribute="height" constant="18" id="Rmz-bL-TX1"/>
                                         <constraint firstAttribute="height" constant="18" id="Rmz-bL-TX1"/>
                                     </constraints>
                                     </constraints>
@@ -95,7 +95,7 @@ DQ
                                     </connections>
                                     </connections>
                                 </button>
                                 </button>
                                 <button translatesAutoresizingMaskIntoConstraints="NO" id="ylR-0q-ZfJ">
                                 <button translatesAutoresizingMaskIntoConstraints="NO" id="ylR-0q-ZfJ">
-                                    <rect key="frame" x="14" y="96" width="52" height="20"/>
+                                    <rect key="frame" x="14" y="100" width="52" height="20"/>
                                     <constraints>
                                     <constraints>
                                         <constraint firstAttribute="height" constant="18" id="Wi1-ef-DbJ"/>
                                         <constraint firstAttribute="height" constant="18" id="Wi1-ef-DbJ"/>
                                     </constraints>
                                     </constraints>
@@ -108,7 +108,7 @@ DQ
                                     </connections>
                                     </connections>
                                 </button>
                                 </button>
                                 <button translatesAutoresizingMaskIntoConstraints="NO" id="NBs-P3-OO5">
                                 <button translatesAutoresizingMaskIntoConstraints="NO" id="NBs-P3-OO5">
-                                    <rect key="frame" x="14" y="14" width="18" height="75"/>
+                                    <rect key="frame" x="14" y="10" width="18" height="83"/>
                                     <buttonCell key="cell" type="radio" title="Page" bezelStyle="regularSquare" imagePosition="only" alignment="left" inset="2" id="LHF-jZ-0UI">
                                     <buttonCell key="cell" type="radio" title="Page" bezelStyle="regularSquare" imagePosition="only" alignment="left" inset="2" id="LHF-jZ-0UI">
                                         <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
                                         <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
                                         <font key="font" metaFont="system"/>
                                         <font key="font" metaFont="system"/>
@@ -193,7 +193,7 @@ DQ
                         </view>
                         </view>
                     </box>
                     </box>
                     <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="a1I-lj-cSX">
                     <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="a1I-lj-cSX">
-                        <rect key="frame" x="32" y="217" width="37" height="18"/>
+                        <rect key="frame" x="32" y="219" width="37" height="18"/>
                         <constraints>
                         <constraints>
                             <constraint firstAttribute="height" constant="18" id="XaE-8z-XoX"/>
                             <constraint firstAttribute="height" constant="18" id="XaE-8z-XoX"/>
                         </constraints>
                         </constraints>
@@ -236,9 +236,9 @@ DQ
                         </connections>
                         </connections>
                     </button>
                     </button>
                     <box title="Box" titlePosition="noTitle" translatesAutoresizingMaskIntoConstraints="NO" id="AIU-6u-Lg3">
                     <box title="Box" titlePosition="noTitle" translatesAutoresizingMaskIntoConstraints="NO" id="AIU-6u-Lg3">
-                        <rect key="frame" x="17" y="251" width="478" height="120"/>
+                        <rect key="frame" x="17" y="253" width="478" height="118"/>
                         <view key="contentView" id="ksM-26-lkE">
                         <view key="contentView" id="ksM-26-lkE">
-                            <rect key="frame" x="4" y="5" width="470" height="112"/>
+                            <rect key="frame" x="3" y="3" width="472" height="112"/>
                             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                             <subviews>
                             <subviews>
                                 <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="yrx-at-WkH">
                                 <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="yrx-at-WkH">

+ 115 - 0
PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNPDFExtract/KMNExtractPDFWindowController.swift

@@ -0,0 +1,115 @@
+//
+//  KMNExtractPDFWindowController.swift
+//  PDF Reader Pro
+//
+//  Created by 丁林圭 on 2024/10/24.
+//
+
+import Cocoa
+
+import KMComponentLibrary
+
+class KMNExtractPDFWindowController: KMNBaseWindowController {
+    @IBOutlet var titleLabel: NSTextField!
+    
+    @IBOutlet var eachButton: ComponentCheckBox!
+    @IBOutlet var deleteButton: ComponentCheckBox!
+
+    @IBOutlet var cancelButton: ComponentButton!
+    @IBOutlet var extractButton: ComponentButton!
+
+    @IBOutlet var cancelWidthButton:NSLayoutConstraint!
+    @IBOutlet var extractWidthButton:NSLayoutConstraint!
+
+    private var orgDocument:CPDFDocument?
+    private var selectionIndexPaths: Set<IndexPath> = []
+    
+    private func setUpProperty() {
+        titleLabel.stringValue = KMLocalizedString("Extract")
+        titleLabel.font =  ComponentLibrary.shared.getFontFromKey("mac/body-m-medium")
+        titleLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("colorText/1")
+        
+        
+        eachButton.properties = ComponentCheckBoxProperty(size: .s,
+                                                                state: .normal,
+                                                                isDisabled: false,
+                                                                showhelp: false,
+                                                                text: KMLocalizedString("Each page in a separate file"),
+                                                                checkboxType: .normal)
+        
+        deleteButton.properties = ComponentCheckBoxProperty(size: .s,
+                                                                state: .normal,
+                                                                isDisabled: false,
+                                                                showhelp: false,
+                                                                text: KMLocalizedString("Delete pages after extraction"),
+                                                                checkboxType: .normal)
+        
+        extractButton.properties = ComponentButtonProperty(type: .primary,
+                                                          size: .s,
+                                                          state: .normal,
+                                                          isDisable: false,
+                                                          buttonText: KMLocalizedString("Extract"))
+        extractButton.setTarget(self, action: #selector(extractButtonClicked(_ :)))
+        extractWidthButton.constant = extractButton.properties.propertyInfo.viewWidth
+        
+        cancelButton.properties = ComponentButtonProperty(type: .default_tertiary,
+                                                          size: .s,
+                                                          state: .normal,
+                                                          buttonText: KMLocalizedString("Cancel"))
+        cancelButton.setTarget(self, action: #selector(cancelButtonClicked(_ :)))
+        cancelWidthButton.constant = cancelButton.properties.propertyInfo.viewWidth
+        
+        eachButton.setTarget(self, action: #selector(eachPDFAction(_:)))
+        deleteButton.setTarget(self, action: #selector(deletePDFAction(_:)))
+
+        cancelWidthButton.constant = cancelButton.properties.propertyInfo.viewWidth
+        extractWidthButton.constant = extractButton.properties.propertyInfo.viewWidth
+    }
+
+    override func windowDidLoad() {
+        super.windowDidLoad()
+
+        setUpProperty()
+        
+        if(selectionIndexPaths.count == orgDocument?.pageCount ?? 0) {
+            deleteButton.properties.isDisabled = true
+            deleteButton.reloadData()
+        }
+    }
+    
+    convenience init(_ document: CPDFDocument?, selectionIndexPaths: Set<IndexPath>) {
+        self.init(windowNibName: "KMNExtractPDFWindowController")
+        orgDocument = document
+        self.selectionIndexPaths = selectionIndexPaths  // 修正此行
+    }
+
+    convenience init(_ filePath: String,password:String?) {
+        self.init(windowNibName: "KMNExtractPDFWindowController")
+        let document = CPDFDocument.init(url: URL(fileURLWithPath: filePath))
+        if password != nil {
+            document?.unlock(withPassword: password as String?)
+        }
+
+        orgDocument = document
+        selectionIndexPaths = [IndexPath(item: 0, section: 0)]  // 修正此行
+
+    }
+    
+    //MARK: - Action
+    @objc func cancelButtonClicked(_ sender: NSView) {
+        own_closeEndSheet()
+    }
+    
+    @objc func extractButtonClicked(_ sender: NSView) {
+                
+        own_closeEndSheet()
+    }
+
+    @objc func eachPDFAction(_ sender: NSView) {
+    }
+    
+    @objc func deletePDFAction(_ sender: NSView) {
+                
+    }
+}
+

+ 137 - 0
PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNPDFExtract/KMNExtractPDFWindowController.xib

@@ -0,0 +1,137 @@
+<?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="KMNExtractPDFWindowController" customModule="PDF_Reader_Pro" customModuleProvider="target">
+            <connections>
+                <outlet property="cancelButton" destination="h6a-7F-ZuD" id="L2u-hp-OnA"/>
+                <outlet property="cancelWidthButton" destination="Gk9-QK-Pqj" id="F39-nY-5H1"/>
+                <outlet property="deleteButton" destination="7sk-Ok-YUA" id="bjz-2v-KA4"/>
+                <outlet property="eachButton" destination="rsN-ni-VsV" id="Uds-Sp-x7W"/>
+                <outlet property="extractButton" destination="erQ-jL-1NT" id="cZ2-0m-v1w"/>
+                <outlet property="extractWidthButton" destination="oI5-0q-gZ5" id="6i6-b1-JmG"/>
+                <outlet property="titleLabel" destination="FVy-lR-qve" id="uOd-FR-ylN"/>
+                <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 allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" titlebarAppearsTransparent="YES" id="F0z-JX-Cv5">
+            <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="1512" height="944"/>
+            <view key="contentView" id="se5-gp-TjO">
+                <rect key="frame" x="0.0" y="0.0" width="480" height="208"/>
+                <autoresizingMask key="autoresizingMask"/>
+                <subviews>
+                    <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="Sb6-m0-cTT">
+                        <rect key="frame" x="24" y="24" width="432" height="168"/>
+                        <view key="contentView" id="C7e-vy-v22">
+                            <rect key="frame" x="0.0" y="0.0" width="432" height="168"/>
+                            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                            <subviews>
+                                <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="FVy-lR-qve">
+                                    <rect key="frame" x="-2" y="152" width="436" height="16"/>
+                                    <textFieldCell key="cell" lineBreakMode="clipping" title="Extract" id="f9j-2x-IVQ">
+                                        <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>
+                                <box boxType="custom" borderWidth="0.0" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="lP1-hs-oYu">
+                                    <rect key="frame" x="0.0" y="0.0" width="432" height="32"/>
+                                    <view key="contentView" id="IUJ-9R-OIn">
+                                        <rect key="frame" x="0.0" y="0.0" width="432" height="32"/>
+                                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                        <subviews>
+                                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="erQ-jL-1NT" customClass="ComponentButton" customModule="KMComponentLibrary">
+                                                <rect key="frame" x="370" y="0.0" width="62" height="32"/>
+                                                <constraints>
+                                                    <constraint firstAttribute="width" constant="62" id="oI5-0q-gZ5"/>
+                                                    <constraint firstAttribute="height" constant="32" id="u4H-Qp-tjL"/>
+                                                </constraints>
+                                            </customView>
+                                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="h6a-7F-ZuD" customClass="ComponentButton" customModule="KMComponentLibrary">
+                                                <rect key="frame" x="300" y="0.0" width="62" height="32"/>
+                                                <constraints>
+                                                    <constraint firstAttribute="width" constant="62" id="Gk9-QK-Pqj"/>
+                                                    <constraint firstAttribute="height" constant="32" id="t2x-Ch-8Gm"/>
+                                                </constraints>
+                                            </customView>
+                                        </subviews>
+                                        <constraints>
+                                            <constraint firstItem="erQ-jL-1NT" firstAttribute="leading" secondItem="h6a-7F-ZuD" secondAttribute="trailing" constant="8" id="6Iy-xg-rm4"/>
+                                            <constraint firstItem="erQ-jL-1NT" firstAttribute="centerY" secondItem="h6a-7F-ZuD" secondAttribute="centerY" id="6Ly-vY-8Fd"/>
+                                            <constraint firstItem="h6a-7F-ZuD" firstAttribute="top" secondItem="IUJ-9R-OIn" secondAttribute="top" id="Dwq-fJ-8zS"/>
+                                            <constraint firstAttribute="bottom" secondItem="h6a-7F-ZuD" secondAttribute="bottom" id="d2a-32-eki"/>
+                                            <constraint firstAttribute="trailing" secondItem="erQ-jL-1NT" secondAttribute="trailing" id="jgG-0k-Cn8"/>
+                                        </constraints>
+                                    </view>
+                                </box>
+                                <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="kck-t5-I18">
+                                    <rect key="frame" x="0.0" y="48" width="432" height="88"/>
+                                    <view key="contentView" id="WFa-eA-GM7">
+                                        <rect key="frame" x="0.0" y="0.0" width="432" height="88"/>
+                                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                        <subviews>
+                                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="rsN-ni-VsV" customClass="ComponentCheckBox" customModule="KMComponentLibrary">
+                                                <rect key="frame" x="0.0" y="48" width="432" height="32"/>
+                                                <constraints>
+                                                    <constraint firstAttribute="height" constant="32" id="NBJ-um-rNV"/>
+                                                </constraints>
+                                            </customView>
+                                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="7sk-Ok-YUA" customClass="ComponentCheckBox" customModule="KMComponentLibrary">
+                                                <rect key="frame" x="0.0" y="8" width="432" height="32"/>
+                                                <constraints>
+                                                    <constraint firstAttribute="height" constant="32" id="2OG-ce-fsU"/>
+                                                </constraints>
+                                            </customView>
+                                        </subviews>
+                                        <constraints>
+                                            <constraint firstItem="7sk-Ok-YUA" firstAttribute="top" secondItem="rsN-ni-VsV" secondAttribute="bottom" constant="8" id="1ov-ec-6wo"/>
+                                            <constraint firstAttribute="trailing" secondItem="7sk-Ok-YUA" secondAttribute="trailing" id="6NW-p0-m7s"/>
+                                            <constraint firstItem="7sk-Ok-YUA" firstAttribute="leading" secondItem="WFa-eA-GM7" secondAttribute="leading" id="7gj-UQ-HTe"/>
+                                            <constraint firstAttribute="bottom" secondItem="7sk-Ok-YUA" secondAttribute="bottom" constant="8" id="FSP-An-OxK"/>
+                                            <constraint firstAttribute="trailing" secondItem="rsN-ni-VsV" secondAttribute="trailing" id="Mw6-Lk-aCu"/>
+                                            <constraint firstItem="rsN-ni-VsV" firstAttribute="leading" secondItem="WFa-eA-GM7" secondAttribute="leading" id="aUv-ip-aDc"/>
+                                            <constraint firstItem="rsN-ni-VsV" firstAttribute="top" secondItem="WFa-eA-GM7" secondAttribute="top" constant="8" id="ieK-gU-fXB"/>
+                                        </constraints>
+                                    </view>
+                                </box>
+                            </subviews>
+                            <constraints>
+                                <constraint firstItem="kck-t5-I18" firstAttribute="top" secondItem="FVy-lR-qve" secondAttribute="bottom" constant="16" id="0Xs-i1-JSs"/>
+                                <constraint firstItem="kck-t5-I18" firstAttribute="leading" secondItem="C7e-vy-v22" secondAttribute="leading" id="3TA-d8-SdS"/>
+                                <constraint firstAttribute="trailing" secondItem="lP1-hs-oYu" secondAttribute="trailing" id="7JZ-va-qbg"/>
+                                <constraint firstAttribute="trailing" secondItem="FVy-lR-qve" secondAttribute="trailing" id="P5S-B2-mWM"/>
+                                <constraint firstAttribute="bottom" secondItem="lP1-hs-oYu" secondAttribute="bottom" id="V3U-KX-999"/>
+                                <constraint firstAttribute="trailing" secondItem="kck-t5-I18" secondAttribute="trailing" id="VUx-kB-2X3"/>
+                                <constraint firstItem="lP1-hs-oYu" firstAttribute="top" secondItem="kck-t5-I18" secondAttribute="bottom" constant="16" id="bUJ-rj-s8H"/>
+                                <constraint firstItem="FVy-lR-qve" firstAttribute="top" secondItem="C7e-vy-v22" secondAttribute="top" id="e2r-NQ-h7B"/>
+                                <constraint firstItem="lP1-hs-oYu" firstAttribute="leading" secondItem="C7e-vy-v22" secondAttribute="leading" id="fh8-PL-Fqh"/>
+                                <constraint firstItem="FVy-lR-qve" firstAttribute="leading" secondItem="C7e-vy-v22" secondAttribute="leading" id="qSI-55-bJd"/>
+                            </constraints>
+                        </view>
+                        <constraints>
+                            <constraint firstAttribute="width" constant="432" id="q3n-kR-r0e"/>
+                        </constraints>
+                    </box>
+                </subviews>
+                <constraints>
+                    <constraint firstAttribute="trailing" secondItem="Sb6-m0-cTT" secondAttribute="trailing" constant="24" id="MNB-Zf-tyz"/>
+                    <constraint firstAttribute="bottom" secondItem="Sb6-m0-cTT" secondAttribute="bottom" constant="24" id="cXG-Ex-5AA"/>
+                    <constraint firstItem="Sb6-m0-cTT" firstAttribute="top" secondItem="se5-gp-TjO" secondAttribute="top" constant="16" id="eh5-zX-O8m"/>
+                    <constraint firstItem="Sb6-m0-cTT" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" constant="24" id="ygu-Eu-4Hx"/>
+                </constraints>
+            </view>
+            <connections>
+                <outlet property="delegate" destination="-2" id="0bl-1N-AYu"/>
+            </connections>
+            <point key="canvasLocation" x="139" y="130"/>
+        </window>
+    </objects>
+</document>

+ 443 - 4
PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNPDFInsert/KMNPDFInsertBlankWindowController.swift

@@ -7,16 +7,455 @@
 
 
 import Cocoa
 import Cocoa
 
 
-class KMNPDFInsertBlankWindowController: NSWindowController {
+import KMComponentLibrary
+
+class KMNPDFInsertBlankWindowController: KMNBaseWindowController {
+    @IBOutlet var titleLabel: NSTextField!
+
+    @IBOutlet var sizeLabel: NSTextField!
+    @IBOutlet var currentRadioButton: ComponentRadio!
+    @IBOutlet var standardRadioButton: ComponentRadio!
+    @IBOutlet var standardSelect: ComponentSelect!
+    @IBOutlet var customizationRadioButton: ComponentRadio!
+    @IBOutlet var widthInput: ComponentInput!
+    @IBOutlet var heightInput: ComponentInput!
+    @IBOutlet var unitSelect: ComponentSelect!
+
+    @IBOutlet var directionLabel: NSTextField!
+    @IBOutlet var verticalRadioButton: ComponentRadio!
+    @IBOutlet var horizontalRadioButton: ComponentRadio!
+    
+    @IBOutlet var positionLabel: NSTextField!
+    @IBOutlet var firstRadioButton: ComponentRadio!
+    @IBOutlet var lastRadioButton: ComponentRadio!
+    @IBOutlet var pageRadioButton: ComponentRadio!
+    @IBOutlet var pageNumInput: ComponentInputNumber!
+    @IBOutlet var pageCountLabel: NSTextField!
+    @IBOutlet var positionSelect: ComponentSelect!
+
+    @IBOutlet var cancelButton: ComponentButton!
+    @IBOutlet var insertButton: ComponentButton!
+
+    @IBOutlet var standardRadioWidthButton:NSLayoutConstraint!
+    @IBOutlet var customizationRadioWidthButton:NSLayoutConstraint!
+    @IBOutlet var verticalRadioWidthButton:NSLayoutConstraint!
+    @IBOutlet var cancelWidthButton:NSLayoutConstraint!
+    @IBOutlet var insertWidthButton:NSLayoutConstraint!
+    @IBOutlet var pageRadioWidthButton:NSLayoutConstraint!
     
     
-    deinit {
-        KMPrint("KMNPDFInsertBlankWindowController deinit.")
+    private var orgDocument:CPDFDocument?
+    private var orgPageIndex:Int = 0
+        
+    convenience init(_ document: CPDFDocument?, currentPageIndex: Int) {
+        self.init(windowNibName: "KMNPDFInsertBlankWindowController")
+        orgDocument = document
+        orgPageIndex = currentPageIndex
     }
     }
 
 
+    convenience init(_ filePath: String,password:String?) {
+        self.init(windowNibName: "KMNPDFInsertBlankWindowController")
+        let document = CPDFDocument.init(url: URL(fileURLWithPath: filePath))
+        if password != nil {
+            document?.unlock(withPassword: password as String?)
+        }
+
+        orgDocument = document
+    }
+    
+    private func setUpPositionSelctProperty() {
+        var menuItemArr: [ComponentMenuitemProperty] = []
+        for language in [KMLocalizedString("After"),KMLocalizedString("Before")] {
+            let itemProperty: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
+                                                                                    itemSelected: false,
+                                                                                    isDisabled: false,
+                                                                                    keyEquivalent: nil,
+                                                                                    text: language)
+            menuItemArr.append(itemProperty)
+        }
+        
+        positionSelect.updateMenuItemsArr(menuItemArr)
+    }
+    
+    private func setUpUnitSelctProperty() {
+        var menuItemArr: [ComponentMenuitemProperty] = []
+        for language in [KMLocalizedString("mm"),KMLocalizedString("cn"),KMLocalizedString("in")] {
+            let itemProperty: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
+                                                                                    itemSelected: false,
+                                                                                    isDisabled: false,
+                                                                                    keyEquivalent: nil,
+                                                                                    text: language)
+            menuItemArr.append(itemProperty)
+        }
+        
+        unitSelect.updateMenuItemsArr(menuItemArr)
+    }
+    
+    private func setUpPageSizeSelctProperty() {
+        let paperArray = KMNPageSizeTool.paperSize()
+        var menuItemArr: [ComponentMenuitemProperty] = []
+        for pageSizeString in paperArray {
+            let itemProperty: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
+                                                                                    itemSelected: false,
+                                                                                    isDisabled: false,
+                                                                                    keyEquivalent: nil,
+                                                                                    text: pageSizeString)
+            menuItemArr.append(itemProperty)
+        }
+        
+        standardSelect.updateMenuItemsArr(menuItemArr)
+    }
+
+
+    private func setUpProperty() {
+        titleLabel.stringValue = KMLocalizedString("Insert Blank Page")
+        titleLabel.font =  ComponentLibrary.shared.getFontFromKey("mac/body-m-medium")
+        titleLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("colorText/1")
+        
+        sizeLabel.stringValue = KMLocalizedString("Form File")
+        sizeLabel.font = ComponentLibrary.shared.getFontFromKey("mac/body-m-medium")
+        sizeLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("colorText/2")
+        
+        directionLabel.stringValue = KMLocalizedString("Direction")
+        directionLabel.font = ComponentLibrary.shared.getFontFromKey("mac/body-m-medium")
+        directionLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("colorText/2")
+        
+        sizeLabel.stringValue = KMLocalizedString("Page Size")
+        sizeLabel.font = ComponentLibrary.shared.getFontFromKey("mac/body-m-medium")
+        sizeLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("colorText/2")
+        
+        positionLabel.stringValue = KMLocalizedString("Where to insert?")
+        positionLabel.font = ComponentLibrary.shared.getFontFromKey("mac/body-m-medium")
+        positionLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("colorText/2")
+        
+        let page = self.orgDocument?.page(at: UInt(orgPageIndex)) as? CPDFPage
+        let rect = page?.bounds ?? CGRectZero
+        let width = KMNPageSizeTool.conversion(withUnit: "mm", value: (NSWidth(rect)/595 * 210))
+        let height = KMNPageSizeTool.conversion(withUnit: "mm", value: (NSHeight(rect)/842 * 297))
+
+        currentRadioButton.properties = ComponentCheckBoxProperty(size: .s,
+                                                                state: .normal,
+                                                                isDisabled: false,
+                                                                showhelp: false,
+                                                                text: String(format: "%@(%@ x %@mm)", KMLocalizedString("Current Size"),width,height),
+                                                                checkboxType: .selected)
+        standardRadioButton.properties = ComponentCheckBoxProperty(size: .s,
+                                                                state: .normal,
+                                                                isDisabled: false,
+                                                                showhelp: false,
+                                                                text: KMLocalizedString("Standard"),
+                                                                checkboxType: .normal)
+        
+        customizationRadioButton.properties = ComponentCheckBoxProperty(size: .s,
+                                                                state: .normal,
+                                                                isDisabled: false,
+                                                                showhelp: false,
+                                                                text: KMLocalizedString("Custom"),
+                                                                checkboxType: .normal)
+        
+        firstRadioButton.properties = ComponentCheckBoxProperty(size: .s,
+                                                                state: .normal,
+                                                                isDisabled: false,
+                                                                showhelp: false,
+                                                                text: KMLocalizedString("First"),
+                                                                checkboxType: .normal)
+        lastRadioButton.properties = ComponentCheckBoxProperty(size: .s,
+                                                                state: .normal,
+                                                                isDisabled: false,
+                                                                showhelp: false,
+                                                                text: KMLocalizedString("Last"),
+                                                                checkboxType: .normal)
+        
+        pageRadioButton.properties = ComponentCheckBoxProperty(size: .s,
+                                                                state: .normal,
+                                                                isDisabled: false,
+                                                                showhelp: false,
+                                                                text: KMLocalizedString("Page"),
+                                                                checkboxType: .normal)
+        
+        verticalRadioButton.properties = ComponentCheckBoxProperty(size: .s,
+                                                                state: .normal,
+                                                                isDisabled: false,
+                                                                showhelp: false,
+                                                                text: KMLocalizedString("Landscape pages"),
+                                                                checkboxType: .selected)
+        horizontalRadioButton.properties = ComponentCheckBoxProperty(size: .s,
+                                                                state: .normal,
+                                                                isDisabled: false,
+                                                                showhelp: false,
+                                                                text: KMLocalizedString("Portrait pages"),
+                                                                checkboxType: .normal)
+        
+        unitSelect.properties = ComponentSelectProperties(size: .s,
+                                                                state: .normal,
+                                                                isDisabled: false,
+                                                                isError: false,
+                                                                leftIcon: false,
+                                                                placeholder: nil,
+                                                                errorText: nil,
+                                                                creatable: false,
+                                                                text: KMLocalizedString("mm", comment: ""))
+        unitSelect.delegate = self
+        
+        standardSelect.properties = ComponentSelectProperties(size: .s,
+                                                                state: .normal,
+                                                                isDisabled: false,
+                                                                isError: false,
+                                                                leftIcon: false,
+                                                                placeholder: nil,
+                                                                errorText: nil,
+                                                                creatable: false,
+                                                                text: KMLocalizedString("A4", comment: ""))
+        standardSelect.delegate = self
+        
+        positionSelect.properties = ComponentSelectProperties(size: .s,
+                                                                state: .normal,
+                                                                isDisabled: false,
+                                                                isError: false,
+                                                                leftIcon: false,
+                                                                placeholder: nil,
+                                                                errorText: nil,
+                                                                creatable: false,
+                                                                text: KMLocalizedString("After", comment: ""))
+        positionSelect.delegate = self
+
+        insertButton.properties = ComponentButtonProperty(type: .primary,
+                                                          size: .s,
+                                                          state: .normal,
+                                                          isDisable: false,
+                                                          buttonText: KMLocalizedString("Insert"))
+        insertButton.setTarget(self, action: #selector(insertButtonClicked(_ :)))
+        insertWidthButton.constant = insertButton.properties.propertyInfo.viewWidth
+        
+        cancelButton.properties = ComponentButtonProperty(type: .default_tertiary,
+                                                          size: .s,
+                                                          state: .normal,
+                                                          buttonText: KMLocalizedString("Cancel"))
+        cancelButton.setTarget(self, action: #selector(cancelButtonClicked(_ :)))
+        cancelWidthButton.constant = cancelButton.properties.propertyInfo.viewWidth
+        
+        firstRadioButton.setTarget(self, action: #selector(insertPositionAction(_:)))
+        lastRadioButton.setTarget(self, action: #selector(insertPositionAction(_:)))
+        pageRadioButton.setTarget(self, action: #selector(insertPositionAction(_:)))
+        
+        verticalRadioButton.setTarget(self, action: #selector(insertDirectionAction(_:)))
+        horizontalRadioButton.setTarget(self, action: #selector(insertDirectionAction(_:)))
+        
+        currentRadioButton.setTarget(self, action: #selector(insertPageSizeAction(_:)))
+        standardRadioButton.setTarget(self, action: #selector(insertPageSizeAction(_:)))
+        customizationRadioButton.setTarget(self, action: #selector(insertPageSizeAction(_:)))
+
+        pageNumInput.properties = ComponentInputNumberProperty(alignment: .left,
+                                                                          size: .s,
+                                                                          state: .normal,
+                                                                          isError: false,
+                                                                          showErrorInfo: false,
+                                                                          isDisabled: true,
+                                                                          showPrefix: false,
+                                                                          showSuffix: false,
+                                                                          minSize: 1,
+                                                                          maxSize: Int(orgDocument?.pageCount ?? 1),
+                                                                          text: SettingsManager.sharedInstance.autoSaveMinutes)
+        pageNumInput.inputNumberDelegate = self
+        
+        let inputWidthProperty: ComponentInputProperty = ComponentInputProperty(size: .s,
+                                                                           state:.pressed ,
+                                                                           isError: false,
+                                                                           showPrefix: false,
+                                                                           showSuffix: false,
+                                                                           showClear: false,
+                                                                           isDisabled: false,
+                                                                           placeholder: "210",
+                                                                           text: "210")
+        widthInput.properties = inputWidthProperty
+        
+        let inputHeightProperty: ComponentInputProperty = ComponentInputProperty(size: .s,
+                                                                           state:.pressed ,
+                                                                           isError: false,
+                                                                           showPrefix: false,
+                                                                           showSuffix: false,
+                                                                           showClear: false,
+                                                                           isDisabled: false,
+                                                                           placeholder: "297",
+                                                                           text: "297")
+        heightInput.properties = inputHeightProperty
+                
+        pageCountLabel.stringValue = "/" + String(format: "%d", orgDocument?.pageCount ?? 0)
+        
+        setUpPositionSelctProperty()
+        setUpUnitSelctProperty()
+        setUpPageSizeSelctProperty()
+        
+        pageRadioWidthButton.constant = pageRadioButton.properties.propertyInfo.viewWidth
+        cancelWidthButton.constant = cancelButton.properties.propertyInfo.viewWidth
+        insertWidthButton.constant = insertButton.properties.propertyInfo.viewWidth
+        standardRadioWidthButton.constant = standardRadioButton.properties.propertyInfo.viewWidth
+        customizationRadioWidthButton.constant = customizationRadioButton.properties.propertyInfo.viewWidth
+        verticalRadioWidthButton.constant = verticalRadioButton.properties.propertyInfo.viewWidth
+  }
+
     override func windowDidLoad() {
     override func windowDidLoad() {
         super.windowDidLoad()
         super.windowDidLoad()
 
 
-        // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.
+        setUpProperty()
+        
+        positionSelect.selectItemAtIndex(0)
+        unitSelect.selectItemAtIndex(0)
+        standardSelect.selectItemAtIndex(1)
+
+        pageRadioButton.properties.checkboxType = .selected
+        pageRadioButton.reloadData()
+        
+        pageNumInput.properties.text = String((orgPageIndex+1))
+        pageNumInput.reloadData()
+        
+        pageCountLabel.stringValue = "/" + String(format: "%d", orgDocument?.pageCount ?? 0)        
+    }
+    
+    //MARK: - Action
+    @objc func cancelButtonClicked(_ sender: NSView) {
+        own_closeEndSheet()
+    }
+    
+    @objc func insertButtonClicked(_ sender: NSView) {
+        own_closeEndSheet()
+    }
+    
+    @objc func insertPositionAction(_ sender: NSView) {
+        var oldSelectRadioBtn:ComponentRadio?  = nil
+        if sender == lastRadioButton {
+            if(firstRadioButton.properties.checkboxType == .selected) {
+                oldSelectRadioBtn = firstRadioButton
+            } else if (pageRadioButton.properties.checkboxType == .selected){
+                oldSelectRadioBtn = pageRadioButton
+                
+                pageNumInput.properties.isDisabled = true
+                positionSelect.properties.isDisabled = true
+                pageNumInput.reloadData()
+                positionSelect.reloadData()
+            }
+        } else if sender == firstRadioButton {
+            if(lastRadioButton.properties.checkboxType == .selected) {
+                oldSelectRadioBtn = lastRadioButton
+            } else if (pageRadioButton.properties.checkboxType == .selected){
+                oldSelectRadioBtn = pageRadioButton
+                
+                pageNumInput.properties.isDisabled = true
+                positionSelect.properties.isDisabled = true
+                pageNumInput.reloadData()
+                positionSelect.reloadData()
+            }
+        } else if sender == pageRadioButton {
+            if(lastRadioButton.properties.checkboxType == .selected) {
+                oldSelectRadioBtn = lastRadioButton
+            } else if (firstRadioButton.properties.checkboxType == .selected){
+                oldSelectRadioBtn = firstRadioButton
+            }
+            
+            pageNumInput.properties.isDisabled = false
+            positionSelect.properties.isDisabled = false
+            pageNumInput.reloadData()
+            positionSelect.reloadData()
+        }
+        
+        if(oldSelectRadioBtn != nil) {
+            oldSelectRadioBtn?.properties.checkboxType = .normal
+            oldSelectRadioBtn?.reloadData()
+        }
     }
     }
     
     
+    @objc func insertDirectionAction(_ sender: NSView) {
+        var oldSelectRadioBtn:ComponentRadio?  = nil
+        if sender == verticalRadioButton {
+            if(horizontalRadioButton.properties.checkboxType == .selected) {
+                oldSelectRadioBtn = horizontalRadioButton
+            }
+        } else if sender == horizontalRadioButton {
+            if(verticalRadioButton.properties.checkboxType == .selected) {
+                oldSelectRadioBtn = verticalRadioButton
+            }
+        }
+        
+        if(oldSelectRadioBtn != nil) {
+            oldSelectRadioBtn?.properties.checkboxType = .normal
+            oldSelectRadioBtn?.reloadData()
+        }
+    }
+
+    @objc func insertPageSizeAction(_ sender: NSView) {
+        var oldSelectRadioBtn:ComponentRadio?  = nil
+        if sender == currentRadioButton {
+            if(standardRadioButton.properties.checkboxType == .selected) {
+                oldSelectRadioBtn = standardRadioButton
+                
+                standardSelect.properties.isDisabled = true
+                standardSelect.reloadData()
+            } else if (customizationRadioButton.properties.checkboxType == .selected){
+                oldSelectRadioBtn = customizationRadioButton
+                
+                widthInput.properties.isDisabled = true
+                widthInput.reloadData()
+                heightInput.properties.isDisabled = true
+                heightInput.reloadData()
+                unitSelect.properties.isDisabled = true
+                unitSelect.reloadData()
+            }
+        } else if sender == standardRadioButton {
+            if(currentRadioButton.properties.checkboxType == .selected) {
+                oldSelectRadioBtn = currentRadioButton
+            } else if (customizationRadioButton.properties.checkboxType == .selected){
+                oldSelectRadioBtn = customizationRadioButton
+                
+                widthInput.properties.isDisabled = true
+                widthInput.reloadData()
+                heightInput.properties.isDisabled = true
+                heightInput.reloadData()
+                unitSelect.properties.isDisabled = true
+                unitSelect.reloadData()
+            }
+            standardSelect.properties.isDisabled = false
+            standardSelect.reloadData()
+        } else if sender == customizationRadioButton {
+            if(firstRadioButton.properties.checkboxType == .selected) {
+                oldSelectRadioBtn = currentRadioButton
+            } else if (standardRadioButton.properties.checkboxType == .selected){
+                oldSelectRadioBtn = standardRadioButton
+                
+                standardSelect.properties.isDisabled = true
+                standardSelect.reloadData()
+            }
+            widthInput.properties.isDisabled = false
+            widthInput.reloadData()
+            heightInput.properties.isDisabled = false
+            heightInput.reloadData()
+            unitSelect.properties.isDisabled = false
+            unitSelect.reloadData()
+        }
+        
+        if(oldSelectRadioBtn != nil) {
+            oldSelectRadioBtn?.properties.checkboxType = .normal
+            oldSelectRadioBtn?.reloadData()
+        }
+    }
+    
+}
+
+extension KMNPDFInsertBlankWindowController: ComponentInputNumberDelegate {
+    func componentInputNumberDidValueChanged(inputNumber: ComponentInputNumber?) {
+        if(inputNumber == pageNumInput) {
+            
+        }
+    }
+}
+
+extension KMNPDFInsertBlankWindowController: ComponentSelectDelegate {
+    func componentSelectDidSelect(view: ComponentSelect?, menuItemProperty: ComponentMenuitemProperty?) {
+        if(view == unitSelect) {
+            
+        } else if (view == standardSelect) {
+            
+        } else if (view == positionSelect) {
+            
+        }
+
+    }
 }
 }

+ 33 - 5
PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNPDFInsert/KMNPDFInsertBlankWindowController.xib

@@ -8,6 +8,33 @@
     <objects>
     <objects>
         <customObject id="-2" userLabel="File's Owner" customClass="KMNPDFInsertBlankWindowController" customModule="PDF_Reader_Pro" customModuleProvider="target">
         <customObject id="-2" userLabel="File's Owner" customClass="KMNPDFInsertBlankWindowController" customModule="PDF_Reader_Pro" customModuleProvider="target">
             <connections>
             <connections>
+                <outlet property="cancelButton" destination="Vku-v2-fdB" id="u1H-sw-8Tz"/>
+                <outlet property="cancelWidthButton" destination="Ter-2m-l0G" id="2d4-w2-fh0"/>
+                <outlet property="currentRadioButton" destination="j7v-0X-QeG" id="tgY-V7-pOa"/>
+                <outlet property="customizationRadioButton" destination="HuM-BA-Uvf" id="6Mx-sQ-hRs"/>
+                <outlet property="customizationRadioWidthButton" destination="IkN-FT-Oi3" id="eYT-bW-EDk"/>
+                <outlet property="directionLabel" destination="5v9-6U-8r4" id="JVE-nG-6Hl"/>
+                <outlet property="firstRadioButton" destination="Pp7-3C-A2A" id="Nlt-KL-F4O"/>
+                <outlet property="heightInput" destination="Zmw-g1-EVI" id="mKs-rT-PYk"/>
+                <outlet property="horizontalRadioButton" destination="OeC-As-9rD" id="Imy-Ag-3Az"/>
+                <outlet property="insertButton" destination="K7X-wZ-9qH" id="WGy-FV-yxc"/>
+                <outlet property="insertWidthButton" destination="2g2-CW-kQj" id="Axl-fy-NxC"/>
+                <outlet property="lastRadioButton" destination="TZU-nb-Bs8" id="Ou5-l2-Taf"/>
+                <outlet property="pageCountLabel" destination="Tao-97-XTi" id="teA-Vm-ao7"/>
+                <outlet property="pageNumInput" destination="gP1-hJ-lAi" id="VCu-7L-8vX"/>
+                <outlet property="pageRadioButton" destination="BzR-rA-nyf" id="xkH-St-e4m"/>
+                <outlet property="pageRadioWidthButton" destination="oei-tu-3Aw" id="aZU-R8-js5"/>
+                <outlet property="positionLabel" destination="KBp-9t-lIU" id="dhJ-5u-55C"/>
+                <outlet property="positionSelect" destination="U9s-pF-RQU" id="fi4-0d-RAv"/>
+                <outlet property="sizeLabel" destination="Clg-pi-h4k" id="uqe-42-Fap"/>
+                <outlet property="standardRadioButton" destination="lKD-hV-fpk" id="cCR-Df-kOn"/>
+                <outlet property="standardRadioWidthButton" destination="jHw-Cz-5Iv" id="fOl-CL-PDd"/>
+                <outlet property="standardSelect" destination="8vo-ZB-pX4" id="cQo-An-0Ta"/>
+                <outlet property="titleLabel" destination="Y1G-WO-o9Q" id="XqG-Fz-65M"/>
+                <outlet property="unitSelect" destination="J0z-Rx-OyF" id="JJT-MU-AyY"/>
+                <outlet property="verticalRadioButton" destination="tfq-wd-Xkb" id="zet-BK-VQS"/>
+                <outlet property="verticalRadioWidthButton" destination="dtr-Ht-SHP" id="DSU-0g-unk"/>
+                <outlet property="widthInput" destination="Czw-9B-CdD" id="llf-5P-54y"/>
                 <outlet property="window" destination="F0z-JX-Cv5" id="gIp-Ho-8D9"/>
                 <outlet property="window" destination="F0z-JX-Cv5" id="gIp-Ho-8D9"/>
             </connections>
             </connections>
         </customObject>
         </customObject>
@@ -70,14 +97,14 @@
                                                     <constraint firstAttribute="height" constant="20" id="eoB-Gk-3k8"/>
                                                     <constraint firstAttribute="height" constant="20" id="eoB-Gk-3k8"/>
                                                 </constraints>
                                                 </constraints>
                                             </customView>
                                             </customView>
-                                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="Czw-9B-CdD">
+                                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="Czw-9B-CdD" customClass="ComponentInput" customModule="KMComponentLibrary">
                                                 <rect key="frame" x="94" y="8" width="96" height="32"/>
                                                 <rect key="frame" x="94" y="8" width="96" height="32"/>
                                                 <constraints>
                                                 <constraints>
                                                     <constraint firstAttribute="height" constant="32" id="i8D-ce-mk3"/>
                                                     <constraint firstAttribute="height" constant="32" id="i8D-ce-mk3"/>
                                                     <constraint firstAttribute="width" constant="96" id="nNy-oz-Atx"/>
                                                     <constraint firstAttribute="width" constant="96" id="nNy-oz-Atx"/>
                                                 </constraints>
                                                 </constraints>
                                             </customView>
                                             </customView>
-                                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="Zmw-g1-EVI">
+                                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="Zmw-g1-EVI" customClass="ComponentInput" customModule="KMComponentLibrary">
                                                 <rect key="frame" x="207" y="8" width="96" height="32"/>
                                                 <rect key="frame" x="207" y="8" width="96" height="32"/>
                                                 <constraints>
                                                 <constraints>
                                                     <constraint firstAttribute="height" constant="32" id="MnU-Yq-Z1L"/>
                                                     <constraint firstAttribute="height" constant="32" id="MnU-Yq-Z1L"/>
@@ -91,13 +118,13 @@
                                                     <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                                     <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                                 </textFieldCell>
                                                 </textFieldCell>
                                             </textField>
                                             </textField>
-                                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="8vo-ZB-pX4">
+                                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="8vo-ZB-pX4" customClass="ComponentSelect" customModule="KMComponentLibrary">
                                                 <rect key="frame" x="104" y="48" width="328" height="32"/>
                                                 <rect key="frame" x="104" y="48" width="328" height="32"/>
                                                 <constraints>
                                                 <constraints>
                                                     <constraint firstAttribute="height" constant="32" id="FBS-mH-lwQ"/>
                                                     <constraint firstAttribute="height" constant="32" id="FBS-mH-lwQ"/>
                                                 </constraints>
                                                 </constraints>
                                             </customView>
                                             </customView>
-                                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="J0z-Rx-OyF">
+                                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="J0z-Rx-OyF" customClass="ComponentSelect" customModule="KMComponentLibrary">
                                                 <rect key="frame" x="311" y="8" width="121" height="32"/>
                                                 <rect key="frame" x="311" y="8" width="121" height="32"/>
                                                 <constraints>
                                                 <constraints>
                                                     <constraint firstAttribute="height" constant="32" id="qSE-T2-9A8"/>
                                                     <constraint firstAttribute="height" constant="32" id="qSE-T2-9A8"/>
@@ -176,7 +203,7 @@
                                                 </constraints>
                                                 </constraints>
                                             </customView>
                                             </customView>
                                             <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="5v9-6U-8r4">
                                             <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="5v9-6U-8r4">
-                                                <rect key="frame" x="-2" y="32" width="436" height="16"/>
+                                                <rect key="frame" x="-2" y="32" width="220" height="16"/>
                                                 <textFieldCell key="cell" lineBreakMode="clipping" title="Direction" id="d29-hg-r3t">
                                                 <textFieldCell key="cell" lineBreakMode="clipping" title="Direction" id="d29-hg-r3t">
                                                     <font key="font" usesAppearanceFont="YES"/>
                                                     <font key="font" usesAppearanceFont="YES"/>
                                                     <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
                                                     <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@@ -201,6 +228,7 @@
                                             <constraint firstItem="OeC-As-9rD" firstAttribute="leading" secondItem="tfq-wd-Xkb" secondAttribute="trailing" constant="16" id="ebr-FK-z4P"/>
                                             <constraint firstItem="OeC-As-9rD" firstAttribute="leading" secondItem="tfq-wd-Xkb" secondAttribute="trailing" constant="16" id="ebr-FK-z4P"/>
                                             <constraint firstAttribute="bottom" secondItem="tfq-wd-Xkb" secondAttribute="bottom" id="gmS-ux-Gom"/>
                                             <constraint firstAttribute="bottom" secondItem="tfq-wd-Xkb" secondAttribute="bottom" id="gmS-ux-Gom"/>
                                             <constraint firstAttribute="trailing" secondItem="5v9-6U-8r4" secondAttribute="trailing" id="hoY-2U-Bra"/>
                                             <constraint firstAttribute="trailing" secondItem="5v9-6U-8r4" secondAttribute="trailing" id="hoY-2U-Bra"/>
+                                            <constraint firstAttribute="trailing" secondItem="OeC-As-9rD" secondAttribute="trailing" id="uF0-0n-zia"/>
                                         </constraints>
                                         </constraints>
                                     </view>
                                     </view>
                                 </box>
                                 </box>

+ 178 - 4
PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNPDFInsert/KMNPDFInsertClipboardWindowController.swift

@@ -7,15 +7,189 @@
 
 
 import Cocoa
 import Cocoa
 
 
-class KMNPDFInsertClipboardWindowController: NSWindowController {
-    deinit {
-        KMPrint("KMNPDFInsertBlankWindowController deinit.")
+import KMComponentLibrary
+
+class KMNPDFInsertClipboardWindowController: KMNBaseWindowController {
+    private var orgDocument:CPDFDocument?
+    private var orgPageIndex:Int = 0
+    
+    @IBOutlet var titleLabel: NSTextField!
+
+    @IBOutlet var positionLabel: NSTextField!
+    @IBOutlet var firstRadioButton: ComponentRadio!
+    @IBOutlet var lastRadioButton: ComponentRadio!
+    @IBOutlet var pageRadioButton: ComponentRadio!
+    @IBOutlet var pageNumInput: ComponentInputNumber!
+    @IBOutlet var pageCountLabel: NSTextField!
+    @IBOutlet var positionSelect: ComponentSelect!
+
+    @IBOutlet var cancelButton: ComponentButton!
+    @IBOutlet var insertButton: ComponentButton!
+
+    @IBOutlet var cancelWidthButton:NSLayoutConstraint!
+    @IBOutlet var insertWidthButton:NSLayoutConstraint!
+    @IBOutlet var pageRadioWidthButton:NSLayoutConstraint!
+
+    convenience init(_ document: CPDFDocument?, currentPageIndex: Int) {
+        self.init(windowNibName: "KMNPDFInsertClipboardWindowController")
+        orgDocument = document
+        orgPageIndex = currentPageIndex
+    }
+
+    convenience init(_ filePath: String,password:String?) {
+        self.init(windowNibName: "KMNPDFInsertClipboardWindowController")
+        let document = CPDFDocument.init(url: URL(fileURLWithPath: filePath))
+        if password != nil {
+            document?.unlock(withPassword: password as String?)
+        }
+
+        orgDocument = document
     }
     }
 
 
     override func windowDidLoad() {
     override func windowDidLoad() {
         super.windowDidLoad()
         super.windowDidLoad()
 
 
-        // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.
+        setUpProperty()
+        positionSelect.selectItemAtIndex(0)
+        
+        pageRadioButton.properties.checkboxType = .selected
+        pageRadioButton.reloadData()
+        
+        pageNumInput.properties.text = String((orgPageIndex+1))
+        pageNumInput.reloadData()
+        
+        pageCountLabel.stringValue = "/" + String(format: "%d", orgDocument?.pageCount ?? 0)
+    }
+    
+    private func setUpPositionSelctProperty() {
+        positionSelect.properties = ComponentSelectProperties(size: .s,
+                                                                state: .normal,
+                                                                isDisabled: false,
+                                                                isError: false,
+                                                                leftIcon: false,
+                                                                placeholder: nil,
+                                                                errorText: nil,
+                                                                creatable: false,
+                                                                text: KMLocalizedString("After", comment: ""))
+        
+        var menuItemArr: [ComponentMenuitemProperty] = []
+        for language in [KMLocalizedString("After"),KMLocalizedString("Before")] {
+            let itemProperty: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
+                                                                                    itemSelected: false,
+                                                                                    isDisabled: false,
+                                                                                    keyEquivalent: nil,
+                                                                                    text: language)
+            menuItemArr.append(itemProperty)
+        }
+        
+        positionSelect.updateMenuItemsArr(menuItemArr)
+        positionSelect.delegate = self
     }
     }
     
     
+    private func setUpProperty() {
+        titleLabel.stringValue = KMLocalizedString("From Clipboard")
+        titleLabel.font =  ComponentLibrary.shared.getFontFromKey("mac/body-m-medium")
+        titleLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("colorText/1")
+        
+        positionLabel.stringValue = KMLocalizedString("Where to insert?")
+        positionLabel.font = ComponentLibrary.shared.getFontFromKey("mac/body-m-medium")
+        positionLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("colorText/2")
+        
+        insertButton.properties = ComponentButtonProperty(type: .primary,
+                                                          size: .s,
+                                                          state: .normal,
+                                                          buttonText: KMLocalizedString("Insert"))
+        insertButton.setTarget(self, action: #selector(insertButtonClicked(_ :)))
+        insertWidthButton.constant = insertButton.properties.propertyInfo.viewWidth
+        
+        cancelButton.properties = ComponentButtonProperty(type: .default_tertiary,
+                                                          size: .s,
+                                                          state: .normal,
+                                                          buttonText: KMLocalizedString("Cancel"))
+        cancelButton.setTarget(self, action: #selector(cancelButtonClicked(_ :)))
+        cancelWidthButton.constant = cancelButton.properties.propertyInfo.viewWidth
+        
+        firstRadioButton.properties = ComponentCheckBoxProperty(size: .s,
+                                                                state: .normal,
+                                                                isDisabled: false,
+                                                                showhelp: false,
+                                                                text: KMLocalizedString("First"),
+                                                                checkboxType: .normal)
+        lastRadioButton.properties = ComponentCheckBoxProperty(size: .s,
+                                                                state: .normal,
+                                                                isDisabled: false,
+                                                                showhelp: false,
+                                                                text: KMLocalizedString("Last"),
+                                                                checkboxType: .normal)
+        
+        pageRadioButton.properties = ComponentCheckBoxProperty(size: .s,
+                                                                state: .normal,
+                                                                isDisabled: false,
+                                                                showhelp: false,
+                                                                text: KMLocalizedString("Page"),
+                                                                checkboxType: .normal)
+
+        
+        firstRadioButton.setTarget(self, action: #selector(insertPositionAction(_:)))
+        lastRadioButton.setTarget(self, action: #selector(insertPositionAction(_:)))
+        pageRadioButton.setTarget(self, action: #selector(insertPositionAction(_:)))
+
+        pageNumInput.properties = ComponentInputNumberProperty(alignment: .left,
+                                                                          size: .s,
+                                                                          state: .normal,
+                                                                          isError: false,
+                                                                          showErrorInfo: false,
+                                                                          isDisabled: true,
+                                                                          showPrefix: false,
+                                                                          showSuffix: false,
+                                                                          minSize: 1,
+                                                                          maxSize: Int(orgDocument?.pageCount ?? 1),
+                                                                          text: SettingsManager.sharedInstance.autoSaveMinutes)
+        pageNumInput.inputNumberDelegate = self
+                
+        pageCountLabel.stringValue = "/" + String(format: "%d", orgDocument?.pageCount ?? 0)
+        
+        setUpPositionSelctProperty()
+        
+        pageRadioWidthButton.constant = pageRadioButton.properties.propertyInfo.viewWidth
+        cancelWidthButton.constant = cancelButton.properties.propertyInfo.viewWidth
+        insertWidthButton.constant = insertButton.properties.propertyInfo.viewWidth
+  }
+    
+    //MARK: - Action
+    @objc func cancelButtonClicked(_ sender: NSView) {
+        own_closeEndSheet()
+    }
+    
+    @objc func insertButtonClicked(_ sender: NSView) {
+        own_closeEndSheet()
+    }
+    
+    @objc func insertPositionAction(_ sender: NSView) {
+        if sender == lastRadioButton {
+            
+        } else if sender == firstRadioButton {
+            
+        } else if sender == pageRadioButton {
+            
+        }
+    }
+
+}
+
+extension KMNPDFInsertClipboardWindowController: ComponentInputNumberDelegate {
+    func componentInputNumberDidValueChanged(inputNumber: ComponentInputNumber?) {
+        if(inputNumber == pageNumInput) {
+            
+        }
+    }
+}
+
+extension KMNPDFInsertClipboardWindowController: ComponentSelectDelegate {
+    func componentSelectDidSelect(view: ComponentSelect?, menuItemProperty: ComponentMenuitemProperty?) {
+        if(view == positionSelect) {
+            
+        }
+
+    }
 }
 }

+ 13 - 0
PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNPDFInsert/KMNPDFInsertClipboardWindowController.xib

@@ -8,6 +8,19 @@
     <objects>
     <objects>
         <customObject id="-2" userLabel="File's Owner" customClass="KMNPDFInsertClipboardWindowController" customModule="PDF_Reader_Pro" customModuleProvider="target">
         <customObject id="-2" userLabel="File's Owner" customClass="KMNPDFInsertClipboardWindowController" customModule="PDF_Reader_Pro" customModuleProvider="target">
             <connections>
             <connections>
+                <outlet property="cancelButton" destination="kbx-r8-FfZ" id="Lzz-Ot-edh"/>
+                <outlet property="cancelWidthButton" destination="eaf-lr-qUJ" id="jJy-G2-ohK"/>
+                <outlet property="firstRadioButton" destination="Jpf-4m-uhA" id="C9Q-fB-e3U"/>
+                <outlet property="insertButton" destination="jUu-dJ-JTK" id="vZs-SZ-1bb"/>
+                <outlet property="insertWidthButton" destination="XWY-SY-DFJ" id="2b7-NS-UcI"/>
+                <outlet property="lastRadioButton" destination="5GE-Zd-UxG" id="DUI-xT-8F8"/>
+                <outlet property="pageCountLabel" destination="0y2-gu-PB5" id="ceY-MI-1Bh"/>
+                <outlet property="pageNumInput" destination="bXL-VD-0g6" id="MLw-wS-kgk"/>
+                <outlet property="pageRadioButton" destination="WI9-2y-RIs" id="Kmp-Ek-ew7"/>
+                <outlet property="pageRadioWidthButton" destination="pmZ-Lm-erY" id="E7q-CM-Vec"/>
+                <outlet property="positionLabel" destination="vvh-mZ-hZZ" id="k7b-J9-M23"/>
+                <outlet property="positionSelect" destination="Fr6-uf-h6g" id="Dc3-t4-yT3"/>
+                <outlet property="titleLabel" destination="AiR-qt-ZiL" id="M9B-wM-5Jq"/>
                 <outlet property="window" destination="F0z-JX-Cv5" id="gIp-Ho-8D9"/>
                 <outlet property="window" destination="F0z-JX-Cv5" id="gIp-Ho-8D9"/>
             </connections>
             </connections>
         </customObject>
         </customObject>

+ 235 - 82
PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNPDFInsert/KMNPDFInsertPDFWindowController.swift

@@ -9,14 +9,11 @@ import Cocoa
 
 
 import KMComponentLibrary
 import KMComponentLibrary
 
 
-class KMNPDFInsertPDFWindowController: NSWindowController {
-    private var parentWindow: NSWindow?
-    private var handler: ((String?) -> Void)!
-
+class KMNPDFInsertPDFWindowController: KMNBaseWindowController {
     @IBOutlet var titleLabel: NSTextField!
     @IBOutlet var titleLabel: NSTextField!
 
 
     @IBOutlet var fileLabel: NSTextField!
     @IBOutlet var fileLabel: NSTextField!
-    @IBOutlet var fileNameInput: ComponentInputWithAddon!
+    @IBOutlet var fileNameInput: ComponentInput!
     @IBOutlet var selectFileInput: ComponentInputAddon!
     @IBOutlet var selectFileInput: ComponentInputAddon!
     @IBOutlet var pageRangeLabel: NSTextField!
     @IBOutlet var pageRangeLabel: NSTextField!
     @IBOutlet var pageRangeSelect: ComponentSelect!
     @IBOutlet var pageRangeSelect: ComponentSelect!
@@ -38,48 +35,44 @@ class KMNPDFInsertPDFWindowController: NSWindowController {
     
     
     private var orgDocument:CPDFDocument?
     private var orgDocument:CPDFDocument?
     private var insertDocument:CPDFDocument?
     private var insertDocument:CPDFDocument?
-
-    deinit {
-        KMPrint("KMSearchReplaceWindowController deinit.")
+    private var orgPageIndex:Int = 0
+    
+    var callback: ((KMNFileAttribute, Int) -> Void)?
+    
+    convenience init(_ document: CPDFDocument?, currentPageIndex: Int) {
+        self.init(windowNibName: "KMNPDFInsertPDFWindowController")
+        orgDocument = document
+        orgPageIndex = currentPageIndex  // 修正此行
     }
     }
 
 
+    convenience init(_ filePath: String,password:String?) {
+        self.init(windowNibName: "KMNPDFInsertPDFWindowController")
+        let document = CPDFDocument.init(url: URL(fileURLWithPath: filePath))
+        if password != nil {
+            document?.unlock(withPassword: password as String?)
+        }
+
+        orgDocument = document
+    }
+    
     override func windowDidLoad() {
     override func windowDidLoad() {
         super.windowDidLoad()
         super.windowDidLoad()
 
 
         setUpProperty()
         setUpProperty()
+        
+        pageRangeSelect.selectItemAtIndex(0)
+        positionSelect.selectItemAtIndex(0)
+        
+        pageRadioButton.properties.checkboxType = .selected
+        pageRadioButton.reloadData()
+        
+        pageNumInput.properties.text = String((orgPageIndex+1))
+        pageNumInput.reloadData()
+        
+        pageCountLabel.stringValue = "/" + String(format: "%d", orgDocument?.pageCount ?? 0)        
     }
     }
     
     
-//    convenience init(_ document: CPDFDocument?) {
-//        self.init(windowNibName: "KMNPDFInsertPDFWindowController")
-//        orgDocument = document
-//    }
-//
-//    convenience init(_ filePath: String,password:String?) {
-//        self.init(windowNibName: "KMNPDFInsertPDFWindowController")
-//        let document = CPDFDocument.init(url: URL(fileURLWithPath: filePath))
-//        if password != nil {
-//            document?.unlock(withPassword: password as String?)
-//        }
-//
-//        orgDocument = document
-//    }
-    
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    private func setUPPageSelctProperty() {
-        pageRangeSelect.properties = ComponentSelectProperties(size: .s,
-                                                                state: .normal,
-                                                                isDisabled: false,
-                                                                isError: false,
-                                                                leftIcon: false,
-                                                                placeholder: nil,
-                                                                errorText: nil,
-                                                                creatable: false,
-                                                                text: KMLocalizedString("All Pages", comment: ""))
-        
-
+    private func setUpPageSelctProperty() {
         var menuItemString:[String] = [KMLocalizedString("All Pages"),
         var menuItemString:[String] = [KMLocalizedString("All Pages"),
                                     KMLocalizedString("Odd Pages Only"),
                                     KMLocalizedString("Odd Pages Only"),
                                     KMLocalizedString("Even Pages Only"),
                                     KMLocalizedString("Even Pages Only"),
@@ -99,20 +92,9 @@ class KMNPDFInsertPDFWindowController: NSWindowController {
 
 
         
         
         pageRangeSelect.updateMenuItemsArr(menuItemArr)
         pageRangeSelect.updateMenuItemsArr(menuItemArr)
-        pageRangeSelect.delegate = self
     }
     }
     
     
-    private func setUPPositionSelctProperty() {
-        positionSelect.properties = ComponentSelectProperties(size: .s,
-                                                                state: .normal,
-                                                                isDisabled: false,
-                                                                isError: false,
-                                                                leftIcon: false,
-                                                                placeholder: nil,
-                                                                errorText: nil,
-                                                                creatable: false,
-                                                                text: KMLocalizedString("After", comment: ""))
-        
+    private func setUpPositionSelctProperty() {
         var menuItemArr: [ComponentMenuitemProperty] = []
         var menuItemArr: [ComponentMenuitemProperty] = []
         for language in [KMLocalizedString("After"),KMLocalizedString("Before")] {
         for language in [KMLocalizedString("After"),KMLocalizedString("Before")] {
             let itemProperty: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
             let itemProperty: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
@@ -124,7 +106,6 @@ class KMNPDFInsertPDFWindowController: NSWindowController {
         }
         }
         
         
         positionSelect.updateMenuItemsArr(menuItemArr)
         positionSelect.updateMenuItemsArr(menuItemArr)
-        positionSelect.delegate = self
     }
     }
     
     
     private func setUpProperty() {
     private func setUpProperty() {
@@ -132,15 +113,15 @@ class KMNPDFInsertPDFWindowController: NSWindowController {
         titleLabel.font =  ComponentLibrary.shared.getFontFromKey("mac/body-m-medium")
         titleLabel.font =  ComponentLibrary.shared.getFontFromKey("mac/body-m-medium")
         titleLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("colorText/1")
         titleLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("colorText/1")
         
         
-        fileLabel.stringValue = KMLocalizedString("Form File")
+        fileLabel.stringValue = KMLocalizedString("From PDF")
         fileLabel.font = ComponentLibrary.shared.getFontFromKey("mac/body-m-medium")
         fileLabel.font = ComponentLibrary.shared.getFontFromKey("mac/body-m-medium")
         fileLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("colorText/2")
         fileLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("colorText/2")
         
         
         pageRangeLabel.stringValue = KMLocalizedString("Page Range:")
         pageRangeLabel.stringValue = KMLocalizedString("Page Range:")
         pageRangeLabel.font = ComponentLibrary.shared.getFontFromKey("mac/body-s-regular")
         pageRangeLabel.font = ComponentLibrary.shared.getFontFromKey("mac/body-s-regular")
-        pageRangeLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("comp-field-colorText-filled-nor")
-
-        positionLabel.stringValue = KMLocalizedString("Insertion Position")
+        pageRangeLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("comp-field/colorText-filled-nor")
+        
+        positionLabel.stringValue = KMLocalizedString("Where to insert?")
         positionLabel.font = ComponentLibrary.shared.getFontFromKey("mac/body-m-medium")
         positionLabel.font = ComponentLibrary.shared.getFontFromKey("mac/body-m-medium")
         positionLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("colorText/2")
         positionLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("colorText/2")
         
         
@@ -154,7 +135,7 @@ class KMNPDFInsertPDFWindowController: NSWindowController {
                                                                 state: .normal,
                                                                 state: .normal,
                                                                 isDisabled: false,
                                                                 isDisabled: false,
                                                                 showhelp: false,
                                                                 showhelp: false,
-                                                                text: KMLocalizedString("First"),
+                                                                text: KMLocalizedString("Last"),
                                                                 checkboxType: .normal)
                                                                 checkboxType: .normal)
         
         
         pageRadioButton.properties = ComponentCheckBoxProperty(size: .s,
         pageRadioButton.properties = ComponentCheckBoxProperty(size: .s,
@@ -167,7 +148,8 @@ class KMNPDFInsertPDFWindowController: NSWindowController {
         insertButton.properties = ComponentButtonProperty(type: .primary,
         insertButton.properties = ComponentButtonProperty(type: .primary,
                                                           size: .s,
                                                           size: .s,
                                                           state: .normal,
                                                           state: .normal,
-                                                          buttonText: KMLocalizedString("Apply"))
+                                                          isDisable: true,
+                                                          buttonText: KMLocalizedString("Insert"))
         insertButton.setTarget(self, action: #selector(insertButtonClicked(_ :)))
         insertButton.setTarget(self, action: #selector(insertButtonClicked(_ :)))
         insertWidthButton.constant = insertButton.properties.propertyInfo.viewWidth
         insertWidthButton.constant = insertButton.properties.propertyInfo.viewWidth
         
         
@@ -187,76 +169,247 @@ class KMNPDFInsertPDFWindowController: NSWindowController {
                                                                           state: .normal,
                                                                           state: .normal,
                                                                           isError: false,
                                                                           isError: false,
                                                                           showErrorInfo: false,
                                                                           showErrorInfo: false,
-                                                                          isDisabled: true,
+                                                                          isDisabled: false,
                                                                           showPrefix: false,
                                                                           showPrefix: false,
                                                                           showSuffix: false,
                                                                           showSuffix: false,
-                                                                          minSize: 5,
-                                                                          maxSize: 99,
-                                                                          text: SettingsManager.sharedInstance.autoSaveMinutes)
+                                                                          minSize: 1,
+                                                                          maxSize: Int(orgDocument?.pageCount ?? 1),
+                                                                          text: "")
         pageNumInput.inputNumberDelegate = self
         pageNumInput.inputNumberDelegate = self
         
         
-        let inputWithAddonProperty = ComponentInputWithAddonProperty(size: .s,
-                                                                     isDisabled:false,
-                                                                     addonType: .text)
+        let inputWithAddonProperty = ComponentInputProperty(size: .s,
+                                                            state: .normal,
+                                                            isError: false,
+                                                            showPrefix: false,
+                                                            showSuffix: false,
+                                                            showClear: false,
+                                                            isDisabled: false,
+                                                            placeholder: KMLocalizedString("Please enter..."),
+                                                            text: "",
+                                                            creatable: false)
         fileNameInput.properties = inputWithAddonProperty
         fileNameInput.properties = inputWithAddonProperty
 
 
         selectFileInput.properties = ComponentInputAddonProperty(size: .s,
         selectFileInput.properties = ComponentInputAddonProperty(size: .s,
                                                                 state: .normal,
                                                                 state: .normal,
                                                                 addOnBefore: false,
                                                                 addOnBefore: false,
                                                                 onlyRead: false,
                                                                 onlyRead: false,
-                                                                addonType: .imageWithColor,
-                                                                iconImage:nil,text: KMLocalizedString("Browse"))
+                                                                addonType: .textWithColor,
+                                                                 text: KMLocalizedString("Browse"))
+        
         selectFileInput.setTarget(self, action: #selector(chooseURLAction(_ :)))
         selectFileInput.setTarget(self, action: #selector(chooseURLAction(_ :)))
+                
+        pageRangeSelect.properties = ComponentSelectProperties(size: .s,
+                                                                state: .normal,
+                                                                isDisabled: true,
+                                                                isError: false,
+                                                                leftIcon: false,
+                                                                placeholder: nil,
+                                                                errorText: nil,
+                                                                creatable: false,
+                                                                text: KMLocalizedString("All Pages", comment: ""))
         
         
-        pageCountLabel.stringValue = "/" + String(format: "%d", orgDocument?.pageCount ?? 0)
+        positionSelect.properties = ComponentSelectProperties(size: .s,
+                                                                state: .normal,
+                                                                isDisabled: false,
+                                                                isError: false,
+                                                                leftIcon: false,
+                                                                placeholder: nil,
+                                                                errorText: nil,
+                                                                creatable: false,
+                                                                text: KMLocalizedString("After", comment: ""))
 
 
+        setUpPositionSelctProperty()
+        setUpPageSelctProperty()
+        
+        positionSelect.delegate = self
+        pageRangeSelect.delegate = self
+        
+        pageRadioWidthButton.constant = pageRadioButton.properties.propertyInfo.viewWidth
+        cancelWidthButton.constant = cancelButton.properties.propertyInfo.viewWidth
+        insertWidthButton.constant = insertButton.properties.propertyInfo.viewWidth
     }
     }
     
     
-    func own_beginSheetModal(for window: NSWindow?, completionHandler handler: ((String?) -> Void)?) {
-        if window != nil {
-            parentWindow = window
-            window!.beginSheet(self.window!) { ModalResponse in
-                self.handler?(nil)
+    private func updateInsertPDF() {
+        fileNameInput.properties.text = insertDocument?.documentURL.path ?? ""
+        fileNameInput.reloadData()
+        window?.makeFirstResponder(self)
+        pageRangeSelect.properties.isDisabled = false
+        setUpPageSelctProperty()
+        pageRangeSelect.selectItemAtIndex(0)
+        
+        if(insertDocument != nil) {
+            if insertButton.properties.isDisabled == true {
+                insertButton.properties.isDisabled = false
+                insertButton.reloadData()
             }
             }
         }
         }
-        self.handler = handler
     }
     }
-    
+                                                            
     //MARK: - Action
     //MARK: - Action
     @objc func cancelButtonClicked(_ sender: NSView) {
     @objc func cancelButtonClicked(_ sender: NSView) {
-        parentWindow?.endSheet(self.window!)
+        own_closeEndSheet()
     }
     }
     
     
     @objc func insertButtonClicked(_ sender: NSView) {
     @objc func insertButtonClicked(_ sender: NSView) {
+        let pageRangeSelectIndex = pageRangeSelect.indexOfSelect()
+
+        let fileAttribute = KMNFileAttribute()
+        fileAttribute.password = insertDocument?.password ?? ""
+        fileAttribute.filePath =  insertDocument?.documentURL.path ?? ""
+
+        if pageRangeSelectIndex == 0  {
+            fileAttribute.bAllPage = true
+            fileAttribute.pagesType = .AllPages
+        } else if pageRangeSelectIndex == 1 {
+            fileAttribute.bAllPage = false
+            fileAttribute.pagesType = .OnlyOdd
+        } else {
+            if(insertDocument?.pageCount ?? 0 <= 1) {
+                fileAttribute.bAllPage = false
+                fileAttribute.pagesType = .PagesString
+                fileAttribute.pagesString = pageRangeSelect.properties.text ?? ""
+            } else {
+                fileAttribute.bAllPage = false
+                if(pageRangeSelectIndex == 2) {
+                    fileAttribute.pagesType = .OnlyEven
+                } else {
+                    fileAttribute.bAllPage = false
+                    fileAttribute.pagesType = .PagesString
+                    fileAttribute.pagesString = pageRangeSelect.properties.text ?? ""
+                }
+            }
+        }
         
         
-        parentWindow?.endSheet(self.window!)
+        if (fileAttribute.fetchSelectPages().isEmpty) {
+            let alert = NSAlert()
+            alert.alertStyle = .critical
+            alert.messageText = String(format: "%@ %@", fileAttribute.filePath.lastPathComponent, KMLocalizedString("Invalid page range or the page number is out of range. Please try again."))
+            alert.runModal()
+            return
+        }
+        
+        var insetPageDex:Int = 0
+        if firstRadioButton.properties.checkboxType == .selected {
+            insetPageDex = 0
+        } else if lastRadioButton.properties.checkboxType == .selected {
+            insetPageDex = Int(orgDocument?.pageCount ?? 0)
+        } else if pageRadioButton.properties.checkboxType == .selected {
+            insetPageDex = Int(pageNumInput.properties.text ?? "0") ?? 0
+            let positionSelectIndex = positionSelect.indexOfSelect()
+            if (1 == positionSelectIndex) {
+                insetPageDex -= 1
+            }
+        }
+        callback?(fileAttribute,insetPageDex)
+                
+        own_closeEndSheet()
     }
     }
     
     
     @objc func insertPositionAction(_ sender: NSView) {
     @objc func insertPositionAction(_ sender: NSView) {
+        var oldSelectRadioBtn:ComponentRadio?  = nil
         if sender == lastRadioButton {
         if sender == lastRadioButton {
-            
+            if(firstRadioButton.properties.checkboxType == .selected) {
+                oldSelectRadioBtn = firstRadioButton
+            } else if (pageRadioButton.properties.checkboxType == .selected){
+                oldSelectRadioBtn = pageRadioButton
+                
+                pageNumInput.properties.isDisabled = true
+                positionSelect.properties.isDisabled = true
+                pageNumInput.reloadData()
+                positionSelect.reloadData()
+            }
         } else if sender == firstRadioButton {
         } else if sender == firstRadioButton {
-            
+            if(lastRadioButton.properties.checkboxType == .selected) {
+                oldSelectRadioBtn = lastRadioButton
+            } else if (pageRadioButton.properties.checkboxType == .selected){
+                oldSelectRadioBtn = pageRadioButton
+                
+                pageNumInput.properties.isDisabled = true
+                positionSelect.properties.isDisabled = true
+                pageNumInput.reloadData()
+                positionSelect.reloadData()
+            }
         } else if sender == pageRadioButton {
         } else if sender == pageRadioButton {
+            if(lastRadioButton.properties.checkboxType == .selected) {
+                oldSelectRadioBtn = lastRadioButton
+            } else if (firstRadioButton.properties.checkboxType == .selected){
+                oldSelectRadioBtn = firstRadioButton
+            }
             
             
+            pageNumInput.properties.isDisabled = false
+            positionSelect.properties.isDisabled = false
+            pageNumInput.reloadData()
+            positionSelect.reloadData()
+        }
+        
+        if(oldSelectRadioBtn != nil) {
+            oldSelectRadioBtn?.properties.checkboxType = .normal
+            oldSelectRadioBtn?.reloadData()
         }
         }
     }
     }
     
     
     @objc func chooseURLAction(_ sender: NSView) {
     @objc func chooseURLAction(_ sender: NSView) {
-        
+        let openPanel = NSOpenPanel()
+        openPanel.allowedFileTypes = ["pdf","PDF"]
+        openPanel.allowsMultipleSelection = false
+        openPanel.beginSheetModal(for: self.window!) { [self] result in
+            if (result == .OK) {
+                let fileURL = openPanel.url
+                let pdfDoc = CPDFDocument(url: fileURL)
+                if let data = pdfDoc?.isLocked, data {
+                    DispatchQueue.main.asyncAfter(deadline: .now()+0.5) {
+                        KMNBaseWindowController.checkPassword(url: fileURL ?? NSURL.fileURL(withPath: ""), type: .owner) { result, pwd in
+                            if (pwd.isEmpty == false) {
+                                self.insertDocument = CPDFDocument(url: fileURL)
+                                if let data = self.insertDocument?.isLocked, data {
+                                    self.insertDocument?.unlock(withPassword: pwd)
+                                }
+                                self.updateInsertPDF()
+                            }
+                        }
+                    }
+                } else {
+                    self.insertDocument = CPDFDocument(url: fileURL)
+                    self.updateInsertPDF()
+                }
+            }
+        }
     }
     }
-
-
 }
 }
 
 
+//MARK: - ComponentInputNumberDelegate
 extension KMNPDFInsertPDFWindowController: ComponentInputNumberDelegate {
 extension KMNPDFInsertPDFWindowController: ComponentInputNumberDelegate {
     func componentInputNumberDidValueChanged(inputNumber: ComponentInputNumber?) {
     func componentInputNumberDidValueChanged(inputNumber: ComponentInputNumber?) {
+        if(inputNumber == pageNumInput) {
+            
+        }
     }
     }
 }
 }
 
 
+//MARK: - ComponentSelectDelegate
 extension KMNPDFInsertPDFWindowController: ComponentSelectDelegate {
 extension KMNPDFInsertPDFWindowController: ComponentSelectDelegate {
     func componentSelectDidSelect(view: ComponentSelect?, menuItemProperty: ComponentMenuitemProperty?) {
     func componentSelectDidSelect(view: ComponentSelect?, menuItemProperty: ComponentMenuitemProperty?) {
+        if(view == pageRangeSelect) {
+            let pageRangeSelectIndex = pageRangeSelect.indexOfSelect()
+            var isEditIndex:Int = 3
+            
+            if(insertDocument?.pageCount ?? 0 <= 1) {
+                isEditIndex = 2
+            }
+            if (pageRangeSelectIndex == isEditIndex) {
+                pageRangeSelect.properties.text = ""
 
 
+                pageRangeSelect.properties.placeholder = KMLocalizedString("e.g. 1,3-5,10")
+                pageRangeSelect.properties.creatable = true
+            } else {
+                pageRangeSelect.properties.placeholder = ""
+                pageRangeSelect.properties.creatable = false
+            }
+            pageRangeSelect.reloadData()
+            
+        } else if (view == positionSelect) {
+            
+        }
     }
     }
 }
 }
 
 

+ 2 - 2
PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNPDFInsert/KMNPDFInsertPDFWindowController.xib

@@ -36,7 +36,7 @@
             <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
             <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
             <rect key="contentRect" x="196" y="240" width="557" height="563"/>
             <rect key="contentRect" x="196" y="240" width="557" height="563"/>
             <rect key="screenRect" x="0.0" y="0.0" width="1512" height="944"/>
             <rect key="screenRect" x="0.0" y="0.0" width="1512" height="944"/>
-            <view key="contentView" misplaced="YES" id="se5-gp-TjO">
+            <view key="contentView" id="se5-gp-TjO">
                 <rect key="frame" x="0.0" y="0.0" width="480" height="372"/>
                 <rect key="frame" x="0.0" y="0.0" width="480" height="372"/>
                 <autoresizingMask key="autoresizingMask"/>
                 <autoresizingMask key="autoresizingMask"/>
                 <subviews>
                 <subviews>
@@ -60,7 +60,7 @@
                                         <rect key="frame" x="0.0" y="0.0" width="432" height="100"/>
                                         <rect key="frame" x="0.0" y="0.0" width="432" height="100"/>
                                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                         <subviews>
                                         <subviews>
-                                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="7Kc-s2-wkr" customClass="ComponentInputWithAddon" customModule="KMComponentLibrary">
+                                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="7Kc-s2-wkr" customClass="ComponentInput" customModule="KMComponentLibrary">
                                                 <rect key="frame" x="0.0" y="40" width="372" height="32"/>
                                                 <rect key="frame" x="0.0" y="40" width="372" height="32"/>
                                                 <constraints>
                                                 <constraints>
                                                     <constraint firstAttribute="height" constant="32" id="amC-hw-pBl"/>
                                                     <constraint firstAttribute="height" constant="32" id="amC-hw-pBl"/>

+ 418 - 0
PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNPDFSplit/KMNSplitPDFWindowController.swift

@@ -0,0 +1,418 @@
+//
+//  KMNSplitPDFWindowController.swift
+//  PDF Reader Pro
+//
+//  Created by 丁林圭 on 2024/10/24.
+//
+
+import Cocoa
+
+import KMComponentLibrary
+
+class KMNSplitPDFWindowController: KMNBaseWindowController {
+    @IBOutlet var titleLabel: NSTextField!
+    
+    @IBOutlet var methodLabel: NSTextField!
+    @IBOutlet var averagePerRadio: ComponentRadio!
+    @IBOutlet var averagePernInputNumber: ComponentInputNumber!
+    @IBOutlet var averagePernLabel: NSTextField!
+    @IBOutlet var averageSplitRadio: ComponentRadio!
+    @IBOutlet var averageSplitInputNumber: ComponentInputNumber!
+    @IBOutlet var averageSplitLabel: NSTextField!
+    @IBOutlet var splitRangeRadio: ComponentRadio!
+    @IBOutlet var splitRangeSelect: ComponentSelect!
+
+    @IBOutlet var fileTitleLabel: NSTextField!
+    @IBOutlet var fileNameBox: NSBox!
+    @IBOutlet var fileNameLabel: NSTextField!
+
+    @IBOutlet var precedeCheckBox: ComponentCheckBox!
+    @IBOutlet var tagCheckBox: ComponentCheckBox!
+    @IBOutlet var tagInput: ComponentInput!
+    @IBOutlet var separatorCheckBox: ComponentCheckBox!
+    @IBOutlet var separatorInput: ComponentInput!
+    
+    @IBOutlet var cancelButton: ComponentButton!
+    @IBOutlet var splitButton: ComponentButton!
+
+    @IBOutlet var cancelWidthButton:NSLayoutConstraint!
+    @IBOutlet var splitWidthButton:NSLayoutConstraint!
+    @IBOutlet var averagePerRadioWidthButton:NSLayoutConstraint!
+    @IBOutlet var averageSplitRadioWidthButton:NSLayoutConstraint!
+    @IBOutlet var splitRangeRadioWidthButton:NSLayoutConstraint!
+    @IBOutlet var tagCheckWidthButton:NSLayoutConstraint!
+    @IBOutlet var separatorCheckWidthButton:NSLayoutConstraint!
+
+    private var orgDocument:CPDFDocument?
+    private var selectionIndexPaths: Set<IndexPath> = []
+
+    private func setUpProperty() {
+        titleLabel.stringValue = KMLocalizedString("Split")
+        titleLabel.font =  ComponentLibrary.shared.getFontFromKey("mac/body-m-medium")
+        titleLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("colorText/1")
+        
+        methodLabel.stringValue = KMLocalizedString("Split Method")
+        methodLabel.font = ComponentLibrary.shared.getFontFromKey("mac/body-m-medium")
+        methodLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("colorText/2")
+        
+        fileTitleLabel.stringValue = KMLocalizedString("File Name")
+        fileTitleLabel.font = ComponentLibrary.shared.getFontFromKey("mac/body-m-medium")
+        fileTitleLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("colorText/2")
+        
+        averagePerRadio.properties = ComponentCheckBoxProperty(size: .s,
+                                                               state: .normal,
+                                                               isDisabled: false,
+                                                               showhelp: false,
+                                                               text: KMLocalizedString("Split by every"),
+                                                               checkboxType: .normal)
+        averagePernLabel.stringValue = KMLocalizedString("page(s)")
+        averagePernLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("colorText/1")
+        averagePernLabel.font =  ComponentLibrary.shared.getFontFromKey("comp-field/colorText-filled-dis")
+
+        averageSplitRadio.properties = ComponentCheckBoxProperty(size: .s,
+                                                                 state: .normal,
+                                                                 isDisabled: false,
+                                                                 showhelp: false,
+                                                                 text: KMLocalizedString("Split averagely to"),
+                                                                 checkboxType: .normal)
+        averageSplitLabel.stringValue = KMLocalizedString("PDF files")
+        averageSplitLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("comp-field/colorText-filled-dis")
+        averageSplitLabel.font =  ComponentLibrary.shared.getFontFromKey("mac/body-s-regular")
+        
+        fileNameLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("colorText/2")
+        fileNameLabel.font =  ComponentLibrary.shared.getFontFromKey("mac/body-s-regular")
+
+        splitRangeRadio.properties = ComponentCheckBoxProperty(size: .s,
+                                                               state: .normal,
+                                                               isDisabled: false,
+                                                               showhelp: false,
+                                                               text: KMLocalizedString("Split by page range"),
+                                                               checkboxType: .selected)
+        
+        precedeCheckBox.properties = ComponentCheckBoxProperty(size: .s,
+                                                               state: .normal,
+                                                               isDisabled: false,
+                                                               showhelp: false,
+                                                               text: KMLocalizedString("Keep the current file name in front of labels"),
+                                                               checkboxType: .selected)
+        tagCheckBox.properties = ComponentCheckBoxProperty(size: .s,
+                                                           state: .normal,
+                                                           isDisabled: false,
+                                                           showhelp: false,
+                                                           text: KMLocalizedString("Label"),
+                                                           checkboxType: .selected)
+        
+        separatorCheckBox.properties = ComponentCheckBoxProperty(size: .s,
+                                                                 state: .normal,
+                                                                 isDisabled: false,
+                                                                 showhelp: false,
+                                                                 text: KMLocalizedString("Separator"),
+                                                                 checkboxType: .selected)
+        
+        averagePernInputNumber.properties = ComponentInputNumberProperty(alignment: .left,
+                                                                          size: .s,
+                                                                          state: .normal,
+                                                                          isError: false,
+                                                                          showErrorInfo: false,
+                                                                          isDisabled: false,
+                                                                          showPrefix: false,
+                                                                          showSuffix: false,
+                                                                          minSize: 1,
+                                                                          maxSize: Int(orgDocument?.pageCount ?? 1),
+                                                                          text:"1")
+        averagePernInputNumber.inputNumberDelegate = self
+        
+        averageSplitInputNumber.properties = ComponentInputNumberProperty(alignment: .left,
+                                                                          size: .s,
+                                                                          state: .normal,
+                                                                          isError: false,
+                                                                          showErrorInfo: false,
+                                                                          isDisabled: true,
+                                                                          showPrefix: false,
+                                                                          showSuffix: false,
+                                                                          minSize: 1,
+                                                                          maxSize: Int(orgDocument?.pageCount ?? 1),
+                                                                          text: "1")
+        averageSplitInputNumber.inputNumberDelegate = self
+        
+        let inputTagProperty: ComponentInputProperty = ComponentInputProperty(size: .s,
+                                                                           state:.pressed ,
+                                                                           isError: false,
+                                                                           showPrefix: false,
+                                                                           showSuffix: false,
+                                                                           showClear: false,
+                                                                           isDisabled: false,
+                                                                           placeholder: "",
+                                                                           text: "Part")
+        tagInput.properties = inputTagProperty
+        
+        let inputSeparatorProperty: ComponentInputProperty = ComponentInputProperty(size: .s,
+                                                                           state:.pressed ,
+                                                                           isError: false,
+                                                                           showPrefix: false,
+                                                                           showSuffix: false,
+                                                                           showClear: false,
+                                                                           isDisabled: false,
+                                                                           placeholder: "",
+                                                                           text: "-")
+        separatorInput.properties = inputSeparatorProperty
+        
+        splitRangeSelect.properties = ComponentSelectProperties(size: .s,
+                                                                state: .normal,
+                                                                isDisabled: false,
+                                                                isError: false,
+                                                                leftIcon: false,
+                                                                placeholder: nil,
+                                                                errorText: nil,
+                                                                creatable: false,
+                                                                text: KMLocalizedString("Odd Pages Only", comment: ""))
+
+
+        splitButton.properties = ComponentButtonProperty(type: .primary,
+                                                         size: .s,
+                                                         state: .normal,
+                                                         isDisable: false,
+                                                         buttonText: KMLocalizedString("Split"))
+        splitButton.setTarget(self, action: #selector(splitButtonClicked(_ :)))
+        splitWidthButton.constant = splitButton.properties.propertyInfo.viewWidth
+        
+        cancelButton.properties = ComponentButtonProperty(type: .default_tertiary,
+                                                          size: .s,
+                                                          state: .normal,
+                                                          buttonText: KMLocalizedString("Cancel"))
+        cancelButton.setTarget(self, action: #selector(cancelButtonClicked(_ :)))
+        cancelWidthButton.constant = cancelButton.properties.propertyInfo.viewWidth
+        
+        fileNameBox.fillColor = ComponentLibrary.shared.getComponentColorFromKey("comp-field/colorText-filled-dis")
+        
+        averagePerRadio.setTarget(self, action: #selector(splitMethodClicked(_:)))
+        averageSplitRadio.setTarget(self, action: #selector(splitMethodClicked(_:)))
+        splitRangeRadio.setTarget(self, action: #selector(splitMethodClicked(_:)))
+        
+        precedeCheckBox.setTarget(self, action: #selector(changeNameClick(_:)))
+        tagCheckBox.setTarget(self, action: #selector(changeNameClick(_:)))
+        separatorCheckBox.setTarget(self, action: #selector(changeNameClick(_:)))
+        
+        setUpPageSelctProperty()
+        
+        splitRangeSelect.delegate = self
+        
+        averagePerRadioWidthButton.constant = averagePerRadio.properties.propertyInfo.viewWidth
+        averageSplitRadioWidthButton.constant = averageSplitRadio.properties.propertyInfo.viewWidth
+        splitRangeRadioWidthButton.constant = splitRangeRadio.properties.propertyInfo.viewWidth
+        tagCheckWidthButton.constant = tagCheckBox.properties.propertyInfo.viewWidth
+        separatorCheckWidthButton.constant = separatorCheckBox.properties.propertyInfo.viewWidth
+        cancelWidthButton.constant = cancelButton.properties.propertyInfo.viewWidth
+        splitWidthButton.constant = splitButton.properties.propertyInfo.viewWidth
+    }
+    
+    private func setUpPageSelctProperty() {
+        var menuItemString:[String] = [KMLocalizedString("Odd Pages Only"),
+                                       KMLocalizedString("Even Pages Only"),
+                                        KMLocalizedString("e.g. 1,3-5,10")]
+        if orgDocument?.pageCount ?? 0 <= 1 {
+            menuItemString.removeObject(KMLocalizedString("Even Pages Only"))
+        }
+        var menuItemArr: [ComponentMenuitemProperty] = []
+        for language in menuItemString {
+            let itemProperty: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
+                                                                                    itemSelected: false,
+                                                                                    isDisabled: false,
+                                                                                    keyEquivalent: nil,
+                                                                                    text: language)
+            menuItemArr.append(itemProperty)
+        }
+
+        
+        splitRangeSelect.updateMenuItemsArr(menuItemArr)
+    }
+
+    override func windowDidLoad() {
+        super.windowDidLoad()
+        
+        setUpProperty()
+        
+        var isEditIndex:Int = 2
+        
+        if(orgDocument?.pageCount ?? 0 <= 1) {
+            isEditIndex = 1
+        }
+        
+        splitRangeSelect.selectItemAtIndex(isEditIndex)
+        splitRangeSelect.properties.creatable = true
+        splitRangeSelect.properties.text =
+        KMNTools.parseIndexPathsSet(indexSets: selectionIndexPaths)
+        splitRangeSelect.reloadData()
+        
+        updateFileName()
+    }
+    
+    func updateFileName() {
+        let pdfName = orgDocument?.documentURL.deletingPathExtension().path.lastPathComponent ?? ""
+        var splitPartString = ""
+        var separatorString = ""
+        
+        if (tagCheckBox.properties.checkboxType == .selected) {
+            splitPartString = tagInput.properties.text
+        }
+        if (separatorCheckBox.properties.checkboxType == .selected) {
+            separatorString = separatorInput.properties.text
+        }
+        var partName = ""
+        if (precedeCheckBox.properties.checkboxType == .selected) {
+            if (separatorString.isEmpty == false) {
+                if (partName.isEmpty == false) {
+                    partName.append(separatorString)
+                } else {
+                    partName = separatorString
+                }
+            }
+            if (splitPartString.isEmpty == false) {
+                if (partName.isEmpty == false) {
+                    partName.append(splitPartString)
+                } else {
+                    partName = splitPartString
+                }
+            }
+            fileNameLabel.stringValue = String(format: "%@%@.pdf", pdfName, partName)
+        } else {
+            if (splitPartString.isEmpty == false) {
+                if (partName.isEmpty == false) {
+                    partName.append(splitPartString)
+                } else {
+                    partName = splitPartString
+                }
+            }
+            if (separatorString.isEmpty == false) {
+                if (partName.isEmpty == false) {
+                    partName.append(separatorString)
+                } else {
+                    partName = separatorString
+                }
+            }
+            fileNameLabel.stringValue = String(format: "%@%@.pdf", partName, pdfName)
+        }
+    }
+    
+    convenience init(_ document: CPDFDocument?, selectionIndexPaths: Set<IndexPath>) {
+        self.init(windowNibName: "KMNSplitPDFWindowController")
+        orgDocument = document
+        self.selectionIndexPaths = selectionIndexPaths  // 修正此行
+    }
+
+    convenience init(_ filePath: String,password:String?) {
+        self.init(windowNibName: "KMNSplitPDFWindowController")
+        let document = CPDFDocument.init(url: URL(fileURLWithPath: filePath))
+        if password != nil {
+            document?.unlock(withPassword: password as String?)
+        }
+
+        orgDocument = document
+        selectionIndexPaths = [IndexPath(item: 0, section: 0)]  // 修正此行
+    }
+    
+    //MARK: - Action
+    @objc func cancelButtonClicked(_ sender: NSView) {
+        own_closeEndSheet()
+    }
+    
+    @objc func splitButtonClicked(_ sender: NSView) {
+                
+        own_closeEndSheet()
+    }
+    
+    @objc func changeNameClick(_ sender: NSView){
+        updateFileName()
+    }
+    
+    @objc func splitMethodClicked(_ sender: NSView){
+        var oldSelectRadioBtn:ComponentRadio?  = nil
+        if sender == averagePerRadio {
+            if(averageSplitRadio.properties.checkboxType == .selected) {
+                oldSelectRadioBtn = averageSplitRadio
+                
+                averageSplitInputNumber.properties.isDisabled = true
+                averageSplitLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("comp-field/colorText-filled-dis")
+                averageSplitInputNumber.reloadData()
+            } else if (splitRangeRadio.properties.checkboxType == .selected){
+                oldSelectRadioBtn = splitRangeRadio
+                
+                splitRangeSelect.properties.isDisabled = true
+                splitRangeSelect.reloadData()
+            }
+            averagePernInputNumber.properties.isDisabled = false
+            averagePernLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("colorText/1")
+            averagePernInputNumber.reloadData()
+        } else if sender == averageSplitRadio {
+            if(averagePerRadio.properties.checkboxType == .selected) {
+                oldSelectRadioBtn = averagePerRadio
+                
+                averagePernInputNumber.properties.isDisabled = true
+                averagePernLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("comp-field/colorText-filled-dis")
+                averagePernInputNumber.reloadData()
+                
+            } else if (splitRangeRadio.properties.checkboxType == .selected){
+                oldSelectRadioBtn = splitRangeRadio
+                
+                splitRangeSelect.properties.isDisabled = true
+                splitRangeSelect.reloadData()
+            }
+            averageSplitInputNumber.properties.isDisabled = false
+            averageSplitLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("colorText/1")
+            averageSplitInputNumber.reloadData()
+        } else if sender == splitRangeRadio {
+            if(averagePerRadio.properties.checkboxType == .selected) {
+                oldSelectRadioBtn = averagePerRadio
+                averagePernInputNumber.properties.isDisabled = true
+                averagePernLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("comp-field/colorText-filled-dis")
+                averagePernInputNumber.reloadData()
+            } else if (averageSplitRadio.properties.checkboxType == .selected){
+                oldSelectRadioBtn = averageSplitRadio
+                averageSplitInputNumber.properties.isDisabled = true
+                averageSplitLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("comp-field/colorText-filled-dis")
+                averageSplitInputNumber.reloadData()
+            }
+            
+            splitRangeSelect.properties.isDisabled = false
+            splitRangeSelect.reloadData()
+        }
+        
+        if(oldSelectRadioBtn != nil) {
+            oldSelectRadioBtn?.properties.checkboxType = .normal
+            oldSelectRadioBtn?.reloadData()
+        }
+    }
+}
+
+//MARK: - ComponentInputNumberDelegate
+extension KMNSplitPDFWindowController: ComponentInputNumberDelegate {
+    func componentInputNumberDidValueChanged(inputNumber: ComponentInputNumber?) {
+    
+    }
+}
+
+//MARK: - ComponentSelectDelegate
+extension KMNSplitPDFWindowController: ComponentSelectDelegate {
+    func componentSelectDidSelect(view: ComponentSelect?, menuItemProperty: ComponentMenuitemProperty?) {
+        if(view == splitRangeSelect) {
+            let pageRangeSelectIndex = splitRangeSelect.indexOfSelect()
+            var isEditIndex:Int = 2
+            
+            if(orgDocument?.pageCount ?? 0 <= 1) {
+                isEditIndex = 1
+            }
+            if (pageRangeSelectIndex == isEditIndex) {
+                splitRangeSelect.properties.text = ""
+
+                splitRangeSelect.properties.placeholder = KMLocalizedString("e.g. 1,3-5,10")
+                splitRangeSelect.properties.creatable = true
+            } else {
+                splitRangeSelect.properties.placeholder = ""
+                splitRangeSelect.properties.creatable = false
+            }
+            splitRangeSelect.reloadData()
+            
+            
+        }
+    }
+}

+ 342 - 0
PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNPDFSplit/KMNSplitPDFWindowController.xib

@@ -0,0 +1,342 @@
+<?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="KMNSplitPDFWindowController" customModule="PDF_Reader_Pro" customModuleProvider="target">
+            <connections>
+                <outlet property="averagePerRadio" destination="QNR-bY-o0a" id="fr7-ya-7no"/>
+                <outlet property="averagePerRadioWidthButton" destination="g2O-rM-rg3" id="to7-Pa-s6h"/>
+                <outlet property="averagePernInputNumber" destination="VtK-QB-kfV" id="7cA-uB-GVl"/>
+                <outlet property="averagePernLabel" destination="taE-wg-hAl" id="Sb7-kQ-zzo"/>
+                <outlet property="averageSplitInputNumber" destination="URa-ZG-kvD" id="1l7-vq-65r"/>
+                <outlet property="averageSplitLabel" destination="hSV-Fh-E6f" id="0YI-SK-OKP"/>
+                <outlet property="averageSplitRadio" destination="tUV-il-jUA" id="1pf-QW-WmU"/>
+                <outlet property="averageSplitRadioWidthButton" destination="0Ip-y2-bce" id="F0X-zC-qiM"/>
+                <outlet property="cancelButton" destination="c9Q-10-BN1" id="Arq-5A-2TJ"/>
+                <outlet property="cancelWidthButton" destination="QD7-Wm-ID7" id="gtQ-x5-7K7"/>
+                <outlet property="fileNameBox" destination="lcM-Zg-T2N" id="PjB-Sc-WLB"/>
+                <outlet property="fileNameLabel" destination="G4G-Lb-K8M" id="go0-rd-oHd"/>
+                <outlet property="fileTitleLabel" destination="E7d-kr-3NP" id="lbd-9A-IEr"/>
+                <outlet property="methodLabel" destination="UQm-9R-ufX" id="DNH-Wf-Xaj"/>
+                <outlet property="precedeCheckBox" destination="ns0-6a-3Zb" id="36m-bT-Pbt"/>
+                <outlet property="separatorCheckBox" destination="cHx-41-a4x" id="grJ-CN-EyI"/>
+                <outlet property="separatorCheckWidthButton" destination="Abe-jb-3iL" id="ATb-a1-i7X"/>
+                <outlet property="separatorInput" destination="TZS-vp-GuO" id="mxR-rj-mIO"/>
+                <outlet property="splitButton" destination="lHU-2j-0SQ" id="EVK-mi-vLS"/>
+                <outlet property="splitRangeRadio" destination="OQ5-6X-OjQ" id="gXR-cC-nkK"/>
+                <outlet property="splitRangeRadioWidthButton" destination="b6x-Js-9ra" id="MVw-Mh-bel"/>
+                <outlet property="splitRangeSelect" destination="VNh-Qe-w42" id="wSP-pe-T3n"/>
+                <outlet property="splitWidthButton" destination="tMj-t8-ZAT" id="OAt-zy-HCv"/>
+                <outlet property="tagCheckBox" destination="fBw-l2-vHD" id="x1F-fZ-KHa"/>
+                <outlet property="tagCheckWidthButton" destination="HPj-5t-SoQ" id="MfB-vp-AVs"/>
+                <outlet property="tagInput" destination="q8l-c0-d1C" id="0ik-fl-yD1"/>
+                <outlet property="titleLabel" destination="jDk-6k-wPg" id="miZ-GX-pMC"/>
+                <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 allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" hasShadow="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" titlebarAppearsTransparent="YES" id="F0z-JX-Cv5">
+            <windowStyleMask key="styleMask" fullSizeContentView="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="502"/>
+                <autoresizingMask key="autoresizingMask"/>
+                <subviews>
+                    <box boxType="custom" borderWidth="0.0" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="J6U-4A-QXu">
+                        <rect key="frame" x="24" y="16" width="432" height="470"/>
+                        <view key="contentView" id="GOc-Px-FVN">
+                            <rect key="frame" x="0.0" y="0.0" width="432" height="470"/>
+                            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                            <subviews>
+                                <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="jDk-6k-wPg">
+                                    <rect key="frame" x="-2" y="454" width="436" height="16"/>
+                                    <textFieldCell key="cell" lineBreakMode="clipping" title="Split" id="cYm-fs-fJs">
+                                        <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>
+                                <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="Q6A-RB-Ma1">
+                                    <rect key="frame" x="0.0" y="272" width="432" height="166"/>
+                                    <view key="contentView" id="bHe-mF-VFs">
+                                        <rect key="frame" x="0.0" y="0.0" width="432" height="166"/>
+                                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                        <subviews>
+                                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="QNR-bY-o0a" customClass="ComponentRadio" customModule="KMComponentLibrary">
+                                                <rect key="frame" x="0.0" y="94" width="98" height="32"/>
+                                                <constraints>
+                                                    <constraint firstAttribute="height" constant="32" id="eN4-vv-2FB"/>
+                                                    <constraint firstAttribute="width" constant="98" id="g2O-rM-rg3"/>
+                                                </constraints>
+                                            </customView>
+                                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="tUV-il-jUA" customClass="ComponentRadio" customModule="KMComponentLibrary">
+                                                <rect key="frame" x="0.0" y="54" width="100" height="32"/>
+                                                <constraints>
+                                                    <constraint firstAttribute="width" constant="100" id="0Ip-y2-bce"/>
+                                                    <constraint firstAttribute="height" constant="32" id="gdP-n3-RdE"/>
+                                                </constraints>
+                                            </customView>
+                                            <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="UQm-9R-ufX">
+                                                <rect key="frame" x="-2" y="138" width="436" height="16"/>
+                                                <textFieldCell key="cell" lineBreakMode="clipping" title="Split Method" id="cI1-Kj-hfi">
+                                                    <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="OQ5-6X-OjQ" customClass="ComponentRadio" customModule="KMComponentLibrary">
+                                                <rect key="frame" x="0.0" y="14" width="90" height="32"/>
+                                                <constraints>
+                                                    <constraint firstAttribute="height" constant="32" id="W7t-AF-CBU"/>
+                                                    <constraint firstAttribute="width" constant="90" id="b6x-Js-9ra"/>
+                                                </constraints>
+                                            </customView>
+                                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="VNh-Qe-w42" customClass="ComponentSelect" customModule="KMComponentLibrary">
+                                                <rect key="frame" x="98" y="14" width="334" height="32"/>
+                                                <constraints>
+                                                    <constraint firstAttribute="height" constant="32" id="t2F-JL-BWZ"/>
+                                                </constraints>
+                                            </customView>
+                                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="VtK-QB-kfV" customClass="ComponentInputNumber" customModule="KMComponentLibrary">
+                                                <rect key="frame" x="106" y="94" width="96" height="32"/>
+                                                <constraints>
+                                                    <constraint firstAttribute="width" constant="96" id="JPd-DV-TKo"/>
+                                                    <constraint firstAttribute="height" constant="32" id="wWO-v0-kf7"/>
+                                                </constraints>
+                                            </customView>
+                                            <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="taE-wg-hAl">
+                                                <rect key="frame" x="208" y="102" width="226" height="16"/>
+                                                <textFieldCell key="cell" lineBreakMode="clipping" title="page(s) split into a PDF file" id="Xjj-Vz-9HY">
+                                                    <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="URa-ZG-kvD" customClass="ComponentInputNumber" customModule="KMComponentLibrary">
+                                                <rect key="frame" x="108" y="54" width="96" height="32"/>
+                                                <constraints>
+                                                    <constraint firstAttribute="width" constant="96" id="80b-Kw-yF3"/>
+                                                    <constraint firstAttribute="height" constant="32" id="xt9-QO-Oc7"/>
+                                                </constraints>
+                                            </customView>
+                                            <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="hSV-Fh-E6f">
+                                                <rect key="frame" x="210" y="62" width="224" height="16"/>
+                                                <textFieldCell key="cell" lineBreakMode="clipping" title="PDF files" id="uMu-7j-jve">
+                                                    <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="URa-ZG-kvD" firstAttribute="centerY" secondItem="tUV-il-jUA" secondAttribute="centerY" id="1sb-4R-bHQ"/>
+                                            <constraint firstItem="URa-ZG-kvD" firstAttribute="leading" secondItem="tUV-il-jUA" secondAttribute="trailing" constant="8" id="2yC-7S-Y0P"/>
+                                            <constraint firstItem="hSV-Fh-E6f" firstAttribute="centerY" secondItem="tUV-il-jUA" secondAttribute="centerY" id="2z7-DF-9e0"/>
+                                            <constraint firstAttribute="trailing" secondItem="taE-wg-hAl" secondAttribute="trailing" id="37M-qP-a9U"/>
+                                            <constraint firstItem="taE-wg-hAl" firstAttribute="centerY" secondItem="VtK-QB-kfV" secondAttribute="centerY" id="BtV-3H-hg7"/>
+                                            <constraint firstItem="tUV-il-jUA" firstAttribute="leading" secondItem="bHe-mF-VFs" secondAttribute="leading" id="I26-Np-JD3"/>
+                                            <constraint firstItem="tUV-il-jUA" firstAttribute="top" secondItem="QNR-bY-o0a" secondAttribute="bottom" constant="8" id="If6-DC-vh1"/>
+                                            <constraint firstItem="VtK-QB-kfV" firstAttribute="leading" secondItem="QNR-bY-o0a" secondAttribute="trailing" constant="8" id="Iin-IB-rE9"/>
+                                            <constraint firstItem="OQ5-6X-OjQ" firstAttribute="top" secondItem="tUV-il-jUA" secondAttribute="bottom" constant="8" id="JPs-hI-cN6"/>
+                                            <constraint firstItem="VtK-QB-kfV" firstAttribute="centerY" secondItem="QNR-bY-o0a" secondAttribute="centerY" id="KrA-sC-knu"/>
+                                            <constraint firstAttribute="trailing" secondItem="hSV-Fh-E6f" secondAttribute="trailing" id="OSH-2J-Pk4"/>
+                                            <constraint firstItem="QNR-bY-o0a" firstAttribute="leading" secondItem="bHe-mF-VFs" secondAttribute="leading" id="PJQ-KQ-XsX"/>
+                                            <constraint firstItem="QNR-bY-o0a" firstAttribute="top" secondItem="UQm-9R-ufX" secondAttribute="bottom" constant="12" id="RMj-xS-gju"/>
+                                            <constraint firstItem="OQ5-6X-OjQ" firstAttribute="leading" secondItem="bHe-mF-VFs" secondAttribute="leading" id="SID-9T-PHQ"/>
+                                            <constraint firstItem="hSV-Fh-E6f" firstAttribute="leading" secondItem="URa-ZG-kvD" secondAttribute="trailing" constant="8" id="Seb-IZ-eCt"/>
+                                            <constraint firstAttribute="trailing" secondItem="UQm-9R-ufX" secondAttribute="trailing" id="cJ6-5g-Dcj"/>
+                                            <constraint firstItem="UQm-9R-ufX" firstAttribute="leading" secondItem="bHe-mF-VFs" secondAttribute="leading" id="cgr-GO-8o7"/>
+                                            <constraint firstAttribute="trailing" secondItem="VNh-Qe-w42" secondAttribute="trailing" id="dJz-XK-r6x"/>
+                                            <constraint firstAttribute="bottom" secondItem="OQ5-6X-OjQ" secondAttribute="bottom" constant="14" id="i5j-gK-Yez"/>
+                                            <constraint firstItem="taE-wg-hAl" firstAttribute="leading" secondItem="VtK-QB-kfV" secondAttribute="trailing" constant="8" id="k0X-V6-nr0"/>
+                                            <constraint firstItem="VNh-Qe-w42" firstAttribute="leading" secondItem="OQ5-6X-OjQ" secondAttribute="trailing" constant="8" id="rZW-vU-IEJ"/>
+                                            <constraint firstItem="VNh-Qe-w42" firstAttribute="centerY" secondItem="OQ5-6X-OjQ" secondAttribute="centerY" id="te3-86-2yJ"/>
+                                            <constraint firstItem="UQm-9R-ufX" firstAttribute="top" secondItem="bHe-mF-VFs" secondAttribute="top" constant="12" id="xn4-HL-y7R"/>
+                                        </constraints>
+                                    </view>
+                                </box>
+                                <box boxType="custom" borderWidth="0.0" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="DNb-ku-BLc">
+                                    <rect key="frame" x="0.0" y="0.0" width="432" height="32"/>
+                                    <view key="contentView" id="LGT-hj-VkS">
+                                        <rect key="frame" x="0.0" y="0.0" width="432" height="32"/>
+                                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                        <subviews>
+                                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="lHU-2j-0SQ" customClass="ComponentButton" customModule="KMComponentLibrary">
+                                                <rect key="frame" x="370" y="0.0" width="62" height="32"/>
+                                                <constraints>
+                                                    <constraint firstAttribute="height" constant="32" id="gfC-fD-y9T"/>
+                                                    <constraint firstAttribute="width" constant="62" id="tMj-t8-ZAT"/>
+                                                </constraints>
+                                            </customView>
+                                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="c9Q-10-BN1" customClass="ComponentButton" customModule="KMComponentLibrary">
+                                                <rect key="frame" x="300" y="0.0" width="62" height="32"/>
+                                                <constraints>
+                                                    <constraint firstAttribute="width" constant="62" id="QD7-Wm-ID7"/>
+                                                    <constraint firstAttribute="height" constant="32" id="qs4-F5-uho"/>
+                                                </constraints>
+                                            </customView>
+                                        </subviews>
+                                        <constraints>
+                                            <constraint firstItem="c9Q-10-BN1" firstAttribute="top" secondItem="LGT-hj-VkS" secondAttribute="top" id="7uU-xX-5eF"/>
+                                            <constraint firstAttribute="bottom" secondItem="c9Q-10-BN1" secondAttribute="bottom" id="Fdh-b9-HDC"/>
+                                            <constraint firstAttribute="trailing" secondItem="lHU-2j-0SQ" secondAttribute="trailing" id="Fyd-dA-ecc"/>
+                                            <constraint firstItem="lHU-2j-0SQ" firstAttribute="leading" secondItem="c9Q-10-BN1" secondAttribute="trailing" constant="8" id="lUt-lQ-jLq"/>
+                                            <constraint firstItem="lHU-2j-0SQ" firstAttribute="centerY" secondItem="c9Q-10-BN1" secondAttribute="centerY" id="nSS-oL-iSr"/>
+                                        </constraints>
+                                    </view>
+                                </box>
+                                <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="tdg-uu-noc">
+                                    <rect key="frame" x="0.0" y="192" width="432" height="64"/>
+                                    <view key="contentView" id="VRw-3a-f98">
+                                        <rect key="frame" x="0.0" y="0.0" width="432" height="64"/>
+                                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                        <subviews>
+                                            <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="E7d-kr-3NP">
+                                                <rect key="frame" x="-2" y="40" width="436" height="16"/>
+                                                <textFieldCell key="cell" lineBreakMode="clipping" title="File Name" id="zp9-BF-8N0">
+                                                    <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>
+                                            <box boxType="custom" borderWidth="0.0" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="lcM-Zg-T2N">
+                                                <rect key="frame" x="0.0" y="0.0" width="432" height="32"/>
+                                                <view key="contentView" id="J2z-6E-ger">
+                                                    <rect key="frame" x="0.0" y="0.0" width="432" height="32"/>
+                                                    <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                                    <subviews>
+                                                        <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="G4G-Lb-K8M">
+                                                            <rect key="frame" x="3" y="8" width="426" height="16"/>
+                                                            <textFieldCell key="cell" lineBreakMode="clipping" alignment="center" title="Split Method" id="SGc-TN-nF0">
+                                                                <font key="font" usesAppearanceFont="YES"/>
+                                                                <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                                <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                            </textFieldCell>
+                                                        </textField>
+                                                    </subviews>
+                                                    <constraints>
+                                                        <constraint firstAttribute="trailing" secondItem="G4G-Lb-K8M" secondAttribute="trailing" constant="5" id="Ec4-vJ-Oo6"/>
+                                                        <constraint firstItem="G4G-Lb-K8M" firstAttribute="leading" secondItem="J2z-6E-ger" secondAttribute="leading" constant="5" id="bYP-qd-ah7"/>
+                                                        <constraint firstItem="G4G-Lb-K8M" firstAttribute="centerY" secondItem="J2z-6E-ger" secondAttribute="centerY" id="rdZ-fS-hTa"/>
+                                                    </constraints>
+                                                </view>
+                                                <constraints>
+                                                    <constraint firstAttribute="height" constant="32" id="daX-TK-vE7"/>
+                                                </constraints>
+                                                <color key="fillColor" red="0.0" green="0.0" blue="0.0" alpha="0.20496171360000001" colorSpace="custom" customColorSpace="calibratedRGB"/>
+                                            </box>
+                                        </subviews>
+                                        <constraints>
+                                            <constraint firstItem="lcM-Zg-T2N" firstAttribute="top" secondItem="E7d-kr-3NP" secondAttribute="bottom" constant="8" id="5dq-1I-c46"/>
+                                            <constraint firstItem="E7d-kr-3NP" firstAttribute="leading" secondItem="VRw-3a-f98" secondAttribute="leading" id="9r7-Dy-Vyg"/>
+                                            <constraint firstItem="E7d-kr-3NP" firstAttribute="top" secondItem="VRw-3a-f98" secondAttribute="top" constant="8" id="BpC-cj-Nrb"/>
+                                            <constraint firstItem="lcM-Zg-T2N" firstAttribute="leading" secondItem="VRw-3a-f98" secondAttribute="leading" id="SfT-BA-GRl"/>
+                                            <constraint firstAttribute="bottom" secondItem="lcM-Zg-T2N" secondAttribute="bottom" id="aF5-i2-tTd"/>
+                                            <constraint firstAttribute="trailing" secondItem="E7d-kr-3NP" secondAttribute="trailing" id="p5n-8W-f48"/>
+                                            <constraint firstAttribute="trailing" secondItem="lcM-Zg-T2N" secondAttribute="trailing" id="rum-Sj-evs"/>
+                                        </constraints>
+                                    </view>
+                                </box>
+                                <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="1WY-FC-FjB">
+                                    <rect key="frame" x="0.0" y="48" width="432" height="128"/>
+                                    <view key="contentView" id="WVS-PN-b7f">
+                                        <rect key="frame" x="0.0" y="0.0" width="432" height="128"/>
+                                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                        <subviews>
+                                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="fBw-l2-vHD" customClass="ComponentCheckBox" customModule="KMComponentLibrary">
+                                                <rect key="frame" x="0.0" y="48" width="100" height="32"/>
+                                                <constraints>
+                                                    <constraint firstAttribute="width" constant="100" id="HPj-5t-SoQ"/>
+                                                    <constraint firstAttribute="height" constant="32" id="qV4-A9-adY"/>
+                                                </constraints>
+                                            </customView>
+                                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="ns0-6a-3Zb" customClass="ComponentCheckBox" customModule="KMComponentLibrary">
+                                                <rect key="frame" x="0.0" y="88" width="432" height="32"/>
+                                                <constraints>
+                                                    <constraint firstAttribute="height" constant="32" id="kGF-cT-SbX"/>
+                                                </constraints>
+                                            </customView>
+                                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="q8l-c0-d1C" customClass="ComponentInput" customModule="KMComponentLibrary">
+                                                <rect key="frame" x="108" y="48" width="324" height="32"/>
+                                                <constraints>
+                                                    <constraint firstAttribute="height" constant="32" id="j8M-RB-nhU"/>
+                                                </constraints>
+                                            </customView>
+                                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="TZS-vp-GuO" customClass="ComponentInput" customModule="KMComponentLibrary">
+                                                <rect key="frame" x="108" y="8" width="324" height="32"/>
+                                                <constraints>
+                                                    <constraint firstAttribute="height" constant="32" id="ePg-ul-95h"/>
+                                                </constraints>
+                                            </customView>
+                                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="cHx-41-a4x" customClass="ComponentCheckBox" customModule="KMComponentLibrary">
+                                                <rect key="frame" x="0.0" y="8" width="100" height="32"/>
+                                                <constraints>
+                                                    <constraint firstAttribute="width" constant="100" id="Abe-jb-3iL"/>
+                                                    <constraint firstAttribute="height" constant="32" id="sAD-b8-2Uv"/>
+                                                </constraints>
+                                            </customView>
+                                        </subviews>
+                                        <constraints>
+                                            <constraint firstAttribute="bottom" secondItem="cHx-41-a4x" secondAttribute="bottom" constant="8" id="BIw-ce-7OJ"/>
+                                            <constraint firstItem="TZS-vp-GuO" firstAttribute="leading" secondItem="cHx-41-a4x" secondAttribute="trailing" constant="8" id="CCS-sM-Baz"/>
+                                            <constraint firstItem="cHx-41-a4x" firstAttribute="top" secondItem="fBw-l2-vHD" secondAttribute="bottom" constant="8" id="Cvf-zI-gsk"/>
+                                            <constraint firstAttribute="trailing" secondItem="q8l-c0-d1C" secondAttribute="trailing" id="Gl5-V5-pJx"/>
+                                            <constraint firstItem="TZS-vp-GuO" firstAttribute="centerY" secondItem="cHx-41-a4x" secondAttribute="centerY" id="JDq-8E-FRg"/>
+                                            <constraint firstItem="fBw-l2-vHD" firstAttribute="top" secondItem="ns0-6a-3Zb" secondAttribute="bottom" constant="8" id="JFf-aZ-Os5"/>
+                                            <constraint firstItem="fBw-l2-vHD" firstAttribute="leading" secondItem="WVS-PN-b7f" secondAttribute="leading" id="Xcw-cr-VcB"/>
+                                            <constraint firstItem="q8l-c0-d1C" firstAttribute="leading" secondItem="fBw-l2-vHD" secondAttribute="trailing" constant="8" id="ZlD-UA-RqM"/>
+                                            <constraint firstItem="ns0-6a-3Zb" firstAttribute="leading" secondItem="WVS-PN-b7f" secondAttribute="leading" id="bmU-2l-7Ll"/>
+                                            <constraint firstItem="ns0-6a-3Zb" firstAttribute="top" secondItem="WVS-PN-b7f" secondAttribute="top" constant="8" id="f05-zg-fM7"/>
+                                            <constraint firstItem="cHx-41-a4x" firstAttribute="leading" secondItem="WVS-PN-b7f" secondAttribute="leading" id="fyd-RM-WXy"/>
+                                            <constraint firstItem="q8l-c0-d1C" firstAttribute="centerY" secondItem="fBw-l2-vHD" secondAttribute="centerY" id="h29-je-k8R"/>
+                                            <constraint firstAttribute="trailing" secondItem="ns0-6a-3Zb" secondAttribute="trailing" id="mF8-bE-ZDy"/>
+                                            <constraint firstAttribute="trailing" secondItem="TZS-vp-GuO" secondAttribute="trailing" id="rfr-uc-aXz"/>
+                                        </constraints>
+                                    </view>
+                                </box>
+                            </subviews>
+                            <constraints>
+                                <constraint firstItem="tdg-uu-noc" firstAttribute="top" secondItem="Q6A-RB-Ma1" secondAttribute="bottom" constant="16" id="0fm-5c-iuR"/>
+                                <constraint firstAttribute="trailing" secondItem="DNb-ku-BLc" secondAttribute="trailing" id="4GG-Cn-xuW"/>
+                                <constraint firstItem="jDk-6k-wPg" firstAttribute="leading" secondItem="GOc-Px-FVN" secondAttribute="leading" id="4zz-30-R3i"/>
+                                <constraint firstItem="Q6A-RB-Ma1" firstAttribute="leading" secondItem="GOc-Px-FVN" secondAttribute="leading" id="6Tn-tz-TQ1"/>
+                                <constraint firstAttribute="trailing" secondItem="Q6A-RB-Ma1" secondAttribute="trailing" id="7IZ-P2-tJO"/>
+                                <constraint firstItem="1WY-FC-FjB" firstAttribute="top" secondItem="tdg-uu-noc" secondAttribute="bottom" constant="16" id="7pL-ec-mTz"/>
+                                <constraint firstItem="DNb-ku-BLc" firstAttribute="top" secondItem="1WY-FC-FjB" secondAttribute="bottom" constant="16" id="A1L-lz-yhs"/>
+                                <constraint firstAttribute="trailing" secondItem="tdg-uu-noc" secondAttribute="trailing" id="Fu2-y9-sHw"/>
+                                <constraint firstItem="DNb-ku-BLc" firstAttribute="leading" secondItem="GOc-Px-FVN" secondAttribute="leading" id="LBX-sb-7oQ"/>
+                                <constraint firstAttribute="trailing" secondItem="jDk-6k-wPg" secondAttribute="trailing" id="NlW-yE-1KU"/>
+                                <constraint firstItem="1WY-FC-FjB" firstAttribute="leading" secondItem="GOc-Px-FVN" secondAttribute="leading" id="P1S-tk-bRV"/>
+                                <constraint firstAttribute="trailing" secondItem="1WY-FC-FjB" secondAttribute="trailing" id="ozV-vz-BWd"/>
+                                <constraint firstItem="tdg-uu-noc" firstAttribute="leading" secondItem="GOc-Px-FVN" secondAttribute="leading" id="p9V-vA-xzN"/>
+                                <constraint firstItem="jDk-6k-wPg" firstAttribute="top" secondItem="GOc-Px-FVN" secondAttribute="top" id="pb9-NX-cDH"/>
+                                <constraint firstAttribute="bottom" secondItem="DNb-ku-BLc" secondAttribute="bottom" id="t2k-xH-QrP"/>
+                                <constraint firstItem="Q6A-RB-Ma1" firstAttribute="top" secondItem="jDk-6k-wPg" secondAttribute="bottom" constant="16" id="wtC-fI-v7q"/>
+                            </constraints>
+                        </view>
+                        <constraints>
+                            <constraint firstAttribute="width" constant="432" id="G1P-tA-ma2"/>
+                        </constraints>
+                    </box>
+                </subviews>
+                <constraints>
+                    <constraint firstAttribute="trailing" secondItem="J6U-4A-QXu" secondAttribute="trailing" constant="24" id="0tf-1Z-2Rg"/>
+                    <constraint firstItem="J6U-4A-QXu" firstAttribute="top" secondItem="se5-gp-TjO" secondAttribute="top" constant="16" id="n1z-oG-V7N"/>
+                    <constraint firstItem="J6U-4A-QXu" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" constant="24" id="uOi-8Q-nuw"/>
+                    <constraint firstAttribute="bottom" secondItem="J6U-4A-QXu" secondAttribute="bottom" constant="16" id="xjT-Ol-pjb"/>
+                </constraints>
+            </view>
+            <connections>
+                <outlet property="delegate" destination="-2" id="0bl-1N-AYu"/>
+            </connections>
+            <point key="canvasLocation" x="33" y="130"/>
+        </window>
+    </objects>
+</document>

+ 205 - 0
PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNThumbnailView/KMNPageEditViewController.swift

@@ -9,6 +9,11 @@ import Cocoa
 
 
 import KMComponentLibrary
 import KMComponentLibrary
 
 
+@objc protocol KMNPageEditViewViewDelegate: AnyObject {
+    @objc optional func changeBoundEditViewController(pageEditVC:KMNPageEditViewController)
+    @objc optional func changeUndoManagerEditViewController(pageEditVC:KMNPageEditViewController)
+}
+
 class KMNPageEditViewController: KMNThumbnailBaseViewController {
 class KMNPageEditViewController: KMNThumbnailBaseViewController {
 
 
      override func viewDidLoad() {
      override func viewDidLoad() {
@@ -17,6 +22,206 @@ class KMNPageEditViewController: KMNThumbnailBaseViewController {
          self.backViewBox.fillColor = ComponentLibrary.shared.getComponentColorFromKey("colorBg/layout-pdfView")
          self.backViewBox.fillColor = ComponentLibrary.shared.getComponentColorFromKey("colorBg/layout-pdfView")
     }
     }
     
     
+    public func insertFromPDFAction() {
+        if IAPProductsManager.default().isAvailableAllFunction() == false {
+            KMPurchaseCompareWindowController.sharedInstance()?.showWindow(nil)
+            return
+        }
+
+        let selectedIndexPaths = collectionView.selectionIndexPaths
+        let minimumIndexPath = selectedIndexPaths.min(by: { $0 < $1 })
+
+        let insertPDF = KMNPDFInsertPDFWindowController(self.showDocument, currentPageIndex: minimumIndexPath?.item ?? 0)
+        insertPDF.callback = { [weak self] fileAttribute, insertIdx in
+            let doc = fileAttribute.pdfDocument
+            self?.thumbnailBaseViewDelegate?.insertPDFThumbnailViewControlle?(pageEditVC: self, pdfDocment: doc)
+            var insertIndex = insertIdx
+            
+            var insertPages: [CPDFPage] = []
+            var indexpaths = Set<IndexPath>()
 
 
+            for number in fileAttribute.fetchSelectPages() {
+                if let page = doc?.page(at: UInt(number-1)) {
+                    insertPages.append(page)
+                    indexpaths.insert(IndexPath(item: insertIndex, section: 0))
+                    insertIndex += 1
+                }
+            }
+            
+            self?.insertFormPDF(insertPages: insertPages, pageDex: insertIdx)
+        }
+        insertPDF.own_beginSheetModal(for: self.view.window, completionHandler: nil)
+    }
     
     
+    public func insertFromBlankAction() {
+        if IAPProductsManager.default().isAvailableAllFunction() == false {
+            KMPurchaseCompareWindowController.sharedInstance()?.showWindow(nil)
+            return
+        }
+        
+        let selectedIndexPaths = collectionView.selectionIndexPaths
+        let minimumIndexPath = selectedIndexPaths.min(by: { $0 < $1 })
+
+        let insertPDF = KMNPDFInsertBlankWindowController(self.showDocument, currentPageIndex: minimumIndexPath?.item ?? 0)
+        insertPDF.own_beginSheetModal(for: self.view.window, completionHandler: nil)
+    }
+    
+    public func insertFromClipboardAction() {
+        if IAPProductsManager.default().isAvailableAllFunction() == false {
+            KMPurchaseCompareWindowController.sharedInstance()?.showWindow(nil)
+            return
+        }
+        let selectedIndexPaths = collectionView.selectionIndexPaths
+        let minimumIndexPath = selectedIndexPaths.min(by: { $0 < $1 })
+
+        let insertPDF = KMNPDFInsertClipboardWindowController(self.showDocument, currentPageIndex: minimumIndexPath?.item ?? 0)
+        insertPDF.own_beginSheetModal(for: self.view.window, completionHandler: nil)
+    }
+    
+    public func insertFromScannerAction() {
+        if IAPProductsManager.default().isAvailableAllFunction() == false {
+            KMPurchaseCompareWindowController.sharedInstance()?.showWindow(nil)
+            return
+        }
+        let selectedIndexPaths = collectionView.selectionIndexPaths
+        let minimumIndexPath = selectedIndexPaths.min(by: { $0 < $1 })
+
+        let insertPDF = KMNPDFInsertClipboardWindowController(self.showDocument, currentPageIndex: minimumIndexPath?.item ?? 0)
+        insertPDF.own_beginSheetModal(for: self.view.window, completionHandler: nil)
+    }
+    
+    public func canZoomInPageSize()->Bool {
+        return true
+    }
+    
+    public func canZoomOutPageSize()->Bool {
+        return true
+    }
+    
+    public func canUndo()->Bool {
+        return true
+    }
+    
+    public func undoPDFAction() {
+        
+    }
+    
+    public func redoPDFAction() {
+        
+    }
+    
+    public func canRodo()->Bool {
+        return true
+    }
+    
+    public func extractPDFAction() {
+        if IAPProductsManager.default().isAvailableAllFunction() == false {
+            KMPurchaseCompareWindowController.sharedInstance()?.showWindow(nil)
+            return
+        }
+
+        if collectionView.selectionIndexPaths.count < 1 {
+            _ = KMNCustomAlertView.alertView(message: KMLocalizedString("Please select one or more pages first to organize."), type: .info, fromView: self.view, point:CGPointMake(self.view.frame.origin.x + self.view.frame.size.width/2, self.view.bounds.size.height - 30))
+            return
+        }
+                
+        let extractPDF = KMNExtractPDFWindowController(self.showDocument, selectionIndexPaths: collectionView.selectionIndexPaths)
+        extractPDF.own_beginSheetModal(for: self.view.window, completionHandler: nil)
+        
+    }
+    
+    public func replacePDFAction() {
+        if IAPProductsManager.default().isAvailableAllFunction() == false {
+            KMPurchaseCompareWindowController.sharedInstance()?.showWindow(nil)
+            return
+        }
+        if collectionView.selectionIndexPaths.count < 1 {
+            _ = KMNCustomAlertView.alertView(message: KMLocalizedString("Please select one or more pages first to organize."), type: .info, fromView: self.view, point:CGPointMake(self.view.frame.origin.x + self.view.frame.size.width/2, self.view.bounds.size.height - 30))
+            return
+        }
+        
+    }
+    
+    public func splitPDFAction() {
+        if IAPProductsManager.default().isAvailableAllFunction() == false {
+            KMPurchaseCompareWindowController.sharedInstance()?.showWindow(nil)
+            return
+        }
+        
+        let selectedIndexPaths = collectionView.selectionIndexPaths
+        let minimumIndexPath = selectedIndexPaths.min(by: { $0 < $1 })
+
+        if collectionView.selectionIndexPaths.count < 1 {
+            _ = KMNCustomAlertView.alertView(message: KMLocalizedString("Please select one or more pages first to organize."), type: .info, fromView: self.view, point:CGPointMake(self.view.bounds.origin.x + self.view.bounds.size.width/2, self.view.bounds.size.height - 30))
+            return
+        }
+        
+        let splitPDF = KMNSplitPDFWindowController(self.showDocument,selectionIndexPaths: selectedIndexPaths)
+        splitPDF.own_beginSheetModal(for: self.view.window, completionHandler: nil)
+
+    }
+    
+    public func reversePDFAction() {
+        if IAPProductsManager.default().isAvailableAllFunction() == false {
+            KMPurchaseCompareWindowController.sharedInstance()?.showWindow(nil)
+            return
+        }
+        if collectionView.selectionIndexPaths.count < 1 {
+            _ = KMNCustomAlertView.alertView(message: KMLocalizedString("Please select one or more pages first to organize."), type: .info, fromView: self.view, point:CGPointMake(self.view.frame.origin.x + self.view.frame.size.width/2, self.view.bounds.size.height - 30))
+            return
+        }
+
+    }
+    
+    public func rotatePageLeftAction() {
+        if IAPProductsManager.default().isAvailableAllFunction() == false {
+            KMPurchaseCompareWindowController.sharedInstance()?.showWindow(nil)
+            return
+        }
+        
+        if collectionView.selectionIndexPaths.count < 1 {
+            _ = KMNCustomAlertView.alertView(message: KMLocalizedString("Please select one or more pages first to organize."), type: .info, fromView: self.view, point:CGPointMake(self.view.frame.origin.x + self.view.frame.size.width/2, self.view.bounds.size.height - 30))
+            return
+        }
+        
+    }
+    
+    public func rotatePageRightAction() {
+        if IAPProductsManager.default().isAvailableAllFunction() == false {
+            KMPurchaseCompareWindowController.sharedInstance()?.showWindow(nil)
+            return
+        }
+        
+        if collectionView.selectionIndexPaths.count < 1 {
+            _ = KMNCustomAlertView.alertView(message: KMLocalizedString("Please select one or more pages first to organize."), type: .info, fromView: self.view, point:CGPointMake(self.view.frame.origin.x + self.view.frame.size.width/2, self.view.bounds.size.height - 30))
+            return
+        }
+        
+    }
+    
+    public func deletePageAction() {
+        if IAPProductsManager.default().isAvailableAllFunction() == false {
+            KMPurchaseCompareWindowController.sharedInstance()?.showWindow(nil)
+            return
+        }
+        
+        if collectionView.selectionIndexPaths.count < 1 {
+            _ = KMNCustomAlertView.alertView(message: KMLocalizedString("Please select one or more pages first to organize."), type: .info, fromView: self.view, point:CGPointMake(self.view.frame.origin.x + self.view.frame.size.width/2, self.view.bounds.size.height - 30))
+            return
+        } else if collectionView.selectionIndexPaths.count == (showDocument?.pageCount ?? 0) {
+            _ = KMNCustomAlertView.alertView(message: KMLocalizedString("Can not delete all pages."), type: .info, fromView: self.view, point:CGPointMake(self.view.frame.origin.x + self.view.frame.size.width/2, self.view.bounds.size.height - 30))
+            return
+
+        }
+        
+    }
+    
+    public func zoomInPageAction() { //放大
+        
+    }
+    
+    public func zoomOutPageAction() { //缩小
+        
+    }
+
 }
 }

+ 70 - 10
PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNThumbnailView/KMNThumbnailBaseViewController.swift

@@ -8,7 +8,9 @@
 import Cocoa
 import Cocoa
 
 
 @objc protocol KMNThumbnailBaseViewDelegate: AnyObject {
 @objc protocol KMNThumbnailBaseViewDelegate: AnyObject {
-    @objc optional func clickThumbnailViewControlle(pageEditVC:KMNThumbnailBaseViewController?,currentIndex:Int)    
+    @objc optional func clickThumbnailViewControlle(pageEditVC:KMNThumbnailBaseViewController?,currentIndex:Int)
+    
+    @objc optional func insertPDFThumbnailViewControlle(pageEditVC:KMNThumbnailBaseViewController?,pdfDocment:CPDFDocument?)
 }
 }
 
 
 internal let kmnThumLocalForDraggedTypes = NSPasteboard.PasteboardType(rawValue: "kmnThumLocalForDraggedTypes")
 internal let kmnThumLocalForDraggedTypes = NSPasteboard.PasteboardType(rawValue: "kmnThumLocalForDraggedTypes")
@@ -26,6 +28,8 @@ class KMNThumbnailBaseViewController: NSViewController,NSCollectionViewDelegate,
     
     
     private var currentDocument:CPDFDocument?
     private var currentDocument:CPDFDocument?
     
     
+    public var currentUndoManager:UndoManager?
+    
     public var showDocument: CPDFDocument? {
     public var showDocument: CPDFDocument? {
         return currentDocument
         return currentDocument
     }
     }
@@ -146,6 +150,41 @@ class KMNThumbnailBaseViewController: NSViewController,NSCollectionViewDelegate,
         return supportFiles
         return supportFiles
     }
     }
     
     
+    private func fileNameWithSelectedPages(_ itemIndexes: IndexSet) -> String {
+        var pagesName = ""
+        if (itemIndexes.count > 1) {
+            pagesName.append(" pages")
+        } else {
+            pagesName.append(" page")
+        }
+        
+        let docmentName = currentDocument?.documentURL.deletingPathExtension().lastPathComponent ?? ""
+        let tFileName = String(format: "%@ %@", pagesName,KMNTools.parseIndexSet(indexSet: itemIndexes))
+        return String(format: "%@%@", docmentName,tFileName)
+    }
+    
+    public func insertFormPDF(insertPages: [CPDFPage],pageDex:Int) {
+        var pageIndexDex: Int = pageDex
+        var indexpaths = Set<IndexPath>()
+        for page in insertPages {
+            currentDocument?.insertPageObject(page, at: UInt(pageIndexDex))
+            indexpaths.insert(IndexPath(item: pageIndexDex, section: 0))
+            pageIndexDex += 1
+        }
+                
+        collectionView.scrollToItems(at: indexpaths, scrollPosition: .centeredVertically)
+        
+//        (currentUndoManager?.prepare(withInvocationTarget: self) as KMNThumbnailBaseViewController).deletePDFPages(indexpaths: indexpaths, scroIndex: pageDex)
+
+    }
+    
+    public func deletePDFPages(indexpaths:Set<IndexPath>,scroIndex:Int) {
+        collectionView.reloadData()
+        collectionView.scrollToItems(at: [IndexPath(item: scroIndex, section: 0)], scrollPosition: .centeredVertically)
+        
+    }
+    
+    
     // MARK: - NSCollectionViewDataSource
     // MARK: - NSCollectionViewDataSource
     func collectionView(_ collectionView: NSCollectionView, numberOfItemsInSection section: Int) -> Int {
     func collectionView(_ collectionView: NSCollectionView, numberOfItemsInSection section: Int) -> Int {
         return thumbnails.count
         return thumbnails.count
@@ -211,15 +250,8 @@ class KMNThumbnailBaseViewController: NSViewController,NSCollectionViewDelegate,
         return true
         return true
     }
     }
     
     
-    func collectionView(_ collectionView: NSCollectionView, pasteboardWriterForItemAt indexPath: IndexPath) -> NSPasteboardWriting? {
-        return String(indexPath.item) as NSPasteboardWriting
-    }
-    
-    func collectionView(_ collectionView: NSCollectionView, draggingSession session: NSDraggingSession, willBeginAt screenPoint: NSPoint, forItemsAt indexPaths: Set<IndexPath>) {
-        dragLocalityIndexPaths = indexPaths
-    }
-    
     func collectionView(_ collectionView: NSCollectionView, validateDrop draggingInfo: NSDraggingInfo, proposedIndexPath proposedDropIndexPath: AutoreleasingUnsafeMutablePointer<NSIndexPath>, dropOperation proposedDropOperation: UnsafeMutablePointer<NSCollectionView.DropOperation>) -> NSDragOperation {
     func collectionView(_ collectionView: NSCollectionView, validateDrop draggingInfo: NSDraggingInfo, proposedIndexPath proposedDropIndexPath: AutoreleasingUnsafeMutablePointer<NSIndexPath>, dropOperation proposedDropOperation: UnsafeMutablePointer<NSCollectionView.DropOperation>) -> NSDragOperation {
+
         let pboard = draggingInfo.draggingPasteboard
         let pboard = draggingInfo.draggingPasteboard
         if (pboard.availableType(from: [kmnThumLocalForDraggedTypes]) != nil) {
         if (pboard.availableType(from: [kmnThumLocalForDraggedTypes]) != nil) {
             return .move
             return .move
@@ -254,12 +286,40 @@ class KMNThumbnailBaseViewController: NSViewController,NSCollectionViewDelegate,
     
     
     func collectionView(_ collectionView: NSCollectionView, acceptDrop draggingInfo: NSDraggingInfo, indexPath: IndexPath, dropOperation: NSCollectionView.DropOperation) -> Bool {
     func collectionView(_ collectionView: NSCollectionView, acceptDrop draggingInfo: NSDraggingInfo, indexPath: IndexPath, dropOperation: NSCollectionView.DropOperation) -> Bool {
         let result = false
         let result = false
+        if !IAPProductsManager.default().isAvailableAllFunction() {
+            return result
+        }
+        let pboard = draggingInfo.draggingPasteboard
+        if (pboard.availableType(from: [kmnThumLocalForDraggedTypes]) != nil) {
+            
+        } else if (pboard.availableType(from: [.localDraggedTypes]) != nil) {
         
         
-        
+        } else if ((pboard.availableType(from: [.fileURL])) != nil) {
+         
+            guard let pbItems = pboard.pasteboardItems else {
+                return false
+            }
+            
+            //获取url
+            var array: [URL] = []
+            for item in pbItems {
+                guard let data = item.string(forType: .fileURL), let url = URL(string: data) else {
+                    continue
+                }
+                let allowedFileTypes = supportDragFileTypes()
+                let type = url.pathExtension.lowercased()
+                if (allowedFileTypes.contains(type)) {
+                    array.append(url)
+                }
+            }
+            
+        }
+
         return true
         return true
     }
     }
     
     
     func collectionView(_ collectionView: NSCollectionView, draggingSession session: NSDraggingSession, endedAt screenPoint: NSPoint, dragOperation operation: NSDragOperation) {
     func collectionView(_ collectionView: NSCollectionView, draggingSession session: NSDraggingSession, endedAt screenPoint: NSPoint, dragOperation operation: NSDragOperation) {
+        print("6")
         dragLocalityIndexPaths = []
         dragLocalityIndexPaths = []
     }
     }
 
 

+ 34 - 1
PDF Office/PDF Master/KMClass/KMPDFViewController/KMPDFViewController.swift

@@ -28,7 +28,8 @@ class KMPDFViewController: NSViewController {
     var document: CPDFDocument?
     var document: CPDFDocument?
     var myDocument: NSDocument?
     var myDocument: NSDocument?
     
     
-    
+    var insertDocuments: Set<CPDFDocument> = [] //插入新文档时,SDK会出现崩溃,临时记录
+
     //工具栏
     //工具栏
     private var pdfToolbarController: KMPDFToolbarController?
     private var pdfToolbarController: KMPDFToolbarController?
     
     
@@ -190,6 +191,32 @@ extension KMPDFViewController: KMPDFToolbarControllerDelegate {
             let model = KMDocumentModel(url: self.pdfView.document.documentURL)
             let model = KMDocumentModel(url: self.pdfView.document.documentURL)
             winC.documentModel = model
             winC.documentModel = model
             self.km_safe_beginSheet(windowC: winC)
             self.km_safe_beginSheet(windowC: winC)
+        } else if itemIdentifier == KMPDFToolbar_PageEdit_InsertFile_Identifier {
+            pageEditViewController?.insertFromPDFAction()
+        } else if itemIdentifier == KMPDFToolbar_PageEdit_InsertBlank_Identifier {
+            pageEditViewController?.insertFromBlankAction()
+        } else if itemIdentifier == KMPDFToolbar_PageEdit_InsertClip_Identifier {
+            pageEditViewController?.insertFromClipboardAction()
+        } else if itemIdentifier == KMPDFToolbar_PageEdit_InsertScanner_Identifier {
+            pageEditViewController?.insertFromScannerAction()
+        } else if itemIdentifier == KMPDFToolbar_PageEdit_Extract_Identifier {
+            pageEditViewController?.extractPDFAction()
+        } else if itemIdentifier == KMPDFToolbar_PageEdit_Replace_Identifier {
+            pageEditViewController?.replacePDFAction()
+        } else if itemIdentifier == KMPDFToolbar_PageEdit_Split_Identifier {
+            pageEditViewController?.splitPDFAction()
+        } else if itemIdentifier == KMPDFToolbar_PageEdit_Reverse_Identifier {
+            pageEditViewController?.reversePDFAction()
+        } else if itemIdentifier == KMPDFToolbar_PageEdit_LeftRotate_Identifier {
+            pageEditViewController?.rotatePageLeftAction()
+        } else if itemIdentifier == KMPDFToolbar_PageEdit_RightRotate_Identifier{
+            pageEditViewController?.rotatePageRightAction()
+        } else if itemIdentifier == KMPDFToolbar_PageEdit_Delete_Identifier {
+            pageEditViewController?.deletePageAction()
+        } else if itemIdentifier == KMPDFToolbar_PageEdit_Reduce_Identifier {
+            pageEditViewController?.zoomOutPageAction()
+        } else if itemIdentifier == KMPDFToolbar_PageEdit_Increase_Identifier {
+            pageEditViewController?.zoomInPageAction()
         }
         }
         
         
         refreshToolbarView()
         refreshToolbarView()
@@ -224,6 +251,12 @@ extension KMPDFViewController: KMNThumbnailBaseViewDelegate {
         viewManager.isPageEditMode = false
         viewManager.isPageEditMode = false
         pdfToolbarController?.reloadPageEditView()
         pdfToolbarController?.reloadPageEditView()
     }
     }
+    
+    func insertPDFThumbnailViewControlle(pageEditVC: KMNThumbnailBaseViewController?, pdfDocment: CPDFDocument?) {
+        if(pdfDocment != nil) {
+            insertDocuments.insert(pdfDocment!)
+        }
+    }
 }
 }
     
     
 
 

+ 1 - 1
PDF Office/PDF Master/KMClass/Tools/Base/KMNBaseWindowController.swift

@@ -13,7 +13,7 @@ class KMNBaseWindowController: NSWindowController {
     public var handler: ((String?) -> Void)!
     public var handler: ((String?) -> Void)!
 
 
     deinit {
     deinit {
-        KMPrint("self.className" + "deinit.")
+        KMPrint(self.className + " deinit.")
         
         
         self.removeNotification()
         self.removeNotification()
     }
     }

+ 194 - 0
PDF Office/PDF Master/KMClass/Tools/KMNFileAttribute/KMNFileAttribute.swift

@@ -0,0 +1,194 @@
+//
+//  KMFileAttribute.swift
+//  PDF Reader Pro
+//
+//  Created by tangchao on 2023/10/12.
+//
+
+import Cocoa
+
+@objc enum KMNFileAttributePageType: Int {
+    case AllPages = 0
+    case OnlyOdd
+    case OnlyEven
+    case PagesString
+}
+
+@objcMembers class KMNFileAttribute: NSObject {
+    var filePath: String = ""
+    var pdfDocument: CPDFDocument?
+    var bAllPage = false
+    private var selectPages: [Int] = []
+    var pagesString: String = ""
+    var isLocked = false
+    var password: String?
+    
+    var pagesType: KMNFileAttributePageType = .AllPages
+    
+    func fetchSelectPages() -> [Int] {
+        if let doc = self.pdfDocument, doc.isLocked {
+            doc.unlock(withPassword: self.password)
+        }
+        guard let pdfDocument = pdfDocument else { return [] }
+        selectPages.removeAll()
+
+        if pagesType == .AllPages {
+            for i in 0..<pdfDocument.pageCount {
+                selectPages.append(Int(i) + 1)
+            }
+            pagesString = "1-\(pdfDocument.pageCount)"
+        } else if pagesType == .OnlyOdd {
+            pagesString = ""
+            for i in 0..<pdfDocument.pageCount where i % 2 == 0 {
+                selectPages.append(Int(i) + 1)
+                if pagesString == "" {
+                    pagesString = "\(i + 1)"
+                } else {
+                    pagesString = "\(pagesString),\(i + 1)"
+                }
+            }
+        } else if pagesType == .OnlyEven {
+            pagesString = ""
+            for i in 0..<pdfDocument.pageCount where i % 2 != 0 {
+                selectPages.append(Int(i) + 1)
+                if pagesString == "" {
+                    pagesString = "\(i + 1)"
+                } else {
+                    pagesString = "\(pagesString),\(i + 1)"
+                }
+            }
+        } else {
+            isInvalidString(pagesString)
+            if !bAllPage {
+                self.quickSort(&selectPages, startIndex: 0, endIndex: selectPages.count-1)
+            }
+        }
+        
+        return selectPages
+    }
+    
+    func isInvalidString(_ text: String) -> Bool {
+        var document: CPDFDocument?
+        if (pdfDocument != nil) {
+            document = pdfDocument
+        } else {
+            document = CPDFDocument(url:URL(fileURLWithPath: self.filePath ))
+        }
+        
+        if let data = document?.isLocked, data {
+            document?.unlock(withPassword: self.password )
+        }
+        var pageNumber = document?.pageCount ?? 0
+        
+        if (self.bAllPage) {
+            self.selectPages = []
+            for i in 1 ... pageNumber {
+                self.selectPages.append(Int(i))
+            }
+            return false
+        }
+        
+        var pageNumbers: [Int] = []
+        var isInvalid = false
+        for c in text {
+            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) {
+            let array = text.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.first!
+                        if p.isEmpty || Int(p)! > pageNumber || Int(p) == 0 {
+                            isInvalid = true
+                            break
+                        }else{
+                            var isEqual = false
+                            for pageNumber in pageNumbers {
+                                if pageNumber == Int(p) {
+                                    isEqual = true
+                                    isInvalid = true
+                                    break
+                                }
+                            }
+                            if (!isEqual) {
+                                pageNumbers.append(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 == i {
+                                        isEqual = true
+                                        isInvalid = true
+                                        break
+                                    }
+                                }
+                            }
+                            if (!isEqual) {
+                                for i in Int(p1)! ... Int(p2)! {
+                                    pageNumbers.append(i)
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        if (text.isEmpty) {
+            isInvalid = true
+        }
+        if (isInvalid) {
+            self.selectPages = []
+        }else{
+            self.selectPages = pageNumbers
+        }
+        return isInvalid
+    }
+    
+    func quickSort(_ list: inout [Int],startIndex: Int, endIndex: Int) {
+        if(startIndex >= endIndex) {
+            return
+        }
+        
+        let temp = list[startIndex]
+        var tempIndex = startIndex
+        
+        for i in startIndex+1 ... endIndex {
+            let t = list[i]
+            if (temp > t) {
+                tempIndex = tempIndex + 1
+                
+                let tmp = list[tempIndex]
+                list[tempIndex] = list[i]
+                list[i] = tmp
+            }
+        }
+        
+        let tmp = list[tempIndex]
+        list[tempIndex] = list[startIndex]
+        list[startIndex] = tmp
+        
+        quickSort(&list, startIndex: startIndex, endIndex: tempIndex-1)
+        quickSort(&list, startIndex: tempIndex+1, endIndex: endIndex)
+    }
+}

+ 128 - 0
PDF Office/PDF Master/KMClass/Tools/Tool/KMNPageSizeTool.swift

@@ -0,0 +1,128 @@
+//
+//  KMPageSizeTool.swift
+//  PDF Reader Pro
+//
+//  Created by tangchao on 2023/9/26.
+//
+
+import Cocoa
+let KMNPaperSizeNameA3: String = KMLocalizedString("A3")
+let KMNPaperSizeNameA4: String = KMLocalizedString("A4")
+let KMNPaperSizeNameA5: String = KMLocalizedString("A5")
+let KMNPaperSizeNameB5: String = KMLocalizedString("B5")
+let KMNPaperSizeNameEnvelope10: String = KMLocalizedString("Envelope #10")
+let KMNPaperSizeNameEnvelopeChoukei: String = KMLocalizedString("Envelope Choukei 3")
+let KMNPaperSizeNameEnvelopeDL: String = KMLocalizedString("Envelope DL")
+let KMNPaperSizeNameJISB5: String = KMLocalizedString("JIS B5")
+let KMNPaperSizeNameROC16K: String = KMLocalizedString("ROC 16K")
+let KMNPaperSizeNameSuper: String = KMLocalizedString("Super B/A3")
+let KMNPaperSizeNameTabloid: String = KMLocalizedString("Tabloid")
+let KMNPaperSizeNameTabloidOversize: String = KMLocalizedString("Tabloid Oversize")
+let KMNPaperSizeNameUSLegal: String = KMLocalizedString("US Legal")
+let KMNPaperSizeNameUSLetter: String = KMLocalizedString("US Letter")
+
+@objcMembers class KMNPageSizeTool: NSObject {
+    
+    static func paperSize() -> [String] {
+        return [KMNPaperSizeNameA3,
+                KMNPaperSizeNameA4,
+                KMNPaperSizeNameA5,
+                KMNPaperSizeNameB5,
+                KMNPaperSizeNameEnvelope10,
+                KMNPaperSizeNameEnvelopeChoukei,
+                KMNPaperSizeNameEnvelopeDL,
+                KMNPaperSizeNameJISB5,
+                KMNPaperSizeNameROC16K,
+                KMNPaperSizeNameSuper,
+                KMNPaperSizeNameTabloid,
+                KMNPaperSizeNameTabloidOversize,
+                KMNPaperSizeNameUSLegal,
+                KMNPaperSizeNameUSLetter]
+    }
+    
+    static func getPaperSize(paperName: String) -> NSSize {
+        var size: NSSize = .zero
+        if (paperName == KMNPaperSizeNameA3) {
+            size = NSMakeSize(297, 420)
+        } else if (paperName == KMNPaperSizeNameA4){
+            size = NSMakeSize(210, 297)
+        } else if (paperName == KMNPaperSizeNameA5){
+            size = NSMakeSize(148, 210)
+        } else if (paperName == KMNPaperSizeNameB5){
+            size = NSMakeSize(176, 250)
+        } else if (paperName == KMNPaperSizeNameEnvelope10){
+            size = NSMakeSize(105, 241)
+        } else if (paperName == KMNPaperSizeNameEnvelopeChoukei){
+            size = NSMakeSize(120, 235)
+        } else if (paperName == KMNPaperSizeNameEnvelopeDL){
+            size = NSMakeSize(110, 220)
+        } else if (paperName == KMNPaperSizeNameJISB5){
+            size = NSMakeSize(182, 257)
+        } else if (paperName == KMNPaperSizeNameROC16K){
+            size = NSMakeSize(197, 273)
+        } else if (paperName == KMNPaperSizeNameSuper){
+            size = NSMakeSize(330, 483)
+        } else if (paperName == KMNPaperSizeNameTabloid){
+            size = NSMakeSize(279, 432)
+        } else if (paperName == KMNPaperSizeNameTabloidOversize){
+            size = NSMakeSize(305, 457)
+        } else if (paperName == KMNPaperSizeNameUSLegal){
+            size = NSMakeSize(216, 356)
+        } else if (paperName == KMNPaperSizeNameUSLetter){
+            size = NSMakeSize(216, 279)
+        }
+        return size
+    }
+    
+    static func conversion(withUnit: String, value: CGFloat) -> String {
+        var f = value
+        if (withUnit == "cm") {
+            f = value / 10.0
+        } else if (withUnit == "in") {
+            f = value / 25.4
+        } else {
+            f = value
+        }
+        
+        if (fmod(f, 1) == 0) { //如果有一位小数点
+            return String(format: "%.0f", f)
+        } else if (fmod(value * 10, 1) == 0) { //如果有两位小数点
+            return String(format: "%.1f", f)
+        } else {
+            return String(format: "%.2f", f)
+        }
+    }
+    
+    static func conversion(with unit: String, from funit: String, value: CGFloat) -> String {
+        var f = value
+        if (unit == funit) {
+            
+        } else if(unit == "cm") {
+            if(funit == "mm") {
+                f =  value/10.0
+            } else if(funit == "in") {
+                f = value * 25.4
+            }
+        } else if(unit == "mm") {
+            if(funit == "cm") {
+                f =  value * 10.0
+            } else if(funit == "in") {
+                f = value * 10 * 25.4
+            }
+        } else if(unit == "in") {
+            if(funit == "cm") {
+                f = value/25.4
+            } else if(funit == "mm") {
+                f = value/10.0
+                f = value/25.4
+            }
+        }
+        if (fmod(f, 1) == 0) { //如果有一位小数点
+            return String(format: "%.0f", f)
+        } else if (fmod(value * 10, 1) == 0) { //如果有两位小数点
+            return String(format: "%.1f", f)
+        } else {
+            return String(format: "%.2f", f)
+        }
+    }
+}

+ 8 - 0
PDF Office/PDF Master/KMClass/Tools/Tool/KMNTools.swift

@@ -8,6 +8,14 @@
 import Cocoa
 import Cocoa
 
 
 class KMNTools: NSObject {
 class KMNTools: NSObject {
+    
+    @objc class func parseIndexPathsSet(indexSets: Set<IndexPath>) -> String {
+        var indexSet = IndexSet()
+        for indeIndexPath in indexSets {
+            indexSet.insert(indeIndexPath.item)
+        }
+        return self.parseIndexs(indexs: indexSet.sorted())
+    }
 
 
     @objc class func parseIndexSet(indexSet: IndexSet) -> String {
     @objc class func parseIndexSet(indexSet: IndexSet) -> String {
         return self.parseIndexs(indexs: indexSet.sorted())
         return self.parseIndexs(indexs: indexSet.sorted())

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

@@ -5655,6 +5655,9 @@
 		F34BF93529530708002C25A2 /* NSImage+PDFListView.m in Sources */ = {isa = PBXBuildFile; fileRef = F34BF93429530708002C25A2 /* NSImage+PDFListView.m */; };
 		F34BF93529530708002C25A2 /* NSImage+PDFListView.m in Sources */ = {isa = PBXBuildFile; fileRef = F34BF93429530708002C25A2 /* NSImage+PDFListView.m */; };
 		F34BF93629530708002C25A2 /* NSImage+PDFListView.m in Sources */ = {isa = PBXBuildFile; fileRef = F34BF93429530708002C25A2 /* NSImage+PDFListView.m */; };
 		F34BF93629530708002C25A2 /* NSImage+PDFListView.m in Sources */ = {isa = PBXBuildFile; fileRef = F34BF93429530708002C25A2 /* NSImage+PDFListView.m */; };
 		F34BF93729530708002C25A2 /* NSImage+PDFListView.m in Sources */ = {isa = PBXBuildFile; fileRef = F34BF93429530708002C25A2 /* NSImage+PDFListView.m */; };
 		F34BF93729530708002C25A2 /* NSImage+PDFListView.m in Sources */ = {isa = PBXBuildFile; fileRef = F34BF93429530708002C25A2 /* NSImage+PDFListView.m */; };
+		F352428E2CCB768B0000A901 /* KMNFileAttribute.swift in Sources */ = {isa = PBXBuildFile; fileRef = F352428C2CCB768B0000A901 /* KMNFileAttribute.swift */; };
+		F352428F2CCB768B0000A901 /* KMNFileAttribute.swift in Sources */ = {isa = PBXBuildFile; fileRef = F352428C2CCB768B0000A901 /* KMNFileAttribute.swift */; };
+		F35242902CCB768B0000A901 /* KMNFileAttribute.swift in Sources */ = {isa = PBXBuildFile; fileRef = F352428C2CCB768B0000A901 /* KMNFileAttribute.swift */; };
 		F356720829AF184A00740FF3 /* CPDFListAnnotationNoteWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F356720429AF184A00740FF3 /* CPDFListAnnotationNoteWindowController.xib */; };
 		F356720829AF184A00740FF3 /* CPDFListAnnotationNoteWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F356720429AF184A00740FF3 /* CPDFListAnnotationNoteWindowController.xib */; };
 		F356720929AF184A00740FF3 /* CPDFListAnnotationNoteWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F356720429AF184A00740FF3 /* CPDFListAnnotationNoteWindowController.xib */; };
 		F356720929AF184A00740FF3 /* CPDFListAnnotationNoteWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F356720429AF184A00740FF3 /* CPDFListAnnotationNoteWindowController.xib */; };
 		F356720A29AF184A00740FF3 /* CPDFListAnnotationNoteWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F356720429AF184A00740FF3 /* CPDFListAnnotationNoteWindowController.xib */; };
 		F356720A29AF184A00740FF3 /* CPDFListAnnotationNoteWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F356720429AF184A00740FF3 /* CPDFListAnnotationNoteWindowController.xib */; };
@@ -5737,6 +5740,21 @@
 		F3DB85F22CCA209600D0AFDE /* KMNBaseWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3DB85EB2CCA209600D0AFDE /* KMNBaseWindowController.swift */; };
 		F3DB85F22CCA209600D0AFDE /* KMNBaseWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3DB85EB2CCA209600D0AFDE /* KMNBaseWindowController.swift */; };
 		F3DB85F32CCA209600D0AFDE /* KMNBaseWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3DB85EB2CCA209600D0AFDE /* KMNBaseWindowController.swift */; };
 		F3DB85F32CCA209600D0AFDE /* KMNBaseWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3DB85EB2CCA209600D0AFDE /* KMNBaseWindowController.swift */; };
 		F3DB85F42CCA209600D0AFDE /* KMNBaseWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3DB85EB2CCA209600D0AFDE /* KMNBaseWindowController.swift */; };
 		F3DB85F42CCA209600D0AFDE /* KMNBaseWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3DB85EB2CCA209600D0AFDE /* KMNBaseWindowController.swift */; };
+		F3DB85F62CCA36F400D0AFDE /* KMNPageSizeTool.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3DB85F52CCA36F400D0AFDE /* KMNPageSizeTool.swift */; };
+		F3DB85F72CCA36F400D0AFDE /* KMNPageSizeTool.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3DB85F52CCA36F400D0AFDE /* KMNPageSizeTool.swift */; };
+		F3DB85F82CCA36F400D0AFDE /* KMNPageSizeTool.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3DB85F52CCA36F400D0AFDE /* KMNPageSizeTool.swift */; };
+		F3DB86062CCA691B00D0AFDE /* KMNExtractPDFWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3DB86032CCA691A00D0AFDE /* KMNExtractPDFWindowController.swift */; };
+		F3DB86072CCA691B00D0AFDE /* KMNExtractPDFWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3DB86032CCA691A00D0AFDE /* KMNExtractPDFWindowController.swift */; };
+		F3DB86082CCA691B00D0AFDE /* KMNExtractPDFWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3DB86032CCA691A00D0AFDE /* KMNExtractPDFWindowController.swift */; };
+		F3DB86092CCA691B00D0AFDE /* KMNExtractPDFWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F3DB86042CCA691A00D0AFDE /* KMNExtractPDFWindowController.xib */; };
+		F3DB860A2CCA691B00D0AFDE /* KMNExtractPDFWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F3DB86042CCA691A00D0AFDE /* KMNExtractPDFWindowController.xib */; };
+		F3DB860B2CCA691B00D0AFDE /* KMNExtractPDFWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F3DB86042CCA691A00D0AFDE /* KMNExtractPDFWindowController.xib */; };
+		F3DB860E2CCA693C00D0AFDE /* KMNSplitPDFWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3DB860C2CCA693C00D0AFDE /* KMNSplitPDFWindowController.swift */; };
+		F3DB860F2CCA693C00D0AFDE /* KMNSplitPDFWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3DB860C2CCA693C00D0AFDE /* KMNSplitPDFWindowController.swift */; };
+		F3DB86102CCA693C00D0AFDE /* KMNSplitPDFWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3DB860C2CCA693C00D0AFDE /* KMNSplitPDFWindowController.swift */; };
+		F3DB86112CCA693C00D0AFDE /* KMNSplitPDFWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F3DB860D2CCA693C00D0AFDE /* KMNSplitPDFWindowController.xib */; };
+		F3DB86122CCA693C00D0AFDE /* KMNSplitPDFWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F3DB860D2CCA693C00D0AFDE /* KMNSplitPDFWindowController.xib */; };
+		F3DB86132CCA693C00D0AFDE /* KMNSplitPDFWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F3DB860D2CCA693C00D0AFDE /* KMNSplitPDFWindowController.xib */; };
 		F3F0B27329B8ACD000722957 /* CPDFListViewDragObject.m in Sources */ = {isa = PBXBuildFile; fileRef = F3F0B27229B8ACD000722957 /* CPDFListViewDragObject.m */; };
 		F3F0B27329B8ACD000722957 /* CPDFListViewDragObject.m in Sources */ = {isa = PBXBuildFile; fileRef = F3F0B27229B8ACD000722957 /* CPDFListViewDragObject.m */; };
 		F3F0B27429B8ACD000722957 /* CPDFListViewDragObject.m in Sources */ = {isa = PBXBuildFile; fileRef = F3F0B27229B8ACD000722957 /* CPDFListViewDragObject.m */; };
 		F3F0B27429B8ACD000722957 /* CPDFListViewDragObject.m in Sources */ = {isa = PBXBuildFile; fileRef = F3F0B27229B8ACD000722957 /* CPDFListViewDragObject.m */; };
 		F3F0B27529B8ACD000722957 /* CPDFListViewDragObject.m in Sources */ = {isa = PBXBuildFile; fileRef = F3F0B27229B8ACD000722957 /* CPDFListViewDragObject.m */; };
 		F3F0B27529B8ACD000722957 /* CPDFListViewDragObject.m in Sources */ = {isa = PBXBuildFile; fileRef = F3F0B27229B8ACD000722957 /* CPDFListViewDragObject.m */; };
@@ -8138,6 +8156,7 @@
 		F34BF925295303E8002C25A2 /* NSCursor+PDFListView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSCursor+PDFListView.m"; sourceTree = "<group>"; };
 		F34BF925295303E8002C25A2 /* NSCursor+PDFListView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSCursor+PDFListView.m"; sourceTree = "<group>"; };
 		F34BF93329530708002C25A2 /* NSImage+PDFListView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSImage+PDFListView.h"; sourceTree = "<group>"; };
 		F34BF93329530708002C25A2 /* NSImage+PDFListView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSImage+PDFListView.h"; sourceTree = "<group>"; };
 		F34BF93429530708002C25A2 /* NSImage+PDFListView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSImage+PDFListView.m"; sourceTree = "<group>"; };
 		F34BF93429530708002C25A2 /* NSImage+PDFListView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSImage+PDFListView.m"; sourceTree = "<group>"; };
+		F352428C2CCB768B0000A901 /* KMNFileAttribute.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KMNFileAttribute.swift; sourceTree = "<group>"; };
 		F356720429AF184A00740FF3 /* CPDFListAnnotationNoteWindowController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CPDFListAnnotationNoteWindowController.xib; sourceTree = "<group>"; };
 		F356720429AF184A00740FF3 /* CPDFListAnnotationNoteWindowController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CPDFListAnnotationNoteWindowController.xib; sourceTree = "<group>"; };
 		F359916729261F0D000D25DE /* CPDFListView+Tool.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CPDFListView+Tool.h"; sourceTree = "<group>"; };
 		F359916729261F0D000D25DE /* CPDFListView+Tool.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CPDFListView+Tool.h"; sourceTree = "<group>"; };
 		F359916829261F0D000D25DE /* CPDFListView+Tool.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "CPDFListView+Tool.m"; sourceTree = "<group>"; wrapsLines = 0; };
 		F359916829261F0D000D25DE /* CPDFListView+Tool.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "CPDFListView+Tool.m"; sourceTree = "<group>"; wrapsLines = 0; };
@@ -8177,6 +8196,11 @@
 		F3DB85E32CCA1C4100D0AFDE /* ComponentGroupItem.nib */ = {isa = PBXFileReference; lastKnownFileType = file; path = ComponentGroupItem.nib; sourceTree = "<group>"; };
 		F3DB85E32CCA1C4100D0AFDE /* ComponentGroupItem.nib */ = {isa = PBXFileReference; lastKnownFileType = file; path = ComponentGroupItem.nib; sourceTree = "<group>"; };
 		F3DB85E92CCA209600D0AFDE /* KMNBaseViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KMNBaseViewController.swift; sourceTree = "<group>"; };
 		F3DB85E92CCA209600D0AFDE /* KMNBaseViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KMNBaseViewController.swift; sourceTree = "<group>"; };
 		F3DB85EB2CCA209600D0AFDE /* KMNBaseWindowController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KMNBaseWindowController.swift; sourceTree = "<group>"; };
 		F3DB85EB2CCA209600D0AFDE /* KMNBaseWindowController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KMNBaseWindowController.swift; sourceTree = "<group>"; };
+		F3DB85F52CCA36F400D0AFDE /* KMNPageSizeTool.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KMNPageSizeTool.swift; sourceTree = "<group>"; };
+		F3DB86032CCA691A00D0AFDE /* KMNExtractPDFWindowController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KMNExtractPDFWindowController.swift; sourceTree = "<group>"; };
+		F3DB86042CCA691A00D0AFDE /* KMNExtractPDFWindowController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = KMNExtractPDFWindowController.xib; sourceTree = "<group>"; };
+		F3DB860C2CCA693C00D0AFDE /* KMNSplitPDFWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMNSplitPDFWindowController.swift; sourceTree = "<group>"; };
+		F3DB860D2CCA693C00D0AFDE /* KMNSplitPDFWindowController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMNSplitPDFWindowController.xib; sourceTree = "<group>"; };
 		F3F0B27129B8ACD000722957 /* CPDFListViewDragObject.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFListViewDragObject.h; sourceTree = "<group>"; };
 		F3F0B27129B8ACD000722957 /* CPDFListViewDragObject.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFListViewDragObject.h; sourceTree = "<group>"; };
 		F3F0B27229B8ACD000722957 /* CPDFListViewDragObject.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFListViewDragObject.m; sourceTree = "<group>"; };
 		F3F0B27229B8ACD000722957 /* CPDFListViewDragObject.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFListViewDragObject.m; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 /* End PBXFileReference section */
@@ -15089,6 +15113,14 @@
 			path = Signature;
 			path = Signature;
 			sourceTree = "<group>";
 			sourceTree = "<group>";
 		};
 		};
+		F352428B2CCB768B0000A901 /* KMNFileAttribute */ = {
+			isa = PBXGroup;
+			children = (
+				F352428C2CCB768B0000A901 /* KMNFileAttribute.swift */,
+			);
+			path = KMNFileAttribute;
+			sourceTree = "<group>";
+		};
 		F3599215292CA27A000D25DE /* AppKitCategories */ = {
 		F3599215292CA27A000D25DE /* AppKitCategories */ = {
 			isa = PBXGroup;
 			isa = PBXGroup;
 			children = (
 			children = (
@@ -15206,6 +15238,8 @@
 		F39603E42CC62E55003C6F71 /* KMNPDFPageEdit */ = {
 		F39603E42CC62E55003C6F71 /* KMNPDFPageEdit */ = {
 			isa = PBXGroup;
 			isa = PBXGroup;
 			children = (
 			children = (
+				F3DB86022CCA691A00D0AFDE /* KMNPDFExtract */,
+				F3DB86052CCA691B00D0AFDE /* KMNPDFSplit */,
 				F337CC422CC7EDD000D46AF4 /* KMNPDFInsert */,
 				F337CC422CC7EDD000D46AF4 /* KMNPDFInsert */,
 				F39603E62CC641D2003C6F71 /* KMNThumbnailManager.swift */,
 				F39603E62CC641D2003C6F71 /* KMNThumbnailManager.swift */,
 				F39603EA2CC64374003C6F71 /* KMNThumbnailView */,
 				F39603EA2CC64374003C6F71 /* KMNThumbnailView */,
@@ -15229,6 +15263,7 @@
 		F3A0F8522CC8F56400E7373F /* Tool */ = {
 		F3A0F8522CC8F56400E7373F /* Tool */ = {
 			isa = PBXGroup;
 			isa = PBXGroup;
 			children = (
 			children = (
+				F3DB85F52CCA36F400D0AFDE /* KMNPageSizeTool.swift */,
 				F3A0F8532CC8F59400E7373F /* KMNConvertTool.swift */,
 				F3A0F8532CC8F59400E7373F /* KMNConvertTool.swift */,
 				F3A0F86C2CCA118D00E7373F /* KMNTools.swift */,
 				F3A0F86C2CCA118D00E7373F /* KMNTools.swift */,
 			);
 			);
@@ -15247,6 +15282,7 @@
 			isa = PBXGroup;
 			isa = PBXGroup;
 			children = (
 			children = (
 				650FF6732CC896D90019FAE1 /* PDFPreview */,
 				650FF6732CC896D90019FAE1 /* PDFPreview */,
+				F352428B2CCB768B0000A901 /* KMNFileAttribute */,
 				F3DB85E82CCA209600D0AFDE /* Base */,
 				F3DB85E82CCA209600D0AFDE /* Base */,
 				BB4583C42CC91531005737F3 /* NSImage+Extension */,
 				BB4583C42CC91531005737F3 /* NSImage+Extension */,
 				F3A0F8522CC8F56400E7373F /* Tool */,
 				F3A0F8522CC8F56400E7373F /* Tool */,
@@ -15273,6 +15309,24 @@
 			path = Base;
 			path = Base;
 			sourceTree = "<group>";
 			sourceTree = "<group>";
 		};
 		};
+		F3DB86022CCA691A00D0AFDE /* KMNPDFExtract */ = {
+			isa = PBXGroup;
+			children = (
+				F3DB86032CCA691A00D0AFDE /* KMNExtractPDFWindowController.swift */,
+				F3DB86042CCA691A00D0AFDE /* KMNExtractPDFWindowController.xib */,
+			);
+			path = KMNPDFExtract;
+			sourceTree = "<group>";
+		};
+		F3DB86052CCA691B00D0AFDE /* KMNPDFSplit */ = {
+			isa = PBXGroup;
+			children = (
+				F3DB860C2CCA693C00D0AFDE /* KMNSplitPDFWindowController.swift */,
+				F3DB860D2CCA693C00D0AFDE /* KMNSplitPDFWindowController.xib */,
+			);
+			path = KMNPDFSplit;
+			sourceTree = "<group>";
+		};
 /* End PBXGroup section */
 /* End PBXGroup section */
 
 
 /* Begin PBXNativeTarget section */
 /* Begin PBXNativeTarget section */
@@ -15756,6 +15810,7 @@
 				8997011928F40898009AF911 /* KMThumbnailViewController.xib in Resources */,
 				8997011928F40898009AF911 /* KMThumbnailViewController.xib in Resources */,
 				BB031B782C47BB090099F7AD /* KMUserListItemView.xib in Resources */,
 				BB031B782C47BB090099F7AD /* KMUserListItemView.xib in Resources */,
 				BBAFC83F2985194800D0648E /* KMPDFEditAppendWindow.xib in Resources */,
 				BBAFC83F2985194800D0648E /* KMPDFEditAppendWindow.xib in Resources */,
+				F3DB86112CCA693C00D0AFDE /* KMNSplitPDFWindowController.xib in Resources */,
 				9FE0BBE72B0EFBA300CD1CAC /* KMAnnotationFontWindowController.xib in Resources */,
 				9FE0BBE72B0EFBA300CD1CAC /* KMAnnotationFontWindowController.xib in Resources */,
 				BB4F7E852B0C4E820077EC8C /* KMNoteFilterCollevtionViewItem.xib in Resources */,
 				BB4F7E852B0C4E820077EC8C /* KMNoteFilterCollevtionViewItem.xib in Resources */,
 				ADDF83502B391A5C00A81A4E /* CDSignatureCertificateCustomViewController.xib in Resources */,
 				ADDF83502B391A5C00A81A4E /* CDSignatureCertificateCustomViewController.xib in Resources */,
@@ -16007,6 +16062,7 @@
 				F35BC6C92CA3AD710022CDE9 /* Texture.bundle in Resources */,
 				F35BC6C92CA3AD710022CDE9 /* Texture.bundle in Resources */,
 				ADD56F5A2BB3F48300E87ED9 /* KMFreeTextStylesViewController.xib in Resources */,
 				ADD56F5A2BB3F48300E87ED9 /* KMFreeTextStylesViewController.xib in Resources */,
 				9F0CB49229683DEE00007028 /* KMPropertiesPanelLineSubVC.xib in Resources */,
 				9F0CB49229683DEE00007028 /* KMPropertiesPanelLineSubVC.xib in Resources */,
+				F3DB86092CCA691B00D0AFDE /* KMNExtractPDFWindowController.xib in Resources */,
 				9FF371F42C69E1B2005F9CC5 /* Localizable.strings in Resources */,
 				9FF371F42C69E1B2005F9CC5 /* Localizable.strings in Resources */,
 				BBE9D09B2AF0CEEB002E83CE /* KMBatchOperateCompressViewController.xib in Resources */,
 				BBE9D09B2AF0CEEB002E83CE /* KMBatchOperateCompressViewController.xib in Resources */,
 				BB88108E2B4F7C4100AFA63E /* KMVerificationExpiredViewController.xib in Resources */,
 				BB88108E2B4F7C4100AFA63E /* KMVerificationExpiredViewController.xib in Resources */,
@@ -16359,6 +16415,7 @@
 				BB4BD9D02909026500A66A65 /* KMRightSideViewController.xib in Resources */,
 				BB4BD9D02909026500A66A65 /* KMRightSideViewController.xib in Resources */,
 				AD7D5C962B8F20FE006562CD /* synctex_parser_version.txt in Resources */,
 				AD7D5C962B8F20FE006562CD /* synctex_parser_version.txt in Resources */,
 				ADB2D6F3294741720029D2B3 /* KMPrintPaperSetView.xib in Resources */,
 				ADB2D6F3294741720029D2B3 /* KMPrintPaperSetView.xib in Resources */,
+				F3DB86122CCA693C00D0AFDE /* KMNSplitPDFWindowController.xib in Resources */,
 				BB7F7C0129AA586900A3E4E7 /* signAdd.png in Resources */,
 				BB7F7C0129AA586900A3E4E7 /* signAdd.png in Resources */,
 				BB6DD81029347F77001F0544 /* KMSecureEncryptWindowController.xib in Resources */,
 				BB6DD81029347F77001F0544 /* KMSecureEncryptWindowController.xib in Resources */,
 				ADBC2D16299CCD10006280C8 /* KMTextfieldButton.xib in Resources */,
 				ADBC2D16299CCD10006280C8 /* KMTextfieldButton.xib in Resources */,
@@ -16613,6 +16670,7 @@
 				9FDD0FBB295D5230000C4DAD /* KMToolbarController.xib in Resources */,
 				9FDD0FBB295D5230000C4DAD /* KMToolbarController.xib in Resources */,
 				9F1FE4E829406E4700E952CA /* COPYING in Resources */,
 				9F1FE4E829406E4700E952CA /* COPYING in Resources */,
 				AD62606F2A9D968B006C6413 /* KMEditPDFAssets.xcassets in Resources */,
 				AD62606F2A9D968B006C6413 /* KMEditPDFAssets.xcassets in Resources */,
+				F3DB860A2CCA691B00D0AFDE /* KMNExtractPDFWindowController.xib in Resources */,
 				9F3D818B29A0A9A70087B5AD /* KMDesignButton.xib in Resources */,
 				9F3D818B29A0A9A70087B5AD /* KMDesignButton.xib in Resources */,
 				F35BC6CA2CA3AD710022CDE9 /* Texture.bundle in Resources */,
 				F35BC6CA2CA3AD710022CDE9 /* Texture.bundle in Resources */,
 				9F1F82E72934D5240092C4B4 /* KMHomeExtractActionViewController.xib in Resources */,
 				9F1F82E72934D5240092C4B4 /* KMHomeExtractActionViewController.xib in Resources */,
@@ -17117,6 +17175,7 @@
 				BB1BFF772AEA0B38003EB179 /* KMBatchOperateLeftViewController.xib in Resources */,
 				BB1BFF772AEA0B38003EB179 /* KMBatchOperateLeftViewController.xib in Resources */,
 				BB04FD122B206F4000D80F7B /* KMPlanViewController.xib in Resources */,
 				BB04FD122B206F4000D80F7B /* KMPlanViewController.xib in Resources */,
 				AD199DE32B200FB000D56FEE /* KMPrintPosterView.xib in Resources */,
 				AD199DE32B200FB000D56FEE /* KMPrintPosterView.xib in Resources */,
+				F3DB860B2CCA691B00D0AFDE /* KMNExtractPDFWindowController.xib in Resources */,
 				9F8539DC294318D600DF644E /* TabsImage.xcassets in Resources */,
 				9F8539DC294318D600DF644E /* TabsImage.xcassets in Resources */,
 				BBE66D0B2B55467C009343FA /* repeatTrialAlert_icon.png in Resources */,
 				BBE66D0B2B55467C009343FA /* repeatTrialAlert_icon.png in Resources */,
 				AD5374972C65A426002DE248 /* default.metallib in Resources */,
 				AD5374972C65A426002DE248 /* default.metallib in Resources */,
@@ -17247,6 +17306,7 @@
 				BBE788A72CBD2463008086E2 /* SliderVC.xib in Resources */,
 				BBE788A72CBD2463008086E2 /* SliderVC.xib in Resources */,
 				ADCFFC0829C04617007D3657 /* BOTA.xcassets in Resources */,
 				ADCFFC0829C04617007D3657 /* BOTA.xcassets in Resources */,
 				ADBC2D00299CA6C7006280C8 /* KMPrintDuplexPrintingSetView.xib in Resources */,
 				ADBC2D00299CA6C7006280C8 /* KMPrintDuplexPrintingSetView.xib in Resources */,
+				F3DB86132CCA693C00D0AFDE /* KMNSplitPDFWindowController.xib in Resources */,
 				ADFCEB4A2B4FBA440001EBAF /* RemoteConfigDefaults.plist in Resources */,
 				ADFCEB4A2B4FBA440001EBAF /* RemoteConfigDefaults.plist in Resources */,
 				F337CC412CC78B9400D46AF4 /* KMNThumbnailImage.xcassets in Resources */,
 				F337CC412CC78B9400D46AF4 /* KMNThumbnailImage.xcassets in Resources */,
 				ADFA8F0F2B579957002595A4 /* KMSearchFindView.xib in Resources */,
 				ADFA8F0F2B579957002595A4 /* KMSearchFindView.xib in Resources */,
@@ -17940,6 +18000,7 @@
 				BB981E552AD4F638001988CA /* KMPageIndicator.swift in Sources */,
 				BB981E552AD4F638001988CA /* KMPageIndicator.swift in Sources */,
 				AD0E8AB42A31B78900DBFD3C /* KMDMGPurchaseManager.swift in Sources */,
 				AD0E8AB42A31B78900DBFD3C /* KMDMGPurchaseManager.swift in Sources */,
 				9FDD0FB229534FEA000C4DAD /* KMGlobal.swift in Sources */,
 				9FDD0FB229534FEA000C4DAD /* KMGlobal.swift in Sources */,
+				F352428E2CCB768B0000A901 /* KMNFileAttribute.swift in Sources */,
 				9F1FE49329406E4700E952CA /* common.m in Sources */,
 				9F1FE49329406E4700E952CA /* common.m in Sources */,
 				BBE788FC2CBD2464008086E2 /* ButtonDemoVC.swift in Sources */,
 				BBE788FC2CBD2464008086E2 /* ButtonDemoVC.swift in Sources */,
 				9FF371C92C69A9E2005F9CC5 /* CPDFPolylineAnnotation+PDFListView.swift in Sources */,
 				9FF371C92C69A9E2005F9CC5 /* CPDFPolylineAnnotation+PDFListView.swift in Sources */,
@@ -18065,6 +18126,7 @@
 				ADE8BC2529F7CCA600570F89 /* KMPageNumberDisplayView.swift in Sources */,
 				ADE8BC2529F7CCA600570F89 /* KMPageNumberDisplayView.swift in Sources */,
 				BB6347AE2AF1F0A500F5438E /* KMBatchOperateConvertViewController.swift in Sources */,
 				BB6347AE2AF1F0A500F5438E /* KMBatchOperateConvertViewController.swift in Sources */,
 				BB4F7E812B0C4E140077EC8C /* KMNoteFilterCollevtionViewItem.swift in Sources */,
 				BB4F7E812B0C4E140077EC8C /* KMNoteFilterCollevtionViewItem.swift in Sources */,
+				F3DB860E2CCA693C00D0AFDE /* KMNSplitPDFWindowController.swift in Sources */,
 				ADD272D029B9CFD30032B5D6 /* KMLightNoNetworkView.swift in Sources */,
 				ADD272D029B9CFD30032B5D6 /* KMLightNoNetworkView.swift in Sources */,
 				BB1B0AD12B4FC6E900889528 /* KMFunctionGuideSingleController.swift in Sources */,
 				BB1B0AD12B4FC6E900889528 /* KMFunctionGuideSingleController.swift in Sources */,
 				9F1F82CA292F6CF90092C4B4 /* KMPDFInsertPageWindow.swift in Sources */,
 				9F1F82CA292F6CF90092C4B4 /* KMPDFInsertPageWindow.swift in Sources */,
@@ -18122,6 +18184,7 @@
 				BB0A55142A3052F800B6E84B /* KMCustomTextField.swift in Sources */,
 				BB0A55142A3052F800B6E84B /* KMCustomTextField.swift in Sources */,
 				ADE3C1FD29A5C44700793B13 /* KMLightMemberManager.swift in Sources */,
 				ADE3C1FD29A5C44700793B13 /* KMLightMemberManager.swift in Sources */,
 				65D684062C6A250C003A532E /* KMWavyLineAnnotationController.swift in Sources */,
 				65D684062C6A250C003A532E /* KMWavyLineAnnotationController.swift in Sources */,
+				F3DB86062CCA691B00D0AFDE /* KMNExtractPDFWindowController.swift in Sources */,
 				AD1FE82C2BD7C98300AA4A9B /* KMPDFBookletWindowController.m in Sources */,
 				AD1FE82C2BD7C98300AA4A9B /* KMPDFBookletWindowController.m in Sources */,
 				BB14701A299DC0D100784A6A /* OIDURLSessionProvider.m in Sources */,
 				BB14701A299DC0D100784A6A /* OIDURLSessionProvider.m in Sources */,
 				BBA8B7AF293600D70097D183 /* KMPasswordInputWindow.swift in Sources */,
 				BBA8B7AF293600D70097D183 /* KMPasswordInputWindow.swift in Sources */,
@@ -18417,6 +18480,7 @@
 				ADDF83922B391A5D00A81A4E /* DSignatureFilelistRow.swift in Sources */,
 				ADDF83922B391A5D00A81A4E /* DSignatureFilelistRow.swift in Sources */,
 				BB8F4557295AA1270037EA22 /* KMHeaderFooterPropertyInfoController.swift in Sources */,
 				BB8F4557295AA1270037EA22 /* KMHeaderFooterPropertyInfoController.swift in Sources */,
 				BB6347C42AF24F6300F5438E /* KMBatchoperateConvertCollectionViewItem.swift in Sources */,
 				BB6347C42AF24F6300F5438E /* KMBatchoperateConvertCollectionViewItem.swift in Sources */,
+				F3DB85F62CCA36F400D0AFDE /* KMNPageSizeTool.swift in Sources */,
 				AD88108D29A760D100178CA1 /* KMRegisterPresenter.swift in Sources */,
 				AD88108D29A760D100178CA1 /* KMRegisterPresenter.swift in Sources */,
 				F3A0F86D2CCA118D00E7373F /* KMNTools.swift in Sources */,
 				F3A0F86D2CCA118D00E7373F /* KMNTools.swift in Sources */,
 				BB146FB4299DC0D100784A6A /* GTLRUtilities.m in Sources */,
 				BB146FB4299DC0D100784A6A /* GTLRUtilities.m in Sources */,
@@ -19305,6 +19369,7 @@
 				9FAAA33A290F72CC0046FFCE /* KMHistoryFileCollectionView.swift in Sources */,
 				9FAAA33A290F72CC0046FFCE /* KMHistoryFileCollectionView.swift in Sources */,
 				BBCE57192A72723600508EFC /* NSResponder+KMExtension.swift in Sources */,
 				BBCE57192A72723600508EFC /* NSResponder+KMExtension.swift in Sources */,
 				BB146FC1299DC0D100784A6A /* GTMSessionFetcherLogging.m in Sources */,
 				BB146FC1299DC0D100784A6A /* GTMSessionFetcherLogging.m in Sources */,
+				F3DB86072CCA691B00D0AFDE /* KMNExtractPDFWindowController.swift in Sources */,
 				AD1FE8362BD7C98300AA4A9B /* KMPDFPrintManageWindowController.m in Sources */,
 				AD1FE8362BD7C98300AA4A9B /* KMPDFPrintManageWindowController.m in Sources */,
 				AD1CA4222A061D190070541F /* KMAnnotationScreenAuthorViewItem.swift in Sources */,
 				AD1CA4222A061D190070541F /* KMAnnotationScreenAuthorViewItem.swift in Sources */,
 				BB3A81B62AC2C0F4006FC66C /* NSObject+KMExtension.swift in Sources */,
 				BB3A81B62AC2C0F4006FC66C /* NSObject+KMExtension.swift in Sources */,
@@ -19480,6 +19545,7 @@
 				BB031B8F2C47CEFA0099F7AD /* KMUserFeekbackHanddler.swift in Sources */,
 				BB031B8F2C47CEFA0099F7AD /* KMUserFeekbackHanddler.swift in Sources */,
 				65AED4B42CAA55A8005C44B3 /* KMMergeViewModel.swift in Sources */,
 				65AED4B42CAA55A8005C44B3 /* KMMergeViewModel.swift in Sources */,
 				BB8F456A295ABDC10037EA22 /* KMWatermarkAdjectiveBaseModel.swift in Sources */,
 				BB8F456A295ABDC10037EA22 /* KMWatermarkAdjectiveBaseModel.swift in Sources */,
+				F3DB860F2CCA693C00D0AFDE /* KMNSplitPDFWindowController.swift in Sources */,
 				BBFDFA952AF328B900E08AA2 /* KMBatchOperateManager.swift in Sources */,
 				BBFDFA952AF328B900E08AA2 /* KMBatchOperateManager.swift in Sources */,
 				9F0CB53A2986570600007028 /* KMDesignToken+BoxShadow.swift in Sources */,
 				9F0CB53A2986570600007028 /* KMDesignToken+BoxShadow.swift in Sources */,
 				9F02017A2A1B5C0300C9B673 /* KMAIServerConfig.swift in Sources */,
 				9F02017A2A1B5C0300C9B673 /* KMAIServerConfig.swift in Sources */,
@@ -19786,6 +19852,7 @@
 				ADDF836F2B391A5C00A81A4E /* CDSignatureTextViewController.swift in Sources */,
 				ADDF836F2B391A5C00A81A4E /* CDSignatureTextViewController.swift in Sources */,
 				BB90E4F72AF3B71800B04B9F /* KMPDFWatermarkData.swift in Sources */,
 				BB90E4F72AF3B71800B04B9F /* KMPDFWatermarkData.swift in Sources */,
 				9F1FE4F729406E4700E952CA /* CTFloatingBarBackingView.m in Sources */,
 				9F1FE4F729406E4700E952CA /* CTFloatingBarBackingView.m in Sources */,
+				F352428F2CCB768B0000A901 /* KMNFileAttribute.swift in Sources */,
 				BB9695B329BDA46500FD68D3 /* SKLocalization.m in Sources */,
 				BB9695B329BDA46500FD68D3 /* SKLocalization.m in Sources */,
 				BB13314F2AD78DC0008F6791 /* KMPDFMergeSizeTabelViewCell.swift in Sources */,
 				BB13314F2AD78DC0008F6791 /* KMPDFMergeSizeTabelViewCell.swift in Sources */,
 				9F0CB4EE298655A800007028 /* KMDesignToken+PaddingLeft.swift in Sources */,
 				9F0CB4EE298655A800007028 /* KMDesignToken+PaddingLeft.swift in Sources */,
@@ -19862,6 +19929,7 @@
 				ADE8BC3029F8CD7200570F89 /* KMPDFThumbnailModel.swift in Sources */,
 				ADE8BC3029F8CD7200570F89 /* KMPDFThumbnailModel.swift in Sources */,
 				BB90E4EF2AF3546500B04B9F /* NSUserDefaultsController+KMExtension.swift in Sources */,
 				BB90E4EF2AF3546500B04B9F /* NSUserDefaultsController+KMExtension.swift in Sources */,
 				ADDEEA7F2AD3FB1D00EF675D /* KMImageAccessoryController.swift in Sources */,
 				ADDEEA7F2AD3FB1D00EF675D /* KMImageAccessoryController.swift in Sources */,
+				F3DB85F72CCA36F400D0AFDE /* KMNPageSizeTool.swift in Sources */,
 				9FDCD8172B6CC88000E22166 /* KMFormActionButtonPopWindowController.swift in Sources */,
 				9FDCD8172B6CC88000E22166 /* KMFormActionButtonPopWindowController.swift in Sources */,
 				BBB789AF2BE8BF2400F7E09C /* AIChatTranslateResultItem.swift in Sources */,
 				BBB789AF2BE8BF2400F7E09C /* AIChatTranslateResultItem.swift in Sources */,
 				BB7E59F72BBA427C0021E63D /* KMBrowserWindow.swift in Sources */,
 				BB7E59F72BBA427C0021E63D /* KMBrowserWindow.swift in Sources */,
@@ -20060,6 +20128,7 @@
 				AD3AAD652B0DA3F600DE5FE7 /* KMCompareTextHeaderView.swift in Sources */,
 				AD3AAD652B0DA3F600DE5FE7 /* KMCompareTextHeaderView.swift in Sources */,
 				BB0A55232A30968900B6E84B /* KMDesignBaseView.swift in Sources */,
 				BB0A55232A30968900B6E84B /* KMDesignBaseView.swift in Sources */,
 				AD9527C8295295110039D2BC /* KMPrintPrinterModel.swift in Sources */,
 				AD9527C8295295110039D2BC /* KMPrintPrinterModel.swift in Sources */,
+				F3DB85F82CCA36F400D0AFDE /* KMNPageSizeTool.swift in Sources */,
 				BBE789072CBD2464008086E2 /* TooltipVC.swift in Sources */,
 				BBE789072CBD2464008086E2 /* TooltipVC.swift in Sources */,
 				BBB9B32A299A5D6D004F3235 /* GTMAppAuthFetcherAuthorization+Keychain.m in Sources */,
 				BBB9B32A299A5D6D004F3235 /* GTMAppAuthFetcherAuthorization+Keychain.m in Sources */,
 				BB96A0BA2AFCE45800559E24 /* WaitingView.swift in Sources */,
 				BB96A0BA2AFCE45800559E24 /* WaitingView.swift in Sources */,
@@ -20207,6 +20276,7 @@
 				BBE788E92CBD2464008086E2 /* CardVC.swift in Sources */,
 				BBE788E92CBD2464008086E2 /* CardVC.swift in Sources */,
 				9FDD0F66294AB645000C4DAD /* KMMainViewController.swift in Sources */,
 				9FDD0F66294AB645000C4DAD /* KMMainViewController.swift in Sources */,
 				BB5A9D5D2CB6521400F64C1F /* SettingsManager.swift in Sources */,
 				BB5A9D5D2CB6521400F64C1F /* SettingsManager.swift in Sources */,
+				F3DB86082CCA691B00D0AFDE /* KMNExtractPDFWindowController.swift in Sources */,
 				BBA8B7A52935CD740097D183 /* KMRemovePasswordAlertWindowController.swift in Sources */,
 				BBA8B7A52935CD740097D183 /* KMRemovePasswordAlertWindowController.swift in Sources */,
 				8997010828F4082C009AF911 /* KMFromViewController.swift in Sources */,
 				8997010828F4082C009AF911 /* KMFromViewController.swift in Sources */,
 				9FDD0FA829533494000C4DAD /* KMJSONParser.swift in Sources */,
 				9FDD0FA829533494000C4DAD /* KMJSONParser.swift in Sources */,
@@ -20521,6 +20591,7 @@
 				AD055ECB2B8848400035F824 /* NSMenu_SKExtensions.m in Sources */,
 				AD055ECB2B8848400035F824 /* NSMenu_SKExtensions.m in Sources */,
 				ADDEEA5C2AD399BB00EF675D /* KMSignature.swift in Sources */,
 				ADDEEA5C2AD399BB00EF675D /* KMSignature.swift in Sources */,
 				BBB789BF2BE8BF2400F7E09C /* AIChatStringUploadItem.swift in Sources */,
 				BBB789BF2BE8BF2400F7E09C /* AIChatStringUploadItem.swift in Sources */,
+				F35242902CCB768B0000A901 /* KMNFileAttribute.swift in Sources */,
 				BBBB6CD82AD150D20035AA66 /* CPDFCircleAnnotation+PDFListView.swift in Sources */,
 				BBBB6CD82AD150D20035AA66 /* CPDFCircleAnnotation+PDFListView.swift in Sources */,
 				BB19A7692CB7D0F4008204DC /* KMHomeFilesEmptyHeaderView.swift in Sources */,
 				BB19A7692CB7D0F4008204DC /* KMHomeFilesEmptyHeaderView.swift in Sources */,
 				BBD7FE092A13241E00F96075 /* KMOutlineEditViewController.swift in Sources */,
 				BBD7FE092A13241E00F96075 /* KMOutlineEditViewController.swift in Sources */,
@@ -20960,6 +21031,7 @@
 				AD055E552B73220A0035F824 /* KMBookmarkManager.swift in Sources */,
 				AD055E552B73220A0035F824 /* KMBookmarkManager.swift in Sources */,
 				AD8810A229A8459000178CA1 /* KMComparativeTableViewController.swift in Sources */,
 				AD8810A229A8459000178CA1 /* KMComparativeTableViewController.swift in Sources */,
 				9F0CB4A129683E2600007028 /* KMPropertiesPanelSizeSubVC.swift in Sources */,
 				9F0CB4A129683E2600007028 /* KMPropertiesPanelSizeSubVC.swift in Sources */,
+				F3DB86102CCA693C00D0AFDE /* KMNSplitPDFWindowController.swift in Sources */,
 				AD0E8AB62A31B78900DBFD3C /* KMDMGPurchaseManager.swift in Sources */,
 				AD0E8AB62A31B78900DBFD3C /* KMDMGPurchaseManager.swift in Sources */,
 				BBEC00E7295C4D3C00A26C98 /* KMBatesPageInfoView.swift in Sources */,
 				BBEC00E7295C4D3C00A26C98 /* KMBatesPageInfoView.swift in Sources */,
 				BB6B4C0E292F62B20071CA06 /* KMPDFThumbnialPageView.swift in Sources */,
 				BB6B4C0E292F62B20071CA06 /* KMPDFThumbnialPageView.swift in Sources */,