Browse Source

【综合】合并代码

tangchao 1 year ago
parent
commit
4f1bba8ec2
21 changed files with 1949 additions and 277 deletions
  1. 56 16
      PDF Office/PDF Master.xcodeproj/project.pbxproj
  2. 35 39
      PDF Office/PDF Master/Class/PDFTools/AddHeaderFooter/New/View/KMHeaderFooterView.swift
  3. 2 0
      PDF Office/PDF Master/Class/PDFTools/Background/New/View/KMAddBackgroundView.swift
  4. 1 1
      PDF Office/PDF Master/Class/PDFTools/Compare/View/KMCompareView.xib
  5. 39 54
      PDF Office/PDF Master/Class/PDFTools/Watermark/New/View/KMWatermarkView.swift
  6. 23 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListView.h
  7. 26 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListView.m
  8. 104 104
      PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/LeftSideView.xib
  9. 0 42
      PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/ViewPanel/KMPageDisplayThemeCollectionViewItem.swift
  10. 7 1
      PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMAnnotationPropertiesViewController.h
  11. 16 1
      PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMAnnotationPropertiesViewController.m
  12. 123 0
      PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/ViewController/PageDisplay/KMPageDisplayCustomThemesCollectionViewItem.swift
  13. 82 0
      PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/ViewController/PageDisplay/KMPageDisplayCustomThemesCollectionViewItem.xib
  14. 722 0
      PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/ViewController/PageDisplay/KMPageDisplayPropertiesViewController.swift
  15. 514 0
      PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/ViewController/PageDisplay/KMPageDisplayPropertiesViewController.xib
  16. 89 0
      PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/ViewController/PageDisplay/KMPageDisplayThemeCollectionViewItem.swift
  17. 17 17
      PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/ViewPanel/KMPageDisplayThemeCollectionViewItem.xib
  18. 19 0
      PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/KMRightSideViewController.swift
  19. 2 2
      PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/KMRightSideViewController.xib
  20. 36 0
      PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift
  21. 36 0
      PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController.swift

+ 56 - 16
PDF Office/PDF Master.xcodeproj/project.pbxproj

@@ -58,12 +58,6 @@
 		896933D429AEEE3D0055327F /* PageSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = 896933D329AEEE3D0055327F /* PageSheet.xib */; };
 		896933D529AEEE3D0055327F /* PageSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = 896933D329AEEE3D0055327F /* PageSheet.xib */; };
 		896933D629AEEE3D0055327F /* PageSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = 896933D329AEEE3D0055327F /* PageSheet.xib */; };
-		896DD4552985FB3200ADE514 /* KMPageDisplayThemeCollectionViewItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 896DD4532985FB3200ADE514 /* KMPageDisplayThemeCollectionViewItem.swift */; };
-		896DD4562985FB3200ADE514 /* KMPageDisplayThemeCollectionViewItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 896DD4532985FB3200ADE514 /* KMPageDisplayThemeCollectionViewItem.swift */; };
-		896DD4572985FB3200ADE514 /* KMPageDisplayThemeCollectionViewItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 896DD4532985FB3200ADE514 /* KMPageDisplayThemeCollectionViewItem.swift */; };
-		896DD4582985FB3200ADE514 /* KMPageDisplayThemeCollectionViewItem.xib in Resources */ = {isa = PBXBuildFile; fileRef = 896DD4542985FB3200ADE514 /* KMPageDisplayThemeCollectionViewItem.xib */; };
-		896DD4592985FB3200ADE514 /* KMPageDisplayThemeCollectionViewItem.xib in Resources */ = {isa = PBXBuildFile; fileRef = 896DD4542985FB3200ADE514 /* KMPageDisplayThemeCollectionViewItem.xib */; };
-		896DD45A2985FB3200ADE514 /* KMPageDisplayThemeCollectionViewItem.xib in Resources */ = {isa = PBXBuildFile; fileRef = 896DD4542985FB3200ADE514 /* KMPageDisplayThemeCollectionViewItem.xib */; };
 		89752DA72936ECE4003FF08E /* Masonry.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 89752DA32936ECD5003FF08E /* Masonry.framework */; };
 		89752DA82936ECE4003FF08E /* Masonry.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 89752DA32936ECD5003FF08E /* Masonry.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		89752DA92936ECE9003FF08E /* Masonry.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 89752DA32936ECD5003FF08E /* Masonry.framework */; };
@@ -307,6 +301,12 @@
 		9F0201992A1F352100C9B673 /* KMAITranslationConfirmWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9F0201952A1F352100C9B673 /* KMAITranslationConfirmWindowController.xib */; };
 		9F02019A2A1F352100C9B673 /* KMAITranslationConfirmWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9F0201952A1F352100C9B673 /* KMAITranslationConfirmWindowController.xib */; };
 		9F02019B2A1F352100C9B673 /* KMAITranslationConfirmWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9F0201952A1F352100C9B673 /* KMAITranslationConfirmWindowController.xib */; };
+		9F0390062B426F3300302D1D /* KMPageDisplayPropertiesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F0390042B426F3300302D1D /* KMPageDisplayPropertiesViewController.swift */; };
+		9F0390072B426F3300302D1D /* KMPageDisplayPropertiesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F0390042B426F3300302D1D /* KMPageDisplayPropertiesViewController.swift */; };
+		9F0390082B426F3300302D1D /* KMPageDisplayPropertiesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F0390042B426F3300302D1D /* KMPageDisplayPropertiesViewController.swift */; };
+		9F0390092B426F3300302D1D /* KMPageDisplayPropertiesViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9F0390052B426F3300302D1D /* KMPageDisplayPropertiesViewController.xib */; };
+		9F03900A2B426F3300302D1D /* KMPageDisplayPropertiesViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9F0390052B426F3300302D1D /* KMPageDisplayPropertiesViewController.xib */; };
+		9F03900B2B426F3300302D1D /* KMPageDisplayPropertiesViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9F0390052B426F3300302D1D /* KMPageDisplayPropertiesViewController.xib */; };
 		9F080B14298CFDB300FC27DA /* KMTextImageButtonVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F080B12298CFDB300FC27DA /* KMTextImageButtonVC.swift */; };
 		9F080B15298CFDB300FC27DA /* KMTextImageButtonVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F080B12298CFDB300FC27DA /* KMTextImageButtonVC.swift */; };
 		9F080B16298CFDB300FC27DA /* KMTextImageButtonVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F080B12298CFDB300FC27DA /* KMTextImageButtonVC.swift */; };
@@ -687,6 +687,18 @@
 		9F3D819629A33A290087B5AD /* KMDesignDropdown.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9F3D819229A33A290087B5AD /* KMDesignDropdown.xib */; };
 		9F3D819729A33A290087B5AD /* KMDesignDropdown.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9F3D819229A33A290087B5AD /* KMDesignDropdown.xib */; };
 		9F3D819829A33A290087B5AD /* KMDesignDropdown.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9F3D819229A33A290087B5AD /* KMDesignDropdown.xib */; };
+		9F512CC72B4640AB00EC0BC3 /* KMPageDisplayCustomThemesCollectionViewItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F512CC52B4640AB00EC0BC3 /* KMPageDisplayCustomThemesCollectionViewItem.swift */; };
+		9F512CC82B4640AB00EC0BC3 /* KMPageDisplayCustomThemesCollectionViewItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F512CC52B4640AB00EC0BC3 /* KMPageDisplayCustomThemesCollectionViewItem.swift */; };
+		9F512CC92B4640AB00EC0BC3 /* KMPageDisplayCustomThemesCollectionViewItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F512CC52B4640AB00EC0BC3 /* KMPageDisplayCustomThemesCollectionViewItem.swift */; };
+		9F512CCA2B4640AB00EC0BC3 /* KMPageDisplayCustomThemesCollectionViewItem.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9F512CC62B4640AB00EC0BC3 /* KMPageDisplayCustomThemesCollectionViewItem.xib */; };
+		9F512CCB2B4640AB00EC0BC3 /* KMPageDisplayCustomThemesCollectionViewItem.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9F512CC62B4640AB00EC0BC3 /* KMPageDisplayCustomThemesCollectionViewItem.xib */; };
+		9F512CCC2B4640AB00EC0BC3 /* KMPageDisplayCustomThemesCollectionViewItem.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9F512CC62B4640AB00EC0BC3 /* KMPageDisplayCustomThemesCollectionViewItem.xib */; };
+		9F512CCF2B469A7700EC0BC3 /* KMPageDisplayThemeCollectionViewItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F512CCD2B469A7600EC0BC3 /* KMPageDisplayThemeCollectionViewItem.swift */; };
+		9F512CD02B469A7700EC0BC3 /* KMPageDisplayThemeCollectionViewItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F512CCD2B469A7600EC0BC3 /* KMPageDisplayThemeCollectionViewItem.swift */; };
+		9F512CD12B469A7700EC0BC3 /* KMPageDisplayThemeCollectionViewItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F512CCD2B469A7600EC0BC3 /* KMPageDisplayThemeCollectionViewItem.swift */; };
+		9F512CD22B469A7700EC0BC3 /* KMPageDisplayThemeCollectionViewItem.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9F512CCE2B469A7600EC0BC3 /* KMPageDisplayThemeCollectionViewItem.xib */; };
+		9F512CD32B469A7700EC0BC3 /* KMPageDisplayThemeCollectionViewItem.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9F512CCE2B469A7600EC0BC3 /* KMPageDisplayThemeCollectionViewItem.xib */; };
+		9F512CD42B469A7700EC0BC3 /* KMPageDisplayThemeCollectionViewItem.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9F512CCE2B469A7600EC0BC3 /* KMPageDisplayThemeCollectionViewItem.xib */; };
 		9F53D5472AD664C300CCF9D8 /* CPDFListHoverAnnotationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F53D5462AD664C300CCF9D8 /* CPDFListHoverAnnotationViewController.swift */; };
 		9F53D5482AD664C300CCF9D8 /* CPDFListHoverAnnotationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F53D5462AD664C300CCF9D8 /* CPDFListHoverAnnotationViewController.swift */; };
 		9F53D5492AD664C300CCF9D8 /* CPDFListHoverAnnotationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F53D5462AD664C300CCF9D8 /* CPDFListHoverAnnotationViewController.swift */; };
@@ -4500,8 +4512,6 @@
 		894A00F02976314C0070ED83 /* KMPDFViewPanelSetViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMPDFViewPanelSetViewController.swift; sourceTree = "<group>"; };
 		894A00F12976314C0070ED83 /* KMPDFViewPanelSetViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMPDFViewPanelSetViewController.xib; sourceTree = "<group>"; };
 		896933D329AEEE3D0055327F /* PageSheet.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PageSheet.xib; sourceTree = "<group>"; };
-		896DD4532985FB3200ADE514 /* KMPageDisplayThemeCollectionViewItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMPageDisplayThemeCollectionViewItem.swift; sourceTree = "<group>"; };
-		896DD4542985FB3200ADE514 /* KMPageDisplayThemeCollectionViewItem.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMPageDisplayThemeCollectionViewItem.xib; sourceTree = "<group>"; };
 		89752DA32936ECD5003FF08E /* Masonry.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Masonry.framework; sourceTree = "<group>"; };
 		89752DAD2936F505003FF08E /* KMCustomButtonPopMenuViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = KMCustomButtonPopMenuViewController.xib; sourceTree = "<group>"; };
 		89752DE8293875FC003FF08E /* KMMainToolbarController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMMainToolbarController.swift; sourceTree = "<group>"; };
@@ -4596,6 +4606,8 @@
 		9F02018D2A1DDAA500C9B673 /* KMAITranslationWindowController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMAITranslationWindowController.xib; sourceTree = "<group>"; };
 		9F0201942A1F352100C9B673 /* KMAITranslationConfirmWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMAITranslationConfirmWindowController.swift; sourceTree = "<group>"; };
 		9F0201952A1F352100C9B673 /* KMAITranslationConfirmWindowController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMAITranslationConfirmWindowController.xib; sourceTree = "<group>"; };
+		9F0390042B426F3300302D1D /* KMPageDisplayPropertiesViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMPageDisplayPropertiesViewController.swift; sourceTree = "<group>"; };
+		9F0390052B426F3300302D1D /* KMPageDisplayPropertiesViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMPageDisplayPropertiesViewController.xib; sourceTree = "<group>"; };
 		9F080B12298CFDB300FC27DA /* KMTextImageButtonVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMTextImageButtonVC.swift; sourceTree = "<group>"; };
 		9F080B13298CFDB300FC27DA /* KMTextImageButtonVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMTextImageButtonVC.xib; sourceTree = "<group>"; };
 		9F080B22298FCB0D00FC27DA /* KMDesignToken+Action.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "KMDesignToken+Action.swift"; sourceTree = "<group>"; };
@@ -4765,6 +4777,10 @@
 		9F3D818D29A22AD90087B5AD /* Date+KMExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Date+KMExtensions.swift"; sourceTree = "<group>"; };
 		9F3D819129A33A290087B5AD /* KMDesignDropdown.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMDesignDropdown.swift; sourceTree = "<group>"; };
 		9F3D819229A33A290087B5AD /* KMDesignDropdown.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMDesignDropdown.xib; sourceTree = "<group>"; };
+		9F512CC52B4640AB00EC0BC3 /* KMPageDisplayCustomThemesCollectionViewItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMPageDisplayCustomThemesCollectionViewItem.swift; sourceTree = "<group>"; };
+		9F512CC62B4640AB00EC0BC3 /* KMPageDisplayCustomThemesCollectionViewItem.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMPageDisplayCustomThemesCollectionViewItem.xib; sourceTree = "<group>"; };
+		9F512CCD2B469A7600EC0BC3 /* KMPageDisplayThemeCollectionViewItem.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KMPageDisplayThemeCollectionViewItem.swift; sourceTree = "<group>"; };
+		9F512CCE2B469A7600EC0BC3 /* KMPageDisplayThemeCollectionViewItem.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = KMPageDisplayThemeCollectionViewItem.xib; sourceTree = "<group>"; };
 		9F53D5462AD664C300CCF9D8 /* CPDFListHoverAnnotationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CPDFListHoverAnnotationViewController.swift; sourceTree = "<group>"; };
 		9F53D54A2AD6696B00CCF9D8 /* ComPDFUIConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ComPDFUIConfig.swift; sourceTree = "<group>"; };
 		9F53D54E2AD677A000CCF9D8 /* CPDFListViewConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CPDFListViewConfig.swift; sourceTree = "<group>"; };
@@ -6354,8 +6370,6 @@
 			children = (
 				894A00F02976314C0070ED83 /* KMPDFViewPanelSetViewController.swift */,
 				894A00F12976314C0070ED83 /* KMPDFViewPanelSetViewController.xib */,
-				896DD4532985FB3200ADE514 /* KMPageDisplayThemeCollectionViewItem.swift */,
-				896DD4542985FB3200ADE514 /* KMPageDisplayThemeCollectionViewItem.xib */,
 			);
 			name = ViewPanel;
 			path = "PDF Master/Class/PDFWindowController/Side/LeftSide/ViewPanel";
@@ -6688,6 +6702,19 @@
 			path = FirebaseAnalytics;
 			sourceTree = "<group>";
 		};
+		9F0390032B426EFC00302D1D /* PageDisplay */ = {
+			isa = PBXGroup;
+			children = (
+				9F0390042B426F3300302D1D /* KMPageDisplayPropertiesViewController.swift */,
+				9F0390052B426F3300302D1D /* KMPageDisplayPropertiesViewController.xib */,
+				9F512CC52B4640AB00EC0BC3 /* KMPageDisplayCustomThemesCollectionViewItem.swift */,
+				9F512CC62B4640AB00EC0BC3 /* KMPageDisplayCustomThemesCollectionViewItem.xib */,
+				9F512CCD2B469A7600EC0BC3 /* KMPageDisplayThemeCollectionViewItem.swift */,
+				9F512CCE2B469A7600EC0BC3 /* KMPageDisplayThemeCollectionViewItem.xib */,
+			);
+			path = PageDisplay;
+			sourceTree = "<group>";
+		};
 		9F080B08298A4BB300FC27DA /* NSObject */ = {
 			isa = PBXGroup;
 			children = (
@@ -6731,6 +6758,7 @@
 				9FD0FA3029CD947000F2AB0D /* KMOpacityPanel.xib */,
 				9FB220FD2B18866E00A5B208 /* KMAnnotationSelfSignViewController.swift */,
 				9FB220FE2B18866E00A5B208 /* KMAnnotationSelfSignViewController.xib */,
+				9F0390032B426EFC00302D1D /* PageDisplay */,
 				9FB220F42B186C2900A5B208 /* FormProperties */,
 			);
 			path = ViewController;
@@ -11696,7 +11724,6 @@
 				89316855296E45CA0073EA59 /* KMImageAccessoryController.xib in Resources */,
 				9FB220E22B10850400A5B208 /* KMAnnotationStampViewController.xib in Resources */,
 				ADAFDA6C2AEB470200F084BC /* KMQucikToolsView.xib in Resources */,
-				896DD4582985FB3200ADE514 /* KMPageDisplayThemeCollectionViewItem.xib in Resources */,
 				ADDF835F2B391A5C00A81A4E /* DSignatureCertifyDetailViewController.xib in Resources */,
 				ADE86AA02B031FDB00414DFA /* KMCompareWindowController.xib in Resources */,
 				89752E072939DB42003FF08E /* KMToolbarViewController.xib in Resources */,
@@ -11739,6 +11766,7 @@
 				AD0FA50629A8E61B00EDEB50 /* KMLightMemberAlertView.xib in Resources */,
 				ADCFFC0629C04617007D3657 /* BOTA.xcassets in Resources */,
 				ADDF837A2B391A5D00A81A4E /* CDSignatureTextViewController.xib in Resources */,
+				9F0390092B426F3300302D1D /* KMPageDisplayPropertiesViewController.xib in Resources */,
 				89E4E7852967BF5A002DBA6F /* KMCustomizeStampViewController.xib in Resources */,
 				BB1BFF652AE9FBA8003EB179 /* KMBatchOperateWindowController.xib in Resources */,
 				BBFDFAA22AF3815C00E08AA2 /* KMTextHintWindowController.xib in Resources */,
@@ -11850,6 +11878,7 @@
 				9F1F82DD292F84D60092C4B4 /* KMHomeInsertActionViewController.xib in Resources */,
 				9F78EFBE28F7C1CC001E66F4 /* KMHomeViewController.xib in Resources */,
 				9F3D818A29A0A9A70087B5AD /* KMDesignButton.xib in Resources */,
+				9F512CD22B469A7700EC0BC3 /* KMPageDisplayThemeCollectionViewItem.xib in Resources */,
 				9FDD0F9F2952FF4D000C4DAD /* global.json in Resources */,
 				ADE614B129779C6D00F62ED7 /* KMImageTitleButton.xib in Resources */,
 				BBB3769B2B10A7FD009539CC /* a_2a.png in Resources */,
@@ -12014,6 +12043,7 @@
 				BBA8B7A62935CD740097D183 /* KMRemovePasswordAlertWindowController.xib in Resources */,
 				BB51074229A61B4100978662 /* ProgressSheet.xib in Resources */,
 				ADE86AA82B031FFA00414DFA /* KMCompareView.xib in Resources */,
+				9F512CCA2B4640AB00EC0BC3 /* KMPageDisplayCustomThemesCollectionViewItem.xib in Resources */,
 				BB003031298D315E002DD1A0 /* KMPreferenceMarkupController.xib in Resources */,
 				BB1AEF3529F937A50048D179 /* PDF Master User Guide.pdf in Resources */,
 				BB96A0B42AFCD56B00559E24 /* KMToolCompareWindowController.xib in Resources */,
@@ -12085,6 +12115,7 @@
 				ADD1B6F92946C0CA00C3FFF7 /* KMPrintChoosePageSizeMultipageView.xib in Resources */,
 				BB1A916F2AFB7871005E5FD8 /* KMConvertWindowController.xib in Resources */,
 				AD88109B29A78AEC00178CA1 /* KMVerificationCodeView.xib in Resources */,
+				9F512CD32B469A7700EC0BC3 /* KMPageDisplayThemeCollectionViewItem.xib in Resources */,
 				AD8810A429A8459000178CA1 /* KMComparativeTableViewController.xib in Resources */,
 				AD0FA4F629A8582C00EDEB50 /* KMComparativeTableView.xib in Resources */,
 				AD3AAD4A2B0B7B8900DE5FE7 /* KMCompareToolbar.xib in Resources */,
@@ -12099,6 +12130,7 @@
 				BBB29BCF2AEA190E005F1B6B /* KMToolbarCustomViewController.xib in Resources */,
 				ADE86A972B0226BB00414DFA /* KMRemovePasswordView.xib in Resources */,
 				BBEFD0212AF9E5BC003FABD8 /* KMBatchOperateAddHeaderFooterViewController.xib in Resources */,
+				9F03900A2B426F3300302D1D /* KMPageDisplayPropertiesViewController.xib in Resources */,
 				ADF1569829A62D31001D1018 /* KMLoginLeftImageView.xib in Resources */,
 				89316856296E45CA0073EA59 /* KMImageAccessoryController.xib in Resources */,
 				BBC3483F2955A60B008D2CD1 /* KMBackgroundPropertyInfoController.xib in Resources */,
@@ -12135,6 +12167,7 @@
 				BB6347B12AF1F0BB00F5438E /* KMBatchOperateConvertViewController.xib in Resources */,
 				9F0201762A1B488C00C9B673 /* KMAITranslationVC.xib in Resources */,
 				9F72D20C2994BDAF00DCACF1 /* KMNotificationVC.xib in Resources */,
+				9F512CCB2B4640AB00EC0BC3 /* KMPageDisplayCustomThemesCollectionViewItem.xib in Resources */,
 				9F3D819729A33A290087B5AD /* KMDesignDropdown.xib in Resources */,
 				BB03D6912B01C7AB008C9976 /* KMPDFEditInsertBlankPageWindow.xib in Resources */,
 				BBFE6E792930E53000142C01 /* KMMergePopoverViewController.xib in Resources */,
@@ -12353,7 +12386,6 @@
 				BBC821E42B0D9F72004B7E8E /* KMStampCreaterWindowController.xib in Resources */,
 				BB3AAB9429878CE000992A5A /* KMWatermarkAdjectivePropertyMainController.xib in Resources */,
 				AD3AAD4E2B0B7B9300DE5FE7 /* KMCompareTextView.xib in Resources */,
-				896DD4592985FB3200ADE514 /* KMPageDisplayThemeCollectionViewItem.xib in Resources */,
 				9F853A062947137500DF644E /* newtab_h.pdf in Resources */,
 				ADAFD9F82AE68A8500F084BC /* KMCreatPDFView.xib in Resources */,
 				ADDF83722B391A5D00A81A4E /* DSignatureCreateViewController.xib in Resources */,
@@ -12602,6 +12634,7 @@
 				ADE86ABC2B0343F100414DFA /* KMWatermarkView.xib in Resources */,
 				AD3AAD612B0DA3D400DE5FE7 /* KMCompareTextViewItem.xib in Resources */,
 				ADDF837C2B391A5D00A81A4E /* CDSignatureTextViewController.xib in Resources */,
+				9F03900B2B426F3300302D1D /* KMPageDisplayPropertiesViewController.xib in Resources */,
 				9F853A072947137500DF644E /* newtab_h.pdf in Resources */,
 				ADF9ED3529A850D200C4A943 /* KMAccountInfoView.xib in Resources */,
 				AD88108929A719E500178CA1 /* KMRegisterView.xib in Resources */,
@@ -12712,6 +12745,7 @@
 				BBD1F781296F9BE000343885 /* KMPageEditSettingBaseWindowController.xib in Resources */,
 				BB5DF1EE2959C5CB0025CDA1 /* KMHeaderFooterPreviewController.xib in Resources */,
 				ADBC2D17299CCD10006280C8 /* KMTextfieldButton.xib in Resources */,
+				9F512CD42B469A7700EC0BC3 /* KMPageDisplayThemeCollectionViewItem.xib in Resources */,
 				BB1BFF6F2AEA030F003EB179 /* KMBatchOperateSplitViewController.xib in Resources */,
 				BBC348382955A118008D2CD1 /* KMCreateBackgroundController.xib in Resources */,
 				BB6DD81129347F77001F0544 /* KMSecureEncryptWindowController.xib in Resources */,
@@ -12877,6 +12911,7 @@
 				BB897263294C5DDA0045787C /* KMWatermarkPropertyInfoController.xib in Resources */,
 				ADE86AC52B034C7100414DFA /* KMBackgroundWindowController.xib in Resources */,
 				BBB376A92B10A7FD009539CC /* a_3b.png in Resources */,
+				9F512CCC2B4640AB00EC0BC3 /* KMPageDisplayCustomThemesCollectionViewItem.xib in Resources */,
 				9F8539F82947137500DF644E /* sadfavicon.png in Resources */,
 				9F8539FB2947137500DF644E /* newtab_p.pdf in Resources */,
 				9F221EDC29A9EC0900978A59 /* KMFillSignTextPanel.xib in Resources */,
@@ -12892,7 +12927,6 @@
 				BB65A0842AF8FEA1003A27A0 /* KMBatchOperateRemoveHeaderFooterViewController.xib in Resources */,
 				BB49ED13293F462E00C82CA2 /* KMConvertImageWindowController.xib in Resources */,
 				ADE86A7D2B0221E100414DFA /* KMSecurityWindowController.xib in Resources */,
-				896DD45A2985FB3200ADE514 /* KMPageDisplayThemeCollectionViewItem.xib in Resources */,
 				9F00CCBB2A2F1E0F00AC462E /* dsa_priv.pem in Resources */,
 				BBF62C6E2B033B5B007B7E86 /* KMPDFEditExtractWindow.xib in Resources */,
 				9F0CB46C2967E5CB00007028 /* KMPropertiesPanelSubViewController.xib in Resources */,
@@ -12965,6 +12999,7 @@
 				BB146FBD299DC0D100784A6A /* GTMGatherInputStream.m in Sources */,
 				9F78EFC628F7E965001E66F4 /* KMHomeViewController+UI.swift in Sources */,
 				BB4F7E952B0C857D0077EC8C /* KMNoteTypeCollectionViewItem.swift in Sources */,
+				9F512CC72B4640AB00EC0BC3 /* KMPageDisplayCustomThemesCollectionViewItem.swift in Sources */,
 				BB8F4582295B0F900037EA22 /* KMHeaderFooterMarginInfoView.swift in Sources */,
 				9FDD0FAA29534FCC000C4DAD /* KMAliasLight.swift in Sources */,
 				AD1D48082AFB18DA007AC1F0 /* KMCompressWIndowControllerNew.swift in Sources */,
@@ -13536,6 +13571,7 @@
 				8942F7E92925E1C400389627 /* KMLiftSideCellView.swift in Sources */,
 				9FBA0EEE28FFC716001117AF /* KMHomeFastToolViewController.swift in Sources */,
 				BBBC08832B2AC863009B237F /* KMSnapshotModel.swift in Sources */,
+				9F512CCF2B469A7700EC0BC3 /* KMPageDisplayThemeCollectionViewItem.swift in Sources */,
 				BB4F7E792B0C45BB0077EC8C /* KMNoteOutlineFilterViewController.swift in Sources */,
 				ADD1B6C72942E83000C3FFF7 /* KMPrintBottomView.swift in Sources */,
 				9F0CB4D12986550B00007028 /* KMDesignToken+Width.swift in Sources */,
@@ -13810,6 +13846,7 @@
 				BBE9D09F2AF0D10F002E83CE /* KMSlider.swift in Sources */,
 				9F0CB4BD2977C06300007028 /* KMPropertiesPanelColorSubVC.swift in Sources */,
 				AD1CA4192A061CE10070541F /* KMAnnotationScreenTypeViewItem.swift in Sources */,
+				9F0390062B426F3300302D1D /* KMPageDisplayPropertiesViewController.swift in Sources */,
 				BBB9B328299A5D6D004F3235 /* GTMAppAuthFetcherAuthorization+Keychain.m in Sources */,
 				9F1FE4F029406E4700E952CA /* BackgroundGradientView.m in Sources */,
 				BB2EDF70296ECE17003BCF58 /* KMPageEditThumbnailView.swift in Sources */,
@@ -13877,7 +13914,6 @@
 				BB6719E92AD2A57C003D44D5 /* CPDFLinkAnnotation+PDFListView.swift in Sources */,
 				AD53B6FE29AC5FCD00D61E81 /* KMLightMemberToken.swift in Sources */,
 				BB0542152965705D00F2665C /* KMCropTipView.swift in Sources */,
-				896DD4552985FB3200ADE514 /* KMPageDisplayThemeCollectionViewItem.swift in Sources */,
 				ADDF83322B391A5C00A81A4E /* CPDFAnnotation+PDFListView.m in Sources */,
 				ADA9102E2A272CEA003352F0 /* KMImageOptimization.swift in Sources */,
 				BBC348532958465C008D2CD1 /* KMBackgroundFilePropertyInfoController.swift in Sources */,
@@ -14548,6 +14584,7 @@
 				BBBE209C2B21E5F100509C4E /* KMAlertTool.swift in Sources */,
 				ADDF839F2B391A5D00A81A4E /* CDSignatureDrawViewController.swift in Sources */,
 				ADD1B6E02946BFD500C3FFF7 /* KMPrintChoosePageSizeSizeView.swift in Sources */,
+				9F512CC82B4640AB00EC0BC3 /* KMPageDisplayCustomThemesCollectionViewItem.swift in Sources */,
 				BBFE6E5E2930809A00142C01 /* KMMergeCollectionPageViewItem.swift in Sources */,
 				9F0CB4D22986550B00007028 /* KMDesignToken+Width.swift in Sources */,
 				BB8F457F295B00130037EA22 /* KMWatermarkAdjectiveTools.swift in Sources */,
@@ -14713,6 +14750,7 @@
 				BB6DD80D29347F77001F0544 /* KMSecureEncryptWindowController.swift in Sources */,
 				9F0CB4682967E5CB00007028 /* KMPropertiesPanelSubViewController.swift in Sources */,
 				9F8539CC29430BF300DF644E /* KMBrowserWindowController.swift in Sources */,
+				9F0390072B426F3300302D1D /* KMPageDisplayPropertiesViewController.swift in Sources */,
 				BB147045299DC0D200784A6A /* OIDURLQueryComponent.m in Sources */,
 				9FDD0FB8295D5230000C4DAD /* KMToolbarController.swift in Sources */,
 				BB162E98295062CD0088E9D1 /* KMPageRangeTools.swift in Sources */,
@@ -14909,7 +14947,6 @@
 				AD53B6FF29AC5FCD00D61E81 /* KMLightMemberToken.swift in Sources */,
 				9FB220F22B1863C800A5B208 /* KMAnnotationFromSignature.swift in Sources */,
 				BB0542162965705D00F2665C /* KMCropTipView.swift in Sources */,
-				896DD4562985FB3200ADE514 /* KMPageDisplayThemeCollectionViewItem.swift in Sources */,
 				BBC348542958465C008D2CD1 /* KMBackgroundFilePropertyInfoController.swift in Sources */,
 				AD02573B2A8601AA00EAD5D5 /* KMLoginManager.swift in Sources */,
 				ADDF83A22B391A5D00A81A4E /* DSignatureFileListViewController.swift in Sources */,
@@ -14935,6 +14972,7 @@
 				89D2D309295A83B500BFF5FE /* KMEditPDFTextPropertyViewController.swift in Sources */,
 				9F0CB4DE2986554D00007028 /* KMDesignToken+HorizontalPadding.swift in Sources */,
 				9F1FE49A29406E4700E952CA /* NewTabButton.m in Sources */,
+				9F512CD02B469A7700EC0BC3 /* KMPageDisplayThemeCollectionViewItem.swift in Sources */,
 				BBF2455E2AE78FF900037D08 /* KMBatchWindow.swift in Sources */,
 				BBC4F9FB2AEB9E200098A1A8 /* KMBatchTableCellView.swift in Sources */,
 				BB146FEE299DC0D100784A6A /* GTLRBatchResult.m in Sources */,
@@ -15492,6 +15530,7 @@
 				BB6013922AD3AFF000A76FB2 /* NSPopover+KMExtension.swift in Sources */,
 				BB2CC5642AF1239900D7A796 /* KMBatchBaseParameter.swift in Sources */,
 				BBC8A7662B05C93900FA9377 /* KMThumbnailTableView.swift in Sources */,
+				9F0390082B426F3300302D1D /* KMPageDisplayPropertiesViewController.swift in Sources */,
 				BB5F8A1029BB04F000365ADB /* GBDeviceInfo_OSX.m in Sources */,
 				AD02573C2A8601AA00EAD5D5 /* KMLoginManager.swift in Sources */,
 				BBFE6E89293210AB00142C01 /* KMCompressCellView.swift in Sources */,
@@ -15867,12 +15906,12 @@
 				ADAFDA4A2AEA7F1300F084BC /* KMAdvertisementShowView.swift in Sources */,
 				AD85D1B72AF0CCFC000F4D28 /* KMHomeHistoryListViewModel.swift in Sources */,
 				AD8F06192999DB5900D93CBC /* KMPrintDrawPage.swift in Sources */,
+				9F512CC92B4640AB00EC0BC3 /* KMPageDisplayCustomThemesCollectionViewItem.swift in Sources */,
 				BBFDFA962AF328BA00E08AA2 /* KMBatchOperateManager.swift in Sources */,
 				9FF94F1B29A770B500B1EF69 /* KMFillSignShapePanel.swift in Sources */,
 				BBA5429E29F13A140041BAD0 /* KMMemorandumPattern.swift in Sources */,
 				BB1BFF882AEA30B1003EB179 /* NSWindow+PopOver.swift in Sources */,
 				BB9EA1512B1ECD0400EAFD9B /* KMBatchOperateImageToPDFViewController.swift in Sources */,
-				896DD4572985FB3200ADE514 /* KMPageDisplayThemeCollectionViewItem.swift in Sources */,
 				9FD0D2B52AD5265A00DA3FF8 /* CPDFListAnnotationNoteWindowController.swift in Sources */,
 				F359916B29261F0E000D25DE /* CPDFListView+Tool.m in Sources */,
 				89752DEC293875FC003FF08E /* KMMainToolbarController.swift in Sources */,
@@ -15908,6 +15947,7 @@
 				AD85D1A62AF09864000F4D28 /* KMHomeQuickToolsWindowController.swift in Sources */,
 				BB35C4A12975362900D46EE2 /* KMRedactTopToolBar.swift in Sources */,
 				AD8810B429A846B100178CA1 /* KMVerficationCodeWindowController.swift in Sources */,
+				9F512CD12B469A7700EC0BC3 /* KMPageDisplayThemeCollectionViewItem.swift in Sources */,
 				9F1FE4CB29406E4700E952CA /* CTTabContents.m in Sources */,
 				9F78EFC428F7E395001E66F4 /* KMHomeViewController+Action.swift in Sources */,
 				BB89721A294AED6C0045787C /* KMWatermarkAdjectivePreViewBaseController.swift in Sources */,

+ 35 - 39
PDF Office/PDF Master/Class/PDFTools/AddHeaderFooter/New/View/KMHeaderFooterView.swift

@@ -931,20 +931,22 @@ class KMHeaderFooterView: KMBaseXibView, NSTextViewDelegate, NSComboBoxDelegate
         }
 
         if comboBox == pageRangeCombobox {
-            if !checkPageRangeValidate(pageRangeString: comboBox.stringValue) {
-                let alert = NSAlert()
-                alert.alertStyle = .critical
-                alert.messageText = "\(pdfDocument?.documentURL?.lastPathComponent ?? NSLocalizedString("Untitled", comment: "")) \(NSLocalizedString("Invalid page range or the page number is out of range. Please try again.", comment: ""))"
-                alert.runModal()
-
-                headerFooterObj.pageRangeType = .all
-                pageRangeCombobox.selectItem(at: 0)
-//                pageRangeCombobox.isEditable = false
-                pageRangeCombobox.isSelectable = false
-                return
-            } else {
-                headerFooterObj.pageRangeString = comboBox.stringValue
-                self.updatePDFView()
+            if pageRangeCombobox.indexOfSelectedItem == -1 {
+                if !checkPageRangeValidate(pageRangeString: comboBox.stringValue) {
+                    let alert = NSAlert()
+                    alert.alertStyle = .critical
+                    alert.messageText = "\(pdfDocument?.documentURL?.lastPathComponent ?? NSLocalizedString("Untitled", comment: "")) \(NSLocalizedString("Invalid page range or the page number is out of range. Please try again.", comment: ""))"
+                    alert.runModal()
+                    
+                    headerFooterObj.pageRangeType = .all
+                    pageRangeCombobox.selectItem(at: 0)
+                    //                pageRangeCombobox.isEditable = false
+                    pageRangeCombobox.isSelectable = false
+                    return
+                } else {
+                    headerFooterObj.pageRangeString = comboBox.stringValue
+                    self.updatePDFView()
+                }
             }
         }
     }
@@ -966,7 +968,7 @@ class KMHeaderFooterView: KMBaseXibView, NSTextViewDelegate, NSComboBoxDelegate
                 headerFooterObj.pageRangeType = .even
             default:
                 headerFooterObj.pageRangeType = .other
-                pageRangeCombobox.stringValue = ""
+//                pageRangeCombobox.stringValue = ""
                 pageRangeCombobox.isEditable = true
                 window?.makeFirstResponder(pageRangeCombobox)
             }
@@ -1116,45 +1118,39 @@ extension KMHeaderFooterView {
     }
 
     @IBAction func apply(_ sender: Any) {
+        guard let pdfDocument = pdfDocument else { return }
         let needSave = saveToTemplateButton.state == .on
         
-        var pages = [String]()
+        var pages = [Int]()
+
         switch pageRangeCombobox.indexOfSelectedItem {
         case 0:
-            for i in 0..<pdfDocument!.pageCount {
-                pages.append("\(i)")
-            }
+            pages = Array(0..<Int(pdfDocument.pageCount))
         case 1:
-            for i in 0..<pdfDocument!.pageCount where i % 2 == 0 {
-                pages.append("\(i)")
-            }
+            pages = Array(stride(from: 0, to: Int(pdfDocument.pageCount), by: 2))
         case 2:
-            for i in 0..<pdfDocument!.pageCount where i % 2 != 0 {
-                pages.append("\(i)")
-            }
+            pages = Array(stride(from: 1, to: Int(pdfDocument.pageCount), by: 2))
         default:
             let fileAttribute = KMFileAttribute()
-            fileAttribute.filePath = pdfDocument?.documentURL?.path ?? ""
+            fileAttribute.filePath = pdfDocument.documentURL?.path ?? ""
             fileAttribute.bAllPage = false
+            fileAttribute.pagesType = .custom
+            fileAttribute.password = pdfDocument.password ?? ""
             fileAttribute.pagesString = pageRangeCombobox.stringValue
-            
-            if fileAttribute.fetchSelectPages().count == 0 {
+
+            let selectPages = fileAttribute.fetchSelectPages()
+            if selectPages.count != 0 {
+                pages = selectPages.map { $0 - 1 }
+            } else {
                 let alert = NSAlert()
                 alert.alertStyle = .critical
                 alert.messageText = "\(fileAttribute.filePath.lastPathComponent) \(NSLocalizedString("Invalid page range or the page number is out of range. Please try again.", comment: ""))"
                 alert.runModal()
                 return
             }
-            for num in fileAttribute.fetchSelectPages() {
-                pages.append("\(num)")
-            }
-        }
-        
-        if pages.count > 0 {
-            headerFooterObj.pageRangeString = pages.joined(separator: ",")
-        } else {
-            headerFooterObj.pageRangeString = ""
         }
+
+        headerFooterObj.pageRangeString = pages.isEmpty ? "" : pages.map { "\($0)" }.joined(separator: ",")
         
         if type == .Add {
             let object = headerFooterObj
@@ -1191,9 +1187,9 @@ extension KMHeaderFooterView {
             
             var fileName: String?
             if isBates {
-                fileName = "\(pdfDocument?.documentURL?.lastPathComponent ?? NSLocalizedString("Untitled", comment: ""))_Bates"
+                fileName = "\(pdfDocument.documentURL?.lastPathComponent ?? NSLocalizedString("Untitled", comment: ""))_Bates"
             } else {
-                fileName = "\(pdfDocument?.documentURL?.lastPathComponent ?? NSLocalizedString("Untitled", comment: ""))_Header_Footer"
+                fileName = "\(pdfDocument.documentURL?.lastPathComponent ?? NSLocalizedString("Untitled", comment: ""))_Header_Footer"
             }
             
             let savePanelAccessoryViewController = KMSavePanelAccessoryController()

+ 2 - 0
PDF Office/PDF Master/Class/PDFTools/Background/New/View/KMAddBackgroundView.swift

@@ -865,6 +865,8 @@ extension KMAddBackgroundView {
             let fileAttribute = KMFileAttribute()
             fileAttribute.filePath = pdfDocument.documentURL?.path ?? ""
             fileAttribute.bAllPage = false
+            fileAttribute.pagesType = .custom
+            fileAttribute.password = pdfDocument.password ?? ""
             fileAttribute.pagesString = pageRangeComboBox.stringValue
 
             let selectPages = fileAttribute.fetchSelectPages()

+ 1 - 1
PDF Office/PDF Master/Class/PDFTools/Compare/View/KMCompareView.xib

@@ -71,7 +71,7 @@
                                             <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="44" id="d8I-aZ-cZc"/>
                                         </constraints>
                                     </button>
-                                    <customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="abd-G5-jAM" customClass="KMMaskView">
+                                    <customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="abd-G5-jAM" customClass="KMMaskView" customModule="PDF_Master" customModuleProvider="target">
                                         <rect key="frame" x="0.0" y="0.0" width="490" height="395"/>
                                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                     </customView>

+ 39 - 54
PDF Office/PDF Master/Class/PDFTools/Watermark/New/View/KMWatermarkView.swift

@@ -448,6 +448,7 @@ class KMWatermarkView: KMBaseXibView, NSTextFieldDelegate, NSComboBoxDelegate, N
     func checkPageRangeValidate(_ pageRangeString: String) -> Bool {
         let fileAttribute = KMFileAttribute()
         fileAttribute.filePath = (self.pdfDocument?.documentURL.path)!
+        fileAttribute.password = self.pdfDocument?.password ?? ""
         fileAttribute.bAllPage = false
         fileAttribute.pagesString = self.pageRangeComboBox.stringValue
         
@@ -742,28 +743,51 @@ extension KMWatermarkView {
     }
     
     @IBAction func buttonClicked_Done(_ sender: Any) {
-        if checkPageRangeValidate(pageRangeComboBox.stringValue) {
-            self.watermark.pagesString = pageRangeComboBox.stringValue
-            updatePDFView()
-        }
+        guard let pdfDocument = pdfDocument else { return }
         
-        if self.watermark.pagesString.count == 0 {
-            let alert = NSAlert()
-            alert.alertStyle = .critical
-            alert.messageText = "\(self.pdfDocument?.documentURL.lastPathComponent) Invalid page range or the page number is out of range. Please try again."
-            alert.runModal()
-            return
-        } else {
-            window?.makeFirstResponder(nil)
+        if self.watermark.imagePath.count == 0 {
+            if self.watermark.text.isEmpty {
+                return
+            }
         }
         
+        if checkPageRangeValidate(pageRangeComboBox.stringValue) {
+            watermark.pagesString = pageRangeComboBox.stringValue
+            self.updatePDFView()
+            window?.makeFirstResponder(self)
+        }
+
         let needSave = saveToTemplateButton.state == .on
-        
-        if self.watermark.imagePath == nil {
-            if self.watermark.text.isEmpty {
+        var pages = [Int]()
+
+        switch pageRangeComboBox.indexOfSelectedItem {
+        case 0:
+            pages = Array(0..<Int(pdfDocument.pageCount))
+        case 1:
+            pages = Array(stride(from: 0, to: Int(pdfDocument.pageCount), by: 2))
+        case 2:
+            pages = Array(stride(from: 1, to: Int(pdfDocument.pageCount), by: 2))
+        default:
+            let fileAttribute = KMFileAttribute()
+            fileAttribute.filePath = pdfDocument.documentURL?.path ?? ""
+            fileAttribute.bAllPage = false
+            fileAttribute.pagesType = .custom
+            fileAttribute.password = pdfDocument.password ?? ""
+            fileAttribute.pagesString = pageRangeComboBox.stringValue
+
+            let selectPages = fileAttribute.fetchSelectPages()
+            if selectPages.count != 0 {
+                pages = selectPages.map { $0 - 1 }
+            } else {
+                let alert = NSAlert()
+                alert.alertStyle = .critical
+                alert.messageText = "\(fileAttribute.filePath.lastPathComponent) \(NSLocalizedString("Invalid page range or the page number is out of range. Please try again.", comment: ""))"
+                alert.runModal()
                 return
             }
         }
+
+        watermark.pagesString = pages.isEmpty ? "" : pages.map { "\($0)" }.joined(separator: ",")
         
         if self.type == .edit || self.type == .add {
             if needSave {
@@ -796,55 +820,16 @@ extension KMWatermarkView {
             
             savePanel.beginSheetModal(for: self.window!) { [unowned self] result in
                 if result == NSApplication.ModalResponse.OK {
-//                    let document = CPDFDocument(url: self.pdfDocument?.documentURL)
-//                    document?.unlock(withPassword: self.pdfDocument?.password)
-                    
                     self.addWatermark(model: self.watermark, toPath: savePanel.url!.path) { success in
                         if success {
                             if savePanelAccessoryViewController.openAutomaticButton.state == .on {
                                 NSDocumentController.shared.openDocument(withContentsOf: savePanel.url!, display: true) { (document, documentWasAlreadyOpen, error) in
-                                    // Handle the completion if needed
                                 }
                             } else {
                                 NSWorkspace.shared.activateFileViewerSelecting([savePanel.url!])
                             }
                         }
                     }
-
-//
-//                    let obj = KMPDFWatermarkObject(pdfDocument: document)
-//                    obj?.addWatermark(self.watermark, toPath: savePanel.url!.path, completionHandler: { (isSuccessfully) in
-//                        DispatchQueue.main.async {
-//                            savePanelAccessoryViewController.release()
-//
-//                            if isSuccessfully {
-//                                if savePanelAccessoryViewController.openAutomaticButton.state == .on {
-//                                    NSDocumentController.shared.openDocument(withContentsOf: savePanel.url!, display: true) { (document, documentWasAlreadyOpen, error) in
-//                                        // Handle the completion if needed
-//                                    }
-//                                } else {
-//                                    NSWorkspace.shared.activateFileViewer(selecting: [savePanel.url!])
-//                                }
-//                            }
-//                        }
-//                    })
-//
-//                    if needSave {
-//                        if self.templateNameTextField.stringValue.isEmpty {
-//                            self.watermark.watermarkID = KMWatermarkManager.defaultManager().fetchAvailableName()
-//                        } else {
-//                            self.watermark.watermarkID = self.templateNameTextField.stringValue
-//                        }
-//
-//                        if KMWatermarkManager.defaultManager.watermarks.contains(self.originalWatermark) {
-//                            KMWatermarkManager.defaultManager.removeWatermark(withData: self.originalWatermark)
-//                            KMWatermarkManager.defaultManager.addWatermark(withData: self.watermark)
-//                        } else {
-//                            KMWatermarkManager.defaultManager.addWatermark(withData: self.watermark)
-//                        }
-//
-//                        NotificationCenter.default.post(name: NSNotification.Name("KMBatchOperateWatermarksNotification"), object: self)
-//                    }
                 }
             }
         }

+ 23 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListView.h

@@ -118,6 +118,24 @@ typedef NS_ENUM(NSUInteger, KMPDFViewActiveFormsType) {
     KMPDFViewActiveFormsType_None
 };
 
+typedef NS_ENUM(NSUInteger, KMPDFViewMode) {
+    KMPDFViewModeNormal = 0,
+    KMPDFViewModeSoft,
+    KMPDFViewModeNight,
+    KMPDFViewModeGreen,
+    KMPDFViewModeThemes1,
+    KMPDFViewModeThemes2,
+    KMPDFViewModeThemes3,
+    KMPDFViewModeThemes4,
+    KMPDFViewModeOther
+};
+
+typedef NS_ENUM(NSInteger, KMPDFViewSplitMode) {
+    KMPDFViewSplitModeDisable = 0,
+    KMPDFViewSplitModeHorizontal,
+    KMPDFViewSplitModeVertical
+};
+
 @protocol CPDFListViewDelegate;
 
 @class CStampSignatureObject,CPDFListStampAnnotation,CPDFListSignatureAnnotation;
@@ -173,6 +191,9 @@ typedef NS_ENUM(NSUInteger, KMPDFViewActiveFormsType) {
 
 @property (nonatomic, assign) BOOL isTakeSnapeSelectConetent;
 
+@property (nonatomic,assign) KMPDFViewMode viewMode;
+@property (nonatomic,assign) KMPDFViewSplitMode viewSplitMode;
+
 - (CPDFAnnotation *)addAnnotationWithType:(CAnnotationType)annotationType selection:(CPDFSelection *)selection page:(CPDFPage *)page bounds:(NSRect)bounds;
 - (void)addAnnotationWithAnnotation:(CPDFAnnotation *)annotation toPage:(CPDFPage *)page;
 
@@ -223,6 +244,8 @@ typedef NS_ENUM(NSUInteger, KMPDFViewActiveFormsType) {
 
 - (void)addImageAnnotation:(NSImage *)image center:(NSPoint)center isRemoveBGColor:(BOOL)isRemoveBGColor;
 
+- (void)setPageBackgroundColorWithColor:(NSColor *)color viewMode:(KMPDFViewMode)viewMode;
+
 @end
 
 @protocol CPDFListViewDelegate <NSObject>

+ 26 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListView.m

@@ -43,6 +43,12 @@ NSNotificationName const CPDFListViewActiveAnnotationsChangeNotification = @"CPD
 
 NSNotificationName const CPDFListViewAnnotationsAttributeHasChangeNotification = @"CPDFListViewAnnotationsAttributeHasChangeNotification";
 
+@interface CPDFListView ()
+
+@property (nonatomic,retain) NSColor *pageBackgroundColor;
+
+@end
+
 @implementation CPDFListView
 
 #pragma mark - Init
@@ -301,6 +307,26 @@ NSNotificationName const CPDFListViewAnnotationsAttributeHasChangeNotification =
     }
 }
 
+- (void)setPageBackgroundColorWithColor:(NSColor *)color viewMode:(KMPDFViewMode)viewMode {
+    if (self.activeAnnotation != nil) {
+        return;
+    }
+    _viewMode = viewMode;
+    self.pageBackgroundColor = color;
+    [self setNeedsDisplay:YES];
+    
+    [[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithInteger:viewMode] forKey:@"kPDFViewModeKey"];
+    [[NSUserDefaults standardUserDefaults] synchronize];
+}
+
+- (void)setViewSplitMode:(KMPDFViewSplitMode)viewSplitMode {
+    if (_viewSplitMode == viewSplitMode) {
+        return;
+    }
+    _viewSplitMode = viewSplitMode;
+    [self setNeedsDisplay:YES];
+}
+
 #pragma mark - menu add image
 - (void)addImageAnnotation:(NSImage *)image center:(NSPoint)center isRemoveBGColor:(BOOL)isRemoveBGColor{
     [self setToolMode:CTextToolMode]; //不支持重复添加,重置状态

File diff suppressed because it is too large
+ 104 - 104
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/LeftSideView.xib


+ 0 - 42
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/ViewPanel/KMPageDisplayThemeCollectionViewItem.swift

@@ -1,42 +0,0 @@
-//
-//  KMPageDisplayThemeCollectionViewItem.swift
-//  PDF Master
-//
-//  Created by lxy on 2023/1/29.
-//
-
-import Cocoa
-typealias KMThemesItemActionCallback = (_ index: Int) -> ()
-class KMPageDisplayThemeCollectionViewItem: NSCollectionViewItem {
-
-    @IBOutlet weak var itemImageView: NSImageView!
-    
-    @IBOutlet weak var itemLabel: NSTextField!
-    
-    @IBOutlet weak var themesBox: KMBox!
-    @IBOutlet weak var vipImageView: NSImageView!
-    @IBOutlet weak var closeButton: NSButton!
-    var itemCallBack : KMThemesItemActionCallback!
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        self.closeButton.isHidden = true
-        self.itemImageView.wantsLayer = true
-        self.itemImageView.layer?.cornerRadius = 10
-        self.itemImageView.layer?.masksToBounds = true
-        self.itemImageView.layer?.borderWidth = 0.5
-        self.itemImageView.layer?.borderColor = NSColor.gridColor.cgColor
-    }
-    
-    private func swatchWithColor(color:NSColor,size:NSSize) -> NSImage {
-        let image = NSImage(size: size)
-        image.lockFocus()
-        color.drawSwatch(in: NSRect(x: 0, y: 0, width: size.width, height: size.height))
-        image.unlockFocus()
-        return image
-    }
-    
-    func themesCollectionCellItem(item:NSInteger,itemData:[Any]) {
-        
-    }
-    
-}

+ 7 - 1
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMAnnotationPropertiesViewController.h

@@ -18,7 +18,9 @@ typedef NS_ENUM(NSInteger, KMOpenPropertiesType) {
     KMOpenPropertiesType_Button
 };
 
-@class KMMainWindowController;
+@class KMMainViewController;
+
+typedef void(^PageDisplayReaderMode)(BOOL isReaderMode);
 
 @interface KMAnnotationPropertiesViewController : NSViewController
 
@@ -34,6 +36,10 @@ typedef NS_ENUM(NSInteger, KMOpenPropertiesType) {
 
 @property (nonatomic, assign) KMOpenPropertiesType openPropertiesType;
 
+@property (nonatomic, copy) PageDisplayReaderMode pageDisplayReaderMode;
+
+@property (nonatomic, assign) IBOutlet KMMainViewController *mainController;
+
 + (CGFloat)heightWithAnnotation:(CPDFAnnotation *)annotation;
 + (CGFloat)heightWithAnnotationMode:(CAnnotationType)annotationMode;
 

+ 16 - 1
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMAnnotationPropertiesViewController.m

@@ -505,8 +505,23 @@
 
 - (void)setOpenPropertiesType:(KMOpenPropertiesType)openPropertiesType {
     _openPropertiesType = openPropertiesType;
-    CPDFAnnotationModel * annotationModel = [[CPDFAnnotationModel alloc] initWithPDFAnnotations:_pdfView.activeAnnotations];
     if (openPropertiesType == KMOpenPropertiesType_PageDisplay) {
+        if (self.contentViewController) {
+           [self.contentViewController.view removeFromSuperview];
+           self.contentViewController = nil;
+        }
+        self.titleLabel.stringValue = NSLocalizedString(@"View Settings", nil);
+        KMPageDisplayPropertiesViewController *vc = [[KMPageDisplayPropertiesViewController alloc] init];
+        vc.mainController = self.mainController;
+        vc.pdfView = self.pdfView;
+        __block typeof(self) blockSelf = self;
+        vc.readerModeBlock = ^(BOOL isReaderMode) {
+            if (blockSelf.pageDisplayReaderMode) {
+                blockSelf.pageDisplayReaderMode(isReaderMode);
+            }
+        };
+        self.propertiesBox.contentView = vc.view;
+        self.contentViewController = vc;
     } else if (openPropertiesType == KMOpenPropertiesType_Stamp) {
         self.titleLabel.stringValue = NSLocalizedString(@"Stamp", nil);
     } else if (openPropertiesType == KMOpenPropertiesType_Link) {

+ 123 - 0
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/ViewController/PageDisplay/KMPageDisplayCustomThemesCollectionViewItem.swift

@@ -0,0 +1,123 @@
+//
+//  KMPageDisplayCustomThemesCollectionViewItem.swift
+//  PDF Master
+//
+//  Created by wanjun on 2024/1/4.
+//
+
+import Cocoa
+
+class KMThemesBox: NSBox {
+    var mouseDownCallback: ((Bool) -> Void)?
+    
+    override func draw(_ dirtyRect: NSRect) {
+        wantsLayer = true
+        borderWidth = 0.0
+        layer?.backgroundColor = NSColor.clear.cgColor
+        
+        let path = NSBezierPath(roundedRect: layer!.frame, xRadius: 6.0, yRadius: 6.0)
+        let dashPattern: [CGFloat] = [5.0, 5.0]
+        path.lineCapStyle = .square
+        path.setLineDash(dashPattern, count: dashPattern.count, phase: 0.0)
+        path.lineWidth = 1.0
+        KMAppearance.Interactive.s0Color().set()
+        path.stroke()
+    }
+    
+    override func viewDidMoveToWindow() {
+        super.viewDidMoveToWindow()
+        if window != nil {
+            addTrackingRect(bounds, owner: self, userData: nil, assumeInside: false)
+        }
+    }
+    
+    override func setFrameSize(_ newSize: NSSize) {
+        super.setFrameSize(newSize)
+        addTrackingRect(NSMakeRect(0, 0, newSize.width, newSize.height), owner: self, userData: nil, assumeInside: false)
+    }
+    
+    override func mouseDown(with event: NSEvent) {
+        super.mouseDown(with: event)
+        
+        if let mouseDownCallback = mouseDownCallback {
+            mouseDownCallback(true)
+        }
+    }
+    
+    override func mouseUp(with event: NSEvent) {
+        super.mouseUp(with: event)
+        
+        if let mouseDownCallback = mouseDownCallback {
+            mouseDownCallback(false)
+        }
+    }
+}
+
+class KMPageDisplayCustomThemesCollectionViewItem: NSCollectionViewItem {
+    
+    @IBOutlet weak var itemImageView: NSImageView!
+    @IBOutlet weak var itemLabel: NSTextField!
+    @IBOutlet weak var themesBox: KMThemesBox!
+    @IBOutlet weak var vipImageView: NSImageView!
+    
+    var customItemActionCallback: ((Int, NSColor, Bool) -> Void)?
+    
+    private var itemCount: Int = 0
+    
+    deinit {
+        NSColorPanel.shared.setTarget(nil)
+        NSColorPanel.shared.setAction(nil)
+        NotificationCenter.default.removeObserver(self)
+    }
+
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        // Do view setup here.
+        
+        itemImageView.wantsLayer = true
+        itemImageView.layer?.cornerRadius = 10.0
+        itemLabel.textColor = KMAppearance.Layout.h0Color()
+        itemLabel.stringValue = NSLocalizedString("Custom", comment: "")
+        itemImageView.image = NSImage(named: KMImageNameUXIconBtnAddNor)
+        vipImageView.isHidden = true
+    }
+
+    func themesCustomCollectionCellItem(_ item: Int) {
+        itemCount = item
+        themesBox.mouseDownCallback = { [weak self] downEntered in
+            if downEntered {
+//                if !IAPProductsManager.defaultManager.isAvailableAllFunction {
+//                    KMPurchaseCompareWindowController.sharedInstance.showWindow(nil)
+//                    return
+//                }
+                
+                self!.themesBox.fillColor = KMAppearance.Layout.l_1Color()
+                self!.itemImageView.image = NSImage(named: KMImageNameUXIconBtnAddHov)
+                NSColorPanel.shared.setTarget(self)
+                NSColorPanel.shared.setAction(#selector(self!.colorPanelAction(_:)))
+                NSColorPanel.shared.orderFront(nil)
+                if let callback = self!.customItemActionCallback {
+                    callback(self!.itemCount, NSColorPanel.shared.color, false)
+                }
+                NotificationCenter.default.addObserver(self!, selector: #selector(self!.windowWillCloseNotifiaction(_:)), name: NSWindow.willCloseNotification, object: NSColorPanel.shared)
+                self!.themesBox.fillColor = NSColor.clear
+                self!.itemImageView.image = NSImage(named: KMImageNameUXIconBtnAddNor)
+            }
+        }
+    }
+
+    @objc func colorPanelAction(_ colorPanel: NSColorPanel) {
+        let color = colorPanel.color.usingColorSpaceName(.calibratedRGB) ?? .clear
+        
+        if let callback = customItemActionCallback {
+            callback(itemCount, color, true)
+        }
+    }
+
+    
+    // MARK: NSNotification Action
+    
+    @objc private func windowWillCloseNotifiaction(_ sender: Notification) {
+        
+    }
+}

+ 82 - 0
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/ViewController/PageDisplay/KMPageDisplayCustomThemesCollectionViewItem.xib

@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22154" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22154"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner" customClass="KMPageDisplayCustomThemesCollectionViewItem">
+            <connections>
+                <outlet property="itemImageView" destination="eAo-yg-ahb" id="ArE-XK-kaA"/>
+                <outlet property="itemLabel" destination="LOe-R1-paM" id="RVn-yq-ZVd"/>
+                <outlet property="themesBox" destination="Arc-B8-K9d" id="maV-uT-OpY"/>
+                <outlet property="view" destination="CMj-RP-q0T" id="LNE-qF-zYU"/>
+                <outlet property="vipImageView" destination="mwp-6e-P5Y" id="KMb-ye-81V"/>
+            </connections>
+        </customObject>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <customView identifier="KMPageDisplayCustomThemesCollectionViewItem" misplaced="YES" id="CMj-RP-q0T">
+            <rect key="frame" x="0.0" y="0.0" width="58" height="64"/>
+            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+            <subviews>
+                <box misplaced="YES" boxType="custom" borderWidth="0.0" cornerRadius="6" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="Arc-B8-K9d" customClass="KMThemesBox" customModule="PDF_Master" customModuleProvider="target">
+                    <rect key="frame" x="0.0" y="6" width="58" height="64"/>
+                    <view key="contentView" id="xu5-Vf-7O3">
+                        <rect key="frame" x="0.0" y="0.0" width="58" height="64"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <subviews>
+                            <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="eAo-yg-ahb">
+                                <rect key="frame" x="19" y="26" width="20" height="20"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="20" id="kjQ-qk-xMd"/>
+                                    <constraint firstAttribute="height" constant="20" id="th0-fS-20r"/>
+                                </constraints>
+                                <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" id="wbz-Ji-gpI"/>
+                            </imageView>
+                            <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="LOe-R1-paM">
+                                <rect key="frame" x="13" y="6" width="33" height="14"/>
+                                <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="cO7-IJ-37O">
+                                    <font key="font" metaFont="smallSystem"/>
+                                    <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                    <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                </textFieldCell>
+                            </textField>
+                            <imageView hidden="YES" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="mwp-6e-P5Y">
+                                <rect key="frame" x="38" y="38" width="20" height="20"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="20" id="8rf-xn-ayL"/>
+                                    <constraint firstAttribute="height" constant="20" id="n2Y-wT-8U8"/>
+                                </constraints>
+                                <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="KMImageNameUXIconVip" id="vwt-lT-NPA"/>
+                            </imageView>
+                        </subviews>
+                        <constraints>
+                            <constraint firstItem="LOe-R1-paM" firstAttribute="top" secondItem="eAo-yg-ahb" secondAttribute="bottom" constant="6" id="K0r-CH-759"/>
+                            <constraint firstItem="mwp-6e-P5Y" firstAttribute="top" secondItem="xu5-Vf-7O3" secondAttribute="top" id="U3f-R4-TTn"/>
+                            <constraint firstItem="eAo-yg-ahb" firstAttribute="top" secondItem="xu5-Vf-7O3" secondAttribute="top" constant="12" id="e9W-yP-fqA"/>
+                            <constraint firstAttribute="bottom" secondItem="LOe-R1-paM" secondAttribute="bottom" constant="6" id="i23-fI-OuE"/>
+                            <constraint firstAttribute="trailing" secondItem="mwp-6e-P5Y" secondAttribute="trailing" id="ifB-Zg-JvG"/>
+                        </constraints>
+                    </view>
+                    <constraints>
+                        <constraint firstItem="LOe-R1-paM" firstAttribute="centerX" secondItem="Arc-B8-K9d" secondAttribute="centerX" id="1W4-14-s4K"/>
+                        <constraint firstItem="eAo-yg-ahb" firstAttribute="centerX" secondItem="Arc-B8-K9d" secondAttribute="centerX" id="Znr-QA-Vs8"/>
+                    </constraints>
+                    <color key="fillColor" white="1" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                </box>
+            </subviews>
+            <constraints>
+                <constraint firstAttribute="bottom" secondItem="Arc-B8-K9d" secondAttribute="bottom" id="59w-PK-2yv"/>
+                <constraint firstAttribute="trailing" secondItem="Arc-B8-K9d" secondAttribute="trailing" id="DFE-mp-uD8"/>
+                <constraint firstItem="Arc-B8-K9d" firstAttribute="leading" secondItem="CMj-RP-q0T" secondAttribute="leading" id="JIl-Zs-z6U"/>
+                <constraint firstItem="Arc-B8-K9d" firstAttribute="top" secondItem="CMj-RP-q0T" secondAttribute="top" id="spG-vV-Pda"/>
+            </constraints>
+            <point key="canvasLocation" x="-223" y="255"/>
+        </customView>
+    </objects>
+    <resources>
+        <image name="KMImageNameUXIconVip" width="20" height="20"/>
+    </resources>
+</document>

+ 722 - 0
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/ViewController/PageDisplay/KMPageDisplayPropertiesViewController.swift

@@ -0,0 +1,722 @@
+//
+//  KMPageDisplayPropertiesViewController.swift
+//  PDF Master
+//
+//  Created by wanjun on 2024/1/1.
+//
+
+import Cocoa
+
+typealias ReaderModeCallBack = (Bool) -> Void
+
+private enum KMDisplayModeType: UInt {
+    case singlePage = 0
+    case twoPages
+    case coverPage
+    case readMode
+}
+
+private enum KMSplitViewType: UInt {
+    case singleScreen = 0
+    case verticalScreen
+    case horizontalScreen
+}
+
+class KMPageDisplayPropertiesButton: NSButton {
+    var buttonBorderColor: NSColor?
+    var buttonLayerRadius: CGFloat = 0.0
+    
+    deinit {
+        buttonBorderColor = nil
+    }
+    
+    override init(frame frameRect: NSRect) {
+        super.init(frame: frameRect)
+        wantsLayer = true
+        layer?.cornerRadius = 6.0
+    }
+    
+    required init?(coder: NSCoder) {
+        super.init(coder: coder)
+        wantsLayer = true
+        layer?.cornerRadius = 6.0
+    }
+    
+    override func draw(_ dirtyRect: NSRect) {
+        super.draw(dirtyRect)
+        // Custom drawing code here
+    }
+}
+
+@objcMembers class KMPageDisplayPropertiesViewController: NSViewController {
+    
+    @IBOutlet weak var pdfView: CPDFListView!
+    var readerModeBlock: ReaderModeCallBack?
+    @IBOutlet weak var mainController: KMMainViewController!
+    
+    @IBOutlet private var pageLayoutLabel: NSTextField!
+    @IBOutlet private var singlePageButton: KMPageDisplayPropertiesButton!
+    @IBOutlet private var twoPagesButton: KMPageDisplayPropertiesButton!
+    @IBOutlet private var coverPageButton: KMPageDisplayPropertiesButton!
+    @IBOutlet private var readModeButton: KMPageDisplayPropertiesButton!
+    @IBOutlet private var continuousScrollButton: NSButton!
+    @IBOutlet private var pageBreaksButton: NSButton!
+    @IBOutlet private var pageDisplayHeightConstraint: NSLayoutConstraint!
+
+    // Split View Properties
+    @IBOutlet private var splitViewLabel: NSTextField!
+    @IBOutlet private var singleScreenButton: KMPageDisplayPropertiesButton!
+    @IBOutlet private var verticalScreenButton: KMPageDisplayPropertiesButton!
+    @IBOutlet private var horizontalScreenButton: KMPageDisplayPropertiesButton!
+    @IBOutlet private var replaceViewTopConstraint: NSLayoutConstraint!
+    @IBOutlet private var replaceView: NSView!
+    @IBOutlet private var replaceFileNameLabel: NSTextField!
+    @IBOutlet private var replaceFileButton: NSButton!
+    @IBOutlet private var buttonHeightConstraint2: NSLayoutConstraint!
+
+    // Rotation Properties
+    @IBOutlet private var rotationLabel: NSTextField!
+    @IBOutlet private var clockwiseRotationBox: KMBox!
+    @IBOutlet private var clockwiseRotationImageView: NSImageView!
+    @IBOutlet private var counterclockwiseRotationBox: KMBox!
+    @IBOutlet private var counterclockwiseRotationImageView: NSImageView!
+
+    // Theme Properties
+    @IBOutlet private var themeLabel: NSTextField!
+    @IBOutlet private var themeCollectionView: NSCollectionView!
+    @IBOutlet private var themeScrollView: NSScrollView!
+    @IBOutlet private var collectionLayoutCollection: NSLayoutConstraint!
+
+    // Other Properties
+    private var displayMode: KMDisplayModeType = .singlePage
+    private var isReaderMode: Bool = false
+    private var isContinuPage: Bool = false
+    private var splitViewType: KMSplitViewType = .singleScreen
+    private var themesArray: [NSColor] = []
+    private var clickInteger: Int = 0
+    private var displayType: KMPDFDisplayType = .singlePage
+    
+    // MARK: - Init Method
+
+    deinit {
+        NotificationCenter.default.removeObserver(self)
+        themeCollectionView.delegate = nil
+        themeCollectionView.dataSource = nil
+//        let keys = ["displaysAsBook", "displayMode"]
+//        for key in keys {
+//            pdfView.removeObserver(self, forKeyPath: key)
+//        }
+    }
+    
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        // Do view setup here.
+        
+        themeCollectionView.register(KMPageDisplayThemeCollectionViewItem.self, forItemWithIdentifier: NSUserInterfaceItemIdentifier(rawValue: "KMPageDisplayThemeCollectionViewItem"))
+        themeCollectionView.register(KMPageDisplayCustomThemesCollectionViewItem.self, forItemWithIdentifier: NSUserInterfaceItemIdentifier(rawValue: "KMPageDisplayCustomThemesCollectionViewItem"))
+
+        pageLayoutLabel.stringValue = NSLocalizedString("Display Mode", comment: "")
+        pageLayoutLabel.textColor = KMAppearance.Layout.h0Color()
+        singlePageButton.title = NSLocalizedString("Single Page", comment: "Menu item title")
+        singlePageButton.toolTip = NSLocalizedString("Single Page", comment: "Menu item title")
+        singlePageButton.image = NSImage(named: KMImageNameUXIconPropertybarViewPagesingleNor)
+        singlePageButton.wantsLayer = true
+        twoPagesButton.title = NSLocalizedString("Two Pages", comment: "Menu item title")
+        twoPagesButton.toolTip = NSLocalizedString("Two Pages", comment: "Menu item title")
+        twoPagesButton.image = NSImage(named: KMImageNameUXIconPropertybarViewPagedoubleNor)
+        twoPagesButton.wantsLayer = true
+        coverPageButton.title = NSLocalizedString("Book Mode", comment: "")
+        coverPageButton.toolTip = NSLocalizedString("Book Mode", comment: "")
+        coverPageButton.image = NSImage(named: KMImageNameUXIconPropertybarViewPagecoverNor)
+        coverPageButton.wantsLayer = true
+        readModeButton.title = NSLocalizedString("Read Mode", comment: "Menu item title")
+        readModeButton.toolTip = NSLocalizedString("Read Mode", comment: "Menu item title")
+        readModeButton.image = NSImage(named: KMImageNameUXIconPropertybarViewPagereadingNor)
+        readModeButton.wantsLayer = true
+        continuousScrollButton.title = NSLocalizedString("Continuous Scroll", comment: "")
+        pageBreaksButton.title = NSLocalizedString("Page Breaks", comment: "")
+
+        splitViewLabel.stringValue = NSLocalizedString("Split View", comment: "")
+        splitViewLabel.textColor = KMAppearance.Layout.h0Color()
+        singleScreenButton.title = NSLocalizedString("Single", comment: "")
+        singleScreenButton.toolTip = NSLocalizedString("Single", comment: "")
+        singleScreenButton.image = NSImage(named: KMImageNameUXIconPropertybarViewSplitscreensingleNor)
+        singleScreenButton.wantsLayer = true
+        verticalScreenButton.title = NSLocalizedString("Vertical", comment: "")
+        verticalScreenButton.toolTip = NSLocalizedString("Vertical", comment: "")
+        verticalScreenButton.image = NSImage(named: KMImageNameUXIconPropertybarViewSplitscreenverNor)
+        verticalScreenButton.wantsLayer = true
+        horizontalScreenButton.title = NSLocalizedString("Horizontal", comment: "")
+        horizontalScreenButton.toolTip = NSLocalizedString("Horizontal", comment: "")
+        horizontalScreenButton.image = NSImage(named: KMImageNameUXIconPropertybarViewSplitscreenhorNor)
+        horizontalScreenButton.wantsLayer = true
+
+        if let documentPath = self.mainController.secondaryPdfView.document?.documentURL?.path {
+            replaceView.isHidden = false
+        } else {
+            replaceView.isHidden = true
+        }
+
+        replaceFileButton.wantsLayer = true
+        replaceFileButton.layer?.cornerRadius = 4.0
+        replaceFileButton.layer?.backgroundColor = KMAppearance.Interactive.a0Color().cgColor
+        reloadReplaceView()
+        
+//        self.mainController.secondaryFileUrlBlock = { [weak self] in
+//            guard let self = self else { return }
+//            self.replaceView.isHidden = false
+//            self.reloadReplaceView()
+//            self.replaceFileButton.titleColor = KMAppearance.Layout.w0Color()
+//            self.replaceViewTopConstraint.constant = self.replaceView.isHidden ? -self.replaceView.bounds.height : 10.0
+//        }
+
+        replaceFileNameLabel.cell?.lineBreakMode = .byTruncatingMiddle
+        replaceFileNameLabel.cell?.truncatesLastVisibleLine = true
+
+        rotationLabel.stringValue = NSLocalizedString("Rotate", comment: "")
+        rotationLabel.textColor = KMAppearance.Layout.h0Color()
+
+        counterclockwiseRotationBox.borderColor = KMAppearance.Interactive.s0Color()
+        counterclockwiseRotationBox.borderWidth = 1.0
+        counterclockwiseRotationBox.fillColor = KMAppearance.Layout.l1Color()
+        counterclockwiseRotationBox.cornerRadius = 1.0
+        counterclockwiseRotationBox.toolTip = NSLocalizedString("Rotate Left", comment: "")
+        counterclockwiseRotationImageView.image = NSImage(named: KMImageNameUXIconPropertybarRotateCounterclockwiseNor)
+
+        counterclockwiseRotationBox.downCallback = { [weak self] downEntered, mouseBox, event in
+            guard let self = self else { return }
+            if downEntered {
+                counterclockwiseRotationBox.fillColor = KMAppearance.Status.selColor()
+                counterclockwiseRotationImageView.image = NSImage(named: KMImageNameUXIconPropertybarRotateCounterclockwisePre)
+                mainController.menuItemAction_rotateLeft((Any).self)
+            } else {
+                self.counterclockwiseRotationBox.fillColor = KMAppearance.Layout.l1Color()
+                self.counterclockwiseRotationImageView.image = NSImage(named: KMImageNameUXIconPropertybarRotateCounterclockwiseNor)
+            }
+        }
+
+        clockwiseRotationBox.borderColor = KMAppearance.Interactive.s0Color()
+        clockwiseRotationBox.borderWidth = 1.0
+        clockwiseRotationBox.fillColor = KMAppearance.Layout.l1Color()
+        clockwiseRotationBox.cornerRadius = 1.0
+        clockwiseRotationBox.toolTip = NSLocalizedString("Rotate Right", comment: "")
+        clockwiseRotationImageView.image = NSImage(named: KMImageNameUXIconPropertybarRotateClockwiseNor)
+
+        clockwiseRotationBox.downCallback = { [weak self] downEntered, mouseBox, event in
+            guard let self = self else { return }
+            if downEntered {
+                clockwiseRotationBox.fillColor = KMAppearance.Status.selColor()
+                clockwiseRotationImageView.image = NSImage(named: KMImageNameUXIconPropertybarRotateClockwisePre)
+                mainController.menuItemAction_rotateRight((Any).self)
+            } else {
+                clockwiseRotationBox.fillColor = KMAppearance.Layout.l1Color()
+                clockwiseRotationImageView.image = NSImage(named: KMImageNameUXIconPropertybarRotateClockwiseNor)
+            }
+        }
+        
+        themeLabel.stringValue = NSLocalizedString("Themes", comment: "")
+        themeLabel.textColor = KMAppearance.Layout.h0Color()
+
+        let buttonArr: [NSButton] = [singlePageButton, twoPagesButton, coverPageButton, readModeButton, continuousScrollButton, singleScreenButton, verticalScreenButton, horizontalScreenButton]
+
+        for button in buttonArr {
+            if let attrTitle = button.attributedTitle.mutableCopy() as? NSMutableAttributedString {
+                let len = attrTitle.length
+                let range = NSRange(location: 0, length: len)
+                attrTitle.addAttribute(NSAttributedString.Key.foregroundColor, value: KMAppearance.Layout.h0Color(), range: range)
+                attrTitle.fixAttributes(in: range)
+                button.attributedTitle = attrTitle
+            }
+        }
+
+        var data: Data? = nil
+        if let themesData = UserDefaults.standard.object(forKey: "kKMPDFViewModeThemesArray") as? Data {
+            data = themesData
+        }
+
+        let appArray = NSKeyedUnarchiver.unarchiveObject(with: data ?? Data()) as? [Any] ?? []
+        var mutableArray = appArray
+        if mutableArray.count > 0 {
+            themesArray = mutableArray as! [NSColor]
+        } else {
+            let normalColor = NSColor.white
+            let softColor = NSColor(deviceRed: 238.0/255.0, green: 232.0/255.0, blue: 216.0/255.0, alpha: 1.0)
+            let nightColor = NSColor.black
+            let greenColor = NSColor(deviceRed: 153.0/255.0, green: 207.0/255.0, blue: 161.0/255.0, alpha: 1.0)
+            themesArray = [normalColor, softColor, nightColor, greenColor]
+        }
+        
+        themeScrollView.backgroundColor = .clear
+        themeCollectionView.delegate = self
+        themeCollectionView.dataSource = self
+        reloadData()
+
+        NotificationCenter.default.addObserver(self, selector: #selector(viewModeChangNotification(_:)), name: NSNotification.Name("KMPDFViewModeChangeNotification"), object: nil)
+
+        let languages = NSLocale.preferredLanguages
+        var currentLocaleLanguageCode = "en"
+        if languages.count > 0 {
+            currentLocaleLanguageCode = languages[0]
+            if currentLocaleLanguageCode.hasPrefix("zh") {
+                currentLocaleLanguageCode = "zh"
+            }
+        }
+
+        let buttonArray1: [NSButton] = [singlePageButton, twoPagesButton, coverPageButton, readModeButton]
+        for button in buttonArray1 {
+            button.wantsLayer = true
+            button.layer?.cornerRadius = 6.0
+            if currentLocaleLanguageCode == "zh" {
+                pageDisplayHeightConstraint.constant = 56.0
+                button.imagePosition = .imageAbove
+            } else {
+                pageDisplayHeightConstraint.constant = singlePageButton.bounds.width
+                button.imagePosition = .imageOnly
+            }
+        }
+
+        let buttonArray2: [NSButton] = [singleScreenButton, verticalScreenButton, horizontalScreenButton]
+        for button in buttonArray2 {
+            button.wantsLayer = true
+            button.layer?.cornerRadius = 6.0
+            if currentLocaleLanguageCode == "zh" {
+                pageDisplayHeightConstraint.constant = 56.0
+                button.imagePosition = .imageAbove
+            } else {
+                pageDisplayHeightConstraint.constant = singleScreenButton.bounds.width
+                button.imagePosition = .imageOnly
+            }
+        }
+
+        replaceFileButton?.setTitleColor(KMAppearance.Layout.w0Color())
+        
+        replaceViewTopConstraint.constant = replaceView.isHidden ? -replaceView.bounds.height : 10.0
+
+        NotificationCenter.default.addObserver(self, selector: #selector(removeSecondaryPdfContentView(_:)), name: NSNotification.Name("KMSplitSinglePageNotification"), object: nil)
+    }
+    
+    private func reloadReplaceView() {
+        if let documentPath = mainController.secondaryPdfView.document?.documentURL?.path {
+            replaceFileButton.title = NSLocalizedString("Replace File", comment: "")
+            replaceFileButton.toolTip = NSLocalizedString("Replace File", comment: "")
+            replaceFileNameLabel.attributedStringValue = replaceFileName(withFilePath: (documentPath as NSString).lastPathComponent)
+            replaceFileNameLabel.isHidden = false
+        } else {
+            replaceFileButton.title = NSLocalizedString("Select File", comment: "")
+            replaceFileButton.toolTip = NSLocalizedString("Select File", comment: "")
+            replaceFileNameLabel.attributedStringValue = replaceFileName(withFilePath: "")
+            replaceFileNameLabel.isHidden = true
+        }
+    }
+
+    private func reloadData() {
+        let pdf: CPDFView = CPDFView()
+        if displayType == .singlePage {
+            setDisplayMode(.singlePage)
+            continuousScrollButton.state = .off
+        } else if displayType == .singlePageContinuous {
+            setDisplayMode(.singlePage)
+            continuousScrollButton.state = .on
+            isContinuPage = true
+        } else if displayType == .twoUp {
+            if pdfView.displaysAsBook {
+                setDisplayMode(.coverPage)
+            } else {
+                setDisplayMode(.twoPages)
+            }
+            continuousScrollButton.state = .off
+        } else if displayType == .twoUpContinuous {
+            if pdfView.displaysAsBook {
+                setDisplayMode(.coverPage)
+            } else {
+                setDisplayMode(.twoPages)
+            }
+            continuousScrollButton.state = .on
+            isContinuPage = true
+        }
+        
+        isReaderMode = UserDefaults.standard.bool(forKey: "kKMPDFViewIsReadMode")
+        if isReaderMode {
+            setDisplayMode(.readMode)
+        }
+        
+        if pdfView.displaysPageBreaks {
+            pageBreaksButton.state = .on
+        } else {
+            pageBreaksButton.state = .off
+        }
+        
+        if !(mainController.secondaryPdfView.window != nil) {
+            setSplitViewType(.singleScreen)
+        } else {
+            if mainController.pdfSplitView.isVertical {
+                setSplitViewType(.verticalScreen)
+            } else {
+                setSplitViewType(.horizontalScreen)
+            }
+        }
+        
+        themeCollectionView.reloadData()
+    }
+    
+//    private func setPdfView(_ pdfView: SKPDFView) {
+//        if _pdfView !== pdfView {
+//            let keys = ["displaysAsBook", "displayMode"]
+//            
+//            for key in keys {
+//                _pdfView?.removeObserver(self, forKeyPath: key)
+//            }
+//            
+//            _pdfView?.release()
+//            _pdfView = pdfView
+//            _pdfView?.retain()
+//            
+//            for key in keys {
+//                _pdfView?.addObserver(self, forKeyPath: key, options: [.new, .old], context: nil)
+//            }
+//        }
+//    }
+    
+    // MARK: - Private
+
+    private func setDisplayMode(_ displayMode: KMDisplayModeType) {
+        self.displayMode = displayMode
+        switch displayMode {
+        case .singlePage:
+            singlePageButton.image = NSImage(named: KMImageNameUXIconPropertybarViewPagesingleSel)
+            singlePageButton.layer?.backgroundColor = KMAppearance.Status.selColor().cgColor
+            
+            twoPagesButton.image = NSImage(named: KMImageNameUXIconPropertybarViewPagedoubleNor)
+            twoPagesButton.layer?.backgroundColor = NSColor.clear.cgColor
+            
+            coverPageButton.image = NSImage(named: KMImageNameUXIconPropertybarViewPagecoverNor)
+            coverPageButton.layer?.backgroundColor = NSColor.clear.cgColor
+        case .twoPages:
+            twoPagesButton.image = NSImage(named: KMImageNameUXIconPropertybarViewPagedoubleSel)
+            twoPagesButton.layer?.backgroundColor = KMAppearance.Status.selColor().cgColor
+            
+            singlePageButton.image = NSImage(named: KMImageNameUXIconPropertybarViewPagesingleNor)
+            singlePageButton.layer?.backgroundColor = NSColor.clear.cgColor
+            
+            coverPageButton.image = NSImage(named: KMImageNameUXIconPropertybarViewPagecoverNor)
+            coverPageButton.layer?.backgroundColor = NSColor.clear.cgColor
+        case .coverPage:
+            coverPageButton.image = NSImage(named: KMImageNameUXIconPropertybarViewPagecoverSel)
+            coverPageButton.layer?.backgroundColor = KMAppearance.Status.selColor().cgColor
+            
+            singlePageButton.image = NSImage(named: KMImageNameUXIconPropertybarViewPagesingleNor)
+            singlePageButton.layer?.backgroundColor = NSColor.clear.cgColor
+            
+            twoPagesButton.image = NSImage(named: KMImageNameUXIconPropertybarViewPagedoubleNor)
+            twoPagesButton.layer?.backgroundColor = NSColor.clear.cgColor
+        case .readMode:
+            self.isReaderMode = !self.isReaderMode
+            if self.isReaderMode {
+                readModeButton.image = NSImage(named: KMImageNameUXIconPropertybarViewPagereadingSel)
+                readModeButton.layer?.backgroundColor = KMAppearance.Status.selColor().cgColor
+            } else {
+                readModeButton.image = NSImage(named: KMImageNameUXIconPropertybarViewPagereadingNor)
+                readModeButton.layer?.backgroundColor = NSColor.clear.cgColor
+            }
+        default:
+            break
+        }
+    }
+    
+    private func setSplitViewType(_ splitViewType: KMSplitViewType) {
+        self.splitViewType = splitViewType
+        switch splitViewType {
+        case .singleScreen:
+            singleScreenButton.image = NSImage(named: KMImageNameUXIconPropertybarViewSplitscreensingleSel)
+            singleScreenButton.layer?.backgroundColor = KMAppearance.Status.selColor().cgColor
+
+            verticalScreenButton.image = NSImage(named: KMImageNameUXIconPropertybarViewSplitscreenverNor)
+            verticalScreenButton.layer?.backgroundColor = NSColor.clear.cgColor
+
+            horizontalScreenButton.image = NSImage(named: KMImageNameUXIconPropertybarViewSplitscreenhorNor)
+            horizontalScreenButton.layer?.backgroundColor = NSColor.clear.cgColor
+        case .verticalScreen:
+            verticalScreenButton.image = NSImage(named: KMImageNameUXIconPropertybarViewSplitscreenverSel)
+            verticalScreenButton.layer?.backgroundColor = KMAppearance.Status.selColor().cgColor
+
+            singleScreenButton.image = NSImage(named: KMImageNameUXIconPropertybarViewSplitscreensingleNor)
+            singleScreenButton.layer?.backgroundColor = NSColor.clear.cgColor
+
+            horizontalScreenButton.image = NSImage(named: KMImageNameUXIconPropertybarViewSplitscreenhorNor)
+            horizontalScreenButton.layer?.backgroundColor = NSColor.clear.cgColor
+        case .horizontalScreen:
+            horizontalScreenButton.image = NSImage(named: KMImageNameUXIconPropertybarViewSplitscreenhorSel)
+            horizontalScreenButton.layer?.backgroundColor = KMAppearance.Status.selColor().cgColor
+
+            verticalScreenButton.image = NSImage(named: KMImageNameUXIconPropertybarViewSplitscreenverNor)
+            verticalScreenButton.layer?.backgroundColor = NSColor.clear.cgColor
+
+            singleScreenButton.image = NSImage(named: KMImageNameUXIconPropertybarViewSplitscreensingleNor)
+            singleScreenButton.layer?.backgroundColor = NSColor.clear.cgColor
+        default:
+            break
+        }
+    }
+    
+    private func replaceFileName(withFilePath filePath: String) -> NSMutableAttributedString {
+        let string = "· \(filePath)"
+        let attrStr = NSMutableAttributedString(string: string)
+        
+        attrStr.addAttribute(.foregroundColor, value: KMAppearance.Interactive.a0Color(), range: NSRange(location: 0, length: 1))
+        attrStr.addAttribute(.font, value: NSFont.boldSystemFont(ofSize: 20), range: NSRange(location: 0, length: 1))
+        attrStr.addAttribute(.baselineOffset, value: 3, range: NSRange(location: 1, length: string.count - 1))
+        
+        return attrStr
+    }
+    
+    // MARK: UI Action
+    
+    @IBAction private func displayModeButtonAction(_ sender: KMPageDisplayPropertiesButton) {
+        switch sender.tag {
+        case 0:
+            setDisplayMode(.singlePage)
+            mainController.selectDisplay(display: isContinuPage ? .singlePageContinuous : .singlePage, viewSettingIsReload: false)
+        case 1:
+            setDisplayMode(.twoPages)
+            mainController.selectDisplay(display: isContinuPage ? .twoUpContinuous : .twoUp, viewSettingIsReload: false)
+        case 2:
+            setDisplayMode(.coverPage)
+            mainController.selectDisplay(display: isContinuPage ? .bookContinuous : .bookMode, viewSettingIsReload: false)
+        case 3:
+//            readerModeBlock?(isReaderMode)
+            mainController.selectDisplay(display: isContinuPage ? .readContinuous : .readModel, viewSettingIsReload: false)
+        default:
+            break
+        }
+    }
+    
+    @IBAction private func continuousScrollButtonAction(_ sender: NSButton) {
+        isContinuPage = !isContinuPage
+
+        if isContinuPage {
+            if displayMode == KMDisplayModeType.singlePage {
+                mainController.selectDisplay(display: .singlePageContinuous, viewSettingIsReload: false)
+            } else {
+                mainController.selectDisplay(display: .twoUpContinuous, viewSettingIsReload: false)
+            }
+        } else {
+            if displayMode == KMDisplayModeType.singlePage {
+                mainController.selectDisplay(display: .singlePage, viewSettingIsReload: false)
+            } else {
+                mainController.selectDisplay(display: .twoUp, viewSettingIsReload: false)
+            }
+        }
+    }
+
+    @IBAction private func pageBreaksButtonAction(_ sender: NSButton) {
+        pdfView.displaysPageBreaks = (pageBreaksButton.state == .on)
+        pdfView.layoutDocumentView()
+    }
+    
+    @IBAction private func splitViewButtonAction(_ sender: KMPageDisplayPropertiesButton) {
+//        if sender.tag > 0 && !IAPProductsManager.defaultManager().isAvailableAllFunction {
+//            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//            return
+//        }
+        
+        let menuItem = NSMenuItem()
+        switch sender.tag {
+        case 0:
+            setSplitViewType(.singleScreen)
+            menuItem.tag = 2
+            replaceView.isHidden = true
+        case 1:
+            setSplitViewType(.verticalScreen)
+            menuItem.tag = 1
+            if let documentPath = mainController.secondaryPdfView.document?.documentURL?.path, !documentPath.isEmpty {
+                replaceView.isHidden = false
+            }
+        case 2:
+            setSplitViewType(.horizontalScreen)
+            menuItem.tag = 0
+            if let documentPath = mainController.secondaryPdfView.document?.documentURL?.path, !documentPath.isEmpty {
+                replaceView.isHidden = false
+            }
+        default:
+            break
+        }
+        
+        mainController.toggleSplitPDF(menuItem)
+        
+        if !replaceView.isHidden {
+            reloadReplaceView()
+            replaceFileButton.setTitleColor(KMAppearance.Layout.w0Color())
+        }
+        
+        replaceViewTopConstraint.constant = replaceView.isHidden ? -replaceView.bounds.height : 10.0
+    }
+    
+    @IBAction private func replaceFileButtonAction(_ sender: Any) {
+        if let document = mainController.secondaryPdfView.document {
+            mainController.changePDFDocument(isChange: false) { [weak self] filePath in
+                self!.replaceFileNameLabel.attributedStringValue = self!.replaceFileName(withFilePath: (filePath as NSString).lastPathComponent)
+                self!.replaceFileNameLabel.isHidden = false
+                if self!.replaceFileButton.title == NSLocalizedString("Select File", comment: "") {
+                    self!.replaceFileButton.title = NSLocalizedString("Replace File", comment: "")
+                    self!.replaceFileButton.toolTip = NSLocalizedString("Replace File", comment: "")
+                    self!.replaceFileButton.setTitleColor(KMAppearance.Layout.w0Color())
+                }
+            }
+        } else {
+            mainController.changePDFDocument(isChange: true) { [weak self] filePath in
+                self!.replaceFileNameLabel.attributedStringValue = self!.replaceFileName(withFilePath: (filePath as NSString).lastPathComponent)
+                self!.replaceFileNameLabel.isHidden = false
+                if self!.replaceFileButton.title == NSLocalizedString("Select File", comment: "") {
+                    self!.replaceFileButton.title = NSLocalizedString("Replace File", comment: "")
+                    self!.replaceFileButton.toolTip = NSLocalizedString("Replace File", comment: "")
+                    self!.replaceFileButton.setTitleColor(KMAppearance.Layout.w0Color())
+                }
+            }
+        }
+    }
+        
+    // MARK: NSNotification Action
+    
+    @objc func viewModeChangNotification(_ notification: Notification) {
+        reloadData()
+    }
+
+//    override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
+//        guard let object = object as? YourObjectType, keyPath == "yourKeyPath" else {
+//            return
+//        }
+//        
+//        guard let newValue = change?[.newKey] ?? NSNull(),
+//              let oldValue = change?[.oldKey] ?? NSNull(),
+//              newValue != oldValue else {
+//            return
+//        }
+//        
+//        reloadData()
+//    }
+
+    @objc func removeSecondaryPdfContentView(_ notification: Notification) {
+        setSplitViewType(.singleScreen)
+        replaceView.isHidden = true
+        replaceViewTopConstraint.constant = replaceView.isHidden ? -replaceView.bounds.height : 10.0
+    }
+
+}
+
+extension KMPageDisplayPropertiesViewController: NSCollectionViewDelegate, NSCollectionViewDataSource {
+    func collectionView(_ collectionView: NSCollectionView, itemForRepresentedObjectAt indexPath: IndexPath) -> NSCollectionViewItem {
+        if themesArray.count == 8 {
+            guard let item = collectionView.makeItem(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "KMPageDisplayThemeCollectionViewItem"), for: indexPath) as? KMPageDisplayThemeCollectionViewItem else {
+                return NSCollectionViewItem()
+            }
+            
+            item.themesCollectionCellItem(item: indexPath.item, itemData: themesArray)
+            item.itemCallBack = { [weak self] customItem in
+                guard let self = self else { return }
+                
+                self.themesArray.remove(at: customItem)
+                self.pdfView.setPageBackgroundColorWith(self.themesArray[0], viewMode: KMPDFViewMode(rawValue: 0)!)
+                self.reloadData()
+                
+                let data = NSKeyedArchiver.archivedData(withRootObject: self.themesArray)
+                UserDefaults.standard.set(data, forKey: "kKMPDFViewModeThemesArray")
+                UserDefaults.standard.synchronize()
+            }
+            
+//            if !IAPProductsManager.defaultManager.isAvailableAllFunction {
+//                item.vipImageView.isHidden = indexPath.item == 0 ? true : false
+//            } else {
+//                item.vipImageView.isHidden = true
+//            }
+            
+            return item
+        } else {
+            if indexPath.item == self.themesArray.count {
+                guard let item = collectionView.makeItem(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "KMPageDisplayCustomThemesCollectionViewItem"), for: indexPath) as? KMPageDisplayCustomThemesCollectionViewItem else {
+                    return NSCollectionViewItem()
+                }
+                
+                item.themesCustomCollectionCellItem(indexPath.item)
+                item.customItemActionCallback = { [weak self] customItem, color, isChangeColor in
+                    guard let self = self else { return }
+                    
+                    if isChangeColor {
+                        guard self.pdfView.activeAnnotation == nil else { return }
+                        self.themesArray[self.clickInteger] = color
+                        self.pdfView.setPageBackgroundColorWith(self.themesArray[self.clickInteger], viewMode: KMPDFViewMode(rawValue: UInt(self.clickInteger))!)
+                        self.reloadData()
+                    } else {
+                        self.themesArray.append(color)
+                        self.clickInteger = customItem
+                        self.pdfView.setPageBackgroundColorWith(self.themesArray[customItem], viewMode: KMPDFViewMode(rawValue: UInt(customItem))!)
+                    }
+                    
+                    let data = NSKeyedArchiver.archivedData(withRootObject: self.themesArray)
+                    UserDefaults.standard.set(data, forKey: "kKMPDFViewModeThemesArray")
+                    UserDefaults.standard.synchronize()
+                }
+                
+//                if !IAPProductsManager.defaultManager.isAvailableAllFunction {
+//                    item.vipImageView.isHidden = false
+//                } else {
+//                    item.vipImageView.isHidden = true
+//                }
+                
+                return item
+            } else {
+                guard let item = collectionView.makeItem(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "KMPageDisplayThemeCollectionViewItem"), for: indexPath) as? KMPageDisplayThemeCollectionViewItem else {
+                    return NSCollectionViewItem()
+                }
+                
+                item.themesCollectionCellItem(item: indexPath.item, itemData: themesArray)
+                item.itemCallBack = { [weak self] customItem in
+                    guard let self = self else { return }
+                    
+                    self.themesArray.remove(at: customItem)
+                    self.pdfView.setPageBackgroundColorWith(self.themesArray[0], viewMode: KMPDFViewMode(rawValue: 0)!)
+                    self.reloadData()
+                    
+                    let data = NSKeyedArchiver.archivedData(withRootObject: self.themesArray)
+                    UserDefaults.standard.set(data, forKey: "kKMPDFViewModeThemesArray")
+                    UserDefaults.standard.synchronize()
+                }
+                
+//                if !IAPProductsManager.defaultManager.isAvailableAllFunction {
+//                    item.vipImageView.isHidden = indexPath.item == 0 ? true : false
+//                } else {
+//                    item.vipImageView.isHidden = true
+//                }
+                
+                return item
+            }
+        }
+        return NSCollectionViewItem()
+    }
+    
+    func collectionView(_ collectionView: NSCollectionView, numberOfItemsInSection section: Int) -> Int {
+        if themesArray.count == 8 {
+            return themesArray.count
+        } else {
+            return themesArray.count + 1
+        }
+    }
+
+    func collectionView(_ collectionView: NSCollectionView, didSelectItemsAt indexPaths: Set<IndexPath>) {
+        let indexPathArr = Array(indexPaths)
+        for indexPath in indexPathArr {
+//            if !IAPProductsManager.defaultManager.isAvailableAllFunction {
+//                if indexPath.item > 0 {
+//                    KMPurchaseCompareWindowController.sharedInstance.showWindow(nil)
+//                    return
+//                }
+//            }
+            pdfView.setPageBackgroundColorWith(themesArray[indexPath.item], viewMode: KMPDFViewMode(rawValue: UInt(indexPath.item))!)
+            reloadData()
+        }
+    }
+
+    func collectionView(_ collectionView: NSCollectionView, layout collectionViewLayout: NSCollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> NSSize {
+        return NSSize(width: 58, height: 64)
+    }
+
+}

+ 514 - 0
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/ViewController/PageDisplay/KMPageDisplayPropertiesViewController.xib

@@ -0,0 +1,514 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22154" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22154"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner" customClass="KMPageDisplayPropertiesViewController" customModule="PDF_Master" customModuleProvider="target">
+            <connections>
+                <outlet property="buttonHeightConstraint2" destination="nfc-c7-dTF" id="kV9-K2-rDa"/>
+                <outlet property="clockwiseRotationBox" destination="cvQ-nx-cJC" id="Get-vG-jZd"/>
+                <outlet property="clockwiseRotationImageView" destination="cOI-5e-e8b" id="HMR-5P-zGy"/>
+                <outlet property="collectionLayoutCollection" destination="o0E-7h-aTq" id="W4Q-fu-Lqq"/>
+                <outlet property="continuousScrollButton" destination="GgO-4o-sDQ" id="8QO-HJ-I6y"/>
+                <outlet property="counterclockwiseRotationBox" destination="mj6-VU-qEY" id="8zM-ye-SE0"/>
+                <outlet property="counterclockwiseRotationImageView" destination="8EW-Bg-sYh" id="evg-Ir-Sit"/>
+                <outlet property="coverPageButton" destination="7Wg-kN-fA5" id="cjk-sd-JY5"/>
+                <outlet property="horizontalScreenButton" destination="w7h-TO-8Yp" id="7Xu-OZ-IC9"/>
+                <outlet property="pageBreaksButton" destination="u43-eA-4ai" id="gtA-fd-TuN"/>
+                <outlet property="pageDisplayHeightConstraint" destination="tBY-Hr-JGP" id="eGO-lK-1cl"/>
+                <outlet property="pageLayoutLabel" destination="Efp-X6-DcQ" id="0HG-it-Re4"/>
+                <outlet property="readModeButton" destination="Nz2-JE-kfR" id="w23-C8-j54"/>
+                <outlet property="replaceFileButton" destination="7FZ-Ad-fZx" id="Tfd-Gy-htS"/>
+                <outlet property="replaceFileNameLabel" destination="4TV-Mh-JcQ" id="REP-fk-lco"/>
+                <outlet property="replaceView" destination="IC2-WP-iLV" id="tB4-yi-jbE"/>
+                <outlet property="replaceViewTopConstraint" destination="Eui-yj-rMk" id="LIe-9y-fOB"/>
+                <outlet property="rotationLabel" destination="nT5-NN-Xiu" id="dRc-zF-Gk9"/>
+                <outlet property="singlePageButton" destination="9oz-7L-80L" id="tY3-ZA-3vW"/>
+                <outlet property="singleScreenButton" destination="xwl-No-Yw0" id="apg-Hn-oLP"/>
+                <outlet property="splitViewLabel" destination="SCr-Pi-j5S" id="0gn-5Q-HZI"/>
+                <outlet property="themeCollectionView" destination="0Pp-z7-VAk" id="iBW-gb-GGl"/>
+                <outlet property="themeLabel" destination="Gm1-5b-ejX" id="qYz-DJ-Hn6"/>
+                <outlet property="themeScrollView" destination="xHh-7X-WA2" id="iIh-Yv-96N"/>
+                <outlet property="twoPagesButton" destination="5ex-Cg-9BL" id="fjA-9j-zoP"/>
+                <outlet property="verticalScreenButton" destination="A1N-XA-yOH" id="gb4-ju-LmE"/>
+                <outlet property="view" destination="6Hk-UC-iih" id="SyN-q1-vCo"/>
+            </connections>
+        </customObject>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <scrollView borderType="none" autohidesScrollers="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" id="6Hk-UC-iih">
+            <rect key="frame" x="0.0" y="0.0" width="481" height="812"/>
+            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+            <clipView key="contentView" drawsBackground="NO" copiesOnScroll="NO" id="atO-N3-K8L" customClass="KMClipView">
+                <rect key="frame" x="0.0" y="0.0" width="481" height="812"/>
+                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                <subviews>
+                    <view translatesAutoresizingMaskIntoConstraints="NO" id="vbu-i7-n0A">
+                        <rect key="frame" x="0.0" y="82" width="481" height="730"/>
+                        <subviews>
+                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="ao9-iB-qLE">
+                                <rect key="frame" x="16" y="10" width="449" height="270"/>
+                                <subviews>
+                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Gm1-5b-ejX">
+                                        <rect key="frame" x="-2" y="240" width="453" height="20"/>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="20" id="JVj-Iy-7eF"/>
+                                        </constraints>
+                                        <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="x99-sp-8zS">
+                                            <font key="font" metaFont="systemBold" size="14"/>
+                                            <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                            <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                        </textFieldCell>
+                                    </textField>
+                                    <scrollView wantsLayer="YES" borderType="none" autohidesScrollers="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xHh-7X-WA2">
+                                        <rect key="frame" x="0.0" y="10" width="449" height="220"/>
+                                        <clipView key="contentView" drawsBackground="NO" copiesOnScroll="NO" id="MZz-gQ-q3e">
+                                            <rect key="frame" x="0.0" y="0.0" width="449" height="220"/>
+                                            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                            <subviews>
+                                                <collectionView selectable="YES" id="0Pp-z7-VAk">
+                                                    <rect key="frame" x="0.0" y="0.0" width="449" height="220"/>
+                                                    <autoresizingMask key="autoresizingMask" widthSizable="YES"/>
+                                                    <collectionViewFlowLayout key="collectionViewLayout" minimumInteritemSpacing="10" minimumLineSpacing="10" id="tD9-si-e4y">
+                                                        <size key="itemSize" width="58" height="64"/>
+                                                    </collectionViewFlowLayout>
+                                                    <color key="primaryBackgroundColor" white="1" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                                </collectionView>
+                                            </subviews>
+                                            <color key="backgroundColor" white="1" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                        </clipView>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="220" id="o0E-7h-aTq"/>
+                                        </constraints>
+                                        <scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="wY1-fL-Sf9">
+                                            <rect key="frame" x="-100" y="-100" width="233" height="15"/>
+                                            <autoresizingMask key="autoresizingMask"/>
+                                        </scroller>
+                                        <scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="pDf-y3-zct" customClass="KMToolSetScroller" customModule="PDF_Master" customModuleProvider="target">
+                                            <rect key="frame" x="-100" y="-100" width="15" height="101"/>
+                                            <autoresizingMask key="autoresizingMask"/>
+                                        </scroller>
+                                    </scrollView>
+                                </subviews>
+                                <constraints>
+                                    <constraint firstAttribute="bottom" secondItem="xHh-7X-WA2" secondAttribute="bottom" constant="10" id="9tf-YR-8t3"/>
+                                    <constraint firstItem="xHh-7X-WA2" firstAttribute="leading" secondItem="ao9-iB-qLE" secondAttribute="leading" id="QUm-5d-5jB"/>
+                                    <constraint firstAttribute="trailing" secondItem="Gm1-5b-ejX" secondAttribute="trailing" id="SfN-hE-bVD"/>
+                                    <constraint firstItem="Gm1-5b-ejX" firstAttribute="leading" secondItem="ao9-iB-qLE" secondAttribute="leading" id="Zte-Of-aKs"/>
+                                    <constraint firstAttribute="trailing" secondItem="xHh-7X-WA2" secondAttribute="trailing" id="cVV-2I-zrH"/>
+                                    <constraint firstItem="Gm1-5b-ejX" firstAttribute="top" secondItem="ao9-iB-qLE" secondAttribute="top" constant="10" id="suq-FC-Cor"/>
+                                    <constraint firstItem="xHh-7X-WA2" firstAttribute="top" secondItem="Gm1-5b-ejX" secondAttribute="bottom" constant="10" id="xLm-dB-yKG"/>
+                                </constraints>
+                            </customView>
+                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="mOq-N3-z4J">
+                                <rect key="frame" x="16" y="379" width="449" height="148"/>
+                                <subviews>
+                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="SCr-Pi-j5S">
+                                        <rect key="frame" x="-2" y="118" width="453" height="20"/>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="20" id="roF-o7-wZm"/>
+                                        </constraints>
+                                        <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="xgo-Bu-emJ">
+                                            <font key="font" metaFont="systemBold" size="14"/>
+                                            <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                            <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                        </textFieldCell>
+                                    </textField>
+                                    <button imageHugsTitle="YES" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="xwl-No-Yw0" customClass="KMPageDisplayPropertiesButton" customModule="PDF_Master" customModuleProvider="target">
+                                        <rect key="frame" x="0.0" y="52" width="50" height="56"/>
+                                        <buttonCell key="cell" type="square" title="Title" bezelStyle="shadowlessSquare" image="KMImageNameUXIconPropertybarViewSplitscreensingleNor" imagePosition="above" alignment="center" imageScaling="proportionallyDown" inset="2" id="WZw-v3-3dO">
+                                            <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                            <font key="font" metaFont="smallSystem"/>
+                                        </buttonCell>
+                                        <constraints>
+                                            <constraint firstAttribute="width" constant="50" id="3JG-fk-VKV"/>
+                                            <constraint firstAttribute="height" constant="56" id="nfc-c7-dTF"/>
+                                        </constraints>
+                                        <connections>
+                                            <action selector="splitViewButtonAction:" target="-2" id="Rjh-kD-oUC"/>
+                                        </connections>
+                                    </button>
+                                    <customView translatesAutoresizingMaskIntoConstraints="NO" id="GuL-TU-LEs">
+                                        <rect key="frame" x="316" y="52" width="83" height="56"/>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="56" id="4Bn-pv-cGt"/>
+                                        </constraints>
+                                    </customView>
+                                    <button imageHugsTitle="YES" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="DdU-4D-Jdj">
+                                        <rect key="frame" x="399" y="52" width="50" height="56"/>
+                                        <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" imagePosition="above" alignment="center" imageScaling="proportionallyDown" inset="2" id="TRA-4E-Pe2">
+                                            <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                            <font key="font" metaFont="smallSystem"/>
+                                        </buttonCell>
+                                    </button>
+                                    <button tag="2" imageHugsTitle="YES" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="w7h-TO-8Yp" customClass="KMPageDisplayPropertiesButton" customModule="PDF_Master" customModuleProvider="target">
+                                        <rect key="frame" x="266" y="52" width="50" height="56"/>
+                                        <buttonCell key="cell" type="square" title="Title" bezelStyle="shadowlessSquare" image="KMImageNameUXIconPropertybarViewSplitscreenhorNor" imagePosition="above" alignment="center" imageScaling="proportionallyDown" inset="2" id="NTU-XQ-DJt">
+                                            <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                            <font key="font" metaFont="smallSystem"/>
+                                        </buttonCell>
+                                        <connections>
+                                            <action selector="splitViewButtonAction:" target="-2" id="rHG-zp-qVK"/>
+                                        </connections>
+                                    </button>
+                                    <customView translatesAutoresizingMaskIntoConstraints="NO" id="AKa-Z2-6qC">
+                                        <rect key="frame" x="50" y="52" width="83" height="56"/>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="56" id="L9k-ZA-6Sw"/>
+                                        </constraints>
+                                    </customView>
+                                    <button tag="1" imageHugsTitle="YES" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="A1N-XA-yOH" customClass="KMPageDisplayPropertiesButton" customModule="PDF_Master" customModuleProvider="target">
+                                        <rect key="frame" x="133" y="52" width="50" height="56"/>
+                                        <buttonCell key="cell" type="square" title="Title" bezelStyle="shadowlessSquare" image="KMImageNameUXIconPropertybarViewSplitscreenverNor" imagePosition="above" alignment="center" imageScaling="proportionallyDown" inset="2" id="Glv-3q-e1k">
+                                            <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                            <font key="font" metaFont="smallSystem"/>
+                                        </buttonCell>
+                                        <connections>
+                                            <action selector="splitViewButtonAction:" target="-2" id="iKz-iN-GvW"/>
+                                        </connections>
+                                    </button>
+                                    <customView translatesAutoresizingMaskIntoConstraints="NO" id="VBx-qZ-vcN">
+                                        <rect key="frame" x="183" y="52" width="83" height="56"/>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="56" id="DPL-iE-QYN"/>
+                                        </constraints>
+                                    </customView>
+                                    <customView translatesAutoresizingMaskIntoConstraints="NO" id="IC2-WP-iLV">
+                                        <rect key="frame" x="0.0" y="0.0" width="449" height="42"/>
+                                        <subviews>
+                                            <box verticalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="Nsl-b5-RfC">
+                                                <rect key="frame" x="0.0" y="39" width="449" height="5"/>
+                                                <constraints>
+                                                    <constraint firstAttribute="height" constant="1" id="XaF-dS-th1"/>
+                                                </constraints>
+                                            </box>
+                                            <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="749" translatesAutoresizingMaskIntoConstraints="NO" id="4TV-Mh-JcQ">
+                                                <rect key="frame" x="-2" y="7" width="35" height="26"/>
+                                                <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" title="Label" id="gs5-bd-hs0">
+                                                    <font key="font" metaFont="cellTitle"/>
+                                                    <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                    <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                </textFieldCell>
+                                            </textField>
+                                            <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="7FZ-Ad-fZx">
+                                                <rect key="frame" x="404" y="10" width="45" height="20"/>
+                                                <buttonCell key="cell" type="square" title="Button" bezelStyle="shadowlessSquare" alignment="center" imageScaling="proportionallyDown" inset="2" id="9W1-mA-eED">
+                                                    <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                                    <font key="font" metaFont="system"/>
+                                                </buttonCell>
+                                                <constraints>
+                                                    <constraint firstAttribute="height" constant="20" id="1Ye-jP-kPQ"/>
+                                                    <constraint firstAttribute="width" priority="500" id="D0V-2p-e6Q"/>
+                                                </constraints>
+                                                <connections>
+                                                    <action selector="replaceFileButtonAction:" target="-2" id="PjV-ea-aFn"/>
+                                                </connections>
+                                            </button>
+                                        </subviews>
+                                        <constraints>
+                                            <constraint firstAttribute="bottom" secondItem="7FZ-Ad-fZx" secondAttribute="bottom" constant="10" id="14y-zf-VGl"/>
+                                            <constraint firstAttribute="trailing" secondItem="Nsl-b5-RfC" secondAttribute="trailing" id="55h-v8-mjM"/>
+                                            <constraint firstItem="4TV-Mh-JcQ" firstAttribute="leading" secondItem="IC2-WP-iLV" secondAttribute="leading" id="9jE-5t-u27"/>
+                                            <constraint firstItem="7FZ-Ad-fZx" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="4TV-Mh-JcQ" secondAttribute="trailing" constant="10" id="NQK-Zk-DHP"/>
+                                            <constraint firstItem="Nsl-b5-RfC" firstAttribute="leading" secondItem="IC2-WP-iLV" secondAttribute="leading" id="SoU-wK-5Wr"/>
+                                            <constraint firstItem="Nsl-b5-RfC" firstAttribute="top" secondItem="IC2-WP-iLV" secondAttribute="top" id="YIr-4B-1bz"/>
+                                            <constraint firstItem="4TV-Mh-JcQ" firstAttribute="top" secondItem="Nsl-b5-RfC" secondAttribute="bottom" constant="8" id="dkf-DW-gjQ"/>
+                                            <constraint firstItem="7FZ-Ad-fZx" firstAttribute="centerY" secondItem="4TV-Mh-JcQ" secondAttribute="centerY" id="jp6-Sb-pRu"/>
+                                            <constraint firstAttribute="trailing" secondItem="7FZ-Ad-fZx" secondAttribute="trailing" id="mhG-ab-VoQ"/>
+                                            <constraint firstAttribute="height" constant="42" id="v5y-3P-mFK"/>
+                                        </constraints>
+                                    </customView>
+                                </subviews>
+                                <constraints>
+                                    <constraint firstItem="w7h-TO-8Yp" firstAttribute="centerY" secondItem="xwl-No-Yw0" secondAttribute="centerY" id="4bu-wW-wm5"/>
+                                    <constraint firstItem="AKa-Z2-6qC" firstAttribute="leading" secondItem="xwl-No-Yw0" secondAttribute="trailing" id="765-Hl-7Lz"/>
+                                    <constraint firstItem="GuL-TU-LEs" firstAttribute="width" secondItem="AKa-Z2-6qC" secondAttribute="width" id="CIU-42-dW0"/>
+                                    <constraint firstItem="VBx-qZ-vcN" firstAttribute="width" secondItem="AKa-Z2-6qC" secondAttribute="width" id="DRl-gF-ruT"/>
+                                    <constraint firstItem="SCr-Pi-j5S" firstAttribute="top" secondItem="mOq-N3-z4J" secondAttribute="top" constant="10" id="E8Y-6v-b6n"/>
+                                    <constraint firstItem="IC2-WP-iLV" firstAttribute="top" secondItem="xwl-No-Yw0" secondAttribute="bottom" constant="10" id="Eui-yj-rMk"/>
+                                    <constraint firstItem="w7h-TO-8Yp" firstAttribute="width" secondItem="xwl-No-Yw0" secondAttribute="width" id="HV0-J6-6gu"/>
+                                    <constraint firstItem="SCr-Pi-j5S" firstAttribute="leading" secondItem="mOq-N3-z4J" secondAttribute="leading" id="JJe-XE-jr2"/>
+                                    <constraint firstAttribute="trailing" secondItem="SCr-Pi-j5S" secondAttribute="trailing" id="JLb-xT-0wM"/>
+                                    <constraint firstItem="VBx-qZ-vcN" firstAttribute="centerY" secondItem="xwl-No-Yw0" secondAttribute="centerY" id="NE0-VR-nsP"/>
+                                    <constraint firstItem="DdU-4D-Jdj" firstAttribute="leading" secondItem="GuL-TU-LEs" secondAttribute="trailing" id="Ni6-wO-hdb"/>
+                                    <constraint firstAttribute="trailing" secondItem="DdU-4D-Jdj" secondAttribute="trailing" id="Npr-7Q-Box"/>
+                                    <constraint firstItem="IC2-WP-iLV" firstAttribute="leading" secondItem="mOq-N3-z4J" secondAttribute="leading" id="P6i-wE-W9H"/>
+                                    <constraint firstItem="xwl-No-Yw0" firstAttribute="leading" secondItem="mOq-N3-z4J" secondAttribute="leading" id="PqT-v2-fyk"/>
+                                    <constraint firstAttribute="bottom" secondItem="IC2-WP-iLV" secondAttribute="bottom" id="RaP-ND-41b"/>
+                                    <constraint firstItem="A1N-XA-yOH" firstAttribute="centerY" secondItem="xwl-No-Yw0" secondAttribute="centerY" id="Sz3-7v-3MT"/>
+                                    <constraint firstItem="GuL-TU-LEs" firstAttribute="centerY" secondItem="xwl-No-Yw0" secondAttribute="centerY" id="TQr-da-gyY"/>
+                                    <constraint firstItem="DdU-4D-Jdj" firstAttribute="centerY" secondItem="xwl-No-Yw0" secondAttribute="centerY" id="X8W-1R-nbu"/>
+                                    <constraint firstItem="DdU-4D-Jdj" firstAttribute="height" secondItem="xwl-No-Yw0" secondAttribute="height" id="a78-4H-Rjh"/>
+                                    <constraint firstItem="w7h-TO-8Yp" firstAttribute="leading" secondItem="VBx-qZ-vcN" secondAttribute="trailing" id="c1y-bV-cid"/>
+                                    <constraint firstItem="DdU-4D-Jdj" firstAttribute="width" secondItem="xwl-No-Yw0" secondAttribute="width" id="ce2-em-3Vi"/>
+                                    <constraint firstItem="A1N-XA-yOH" firstAttribute="height" secondItem="xwl-No-Yw0" secondAttribute="height" id="gRp-9A-Vtr"/>
+                                    <constraint firstItem="A1N-XA-yOH" firstAttribute="leading" secondItem="AKa-Z2-6qC" secondAttribute="trailing" id="ht5-mO-qyK"/>
+                                    <constraint firstItem="w7h-TO-8Yp" firstAttribute="height" secondItem="xwl-No-Yw0" secondAttribute="height" id="i7Z-vg-wMX"/>
+                                    <constraint firstItem="AKa-Z2-6qC" firstAttribute="centerY" secondItem="xwl-No-Yw0" secondAttribute="centerY" id="ijA-RC-1SJ"/>
+                                    <constraint firstItem="VBx-qZ-vcN" firstAttribute="leading" secondItem="A1N-XA-yOH" secondAttribute="trailing" id="iyc-F7-t6N"/>
+                                    <constraint firstItem="GuL-TU-LEs" firstAttribute="leading" secondItem="w7h-TO-8Yp" secondAttribute="trailing" id="tzy-Fh-kRt"/>
+                                    <constraint firstItem="xwl-No-Yw0" firstAttribute="top" secondItem="SCr-Pi-j5S" secondAttribute="bottom" constant="10" id="vAJ-68-qPd"/>
+                                    <constraint firstAttribute="trailing" secondItem="IC2-WP-iLV" secondAttribute="trailing" id="xSz-eF-lLY"/>
+                                    <constraint firstItem="A1N-XA-yOH" firstAttribute="width" secondItem="xwl-No-Yw0" secondAttribute="width" id="zeE-RH-Mu3"/>
+                                </constraints>
+                            </customView>
+                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="vLs-DH-OYK">
+                                <rect key="frame" x="16" y="547" width="449" height="173"/>
+                                <subviews>
+                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Efp-X6-DcQ">
+                                        <rect key="frame" x="-2" y="143" width="453" height="20"/>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="20" id="ktK-MN-6Wm"/>
+                                        </constraints>
+                                        <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="faf-yw-yZz">
+                                            <font key="font" metaFont="systemBold" size="14"/>
+                                            <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                            <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                        </textFieldCell>
+                                    </textField>
+                                    <button imageHugsTitle="YES" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="9oz-7L-80L" customClass="KMPageDisplayPropertiesButton" customModule="PDF_Master" customModuleProvider="target">
+                                        <rect key="frame" x="0.0" y="77" width="50" height="56"/>
+                                        <buttonCell key="cell" type="square" title="Title" bezelStyle="shadowlessSquare" image="KMImageNameUXIconPropertybarViewPagesingleNor" imagePosition="above" alignment="center" imageScaling="proportionallyDown" inset="2" id="TVe-q8-kd4">
+                                            <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                            <font key="font" metaFont="smallSystem"/>
+                                        </buttonCell>
+                                        <constraints>
+                                            <constraint firstAttribute="width" constant="50" id="4tq-tK-Iwa"/>
+                                            <constraint firstAttribute="height" constant="56" id="tBY-Hr-JGP"/>
+                                        </constraints>
+                                        <connections>
+                                            <action selector="displayModeButtonAction:" target="-2" id="epG-sy-s7A"/>
+                                        </connections>
+                                    </button>
+                                    <button tag="1" imageHugsTitle="YES" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="5ex-Cg-9BL" customClass="KMPageDisplayPropertiesButton" customModule="PDF_Master" customModuleProvider="target">
+                                        <rect key="frame" x="133" y="77" width="50" height="56"/>
+                                        <buttonCell key="cell" type="square" title="Title" bezelStyle="shadowlessSquare" image="KMImageNameUXIconPropertybarViewPagedoubleNor" imagePosition="above" alignment="center" imageScaling="proportionallyDown" inset="2" id="QOU-JK-ugq">
+                                            <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                            <font key="font" metaFont="smallSystem"/>
+                                        </buttonCell>
+                                        <connections>
+                                            <action selector="displayModeButtonAction:" target="-2" id="Any-jA-lga"/>
+                                        </connections>
+                                    </button>
+                                    <button tag="2" imageHugsTitle="YES" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="7Wg-kN-fA5" customClass="KMPageDisplayPropertiesButton" customModule="PDF_Master" customModuleProvider="target">
+                                        <rect key="frame" x="266" y="77" width="50" height="56"/>
+                                        <buttonCell key="cell" type="square" title="Title" bezelStyle="shadowlessSquare" image="KMImageNameUXIconPropertybarViewPagecoverNor" imagePosition="above" alignment="center" imageScaling="proportionallyDown" inset="2" id="2kr-Hd-OgG">
+                                            <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                            <font key="font" metaFont="smallSystem"/>
+                                        </buttonCell>
+                                        <connections>
+                                            <action selector="displayModeButtonAction:" target="-2" id="5Sj-Er-bJK"/>
+                                        </connections>
+                                    </button>
+                                    <button tag="3" imageHugsTitle="YES" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Nz2-JE-kfR" customClass="KMPageDisplayPropertiesButton" customModule="PDF_Master" customModuleProvider="target">
+                                        <rect key="frame" x="399" y="77" width="50" height="56"/>
+                                        <buttonCell key="cell" type="square" title="Title" bezelStyle="shadowlessSquare" image="KMImageNameUXIconPropertybarViewPagereadingNor" imagePosition="above" alignment="center" imageScaling="proportionallyDown" inset="2" id="CXv-oK-Kdz">
+                                            <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                            <font key="font" metaFont="smallSystem"/>
+                                        </buttonCell>
+                                        <connections>
+                                            <action selector="displayModeButtonAction:" target="-2" id="BaO-us-Sbx"/>
+                                        </connections>
+                                    </button>
+                                    <customView translatesAutoresizingMaskIntoConstraints="NO" id="QpT-kf-e68">
+                                        <rect key="frame" x="50" y="77" width="83" height="56"/>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="56" id="Wv2-fg-iGd"/>
+                                        </constraints>
+                                    </customView>
+                                    <customView translatesAutoresizingMaskIntoConstraints="NO" id="amY-07-olk">
+                                        <rect key="frame" x="183" y="77" width="83" height="56"/>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="56" id="kU4-nL-4ZQ"/>
+                                        </constraints>
+                                    </customView>
+                                    <customView translatesAutoresizingMaskIntoConstraints="NO" id="faP-1g-Xdz">
+                                        <rect key="frame" x="316" y="77" width="83" height="56"/>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="56" id="CtK-Ig-eEn"/>
+                                        </constraints>
+                                    </customView>
+                                    <box verticalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="Qco-Dk-82q">
+                                        <rect key="frame" x="0.0" y="58" width="449" height="5"/>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="1" id="npP-Wd-L62"/>
+                                        </constraints>
+                                    </box>
+                                    <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="GgO-4o-sDQ">
+                                        <rect key="frame" x="-2" y="25" width="65" height="18"/>
+                                        <buttonCell key="cell" type="check" title="Check" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="d0i-wy-sZ6">
+                                            <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
+                                            <font key="font" metaFont="system"/>
+                                        </buttonCell>
+                                        <connections>
+                                            <action selector="continuousScrollButtonAction:" target="-2" id="PFs-M3-rEf"/>
+                                        </connections>
+                                    </button>
+                                    <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="u43-eA-4ai">
+                                        <rect key="frame" x="-2" y="-1" width="65" height="18"/>
+                                        <buttonCell key="cell" type="check" title="Check" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="qqN-fW-L4W">
+                                            <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
+                                            <font key="font" metaFont="system"/>
+                                        </buttonCell>
+                                        <connections>
+                                            <action selector="pageBreaksButtonAction:" target="-2" id="Adp-Bw-ChD"/>
+                                        </connections>
+                                    </button>
+                                </subviews>
+                                <constraints>
+                                    <constraint firstItem="9oz-7L-80L" firstAttribute="top" secondItem="Efp-X6-DcQ" secondAttribute="bottom" constant="10" id="0XV-Pj-M6o"/>
+                                    <constraint firstItem="faP-1g-Xdz" firstAttribute="leading" secondItem="7Wg-kN-fA5" secondAttribute="trailing" id="1iN-I0-kBG"/>
+                                    <constraint firstItem="GgO-4o-sDQ" firstAttribute="leading" secondItem="vLs-DH-OYK" secondAttribute="leading" id="59Q-gu-3Z3"/>
+                                    <constraint firstAttribute="trailing" secondItem="Qco-Dk-82q" secondAttribute="trailing" id="5yr-mf-iau"/>
+                                    <constraint firstItem="5ex-Cg-9BL" firstAttribute="width" secondItem="9oz-7L-80L" secondAttribute="width" id="8is-ng-7uE"/>
+                                    <constraint firstItem="QpT-kf-e68" firstAttribute="leading" secondItem="9oz-7L-80L" secondAttribute="trailing" id="9MV-dF-y3G"/>
+                                    <constraint firstItem="5ex-Cg-9BL" firstAttribute="leading" secondItem="QpT-kf-e68" secondAttribute="trailing" id="AYq-5Y-c77"/>
+                                    <constraint firstItem="amY-07-olk" firstAttribute="centerY" secondItem="9oz-7L-80L" secondAttribute="centerY" id="Ag4-at-BWo"/>
+                                    <constraint firstItem="Efp-X6-DcQ" firstAttribute="leading" secondItem="vLs-DH-OYK" secondAttribute="leading" id="Cp9-Eb-m1s"/>
+                                    <constraint firstItem="Nz2-JE-kfR" firstAttribute="width" secondItem="9oz-7L-80L" secondAttribute="width" id="GCn-ta-dYa"/>
+                                    <constraint firstAttribute="bottom" secondItem="u43-eA-4ai" secondAttribute="bottom" id="I0J-e2-Q83"/>
+                                    <constraint firstItem="Nz2-JE-kfR" firstAttribute="centerY" secondItem="9oz-7L-80L" secondAttribute="centerY" id="Od0-du-eaU"/>
+                                    <constraint firstItem="Nz2-JE-kfR" firstAttribute="height" secondItem="9oz-7L-80L" secondAttribute="height" id="Xuo-EA-Uk7"/>
+                                    <constraint firstAttribute="trailing" secondItem="Nz2-JE-kfR" secondAttribute="trailing" id="ZLh-4k-17D"/>
+                                    <constraint firstItem="amY-07-olk" firstAttribute="leading" secondItem="5ex-Cg-9BL" secondAttribute="trailing" id="ZOG-LG-4UL"/>
+                                    <constraint firstItem="5ex-Cg-9BL" firstAttribute="centerY" secondItem="9oz-7L-80L" secondAttribute="centerY" id="ZTp-Rg-Cv2"/>
+                                    <constraint firstItem="GgO-4o-sDQ" firstAttribute="top" secondItem="Qco-Dk-82q" secondAttribute="bottom" constant="18" id="aAG-qc-kne"/>
+                                    <constraint firstItem="faP-1g-Xdz" firstAttribute="centerY" secondItem="9oz-7L-80L" secondAttribute="centerY" id="at6-yn-AWV"/>
+                                    <constraint firstItem="Qco-Dk-82q" firstAttribute="top" secondItem="9oz-7L-80L" secondAttribute="bottom" constant="16" id="avr-Xb-QTK"/>
+                                    <constraint firstItem="faP-1g-Xdz" firstAttribute="width" secondItem="QpT-kf-e68" secondAttribute="width" id="c8O-ej-Ppv"/>
+                                    <constraint firstItem="7Wg-kN-fA5" firstAttribute="height" secondItem="9oz-7L-80L" secondAttribute="height" id="eQ6-TM-rpl"/>
+                                    <constraint firstItem="7Wg-kN-fA5" firstAttribute="width" secondItem="9oz-7L-80L" secondAttribute="width" id="gNM-h6-G93"/>
+                                    <constraint firstItem="Nz2-JE-kfR" firstAttribute="leading" secondItem="faP-1g-Xdz" secondAttribute="trailing" id="gdX-6t-PxE"/>
+                                    <constraint firstItem="9oz-7L-80L" firstAttribute="leading" secondItem="vLs-DH-OYK" secondAttribute="leading" id="jna-IY-VnR"/>
+                                    <constraint firstAttribute="trailing" secondItem="Efp-X6-DcQ" secondAttribute="trailing" id="las-46-utd"/>
+                                    <constraint firstItem="7Wg-kN-fA5" firstAttribute="leading" secondItem="amY-07-olk" secondAttribute="trailing" id="nSx-XS-IFF"/>
+                                    <constraint firstItem="7Wg-kN-fA5" firstAttribute="centerY" secondItem="9oz-7L-80L" secondAttribute="centerY" id="neI-An-Nmx"/>
+                                    <constraint firstItem="QpT-kf-e68" firstAttribute="centerY" secondItem="9oz-7L-80L" secondAttribute="centerY" id="p2E-vK-WeO"/>
+                                    <constraint firstItem="Qco-Dk-82q" firstAttribute="leading" secondItem="vLs-DH-OYK" secondAttribute="leading" id="sSg-0F-Eaj"/>
+                                    <constraint firstItem="Efp-X6-DcQ" firstAttribute="top" secondItem="vLs-DH-OYK" secondAttribute="top" constant="10" id="tCs-RN-Twe"/>
+                                    <constraint firstItem="u43-eA-4ai" firstAttribute="top" secondItem="GgO-4o-sDQ" secondAttribute="bottom" constant="10" id="teT-wE-7Md"/>
+                                    <constraint firstItem="u43-eA-4ai" firstAttribute="leading" secondItem="vLs-DH-OYK" secondAttribute="leading" id="wJa-rM-THl"/>
+                                    <constraint firstItem="amY-07-olk" firstAttribute="width" secondItem="QpT-kf-e68" secondAttribute="width" id="xxc-uL-6uM"/>
+                                    <constraint firstItem="5ex-Cg-9BL" firstAttribute="height" secondItem="9oz-7L-80L" secondAttribute="height" id="ziF-SC-CkJ"/>
+                                </constraints>
+                            </customView>
+                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="74p-qc-QIt">
+                                <rect key="frame" x="16" y="300" width="449" height="64"/>
+                                <subviews>
+                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="nT5-NN-Xiu">
+                                        <rect key="frame" x="-2" y="34" width="453" height="20"/>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="20" id="YyK-xf-MLn"/>
+                                        </constraints>
+                                        <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="7M4-Kh-XWC">
+                                            <font key="font" metaFont="systemBold" size="14"/>
+                                            <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                            <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                        </textFieldCell>
+                                    </textField>
+                                    <box boxType="custom" cornerRadius="1" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="cvQ-nx-cJC" customClass="KMBox" customModule="PDF_Master" customModuleProvider="target">
+                                        <rect key="frame" x="0.0" y="0.0" width="69" height="24"/>
+                                        <view key="contentView" id="saP-cx-R4h">
+                                            <rect key="frame" x="1" y="1" width="67" height="22"/>
+                                            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                            <subviews>
+                                                <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="cOI-5e-e8b">
+                                                    <rect key="frame" x="0.0" y="0.0" width="67" height="22"/>
+                                                    <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="KMImageNameUXIconPropertybarRotateClockwiseNor" id="HiZ-eL-s0y"/>
+                                                </imageView>
+                                            </subviews>
+                                            <constraints>
+                                                <constraint firstAttribute="bottom" secondItem="cOI-5e-e8b" secondAttribute="bottom" id="3gk-Px-O7y"/>
+                                                <constraint firstAttribute="trailing" secondItem="cOI-5e-e8b" secondAttribute="trailing" id="FNg-0T-frr"/>
+                                                <constraint firstItem="cOI-5e-e8b" firstAttribute="leading" secondItem="saP-cx-R4h" secondAttribute="leading" id="hC4-Fn-73a"/>
+                                                <constraint firstItem="cOI-5e-e8b" firstAttribute="top" secondItem="saP-cx-R4h" secondAttribute="top" id="xcj-l0-bQ5"/>
+                                            </constraints>
+                                        </view>
+                                        <constraints>
+                                            <constraint firstAttribute="width" constant="69" id="Lys-ab-poc"/>
+                                            <constraint firstAttribute="height" constant="24" id="iTE-0X-eyC"/>
+                                        </constraints>
+                                    </box>
+                                    <box boxType="custom" cornerRadius="1" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="mj6-VU-qEY" customClass="KMBox" customModule="PDF_Master" customModuleProvider="target">
+                                        <rect key="frame" x="78" y="0.0" width="69" height="24"/>
+                                        <view key="contentView" id="n08-Js-i6L">
+                                            <rect key="frame" x="1" y="1" width="67" height="22"/>
+                                            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                            <subviews>
+                                                <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="8EW-Bg-sYh">
+                                                    <rect key="frame" x="0.0" y="0.0" width="67" height="22"/>
+                                                    <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="KMImageNameUXIconPropertybarRotateCounterclockwiseNor" id="loE-73-rPX"/>
+                                                </imageView>
+                                            </subviews>
+                                            <constraints>
+                                                <constraint firstAttribute="bottom" secondItem="8EW-Bg-sYh" secondAttribute="bottom" id="4OX-1m-xaH"/>
+                                                <constraint firstItem="8EW-Bg-sYh" firstAttribute="leading" secondItem="n08-Js-i6L" secondAttribute="leading" id="7DN-y6-ExY"/>
+                                                <constraint firstAttribute="trailing" secondItem="8EW-Bg-sYh" secondAttribute="trailing" id="JCQ-aR-9Lf"/>
+                                                <constraint firstItem="8EW-Bg-sYh" firstAttribute="top" secondItem="n08-Js-i6L" secondAttribute="top" id="qsg-Rd-zO9"/>
+                                            </constraints>
+                                        </view>
+                                    </box>
+                                </subviews>
+                                <constraints>
+                                    <constraint firstAttribute="trailing" secondItem="nT5-NN-Xiu" secondAttribute="trailing" id="HOX-Wc-1xY"/>
+                                    <constraint firstItem="nT5-NN-Xiu" firstAttribute="top" secondItem="74p-qc-QIt" secondAttribute="top" constant="10" id="Sfj-PY-im3"/>
+                                    <constraint firstAttribute="bottom" secondItem="cvQ-nx-cJC" secondAttribute="bottom" id="Xq6-Nz-5yO"/>
+                                    <constraint firstItem="nT5-NN-Xiu" firstAttribute="leading" secondItem="74p-qc-QIt" secondAttribute="leading" id="YaQ-vU-Hmt"/>
+                                    <constraint firstItem="cvQ-nx-cJC" firstAttribute="top" secondItem="nT5-NN-Xiu" secondAttribute="bottom" constant="10" id="clM-Jy-Jnl"/>
+                                    <constraint firstItem="mj6-VU-qEY" firstAttribute="leading" secondItem="cvQ-nx-cJC" secondAttribute="trailing" constant="9" id="f4e-EF-LXQ"/>
+                                    <constraint firstItem="mj6-VU-qEY" firstAttribute="height" secondItem="cvQ-nx-cJC" secondAttribute="height" id="iSR-tg-L47"/>
+                                    <constraint firstItem="cvQ-nx-cJC" firstAttribute="leading" secondItem="74p-qc-QIt" secondAttribute="leading" id="iga-yb-khn"/>
+                                    <constraint firstItem="mj6-VU-qEY" firstAttribute="centerY" secondItem="cvQ-nx-cJC" secondAttribute="centerY" id="llI-ev-0os"/>
+                                    <constraint firstItem="mj6-VU-qEY" firstAttribute="width" secondItem="cvQ-nx-cJC" secondAttribute="width" id="pCj-OP-9av"/>
+                                </constraints>
+                            </customView>
+                        </subviews>
+                        <constraints>
+                            <constraint firstItem="74p-qc-QIt" firstAttribute="leading" secondItem="vLs-DH-OYK" secondAttribute="leading" id="0ah-sd-iFd"/>
+                            <constraint firstItem="vLs-DH-OYK" firstAttribute="leading" secondItem="vbu-i7-n0A" secondAttribute="leading" constant="16" id="2fG-l4-lEw"/>
+                            <constraint firstItem="ao9-iB-qLE" firstAttribute="leading" secondItem="vbu-i7-n0A" secondAttribute="leading" constant="16" id="35B-6I-8Hu"/>
+                            <constraint firstItem="mOq-N3-z4J" firstAttribute="leading" secondItem="vLs-DH-OYK" secondAttribute="leading" id="35I-sd-1g8"/>
+                            <constraint firstItem="74p-qc-QIt" firstAttribute="top" secondItem="mOq-N3-z4J" secondAttribute="bottom" constant="15" id="Jkl-J5-3jb"/>
+                            <constraint firstItem="mOq-N3-z4J" firstAttribute="trailing" secondItem="vLs-DH-OYK" secondAttribute="trailing" id="MGR-wm-uls"/>
+                            <constraint firstAttribute="bottom" secondItem="ao9-iB-qLE" secondAttribute="bottom" constant="10" id="NHH-b6-Anc"/>
+                            <constraint firstItem="mOq-N3-z4J" firstAttribute="top" secondItem="vLs-DH-OYK" secondAttribute="bottom" constant="20" id="PiP-2u-zEh"/>
+                            <constraint firstAttribute="trailing" secondItem="vLs-DH-OYK" secondAttribute="trailing" constant="16" id="SRl-Co-6HB"/>
+                            <constraint firstItem="vLs-DH-OYK" firstAttribute="top" secondItem="vbu-i7-n0A" secondAttribute="top" constant="10" id="XF5-fk-v31"/>
+                            <constraint firstAttribute="trailing" secondItem="ao9-iB-qLE" secondAttribute="trailing" constant="16" id="dWC-MA-Vwf"/>
+                            <constraint firstItem="74p-qc-QIt" firstAttribute="trailing" secondItem="vLs-DH-OYK" secondAttribute="trailing" id="kFq-Ui-c47"/>
+                            <constraint firstItem="ao9-iB-qLE" firstAttribute="top" secondItem="74p-qc-QIt" secondAttribute="bottom" constant="20" id="urx-Hv-5Rq"/>
+                        </constraints>
+                    </view>
+                </subviews>
+                <constraints>
+                    <constraint firstItem="vbu-i7-n0A" firstAttribute="leading" secondItem="atO-N3-K8L" secondAttribute="leading" id="A7i-zM-7ZJ"/>
+                    <constraint firstAttribute="trailing" secondItem="vbu-i7-n0A" secondAttribute="trailing" id="LLO-Au-RIL"/>
+                    <constraint firstItem="vbu-i7-n0A" firstAttribute="top" secondItem="atO-N3-K8L" secondAttribute="top" id="d8Y-ds-Cdm"/>
+                </constraints>
+            </clipView>
+            <scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="yV7-ET-dz5">
+                <rect key="frame" x="-100" y="-100" width="303" height="15"/>
+                <autoresizingMask key="autoresizingMask"/>
+            </scroller>
+            <scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="gGc-XW-0cz">
+                <rect key="frame" x="466" y="0.0" width="15" height="728"/>
+                <autoresizingMask key="autoresizingMask"/>
+            </scroller>
+            <point key="canvasLocation" x="-203.5" y="256"/>
+        </scrollView>
+    </objects>
+    <resources>
+        <image name="KMImageNameUXIconPropertybarRotateClockwiseNor" width="20" height="20"/>
+        <image name="KMImageNameUXIconPropertybarRotateCounterclockwiseNor" width="20" height="20"/>
+        <image name="KMImageNameUXIconPropertybarViewPagecoverNor" width="24" height="24"/>
+        <image name="KMImageNameUXIconPropertybarViewPagedoubleNor" width="24" height="24"/>
+        <image name="KMImageNameUXIconPropertybarViewPagereadingNor" width="24" height="24"/>
+        <image name="KMImageNameUXIconPropertybarViewPagesingleNor" width="24" height="24"/>
+        <image name="KMImageNameUXIconPropertybarViewSplitscreenhorNor" width="24" height="24"/>
+        <image name="KMImageNameUXIconPropertybarViewSplitscreensingleNor" width="24" height="24"/>
+        <image name="KMImageNameUXIconPropertybarViewSplitscreenverNor" width="24" height="24"/>
+    </resources>
+</document>

+ 89 - 0
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/ViewController/PageDisplay/KMPageDisplayThemeCollectionViewItem.swift

@@ -0,0 +1,89 @@
+//
+//  KMPageDisplayThemeCollectionViewItem.swift
+//  PDF Master
+//
+//  Created by lxy on 2023/1/29.
+//
+
+import Cocoa
+typealias KMThemesItemActionCallback = (_ index: Int) -> ()
+class KMPageDisplayThemeCollectionViewItem: NSCollectionViewItem {
+
+    @IBOutlet weak var itemImageView: NSImageView!
+    
+    @IBOutlet weak var itemLabel: NSTextField!
+    
+    @IBOutlet weak var themesBox: KMBox!
+    @IBOutlet weak var vipImageView: NSImageView!
+    @IBOutlet weak var closeButton: NSButton!
+    var itemCallBack : KMThemesItemActionCallback!
+    var viewMode: KMPDFViewMode = .normal
+    
+    private var itemInteger: KMPDFViewMode = .normal
+    
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        self.closeButton.isHidden = true
+        self.itemImageView.wantsLayer = true
+        self.itemImageView.layer?.cornerRadius = 10
+        self.itemImageView.layer?.masksToBounds = true
+        self.itemImageView.layer?.borderWidth = 0.5
+        self.itemImageView.layer?.borderColor = NSColor.gridColor.cgColor
+    }
+    
+    private func swatchWithColor(color:NSColor,size:NSSize) -> NSImage {
+        let image = NSImage(size: size)
+        image.lockFocus()
+        color.drawSwatch(in: NSRect(x: 0, y: 0, width: size.width, height: size.height))
+        image.unlockFocus()
+        return image
+    }
+    
+    func themesCollectionCellItem(item:NSInteger, itemData:[NSColor]) {
+        let size = CGSize(width: 20, height: 20)
+        itemInteger = KMPDFViewMode(rawValue: UInt(item)) ?? .normal
+        
+        if itemInteger == .normal {
+            itemLabel.stringValue = NSLocalizedString("Light", comment: "")
+        } else if itemInteger == .soft {
+            itemLabel.stringValue = NSLocalizedString("Sepia", comment: "")
+        } else if itemInteger == .night {
+            itemLabel.stringValue = NSLocalizedString("Dark", comment: "")
+        } else if itemInteger == .green {
+            itemLabel.stringValue = NSLocalizedString("Reseda", comment: "")
+        } else if itemInteger == .themes1 || itemInteger == .themes2 || itemInteger == .themes3 || itemInteger == .themes4 {
+            itemLabel.stringValue = String(format: "%@%d", NSLocalizedString("Themes", comment: ""), itemInteger.rawValue - KMPDFViewMode.themes1.rawValue + 1)
+        }
+
+        let bgColor = itemData[item] 
+        self.itemImageView.layer?.backgroundColor = bgColor.cgColor
+
+        var viewMode: KMPDFViewMode = .normal
+        if let storedViewMode = UserDefaults.standard.value(forKey: "kPDFViewModeKey") as? Int {
+            viewMode = KMPDFViewMode(rawValue: UInt(storedViewMode)) ?? .normal
+        }
+
+        if itemInteger == viewMode {
+            self.themesBox.fillColor = KMAppearance.Status.selColor()
+        } else {
+            self.themesBox.fillColor = NSColor.clear
+        }
+
+        self.themesBox.moveCallback = { [weak self] mouseEntered, mouseBox in
+            guard let self = self else { return }
+
+            if mouseEntered {
+                if itemInteger.rawValue > 3 {
+//                    if !IAPProductsManager.defaultManager.isAvailableAllFunction {
+//                        self.closeButton.isHidden = true
+//                    } else {
+//                        self.closeButton.isHidden = false
+//                    }
+                }
+            } else {
+                closeButton.isHidden = true
+            }
+        }
+    }
+    
+}

+ 17 - 17
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/ViewPanel/KMPageDisplayThemeCollectionViewItem.xib

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22154" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22154"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
-        <customObject id="-2" userLabel="File's Owner" customClass="KMPageDisplayThemeCollectionViewItem" customModule="PDF_Office" customModuleProvider="target">
+        <customObject id="-2" userLabel="File's Owner" customClass="KMPageDisplayThemeCollectionViewItem" customModule="PDF_Master" customModuleProvider="target">
             <connections>
                 <outlet property="closeButton" destination="Ho0-7o-Web" id="Q0K-3U-jPF"/>
                 <outlet property="itemImageView" destination="PPa-Or-WHl" id="TAf-zw-q64"/>
@@ -18,26 +18,26 @@
         </customObject>
         <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
         <customObject id="-3" userLabel="Application" customClass="NSObject"/>
-        <customView identifier="KMPageDisplayThemeCollectionViewItem" id="3SZ-T6-0pc">
-            <rect key="frame" x="0.0" y="0.0" width="54" height="58"/>
+        <customView identifier="KMPageDisplayThemeCollectionViewItem" misplaced="YES" id="3SZ-T6-0pc">
+            <rect key="frame" x="0.0" y="0.0" width="58" height="64"/>
             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
             <subviews>
-                <box boxType="custom" borderWidth="0.0" cornerRadius="6" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="6e1-NQ-e52" customClass="KMBox">
-                    <rect key="frame" x="0.0" y="0.0" width="54" height="58"/>
+                <box boxType="custom" borderWidth="0.0" cornerRadius="6" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="6e1-NQ-e52" customClass="KMBox" customModule="PDF_Master" customModuleProvider="target">
+                    <rect key="frame" x="0.0" y="0.0" width="58" height="58"/>
                     <view key="contentView" id="S4n-a2-gfe">
-                        <rect key="frame" x="0.0" y="0.0" width="54" height="58"/>
+                        <rect key="frame" x="0.0" y="0.0" width="58" height="58"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
                             <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="PPa-Or-WHl">
-                                <rect key="frame" x="17" y="26" width="20" height="20"/>
+                                <rect key="frame" x="19" y="26" width="20" height="20"/>
                                 <constraints>
                                     <constraint firstAttribute="width" constant="20" id="gIT-Q6-tCy"/>
                                     <constraint firstAttribute="height" constant="20" id="yye-a8-JZi"/>
                                 </constraints>
                                 <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" id="G37-ze-AGO"/>
                             </imageView>
-                            <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="1SW-NV-wPQ">
-                                <rect key="frame" x="11" y="6" width="33" height="14"/>
+                            <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="1SW-NV-wPQ">
+                                <rect key="frame" x="13" y="6" width="33" height="14"/>
                                 <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="Nni-bT-Fwd">
                                     <font key="font" metaFont="smallSystem"/>
                                     <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@@ -45,18 +45,18 @@
                                 </textFieldCell>
                             </textField>
                             <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Ho0-7o-Web">
-                                <rect key="frame" x="38" y="42" width="16" height="16"/>
-                                <constraints>
-                                    <constraint firstAttribute="height" constant="16" id="GlF-Cn-mfR"/>
-                                    <constraint firstAttribute="width" constant="16" id="NhD-gS-6jN"/>
-                                </constraints>
+                                <rect key="frame" x="42" y="42" width="16" height="16"/>
                                 <buttonCell key="cell" type="bevel" bezelStyle="rounded" image="CPDFListViewImageNameCursorsFork" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="5BP-bL-plW">
                                     <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                     <font key="font" metaFont="system"/>
                                 </buttonCell>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="16" id="GlF-Cn-mfR"/>
+                                    <constraint firstAttribute="width" constant="16" id="NhD-gS-6jN"/>
+                                </constraints>
                             </button>
                             <imageView hidden="YES" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Gmv-j8-3Dr">
-                                <rect key="frame" x="34" y="38" width="20" height="20"/>
+                                <rect key="frame" x="38" y="38" width="20" height="20"/>
                                 <constraints>
                                     <constraint firstAttribute="width" constant="20" id="Ilk-pr-0HP"/>
                                     <constraint firstAttribute="height" constant="20" id="tF9-Zi-rH0"/>

+ 19 - 0
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/KMRightSideViewController.swift

@@ -17,6 +17,7 @@ enum RightSubViewType : Int {
     case Headerfooter
     case Background
     case Watermark
+    case ViewSettings
 }
 
 typealias KMRightSidePropertyDidChange = (_ model: AnyObject?) -> ()
@@ -37,6 +38,7 @@ class KMRightSideViewController: NSViewController,CipherTextViewDelegate {
     var model: AnyObject?
     
     weak var delegate: KMEditImagePropertyViewControllerDelegate?
+    weak var mainController: KMMainViewController?
     
     override func viewDidLoad() {
         super.viewDidLoad()
@@ -155,6 +157,8 @@ class KMRightSideViewController: NSViewController,CipherTextViewDelegate {
                 self.initBackgroundViewController()
             } else if subViewType == .Watermark {
                 self.initWatermarkViewController()
+            } else if subViewType == .ViewSettings {
+                self.initViewSettingsViewController()
             }
         }
         get {
@@ -330,6 +334,21 @@ class KMRightSideViewController: NSViewController,CipherTextViewDelegate {
         }
     }
     
+    private func initViewSettingsViewController() {
+        annotationProperties = KMAnnotationPropertiesViewController()
+        annotationProperties.view.frame = self.view.bounds
+        annotationProperties.view.autoresizingMask = [.height,.maxXMargin]
+        annotationProperties.mainController = mainController
+        annotationProperties.pdfView = listView
+        annotationProperties.openPropertiesType = .pageDisplay
+        annotationProperties.pageDisplayReaderMode = { [weak self] isReaderMode in
+            guard let self = self else { return }
+            mainController!.readMode(self)
+        }
+        annotationProperties.isEmptyAnnotation = false
+        contextBox.contentView = self.annotationProperties.view
+    }
+    
     //MARK: CipherTextViewDelegate
     func cipherTextViewButtonClicked(textView: CipherTextView, buttonIndex: Int) {
         if buttonIndex == 0 {

+ 2 - 2
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/KMRightSideViewController.xib

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22155" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22154" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22155"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22154"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>

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

@@ -1136,6 +1136,20 @@ extension KMMainViewController {
         KMPrintWindowController.printImage(image: image)
     }
     
+    func splitView(withTag tag: Int) {
+        if tag == 0 {
+            listView.viewSplitMode = KMPDFViewSplitMode.horizontal
+            singlePageScreen(isSinglePage: false, doublePagesScreen: false)
+        } else if tag == 1 {
+            listView.viewSplitMode = KMPDFViewSplitMode.vertical
+            singlePageScreen(isSinglePage: false, doublePagesScreen: true)
+        } else if tag == 2 {
+            listView.viewSplitMode = KMPDFViewSplitMode.disable
+            singlePageScreen(isSinglePage: true, doublePagesScreen: false)
+        }
+        listView.needsDisplay = true
+    }
+    
     // MARK: Redact 【密文标记】
     @objc func redact_menuItemClick_delete(sender: NSMenuItem?) {
         self.listView.remove(self.listView.activeAnnotation)
@@ -2085,6 +2099,24 @@ extension KMMainViewController {
         }
     }
     
+    @IBAction func toggleSplitPDF(_ sender: Any) {
+        if let menuItem = sender as? NSMenuItem {
+            splitView(withTag: menuItem.tag)
+        }
+    }
+    
+    @IBAction func readMode(_ sender: Any) {
+        isReadMode = !isReadMode
+        UserDefaults.standard.set(isReadMode, forKey: "kKMPDFViewIsReadMode")
+        UserDefaults.standard.synchronize()
+
+        if isReadMode {
+            CustomAlertView.alertView(message: NSLocalizedString("Read Mode On", comment: ""), fromView: (view.window?.contentView)!, withStyle: .black)
+        } else {
+            CustomAlertView.alertView(message: NSLocalizedString("Read Mode Off", comment: ""), fromView: (view.window?.contentView)!, withStyle: .black)
+        }
+    }
+    
     // MARK: -
     // MARK: 显示窗口
     
@@ -3750,6 +3782,10 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
                     self.km_beginSheet(windowC: windowC)
                 } else if toolbarItem.itemIdentifier == KMToolbarViewSettingIdentifier {
                     Swift.debugPrint("KMToolbarViewSettingIdentifier ...")
+                    rightSideViewController.mainController = self
+                    self.rightSideViewController.isHidden = false
+                    self.rightSideViewController.subViewType = .ViewSettings
+                    self.openRightPane()
                 } else if toolbarItem.itemIdentifier == KMToolbarSnapshotIdentifier {
                     self.listView.takeSnapshot(nil)
                 } else if toolbarItem.itemIdentifier == KMToolbarTTSIdentifier {

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

@@ -2434,6 +2434,42 @@ import Cocoa
 //        [swc setForceOnTop:[self interactionMode] != SKNormalMode];
         self.myDocument?.addWindowController(swc)
     }
+    
+    // MARK: Split View
+    
+    func changePDFDocument(isChange: Bool, replaceBlock: @escaping (String) -> Void) {
+        let openPanel = NSOpenPanel()
+        openPanel.allowedFileTypes = ["pdf", "PDF"]
+        openPanel.allowsMultipleSelection = false
+        
+        guard let mainWindow = NSApp.mainWindow else {
+            return
+        }
+        
+        openPanel.beginSheetModal(for: mainWindow) { [weak self] response in
+            if response == NSApplication.ModalResponse.OK {
+                guard let url = openPanel.url else {
+                    return
+                }
+                
+                if let document = CPDFDocument(url: url) {
+                    self!.secondaryPdfView.document = nil
+                    self!.secondaryPdfView.document = document
+                    
+                    if isChange {
+                        self!.openSecondaryPdfView!.view.removeFromSuperview()
+                    }
+                    
+                    replaceBlock(document.documentURL?.path ?? "")
+                } else {
+                    let alert = NSAlert()
+                    alert.alertStyle = .critical
+                    alert.messageText = NSLocalizedString("An error occurred while opening this document. The file is damaged and could not be repaired.", comment: "")
+                    alert.runModal()
+                }
+            }
+        }
+    }
 }
 
 extension KMMainViewController: KMEditImagePropertyViewControllerDelegate {