소스 검색

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

# Conflicts:
#	PDF Office/PDF Master.xcodeproj/project.pbxproj
#	PDF Office/PDF Master/Class/Appearance/KMAppearance.swift
jiajie 1 년 전
부모
커밋
a8df673566
100개의 변경된 파일8827개의 추가작업 그리고 28109개의 파일을 삭제
  1. 0 1
      PDF Office/PDF Master DMG/AppDelegate.swift
  2. 0 1
      PDF Office/PDF Master Pro/AppDelegate.swift
  3. 300 31
      PDF Office/PDF Master.xcodeproj/project.pbxproj
  4. 29 46
      PDF Office/PDF Master.xcodeproj/xcuserdata/kdanmobile.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
  5. 1106 120
      PDF Office/PDF Master.xcodeproj/xcuserdata/lizhe.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
  6. 0 1
      PDF Office/PDF Master/AppDelegate.swift
  7. 22 0
      PDF Office/PDF Master/Class/Appearance/Image.xcassets/Toolbar/KMImageNameToolbarSelected.imageset/Contents.json
  8. BIN
      PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Resources/KMAdvertisement.bundle/dark_brower_delect.pdf
  9. BIN
      PDF Office/PDF Master/Class/Appearance/Image.xcassets/Toolbar/KMImageNameToolbarSelected.imageset/ic_have.pdf
  10. 555 8
      PDF Office/PDF Master/Class/Appearance/KMAppearance.swift
  11. 4 4
      PDF Office/PDF Master/Class/ChromiumTabs/KMBrowserWindowController.swift
  12. 21 1
      PDF Office/PDF Master/Class/Common/Category/NSObject+KMExtension.swift
  13. 6 2
      PDF Office/PDF Master/Class/Common/Category/View/NSMenu+KMExtension.swift
  14. 2 2
      PDF Office/PDF Master/Class/Document/KMDocumentController.swift
  15. 88 0
      PDF Office/PDF Master/Class/Home/View/CreatPDFView/KMCreatPDFView.swift
  16. 172 0
      PDF Office/PDF Master/Class/Home/View/CreatPDFView/KMCreatPDFView.xib
  17. 2 2
      PDF Office/PDF Master/Class/Home/View/KMStepperView.swift
  18. 17 81
      PDF Office/PDF Master/Class/Home/ViewController/KMHomeViewController+Action.swift
  19. 215 183
      PDF Office/PDF Master/Class/Home/ViewController/KMHomeViewController.swift
  20. 78 321
      PDF Office/PDF Master/Class/Home/ViewController/KMHomeViewController.xib
  21. 25 26
      PDF Office/PDF Master/Class/Home/WindowController/KMDeviceBrowserWindowController.swift
  22. 4 3
      PDF Office/PDF Master/Class/Home/WindowController/KMDeviceBrowserWindowController.xib
  23. 3 2
      PDF Office/PDF Master/Class/Home/WindowController/KMHomeWindowController.xib
  24. 0 456
      PDF Office/PDF Master/Class/Home/WindowController/KMURLToPDFWindowController.swift
  25. 0 292
      PDF Office/PDF Master/Class/Home/WindowController/KMURLToPDFWindowController.xib
  26. 340 0
      PDF Office/PDF Master/Class/Home/WindowController/KMURLToPDFWindowController/KMURLToPDFWindowController.swift
  27. 267 0
      PDF Office/PDF Master/Class/Home/WindowController/KMURLToPDFWindowController/KMURLToPDFWindowController.xib
  28. 27 0
      PDF Office/PDF Master/Class/Home/WindowController/KMURLToPDFWindowController/Model/KMConvertURLToPDF.h
  29. 228 0
      PDF Office/PDF Master/Class/Home/WindowController/KMURLToPDFWindowController/Model/KMConvertURLToPDF.m
  30. 43 0
      PDF Office/PDF Master/Class/KMAdvertisement/Cache/KMAdvertisementCache.swift
  31. 14 2
      PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Headers/KMAdvertisementConfig.swift
  32. 74 74
      PDF Office/PDF Master/Class/KMAdvertisement/KMRecommondInfo.h
  33. 334 334
      PDF Office/PDF Master/Class/KMAdvertisement/KMRecommondInfo.m
  34. 69 69
      PDF Office/PDF Master/Class/KMAdvertisement/KMRecommondManager.h
  35. 174 174
      PDF Office/PDF Master/Class/KMAdvertisement/KMRecommondManager.m
  36. 277 0
      PDF Office/PDF Master/Class/KMAdvertisement/Manager/KMAdvertisementManager.swift
  37. 92 0
      PDF Office/PDF Master/Class/KMAdvertisement/Model/KMAdvertisementImage.swift
  38. 148 0
      PDF Office/PDF Master/Class/KMAdvertisement/Model/KMAdvertisementModel.swift
  39. 147 0
      PDF Office/PDF Master/Class/KMAdvertisement/Model/KMAdvertisementModelTransition.swift
  40. 0 0
      PDF Office/PDF Master/Class/KMAdvertisement/Model/KMAdvertisementTimeStampConversion.swift
  41. 0 0
      PDF Office/PDF Master/Class/KMAdvertisement/Request/KMAdvertisementRequestServer.swift
  42. 48 0
      PDF Office/PDF Master/Class/KMAdvertisement/View/Tableview/Cell/KMAdvertisementCollectionHeadView.swift
  43. 32 0
      PDF Office/PDF Master/Class/KMAdvertisement/View/Tableview/Cell/KMAdvertisementCollectionHeadView.xib
  44. 61 0
      PDF Office/PDF Master/Class/KMAdvertisement/View/Tableview/Cell/KMAdvertisementCollectionViewItem.swift
  45. 60 0
      PDF Office/PDF Master/Class/KMAdvertisement/View/Tableview/Cell/KMAdvertisementCollectionViewItem.xib
  46. 176 0
      PDF Office/PDF Master/Class/KMAdvertisement/View/Tableview/KMAdvertisementTableView.swift
  47. 57 0
      PDF Office/PDF Master/Class/KMAdvertisement/View/Tableview/KMAdvertisementTableView.xib
  48. 71 0
      PDF Office/PDF Master/Class/KMAdvertisement/View/View/KMAdvertisementShowView.swift
  49. 78 0
      PDF Office/PDF Master/Class/KMAdvertisement/View/View/KMAdvertisementShowView.xib
  50. 37 24
      PDF Office/PDF Master/Class/PDFTools/PageEdit/Controller/KMPDFEditViewController.swift
  51. 210 69
      PDF Office/PDF Master/Class/PDFTools/PageEdit/View/KMPDFEditToolbar.swift
  52. 0 18
      PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolBarBox.swift
  53. 0 107
      PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbar.h
  54. 0 1168
      PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbar.m
  55. 39 44
      PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbarController.swift
  56. 390 0
      PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbarCustomViewController.swift
  57. 358 0
      PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbarCustomViewController.xib
  58. 31 0
      PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbarCustomWindowController.swift
  59. 32 0
      PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbarCustomWindowController.xib
  60. 569 0
      PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbarItemView.swift
  61. 583 0
      PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbarView.swift
  62. 972 959
      PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbarViewController.swift
  63. 41 19
      PDF Office/PDF Master/Class/PDFWindowController/Toolbar/PublicKey.swift
  64. 67 12
      PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift
  65. 2 2
      PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+MenuAction.swift
  66. 16 25
      PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+UI.swift
  67. 8 8
      PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController.swift
  68. 2 0
      PDF Office/PDF Master/PDF_Master DMG-Bridging-Header.h
  69. 2 0
      PDF Office/PDF Master/PDF_Master Pro-Bridging-Header.h
  70. 2 1
      PDF Office/PDF Master/PDF_Master-Bridging-Header.h
  71. 0 1
      PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Headers
  72. 0 1
      PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/KMAdvertisement
  73. 0 1
      PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Modules
  74. 0 1
      PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Resources
  75. 0 998
      PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Headers/KMAdvertisement-Swift.h
  76. 0 21
      PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Headers/KMAdvertisement.h
  77. 0 391
      PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Headers/KMAdvertisementManager.swift
  78. 0 111
      PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Headers/KMAdvertisementModel.swift
  79. BIN
      PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/KMAdvertisement
  80. BIN
      PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Modules/KMAdvertisement.swiftmodule/Project/arm64-apple-macos.swiftsourceinfo
  81. BIN
      PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Modules/KMAdvertisement.swiftmodule/Project/x86_64-apple-macos.swiftsourceinfo
  82. 0 10313
      PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Modules/KMAdvertisement.swiftmodule/arm64-apple-macos.abi.json
  83. 0 301
      PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Modules/KMAdvertisement.swiftmodule/arm64-apple-macos.private.swiftinterface
  84. BIN
      PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Modules/KMAdvertisement.swiftmodule/arm64-apple-macos.swiftdoc
  85. 0 301
      PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Modules/KMAdvertisement.swiftmodule/arm64-apple-macos.swiftinterface
  86. BIN
      PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Modules/KMAdvertisement.swiftmodule/arm64-apple-macos.swiftmodule
  87. 0 10313
      PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Modules/KMAdvertisement.swiftmodule/x86_64-apple-macos.abi.json
  88. 0 301
      PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Modules/KMAdvertisement.swiftmodule/x86_64-apple-macos.private.swiftinterface
  89. BIN
      PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Modules/KMAdvertisement.swiftmodule/x86_64-apple-macos.swiftdoc
  90. 0 301
      PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Modules/KMAdvertisement.swiftmodule/x86_64-apple-macos.swiftinterface
  91. BIN
      PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Modules/KMAdvertisement.swiftmodule/x86_64-apple-macos.swiftmodule
  92. 0 11
      PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Modules/module.modulemap
  93. 0 51
      PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Resources/Info.plist
  94. BIN
      PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Resources/KMAdvertisement.bundle/1.jpg
  95. BIN
      PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Resources/KMAdvertisement.bundle/2.png
  96. BIN
      PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Resources/KMAdvertisement.bundle/3.png
  97. BIN
      PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Resources/KMAdvertisement.bundle/ad_cancel_button00@2x.png
  98. BIN
      PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Resources/KMAdvertisementCollectionHeadView.nib
  99. BIN
      PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Resources/KMAdvertisementCollectionViewItem.nib
  100. 0 0
      PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Resources/KMAdvertisementShowView.nib

+ 0 - 1
PDF Office/PDF Master DMG/AppDelegate.swift

@@ -6,7 +6,6 @@
 //
 
 import Cocoa
-import KMAdvertisement
 
 @main
 class AppDelegate: NSObject, NSApplicationDelegate {

+ 0 - 1
PDF Office/PDF Master Pro/AppDelegate.swift

@@ -6,7 +6,6 @@
 //
 
 import Cocoa
-import KMAdvertisement
 
 @main
 class AppDelegate: NSObject, NSApplicationDelegate {

+ 300 - 31
PDF Office/PDF Master.xcodeproj/project.pbxproj

@@ -64,12 +64,6 @@
 		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 */; };
-		89752D9A2936E675003FF08E /* KMToolBarBox.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89752D992936E675003FF08E /* KMToolBarBox.swift */; };
-		89752D9B2936E675003FF08E /* KMToolBarBox.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89752D992936E675003FF08E /* KMToolBarBox.swift */; };
-		89752D9C2936E675003FF08E /* KMToolBarBox.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89752D992936E675003FF08E /* KMToolBarBox.swift */; };
-		89752D9F2936EC50003FF08E /* KMToolbar.m in Sources */ = {isa = PBXBuildFile; fileRef = 89752D9D2936EC4F003FF08E /* KMToolbar.m */; };
-		89752DA02936EC50003FF08E /* KMToolbar.m in Sources */ = {isa = PBXBuildFile; fileRef = 89752D9D2936EC4F003FF08E /* KMToolbar.m */; };
-		89752DA12936EC50003FF08E /* KMToolbar.m in Sources */ = {isa = PBXBuildFile; fileRef = 89752D9D2936EC4F003FF08E /* KMToolbar.m */; };
 		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 */; };
@@ -1359,6 +1353,63 @@
 		ADAFD9EE2AE616B100F084BC /* FocusAwareSecureTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAFD9ED2AE616B100F084BC /* FocusAwareSecureTextField.swift */; };
 		ADAFD9EF2AE616B100F084BC /* FocusAwareSecureTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAFD9ED2AE616B100F084BC /* FocusAwareSecureTextField.swift */; };
 		ADAFD9F02AE616B100F084BC /* FocusAwareSecureTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAFD9ED2AE616B100F084BC /* FocusAwareSecureTextField.swift */; };
+		ADAFD9F32AE68A7400F084BC /* KMCreatPDFView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAFD9F22AE68A7400F084BC /* KMCreatPDFView.swift */; };
+		ADAFD9F42AE68A7400F084BC /* KMCreatPDFView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAFD9F22AE68A7400F084BC /* KMCreatPDFView.swift */; };
+		ADAFD9F52AE68A7400F084BC /* KMCreatPDFView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAFD9F22AE68A7400F084BC /* KMCreatPDFView.swift */; };
+		ADAFD9F72AE68A8500F084BC /* KMCreatPDFView.xib in Resources */ = {isa = PBXBuildFile; fileRef = ADAFD9F62AE68A8500F084BC /* KMCreatPDFView.xib */; };
+		ADAFD9F82AE68A8500F084BC /* KMCreatPDFView.xib in Resources */ = {isa = PBXBuildFile; fileRef = ADAFD9F62AE68A8500F084BC /* KMCreatPDFView.xib */; };
+		ADAFD9F92AE68A8500F084BC /* KMCreatPDFView.xib in Resources */ = {isa = PBXBuildFile; fileRef = ADAFD9F62AE68A8500F084BC /* KMCreatPDFView.xib */; };
+		ADAFDA032AE8BD5C00F084BC /* KMConvertURLToPDF.m in Sources */ = {isa = PBXBuildFile; fileRef = ADAFDA022AE8BD5C00F084BC /* KMConvertURLToPDF.m */; };
+		ADAFDA042AE8BD5C00F084BC /* KMConvertURLToPDF.m in Sources */ = {isa = PBXBuildFile; fileRef = ADAFDA022AE8BD5C00F084BC /* KMConvertURLToPDF.m */; };
+		ADAFDA052AE8BD5C00F084BC /* KMConvertURLToPDF.m in Sources */ = {isa = PBXBuildFile; fileRef = ADAFDA022AE8BD5C00F084BC /* KMConvertURLToPDF.m */; };
+		ADAFDA0D2AE8DD6600F084BC /* KMAdvertisementCollectionViewItem.xib in Resources */ = {isa = PBXBuildFile; fileRef = ADAFDA072AE8DD6600F084BC /* KMAdvertisementCollectionViewItem.xib */; };
+		ADAFDA0E2AE8DD6600F084BC /* KMAdvertisementCollectionViewItem.xib in Resources */ = {isa = PBXBuildFile; fileRef = ADAFDA072AE8DD6600F084BC /* KMAdvertisementCollectionViewItem.xib */; };
+		ADAFDA0F2AE8DD6600F084BC /* KMAdvertisementCollectionViewItem.xib in Resources */ = {isa = PBXBuildFile; fileRef = ADAFDA072AE8DD6600F084BC /* KMAdvertisementCollectionViewItem.xib */; };
+		ADAFDA102AE8DD6600F084BC /* KMAdvertisementCollectionHeadView.xib in Resources */ = {isa = PBXBuildFile; fileRef = ADAFDA082AE8DD6600F084BC /* KMAdvertisementCollectionHeadView.xib */; };
+		ADAFDA112AE8DD6600F084BC /* KMAdvertisementCollectionHeadView.xib in Resources */ = {isa = PBXBuildFile; fileRef = ADAFDA082AE8DD6600F084BC /* KMAdvertisementCollectionHeadView.xib */; };
+		ADAFDA122AE8DD6600F084BC /* KMAdvertisementCollectionHeadView.xib in Resources */ = {isa = PBXBuildFile; fileRef = ADAFDA082AE8DD6600F084BC /* KMAdvertisementCollectionHeadView.xib */; };
+		ADAFDA132AE8DD6600F084BC /* KMAdvertisementCollectionViewItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAFDA092AE8DD6600F084BC /* KMAdvertisementCollectionViewItem.swift */; };
+		ADAFDA142AE8DD6600F084BC /* KMAdvertisementCollectionViewItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAFDA092AE8DD6600F084BC /* KMAdvertisementCollectionViewItem.swift */; };
+		ADAFDA152AE8DD6600F084BC /* KMAdvertisementCollectionViewItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAFDA092AE8DD6600F084BC /* KMAdvertisementCollectionViewItem.swift */; };
+		ADAFDA162AE8DD6600F084BC /* KMAdvertisementCollectionHeadView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAFDA0A2AE8DD6600F084BC /* KMAdvertisementCollectionHeadView.swift */; };
+		ADAFDA172AE8DD6600F084BC /* KMAdvertisementCollectionHeadView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAFDA0A2AE8DD6600F084BC /* KMAdvertisementCollectionHeadView.swift */; };
+		ADAFDA182AE8DD6600F084BC /* KMAdvertisementCollectionHeadView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAFDA0A2AE8DD6600F084BC /* KMAdvertisementCollectionHeadView.swift */; };
+		ADAFDA192AE8DD6600F084BC /* KMAdvertisementTableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAFDA0B2AE8DD6600F084BC /* KMAdvertisementTableView.swift */; };
+		ADAFDA1A2AE8DD6600F084BC /* KMAdvertisementTableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAFDA0B2AE8DD6600F084BC /* KMAdvertisementTableView.swift */; };
+		ADAFDA1B2AE8DD6600F084BC /* KMAdvertisementTableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAFDA0B2AE8DD6600F084BC /* KMAdvertisementTableView.swift */; };
+		ADAFDA1C2AE8DD6600F084BC /* KMAdvertisementTableView.xib in Resources */ = {isa = PBXBuildFile; fileRef = ADAFDA0C2AE8DD6600F084BC /* KMAdvertisementTableView.xib */; };
+		ADAFDA1D2AE8DD6600F084BC /* KMAdvertisementTableView.xib in Resources */ = {isa = PBXBuildFile; fileRef = ADAFDA0C2AE8DD6600F084BC /* KMAdvertisementTableView.xib */; };
+		ADAFDA1E2AE8DD6600F084BC /* KMAdvertisementTableView.xib in Resources */ = {isa = PBXBuildFile; fileRef = ADAFDA0C2AE8DD6600F084BC /* KMAdvertisementTableView.xib */; };
+		ADAFDA252AE8DE1B00F084BC /* KMAdvertisementModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAFDA212AE8DE1B00F084BC /* KMAdvertisementModel.swift */; };
+		ADAFDA262AE8DE1B00F084BC /* KMAdvertisementModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAFDA212AE8DE1B00F084BC /* KMAdvertisementModel.swift */; };
+		ADAFDA272AE8DE1B00F084BC /* KMAdvertisementModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAFDA212AE8DE1B00F084BC /* KMAdvertisementModel.swift */; };
+		ADAFDA282AE8DE1B00F084BC /* KMAdvertisementModelTransition.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAFDA222AE8DE1B00F084BC /* KMAdvertisementModelTransition.swift */; };
+		ADAFDA292AE8DE1B00F084BC /* KMAdvertisementModelTransition.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAFDA222AE8DE1B00F084BC /* KMAdvertisementModelTransition.swift */; };
+		ADAFDA2A2AE8DE1B00F084BC /* KMAdvertisementModelTransition.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAFDA222AE8DE1B00F084BC /* KMAdvertisementModelTransition.swift */; };
+		ADAFDA2B2AE8DE1B00F084BC /* KMAdvertisementCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAFDA242AE8DE1B00F084BC /* KMAdvertisementCache.swift */; };
+		ADAFDA2C2AE8DE1B00F084BC /* KMAdvertisementCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAFDA242AE8DE1B00F084BC /* KMAdvertisementCache.swift */; };
+		ADAFDA2D2AE8DE1B00F084BC /* KMAdvertisementCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAFDA242AE8DE1B00F084BC /* KMAdvertisementCache.swift */; };
+		ADAFDA302AE8E45000F084BC /* KMAdvertisementConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAFDA2F2AE8E44F00F084BC /* KMAdvertisementConfig.swift */; };
+		ADAFDA312AE8E45000F084BC /* KMAdvertisementConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAFDA2F2AE8E44F00F084BC /* KMAdvertisementConfig.swift */; };
+		ADAFDA322AE8E45000F084BC /* KMAdvertisementConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAFDA2F2AE8E44F00F084BC /* KMAdvertisementConfig.swift */; };
+		ADAFDA342AE8EE9300F084BC /* KMAdvertisementImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAFDA332AE8EE9300F084BC /* KMAdvertisementImage.swift */; };
+		ADAFDA352AE8EE9300F084BC /* KMAdvertisementImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAFDA332AE8EE9300F084BC /* KMAdvertisementImage.swift */; };
+		ADAFDA362AE8EE9300F084BC /* KMAdvertisementImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAFDA332AE8EE9300F084BC /* KMAdvertisementImage.swift */; };
+		ADAFDA392AE8EEFF00F084BC /* KMAdvertisementRequestServer.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAFDA382AE8EEFF00F084BC /* KMAdvertisementRequestServer.swift */; };
+		ADAFDA3A2AE8EEFF00F084BC /* KMAdvertisementRequestServer.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAFDA382AE8EEFF00F084BC /* KMAdvertisementRequestServer.swift */; };
+		ADAFDA3B2AE8EEFF00F084BC /* KMAdvertisementRequestServer.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAFDA382AE8EEFF00F084BC /* KMAdvertisementRequestServer.swift */; };
+		ADAFDA3E2AE8F32400F084BC /* KMAdvertisementManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAFDA3D2AE8F32400F084BC /* KMAdvertisementManager.swift */; };
+		ADAFDA3F2AE8F32400F084BC /* KMAdvertisementManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAFDA3D2AE8F32400F084BC /* KMAdvertisementManager.swift */; };
+		ADAFDA402AE8F32400F084BC /* KMAdvertisementManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAFDA3D2AE8F32400F084BC /* KMAdvertisementManager.swift */; };
+		ADAFDA422AE8F3C400F084BC /* KMAdvertisementTimeStampConversion.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAFDA412AE8F3C400F084BC /* KMAdvertisementTimeStampConversion.swift */; };
+		ADAFDA432AE8F3C400F084BC /* KMAdvertisementTimeStampConversion.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAFDA412AE8F3C400F084BC /* KMAdvertisementTimeStampConversion.swift */; };
+		ADAFDA442AE8F3C400F084BC /* KMAdvertisementTimeStampConversion.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAFDA412AE8F3C400F084BC /* KMAdvertisementTimeStampConversion.swift */; };
+		ADAFDA482AEA7F1300F084BC /* KMAdvertisementShowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAFDA472AEA7F1200F084BC /* KMAdvertisementShowView.swift */; };
+		ADAFDA492AEA7F1300F084BC /* KMAdvertisementShowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAFDA472AEA7F1200F084BC /* KMAdvertisementShowView.swift */; };
+		ADAFDA4A2AEA7F1300F084BC /* KMAdvertisementShowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAFDA472AEA7F1200F084BC /* KMAdvertisementShowView.swift */; };
+		ADAFDA4C2AEA7F2700F084BC /* KMAdvertisementShowView.xib in Resources */ = {isa = PBXBuildFile; fileRef = ADAFDA4B2AEA7F2700F084BC /* KMAdvertisementShowView.xib */; };
+		ADAFDA4D2AEA7F2700F084BC /* KMAdvertisementShowView.xib in Resources */ = {isa = PBXBuildFile; fileRef = ADAFDA4B2AEA7F2700F084BC /* KMAdvertisementShowView.xib */; };
+		ADAFDA4E2AEA7F2700F084BC /* KMAdvertisementShowView.xib in Resources */ = {isa = PBXBuildFile; fileRef = ADAFDA4B2AEA7F2700F084BC /* KMAdvertisementShowView.xib */; };
 		ADB2D6E6294740F30029D2B3 /* KMPrintPaperSetWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADB2D6E4294740F30029D2B3 /* KMPrintPaperSetWindowController.swift */; };
 		ADB2D6E7294740F30029D2B3 /* KMPrintPaperSetWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADB2D6E4294740F30029D2B3 /* KMPrintPaperSetWindowController.swift */; };
 		ADB2D6E8294740F30029D2B3 /* KMPrintPaperSetWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADB2D6E4294740F30029D2B3 /* KMPrintPaperSetWindowController.swift */; };
@@ -1642,9 +1693,6 @@
 		ADE3C1C929A5A75E00793B13 /* AFNetworking.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ADE3C1C729A5A75E00793B13 /* AFNetworking.framework */; };
 		ADE3C1CC29A5A7EE00793B13 /* AFNetworking.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ADE3C1C729A5A75E00793B13 /* AFNetworking.framework */; };
 		ADE3C1CD29A5A7EE00793B13 /* AFNetworking.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = ADE3C1C729A5A75E00793B13 /* AFNetworking.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
-		ADE3C1D329A5A91600793B13 /* KMAdvertisement.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ADE3C1D129A5A91600793B13 /* KMAdvertisement.framework */; };
-		ADE3C1D529A5A91C00793B13 /* KMAdvertisement.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ADE3C1D129A5A91600793B13 /* KMAdvertisement.framework */; };
-		ADE3C1D629A5A91C00793B13 /* KMAdvertisement.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = ADE3C1D129A5A91600793B13 /* KMAdvertisement.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		ADE3C1DE29A5AA0B00793B13 /* KMRequestServer.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADE3C1DD29A5AA0B00793B13 /* KMRequestServer.swift */; };
 		ADE3C1DF29A5AA0B00793B13 /* KMRequestServer.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADE3C1DD29A5AA0B00793B13 /* KMRequestServer.swift */; };
 		ADE3C1E029A5AA0B00793B13 /* KMRequestServer.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADE3C1DD29A5AA0B00793B13 /* KMRequestServer.swift */; };
@@ -2563,6 +2611,12 @@
 		BB8F4586295B19AC0037EA22 /* KMHeaderFooterDateInfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB8F4585295B19AC0037EA22 /* KMHeaderFooterDateInfoView.swift */; };
 		BB8F4587295B19AC0037EA22 /* KMHeaderFooterDateInfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB8F4585295B19AC0037EA22 /* KMHeaderFooterDateInfoView.swift */; };
 		BB8F4588295B19AC0037EA22 /* KMHeaderFooterDateInfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB8F4585295B19AC0037EA22 /* KMHeaderFooterDateInfoView.swift */; };
+		BB93CDE52AE757A000B29C57 /* KMToolbarItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB93CDE42AE757A000B29C57 /* KMToolbarItemView.swift */; };
+		BB93CDE62AE757A000B29C57 /* KMToolbarItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB93CDE42AE757A000B29C57 /* KMToolbarItemView.swift */; };
+		BB93CDE72AE757A000B29C57 /* KMToolbarItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB93CDE42AE757A000B29C57 /* KMToolbarItemView.swift */; };
+		BB93CDE92AE7B6E100B29C57 /* KMToolbarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB93CDE82AE7B6E100B29C57 /* KMToolbarView.swift */; };
+		BB93CDEA2AE7B6E100B29C57 /* KMToolbarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB93CDE82AE7B6E100B29C57 /* KMToolbarView.swift */; };
+		BB93CDEB2AE7B6E100B29C57 /* KMToolbarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB93CDE82AE7B6E100B29C57 /* KMToolbarView.swift */; };
 		BB9695B229BDA46500FD68D3 /* SKLocalization.m in Sources */ = {isa = PBXBuildFile; fileRef = BB9695B129BDA46500FD68D3 /* SKLocalization.m */; };
 		BB9695B329BDA46500FD68D3 /* SKLocalization.m in Sources */ = {isa = PBXBuildFile; fileRef = BB9695B129BDA46500FD68D3 /* SKLocalization.m */; };
 		BB9695B429BDA46500FD68D3 /* SKLocalization.m in Sources */ = {isa = PBXBuildFile; fileRef = BB9695B129BDA46500FD68D3 /* SKLocalization.m */; };
@@ -2695,6 +2749,9 @@
 		BBB1A3A629F6B66400E54E47 /* NSPanel+KMExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBB1A3A529F6B66400E54E47 /* NSPanel+KMExtension.swift */; };
 		BBB1A3A729F6B66400E54E47 /* NSPanel+KMExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBB1A3A529F6B66400E54E47 /* NSPanel+KMExtension.swift */; };
 		BBB1A3A829F6B66400E54E47 /* NSPanel+KMExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBB1A3A529F6B66400E54E47 /* NSPanel+KMExtension.swift */; };
+		BBB29BCE2AEA190D005F1B6B /* KMToolbarCustomViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BBB29BCB2AEA190D005F1B6B /* KMToolbarCustomViewController.xib */; };
+		BBB29BCF2AEA190E005F1B6B /* KMToolbarCustomViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BBB29BCB2AEA190D005F1B6B /* KMToolbarCustomViewController.xib */; };
+		BBB29BD02AEA190E005F1B6B /* KMToolbarCustomViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BBB29BCB2AEA190D005F1B6B /* KMToolbarCustomViewController.xib */; };
 		BBB5C80729F4CEE40054F261 /* KMLinkAnnotationPropertyEmptyController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBB5C80629F4CEE40054F261 /* KMLinkAnnotationPropertyEmptyController.swift */; };
 		BBB5C80829F4CEE40054F261 /* KMLinkAnnotationPropertyEmptyController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBB5C80629F4CEE40054F261 /* KMLinkAnnotationPropertyEmptyController.swift */; };
 		BBB5C80929F4CEE40054F261 /* KMLinkAnnotationPropertyEmptyController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBB5C80629F4CEE40054F261 /* KMLinkAnnotationPropertyEmptyController.swift */; };
@@ -2854,6 +2911,15 @@
 		BBC4F9FA2AEB9E200098A1A8 /* KMBatchTableCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBC4F9F92AEB9E200098A1A8 /* KMBatchTableCellView.swift */; };
 		BBC4F9FB2AEB9E200098A1A8 /* KMBatchTableCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBC4F9F92AEB9E200098A1A8 /* KMBatchTableCellView.swift */; };
 		BBC4F9FC2AEB9E200098A1A8 /* KMBatchTableCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBC4F9F92AEB9E200098A1A8 /* KMBatchTableCellView.swift */; };
+		BBC70EA92AEA6EF800AC1585 /* KMToolbarCustomWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BBC70EA62AEA6EF700AC1585 /* KMToolbarCustomWindowController.xib */; };
+		BBC70EAA2AEA6EF800AC1585 /* KMToolbarCustomWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BBC70EA62AEA6EF700AC1585 /* KMToolbarCustomWindowController.xib */; };
+		BBC70EAB2AEA6EF800AC1585 /* KMToolbarCustomWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BBC70EA62AEA6EF700AC1585 /* KMToolbarCustomWindowController.xib */; };
+		BBC70EB02AEA80EC00AC1585 /* KMToolbarCustomWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBC70EAF2AEA80EC00AC1585 /* KMToolbarCustomWindowController.swift */; };
+		BBC70EB12AEA80EC00AC1585 /* KMToolbarCustomWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBC70EAF2AEA80EC00AC1585 /* KMToolbarCustomWindowController.swift */; };
+		BBC70EB22AEA80EC00AC1585 /* KMToolbarCustomWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBC70EAF2AEA80EC00AC1585 /* KMToolbarCustomWindowController.swift */; };
+		BBC70EB42AEA847500AC1585 /* KMToolbarCustomViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBC70EB32AEA847500AC1585 /* KMToolbarCustomViewController.swift */; };
+		BBC70EB52AEA847500AC1585 /* KMToolbarCustomViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBC70EB32AEA847500AC1585 /* KMToolbarCustomViewController.swift */; };
+		BBC70EB62AEA847500AC1585 /* KMToolbarCustomViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBC70EB32AEA847500AC1585 /* KMToolbarCustomViewController.swift */; };
 		BBC745EA295F067B0072C2ED /* KMCropSettingWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBC745E8295F067B0072C2ED /* KMCropSettingWindowController.swift */; };
 		BBC745EB295F067B0072C2ED /* KMCropSettingWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBC745E8295F067B0072C2ED /* KMCropSettingWindowController.swift */; };
 		BBC745EC295F067B0072C2ED /* KMCropSettingWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBC745E8295F067B0072C2ED /* KMCropSettingWindowController.swift */; };
@@ -2914,8 +2980,6 @@
 		BBD7FDFE2A13210A00F96075 /* ComPDFKit_Conversion.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = ADA08A8029F13EE1009B2A7B /* ComPDFKit_Conversion.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		BBD7FDFF2A13210C00F96075 /* ComPDFKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ADA08A7C29F13EA0009B2A7B /* ComPDFKit.framework */; };
 		BBD7FE002A13210C00F96075 /* ComPDFKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = ADA08A7C29F13EA0009B2A7B /* ComPDFKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
-		BBD7FE012A13211700F96075 /* KMAdvertisement.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ADE3C1D129A5A91600793B13 /* KMAdvertisement.framework */; };
-		BBD7FE022A13211700F96075 /* KMAdvertisement.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = ADE3C1D129A5A91600793B13 /* KMAdvertisement.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		BBD7FE032A13218E00F96075 /* KMWatermarkAdjectivePropertyBaseController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB897234294B38DC0045787C /* KMWatermarkAdjectivePropertyBaseController.swift */; };
 		BBD7FE042A13218F00F96075 /* KMWatermarkAdjectivePropertyBaseController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB897234294B38DC0045787C /* KMWatermarkAdjectivePropertyBaseController.swift */; };
 		BBD7FE052A1323A400F96075 /* KMEditImagePropertyViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89E9B404295D268E00AEFA61 /* KMEditImagePropertyViewController.swift */; };
@@ -3225,7 +3289,6 @@
 				AD8DD29F2A97249B007CC9D0 /* libonnxruntime.1.14.1.dylib in Embed Frameworks */,
 				BB9DCC9D2A0A104E0024A6F1 /* ComDocumentAIKit.framework in Embed Frameworks */,
 				89752DAC2936ECED003FF08E /* Masonry.framework in Embed Frameworks */,
-				ADE3C1D629A5A91C00793B13 /* KMAdvertisement.framework in Embed Frameworks */,
 				ADA08A8529F1430E009B2A7B /* ComPDFKit.framework in Embed Frameworks */,
 				BBB9B33A299A5FD1004F3235 /* ObjectiveDropboxOfficial.framework in Embed Frameworks */,
 				BB9DCC942A09FCA50024A6F1 /* libopencv_world.4.2.dylib in Embed Frameworks */,
@@ -3250,7 +3313,6 @@
 			dstPath = "";
 			dstSubfolderSpec = 10;
 			files = (
-				BBD7FE022A13211700F96075 /* KMAdvertisement.framework in Embed Frameworks */,
 				BBD7FDFE2A13210A00F96075 /* ComPDFKit_Conversion.framework in Embed Frameworks */,
 				9F00CCC12A2F251800AC462E /* Sparkle.framework in Embed Frameworks */,
 				9FC444FB2AA61EDE00D7187C /* ZipArchive.framework in Embed Frameworks */,
@@ -3290,9 +3352,6 @@
 		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>"; };
-		89752D992936E675003FF08E /* KMToolBarBox.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMToolBarBox.swift; sourceTree = "<group>"; };
-		89752D9D2936EC4F003FF08E /* KMToolbar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KMToolbar.m; sourceTree = "<group>"; };
-		89752D9E2936EC50003FF08E /* KMToolbar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KMToolbar.h; 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>"; };
@@ -3786,6 +3845,26 @@
 		ADAC0DE02AC273D600FD4F52 /* KMOCToolClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMOCToolClass.swift; sourceTree = "<group>"; };
 		ADAC0DE42AC2B04800FD4F52 /* KMNoteTypeImageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMNoteTypeImageView.swift; sourceTree = "<group>"; };
 		ADAFD9ED2AE616B100F084BC /* FocusAwareSecureTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FocusAwareSecureTextField.swift; sourceTree = "<group>"; };
+		ADAFD9F22AE68A7400F084BC /* KMCreatPDFView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMCreatPDFView.swift; sourceTree = "<group>"; };
+		ADAFD9F62AE68A8500F084BC /* KMCreatPDFView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMCreatPDFView.xib; sourceTree = "<group>"; };
+		ADAFDA012AE8BD5B00F084BC /* KMConvertURLToPDF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KMConvertURLToPDF.h; sourceTree = "<group>"; };
+		ADAFDA022AE8BD5C00F084BC /* KMConvertURLToPDF.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KMConvertURLToPDF.m; sourceTree = "<group>"; };
+		ADAFDA072AE8DD6600F084BC /* KMAdvertisementCollectionViewItem.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = KMAdvertisementCollectionViewItem.xib; sourceTree = "<group>"; };
+		ADAFDA082AE8DD6600F084BC /* KMAdvertisementCollectionHeadView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = KMAdvertisementCollectionHeadView.xib; sourceTree = "<group>"; };
+		ADAFDA092AE8DD6600F084BC /* KMAdvertisementCollectionViewItem.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KMAdvertisementCollectionViewItem.swift; sourceTree = "<group>"; };
+		ADAFDA0A2AE8DD6600F084BC /* KMAdvertisementCollectionHeadView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KMAdvertisementCollectionHeadView.swift; sourceTree = "<group>"; };
+		ADAFDA0B2AE8DD6600F084BC /* KMAdvertisementTableView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KMAdvertisementTableView.swift; sourceTree = "<group>"; };
+		ADAFDA0C2AE8DD6600F084BC /* KMAdvertisementTableView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = KMAdvertisementTableView.xib; sourceTree = "<group>"; };
+		ADAFDA212AE8DE1B00F084BC /* KMAdvertisementModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KMAdvertisementModel.swift; sourceTree = "<group>"; };
+		ADAFDA222AE8DE1B00F084BC /* KMAdvertisementModelTransition.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KMAdvertisementModelTransition.swift; sourceTree = "<group>"; };
+		ADAFDA242AE8DE1B00F084BC /* KMAdvertisementCache.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KMAdvertisementCache.swift; sourceTree = "<group>"; };
+		ADAFDA2F2AE8E44F00F084BC /* KMAdvertisementConfig.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KMAdvertisementConfig.swift; sourceTree = "<group>"; };
+		ADAFDA332AE8EE9300F084BC /* KMAdvertisementImage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KMAdvertisementImage.swift; sourceTree = "<group>"; };
+		ADAFDA382AE8EEFF00F084BC /* KMAdvertisementRequestServer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KMAdvertisementRequestServer.swift; sourceTree = "<group>"; };
+		ADAFDA3D2AE8F32400F084BC /* KMAdvertisementManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KMAdvertisementManager.swift; sourceTree = "<group>"; };
+		ADAFDA412AE8F3C400F084BC /* KMAdvertisementTimeStampConversion.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KMAdvertisementTimeStampConversion.swift; sourceTree = "<group>"; };
+		ADAFDA472AEA7F1200F084BC /* KMAdvertisementShowView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMAdvertisementShowView.swift; sourceTree = "<group>"; };
+		ADAFDA4B2AEA7F2700F084BC /* KMAdvertisementShowView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMAdvertisementShowView.xib; sourceTree = "<group>"; };
 		ADB2D6E4294740F30029D2B3 /* KMPrintPaperSetWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMPrintPaperSetWindowController.swift; sourceTree = "<group>"; };
 		ADB2D6E5294740F30029D2B3 /* KMPrintPaperSetWindowController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMPrintPaperSetWindowController.xib; sourceTree = "<group>"; };
 		ADB2D6EC2947415E0029D2B3 /* KMPrintPaperSetView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMPrintPaperSetView.swift; sourceTree = "<group>"; };
@@ -3882,7 +3961,6 @@
 		ADE3C1BF29A4C13700793B13 /* KMPrintAccessoryController_OC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KMPrintAccessoryController_OC.m; sourceTree = "<group>"; };
 		ADE3C1C029A4C13700793B13 /* KMPrintAccessoryController_OC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMPrintAccessoryController_OC.xib; sourceTree = "<group>"; };
 		ADE3C1C729A5A75E00793B13 /* AFNetworking.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = AFNetworking.framework; sourceTree = "<group>"; };
-		ADE3C1D129A5A91600793B13 /* KMAdvertisement.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = KMAdvertisement.framework; sourceTree = "<group>"; };
 		ADE3C1DD29A5AA0B00793B13 /* KMRequestServer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMRequestServer.swift; sourceTree = "<group>"; };
 		ADE3C1E229A5ABC200793B13 /* KMLoginWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMLoginWindowController.swift; sourceTree = "<group>"; };
 		ADE3C1E329A5ABC200793B13 /* KMLoginWindowController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMLoginWindowController.xib; sourceTree = "<group>"; };
@@ -4271,6 +4349,8 @@
 		BB8F457D295B00130037EA22 /* KMWatermarkAdjectiveTools.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMWatermarkAdjectiveTools.swift; sourceTree = "<group>"; };
 		BB8F4581295B0F900037EA22 /* KMHeaderFooterMarginInfoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMHeaderFooterMarginInfoView.swift; sourceTree = "<group>"; };
 		BB8F4585295B19AC0037EA22 /* KMHeaderFooterDateInfoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMHeaderFooterDateInfoView.swift; sourceTree = "<group>"; };
+		BB93CDE42AE757A000B29C57 /* KMToolbarItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMToolbarItemView.swift; sourceTree = "<group>"; };
+		BB93CDE82AE7B6E100B29C57 /* KMToolbarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMToolbarView.swift; sourceTree = "<group>"; };
 		BB9695B029BDA46500FD68D3 /* SKLocalization.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SKLocalization.h; sourceTree = "<group>"; };
 		BB9695B129BDA46500FD68D3 /* SKLocalization.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SKLocalization.m; sourceTree = "<group>"; };
 		BB9695B529BDB03E00FD68D3 /* InfoWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = InfoWindow.xib; sourceTree = "<group>"; };
@@ -4319,6 +4399,7 @@
 		BBB14A6229792D6900936EDB /* KMRedactPageRangeContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMRedactPageRangeContentView.swift; sourceTree = "<group>"; };
 		BBB1A39D29F6128200E54E47 /* KMSystemMenu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMSystemMenu.swift; sourceTree = "<group>"; };
 		BBB1A3A529F6B66400E54E47 /* NSPanel+KMExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSPanel+KMExtension.swift"; sourceTree = "<group>"; };
+		BBB29BCB2AEA190D005F1B6B /* KMToolbarCustomViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = KMToolbarCustomViewController.xib; sourceTree = "<group>"; };
 		BBB5C80629F4CEE40054F261 /* KMLinkAnnotationPropertyEmptyController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMLinkAnnotationPropertyEmptyController.swift; sourceTree = "<group>"; };
 		BBB7B4882A033F6200B58A5A /* KMThumbnailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMThumbnailView.swift; sourceTree = "<group>"; };
 		BBB7B48C2A0384E100B58A5A /* NSCollectionViewItem+KMExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSCollectionViewItem+KMExtension.swift"; sourceTree = "<group>"; };
@@ -4385,6 +4466,9 @@
 		BBC4F9ED2AEB58470098A1A8 /* KMAlertWindowController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = KMAlertWindowController.xib; sourceTree = "<group>"; };
 		BBC4F9F52AEB69940098A1A8 /* NSArray+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSArray+Extension.swift"; sourceTree = "<group>"; };
 		BBC4F9F92AEB9E200098A1A8 /* KMBatchTableCellView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMBatchTableCellView.swift; sourceTree = "<group>"; };
+		BBC70EA62AEA6EF700AC1585 /* KMToolbarCustomWindowController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = KMToolbarCustomWindowController.xib; sourceTree = "<group>"; };
+		BBC70EAF2AEA80EC00AC1585 /* KMToolbarCustomWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMToolbarCustomWindowController.swift; sourceTree = "<group>"; };
+		BBC70EB32AEA847500AC1585 /* KMToolbarCustomViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMToolbarCustomViewController.swift; sourceTree = "<group>"; };
 		BBC745E8295F067B0072C2ED /* KMCropSettingWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMCropSettingWindowController.swift; sourceTree = "<group>"; };
 		BBC745E9295F067B0072C2ED /* KMCropSettingWindowController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMCropSettingWindowController.xib; sourceTree = "<group>"; };
 		BBC745F1295F0DD00072C2ED /* KMCropSettingPageSizeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMCropSettingPageSizeView.swift; sourceTree = "<group>"; };
@@ -4527,7 +4611,6 @@
 				BB9DCC892A09FC760024A6F1 /* libopencv_world.4.2.dylib in Frameworks */,
 				ADE3C1CC29A5A7EE00793B13 /* AFNetworking.framework in Frameworks */,
 				BBB9B339299A5FD1004F3235 /* ObjectiveDropboxOfficial.framework in Frameworks */,
-				ADE3C1D529A5A91C00793B13 /* KMAdvertisement.framework in Frameworks */,
 				BB9DCC9C2A0A104E0024A6F1 /* ComDocumentAIKit.framework in Frameworks */,
 				BBF5D4A52A5FD2A000D09418 /* AppCenterAnalytics.framework in Frameworks */,
 				89D9896328FD23AE003A3E87 /* PDFKit.framework in Frameworks */,
@@ -4577,7 +4660,6 @@
 				9F00CF612A386C7400AC462E /* FirebaseInstallations.framework in Frameworks */,
 				9F00CF7B2A386DC500AC462E /* FirebaseCoreDiagnostics.framework in Frameworks */,
 				BBB9B337299A5F35004F3235 /* ObjectiveDropboxOfficial.framework in Frameworks */,
-				ADE3C1D329A5A91600793B13 /* KMAdvertisement.framework in Frameworks */,
 				BB9DCC9A2A0A10410024A6F1 /* ComDocumentAIKit.framework in Frameworks */,
 				9F00CF6E2A386D8D00AC462E /* PromisesObjC.framework in Frameworks */,
 				9F00CF782A386DC400AC462E /* GoogleAppMeasurement.framework in Frameworks */,
@@ -4637,7 +4719,6 @@
 				BBD7FDFD2A13210A00F96075 /* ComPDFKit_Conversion.framework in Frameworks */,
 				AD8DD29D2A972492007CC9D0 /* libpaddle2onnx.1.0.7.dylib in Frameworks */,
 				9F00CF4F2A38655500AC462E /* FirebaseCore.framework in Frameworks */,
-				BBD7FE012A13211700F96075 /* KMAdvertisement.framework in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -4741,19 +4822,22 @@
 				89752DF52938A236003FF08E /* PublicKey.swift */,
 				89752DF129389F82003FF08E /* KMToolbarItem.h */,
 				89752DF029389F81003FF08E /* KMToolbarItem.m */,
-				89752D9E2936EC50003FF08E /* KMToolbar.h */,
-				89752D9D2936EC4F003FF08E /* KMToolbar.m */,
+				BB93CDE82AE7B6E100B29C57 /* KMToolbarView.swift */,
+				BB93CDE42AE757A000B29C57 /* KMToolbarItemView.swift */,
 				89752DE8293875FC003FF08E /* KMMainToolbarController.swift */,
 				89752DE9293875FC003FF08E /* KMMainToolbarController.xib */,
 				89752E022939DB42003FF08E /* KMToolbarViewController.swift */,
 				89752E032939DB42003FF08E /* KMToolbarViewController.xib */,
 				9FCFEC832AD0EF6700EAD2CB /* KMCustomButtonPopMenuViewController.swift */,
 				89752DAD2936F505003FF08E /* KMCustomButtonPopMenuViewController.xib */,
-				89752D992936E675003FF08E /* KMToolBarBox.swift */,
 				9FDD0FB5295D5230000C4DAD /* KMToolbarController.swift */,
 				9FDD0FB6295D5230000C4DAD /* KMToolbarController.xib */,
 				9FCFEC7F2AD0E74C00EAD2CB /* KMPopMenuButtonCell.swift */,
 				9FCFEC872AD0EF9900EAD2CB /* KMPopMenuButton.swift */,
+				BBC70EB32AEA847500AC1585 /* KMToolbarCustomViewController.swift */,
+				BBB29BCB2AEA190D005F1B6B /* KMToolbarCustomViewController.xib */,
+				BBC70EAF2AEA80EC00AC1585 /* KMToolbarCustomWindowController.swift */,
+				BBC70EA62AEA6EF700AC1585 /* KMToolbarCustomWindowController.xib */,
 			);
 			path = Toolbar;
 			sourceTree = "<group>";
@@ -4769,7 +4853,6 @@
 				9F00CCC42A2F2E2400AC462E /* AppCenterCrashes.framework */,
 				9F00CCB52A2F1E0F00AC462E /* Sparkle */,
 				9F00CCB32A2F1E0100AC462E /* Sparkle.framework */,
-				ADE3C1D129A5A91600793B13 /* KMAdvertisement.framework */,
 				ADE3C1C729A5A75E00793B13 /* AFNetworking.framework */,
 				BBB9B335299A5F35004F3235 /* ObjectiveDropboxOfficial.framework */,
 				89752DA32936ECD5003FF08E /* Masonry.framework */,
@@ -5383,6 +5466,7 @@
 		9F78EFD228F81EF9001E66F4 /* View */ = {
 			isa = PBXGroup;
 			children = (
+				ADAFD9F12AE68A3600F084BC /* CreatPDFView */,
 				9FA607D828F8227500B46586 /* KMBox.swift */,
 				9FBA0EF428FFC8A0001117AF /* KMCollectionView.swift */,
 				9F705F88291E576D005199AD /* KMTableView.swift */,
@@ -5446,12 +5530,11 @@
 		9F78EFD428F81F1A001E66F4 /* WindowController */ = {
 			isa = PBXGroup;
 			children = (
+				ADAFD9FB2AE8AE9800F084BC /* KMURLToPDFWindowController */,
 				899700DD28F3A9F2009AF911 /* KMHomeWindowController.swift */,
 				899700DE28F3A9F2009AF911 /* KMHomeWindowController.xib */,
 				9F705F74291A3A84005199AD /* KMHistoryFileDeleteWindowController.swift */,
 				9F705F75291A3A84005199AD /* KMHistoryFileDeleteWindowController.xib */,
-				9F0CB5402986953A00007028 /* KMURLToPDFWindowController.swift */,
-				9F0CB5412986953A00007028 /* KMURLToPDFWindowController.xib */,
 				9FD0FA4929D43D6800F2AB0D /* KMDeviceBrowserWindowController.swift */,
 				9FD0FA4A29D43D6800F2AB0D /* KMDeviceBrowserWindowController.xib */,
 				9F02018C2A1DDAA500C9B673 /* KMAITranslationWindowController.swift */,
@@ -5966,6 +6049,116 @@
 			path = FocusAwareSecureTextField;
 			sourceTree = "<group>";
 		};
+		ADAFD9F12AE68A3600F084BC /* CreatPDFView */ = {
+			isa = PBXGroup;
+			children = (
+				ADAFD9F22AE68A7400F084BC /* KMCreatPDFView.swift */,
+				ADAFD9F62AE68A8500F084BC /* KMCreatPDFView.xib */,
+			);
+			path = CreatPDFView;
+			sourceTree = "<group>";
+		};
+		ADAFD9FB2AE8AE9800F084BC /* KMURLToPDFWindowController */ = {
+			isa = PBXGroup;
+			children = (
+				9F0CB5402986953A00007028 /* KMURLToPDFWindowController.swift */,
+				9F0CB5412986953A00007028 /* KMURLToPDFWindowController.xib */,
+				ADAFD9FC2AE8AEA900F084BC /* Model */,
+			);
+			path = KMURLToPDFWindowController;
+			sourceTree = "<group>";
+		};
+		ADAFD9FC2AE8AEA900F084BC /* Model */ = {
+			isa = PBXGroup;
+			children = (
+				ADAFDA012AE8BD5B00F084BC /* KMConvertURLToPDF.h */,
+				ADAFDA022AE8BD5C00F084BC /* KMConvertURLToPDF.m */,
+			);
+			path = Model;
+			sourceTree = "<group>";
+		};
+		ADAFDA062AE8DD6600F084BC /* Cell */ = {
+			isa = PBXGroup;
+			children = (
+				ADAFDA092AE8DD6600F084BC /* KMAdvertisementCollectionViewItem.swift */,
+				ADAFDA072AE8DD6600F084BC /* KMAdvertisementCollectionViewItem.xib */,
+				ADAFDA0A2AE8DD6600F084BC /* KMAdvertisementCollectionHeadView.swift */,
+				ADAFDA082AE8DD6600F084BC /* KMAdvertisementCollectionHeadView.xib */,
+			);
+			path = Cell;
+			sourceTree = "<group>";
+		};
+		ADAFDA1F2AE8DD6B00F084BC /* View */ = {
+			isa = PBXGroup;
+			children = (
+				ADAFDA462AEA7EEE00F084BC /* View */,
+				ADAFDA452AEA7EE800F084BC /* Tableview */,
+			);
+			path = View;
+			sourceTree = "<group>";
+		};
+		ADAFDA202AE8DE1B00F084BC /* Model */ = {
+			isa = PBXGroup;
+			children = (
+				ADAFDA412AE8F3C400F084BC /* KMAdvertisementTimeStampConversion.swift */,
+				ADAFDA332AE8EE9300F084BC /* KMAdvertisementImage.swift */,
+				ADAFDA212AE8DE1B00F084BC /* KMAdvertisementModel.swift */,
+				ADAFDA222AE8DE1B00F084BC /* KMAdvertisementModelTransition.swift */,
+			);
+			path = Model;
+			sourceTree = "<group>";
+		};
+		ADAFDA232AE8DE1B00F084BC /* Cache */ = {
+			isa = PBXGroup;
+			children = (
+				ADAFDA242AE8DE1B00F084BC /* KMAdvertisementCache.swift */,
+			);
+			path = Cache;
+			sourceTree = "<group>";
+		};
+		ADAFDA2E2AE8E44200F084BC /* Config */ = {
+			isa = PBXGroup;
+			children = (
+				ADAFDA2F2AE8E44F00F084BC /* KMAdvertisementConfig.swift */,
+			);
+			path = Config;
+			sourceTree = "<group>";
+		};
+		ADAFDA372AE8EEED00F084BC /* Request */ = {
+			isa = PBXGroup;
+			children = (
+				ADAFDA382AE8EEFF00F084BC /* KMAdvertisementRequestServer.swift */,
+			);
+			path = Request;
+			sourceTree = "<group>";
+		};
+		ADAFDA3C2AE8F31400F084BC /* Manager */ = {
+			isa = PBXGroup;
+			children = (
+				ADAFDA3D2AE8F32400F084BC /* KMAdvertisementManager.swift */,
+			);
+			path = Manager;
+			sourceTree = "<group>";
+		};
+		ADAFDA452AEA7EE800F084BC /* Tableview */ = {
+			isa = PBXGroup;
+			children = (
+				ADAFDA062AE8DD6600F084BC /* Cell */,
+				ADAFDA0B2AE8DD6600F084BC /* KMAdvertisementTableView.swift */,
+				ADAFDA0C2AE8DD6600F084BC /* KMAdvertisementTableView.xib */,
+			);
+			path = Tableview;
+			sourceTree = "<group>";
+		};
+		ADAFDA462AEA7EEE00F084BC /* View */ = {
+			isa = PBXGroup;
+			children = (
+				ADAFDA472AEA7F1200F084BC /* KMAdvertisementShowView.swift */,
+				ADAFDA4B2AEA7F2700F084BC /* KMAdvertisementShowView.xib */,
+			);
+			path = View;
+			sourceTree = "<group>";
+		};
 		ADB2D6E229473FF00029D2B3 /* DealPaper */ = {
 			isa = PBXGroup;
 			children = (
@@ -6485,6 +6678,12 @@
 		ADE8BC3629F9453A00570F89 /* KMAdvertisement */ = {
 			isa = PBXGroup;
 			children = (
+				ADAFDA3C2AE8F31400F084BC /* Manager */,
+				ADAFDA372AE8EEED00F084BC /* Request */,
+				ADAFDA2E2AE8E44200F084BC /* Config */,
+				ADAFDA232AE8DE1B00F084BC /* Cache */,
+				ADAFDA202AE8DE1B00F084BC /* Model */,
+				ADAFDA1F2AE8DD6B00F084BC /* View */,
 				ADE8BC3A29F9458700570F89 /* KMRecommondInfo.h */,
 				ADE8BC3929F9458700570F89 /* KMRecommondInfo.m */,
 				ADE8BC3829F9458700570F89 /* KMRecommondManager.h */,
@@ -8605,8 +8804,12 @@
 				ADBC373729CA975B00D93208 /* KMCompatative.xcassets in Resources */,
 				BBC3481F295593F0008D2CD1 /* KMBackgroundListController.xib in Resources */,
 				ADBC372D29CA951E00D93208 /* KMComparativeOutlineView.xib in Resources */,
+				ADAFDA102AE8DD6600F084BC /* KMAdvertisementCollectionHeadView.xib in Resources */,
+				ADAFDA1C2AE8DD6600F084BC /* KMAdvertisementTableView.xib in Resources */,
 				BB7F7BFA29AA469F00A3E4E7 /* KMSigntureViewItem.xib in Resources */,
+				ADAFDA0D2AE8DD6600F084BC /* KMAdvertisementCollectionViewItem.xib in Resources */,
 				9F1F82E62934D5240092C4B4 /* KMHomeExtractActionViewController.xib in Resources */,
+				ADAFD9F72AE68A8500F084BC /* KMCreatPDFView.xib in Resources */,
 				89E4E77C2967B370002DBA6F /* KMDynamicStampViewController.xib in Resources */,
 				89316855296E45CA0073EA59 /* KMImageAccessoryController.xib in Resources */,
 				896DD4582985FB3200ADE514 /* KMPageDisplayThemeCollectionViewItem.xib in Resources */,
@@ -8832,10 +9035,13 @@
 				BB1AEF3529F937A50048D179 /* PDF Master User Guide.pdf in Resources */,
 				BB7507EC29861C37002DBDB1 /* PasswordWindowController.xib in Resources */,
 				9F0CB49A29683E1000007028 /* KMPropertiesPanelTextSubVC.xib in Resources */,
+				BBB29BCE2AEA190D005F1B6B /* KMToolbarCustomViewController.xib in Resources */,
+				BBC70EA92AEA6EF800AC1585 /* KMToolbarCustomWindowController.xib in Resources */,
 				89DB5DAA291B8DE70029624F /* KMOutlineEditViewController.xib in Resources */,
 				BB003029298CF7EC002DD1A0 /* KMPreferenceDisplayController.xib in Resources */,
 				9F0CB5452986953A00007028 /* KMURLToPDFWindowController.xib in Resources */,
 				9FBA0F0129015A82001117AF /* KMFastToolCollectionViewItem.xib in Resources */,
+				ADAFDA4C2AEA7F2700F084BC /* KMAdvertisementShowView.xib in Resources */,
 				ADE787A52AA5A833002EC85A /* KMAccountExceptionWindowController.xib in Resources */,
 				BBFBE6C528DD7B98008B2335 /* Main.storyboard in Resources */,
 				9F0201752A1B488C00C9B673 /* KMAITranslationVC.xib in Resources */,
@@ -8873,6 +9079,7 @@
 				ADD272D529B9CFE20032B5D6 /* KMLightNoNetworkView.xib in Resources */,
 				9FD0FA2D29CD3ED400F2AB0D /* KMRightSideEmptyVC.xib in Resources */,
 				BBA8B7A72935CD740097D183 /* KMRemovePasswordAlertWindowController.xib in Resources */,
+				ADAFDA4D2AEA7F2700F084BC /* KMAdvertisementShowView.xib in Resources */,
 				BB99ACC6292DE22E0048AFD9 /* KMMergeViewController.xib in Resources */,
 				AD0FA50F29A9E75000EDEB50 /* KMLoginInputPasswordView.xib in Resources */,
 				9F0CB49B29683E1000007028 /* KMPropertiesPanelTextSubVC.xib in Resources */,
@@ -8884,10 +9091,12 @@
 				AD8810A429A8459000178CA1 /* KMComparativeTableViewController.xib in Resources */,
 				AD0FA4F629A8582C00EDEB50 /* KMComparativeTableView.xib in Resources */,
 				BB7507ED29861C37002DBDB1 /* PasswordWindowController.xib in Resources */,
+				ADAFDA112AE8DD6600F084BC /* KMAdvertisementCollectionHeadView.xib in Resources */,
 				ADD1B6CC2942E85300C3FFF7 /* KMPrintBottomView.xib in Resources */,
 				9F0CB4732967E63100007028 /* KMPropertiesPanelNameSubVC.xib in Resources */,
 				9FF94F1529A7476000B1EF69 /* KMDesignPropertySelector.xib in Resources */,
 				AD8810AD29A8463600178CA1 /* KMAccountInfoWindowController.xib in Resources */,
+				BBB29BCF2AEA190E005F1B6B /* KMToolbarCustomViewController.xib in Resources */,
 				ADF1569829A62D31001D1018 /* KMLoginLeftImageView.xib in Resources */,
 				89316856296E45CA0073EA59 /* KMImageAccessoryController.xib in Resources */,
 				BBC3483F2955A60B008D2CD1 /* KMBackgroundPropertyInfoController.xib in Resources */,
@@ -8899,6 +9108,7 @@
 				BBEC00D5295C33D600A26C98 /* KMCreateBatesController.xib in Resources */,
 				AD1CA3FB2A05FCB60070541F /* KMAnnotationScreenViewController.xib in Resources */,
 				ADD1B6C02942DD3D00C3FFF7 /* KMPrintChooseView.xib in Resources */,
+				ADAFDA0E2AE8DD6600F084BC /* KMAdvertisementCollectionViewItem.xib in Resources */,
 				8997012328F41AB8009AF911 /* KMLeftSideViewController.xib in Resources */,
 				BB2F615C2966B69D001CB369 /* KMWatermarkPropertyHomeController.xib in Resources */,
 				BBFBE74C28DD7DE4008B2335 /* Assets.xcassets in Resources */,
@@ -8926,6 +9136,7 @@
 				BB49ED02293F459500C82CA2 /* KMConvertPPTsWindowController.xib in Resources */,
 				BB8F455B295AA1270037EA22 /* KMHeaderFooterPropertyInfoController.xib in Resources */,
 				BB7F7BFB29AA469F00A3E4E7 /* KMSigntureViewItem.xib in Resources */,
+				BBC70EAA2AEA6EF800AC1585 /* KMToolbarCustomWindowController.xib in Resources */,
 				AD0FA51729A9FA8F00EDEB50 /* KMResetPasswordView.xib in Resources */,
 				F3A9DC82294309D80074E5D2 /* CPDFListEditAnnotationViewController.xib in Resources */,
 				8942F7F42926087200389627 /* KMSearchViewController.xib in Resources */,
@@ -9030,6 +9241,7 @@
 				F356720929AF184A00740FF3 /* CPDFListAnnotationNoteWindowController.xib in Resources */,
 				9FDD0FA32952FF4D000C4DAD /* $themes.json in Resources */,
 				BB1BFF622AE9FA6C003EB179 /* KMBatchOperateBaseWindowController.xib in Resources */,
+				ADAFDA1D2AE8DD6600F084BC /* KMAdvertisementTableView.xib in Resources */,
 				9F0CB4B92977BC1000007028 /* KMPropertiesPanelPreviewSubVC.xib in Resources */,
 				9F8539FD2947137500DF644E /* throbber_waiting.png in Resources */,
 				9F8539E42947126000DF644E /* KMChromiumToolbar.xib in Resources */,
@@ -9064,6 +9276,7 @@
 				BB3AAB9429878CE000992A5A /* KMWatermarkAdjectivePropertyMainController.xib in Resources */,
 				896DD4592985FB3200ADE514 /* KMPageDisplayThemeCollectionViewItem.xib in Resources */,
 				9F853A062947137500DF644E /* newtab_h.pdf in Resources */,
+				ADAFD9F82AE68A8500F084BC /* KMCreatPDFView.xib in Resources */,
 				BB51074329A61B4100978662 /* ProgressSheet.xib in Resources */,
 				BB1AEF3629F937A50048D179 /* PDF Master User Guide.pdf in Resources */,
 				ADE3C1C529A4C13700793B13 /* KMPrintAccessoryController_OC.xib in Resources */,
@@ -9200,8 +9413,12 @@
 				9F78EFC028F7C1CC001E66F4 /* KMHomeViewController.xib in Resources */,
 				9F8539E52947126000DF644E /* KMChromiumToolbar.xib in Resources */,
 				9F0CB4742967E63100007028 /* KMPropertiesPanelNameSubVC.xib in Resources */,
+				ADAFDA122AE8DD6600F084BC /* KMAdvertisementCollectionHeadView.xib in Resources */,
+				ADAFDA1E2AE8DD6600F084BC /* KMAdvertisementTableView.xib in Resources */,
 				89E4E6E82963CD82002DBA6F /* KMGeneralAnnotationViewController.xib in Resources */,
+				ADAFDA0F2AE8DD6600F084BC /* KMAdvertisementCollectionViewItem.xib in Resources */,
 				BBEC00D6295C33D600A26C98 /* KMCreateBatesController.xib in Resources */,
+				ADAFD9F92AE68A8500F084BC /* KMCreatPDFView.xib in Resources */,
 				9F1F82E82934D5240092C4B4 /* KMHomeExtractActionViewController.xib in Resources */,
 				F3B7DF9F2948565000333201 /* CPDFListHoverAnnotationViewController.xib in Resources */,
 				BB69C961299116FD0001A9B1 /* plaid.pdf in Resources */,
@@ -9427,10 +9644,13 @@
 				9F8539F82947137500DF644E /* sadfavicon.png in Resources */,
 				9F8539FB2947137500DF644E /* newtab_p.pdf in Resources */,
 				9F221EDC29A9EC0900978A59 /* KMFillSignTextPanel.xib in Resources */,
+				BBB29BD02AEA190E005F1B6B /* KMToolbarCustomViewController.xib in Resources */,
+				BBC70EAB2AEA6EF800AC1585 /* KMToolbarCustomWindowController.xib in Resources */,
 				BB69C95E299116FD0001A9B1 /* five_line_score.pdf in Resources */,
 				BB89725B294C559F0045787C /* KMWatermarkPropertyCreateController.xib in Resources */,
 				ADBC2D3C299F0A5A006280C8 /* KMPrintHelpViewController.xib in Resources */,
 				ADB2D6F4294741720029D2B3 /* KMPrintPaperSetView.xib in Resources */,
+				ADAFDA4E2AEA7F2700F084BC /* KMAdvertisementShowView.xib in Resources */,
 				BB49ED13293F462E00C82CA2 /* KMConvertImageWindowController.xib in Resources */,
 				896DD45A2985FB3200ADE514 /* KMPageDisplayThemeCollectionViewItem.xib in Resources */,
 				9F00CCBB2A2F1E0F00AC462E /* dsa_priv.pem in Resources */,
@@ -9552,6 +9772,7 @@
 				89DB5DA9291B8DE70029624F /* KMOutlineEditViewController.swift in Sources */,
 				BB6DD80C29347F77001F0544 /* KMSecureEncryptWindowController.swift in Sources */,
 				BBB14A572978E75D00936EDB /* KMRedactMutilPageFlagWindowController.swift in Sources */,
+				ADAFDA132AE8DD6600F084BC /* KMAdvertisementCollectionViewItem.swift in Sources */,
 				899E0B092919244500B13D34 /* KMCustomTableRowView.swift in Sources */,
 				BBB9B30D299A5D6D004F3235 /* KMCloudUploadOperationQueue.m in Sources */,
 				BB146FC6299DC0D100784A6A /* GTMSessionFetcherService.m in Sources */,
@@ -9591,9 +9812,11 @@
 				AD015FB729AB484400A57062 /* KMLightMemberConfig.swift in Sources */,
 				BBD1F77C296F9BE000343885 /* KMPageEditSettingBaseWindowController.swift in Sources */,
 				BB2F184A2A0C911B0003F65E /* KMBaseWindowController.swift in Sources */,
+				BBC70EB02AEA80EC00AC1585 /* KMToolbarCustomWindowController.swift in Sources */,
 				BBF38A5A294F2B760086D025 /* KMWatermarkPositionView.swift in Sources */,
 				BBB7B4912A03AD2A00B58A5A /* KMPDFEditToolbar.swift in Sources */,
 				ADC63E372A49813E00854E02 /* KMSubscribeSuccessWindowController.swift in Sources */,
+				ADAFDA252AE8DE1B00F084BC /* KMAdvertisementModel.swift in Sources */,
 				BB8F4586295B19AC0037EA22 /* KMHeaderFooterDateInfoView.swift in Sources */,
 				ADF9ED2F29A8507400C4A943 /* KMAccountInfoView.swift in Sources */,
 				9FDD0FAE29534FDC000C4DAD /* KMCompLight.swift in Sources */,
@@ -9601,6 +9824,7 @@
 				BB897236294B38DC0045787C /* KMWatermarkAdjectivePropertyBaseController.swift in Sources */,
 				9F1F82D2292F6D510092C4B4 /* KMPDFInsertPreviewViewController.swift in Sources */,
 				AD02573F2A8601CD00EAD5D5 /* KMAppleLoginManager.swift in Sources */,
+				BBC70EB42AEA847500AC1585 /* KMToolbarCustomViewController.swift in Sources */,
 				BB86C1ED28F544F4005AD968 /* CPDFListView+Event.m in Sources */,
 				9F1FE4D229406E4700E952CA /* CTTabView.m in Sources */,
 				ADBC372929CA950500D93208 /* KMComparativeOutlineView.swift in Sources */,
@@ -9681,11 +9905,13 @@
 				BB6719F92AD2CC05003D44D5 /* CPDFSignatureWidgetAnnotation+PDFListView.swift in Sources */,
 				ADDEEA7A2AD3F4C800EF675D /* KMPopUpButton.swift in Sources */,
 				BB1BFF792AEA0B8E003EB179 /* KMBatchOperateRightViewController.swift in Sources */,
+				ADAFDA282AE8DE1B00F084BC /* KMAdvertisementModelTransition.swift in Sources */,
 				ADC63E482A49BEDD00854E02 /* KMSubscribeWaterMarkCollectionItem.swift in Sources */,
 				89752E1D2942CB03003FF08E /* KMSearchMode.swift in Sources */,
 				AD3A3587294C11ED00D72802 /* KMPrintPreviewPresenter.swift in Sources */,
 				BB3AD6F929935483004FC1AE /* Reachability.m in Sources */,
 				BBEC00BF295C306400A26C98 /* KMBatesPropertyController.swift in Sources */,
+				BB93CDE52AE757A000B29C57 /* KMToolbarItemView.swift in Sources */,
 				89E4E6EC2963D1B7002DBA6F /* KMColorPickerViewController.m in Sources */,
 				ADDEEA862AD7805200EF675D /* KMGeneralButton.swift in Sources */,
 				BB49ED19293F4D4E00C82CA2 /* KMConvertCSVSettingView.swift in Sources */,
@@ -9694,6 +9920,7 @@
 				BB49ED0E293F462E00C82CA2 /* KMConvertImageWindowController.swift in Sources */,
 				ADE3C1C129A4C13700793B13 /* KMPrintAccessoryController_OC.m in Sources */,
 				8942F7F82926089200389627 /* KMSignatureViewController.swift in Sources */,
+				ADAFDA392AE8EEFF00F084BC /* KMAdvertisementRequestServer.swift in Sources */,
 				9F0CB5092986563300007028 /* KMDesignToken+BorderBottom.swift in Sources */,
 				9F1FE4E429406E4700E952CA /* GTMNSColor+Luminance.m in Sources */,
 				BBA5429C29F13A140041BAD0 /* KMMemorandumPattern.swift in Sources */,
@@ -9739,6 +9966,7 @@
 				BB2EDF6D296ECE17003BCF58 /* KMPageEditInsertDirectionItemView.swift in Sources */,
 				BBD1F783296F9DB500343885 /* KMPageEditExtractWindowController.swift in Sources */,
 				BB146FB1299DC0D100784A6A /* GTLRErrorObject.m in Sources */,
+				ADAFDA482AEA7F1300F084BC /* KMAdvertisementShowView.swift in Sources */,
 				BBB9B319299A5D6D004F3235 /* KMCloudServer.m in Sources */,
 				9F1FE4A829406E4700E952CA /* CTBrowserWindowController.m in Sources */,
 				ADBC374129CAB1C300D93208 /* KMComparativeOutlineCell.swift in Sources */,
@@ -9748,6 +9976,7 @@
 				ADA9102A2A272CE2003352F0 /* KMEditPDFTextManager.swift in Sources */,
 				BB897229294B08720045787C /* KMWatermarkAdjectiveTopBarItemModel.swift in Sources */,
 				BB00301D298CB799002DD1A0 /* KMPreferenceManager.swift in Sources */,
+				ADAFDA342AE8EE9300F084BC /* KMAdvertisementImage.swift in Sources */,
 				ADBC2D28299DCA76006280C8 /* NSTextField+Layer.swift in Sources */,
 				ADF6B8762A48155E0090CB78 /* KMComparativeViewCollectionItem.swift in Sources */,
 				BB49ECF1293F40F500C82CA2 /* KMConvertPageRangeSettingItemView.swift in Sources */,
@@ -9765,7 +9994,6 @@
 				BB6DD81829348A00001F0544 /* KMSecureEncryptComboBoxCellView.swift in Sources */,
 				9F0CB4CD298654FA00007028 /* KMDesignToken+Height.swift in Sources */,
 				BB6013802AD38E0100A76FB2 /* CPDFTextAnnotation+PDFListView.swift in Sources */,
-				89752D9A2936E675003FF08E /* KMToolBarBox.swift in Sources */,
 				BB4EEF4429764FEF003A3537 /* KMWatermarkAligementView.swift in Sources */,
 				BBBB6CD62AD150D20035AA66 /* CPDFCircleAnnotation+PDFListView.swift in Sources */,
 				BB1BFF922AEA6352003EB179 /* KMImageToPDFMethod.swift in Sources */,
@@ -9784,6 +10012,7 @@
 				BB6DD821293497B6001F0544 /* KMSecureEncryptModel.swift in Sources */,
 				ADBC373229CA95AA00D93208 /* KMComparativeModel.swift in Sources */,
 				9FCFEC802AD0E74C00EAD2CB /* KMPopMenuButtonCell.swift in Sources */,
+				ADAFDA2B2AE8DE1B00F084BC /* KMAdvertisementCache.swift in Sources */,
 				9FCFEC7C2AC579F600EAD2CB /* CPDFListSignatureAnnotation.swift in Sources */,
 				BBF8A3FD2AE8B03B00788BAC /* KMBatchOperateFile.swift in Sources */,
 				ADD1B6E42946C00800C3FFF7 /* KMPrintChoosePageSizePosterView.swift in Sources */,
@@ -9802,6 +10031,7 @@
 				ADBC2D11299CCD05006280C8 /* KMTextfieldButton.swift in Sources */,
 				BB7BC4DC2AD3FFC200D6BEE6 /* NSImage+ KMExtension.swift in Sources */,
 				9FCFEC982AD14EEF00EAD2CB /* KMMailHelper.swift in Sources */,
+				ADAFDA302AE8E45000F084BC /* KMAdvertisementConfig.swift in Sources */,
 				9FAAA325290A69920046FFCE /* KMToolSetScroller.swift in Sources */,
 				AD0FA51229A9FA8600EDEB50 /* KMResetPasswordView.swift in Sources */,
 				9FDD0F882952FCC6000C4DAD /* KMCompLightParser.swift in Sources */,
@@ -9843,6 +10073,7 @@
 				9F5664872988B16F00020985 /* KMTextfieldVC.swift in Sources */,
 				9F1F82DA292F84D60092C4B4 /* KMHomeInsertActionViewController.swift in Sources */,
 				9FD0D2AF2AD51BCC00DA3FF8 /* CPDFListEditAnnotationViewController.swift in Sources */,
+				ADAFDA422AE8F3C400F084BC /* KMAdvertisementTimeStampConversion.swift in Sources */,
 				9F0CB4E92986559400007028 /* KMDesignToken+PaddingBottom.swift in Sources */,
 				ADD1B6E82946C02600C3FFF7 /* KMPrintChoosePageSizeMultipageView.swift in Sources */,
 				9F1FE4ED29406E4700E952CA /* ThrobberView.m in Sources */,
@@ -9851,6 +10082,7 @@
 				ADCFFC0229C004AD007D3657 /* KMBookMarkTableRowView.swift in Sources */,
 				ADF6B86C2A480C5F0090CB78 /* KMComparativeView.swift in Sources */,
 				9FAAA339290F72CC0046FFCE /* KMHistoryFileCollectionView.swift in Sources */,
+				BB93CDE92AE7B6E100B29C57 /* KMToolbarView.swift in Sources */,
 				BB2F18462A0C7E250003F65E /* KMConvertBaseView.swift in Sources */,
 				BB99ACCA292DEE6E0048AFD9 /* KMMergeTitleBar.swift in Sources */,
 				ADBC174F2A2991F700959CEE /* KMPurchaseManager.swift in Sources */,
@@ -9895,6 +10127,7 @@
 				BB147005299DC0D100784A6A /* OIDFieldMapping.m in Sources */,
 				BB1BFF8A2AEA4725003EB179 /* KMTableHeaderCell.swift in Sources */,
 				BB003015298CA446002DD1A0 /* KMPreferenceGeneralController.swift in Sources */,
+				ADAFD9F32AE68A7400F084BC /* KMCreatPDFView.swift in Sources */,
 				BBB9B32E299A5D6D004F3235 /* GTMAppAuthFetcherAuthorization.m in Sources */,
 				BB3198162AC55E6D00107371 /* CPDFDocument+KMExtension.swift in Sources */,
 				894A00F22976314C0070ED83 /* KMPDFViewPanelSetViewController.swift in Sources */,
@@ -9973,6 +10206,7 @@
 				ADB2D6F9294882AE0029D2B3 /* KMTextFieldStepperView.swift in Sources */,
 				9F72D2082994BDAF00DCACF1 /* KMNotificationVC.swift in Sources */,
 				BB4DD04B299B296500E80DF6 /* KMCloudPathControl.swift in Sources */,
+				ADAFDA192AE8DD6600F084BC /* KMAdvertisementTableView.swift in Sources */,
 				AD867F9029D9554F00F00440 /* KMBOTAOutlineItem.swift in Sources */,
 				BB0A823229C00400002C5C1B /* KMCommonEnum.swift in Sources */,
 				BB49ED06293F461500C82CA2 /* KMConvertCSVWindowController.swift in Sources */,
@@ -9980,6 +10214,7 @@
 				AD88109229A7612000178CA1 /* KMRegisterModel.swift in Sources */,
 				BB1BFF812AEA139F003EB179 /* KMLongerButton.swift in Sources */,
 				ADBC2D1F299CDA29006280C8 /* NSView+Layer.swift in Sources */,
+				ADAFDA3E2AE8F32400F084BC /* KMAdvertisementManager.swift in Sources */,
 				AD1CA3F72A05FCB60070541F /* KMAnnotationScreenViewController.swift in Sources */,
 				ADB2D6E6294740F30029D2B3 /* KMPrintPaperSetWindowController.swift in Sources */,
 				BB897271294DB6BE0045787C /* KMWatermarkAdjectivePlainView.swift in Sources */,
@@ -10138,6 +10373,7 @@
 				BB89725E294C5DDA0045787C /* KMWatermarkPropertyInfoController.swift in Sources */,
 				BB146FAB299DC0D000784A6A /* GTLRBatchQuery.m in Sources */,
 				BB897218294AED6C0045787C /* KMWatermarkAdjectivePreViewBaseController.swift in Sources */,
+				ADAFDA162AE8DD6600F084BC /* KMAdvertisementCollectionHeadView.swift in Sources */,
 				ADE8BC2F29F8CD7200570F89 /* KMPDFThumbnailModel.swift in Sources */,
 				BB4EEF4029764FCC003A3537 /* KMWatermarkColorView.swift in Sources */,
 				BB146FC9299DC0D100784A6A /* GTMSessionFetcher.m in Sources */,
@@ -10167,6 +10403,7 @@
 				896DD4552985FB3200ADE514 /* KMPageDisplayThemeCollectionViewItem.swift in Sources */,
 				ADA9102E2A272CEA003352F0 /* KMImageOptimization.swift in Sources */,
 				BBC348532958465C008D2CD1 /* KMBackgroundFilePropertyInfoController.swift in Sources */,
+				ADAFDA032AE8BD5C00F084BC /* KMConvertURLToPDF.m in Sources */,
 				AD9527C2295294EF0039D2BC /* KMPrintPaperModel.swift in Sources */,
 				AD8810A929A8463600178CA1 /* KMAccountInfoWindowController.swift in Sources */,
 				9F0CB525298656BA00007028 /* KMDesignToken+BorderWidth.swift in Sources */,
@@ -10241,6 +10478,7 @@
 				ADBC373D29CA9AE100D93208 /* KMComparativeManager.swift in Sources */,
 				BB147009299DC0D100784A6A /* OIDRegistrationRequest.m in Sources */,
 				BBBB6CDB2AD15B900035AA66 /* CPDFFreeTextAnnotation+PDFListView.swift in Sources */,
+				ADAFDA3F2AE8F32400F084BC /* KMAdvertisementManager.swift in Sources */,
 				BBA19F4829AE27DA001A285A /* KMAnnotationTableRowView.swift in Sources */,
 				BB8F4566295AA3ED0037EA22 /* KMHeaderFooterManager.swift in Sources */,
 				BB99ACC3292DE22E0048AFD9 /* KMMergeViewController.swift in Sources */,
@@ -10331,6 +10569,7 @@
 				BB3198172AC55E6D00107371 /* CPDFDocument+KMExtension.swift in Sources */,
 				BBEC00C8295C319400A26C98 /* KMBatesManager.swift in Sources */,
 				ADA9102B2A272CE2003352F0 /* KMEditPDFTextManager.swift in Sources */,
+				ADAFDA042AE8BD5C00F084BC /* KMConvertURLToPDF.m in Sources */,
 				BB147021299DC0D100784A6A /* OIDServiceDiscovery.m in Sources */,
 				BB5DF1F22959C9F00025CDA1 /* KMHeaderFooterPropertyMainController.swift in Sources */,
 				BBC3482529559506008D2CD1 /* KMBackgroundManager.swift in Sources */,
@@ -10362,6 +10601,7 @@
 				BB1BFF872AEA30B1003EB179 /* NSWindow+PopOver.swift in Sources */,
 				9FDD0F65294AB645000C4DAD /* KMMainViewController.swift in Sources */,
 				9FCFEC692AC2EAD500EAD2CB /* CPDFListViewColorMenuItemView.swift in Sources */,
+				ADAFDA262AE8DE1B00F084BC /* KMAdvertisementModel.swift in Sources */,
 				ADBC372A29CA950500D93208 /* KMComparativeOutlineView.swift in Sources */,
 				9FDD0FA729533494000C4DAD /* KMJSONParser.swift in Sources */,
 				9FDD0F70294AD13C000C4DAD /* KMMainViewController+Action.swift in Sources */,
@@ -10370,11 +10610,13 @@
 				BB1BFF8B2AEA4725003EB179 /* KMTableHeaderCell.swift in Sources */,
 				BBB9B314299A5D6D004F3235 /* DropboxModel.m in Sources */,
 				BBB9B323299A5D6D004F3235 /* KMServicesCloudFile.m in Sources */,
+				ADAFDA3A2AE8EEFF00F084BC /* KMAdvertisementRequestServer.swift in Sources */,
 				BBC745EB295F067B0072C2ED /* KMCropSettingWindowController.swift in Sources */,
 				ADDEEA7B2AD3F4C800EF675D /* KMPopUpButton.swift in Sources */,
 				BBC3480D29558DC1008D2CD1 /* KMBackgroundController.swift in Sources */,
 				BB6DD8262934D056001F0544 /* KMSecureEncryptSuccessTipView.swift in Sources */,
 				9FBC48B9299B44C600CA39D7 /* KMSecondaryViewController.m in Sources */,
+				ADAFD9F42AE68A7400F084BC /* KMCreatPDFView.swift in Sources */,
 				BBC348152955920B008D2CD1 /* KMBackgroundPropertyController.swift in Sources */,
 				BBEC00D2295C33D600A26C98 /* KMCreateBatesController.swift in Sources */,
 				AD867FB429DFBB2700F00440 /* KMAnnotationOutlineSectionView.swift in Sources */,
@@ -10427,6 +10669,7 @@
 				BB0A55222A30968900B6E84B /* KMDesignBaseView.swift in Sources */,
 				9FCFEC992AD14EEF00EAD2CB /* KMMailHelper.swift in Sources */,
 				89E4E6ED2963D1B7002DBA6F /* KMColorPickerViewController.m in Sources */,
+				ADAFDA172AE8DD6600F084BC /* KMAdvertisementCollectionHeadView.swift in Sources */,
 				89752E1E2942CB04003FF08E /* KMSearchMode.swift in Sources */,
 				AD3A3588294C11ED00D72802 /* KMPrintPreviewPresenter.swift in Sources */,
 				BB49ED1A293F4D4E00C82CA2 /* KMConvertCSVSettingView.swift in Sources */,
@@ -10437,6 +10680,7 @@
 				BBA5429D29F13A140041BAD0 /* KMMemorandumPattern.swift in Sources */,
 				BB3A81AD2AC2A4E4006FC66C /* NSTextView+KMExtension.swift in Sources */,
 				BB49ED0F293F462E00C82CA2 /* KMConvertImageWindowController.swift in Sources */,
+				ADAFDA142AE8DD6600F084BC /* KMAdvertisementCollectionViewItem.swift in Sources */,
 				89E4E7362964148E002DBA6F /* KMAnnotationPropertiesViewController.m in Sources */,
 				9F221ED829A9EC0900978A59 /* KMFillSignTextPanel.swift in Sources */,
 				ADC63E492A49BEDD00854E02 /* KMSubscribeWaterMarkCollectionItem.swift in Sources */,
@@ -10446,6 +10690,7 @@
 				BB003027298CF7EC002DD1A0 /* KMPreferenceDisplayController.swift in Sources */,
 				F36AD77829642FE80015AD53 /* CPDFListView+UndoManager.m in Sources */,
 				BB89726A294DB41D0045787C /* KMWatermarkAdjectivePositionView.swift in Sources */,
+				ADAFDA312AE8E45000F084BC /* KMAdvertisementConfig.swift in Sources */,
 				ADE787A32AA5A833002EC85A /* KMAccountExceptionWindowController.swift in Sources */,
 				BB146FBB299DC0D100784A6A /* GTLRBase64.m in Sources */,
 				BB2C6ACE28F41B9F00478A33 /* CPDFListView.m in Sources */,
@@ -10527,7 +10772,6 @@
 				89E4E76229656A88002DBA6F /* KMAnnotationStampViewController.m in Sources */,
 				89E4E756296427E5002DBA6F /* NSImage_SKExtensions.m in Sources */,
 				BB897276294DC04F0045787C /* KMWatermartAdjectivePageRangeView.swift in Sources */,
-				89752D9B2936E675003FF08E /* KMToolBarBox.swift in Sources */,
 				ADBC373329CA95AA00D93208 /* KMComparativeModel.swift in Sources */,
 				9FAAA326290A69920046FFCE /* KMToolSetScroller.swift in Sources */,
 				BB89724E294C1DCE0045787C /* KMWatermarkAdjectiveListTableCellView.swift in Sources */,
@@ -10536,10 +10780,12 @@
 				ADD1B6E52946C00800C3FFF7 /* KMPrintChoosePageSizePosterView.swift in Sources */,
 				9F1FE4BB29406E4700E952CA /* NSImage+CTAdditions.m in Sources */,
 				8997012028F41AB8009AF911 /* KMLeftSideViewController.swift in Sources */,
+				BBC70EB12AEA80EC00AC1585 /* KMToolbarCustomWindowController.swift in Sources */,
 				ADBC2D12299CCD05006280C8 /* KMTextfieldButton.swift in Sources */,
 				9F1FE49429406E4700E952CA /* common.m in Sources */,
 				AD0FA51329A9FA8600EDEB50 /* KMResetPasswordView.swift in Sources */,
 				9F0201732A1B488C00C9B673 /* KMAITranslationVC.swift in Sources */,
+				ADAFDA1A2AE8DD6600F084BC /* KMAdvertisementTableView.swift in Sources */,
 				9FD0D2AC2AD5143D00DA3FF8 /* KMTableRowView.swift in Sources */,
 				BBFBE74728DD7DB7008B2335 /* ViewController.swift in Sources */,
 				9FDD0F812952FC36000C4DAD /* KMDesignToken.swift in Sources */,
@@ -10563,6 +10809,7 @@
 				F3732324292DFFFE0013862C /* CPDFListView+Extension.m in Sources */,
 				ADB5E5132A371131007110A8 /* KMSubscribeWaterMarkWindowController.swift in Sources */,
 				AD68782229A5FADC005B5210 /* KMLightMemberCache.swift in Sources */,
+				ADAFDA492AEA7F1300F084BC /* KMAdvertisementShowView.swift in Sources */,
 				AD8F06182999DB5900D93CBC /* KMPrintDrawPage.swift in Sources */,
 				BB147030299DC0D200784A6A /* OIDTokenUtilities.m in Sources */,
 				BB146FD6299DC0D100784A6A /* GTLRObject.m in Sources */,
@@ -10643,6 +10890,7 @@
 				BB6DD81929348A00001F0544 /* KMSecureEncryptComboBoxCellView.swift in Sources */,
 				BBC2BCC7295DA8F30036B983 /* KMCropPreviewController.swift in Sources */,
 				ADE3C1FE29A5C44700793B13 /* KMLightMemberManager.swift in Sources */,
+				ADAFDA2C2AE8DE1B00F084BC /* KMAdvertisementCache.swift in Sources */,
 				BB14701B299DC0D100784A6A /* OIDURLSessionProvider.m in Sources */,
 				9F8DDF352924DA6B006CDC73 /* KMPDFToolsCollectionView.swift in Sources */,
 				BBEC00A5295BD42D00A26C98 /* KMHeaderFooterPageInfoView.swift in Sources */,
@@ -10663,6 +10911,7 @@
 				9FCFEC752AC56ECE00EAD2CB /* CPDFListStampAnnotation.swift in Sources */,
 				9F0CB5162986566D00007028 /* KMDesignToken+BorderRadiusTopLeft.swift in Sources */,
 				AD867F8729D94F5100F00440 /* KMBOTAOutlineView.swift in Sources */,
+				ADAFDA292AE8DE1B00F084BC /* KMAdvertisementModelTransition.swift in Sources */,
 				9F0CB536298656F900007028 /* KMDesignToken+BorderWidthLeft.swift in Sources */,
 				BBA8B7AB2935DC120097D183 /* KMRemovePasswordResultTipView.swift in Sources */,
 				9F02017F2A1BAC1600C9B673 /* KMAIRewritingVC.swift in Sources */,
@@ -10705,6 +10954,7 @@
 				9FCFECA12AD17B8A00EAD2CB /* SKProgressController.swift in Sources */,
 				BBEC00DA295C39FD00A26C98 /* KMBatesPropertyInfoController.swift in Sources */,
 				9F0CB52A298656C900007028 /* KMDesignToken+BorderWidthTop.swift in Sources */,
+				BB93CDEA2AE7B6E100B29C57 /* KMToolbarView.swift in Sources */,
 				BB4EEF492976504C003A3537 /* KMRedactColorView.swift in Sources */,
 				BBEC00E2295C410A00A26C98 /* KMBatesPrefixInfoView.swift in Sources */,
 				9F1F82E42934D5240092C4B4 /* KMHomeExtractActionViewController.swift in Sources */,
@@ -10798,6 +11048,7 @@
 				BB146FEB299DC0D100784A6A /* GTLRDuration.m in Sources */,
 				BB89726E294DB67D0045787C /* KMWatermarkAdjectiveBaseView.swift in Sources */,
 				89D2D2C6294972B900BFF5FE /* KMFormCellView.swift in Sources */,
+				ADAFDA432AE8F3C400F084BC /* KMAdvertisementTimeStampConversion.swift in Sources */,
 				BB146FFD299DC0D100784A6A /* OIDAuthState+Mac.m in Sources */,
 				BB897225294B07960045787C /* KMWatermarkAdjectiveTopBarItemView.swift in Sources */,
 				ADDEEA6F2AD3E16100EF675D /* KMSigntureViewItem.swift in Sources */,
@@ -10850,6 +11101,7 @@
 				9F1FE49D29406E4700E952CA /* HoverCloseButton.m in Sources */,
 				9F1F82C4292F113A0092C4B4 /* KMHomeDragView.swift in Sources */,
 				BB3A81B12AC2B82A006FC66C /* KMPageSizeTool.swift in Sources */,
+				ADAFDA352AE8EE9300F084BC /* KMAdvertisementImage.swift in Sources */,
 				9F1F82CB292F6CF90092C4B4 /* KMPDFInsertPageWindow.swift in Sources */,
 				BB6CA4CD298BB0D000A13864 /* KMPreferenceWindowController.swift in Sources */,
 				ADB5E51A2A3711CB007110A8 /* KMSubscribeWaterMarkView.swift in Sources */,
@@ -10860,7 +11112,6 @@
 				9F1FE50E29407B2B00E952CA /* KMUploadFilePanel.swift in Sources */,
 				BBA93D2E29BEBAA60044E0DD /* KMPreferenceEnum.swift in Sources */,
 				ADE8BC3F29F9458700570F89 /* KMRecommondInfo.m in Sources */,
-				89752DA02936EC50003FF08E /* KMToolbar.m in Sources */,
 				ADDEEA672AD3C4BE00EF675D /* KMPDFSignatureImageView.swift in Sources */,
 				ADDEEA732AD3EFE200EF675D /* KMButton.swift in Sources */,
 				BB146FE5299DC0D100784A6A /* GTLRURITemplate.m in Sources */,
@@ -10894,6 +11145,7 @@
 				ADDEEA7F2AD3FB1D00EF675D /* KMImageAccessoryController.swift in Sources */,
 				BB4EEF4129764FCC003A3537 /* KMWatermarkColorView.swift in Sources */,
 				BB146FCA299DC0D100784A6A /* GTMSessionFetcher.m in Sources */,
+				BBC70EB52AEA847500AC1585 /* KMToolbarCustomViewController.swift in Sources */,
 				BB49ECDE293EED6100C82CA2 /* KMConvertWordWindowController.swift in Sources */,
 				BB6B4C09292F53CE0071CA06 /* KMMergeFileModel.swift in Sources */,
 				AD0E8AB52A31B78900DBFD3C /* KMDMGPurchaseManager.swift in Sources */,
@@ -10954,6 +11206,7 @@
 				BB4EEF392976451E003A3537 /* KMRedactContentBaseView.swift in Sources */,
 				BB24D4A82977BE6700041659 /* KMRedactConfirmWindowController.swift in Sources */,
 				9F0CB4F2298655BC00007028 /* KMDesignToken+ItemSpacing.swift in Sources */,
+				BB93CDE62AE757A000B29C57 /* KMToolbarItemView.swift in Sources */,
 				8997010F28F40842009AF911 /* KMOutlineViewController.swift in Sources */,
 				BB2F61512966A91D001CB369 /* KMBackgroundPropertyHomeController.swift in Sources */,
 				9F1FE3DF293EE51F00E952CA /* KMMainDocument.swift in Sources */,
@@ -11003,7 +11256,10 @@
 				9FBA0F0029015A82001117AF /* KMFastToolCollectionViewItem.swift in Sources */,
 				BB146FD1299DC0D100784A6A /* GTMMIMEDocument.m in Sources */,
 				9FCFECA62AD237B500EAD2CB /* KMBatchTableRowView.swift in Sources */,
+				BB93CDEB2AE7B6E100B29C57 /* KMToolbarView.swift in Sources */,
 				BB1EC8002967B26700EC0BC3 /* KMPDFEditViewController.swift in Sources */,
+				ADAFDA402AE8F32400F084BC /* KMAdvertisementManager.swift in Sources */,
+				ADAFDA152AE8DD6600F084BC /* KMAdvertisementCollectionViewItem.swift in Sources */,
 				AD015FB929AB484400A57062 /* KMLightMemberConfig.swift in Sources */,
 				ADBC2D13299CCD05006280C8 /* KMTextfieldButton.swift in Sources */,
 				BB162E90294FFC0C0088E9D1 /* KMWatermarkPDFView.swift in Sources */,
@@ -11027,7 +11283,9 @@
 				AD1CA4232A061D190070541F /* KMAnnotationScreenAuthorViewItem.swift in Sources */,
 				BB897243294C028A0045787C /* KMWatermarkAdjectiveSegementControl.swift in Sources */,
 				ADE3C1EF29A5AFB100793B13 /* KMRequestServerManager.swift in Sources */,
+				BBC70EB22AEA80EC00AC1585 /* KMToolbarCustomWindowController.swift in Sources */,
 				9F1FE4B629406E4700E952CA /* CTBrowser.m in Sources */,
+				ADAFDA2A2AE8DE1B00F084BC /* KMAdvertisementModelTransition.swift in Sources */,
 				ADC63E412A49816900854E02 /* KMSubscribeSuccessView.swift in Sources */,
 				BBA19F4529ADE6A3001A285A /* KMBookMarkRowView.swift in Sources */,
 				9F0201982A1F352100C9B673 /* KMAITranslationConfirmWindowController.swift in Sources */,
@@ -11058,6 +11316,7 @@
 				ADBC375229CAE27900D93208 /* KMComparativeOutlineRowView.swift in Sources */,
 				ADE8BC3129F8CD7200570F89 /* KMPDFThumbnailModel.swift in Sources */,
 				BB89DD802953F863007C3FFA /* KMWatermarkFileOutsideView.swift in Sources */,
+				ADAFDA442AE8F3C400F084BC /* KMAdvertisementTimeStampConversion.swift in Sources */,
 				BB6B4C0A292F53CE0071CA06 /* KMMergeFileModel.swift in Sources */,
 				9F0CB4B72977BC1000007028 /* KMPropertiesPanelPreviewSubVC.swift in Sources */,
 				BB3A81B72AC2C0F4006FC66C /* NSObject+KMExtension.swift in Sources */,
@@ -11143,6 +11402,7 @@
 				BBFE6E772930E53000142C01 /* KMMergePopoverViewController.swift in Sources */,
 				ADF6B8782A48155E0090CB78 /* KMComparativeViewCollectionItem.swift in Sources */,
 				BB32BF252A5EA05900D11348 /* KMAnalytics.swift in Sources */,
+				ADAFDA1B2AE8DD6600F084BC /* KMAdvertisementTableView.swift in Sources */,
 				89E4E7102963D62C002DBA6F /* KMAnnotationFontWindowController.m in Sources */,
 				AD9527C0295294E20039D2BC /* KMPrintPageModel.swift in Sources */,
 				BBB14A6529792D6900936EDB /* KMRedactPageRangeContentView.swift in Sources */,
@@ -11260,6 +11520,7 @@
 				BB8F4541295A98960037EA22 /* KMHeaderFooterPropertyController.swift in Sources */,
 				BBFE6E6F2930D9C600142C01 /* KMMergeSettingWindowController.swift in Sources */,
 				BBA5B64A2A823E0200748A83 /* KMPDFEditViewController_dmg.swift in Sources */,
+				ADAFD9F52AE68A7400F084BC /* KMCreatPDFView.swift in Sources */,
 				BB74DA792AC41182006EDFE7 /* NSFont+KMExtension.swift in Sources */,
 				BB49ECF3293F40F500C82CA2 /* KMConvertPageRangeSettingItemView.swift in Sources */,
 				9F1FE4F529406E4700E952CA /* FastResizeView.m in Sources */,
@@ -11304,7 +11565,6 @@
 				9F221ED129A85D3700978A59 /* KMDesignBase.swift in Sources */,
 				ADB5E51B2A3711CB007110A8 /* KMSubscribeWaterMarkView.swift in Sources */,
 				89D9896028FD21E6003A3E87 /* KMAnnotationCollectionView.swift in Sources */,
-				89752D9C2936E675003FF08E /* KMToolBarBox.swift in Sources */,
 				9F53D5552AD683A700CCF9D8 /* KMAnnotationPropertyBaseController.swift in Sources */,
 				BB4DD049299B294000E80DF6 /* KMCloudFileEmptyView.swift in Sources */,
 				BB3198182AC55E6D00107371 /* CPDFDocument+KMExtension.swift in Sources */,
@@ -11353,6 +11613,7 @@
 				9F1F82EC2935D02E0092C4B4 /* KMComboBox.swift in Sources */,
 				8997012128F41AB8009AF911 /* KMLeftSideViewController.swift in Sources */,
 				F35B484D29A4903300756255 /* NSPointerArray+PDFListView.m in Sources */,
+				BBC70EB62AEA847500AC1585 /* KMToolbarCustomViewController.swift in Sources */,
 				89752E062939DB42003FF08E /* KMToolbarViewController.swift in Sources */,
 				89D2D2FD294C806000BFF5FE /* KMPDFThumbnailItem.swift in Sources */,
 				BBFBE74928DD7DB8008B2335 /* ViewController.swift in Sources */,
@@ -11388,6 +11649,7 @@
 				AD1CA3F92A05FCB60070541F /* KMAnnotationScreenViewController.swift in Sources */,
 				9F1FE4EC29406E4700E952CA /* NSBezierPath+MCAdditions.m in Sources */,
 				9F5664892988B16F00020985 /* KMTextfieldVC.swift in Sources */,
+				ADAFDA3B2AE8EEFF00F084BC /* KMAdvertisementRequestServer.swift in Sources */,
 				BBD1F77E296F9BE000343885 /* KMPageEditSettingBaseWindowController.swift in Sources */,
 				9F080B25298FCB0D00FC27DA /* KMDesignToken+Action.swift in Sources */,
 				9F81ADC829B9B12C002251F4 /* NSButton+DesignToken.swift in Sources */,
@@ -11424,6 +11686,7 @@
 				9F1FE49829406E4700E952CA /* common.c in Sources */,
 				ADBC375629CAE94700D93208 /* KMComparativeOutlineSectionCell.swift in Sources */,
 				9F0CB5442986953A00007028 /* KMURLToPDFWindowController.swift in Sources */,
+				ADAFDA322AE8E45000F084BC /* KMAdvertisementConfig.swift in Sources */,
 				ADD272D229B9CFD30032B5D6 /* KMLightNoNetworkView.swift in Sources */,
 				F3599224292CA27B000D25DE /* CPDFListViewRuntime.m in Sources */,
 				ADD1B6E12946BFD500C3FFF7 /* KMPrintChoosePageSizeSizeView.swift in Sources */,
@@ -11463,6 +11726,7 @@
 				BB897253294C3F660045787C /* KMMenuTableView.swift in Sources */,
 				BB88E45A29404752002B3655 /* KMPDFConvert.swift in Sources */,
 				BB147004299DC0D100784A6A /* OIDScopeUtilities.m in Sources */,
+				ADAFDA362AE8EE9300F084BC /* KMAdvertisementImage.swift in Sources */,
 				9F0CB4712967E63100007028 /* KMPropertiesPanelNameSubVC.swift in Sources */,
 				9F1FE4CE29406E4700E952CA /* CTTabContentsController.m in Sources */,
 				9F0CB4EF298655A800007028 /* KMDesignToken+PaddingLeft.swift in Sources */,
@@ -11501,6 +11765,7 @@
 				AD9527EC2955520C0039D2BC /* KMBaseTextFieldModel.swift in Sources */,
 				BBF38A5C294F2B760086D025 /* KMWatermarkPositionView.swift in Sources */,
 				AD5999402AD7E88600412F8B /* KMStampManager.swift in Sources */,
+				ADAFDA2D2AE8DE1B00F084BC /* KMAdvertisementCache.swift in Sources */,
 				BB7BC4DA2AD3D6B700D6BEE6 /* PDFListView+KMExtensions.swift in Sources */,
 				BB14702E299DC0D100784A6A /* OIDEndSessionRequest.m in Sources */,
 				BB146FE3299DC0D100784A6A /* GTLRDriveQuery.m in Sources */,
@@ -11533,6 +11798,7 @@
 				BB162E99295062CD0088E9D1 /* KMPageRangeTools.swift in Sources */,
 				9FD0FA3329CD947000F2AB0D /* KMOpacityPanel.swift in Sources */,
 				9FBC489D2996500300CA39D7 /* KMDocumentController.swift in Sources */,
+				ADAFDA182AE8DD6600F084BC /* KMAdvertisementCollectionHeadView.swift in Sources */,
 				BB1A34AA295EA30100B80B3E /* NSBitmapImageRep_SKExtensions.m in Sources */,
 				9F0CB4A9296CF19600007028 /* KMPropertiesPanelListMenuSubVC.swift in Sources */,
 				BBB5C80929F4CEE40054F261 /* KMLinkAnnotationPropertyEmptyController.swift in Sources */,
@@ -11609,6 +11875,7 @@
 				9F1FE49E29406E4700E952CA /* HoverCloseButton.m in Sources */,
 				BB3A81B22AC2B82A006FC66C /* KMPageSizeTool.swift in Sources */,
 				9FD0D2A52AD4ECA900DA3FF8 /* KMPDFEditAppendCustomView.swift in Sources */,
+				ADAFDA4A2AEA7F1300F084BC /* KMAdvertisementShowView.swift in Sources */,
 				AD8F06192999DB5900D93CBC /* KMPrintDrawPage.swift in Sources */,
 				9FF94F1B29A770B500B1EF69 /* KMFillSignShapePanel.swift in Sources */,
 				BBA5429E29F13A140041BAD0 /* KMMemorandumPattern.swift in Sources */,
@@ -11628,9 +11895,9 @@
 				AD5999442AD8DC2000412F8B /* KMDynamicStampViewController.swift in Sources */,
 				BBC347FF295448DE008D2CD1 /* KMWatermarkTemplateModel.swift in Sources */,
 				BBD7FE042A13218F00F96075 /* KMWatermarkAdjectivePropertyBaseController.swift in Sources */,
-				89752DA12936EC50003FF08E /* KMToolbar.m in Sources */,
 				ADAC0DE72AC2B04900FD4F52 /* KMNoteTypeImageView.swift in Sources */,
 				9F1FE4F229406E4700E952CA /* BackgroundGradientView.m in Sources */,
+				ADAFDA272AE8DE1B00F084BC /* KMAdvertisementModel.swift in Sources */,
 				89316824296D73CC0073EA59 /* KMSignatureAnnotationViewController.m in Sources */,
 				9F1FE4A429406E4700E952CA /* CTToolbarController.m in Sources */,
 				BBEB93ED2AD6C2AE00739573 /* KMPDFMergeFileNameTabelViewCell.swift in Sources */,
@@ -11662,6 +11929,7 @@
 				9F1F82D4292F6D510092C4B4 /* KMPDFInsertPreviewViewController.swift in Sources */,
 				BBF1705A2AE296B90013CE02 /* KMView.swift in Sources */,
 				ADDEEA7C2AD3F4C800EF675D /* KMPopUpButton.swift in Sources */,
+				BB93CDE72AE757A000B29C57 /* KMToolbarItemView.swift in Sources */,
 				9F705F8F291E579F005199AD /* KMHistoryFileTableView.swift in Sources */,
 				9F0CB4812967F64D00007028 /* KMPropertiesPanelReadOnlySubVC.swift in Sources */,
 				9F0CB53B2986570600007028 /* KMDesignToken+BoxShadow.swift in Sources */,
@@ -11701,6 +11969,7 @@
 				8997011028F40842009AF911 /* KMOutlineViewController.swift in Sources */,
 				9F1F82BE292E01860092C4B4 /* KMCloudEmptyCollectionViewItem.swift in Sources */,
 				BB6DD8272934D056001F0544 /* KMSecureEncryptSuccessTipView.swift in Sources */,
+				ADAFDA052AE8BD5C00F084BC /* KMConvertURLToPDF.m in Sources */,
 				9FCFECAA2AD243C900EAD2CB /* KMBlankView.swift in Sources */,
 				9F0201902A1DDAA500C9B673 /* KMAITranslationWindowController.swift in Sources */,
 				ADDEEA802AD3FB1D00EF675D /* KMImageAccessoryController.swift in Sources */,

+ 29 - 46
PDF Office/PDF Master.xcodeproj/xcuserdata/kdanmobile.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -273,6 +273,21 @@
                   endingLineNumber = "332"
                   offsetFromSymbolStart = "299">
                </Location>
+               <Location
+                  uuid = "4AA5DDA9-7119-40D7-89B4-F368372F819A - 89e3ff688b88713e"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Master.KMEditPDFTextManager.setFontAlignment(alignment: __C.NSTextAlignment) -&gt; ()"
+                  moduleName = "PDF Master"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/kdanmobile/PDF_Office/PDF%20Office/PDF%20Master/Class/PDFWindowController/Side/RightSide/EditPDF/Manager/KMEditPDFTextManager.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "332"
+                  endingLineNumber = "332"
+                  offsetFromSymbolStart = "192">
+               </Location>
             </Locations>
          </BreakpointContent>
       </BreakpointProxy>
@@ -327,80 +342,48 @@
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
-            uuid = "7D95F342-B074-4DA1-8B8A-FE872037ED83"
+            uuid = "A3B3880C-1091-413D-BAA2-8878F4F2EE54"
             shouldBeEnabled = "Yes"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "PDF Master/Class/PDFWindowController/Side/RightSide/Signature/KMSignature.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "55"
-            endingLineNumber = "55"
-            landmarkName = "init?(coder:)"
+            startingLineNumber = "35"
+            endingLineNumber = "35"
+            landmarkName = "init()"
             landmarkType = "7">
-            <Locations>
-               <Location
-                  uuid = "7D95F342-B074-4DA1-8B8A-FE872037ED83 - e5bb98ce5d956827"
-                  shouldBeEnabled = "Yes"
-                  ignoreCount = "0"
-                  continueAfterRunningActions = "No"
-                  symbolName = "PDF_Master.KMSignature.init(coder: __C.NSCoder) -&gt; Swift.Optional&lt;PDF_Master.KMSignature&gt;"
-                  moduleName = "PDF Master"
-                  usesParentBreakpointCondition = "Yes"
-                  urlString = "file:///Users/kdanmobile/work/tangchao/git/PDFOffice/PDF%20Office/PDF%20Master/Class/PDFWindowController/Side/RightSide/Signature/KMSignature.swift"
-                  startingColumnNumber = "9223372036854775807"
-                  endingColumnNumber = "9223372036854775807"
-                  startingLineNumber = "55"
-                  endingLineNumber = "55"
-                  offsetFromSymbolStart = "826">
-               </Location>
-               <Location
-                  uuid = "7D95F342-B074-4DA1-8B8A-FE872037ED83 - e5bb98ce5d956827"
-                  shouldBeEnabled = "Yes"
-                  ignoreCount = "0"
-                  continueAfterRunningActions = "No"
-                  symbolName = "PDF_Master.KMSignature.init(coder: __C.NSCoder) -&gt; Swift.Optional&lt;PDF_Master.KMSignature&gt;"
-                  moduleName = "PDF Master"
-                  usesParentBreakpointCondition = "Yes"
-                  urlString = "file:///Users/kdanmobile/work/tangchao/git/PDFOffice/PDF%20Office/PDF%20Master/Class/PDFWindowController/Side/RightSide/Signature/KMSignature.swift"
-                  startingColumnNumber = "9223372036854775807"
-                  endingColumnNumber = "9223372036854775807"
-                  startingLineNumber = "55"
-                  endingLineNumber = "55"
-                  offsetFromSymbolStart = "1370">
-               </Location>
-            </Locations>
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
-            uuid = "A3B3880C-1091-413D-BAA2-8878F4F2EE54"
+            uuid = "E33CE6EB-AF37-4B1D-89A4-DB97337F719D"
             shouldBeEnabled = "Yes"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "PDF Master/Class/PDFWindowController/Side/RightSide/Signature/KMSignature.swift"
+            filePath = "PDF Master/Class/PDFWindowController/Toolbar/KMToolbarViewController.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "35"
-            endingLineNumber = "35"
-            landmarkName = "init()"
+            startingLineNumber = "357"
+            endingLineNumber = "357"
+            landmarkName = "scanOCRModelSelect(sender:)"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
-            uuid = "28AEB13C-12E0-4DE8-90CF-29754B61B6FB"
+            uuid = "BA35DAFD-2DD8-4E4C-9E39-70FC85E0D7C4"
             shouldBeEnabled = "Yes"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "PDF Master/Class/PDFWindowController/Side/RightSide/Signature/KMSignature.swift"
+            filePath = "PDF Master/Class/PDFWindowController/Toolbar/KMToolbarView.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "68"
-            endingLineNumber = "68"
-            landmarkName = "encode(with:)"
+            startingLineNumber = "113"
+            endingLineNumber = "113"
+            landmarkName = "_moreButtonAction()"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1106 - 120
PDF Office/PDF Master.xcodeproj/xcuserdata/lizhe.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist


+ 0 - 1
PDF Office/PDF Master/AppDelegate.swift

@@ -6,7 +6,6 @@
 //
 
 import Cocoa
-import KMAdvertisement
 
 @main
 class AppDelegate: NSObject, NSApplicationDelegate {

+ 22 - 0
PDF Office/PDF Master/Class/Appearance/Image.xcassets/Toolbar/KMImageNameToolbarSelected.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "ic_have.pdf",
+      "idiom" : "universal"
+    },
+    {
+      "appearances" : [
+        {
+          "appearance" : "luminosity",
+          "value" : "dark"
+        }
+      ],
+      "filename" : "ic_have 1.pdf",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Resources/KMAdvertisement.bundle/dark_brower_delect.pdf


BIN
PDF Office/PDF Master/Class/Appearance/Image.xcassets/Toolbar/KMImageNameToolbarSelected.imageset/ic_have.pdf


+ 555 - 8
PDF Office/PDF Master/Class/Appearance/KMAppearance.swift

@@ -7,9 +7,561 @@
 
 import Cocoa
 
-let KMImageNameUXIconBtnCloseNor = "KMImageNameUXIconBtnCloseNor"
-let KMImageNameUXIconBtnCloseHov = "KMImageNameUXIconBtnCloseHov"
-let KMImageNameUXIconProgressWaiting = "KMImageNameUXIconProgressWaiting"
+let KMImageNameToolbarLeftPanel = "KMImageNameToolbarLeftPanel";
+let KMImageNameToolbarRightPanel = "KMImageNameToolbarRightPanel";
+let KMImageNameToolbarMinus = "KMImageNameToolbarMinus";
+let KMImageNameToolbarPlus = "KMImageNameToolbarPlus";
+let KMImageNameToolbarPrevious = "KMImageNameToolbarPrevious";
+let KMImageNameToolbarNext = "KMImageNameToolbarNext";
+let KMImageNameToolbarTools = "KMImageNameToolbarTools";
+let KMImageNameToolbarPageEdit = "KMImageNameToolbarPageEdit";
+let KMImageNameToolbarEdit = "KMImageNameToolbarEdit";
+let KMImageNameToolbarConvert = "KMImageNameToolbarConvert";
+let KMImageNameToolbarSettings = "KMImageNameToolbarSettings";
+let KMImageNameToolbarShare = "KMImageNameToolbarShare";
+let KMImageNameToolbarBack = "KMImageNameToolbarBack";
+let KMImageNameToolbarForward = "KMImageNameToolbarForward";
+let KMImageNameToolbarFirst = "KMImageNameToolbarFirst";
+let KMImageNameToolbarLast = "KMImageNameToolbarLast";
+let KMImageNameToolbarInfo = "KMImageNameToolbarInfo";
+let KMImageNameToolbarLines = "KMImageNameToolbarLines";
+let KMImageNameToolbarFont = "KMImageNameToolbarFont";
+let KMImageNameToolbarPrint = "KMImageNameToolbarPrint";
+let KMImageNameToolbarPlay = "KMImageNameToolbarPlay";
+let KMImageNameToolbarHome = "KMImageNameToolbarHome";
+let KMImageNameToolbarForm = "KMImageNameToolbarForm";
+let KMImageNameToolbarSelfSign = "KMImageNameToolbarSelfSign";
+let KMImageNameToolbarTextEdit = "KMImageNameToolbarTextEdit";
+
+let KMImageNameToolbarLeftPanelSelected = "KMImageNameToolbarLeftPanelSelected";
+let KMImageNameToolbarRightPanelSelected = "KMImageNameToolbarRightPanelSelected";
+let KMImageNameToolbarToolsSelected = "KMImageNameToolbarToolsSelected";
+let KMImageNameToolbarSettingsSelected = "KMImageNameToolbarSettingsSelected";
+let KMImageNameToolbarPageEditSelected = "KMImageNameToolbarPageEditSelected";
+let KMImageNameToolbarConvertSelected = "KMImageNameToolbarConvertSelected";
+let KMImageNameToolbarEditSelected = "KMImageNameToolbarEditSelected";
+let KMImageNameToolbarHomeSelected = "KMImageNameToolbarHomeSelected";
+let KMImageNameToolbarFormSelected = "KMImageNameToolbarFormSelected";
+let KMImageNameToolbarSelfSignSelected = "KMImageNameToolbarSelfSignSelected";
+let KMImageNameToolbarTextEditSelected = "KMImageNameToolbarTextEditSelected";
+
+let KMImageNameToolbarHand = "KMImageNameToolbarHand";
+let KMImageNameToolbarZoom = "KMImageNameToolbarZoom";
+let KMImageNameToolbarSelect = "KMImageNameToolbarSelect";
+let KMImageNameToolbarSelectZoom = "KMImageNameToolbarSelectZoom";
+let KMImageNameToolbarHighlight = "KMImageNameToolbarHighlight";
+let KMImageNameToolbarUnderline = "KMImageNameToolbarUnderline";
+let KMImageNameToolbarStrickout = "KMImageNameToolbarStrickout";
+let KMImageNameToolbarInk = "KMImageNameToolbarInk";
+let KMImageNameToolbarFreeText = "KMImageNameToolbarFreeText";
+let KMImageNameToolbarNote = "KMImageNameToolbarNote";
+let KMImageNameToolbarSquare = "KMImageNameToolbarSquare";
+let KMImageNameToolbarCircle = "KMImageNameToolbarCircle";
+let KMImageNameToolbarArrow = "KMImageNameToolbarArrow";
+let KMImageNameToolbarLine = "KMImageNameToolbarLine";
+let KMImageNameToolbarLink = "KMImageNameToolbarLink";
+let KMImageNameToolbarStamp = "KMImageNameToolbarStamp";
+let KMImageNameToolbarImage = "KMImageNameToolbarImage";
+let KMImageNameToolbarSign = "KMImageNameToolbarSign";
+let KMImageNameToolbarSet = "KMImageNameToolbarSet";
+let KMImageNameToolbarSpace = "KMImageNameToolbarSpace";
+
+let KMImageNameToolbarInsert = "KMImageNameToolbarInsert";
+let KMImageNameToolbarMerge = "KMImageNameToolbarMerge";
+let KMImageNameToolbarReplace = "KMImageNameToolbarReplace";
+let KMImageNameToolbarExtract = "KMImageNameToolbarExtract";
+let KMImageNameToolbarSplit = "KMImageNameToolbarSplit";
+let KMImageNameToolbarRotate = "KMImageNameToolbarRotate";
+let KMImageNameToolbarPaste = "KMImageNameToolbarPaste";
+let KMImageNameToolbarCopy = "KMImageNameToolbarCopy";
+let KMImageNameToolbarDelete = "KMImageNameToolbarDelete";
+let KMImageNameToolbarReverse = "KMImageNameToolbarReverse";
+
+let KMImageNameToolbarCompress = "KMImageNameToolbarCompress";
+let KMImageNameToolbarSercurity = "KMImageNameToolbarSercurity";
+let KMImageNameToolbarWatermark = "KMImageNameToolbarWatermark";
+let KMImageNameToolbarBackground = "KMImageNameToolbarBackground";
+let KMImageNameToolbarHeaderFooter = "KMImageNameToolbarHeaderFooter";
+let KMImageNameToolbarBates = "KMImageNameToolbarBates";
+
+let KMImageNameToolbarPDFToWord = "KMImageNameToolbarPDFToWord";
+let KMImageNameToolbarPDFToHtml = "KMImageNameToolbarPDFToHtml";
+let KMImageNameToolbarPDFToText = "KMImageNameToolbarPDFToText";
+let KMImageNameToolbarPDFToImage = "KMImageNameToolbarPDFToImage";
+let KMImageNameToolbarImageToPDF = "KMImageNameToolbarImageToPDF";
+
+let KMImageNameToolbarThemes = "KMImageNameToolbarThemes";
+let KMImageNameToolbarTurning = "KMImageNameToolbarTurning";
+let KMImageNameToolbarSplitScreen = "KMImageNameToolbarSplitScreen";
+let KMImageNameToolbarBreaks = "KMImageNameToolbarBreaks";
+let KMImageNameToolbarRotateRight = "KMImageNameToolbarRotateRight";
+let KMImageNameToolbarRotateLeft = "KMImageNameToolbarRotateLeft";
+let KMImageNameToolbarCrop = "KMImageNameToolbarCrop";
+let KMImageNameToolbarSnapshots = "KMImageNameToolbarSnapshots";
+
+let KMImageNamePanelContent = "KMImageNamePanelContent";
+let KMImageNamePanelRange = "KMImageNamePanelRange";
+let KMImageNamePanelAdd = "KMImageNamePanelAdd";
+let KMImageNamePanelDelete = "KMImageNamePanelDelete";
+let KMImageNamePanelFilter = "KMImageNamePanelFilter";
+let KMImageNamePanelExport = "KMImageNamePanelExport";
+let KMImageNamePanelPrint = "KMImageNamePanelPrint";
+let KMImageNamePanelSettings = "KMImageNamePanelSettings";
+
+let KMImageNameHomeDelete = "KMImageNameHomeDelete";
+let KMImageNameHomeDeleteHover = "KMImageNameHomeDeleteHover";
+
+let KMImageNameFormTextField = "KMImageNameFormTextField";
+let KMImageNameFormTable = "KMImageNameFormTable";
+let KMImageNameFormRadio = "KMImageNameFormRadio";
+let KMImageNameFormList = "KMImageNameFormList";
+let KMImageNameFormComboBox = "KMImageNameFormComboBox";
+let KMImageNameFormCheckBox = "KMImageNameFormCheckBox";
+let KMImageNameFormActionButton = "KMImageNameFormActionButton";
+let KMImageNameFormSignature = "KMImageNameFormSignature";
+let KMImageNameFormSegmentation = "KMImageNameFormSegmentation";
+let KMImageNameFormAlignment = "KMImageNameFormAlignment";
+
+let KMImageNameSelfSignCircle = "KMImageNameSelfSignCircle";
+let KMImageNameSelfSignCircleMouse = "KMImageNameSelfSignCircleMouse";
+let KMImageNameSelfSignCircleSel = "KMImageNameSelfSignCircleSel";
+let KMImageNameSelfSignDot = "KMImageNameSelfSignDot";
+let KMImageNameSelfSignDotSel = "KMImageNameSelfSignDotSel";
+let KMImageNameSelfSignFalse = "KMImageNameSelfSignFalse";
+let KMImageNameSelfSignFalseMouse = "KMImageNameSelfSignFalseMouse";
+let KMImageNameSelfSignFalseSel = "KMImageNameSelfSignFalseSel";
+let KMImageNameSelfSignTure = "KMImageNameSelfSignTure";
+let KMImageNameSelfSignTureMouse = "KMImageNameSelfSignTureMouse";
+let KMImageNameSelfSignTureSel = "KMImageNameSelfSignTureSel";
+let KMImageNameSelfSignLine = "KMImageNameSelfSignLine";
+let KMImageNameSelfSignLineSel = "KMImageNameSelfSignLineSel";
+let KMImageNameSelfSignLineMouse = "KMImageNameSelfSignLineMouse";
+let KMImageNameSelfSignDotMouse = "KMImageNameSelfSignDotMouse";
+let KMImageNameSelfSignProfile = "KMImageNameSelfSignProfile";
+let KMImageNameSelfSignDate = "KMImageNameSelfSignDate";
+let KMImageNameSelfSignDateMouse = "KMImageNameSelfSignDateMouse";
+
+let KMImageNameSplitOne = "KMImageNameSplitOne";
+let KMImageNameSplitOneSelect = "KMImageNameSplitOneSelect";
+let KMImageNameSplitHorizontal = "KMImageNameSplitHorizontal";
+let KMImageNameSplitHorizontalSelect = "KMImageNameSplitHorizontalSelect";
+let KMImageNameSplitVertical = "KMImageNameSplitVertical";
+let KMImageNameSplitVerticalSelect = "KMImageNameSplitVerticalSelect";
+
+//UX 改版
+//Home
+let KMImageNameUXIconHomeGuideNor = "KMImageNameUXIconHomeGuideNor";
+let KMImageNameUXIconHomeGuidePre = "KMImageNameUXIconHomeGuidePre";
+let KMImageNameUXIconHomeIosNor = "KMImageNameUXIconHomeIosNor";
+let KMImageNameUXIconHomeIosPre = "KMImageNameUXIconHomeIosPre";
+let KMImageNameUXIconHomeViewlistNor = "KMImageNameUXIconHomeViewlistNor";
+let KMImageNameUXIconHomeViewlistPre = "KMImageNameUXIconHomeViewlistPre";
+let KMImageNameUXIconHomeViewthumbnailNor = "KMImageNameUXIconHomeViewthumbnailNor";
+let KMImageNameUXIconHomeViewthumbnailPre = "KMImageNameUXIconHomeViewthumbnailPre";
+let KMImageNameUXIconHomeQuicktoolBackgroundNor = "KMImageNameUXIconHomeQuicktoolBackgroundNor";
+let KMImageNameUXIconHomeQuicktoolBatchNor = "KMImageNameUXIconHomeQuicktoolBatchNor";
+let KMImageNameUXIconHomeQuicktoolComprison = "KMImageNameUXIconHomeQuicktoolComprison";
+let KMImageNameUXIconHomeQuicktoolBatesNor = "KMImageNameUXIconHomeQuicktoolBatesNor";
+let KMImageNameUXIconHomeQuicktoolBookNor = "KMImageNameUXIconHomeQuicktoolBookNor";
+let KMImageNameUXIconHomeQuicktoolConvertNor = "KMImageNameUXIconHomeQuicktoolConvertNor";
+let KMImageNameUXIconHomeQuicktoolExcelNor = "KMImageNameUXIconHomeQuicktoolExcelNor";
+let KMImageNameUXIconHomeQuicktoolExtractNor = "KMImageNameUXIconHomeQuicktoolExtractNor";
+let KMImageNameUXIconHomeQuicktoolHeaderandfooterNor = "KMImageNameUXIconHomeQuicktoolHeaderandfooterNor";
+let KMImageNameUXIconHomeQuicktoolInsertNor = "KMImageNameUXIconHomeQuicktoolInsertNor";
+let KMImageNameUXIconHomeQuicktoolMergeNor = "KMImageNameUXIconHomeQuicktoolMergeNor";
+let KMImageNameUXIconHomeQuicktoolMultipageNor = "KMImageNameUXIconHomeQuicktoolMultipageNor";
+let KMImageNameUXIconHomeQuicktoolOcrNor = "KMImageNameUXIconHomeQuicktoolOcrNor";
+let KMImageNameUXIconHomeQuicktoolOptimizeNor = "KMImageNameUXIconHomeQuicktoolOptimizeNor";
+let KMImageNameUXIconHomeQuicktoolPageeditNor = "KMImageNameUXIconHomeQuicktoolPageeditNor";
+let KMImageNameUXIconHomeQuicktoolPdftoimgNor = "KMImageNameUXIconHomeQuicktoolPdftoimgNor";
+let KMImageNameUXIconHomeQuicktoolPosterNor = "KMImageNameUXIconHomeQuicktoolPosterNor";
+let KMImageNameUXIconHomeQuicktoolPPTNor = "KMImageNameUXIconHomeQuicktoolPPTNor";
+let KMImageNameUXIconHomeQuicktoolSafeNor = "KMImageNameUXIconHomeQuicktoolSafeNor";
+let KMImageNameUXIconHomeQuicktoolSplitNor = "KMImageNameUXIconHomeQuicktoolSplitNor";
+let KMImageNameUXIconHomeQuicktoolWatermarkNor = "KMImageNameUXIconHomeQuicktoolWatermarkNor";
+let KMImageNameUXIconHomeQuicktoolWordNor = "KMImageNameUXIconHomeQuicktoolWordNor";
+let KMImageNameUXIconHomeRemoveNor = "KMImageNameUXIconHomeRemoveNor";
+let KMImageNameUXIconHomeRemoveHov = "KMImageNameUXIconHomeRemoveHov";
+//Batch
+let KMImageNameUXIconBatchBackground = "KMImageNameUXIconBatchBackground";
+let KMImageNameUXIconBatchBates = "KMImageNameUXIconBatchBates";
+let KMImageNameUXIconBatchConvert = "KMImageNameUXIconBatchConvert";
+let KMImageNameUXIconBatchConvertOCR = "KMImageNameUXIconBatchConvertOCR";
+let KMImageNameUXIconBatchHeaderandfooter = "KMImageNameUXIconBatchHeaderandfooter";
+let KMImageNameUXIconBatchMerge = "KMImageNameUXIconBatchMerge";
+let KMImageNameUXIconBatchOptimize = "KMImageNameUXIconBatchOptimize";
+let KMImageNameUXIconBatchComparison = "KMImageNameUXIconBatchComparison";
+let KMImageNameUXIconBatchSafe = "KMImageNameUXIconBatchSafe";
+let KMImageNameUXIconBatchWatermark = "KMImageNameUXIconBatchWatermark";
+//Toolbar
+let KMImageNameUXIconToolbarConvertNor = "KMImageNameUXIconToolbarConvertNor";
+let KMImageNameUXIconToolbarConvertSel = "KMImageNameUXIconToolbarConvertSel";
+let KMImageNameUXIconToolbarEditNor = "KMImageNameUXIconToolbarEditNor";
+let KMImageNameUXIconToolbarEditSel = "KMImageNameUXIconToolbarEditSel";
+let KMImageNameUXIconToolbarRedactNor = "KMImageNameUXIconToolbarRedactNor";
+let KMImageNameUXIconToolbarRedactSel = "KMImageNameUXIconToolbarRedactSel";
+let KMImageNameUXIconToolbarEdittoolNor = "KMImageNameUXIconToolbarEdittoolNor";
+let KMImageNameUXIconToolbarEdittoolSel = "KMImageNameUXIconToolbarEdittoolSel";
+let KMImageNameUXIconToolbarFillsignNor = "KMImageNameUXIconToolbarFillsignNor";
+let KMImageNameUXIconToolbarFillsignSel = "KMImageNameUXIconToolbarFillsignSel";
+let KMImageNameUXIconToolbarFormNor = "KMImageNameUXIconToolbarFormNor";
+let KMImageNameUXIconToolbarFormSel = "KMImageNameUXIconToolbarFormSel";
+let KMImageNameUXIconToolbarMytoolsNor = "KMImageNameUXIconToolbarMytoolsNor";
+let KMImageNameUXIconToolbarMytoolsSel = "KMImageNameUXIconToolbarMytoolsSel";
+let KMImageNameUXIconToolbarPageeditNor = "KMImageNameUXIconToolbarPageeditNor";
+let KMImageNameUXIconToolbarPageeditSel = "KMImageNameUXIconToolbarPageeditSel";
+let KMImageNameUXIconToolbarPageviewNor = "KMImageNameUXIconToolbarPageviewNor";
+let KMImageNameUXIconToolbarPageviewSel = "KMImageNameUXIconToolbarPageviewSel";
+let KMImageNameUXIconToolbarShareNor = "KMImageNameUXIconToolbarShareNor";
+let KMImageNameUXIconToolbarShareSel = "KMImageNameUXIconToolbarShareSel";
+let KMImageNameUXIconToolbarZoominNor = "KMImageNameUXIconToolbarZoominNor";
+let KMImageNameUXIconToolbarZoominSel = "KMImageNameUXIconToolbarZoominSel";
+let KMImageNameUXIconToolbarZoomoutNor = "KMImageNameUXIconToolbarZoomoutNor";
+let KMImageNameToolbarZoomoutPre = "KMImageNameToolbarZoomoutPre";
+let KMImageNameToolbarBackwardNor = "KMImageNameToolbarBackwardNor";
+let KMImageNameToolbarBackwardSel = "KMImageNameToolbarBackwardSel";
+let KMImageNameToolbarFirstpageNor = "KMImageNameToolbarFirstpageNor";
+let KMImageNameToolbarFirstpageSel = "KMImageNameToolbarFirstpageSel";
+let KMImageNameToolbarForwardNor = "KMImageNameToolbarForwardNor";
+let KMImageNameToolbarForwardSel = "KMImageNameToolbarForwardSel";
+let KMImageNameToolbarHomeNor = "KMImageNameToolbarHomeNor";
+let KMImageNameToolbarHomeSel = "KMImageNameToolbarHomeSel";
+let KMImageNameToolbarLastpageNor = "KMImageNameToolbarLastpageNor";
+let KMImageNameToolbarLastpageSel = "KMImageNameToolbarLastpageSel";
+let KMImageNameToolbarPagenextNor = "KMImageNameToolbarPagenextNor";
+let KMImageNameToolbarPagenextSel = "KMImageNameToolbarPagenextSel";
+let KMImageNameToolbarPagepreviousNor = "KMImageNameToolbarPagepreviousNor";
+let KMImageNameToolbarPagepreviousSel = "KMImageNameToolbarPagepreviousSel";
+let KMImageNameToolbarSlideshowNor = "KMImageNameToolbarSlideshowNor";
+let KMImageNameToolbarSlideshowSel = "KMImageNameToolbarSlideshowSel";
+let KMImageNameToolbarFontNor = "KMImageNameToolbarFontNor";
+let KMImageNameToolbarFontSel = "KMImageNameToolbarFontSel";
+let KMImageNameToolbarInfoNor = "KMImageNameToolbarInfoNor";
+let KMImageNameToolbarInfoSel = "KMImageNameToolbarInfoSel";
+let KMImageNameToolbarOCRNor = "KMImageNameToolbarOCRNor";
+let KMImageNameToolbarOCRSel = "KMImageNameToolbarOCRSel";
+let KMImageNameToolbarPrintNor = "KMImageNameToolbarPrintNor";
+let KMImageNameToolbarPrintSel = "KMImageNameToolbarPrintSel";
+let KMImageNameToolbarStirkeNor = "KMImageNameToolbarStirkeNor";
+let KMImageNameToolbarStirkeSel = "KMImageNameToolbarStirkeSel";
+//ic_Subtoolbar
+let KMImageNameUXIconSubtoolbarConvertCreatPDF = "KMImageNameUXIconSubtoolbarConvertCreatpdf";
+let KMImageNameUXIconSubtoolbarConvertCSV = "KMImageNameUXIconSubtoolbarConvertCSV";
+let KMImageNameUXIconSubtoolbarConvertExcel = "KMImageNameUXIconSubtoolbarConvertExcel";
+let KMImageNameUXIconSubtoolbarConvertHtml = "KMImageNameUXIconSubtoolbarConvertHtml";
+let KMImageNameUXIconSubtoolbarConvertOCR = "KMImageNameUXIconSubtoolbarConvertOCR";
+let KMImageNameUXIconSubtoolbarConvertPDFToIMG = "KMImageNameUXIconSubtoolbarConvertPDFToIMG";
+let KMImageNameUXIconSubtoolbarConvertExportImage = "KMImageNameUXIconSubtoolbarConvertExportImage";
+let KMImageNameUXIconSubtoolbarConvertPPT = "KMImageNameUXIconSubtoolbarConvertPPT";
+let KMImageNameUXIconSubtoolbarConvertRTF = "KMImageNameUXIconSubtoolbarConvertRTF";
+let KMImageNameUXIconSubtoolbarConvertText = "KMImageNameUXIconSubtoolbarConvertText";
+let KMImageNameUXIconSubtoolbarConvertWord = "KMImageNameUXIconSubtoolbarConvertWord";
+let KMImageNameUXIconSubtoolbarDisplaySnapshot = "KMImageNameUXIconSubtoolbarDisplaySnapshot";
+let KMImageNameUXIconSubtoolbarDisplayTailor = "KMImageNameUXIconSubtoolbarDisplayTailor";
+let KMImageNameUXIconSubtoolbarDisplayTTS = "KMImageNameUXIconSubtoolbarDisplayTTS";
+let KMImageNameUXIconSubtoolbarDisplayView = "KMImageNameUXIconSubtoolbarDisplayView";
+let KMImageNameUXIconSubtoolbarEdittoolRemovepassword = "KMImageNameUXIconSubtoolbarEdittoolRemovepassword";
+let KMImageNameUXIconSubtoolbarEdittoolSafe = "KMImageNameUXIconSubtoolbarEdittoolSafe";
+let KMImageNameUXIconSubtoolbarFillsignDate = "KMImageNameUXIconSubtoolbarFillsignDate";
+let KMImageNameUXIconSubtoolbarFillsignDigitalsignature = "KMImageNameUXIconSubtoolbarFillsignDigitalsignature";
+let KMImageNameUXIconSubtoolbarFillsignFork = "KMImageNameUXIconSubtoolbarFillsignFork";
+let KMImageNameUXIconSubtoolbarFillsignLine = "KMImageNameUXIconSubtoolbarFillsignLine";
+let KMImageNameUXIconSubtoolbarFillsignMyprofile = "KMImageNameUXIconSubtoolbarFillsignMyprofile";
+let KMImageNameUXIconSubtoolbarFillsignMysignature = "KMImageNameUXIconSubtoolbarFillsignMysignature";
+let KMImageNameUXIconSubtoolbarFillsignPoint = "KMImageNameUXIconSubtoolbarFillsignPoint";
+let KMImageNameButtonRedactText = "KMImageNameButtonRedactText";
+let KMImageNameUXIconSubtoolbarFillsignRoundedrec = "KMImageNameUXIconSubtoolbarFillsignRoundedrec";
+let KMImageNameUXIconSubtoolbarFillsignTick = "KMImageNameUXIconSubtoolbarFillsignTick";
+let KMImageNameUXIconSubtoolbarFormButton = "KMImageNameUXIconSubtoolbarFormButton";
+let KMImageNameUXIconSubtoolbarFormCheckbox = "KMImageNameUXIconSubtoolbarFormCheckbox";
+let KMImageNameUXIconSubtoolbarFormListbox = "KMImageNameUXIconSubtoolbarFormListbox";
+let KMImageNameUXIconSubtoolbarFormPulldownmenu = "KMImageNameUXIconSubtoolbarFormPulldownmenu";
+let KMImageNameUXIconSubtoolbarFormRadiobutton = "KMImageNameUXIconSubtoolbarFormRadiobutton";
+let KMImageNameUXIconSubtoolbarFormSet = "KMImageNameUXIconSubtoolbarFormSet";
+let KMImageNameUXIconSubtoolbarFormSign = "KMImageNameUXIconSubtoolbarFormSign";
+let KMImageNameUXIconSubtoolbarFormClear = "KMImageNameUXIconSubtoolbarFormClear";
+let KMImageNameUXIconSubtoolbarFormTextfield = "KMImageNameUXIconSubtoolbarFormTextfield";
+let KMImageNameUXIconSubtoolbarMytoolsAreazoom = "KMImageNameUXIconSubtoolbarMytoolsAreazoom";
+let KMImageNameUXIconSubtoolbarMytoolsArrow = "KMImageNameUXIconSubtoolbarMytoolsArrow";
+let KMImageNameUXIconSubtoolbarMytoolsContentsel = "KMImageNameUXIconSubtoolbarMytoolsContentsel";
+let KMImageNameUXIconSubtoolbarMytoolsHighlight = "KMImageNameUXIconSubtoolbarMytoolsHighlight";
+let KMImageNameUXIconSubtoolbarMytoolsImage = "KMImageNameUXIconSubtoolbarMytoolsImage";
+let KMImageNameUXIconSubtoolbarMytoolsLine = "KMImageNameUXIconSubtoolbarMytoolsLine";
+let KMImageNameUXIconSubtoolbarMytoolsLink = "KMImageNameUXIconSubtoolbarMytoolsLink";
+let KMImageNameUXIconSubtoolbarMytoolsMagnifier = "KMImageNameUXIconSubtoolbarMytoolsMagnifier";
+let KMImageNameUXIconSubtoolbarMytoolsNote = "KMImageNameUXIconSubtoolbarMytoolsNote";
+let KMImageNameUXIconSubtoolbarMytoolsOval = "KMImageNameUXIconSubtoolbarMytoolsOval";
+let KMImageNameUXIconSubtoolbarMytoolsPantool = "KMImageNameUXIconSubtoolbarMytoolsPantool";
+let KMImageNameUXIconSubtoolbarMytoolsPen = "KMImageNameUXIconSubtoolbarMytoolsPen";
+let KMImageNameUXIconSubtoolbarMytoolsRec = "KMImageNameUXIconSubtoolbarMytoolsRec";
+let KMImageNameUXIconSubtoolbarMytoolsSign = "KMImageNameUXIconSubtoolbarMytoolsSign";
+let KMImageNameUXIconSubtoolbarMytoolsStamp = "KMImageNameUXIconSubtoolbarMytoolsStamp";
+let KMImageNameUXIconSubtoolbarMytoolsStrikeout = "KMImageNameUXIconSubtoolbarMytoolsStrikeout";
+let KMImageNameUXIconSubtoolbarMytoolsTable = "KMImageNameUXIconSubtoolbarMytoolsTable";
+let KMImageNameUXIconSubtoolbarMytoolsText = "KMImageNameUXIconSubtoolbarMytoolsText";
+let KMImageNameUXIconSubtoolbarMytoolsUnderline = "KMImageNameUXIconSubtoolbarMytoolsUnderline";
+let KMImageNameUXIconSubtoolbarPageCopy = "KMImageNameUXIconSubtoolbarPageCopy";
+let KMImageNameUXIconSubtoolbarPageDelete = "KMImageNameUXIconSubtoolbarPageDelete";
+let KMImageNameUXIconSubtoolbarPageExtract = "KMImageNameUXIconSubtoolbarPageExtract";
+let KMImageNameUXIconSubtoolbarPageInsert = "KMImageNameUXIconSubtoolbarPageInsert";
+let KMImageNameUXIconSubtoolbarPagePaste = "KMImageNameUXIconSubtoolbarPagePaste";
+let KMImageNameUXIconSubtoolbarPageRange = "KMImageNameUXIconSubtoolbarPageRange";
+let KMImageNameUXIconSubtoolbarPageReverse = "KMImageNameUXIconSubtoolbarPageReverse";
+let KMImageNameUXIconSubtoolbarPageRotate = "KMImageNameUXIconSubtoolbarPageRotate";
+let KMImageNameUXIconSubtoolbarPageSplit = "KMImageNameUXIconSubtoolbarPageSplit";
+let KMImageNameUXIconSubtoolbarPageTailor = "KMImageNameUXIconSubtoolbarPageTailor";
+//ic_Sidetabbar
+let KMImageNameUXIconSidetabbarAnnotationNor = "KMImageNameUXIconSidetabbarAnnotationNor";
+let KMImageNameUXIconSidetabbarAnnotationSel = "KMImageNameUXIconSidetabbarAnnotationSel";
+let KMImageNameUXIconSidetabbarOutlineNor = "KMImageNameUXIconSidetabbarOutlineNor";
+let KMImageNameUXIconSidetabbarOutlineSel = "KMImageNameUXIconSidetabbarOutlineSel";
+let KMImageNameUXIconSidetabbarSearchNor = "KMImageNameUXIconSidetabbarSearchNor";
+let KMImageNameUXIconSidetabbarSearchSel = "KMImageNameUXIconSidetabbarSearchSel";
+let KMImageNameUXIconSidetabbarSnapshotNor = "KMImageNameUXIconSidetabbarSnapshotNor";
+let KMImageNameUXIconSidetabbarSnapshotSel = "KMImageNameUXIconSidetabbarSnapshotSel";
+let KMImageNameUXIconSidetabbarThumbnailNor = "KMImageNameUXIconSidetabbarThumbnailNor";
+let KMImageNameUXIconSidetabbarThumbnailSel = "KMImageNameUXIconSidetabbarThumbnailSel";
+//ic_Sidebar
+let KMImageNameUXIconSidebarAnnotationFilterHightlightNor = "KMImageNameUXIconSidebarAnnotationFilterHightlightNor";
+let KMImageNameUXIconSidebarAnnotationFilterHightlightWhite = "KMImageNameUXIconSidebarAnnotationFilterHightlightWhite";
+let KMImageNameUXIconSidebarAnnotationFilterOvalNor = "KMImageNameUXIconSidebarAnnotationFilterOvalNor";
+let KMImageNameUXIconSidebarAnnotationFilterOvalWhite = "KMImageNameUXIconSidebarAnnotationFilterOvalWhite";
+let KMImageNameUXIconSidebarAnnotationFilterStampNor = "KMImageNameUXIconSidebarAnnotationFilterStampNor";
+let KMImageNameUXIconSidebarAnnotationFilterStampWhite = "KMImageNameUXIconSidebarAnnotationFilterStampWhite";
+let KMImageNameUXIconSidebarAnnotationFilterTextNor = "KMImageNameUXIconSidebarAnnotationFilterTextNor";
+let KMImageNameUXIconSidebarAnnotationFilterTextWhite = "KMImageNameUXIconSidebarAnnotationFilterTextWhite";
+let KMImageNameUXIconSidebarAnnotationFilterUnderlineNor = "KMImageNameUXIconSidebarAnnotationFilterUnderlineNor";
+let KMImageNameUXIconSidebarAnnotationFilterUnderlineWhite = "KMImageNameUXIconSidebarAnnotationFilterUnderlineWhite";
+let KMImageNameUXIconSidebarAnnotationHightlight = "KMImageNameUXIconSidebarAnnotationHightlight";
+let KMImageNameUXIconSidebarAnnotationOval = "KMImageNameUXIconSidebarAnnotationOval";
+let KMImageNameUXIconSidebarAnnotationStamp = "KMImageNameUXIconSidebarAnnotationStamp";
+let KMImageNameUXIconSidebarAnnotationText = "KMImageNameUXIconSidebarAnnotationText";
+let KMImageNameUXIconSidebarAnnotationUnderline = "KMImageNameUXIconSidebarAnnotationUnderline";
+let KMImageNameUXIconSidebarFormButton = "KMImageNameUXIconSidebarFormButton";
+let KMImageNameUXIconSidebarFormCheckbox = "KMImageNameUXIconSidebarFormCheckbox";
+let KMImageNameUXIconSidebarFormListbox = "KMImageNameUXIconSidebarFormListbox";
+let KMImageNameUXIconSidebarFormPulldownmenu = "KMImageNameUXIconSidebarFormPulldownmenu";
+let KMImageNameUXIconSidebarFormRadiobutton = "KMImageNameUXIconSidebarFormRadiobutton";
+let KMImageNameUXIconSidebarFormSign = "KMImageNameUXIconSidebarFormSign";
+let KMImageNameUXIconSidebarFormTextfield = "KMImageNameUXIconSidebarFormTextfield";
+let KMImageNameUXIconSidebarSnapshotWindowNor = "KMImageNameUXIconSidebarSnapshotWindowNor";
+let KMImageNameUXIconSidebarSnapshotWindowSel = "KMImageNameUXIconSidebarSnapshotWindowSel";
+let KMImageNameSidebarAnnotationLink = "KMImageNameSidebarAnnotationLink";
+let KMImageNameSidebarAnnotationImage = "KMImageNameSidebarAnnotationImage";
+let KMImageNameSidebarAnnotationSign = "KMImageNameSidebarAnnotationSign";
+let KMImageNameSidebarAnnotationTable = "KMImageNameSidebarAnnotationTable";
+let KMImageNameSidebarAnnotationMarkup = "KMImageNameSidebarAnnotationMarkup";
+let KMImageNameSidebarAnnotationNote = "KMImageNameSidebarAnnotationNote";
+//ic_Propertybar
+let KMImageNameUXIconPropertybarAlignDownNor = "KMImageNameUXIconPropertybarAlignDownNor";
+let KMImageNameUXIconPropertybarAlignDownPre = "KMImageNameUXIconPropertybarAlignDownPre";
+let KMImageNameUXIconPropertybarAlignHorcenterNor = "KMImageNameUXIconPropertybarAlignHorcenterNor";
+let KMImageNameUXIconPropertybarAlignHorcenterPre = "KMImageNameUXIconPropertybarAlignHorcenterPre";
+let KMImageNameUXIconPropertybarAlignHorsplitNor = "KMImageNameUXIconPropertybarAlignHorsplitNor";
+let KMImageNameUXIconPropertybarAlignHorsplitPre = "KMImageNameUXIconPropertybarAlignHorsplitPre";
+let KMImageNameUXIconPropertybarAlignLeftNor = "KMImageNameUXIconPropertybarAlignLeftNor";
+let KMImageNameUXIconPropertybarAlignLeftPre = "KMImageNameUXIconPropertybarAlignLeftPre";
+let KMImageNameUXIconPropertybarAlignLeftToor = "KMImageNameUXIconPropertybarAlignLeftToor";
+let KMImageNameUXIconPropertybarAlignRightNor = "KMImageNameUXIconPropertybarAlignRightNor";
+let KMImageNameUXIconPropertybarAlignRightPre = "KMImageNameUXIconPropertybarAlignRightPre";
+let KMImageNameUXIconPropertybarAlignUpNor = "KMImageNameUXIconPropertybarAlignUpNor";
+let KMImageNameUXIconPropertybarAlignUpPre = "KMImageNameUXIconPropertybarAlignUpPre";
+let KMImageNameUXIconPropertybarAlignVercenterNor = "KMImageNameUXIconPropertybarAlignVercenterNor";
+let KMImageNameUXIconPropertybarAlignVercenterPre = "KMImageNameUXIconPropertybarAlignVercenterPre";
+let KMImageNameUXIconPropertybarAlignVersplitNor = "KMImageNameUXIconPropertybarAlignVersplitNor";
+let KMImageNameUXIconPropertybarAlignVersplitPre = "KMImageNameUXIconPropertybarAlignVersplitPre";
+let KMImageNameUXIconPropertybarFileElse = "KMImageNameUXIconPropertybarFileElse";
+let KMImageNameUXIconPropertybarFileExcel = "KMImageNameUXIconPropertybarFileExcel";
+let KMImageNameUXIconPropertybarFileIMG = "KMImageNameUXIconPropertybarFileIMG";
+let KMImageNameUXIconPropertybarFilePdf = "KMImageNameUXIconPropertybarFilePdf";
+let KMImageNameUXIconPropertybarFilePPT = "KMImageNameUXIconPropertybarFilePPT";
+let KMImageNameUXIconPropertybarFileWord = "KMImageNameUXIconPropertybarFileWord";
+let KMImageNameUXIconPropertybarFillsignForkNor = "KMImageNameUXIconPropertybarFillsignForkNor";
+let KMImageNameUXIconPropertybarFillsignForkSel = "KMImageNameUXIconPropertybarFillsignForkSel";
+let KMImageNameUXIconPropertybarFillsignLineNor = "KMImageNameUXIconPropertybarFillsignLineNor";
+let KMImageNameUXIconPropertybarFillsignLineSel = "KMImageNameUXIconPropertybarFillsignLineSel";
+let KMImageNameUXIconPropertybarFillsignPointNor = "KMImageNameUXIconPropertybarFillsignPointNor";
+let KMImageNameUXIconPropertybarFillsignPointSel = "KMImageNameUXIconPropertybarFillsignPointSel";
+let KMImageNameUXIconPropertybarFillsignRoundedrecNor = "KMImageNameUXIconPropertybarFillsignRoundedrecNor";
+let KMImageNameUXIconPropertybarFillsignRoundedrecSel = "KMImageNameUXIconPropertybarFillsignRoundedrecSel";
+let KMImageNameUXIconPropertybarFillsignTickNor = "KMImageNameUXIconPropertybarFillsignTickNor";
+let KMImageNameUXIconPropertybarFillsignTickSel = "KMImageNameUXIconPropertybarFillsignTickSel";
+let KMImageNameUXIconPropertybarLinkEmail = "KMImageNameUXIconPropertybarLinkEmail";
+let KMImageNameUXIconPropertybarLinkPage = "KMImageNameUXIconPropertybarLinkPage";
+let KMImageNameUXIconPropertybarLinkUrl = "KMImageNameUXIconPropertybarLinkUrl";
+let KMImageNameUXIconPropertybarNoteAnnotationNor = "KMImageNameUXIconPropertybarNoteAnnotationNor";
+let KMImageNameUXIconPropertybarNoteAnnotationSel = "KMImageNameUXIconPropertybarNoteAnnotationSel";
+let KMImageNameUXIconPropertybarNoteHelpNor = "KMImageNameUXIconPropertybarNoteHelpNor";
+let KMImageNameUXIconPropertybarNoteHelpSel = "KMImageNameUXIconPropertybarNoteHelpSel";
+let KMImageNameUXIconPropertybarNoteInsertNor = "KMImageNameUXIconPropertybarNoteInsertNor";
+let KMImageNameUXIconPropertybarNoteInsertSel = "KMImageNameUXIconPropertybarNoteInsertSel";
+let KMImageNameUXIconPropertybarNoteKeywordNor = "KMImageNameUXIconPropertybarNoteKeywordNor";
+let KMImageNameUXIconPropertybarNoteKeywordSel = "KMImageNameUXIconPropertybarNoteKeywordSel";
+let KMImageNameUXIconPropertybarNoteNewparagraphNor = "KMImageNameUXIconPropertybarNoteNewparagraphNor";
+let KMImageNameUXIconPropertybarNoteNewparagraphSel = "KMImageNameUXIconPropertybarNoteNewparagraphSel";
+let KMImageNameUXIconPropertybarNoteNotesNor = "KMImageNameUXIconPropertybarNoteNotesNor";
+let KMImageNameUXIconPropertybarNoteNotesSel = "KMImageNameUXIconPropertybarNoteNotesSel";
+let KMImageNameUXIconPropertybarNoteParagraphNor = "KMImageNameUXIconPropertybarNoteParagraphNor";
+let KMImageNameUXIconPropertybarNoteParagraphSel = "KMImageNameUXIconPropertybarNoteParagraphSel";
+let KMImageNameUXIconPropertybarRotateClockwiseNor = "KMImageNameUXIconPropertybarRotateClockwiseNor";
+let KMImageNameUXIconPropertybarRotateClockwisePre = "KMImageNameUXIconPropertybarRotateClockwisePre";
+let KMImageNameUXIconPropertybarRotateCounterclockwiseNor = "KMImageNameUXIconPropertybarRotateCounterclockwiseNor";
+let KMImageNameUXIconPropertybarRotateCounterclockwisePre = "KMImageNameUXIconPropertybarRotateCounterclockwisePre";
+let KMImageNameUXIconPropertybarTableBottom = "KMImageNameUXIconPropertybarTableBottom";
+let KMImageNameUXIconPropertybarTableTitleAbove = "KMImageNameUXIconPropertybarTableTitleAbove";
+let KMImageNameUXIconPropertybarTableTitleLeft = "KMImageNameUXIconPropertybarTableTitleLeft";
+let KMImageNameUXIconPropertybarTextalignCenterNor = "KMImageNameUXIconPropertybarTextalignCenterNor";
+let KMImageNameUXIconPropertybarTextalignCenterSel = "KMImageNameUXIconPropertybarTextalignCenterSel";
+let KMImageNameUXIconPropertybarTextalignCenterWhite = "KMImageNameUXIconPropertybarTextalignCenterWhite";
+let KMImageNameUXIconPropertybarTextalignJustifyNor = "KMImageNameUXIconPropertybarTextalignJustifyNor";
+let KMImageNameUXIconPropertybarTextalignJustifySel = "KMImageNameUXIconPropertybarTextalignJustifySel";
+let KMImageNameUXIconPropertybarTextalignJustifyWhite = "KMImageNameUXIconPropertybarTextalignJustifyWhite";
+let KMImageNameUXIconPropertybarTextalignLeftNor = "KMImageNameUXIconPropertybarTextalignLeftNor";
+let KMImageNameUXIconPropertybarTextalignLeftSel = "KMImageNameUXIconPropertybarTextalignLeftSel";
+let KMImageNameUXIconPropertybarTextalignLeftWhite = "KMImageNameUXIconPropertybarTextalignLeftWhite";
+let KMImageNameUXIconPropertybarTextalignRightNor = "KMImageNameUXIconPropertybarTextalignRightNor";
+let KMImageNameUXIconPropertybarTextalignRightSel = "KMImageNameUXIconPropertybarTextalignRightSel";
+let KMImageNameUXIconPropertybarTextalignRightWhite = "KMImageNameUXIconPropertybarTextalignRightWhite";
+let KMImageNameUXIconPropertybarViewPagecoverNor = "KMImageNameUXIconPropertybarViewPagecoverNor";
+let KMImageNameUXIconPropertybarViewPagecoverSel = "KMImageNameUXIconPropertybarViewPagecoverSel";
+let KMImageNameUXIconPropertybarViewPagedoubleNor = "KMImageNameUXIconPropertybarViewPagedoubleNor";
+let KMImageNameUXIconPropertybarViewPagedoubleSel = "KMImageNameUXIconPropertybarViewPagedoubleSel";
+let KMImageNameUXIconPropertybarViewPagereadingNor = "KMImageNameUXIconPropertybarViewPagereadingNor";
+let KMImageNameUXIconPropertybarViewPagereadingSel = "KMImageNameUXIconPropertybarViewPagereadingSel";
+let KMImageNameUXIconPropertybarViewPagesingleNor = "KMImageNameUXIconPropertybarViewPagesingleNor";
+let KMImageNameUXIconPropertybarViewPagesingleSel = "KMImageNameUXIconPropertybarViewPagesingleSel";
+let KMImageNameUXIconPropertybarViewSplitscreenhorNor = "KMImageNameUXIconPropertybarViewSplitscreenhorNor";
+let KMImageNameUXIconPropertybarViewSplitscreenhorSel = "KMImageNameUXIconPropertybarViewSplitscreenhorSel";
+let KMImageNameUXIconPropertybarViewSplitscreensingleNor = "KMImageNameUXIconPropertybarViewSplitscreensingleNor";
+let KMImageNameUXIconPropertybarViewSplitscreensingleSel = "KMImageNameUXIconPropertybarViewSplitscreensingleSel";
+let KMImageNameUXIconPropertybarViewSplitscreenverNor = "KMImageNameUXIconPropertybarViewSplitscreenverNor";
+let KMImageNameUXIconPropertybarViewSplitscreenverSel = "KMImageNameUXIconPropertybarViewSplitscreenverSel";
+
+let KMImageNameUXIconPropertybarFileHTML = "KMImageNameUXIconPropertybarFileHTML";
+let KMImageNameUXIconPropertybarFileCSV = "KMImageNameUXIconPropertybarFileCSV";
+let KMImageNameUXIconPropertybarFileTXT = "KMImageNameUXIconPropertybarFileTXT";
+let KMImageNameUXIconPropertybarFileJPEG = "KMImageNameUXIconPropertybarFileJPEG";
+let KMImageNameUXIconPropertybarFileJPG = "KMImageNameUXIconPropertybarFileJPG";
+let KMImageNameUXIconPropertybarFilePNG = "KMImageNameUXIconPropertybarFilePNG";
+let KMImageNameUXIconPropertybarFileGIF = "KMImageNameUXIconPropertybarFileGIF";
+let KMImageNameUXIconPropertybarFileTIFF = "KMImageNameUXIconPropertybarFileTIFF";
+let KMImageNameUXIconPropertybarFileTGA = "KMImageNameUXIconPropertybarFileTGA";
+let KMImageNameUXIconPropertybarFileBMP = "KMImageNameUXIconPropertybarFileBMP";
+let KMImageNameUXIconPropertybarFileJP2 = "KMImageNameUXIconPropertybarFileJP2";
+
+//ic_Cursors
+let KMImageNameUXIconCursorsText = "KMImageNameUXIconCursorsText";
+//ic_Progress
+let KMImageNameUXIconProgressComplete = "KMImageNameUXIconProgressComplete";
+let KMImageNameUXIconProgressFailure = "KMImageNameUXIconProgressFailure";
+let KMImageNameUXIconProgressWaiting = "KMImageNameUXIconProgressWaiting";
+//ic_Vip
+let KMImageNameUXIconVip = "KMImageNameUXIconVip";
+//ic_Btn
+let KMImageNameUXIconBtnAddHov = "KMImageNameUXIconBtnAddHov";
+let KMImageNameUXIconBtnAddNor = "KMImageNameUXIconBtnAddNor";
+let KMImageNameUXIconBtnAddWhite = "KMImageNameUXIconBtnAddWhite";
+let KMImageNameUXIconBtnArrowDown = "KMImageNameUXIconBtnArrowDown";
+let KMImageNameUXIconBtnArrowLeft = "KMImageNameUXIconBtnArrowLeft";
+let KMImageNameUXIconBtnArrowRight = "KMImageNameUXIconBtnArrowRight";
+let KMImageNameUXIconBtnArrowUp = "KMImageNameUXIconBtnArrowUp";
+let KMImageNameUXIconBtnArrowUpdown = "KMImageNameUXIconBtnArrowUpdown";
+let KMImageNameUXIconBtnCheckboxDis = "KMImageNameUXIconBtnCheckboxDis";
+let KMImageNameUXIconBtnCheckboxSel = "KMImageNameUXIconBtnCheckboxSel";
+let KMImageNameUXIconBtnClear = "KMImageNameUXIconBtnClear";
+let KMImageNameUXIconBtnCloseHov = "KMImageNameUXIconBtnCloseHov";
+let KMImageNameUXIconBtnCloseNor = "KMImageNameUXIconBtnCloseNor";
+let KMImageNameUXIconBtnCloseWhite = "KMImageNameUXIconBtnCloseWhite";
+let KMImageNameUXIconBtnColor = "KMImageNameUXIconBtnColor";
+let KMImageNameUXIconBtnDeletAccent = "KMImageNameUXIconBtnDeletAccent";
+let KMImageNameUXIconBtnDeletHov = "KMImageNameUXIconBtnDeletHov";
+let KMImageNameUXIconBtnDeletNor = "KMImageNameUXIconBtnDeletNor";
+let KMImageNameUXIconBtnEditHov = "KMImageNameUXIconBtnEditHov";
+let KMImageNameUXIconBtnEditNor = "KMImageNameUXIconBtnEditNor";
+let KMImageNameUXIconBtnEyesInvisible = "KMImageNameUXIconBtnEyesInvisible";
+let KMImageNameUXIconBtnEyesVisible = "KMImageNameUXIconBtnEyesVisible";
+let KMImageNameUXIconBtnFontsetNor = "KMImageNameUXIconBtnFontsetNor";
+let KMImageNameUXIconBtnFontsetPre = "KMImageNameUXIconBtnFontsetPre";
+let KMImageNameUXIconBtnOpenfileNor = "KMImageNameUXIconBtnOpenfileNor";
+let KMImageNameUXIconBtnOpenfileWhite = "KMImageNameUXIconBtnOpenfileWhite";
+let KMImageNameUXIconBtnOvalarrowDown = "KMImageNameUXIconBtnOvalarrowDown";
+let KMImageNameUXIconBtnRadioDis = "KMImageNameUXIconBtnRadioDis";
+let KMImageNameUXIconBtnRadioSel = "KMImageNameUXIconBtnRadioSel";
+let KMImageNameUXIconBtnSearchbarSearch = "KMImageNameUXIconBtnSearchbarSearch";
+let KMImageNameUXIconBtnSearchbarSearchfilter = "KMImageNameUXIconBtnSearchbarSearchfilter";
+let KMImageNameUXIconBtnSetNor = "KMImageNameUXIconBtnSetNor";
+let KMImageNameUXIconBtnSetPre = "KMImageNameUXIconBtnSetPre";
+let KMImageNameUXIconBtnSidebarAddNor = "KMImageNameUXIconBtnSidebarAddNor";
+let KMImageNameUXIconBtnSidebarAddPre = "KMImageNameUXIconBtnSidebarAddPre";
+let KMImageNameUXIconBtnSidebarFilterNor = "KMImageNameUXIconBtnSidebarFilterNor";
+let KMImageNameUXIconBtnSidebarFilterPre = "KMImageNameUXIconBtnSidebarFilterPre";
+let KMImageNameUXIconBtnSidebarListNor = "KMImageNameUXIconBtnSidebarListNor";
+let KMImageNameUXIconBtnSidebarListPre = "KMImageNameUXIconBtnSidebarListPre";
+let KMImageNameUXIconBtnSidebarMoreNor = "KMImageNameUXIconBtnSidebarMoreNor";
+let KMImageNameUXIconBtnSidebarMorePre = "KMImageNameUXIconBtnSidebarMorePre";
+let KMImageNameUXIconBtnSidebarMoreSecondary = "KMImageNameUXIconBtnSidebarMoreSecondary";
+let KMImageNameUXIconBtnSidebarPageNor = "KMImageNameUXIconBtnSidebarPageNor";
+let KMImageNameUXIconBtnSidebarPagePre = "KMImageNameUXIconBtnSidebarPagePre";
+let KMImageNameUXIconBtnSidebarSearchNor = "KMImageNameUXIconBtnSidebarSearchNor";
+let KMImageNameUXIconBtnSidebarSearchPre = "KMImageNameUXIconBtnSidebarSearchPre";
+let KMImageNameUXIconBtnSidebarZoominNor = "KMImageNameUXIconBtnSidebarZoominNor";
+let KMImageNameUXIconBtnSidebarZoominPre = "KMImageNameUXIconBtnSidebarZoominPre";
+let KMImageNameUXIconBtnSidebarZoomoutNor = "KMImageNameUXIconBtnSidebarZoomoutNor";
+let KMImageNameUXIconBtnSidebarZoomoutPre = "KMImageNameUXIconBtnSidebarZoomoutPre";
+let KMImageNameUXIconBtnStrikeNor = "KMImageNameUXIconBtnStrikeNor";
+let KMImageNameUXIconBtnStrikePre = "KMImageNameUXIconBtnStrikePre";
+let KMImageNameUXIconBtnsysArrowLeft = "KMImageNameUXIconBtnsysArrowLeft";
+let KMImageNameUXIconBtnSysArrowRight = "KMImageNameUXIconBtnSysArrowRight";
+let KMImageNameUXIconBtnTriDownNor = "KMImageNameUXIconBtnTriDownNor";
+let KMImageNameUXIconBtnTriDownPre = "KMImageNameUXIconBtnTriDownPre";
+let KMImageNameUXIconBtnTriLeftNor = "KMImageNameUXIconBtnTriLeftNor";
+let KMImageNameUXIconBtnTriLeftPre = "KMImageNameUXIconBtnTriLeftPre";
+let KMImageNameUXIconBtnTriLeftSel = "KMImageNameUXIconBtnTriLeftSel";
+let KMImageNameUXIconBtnTriRightNor = "KMImageNameUXIconBtnTriRightNor";
+let KMImageNameUXIconBtnTriRightPre = "KMImageNameUXIconBtnTriRightPre";
+let KMImageNameUXIconBtnTriRightSel = "KMImageNameUXIconBtnTriRightSel";
+let KMImageNameUXIconBtnTriUpNor = "KMImageNameUXIconBtnTriUpNor";
+let KMImageNameUXIconBtnTriUpPre = "KMImageNameUXIconBtnTriUpPre";
+let KMImageNameBtnSidebarRankPositive = "KMImageNameBtnSidebarRankPositive";
+let KMImageNameBtnSidebarRankReverse = "KMImageNameBtnSidebarRankReverse";
+let KMImageNameEmptyOutline = "KMImageNameEmptyOutline";
+let KMImageNameEmptyAnnotation = "KMImageNameEmptyAnnotation";
+let KMImageNameEmptySearch = "KMImageNameEmptySearch";
+let KMImageNameEmptyStamp = "KMImageNameEmptyStamp";
+let KMImageNameEmptySign = "KMImageNameEmptySign";
+let KMImageNameEmptyWatermark = "KMImageNameEmptyWatermark";
+let KMImageNameEmptyBackground = "KMImageNameEmptyBackground";
+let KMImageNameEmptyHeaderandfooter = "KMImageNameEmptyHeaderandfooter";
+let KMImageNameEmptySplitview = "KMImageNameEmptySplitview";
+let KMImageNameCursorsUnderline = "KMImageNameCursorsUnderline";
+let KMImageNameCursorsHighlight = "KMImageNameCursorsHighlight";
+let KMImageNameCursorsStrikeout = "KMImageNameCursorsStrikeout";
+let KMImageNameCursorsFreehand = "KMImageNameCursorsFreehand";
+let KMImageNameCursorsText = "KMImageNameCursorsText";
+let KMImageNameCursorsNote = "KMImageNameCursorsNote";
+let KMImageNameCursorsRec = "KMImageNameCursorsRec";
+let KMImageNameCursorsOval = "KMImageNameCursorsOval";
+let KMImageNameCursorsArrow = "KMImageNameCursorsArrow";
+let KMImageNameCursorsTable = "KMImageNameCursorsTable";
+let KMImageNameCursorsLink = "KMImageNameCursorsLink";
+let KMImageNameCursorsLine = "KMImageNameCursorsLine";
+
+let KMImageNameCursorsButton = "KMImageNameCursorsButton";
+let KMImageNameCursorsCheckbox = "KMImageNameCursorsCheckbox";
+let KMImageNameCursorsDate = "KMImageNameCursorsDate";
+let KMImageNameCursorsFork = "KMImageNameCursorsFork";
+let KMImageNameCursorsFormLine = "KMImageNameCursorsFormLine";
+let KMImageNameCursorsListbox = "KMImageNameCursorsListbox";
+let KMImageNameCursorsPoint = "KMImageNameCursorsPoint";
+let KMImageNameCursorsPulldownmenu = "KMImageNameCursorsPulldownmenu";
+let KMImageNameCursorsRadiobutton = "KMImageNameCursorsRadiobutton";
+let KMImageNameCursorsRoundedrec = "KMImageNameCursorsRoundedrec";
+let KMImageNameCursorsSign = "KMImageNameCursorsSign";
+let KMImageNameCursorsTextfield = "KMImageNameCursorsTextfield";
+let KMImageNameCursorsTick = "KMImageNameCursorsTick";
+let KMImageNameElse1 = "KMImageNameElse1";
+let KMImageNameElse2 = "KMImageNameElse2";
+let KMImageNameElsei = "KMImageNameElsei";
 
 @objc class KMAppearance: NSObject {
     
@@ -1358,9 +1910,4 @@ extension KMAppearance {
     struct Status {}
     struct Interactive {}
     struct Layout {}
-    
-    /*
-     
-     
-     */
 }

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

@@ -512,20 +512,20 @@ extension KMBrowserWindowController {
     @IBAction func openBlankPage(_ sender: Any) {
         let document: KMMainDocument = self.browser.activeTabContents() as! KMMainDocument
         if (document.isHome) {
-            document.homeViewController?.openBlankPage(sender)
+            document.homeViewController?.openBlankPage()
         } else {
             self.homeVC = KMHomeViewController()
-            self.homeVC?.openBlankPage(sender)
+            self.homeVC?.openBlankPage()
         }
     }
     
     @IBAction func importFromScanner(_ sender: Any) {
         let document: KMMainDocument = self.browser.activeTabContents() as! KMMainDocument
         if (document.isHome) {
-            document.homeViewController?.importFromScanner(sender)
+            document.homeViewController?.importFromScanner()
         } else {
             self.homeVC = KMHomeViewController()
-            self.homeVC?.importFromScanner(sender)
+            self.homeVC?.importFromScanner()
         }
     }
     

+ 21 - 1
PDF Office/PDF Master/Class/Common/Category/NSObject+KMExtension.swift

@@ -210,6 +210,26 @@ func KMContextRestoreGState(_ ctx: CGContext?) {
     ctx?.restoreGState()
 }
 
+func KMContextScaleCTM(_ ctx: CGContext?, _ sx: CGFloat, _ sy: CGFloat) {
+    ctx?.scaleBy(x: sx, y: sy)
+}
+
+func KMContextTranslateCTM(_ ctx: CGContext?, _ tx: CGFloat, _ ty: CGFloat) {
+    ctx?.translateBy(x: tx, y: ty)
+}
+
+func KMContextRotateCTM(_ ctx: CGContext?, _ angle: CGFloat) {
+    ctx?.rotate(by: angle)
+}
+
+func KMContextConcatCTM(_ ctx: CGContext?, _ transform: CGAffineTransform) {
+    ctx?.concatenate(transform)
+}
+
+func KMContextGetCTM(_ ctx: CGContext?) -> CGAffineTransform? {
+    return ctx?.ctm
+}
+
 func KMContextSetLineWidth(_ ctx: CGContext?, _ width: CGFloat) {
     ctx?.setLineWidth(width)
 }
@@ -218,7 +238,7 @@ func KMContextSetLineCap(_ ctx: CGContext?, _ cap: CGLineCap) {
     ctx?.setLineCap(cap)
 }
 
-func CGContextSetLineJoin(_ ctx: CGContext?, _ join: CGLineJoin) {
+func KMContextSetLineJoin(_ ctx: CGContext?, _ join: CGLineJoin) {
     ctx?.setLineJoin(join)
 }
 

+ 6 - 2
PDF Office/PDF Master/Class/Common/Category/View/NSMenu+KMExtension.swift

@@ -20,10 +20,14 @@ import Foundation
         return item
     }
     
-    func addItem(title: String, action: Selector?, target: AnyObject?, tag: Int) -> NSMenuItem? {
+    func addItem_r(title: String, action: Selector?, target: AnyObject?, tag: Int) -> NSMenuItem? {
         return self.insertItem(title: title, action: action, target: target, tag: tag, atIndex: self.numberOfItems)
     }
     
+    func addItem(title: String, action: Selector?, target: AnyObject?, tag: Int) {
+        _ = self.addItem_r(title: title, action: action, target: target, tag: tag)
+    }
+    
     func addItem(title: String, action: Selector?, target: AnyObject?) -> NSMenuItem? {
         return self.insertItem(title: title, action: action, target: target, atIndex: self.numberOfItems)
     }
@@ -39,7 +43,7 @@ extension NSMenu {
     }
     
     func addItem(withTitle title: String, action: Selector?, target: AnyObject?, tag: Int) -> NSMenuItem? {
-        return self.addItem(title: title, action: action, target: target, tag: tag)
+        return self.addItem_r(title: title, action: action, target: target, tag: tag)
     }
     
     func addItem(withTitle title: String, action: Selector?, target: AnyObject?) -> NSMenuItem? {

+ 2 - 2
PDF Office/PDF Master/Class/Document/KMDocumentController.swift

@@ -128,8 +128,8 @@ class KMDocumentController: NSDocumentController {
     @IBAction func importFromWebPage(_ sender: Any) {
         let windowController: KMURLToPDFWindowController = KMURLToPDFWindowController.init(windowNibName: NSNib.Name("KMURLToPDFWindowController"))
         
-        windowController.beginSheetModal(for: NSApp.mainWindow!) { filePath in
-            if filePath != nil && FileManager.default.fileExists(atPath: filePath) {
+        windowController.beginSheetModalForWindow(NSWindow.currentWindow()) { filePath in
+            if FileManager.default.fileExists(atPath: filePath) {
                 NSDocumentController.shared.openDocument(withContentsOf: URL(fileURLWithPath: filePath), display: true) { document, documentWasAlreadyOpen, error in
                     if error != nil {
                         NSApp.presentError(error!)

+ 88 - 0
PDF Office/PDF Master/Class/Home/View/CreatPDFView/KMCreatPDFView.swift

@@ -0,0 +1,88 @@
+//
+//  KMCreatPDFView.swift
+//  PDF Master
+//
+//  Created by lizhe on 2023/10/23.
+//
+
+import Cocoa
+
+typealias KMCreatPDFViewOpenPDFAction = (_ view: KMCreatPDFView, _ sender: KMBox) -> Void
+typealias KMCreatPDFViewCreatAction = (_ view: KMCreatPDFView, _ sender: KMBox) -> Void
+class KMCreatPDFView: KMBaseXibView {
+    @IBOutlet weak var openBox: KMBox!
+    @IBOutlet weak var openLabel: NSTextField!
+    @IBOutlet weak var creatBox: KMBox!
+    @IBOutlet weak var creatLabel: NSTextField!
+    
+    var openPDFAction: KMCreatPDFViewOpenPDFAction?
+    var creatPDFAction: KMCreatPDFViewCreatAction?
+    
+    
+    override func draw(_ dirtyRect: NSRect) {
+        super.draw(dirtyRect)
+
+        // Drawing code here.
+    }
+    
+    override func setup() {
+        self.openLabel.stringValue = NSLocalizedString("Open File", comment: "")
+        self.openLabel.textColor = KMAppearance.Layout.w0Color()
+        self.creatLabel.stringValue = NSLocalizedString("Create PDF", comment: "")
+        self.creatLabel.textColor = KMAppearance.Layout.m_1Color()
+        
+        self.openBox.fillColor = KMAppearance.Interactive.m0Color()
+        self.openBox.toolTip = NSLocalizedString("Open PDF", comment: "")
+        self.openBox.downCallback = { [unowned self] downEntered, mouseBox, event in
+            if (downEntered) {
+                self.openBox.fillColor = KMAppearance.Interactive.m_1Color()
+                self.openPDFButtonAction()
+            } else {
+                self.openBox.fillColor = KMAppearance.Interactive.m0Color()
+            }
+        };
+        
+        self.openBox.moveCallback = { [unowned self] mouseEntered, mouseBox in
+            if (mouseEntered) {
+                self.openBox.fillColor = KMAppearance.Interactive.m1Color()
+            } else {
+                self.openBox.fillColor = KMAppearance.Interactive.m0Color()
+            }
+        };
+        
+        self.creatBox.toolTip = NSLocalizedString("Create PDF", comment: "")
+        self.creatBox.fillColor = KMAppearance.Layout.l0Color()
+        self.creatBox.borderWidth = 1.0;
+        self.creatBox.borderColor = KMAppearance.Interactive.m0Color()
+        self.creatBox.downCallback = { [unowned self] downEntered, mouseBox, event in
+            if (downEntered) {
+                self.creatBox.fillColor = KMAppearance.Status.preColor()
+                self.createPDFButtonAction()
+            } else {
+                self.creatBox.fillColor = KMAppearance.Layout.l0Color()
+            }
+        };
+        
+        self.creatBox.moveCallback = { [unowned self] mouseEntered, mouseBox in
+            if (mouseEntered) {
+                self.creatBox.fillColor = KMAppearance.Status.hovColor()
+            } else {
+                self.creatBox.fillColor = KMAppearance.Layout.l0Color()
+            }
+        };
+
+    }
+    
+    @objc func openPDFButtonAction() {
+        guard let callBack = openPDFAction else { return }
+        
+        callBack(self, self.openBox)
+    }
+    
+    @objc func createPDFButtonAction() {
+        guard let callBack = creatPDFAction else { return }
+        
+        callBack(self, self.creatBox)
+    }
+    
+}

+ 172 - 0
PDF Office/PDF Master/Class/Home/View/CreatPDFView/KMCreatPDFView.xib

@@ -0,0 +1,172 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22155" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22155"/>
+        <capability name="Named colors" minToolsVersion="9.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner" customClass="KMCreatPDFView" customModule="PDF_Master" customModuleProvider="target">
+            <connections>
+                <outlet property="creatBox" destination="Vti-iD-u9k" id="vT4-20-HTW"/>
+                <outlet property="creatLabel" destination="Olj-cQ-f0O" id="gSh-sd-zkf"/>
+                <outlet property="openBox" destination="OeJ-LB-1ap" id="nOb-dC-iS1"/>
+                <outlet property="openLabel" destination="qds-xE-Fcm" id="qUo-Mc-DrK"/>
+            </connections>
+        </customObject>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <customView id="c22-O7-iKe">
+            <rect key="frame" x="0.0" y="0.0" width="264" height="111"/>
+            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+            <subviews>
+                <view translatesAutoresizingMaskIntoConstraints="NO" id="yL2-Zs-ryZ">
+                    <rect key="frame" x="0.0" y="0.0" width="264" height="111"/>
+                    <subviews>
+                        <box boxType="custom" cornerRadius="1" translatesAutoresizingMaskIntoConstraints="NO" id="Vti-iD-u9k" customClass="KMBox" customModule="PDF_Master" customModuleProvider="target">
+                            <rect key="frame" x="0.0" y="0.0" width="264" height="48"/>
+                            <view key="contentView" id="gdX-gO-RS9">
+                                <rect key="frame" x="1" y="1" width="262" height="46"/>
+                                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                <subviews>
+                                    <box boxType="custom" borderWidth="0.0" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="KOh-3q-duh" customClass="KMBox" customModule="PDF_Master" customModuleProvider="target">
+                                        <rect key="frame" x="81" y="13" width="100" height="20"/>
+                                        <view key="contentView" id="ynC-Yp-Rnv">
+                                            <rect key="frame" x="0.0" y="0.0" width="100" height="20"/>
+                                            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                            <subviews>
+                                                <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="DqF-AX-qBg">
+                                                    <rect key="frame" x="0.0" y="2" width="16" height="16"/>
+                                                    <constraints>
+                                                        <constraint firstAttribute="width" constant="16" id="Yi7-CW-rTg"/>
+                                                        <constraint firstAttribute="height" constant="16" id="uJh-TZ-AfO"/>
+                                                    </constraints>
+                                                    <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="KMImageNameUXIconHomeCreat" id="XU9-pp-nBe"/>
+                                                </imageView>
+                                                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Olj-cQ-f0O">
+                                                    <rect key="frame" x="22" y="0.0" width="78" height="20"/>
+                                                    <constraints>
+                                                        <constraint firstAttribute="height" constant="20" id="B90-4D-ERP"/>
+                                                    </constraints>
+                                                    <textFieldCell key="cell" lineBreakMode="clipping" title="Create PDF" id="aBP-nQ-0jc">
+                                                        <font key="font" metaFont="system" size="14"/>
+                                                        <color key="textColor" name="KMMainColor"/>
+                                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                    </textFieldCell>
+                                                </textField>
+                                            </subviews>
+                                            <constraints>
+                                                <constraint firstItem="Olj-cQ-f0O" firstAttribute="leading" secondItem="DqF-AX-qBg" secondAttribute="trailing" constant="8" id="YzH-JB-nCq"/>
+                                                <constraint firstItem="DqF-AX-qBg" firstAttribute="leading" secondItem="ynC-Yp-Rnv" secondAttribute="leading" id="usz-HE-PLd"/>
+                                            </constraints>
+                                        </view>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="20" id="0P0-Uf-7Sd"/>
+                                            <constraint firstItem="Olj-cQ-f0O" firstAttribute="centerY" secondItem="KOh-3q-duh" secondAttribute="centerY" id="KHw-Lo-Cp3"/>
+                                            <constraint firstAttribute="width" constant="100" id="RjJ-VU-H4Z"/>
+                                            <constraint firstItem="DqF-AX-qBg" firstAttribute="centerY" secondItem="KOh-3q-duh" secondAttribute="centerY" id="kDp-4n-XSk"/>
+                                        </constraints>
+                                    </box>
+                                </subviews>
+                                <constraints>
+                                    <constraint firstItem="KOh-3q-duh" firstAttribute="centerY" secondItem="gdX-gO-RS9" secondAttribute="centerY" id="Plt-1X-mO2"/>
+                                    <constraint firstItem="KOh-3q-duh" firstAttribute="centerX" secondItem="gdX-gO-RS9" secondAttribute="centerX" id="XLN-Rg-zLn"/>
+                                </constraints>
+                            </view>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="48" id="VN2-AK-KQD"/>
+                            </constraints>
+                            <color key="borderColor" name="KMMainColor"/>
+                            <color key="fillColor" name="KMGray1Color"/>
+                        </box>
+                        <box boxType="custom" cornerRadius="1" translatesAutoresizingMaskIntoConstraints="NO" id="OeJ-LB-1ap" customClass="KMBox" customModule="PDF_Master" customModuleProvider="target">
+                            <rect key="frame" x="0.0" y="63" width="264" height="48"/>
+                            <view key="contentView" id="duq-hz-9tP">
+                                <rect key="frame" x="1" y="1" width="262" height="46"/>
+                                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                <subviews>
+                                    <box boxType="custom" borderWidth="0.0" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="7Av-Ws-uiE" customClass="KMBox" customModule="PDF_Master" customModuleProvider="target">
+                                        <rect key="frame" x="81" y="13" width="100" height="20"/>
+                                        <view key="contentView" id="omc-32-Ugy">
+                                            <rect key="frame" x="0.0" y="0.0" width="100" height="20"/>
+                                            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                            <subviews>
+                                                <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="SiE-jD-UiH">
+                                                    <rect key="frame" x="0.0" y="2" width="16" height="16"/>
+                                                    <constraints>
+                                                        <constraint firstAttribute="height" constant="16" id="lkT-Dc-NQf"/>
+                                                        <constraint firstAttribute="width" constant="16" id="x7w-2n-8QR"/>
+                                                    </constraints>
+                                                    <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="KMImageNameUXIconHomeOpen" id="JPt-by-dBN"/>
+                                                </imageView>
+                                                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="qds-xE-Fcm">
+                                                    <rect key="frame" x="22" y="0.0" width="70" height="20"/>
+                                                    <constraints>
+                                                        <constraint firstAttribute="height" constant="20" id="nj0-lx-g2B"/>
+                                                    </constraints>
+                                                    <textFieldCell key="cell" lineBreakMode="clipping" title="Open PDF" id="6EN-Y0-PYa">
+                                                        <font key="font" metaFont="system" size="14"/>
+                                                        <color key="textColor" name="KMWhiteColor"/>
+                                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                    </textFieldCell>
+                                                </textField>
+                                            </subviews>
+                                            <constraints>
+                                                <constraint firstItem="SiE-jD-UiH" firstAttribute="leading" secondItem="omc-32-Ugy" secondAttribute="leading" id="j64-5p-f05"/>
+                                                <constraint firstItem="qds-xE-Fcm" firstAttribute="leading" secondItem="SiE-jD-UiH" secondAttribute="trailing" constant="8" id="mQa-ZT-qYW"/>
+                                            </constraints>
+                                        </view>
+                                        <constraints>
+                                            <constraint firstItem="SiE-jD-UiH" firstAttribute="centerY" secondItem="7Av-Ws-uiE" secondAttribute="centerY" id="0bc-iR-1qB"/>
+                                            <constraint firstItem="qds-xE-Fcm" firstAttribute="centerY" secondItem="7Av-Ws-uiE" secondAttribute="centerY" id="1Xk-r3-Epe"/>
+                                            <constraint firstAttribute="height" constant="20" id="ZCt-iJ-0oc"/>
+                                            <constraint firstAttribute="width" constant="100" id="sSV-xC-7xx"/>
+                                        </constraints>
+                                    </box>
+                                </subviews>
+                                <constraints>
+                                    <constraint firstItem="7Av-Ws-uiE" firstAttribute="centerX" secondItem="duq-hz-9tP" secondAttribute="centerX" id="R1g-fh-sD5"/>
+                                    <constraint firstItem="7Av-Ws-uiE" firstAttribute="centerY" secondItem="duq-hz-9tP" secondAttribute="centerY" id="hGg-xc-GuA"/>
+                                </constraints>
+                            </view>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="48" id="xL4-kK-xXT"/>
+                            </constraints>
+                            <color key="borderColor" name="KMMainColor"/>
+                            <color key="fillColor" name="KMMainColor"/>
+                        </box>
+                    </subviews>
+                    <constraints>
+                        <constraint firstItem="OeJ-LB-1ap" firstAttribute="leading" secondItem="yL2-Zs-ryZ" secondAttribute="leading" id="7sl-eo-q7F"/>
+                        <constraint firstAttribute="trailing" secondItem="Vti-iD-u9k" secondAttribute="trailing" id="De8-yp-eCF"/>
+                        <constraint firstItem="OeJ-LB-1ap" firstAttribute="top" secondItem="yL2-Zs-ryZ" secondAttribute="top" id="LUY-V2-o7w"/>
+                        <constraint firstAttribute="bottom" secondItem="Vti-iD-u9k" secondAttribute="bottom" id="faF-sy-OTS"/>
+                        <constraint firstAttribute="trailing" secondItem="OeJ-LB-1ap" secondAttribute="trailing" id="g5k-GP-Lvt"/>
+                        <constraint firstItem="Vti-iD-u9k" firstAttribute="leading" secondItem="yL2-Zs-ryZ" secondAttribute="leading" id="lxE-UJ-6WD"/>
+                    </constraints>
+                </view>
+            </subviews>
+            <constraints>
+                <constraint firstItem="yL2-Zs-ryZ" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" id="Pyd-d5-aek"/>
+                <constraint firstAttribute="bottom" secondItem="yL2-Zs-ryZ" secondAttribute="bottom" id="ZZ8-e5-Frp"/>
+                <constraint firstAttribute="trailing" secondItem="yL2-Zs-ryZ" secondAttribute="trailing" id="fGG-Aj-OS3"/>
+                <constraint firstItem="yL2-Zs-ryZ" firstAttribute="top" secondItem="c22-O7-iKe" secondAttribute="top" id="ogg-YZ-VWL"/>
+            </constraints>
+            <point key="canvasLocation" x="-64" y="186.5"/>
+        </customView>
+    </objects>
+    <resources>
+        <image name="KMImageNameUXIconHomeCreat" width="16" height="16"/>
+        <image name="KMImageNameUXIconHomeOpen" width="16" height="16"/>
+        <namedColor name="KMGray1Color">
+            <color red="0.32899999618530273" green="0.32400000095367432" blue="0.4779999852180481" alpha="0.33000001311302185" colorSpace="custom" customColorSpace="sRGB"/>
+        </namedColor>
+        <namedColor name="KMMainColor">
+            <color red="0.15294117647058825" green="0.23529411764705882" blue="0.3843137254901961" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+        </namedColor>
+        <namedColor name="KMWhiteColor">
+            <color red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+        </namedColor>
+    </resources>
+</document>

+ 2 - 2
PDF Office/PDF Master/Class/Home/View/KMStepperView.swift

@@ -54,8 +54,8 @@ class KMStepperView: NSViewController {
     var borderWidth: Float = 0.0
     var borderColor: NSColor = .clear
     var cornerRadius: Float = 0.0
-    var upImage: NSImage = NSImage(named: "btn_arrow_gray_up_s_norm_on")!
-    var downImage: NSImage = NSImage(named: "btn_arrow_gray_down_s_norm_on")!
+    var upImage: NSImage = NSImage(named: "btn_arrow_gray_up_s_norm_on") ?? NSImage()
+    var downImage: NSImage = NSImage(named: "btn_arrow_gray_down_s_norm_on") ?? NSImage()
     open weak var delete: KMStepperViewDelegate?
     var enabled: Bool = true // 是否可点击
 

+ 17 - 81
PDF Office/PDF Master/Class/Home/ViewController/KMHomeViewController+Action.swift

@@ -61,7 +61,7 @@ extension KMHomeViewController {
             openPDFButtonAction()
             break
         case .CreatePDF:
-            createPDFButtonAction()
+            
             break
         case .Home:
             homeButtonAction()
@@ -226,13 +226,6 @@ extension KMHomeViewController {
         }
     }
     
-    func createPDFButtonAction() {
-        let popViewDataArr = [NSLocalizedString("New Blank Page", comment: ""),
-//                              NSLocalizedString("New From Web Page", comment: ""),
-                              NSLocalizedString("Import From Scanner", comment: "")]
-        createPopoverAction(popViewDataArr)
-    }
-    
     func homeButtonAction() {
         refreshRightBoxUI(.Home)
     }
@@ -253,22 +246,22 @@ extension KMHomeViewController {
     func productPromotionFoldOrUnfold(_ sender: NSButton) {
         var arr1: [NSString] = []
         var arr2: [NSString] = []
-        if sender.isEqual(to: pdfSeriesButtonVC.button) {
-            if self.pdfProSeriesBoxHeightConstraint.constant == 0 {
-                arr1 = self.productPromotionPDFProSeries as! [NSString]
-            }
-            if self.othersBoxHeightConstraint.constant > 0 {
-                arr2 = self.productPromotionOthers as! [NSString]
-            }
-        }
-        if sender.isEqual(to: self.pdfOthersButtonVC.button) {
-            if self.pdfProSeriesBoxHeightConstraint.constant > 0 {
-                arr1 = self.productPromotionPDFProSeries as! [NSString]
-            }
-            if self.othersBoxHeightConstraint.constant == 0 {
-                arr2 = self.productPromotionOthers as! [NSString]
-            }
-        }
+//        if sender.isEqual(to: pdfSeriesButtonVC.button) {
+//            if self.pdfProSeriesBoxHeightConstraint.constant == 0 {
+//                arr1 = self.productPromotionPDFProSeries as! [NSString]
+//            }
+//            if self.othersBoxHeightConstraint.constant > 0 {
+//                arr2 = self.productPromotionOthers as! [NSString]
+//            }
+//        }
+//        if sender.isEqual(to: self.pdfOthersButtonVC.button) {
+//            if self.pdfProSeriesBoxHeightConstraint.constant > 0 {
+//                arr1 = self.productPromotionPDFProSeries as! [NSString]
+//            }
+//            if self.othersBoxHeightConstraint.constant == 0 {
+//                arr2 = self.productPromotionOthers as! [NSString]
+//            }
+//        }
         self.productPromotionShow(arr1 as NSArray, withOthers: arr2 as NSArray, isInitialize: false)
         
         refreshProductActiveSpacing()
@@ -1208,18 +1201,6 @@ extension KMHomeViewController {
         }
     }
     
-    // MARK: MenuItem Action & PopoverItem Action
-    
-    func popoverItemAction(_ count: String) {
-        if count == NSLocalizedString("New Blank Page", comment: "") {
-            openBlankPage("")
-        } else if count == NSLocalizedString("New From Web Page", comment: "") {
-            importFromWebPage("")
-        } else if count == NSLocalizedString("Import From Scanner", comment: "") {
-            importFromScanner("")
-        }
-    }
-    
     @IBAction func escButtonAction(_ sender: Any) {
 //        self.historyFileViewController.selectFiles.removeAll()
 //        if self.historyFileViewController.showMode == .Thumbnail {
@@ -1234,51 +1215,6 @@ extension KMHomeViewController {
         self.openSupportPDFButtonAction()
     }
     
-    @IBAction func openBlankPage(_ sender: Any) {
-        let fileName: NSString = String(format: "%@.pdf", NSLocalizedString("Untitled", comment: "")) as NSString
-        let savePath = fetchUniquePath(fileName.kUrlToPDFFolderPath() as String)
-        let pdfDocument = CPDFDocument()
-        pdfDocument?.insertPage(CGSize(width: 595, height: 842), at: 0)
-        pdfDocument?.write(to: URL(fileURLWithPath: savePath))
-        NSDocumentController.shared.openDocument(withContentsOf: URL(fileURLWithPath: savePath), display: true) { document, documentWasAlreadyOpen, error in
-            if error != nil {
-                NSApp.presentError(error!)
-            } else {
-                if document is KMMainDocument {
-                    let newDocument = document
-                    (newDocument as! KMMainDocument).isNewCreated = true
-                }
-            }
-        }
-    }
-    
-    @IBAction func importFromWebPage(_ sender: Any) {
-        self.urlToPDFWindowController = KMURLToPDFWindowController.init(windowNibName: NSNib.Name("KMURLToPDFWindowController"))
-        
-        self.urlToPDFWindowController!.beginSheetModal(for: NSApp.mainWindow!) { filePath in
-            if filePath != nil && FileManager.default.fileExists(atPath: filePath) {
-                NSDocumentController.shared.openDocument(withContentsOf: URL(fileURLWithPath: filePath), display: true) { document, documentWasAlreadyOpen, error in
-                    if error != nil {
-                        NSApp.presentError(error!)
-                    } else {
-                        if document is KMMainDocument {
-                            (document as! KMMainDocument).isNewCreated = true
-                        }
-                    }
-                }
-            }
-        }
-    }
-    
-    @IBAction func importFromScanner(_ sender: Any) {
-        deviceBrowserWC = KMDeviceBrowserWindowController.shared
-        deviceBrowserWC?.type = .scanner
-        deviceBrowserWC?.importScannerFileCallback = { [weak self](url: NSURL) -> Void in
-            self?.openFile(withFilePath: url as URL)
-        }
-        deviceBrowserWC?.showWindow(NSApp.mainWindow)
-    }
-    
     @IBAction func menuItemClick_mergePDF(_ sender: Any) {
         fastTool_MergePDF()
     }

+ 215 - 183
PDF Office/PDF Master/Class/Home/ViewController/KMHomeViewController.swift

@@ -6,8 +6,6 @@
 //
 
 import Cocoa
-import KMAdvertisement
-
 @objc enum KMHomeToolState : Int {
     case OpenPDF = 0
     case CreatePDF
@@ -30,36 +28,6 @@ import KMAdvertisement
     @IBOutlet weak var rightBox: NSBox!
     @IBOutlet weak var homeSplitView: NSSplitView!
     @IBOutlet weak var homeRightScrollViewView: NSScrollView!
-    
-    @IBOutlet weak var openPDFBox: NSBox!               // Open PDF
-    @IBOutlet weak var openPDFBoxHeight: NSLayoutConstraint!
-    @IBOutlet weak var createPDFBox: NSBox!             // Create PDF
-    @IBOutlet weak var createPDFView: NSBox!             // Create PDF
-    @IBOutlet weak var createPDFBoxHeight: NSLayoutConstraint!
-    @IBOutlet weak var createPDFViewHeight: NSLayoutConstraint!
-    @IBOutlet weak var homeBox: NSBox!                  // Home
-    @IBOutlet weak var homeBoxHeight: NSLayoutConstraint!
-    @IBOutlet weak var pdfToolsBox: NSBox!              // PDF Tools
-    @IBOutlet weak var pdfToolsBoxHeight: NSLayoutConstraint!
-    @IBOutlet weak var favoriteDocumentsBox: KMBox!     // Favorite Documents
-    @IBOutlet weak var favoriteDocumentsLabel: NSTextField!
-    @IBOutlet weak var favoriteDocumentsImageView: NSImageView!
-    @IBOutlet weak var cloudDocumentsBox: NSBox!        // Cloud Documents
-    @IBOutlet weak var cloudDocumentsBoxHeight: NSLayoutConstraint!
-    @IBOutlet weak var productPromotionBox: KMBox!      // 产品推广
-    @IBOutlet weak var pdfSeriesBox: NSBox!
-    @IBOutlet weak var pdfSeriesBoxHeight: NSLayoutConstraint!
-    @IBOutlet weak var pdfProSeriesBox: NSBox!
-    @IBOutlet weak var pdfProSeriesBoxHeightConstraint: NSLayoutConstraint!
-    @IBOutlet weak var pdfOthersBox: NSBox!
-    @IBOutlet weak var pdfOthersBoxHeightConstraint: NSLayoutConstraint!
-    @IBOutlet weak var othersBox: NSBox!
-    @IBOutlet weak var othersBoxHeightConstraint: NSLayoutConstraint!
-    @IBOutlet weak var activitiesBox: KMBox!            // 活动
-    @IBOutlet weak var product_active_box: NSBox!
-    @IBOutlet weak var product_active_scrollView: NSScrollView!
-    
-    @IBOutlet weak var product_active_spacing: NSLayoutConstraint!
 
     @IBOutlet weak var rightTopBox: NSBox!
     @IBOutlet weak var rightBottomBox: NSBox!
@@ -90,6 +58,13 @@ import KMAdvertisement
     @IBOutlet var aiTranslationViewController: KMAITranslationVC!
     @IBOutlet var aiRewritingViewController: KMAIRewritingVC!
     
+    @IBOutlet weak var creatPDFView: KMCreatPDFView!
+    
+    //广告 互推
+    @IBOutlet weak var advertisementTableView: KMAdvertisementTableView!
+    @IBOutlet weak var advertisementTableViewHeightConstraint: NSLayoutConstraint!
+    @IBOutlet weak var advertisementShowView: KMAdvertisementShowView!
+    
     var aiHomeState: KMAIHomeToolState = .Home
     
     let ScrollerViewWidget: CGFloat = 15.0
@@ -167,11 +142,12 @@ import KMAdvertisement
             self.otherMouseDown(with: aEvent)
             return aEvent
         }
-//        self.initNetworkingData()
+        self.initNetworkingData()
 //        self.initLocalization()
 //        self.initializeUI()
         self.initializeUI_DMG()
         
+        self.setup()
 //        refreshUI()
         
         NotificationCenter.default.addObserver(self, selector: #selector(homeFileRectChange(_:)), name: Notification.Name("KMHomeFileRectChange"), object: nil)
@@ -193,135 +169,74 @@ import KMAdvertisement
         KMAdvertisementManager.manager.fetchDataWithResponseObject { [unowned self] data, responseObject, error in
             KMPrint("获取广告数据成功")
             if data != nil {
-                for model in data! {
-                    guard let sectionContent = model.content else { break }
-                    if model.showType == .list {
-                        for section in sectionContent {
-                            KMPrint("list section 标题" + KMAdvertisementModelTransition.transitionLanguage(langeuage: section.sectionTitle?.language))
-                            guard let itemContent = section.content else { break }
-                            
-                            for item in itemContent {
-                                KMPrint("item 标题" + KMAdvertisementModelTransition.transitionLanguage(langeuage: item.title?.language))
-                                KMPrint("item 图片链接" + KMAdvertisementModelTransition.transitionLanguage(langeuage: item.imageURL?.normal?.universal))
-                                KMPrint("item 点击链接" + KMAdvertisementModelTransition.transitionLanguage(langeuage: item.linkURL))
-                                KMPrint("item tips" + KMAdvertisementModelTransition.transitionLanguage(langeuage: item.tips))
-                                KMPrint("item actionType" + String(Int(item.actionType.rawValue)))
-                            }
-                        }
-                    }
-                    if model.showType == .view {
-                        for section in sectionContent {
-                            KMPrint("view section 标题" + KMAdvertisementModelTransition.transitionLanguage(langeuage: section.sectionTitle?.language))
-                            guard let itemContent = section.content else { break }
-                            
-                            for item in itemContent {
-                                KMPrint("item 标题 = " + KMAdvertisementModelTransition.transitionLanguage(langeuage: item.title?.language))
-                                KMPrint("item 图片链接 = " + KMAdvertisementModelTransition.transitionLanguage(langeuage: item.imageURL?.normal?.universal))
-                                KMPrint("item 点击链接 = " + KMAdvertisementModelTransition.transitionLanguage(langeuage: item.linkURL))
-                                KMPrint("item tips = " + KMAdvertisementModelTransition.transitionLanguage(langeuage: item.tips))
-                                KMPrint("item actionType = " + String(Int(item.actionType.rawValue)))
-                            }
-                        }
+                advertisementTableView.inputData = data!.recommondContent
+                advertisementTableView.didSelect = { view, item in
+                    let string = KMAdvertisementModelTransition.transitionLanguage(langeuage: item.linkURL)
+                    if NSWorkspace.shared.open(URL.init(string: string)!) {
+                        NSWorkspace.shared.open(URL.init(string: string)!)
                     }
                 }
+                advertisementShowView.inputData = data!.advertisement
             }
         }
     }
     
+    func setup() {
+        self.creatPDFView.openPDFAction = { [unowned self] view, sender in
+            self.openPDFAction(sender)
+        }
+        
+        self.creatPDFView.creatPDFAction = { [unowned self] view, sender in
+            self.creatPDFAction(sender)
+        }
+    }
+    
     // MARK: Init
     
     func initializeUI() {
-        openPDFBox.fillColor = .clear
-        openPDFBox.contentView = openPDFButtonVC.view
-        openPDFButtonVC.target = self
-        openPDFButtonVC.action = #selector(self.homeToolAction(_:))
-        openPDFButtonVC.button(type: .Brand, size: .l, height: openPDFBoxHeight)
-
-        createPDFBox.fillColor = .clear
-        createPDFBox.contentView = createPDFButtonVC.view
-        createPDFButtonVC.target = self
-        createPDFButtonVC.action = #selector(self.homeToolAction(_:))
-        createPDFButtonVC.button(type: .Sec, size: .l, height: createPDFBoxHeight)
-        createPDFButtonVC.textButtonBox.move =  { [unowned self](mouseEntered: Bool) -> Void in
-            if mouseEntered {
-                if self.createPDFButtonVC.state != .Sel && self.createPDFButtonVC.canHover {
-                    self.createPDFButtonVC.state = .Hov
-                    self.createPDFButtonVC.updateUI()
-                    self.createPDFImage.state = .Hov
-                    self.createPDFImage.updateUI()
-                    self.createPDFImage.canHover = false
-                }
-            } else {
-                if self.createPDFButtonVC.state != .Sel && self.createPDFButtonVC.canHover {
-                    self.createPDFButtonVC.state = .Norm
-                    self.createPDFButtonVC.updateUI()
-                    self.createPDFImage.state = .Norm
-                    self.createPDFImage.updateUI()
-                    self.createPDFImage.canHover = true
-                }
-            }
-        }
-        
-        createPDFView.contentView = createPDFImage.view
-        createPDFImage.image = NSImage(named: "icon_btn_arrow_gray_down_s_norm_false")!
-        createPDFImage.target = self
-        createPDFImage.action = #selector(self.homeToolAction(_:))
-        createPDFImage.button(type: .Icon_Fill, size: .m, height: createPDFViewHeight)
-
-        homeBox.fillColor = .clear
-        homeBox.contentView = homeButtonVC.view
-        homeButtonVC.target = self
-        homeButtonVC.action = #selector(self.homeToolAction(_:))
-        homeButtonVC.image = NSImage(named: "icon_home_sidebar_home_false")!
-        homeButtonVC.image_hover = NSImage(named: "icon_home_sidebar_home_false")!
-        homeButtonVC.image_click = NSImage(named: "icon_home_sidebar_home_true")!
-        homeButtonVC.navMenu(bg: "navmenu.has-icon.m.bg.norm", text: "navmenu.win-text.def", height: homeBoxHeight)
-        homeButtonVC.navMenu(bg: "navmenu.has-icon.m.bg.hov", text: "navmenu.win-text.def", state:.Hov)
-        homeButtonVC.navMenu(bg: "navmenu.has-icon.m.bg.sel", text: "navmenu.win-text.sel", state:.Sel)
-
-        pdfToolsBox.fillColor = .clear
-        pdfToolsBox.contentView = pdfToolsButtonVC.view
-        pdfToolsButtonVC.target = self
-        pdfToolsButtonVC.action = #selector(self.homeToolAction(_:))
-        pdfToolsButtonVC.image = NSImage(named: "icon_home_sidebar_tool_false")!
-        pdfToolsButtonVC.image_hover = NSImage(named: "icon_home_sidebar_tool_false")!
-        pdfToolsButtonVC.image_click = NSImage(named: "icon_home_sidebar_tool_true")!
-        pdfToolsButtonVC.navMenu(bg: "navmenu.has-icon.m.bg.norm", text: "navmenu.win-text.def", height: pdfToolsBoxHeight)
-        pdfToolsButtonVC.navMenu(bg: "navmenu.has-icon.m.bg.hov", text: "navmenu.win-text.def", state:.Hov)
-        pdfToolsButtonVC.navMenu(bg: "navmenu.has-icon.m.bg.sel", text: "navmenu.win-text.sel", state:.Sel)
-        
-        cloudDocumentsBox.fillColor = .clear
-        cloudDocumentsBox.contentView = cloudDocumentsButtonVC.view
-        cloudDocumentsButtonVC.target = self
-        cloudDocumentsButtonVC.action = #selector(self.homeToolAction(_:))
-        cloudDocumentsButtonVC.image = NSImage(named: "icon_home_sidebar_cloud_false")!
-        cloudDocumentsButtonVC.image_hover = NSImage(named: "icon_home_sidebar_cloud_false")!
-        cloudDocumentsButtonVC.image_click = NSImage(named: "icon_home_sidebar_cloud_true")!
-        cloudDocumentsButtonVC.navMenu(bg: "navmenu.has-icon.m.bg.norm", text: "navmenu.win-text.def", height: cloudDocumentsBoxHeight)
-        cloudDocumentsButtonVC.navMenu(bg: "navmenu.has-icon.m.bg.hov", text: "navmenu.win-text.def", state:.Hov)
-        cloudDocumentsButtonVC.navMenu(bg: "navmenu.has-icon.m.bg.sel", text: "navmenu.win-text.sel", state:.Sel)
-
-        pdfSeriesBox.fillColor = .clear
-        pdfSeriesBox.contentView = pdfSeriesButtonVC.view
-        pdfSeriesButtonVC.target = self
-        pdfSeriesButtonVC.action = #selector(self.productPromotionFoldOrUnfold(_:))
-        pdfSeriesButtonVC.type = .Right
-        pdfSeriesButtonVC.canHover = false
-        pdfSeriesButtonVC.imageWidth = 12.0
-        pdfSeriesButtonVC.imageHeight = 12.0
-        pdfSeriesButtonVC.image = NSImage(named: "icon_btn_expand_lv2_down_false")!
-        pdfSeriesButtonVC.navMenu(bg: "collapse.ad-list.bg", text: "collapse.ad-list.mac-text.norm", height: pdfSeriesBoxHeight)
-
-        pdfOthersBox.fillColor = .clear
-        pdfOthersBox.contentView = pdfOthersButtonVC.view
-        pdfOthersButtonVC.target = self
-        pdfOthersButtonVC.action = #selector(self.productPromotionFoldOrUnfold(_:))
-        pdfOthersButtonVC.type = .Right
-        pdfOthersButtonVC.canHover = false
-        pdfOthersButtonVC.imageWidth = 12.0
-        pdfOthersButtonVC.imageHeight = 12.0
-        pdfOthersButtonVC.image = NSImage(named: "icon_btn_expand_lv2_down_false")!
-        pdfOthersButtonVC.navMenu(bg: "collapse.ad-list.bg", text: "collapse.ad-list.mac-text.norm", height: othersBoxHeightConstraint)
+//        pdfToolsBox.fillColor = .clear
+//        pdfToolsBox.contentView = pdfToolsButtonVC.view
+//        pdfToolsButtonVC.target = self
+//        pdfToolsButtonVC.action = #selector(self.homeToolAction(_:))
+//        pdfToolsButtonVC.image = NSImage(named: "icon_home_sidebar_tool_false")!
+//        pdfToolsButtonVC.image_hover = NSImage(named: "icon_home_sidebar_tool_false")!
+//        pdfToolsButtonVC.image_click = NSImage(named: "icon_home_sidebar_tool_true")!
+//        pdfToolsButtonVC.navMenu(bg: "navmenu.has-icon.m.bg.norm", text: "navmenu.win-text.def", height: pdfToolsBoxHeight)
+//        pdfToolsButtonVC.navMenu(bg: "navmenu.has-icon.m.bg.hov", text: "navmenu.win-text.def", state:.Hov)
+//        pdfToolsButtonVC.navMenu(bg: "navmenu.has-icon.m.bg.sel", text: "navmenu.win-text.sel", state:.Sel)
+//        
+//        cloudDocumentsBox.fillColor = .clear
+//        cloudDocumentsBox.contentView = cloudDocumentsButtonVC.view
+//        cloudDocumentsButtonVC.target = self
+//        cloudDocumentsButtonVC.action = #selector(self.homeToolAction(_:))
+//        cloudDocumentsButtonVC.image = NSImage(named: "icon_home_sidebar_cloud_false")!
+//        cloudDocumentsButtonVC.image_hover = NSImage(named: "icon_home_sidebar_cloud_false")!
+//        cloudDocumentsButtonVC.image_click = NSImage(named: "icon_home_sidebar_cloud_true")!
+//        cloudDocumentsButtonVC.navMenu(bg: "navmenu.has-icon.m.bg.norm", text: "navmenu.win-text.def", height: cloudDocumentsBoxHeight)
+//        cloudDocumentsButtonVC.navMenu(bg: "navmenu.has-icon.m.bg.hov", text: "navmenu.win-text.def", state:.Hov)
+//        cloudDocumentsButtonVC.navMenu(bg: "navmenu.has-icon.m.bg.sel", text: "navmenu.win-text.sel", state:.Sel)
+//
+//        pdfSeriesBox.fillColor = .clear
+//        pdfSeriesBox.contentView = pdfSeriesButtonVC.view
+//        pdfSeriesButtonVC.target = self
+//        pdfSeriesButtonVC.action = #selector(self.productPromotionFoldOrUnfold(_:))
+//        pdfSeriesButtonVC.type = .Right
+//        pdfSeriesButtonVC.canHover = false
+//        pdfSeriesButtonVC.imageWidth = 12.0
+//        pdfSeriesButtonVC.imageHeight = 12.0
+//        pdfSeriesButtonVC.image = NSImage(named: "icon_btn_expand_lv2_down_false")!
+//        pdfSeriesButtonVC.navMenu(bg: "collapse.ad-list.bg", text: "collapse.ad-list.mac-text.norm", height: pdfSeriesBoxHeight)
+//
+//        pdfOthersBox.fillColor = .clear
+//        pdfOthersBox.contentView = pdfOthersButtonVC.view
+//        pdfOthersButtonVC.target = self
+//        pdfOthersButtonVC.action = #selector(self.productPromotionFoldOrUnfold(_:))
+//        pdfOthersButtonVC.type = .Right
+//        pdfOthersButtonVC.canHover = false
+//        pdfOthersButtonVC.imageWidth = 12.0
+//        pdfOthersButtonVC.imageHeight = 12.0
+//        pdfOthersButtonVC.image = NSImage(named: "icon_btn_expand_lv2_down_false")!
+//        pdfOthersButtonVC.navMenu(bg: "collapse.ad-list.bg", text: "collapse.ad-list.mac-text.norm", height: othersBoxHeightConstraint)
 
 //        if self.activitiesBox.isHidden {
 //            self.productPromotionShow(self.productPromotionPDFProSeries, withOthers: self.productPromotionOthers, isInitialize: true)
@@ -330,16 +245,16 @@ import KMAdvertisement
 //        }
         self.productPromotionShow(self.productPromotionPDFProSeries, withOthers: self.productPromotionOthers, isInitialize: true)
         
-        self.activitiesBox.contentView = KMProductPromotionViewController.init().view
-        activitiesBox.cornerRadius = 8.0
+//        self.activitiesBox.contentView = KMProductPromotionViewController.init().view
+//        activitiesBox.cornerRadius = 8.0
         
         rightTopBox.fillColor = .white
         rightBottomBox.fillColor = .white
         rightFullBox.fillColor = .white
         
-        productPromotionBox.fillColor = .clear
-        
-        product_active_scrollView.verticalScrollElasticity = .none
+//        productPromotionBox.fillColor = .clear
+//        
+//        product_active_scrollView.verticalScrollElasticity = .none
         
         self.refreshRightBoxUI(.Home)
         fastToolViewController.delete = self
@@ -349,15 +264,15 @@ import KMAdvertisement
     }
     
     func initLocalization() {
-        self.favoriteDocumentsLabel.stringValue = NSLocalizedString("Favorite Documents", comment: "")
+//        self.favoriteDocumentsLabel.stringValue = NSLocalizedString("Favorite Documents", comment: "")
         
         homeButtonVC.stringValue = NSLocalizedString("Home", comment: "")
         pdfToolsButtonVC.stringValue = NSLocalizedString("PDF Tools", comment: "")
         cloudDocumentsButtonVC.stringValue = NSLocalizedString("Cloud Documents", comment: "")
         openPDFButtonVC.stringValue = NSLocalizedString("Open File", comment: "")
-        openPDFBox.toolTip = NSLocalizedString("Open PDF", comment: "")
+//        openPDFBox.toolTip = NSLocalizedString("Open PDF", comment: "")
         createPDFButtonVC.stringValue = NSLocalizedString("Create PDF", comment: "")
-        createPDFBox.toolTip = NSLocalizedString("Create PDF", comment: "")
+//        createPDFBox.toolTip = NSLocalizedString("Create PDF", comment: "")
         pdfSeriesButtonVC.stringValue = NSLocalizedString("PDF Pro Series", comment: "")
         pdfOthersButtonVC.stringValue = NSLocalizedString("Others", comment: "")
     }
@@ -604,13 +519,13 @@ import KMAdvertisement
     }
     
     func refreshProductActiveSpacing() -> Void {
-        let height = self.view.frame.height - 32.0 - openPDFBoxHeight.constant - 16.0 - createPDFBoxHeight.constant - 24.0 - pdfSeriesBoxHeight.constant - pdfProSeriesBoxHeightConstraint.constant - 8 - othersBoxHeightConstraint.constant - pdfOthersBoxHeightConstraint.constant - 242 - 30
-//        print("height == %f", height)
-        if height > 24.0 {
-            self.product_active_spacing.constant = height
-        } else {
-            self.product_active_spacing.constant = 24.0
-        }
+//        let height = self.view.frame.height - 32.0 - openPDFBoxHeight.constant - 16.0 - createPDFBoxHeight.constant - 24.0 - pdfSeriesBoxHeight.constant - pdfProSeriesBoxHeightConstraint.constant - 8 - othersBoxHeightConstraint.constant - pdfOthersBoxHeightConstraint.constant - 242 - 30
+////        print("height == %f", height)
+//        if height > 24.0 {
+//            self.product_active_spacing.constant = height
+//        } else {
+//            self.product_active_spacing.constant = 24.0
+//        }
     }
     
     func fetchDifferentFilePath(filePath: String) -> String {
@@ -702,28 +617,145 @@ import KMAdvertisement
             tWorkSpace.open(httpUrl as URL)
         }
     }
-    
-    func createPopoverAction(_ data: [String]) {
-        if (self.popover != nil && self.popover!.isShown) {
-            self.popover?.close()
-            self.popover = nil
-            return
+}
+
+//MARK: Open Creat PDF
+extension KMHomeViewController: NSPopoverDelegate {
+}
+
+extension KMHomeViewController {
+    func openPDFAction(_ sender: KMBox) {
+        let openPanel = NSOpenPanel()
+        openPanel.allowedFileTypes = ["pdf", "PDF"]
+        openPanel.allowsMultipleSelection = false
+        openPanel.beginSheetModal(for: self.view.window!) { (result) in
+            if result == NSApplication.ModalResponse.OK {
+                NSDocumentController.shared.openDocument(withContentsOf: openPanel.url!, display: true) { (document, documentWasAlreadyOpen, error) in
+                    if let error = error {
+                        NSApp.presentError(error)
+                    } else {
+                        self.view.window?.windowController?.close()
+                    }
+                }
+            }
         }
-        let vc: KMHomePopViewController = KMHomePopViewController().initWithPopViewDataArr(data)
+    }
+    
+    func creatPDFAction(_ sender: KMBox) {
+        let popViewDataArr: [String] = [NSLocalizedString("New Blank Page", comment: ""),
+                                        NSLocalizedString("New From Images", comment: ""),
+                                        NSLocalizedString("New From Web Page", comment: ""),
+                                        NSLocalizedString("Import From Camera", comment: ""),
+                                        NSLocalizedString("Import From Scanner", comment: "")]
+        let vc: KMHomePopViewController = KMHomePopViewController().initWithPopViewDataArr(popViewDataArr)
         let createFilePopover: NSPopover = NSPopover.init()
-        self.popover = createFilePopover
         createFilePopover.contentViewController = vc
+        createFilePopover.delegate = self
         createFilePopover.animates = true
         createFilePopover.behavior = .semitransient
         createFilePopover.setValue(true, forKey: "shouldHideAnchor")
-        createFilePopover.show(relativeTo: CGRect(x: createPDFBox.bounds.origin.x, y: 10, width: createPDFBox.bounds.size.width, height: createPDFBox.bounds.size.height), of: createPDFBox, preferredEdge: .minY)
+        createFilePopover.show(relativeTo: CGRect(x: sender.bounds.origin.x, y: 10, width: sender.bounds.size.width, height: sender.bounds.size.height), of: sender, preferredEdge: .minY)
         
-        vc.customBoxWidthLayoutConstraint.constant = createPDFBox.frame.width
-        vc.downCallback = { [weak self] (downEntered: Bool, count: String) -> Void in
-            if downEntered {
-                self?.popover?.close()
-                self?.popover = nil
-                self?.popoverItemAction(count)
+        vc.downCallback = { [unowned self] (downEntered: Bool, count: String) -> Void in
+            if count == NSLocalizedString("New Blank Page", comment: "") {
+                self.openBlankPage()
+            } else if count == NSLocalizedString("Import From Camera", comment: "") {
+                self.importFromCamera()
+            }  else if count == NSLocalizedString("Import From Scanner", comment: "") {
+                self.importFromScanner()
+            }  else if count == NSLocalizedString("New From Web Page", comment: "") {
+                self.importFromWebPage()
+            } else if count == NSLocalizedString("Import From Scanner", comment: "") {
+                self.newFromImages()
+            }
+            createFilePopover.close()
+        }
+    }
+    
+    func openBlankPage() {
+        let fileName: NSString = String(format: "%@.pdf", NSLocalizedString("Untitled", comment: "")) as NSString
+        let savePath = fetchUniquePath(fileName.kUrlToPDFFolderPath() as String)
+        let pdfDocument = CPDFDocument()
+        pdfDocument?.insertPage(CGSize(width: 595, height: 842), at: 0)
+        pdfDocument?.write(to: URL(fileURLWithPath: savePath))
+        NSDocumentController.shared.openDocument(withContentsOf: URL(fileURLWithPath: savePath), display: true) { document, documentWasAlreadyOpen, error in
+            if error != nil {
+                NSApp.presentError(error!)
+            } else {
+                if document is KMMainDocument {
+                    let newDocument = document
+                    (newDocument as! KMMainDocument).isNewCreated = true
+                }
+            }
+        }
+    }
+    
+    func importFromWebPage() {
+        self.urlToPDFWindowController = KMURLToPDFWindowController.init(windowNibName: NSNib.Name("KMURLToPDFWindowController"))
+        
+        self.urlToPDFWindowController?.beginSheetModalForWindow(NSApp.mainWindow!, completionHandler: { filePath in
+            if FileManager.default.fileExists(atPath: filePath) {
+                NSDocumentController.shared.openDocument(withContentsOf: URL(fileURLWithPath: filePath), display: true) { document, documentWasAlreadyOpen, error in
+                    if error != nil {
+                        NSApp.presentError(error!)
+                    } else {
+                        if document is KMMainDocument {
+                            (document as! KMMainDocument).isNewCreated = true
+                        }
+                    }
+                }
+            }
+        })
+    }
+    
+    func importFromScanner() {
+        let vc = KMDeviceBrowserWindowController.shared
+        vc.type = .scanner
+        vc.importScannerFileCallback = { [weak self](url: NSURL) -> Void in
+            self?.openFile(withFilePath: url as URL)
+        }
+        vc.showWindow(NSApp.mainWindow)
+    }
+    
+    func importFromCamera() {
+        let vc = KMDeviceBrowserWindowController.shared
+        vc.type = .camera
+        vc.importCameraFileCallback = { [weak self] (url: NSURL) -> Void in
+            self?.openFile(withFilePath: url as URL)
+        }
+        vc.showWindow(NSApp.mainWindow)
+    }
+    
+    func newFromImages() {
+        let openPanel = NSOpenPanel()
+        openPanel.allowedFileTypes = KMImageAccessoryController.supportedImageTypes()
+//        if IAPProductsManager.defaultManager().isAvailableAllFunction {
+//            openPanel.allowsMultipleSelection = true
+//        } else {
+//            openPanel.allowsMultipleSelection = false
+//        }
+        openPanel.message = NSLocalizedString("Select images to create a new document. To select multiple files press cmd ⌘ button on the keyboard and click on the target files one by one.", comment: "")
+        openPanel.beginSheetModal(for: NSApp.mainWindow!) { result in
+            if result == .OK {
+                DispatchQueue.main.asyncAfter(deadline: .now() + 0.25) {
+                    debugPrint("缺少图片转PDF")
+//                    let baseWindowController = KMBatchOperateBaseWindowController(windowNibName: "KMBatchOperateBaseWindowController")
+//                    var arr: [KMBatchOperateFile] = []
+//                    for url in openPanel.urls {
+//                        let file = KMBatchOperateFile(filePath: url.path, type: .createPDF)
+//                        arr.append(file)
+//                    }
+//                   
+//                    if #available(macOS 10.13, *) {
+//                        baseWindowController.window?.makeKeyAndOrderFront(nil)
+//                    } else {
+//                        baseWindowController.showWindow(nil)
+//                    }
+//                    baseWindowController.checkNeedPasswordSwitch(toOperateType: .createPDF, files: arr)
+//                    if #available(macOS 10.13, *) {
+//                        baseWindowController.release()
+//                    }
+                }
             }
         }
     }

+ 78 - 321
PDF Office/PDF Master/Class/Home/ViewController/KMHomeViewController.xib

@@ -1,14 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22146" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22155" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22146"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22155"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
         <customObject id="-2" userLabel="File's Owner" customClass="KMHomeViewController" customModule="PDF_Master" customModuleProvider="target">
             <connections>
-                <outlet property="activitiesBox" destination="MFa-T5-0wb" id="hkR-Nv-9aL"/>
+                <outlet property="advertisementShowView" destination="SYM-SV-gBY" id="BFm-b8-txu"/>
+                <outlet property="advertisementTableView" destination="fnz-k9-XjO" id="UbQ-y0-tnF"/>
+                <outlet property="advertisementTableViewHeightConstraint" destination="Tot-Bo-gOe" id="lbH-c8-hec"/>
                 <outlet property="aiErrorCorrectionBox" destination="gfM-nc-QPH" id="Hmh-sg-oXV"/>
                 <outlet property="aiErrorCorrectionImageView" destination="tWj-m1-RHC" id="Vih-4K-hKQ"/>
                 <outlet property="aiErrorCorrectionLabel" destination="aGT-3k-XaH" id="v9b-2n-Uue"/>
@@ -24,41 +26,15 @@
                 <outlet property="aiTranslationImageView" destination="R0l-VG-P9c" id="bS5-ho-ymi"/>
                 <outlet property="aiTranslationLabel" destination="p5N-bY-CVu" id="1QT-kv-3v4"/>
                 <outlet property="aiTranslationViewController" destination="vQI-sm-WpY" id="TS3-4x-ip4"/>
-                <outlet property="cloudDocumentsBox" destination="ntJ-b8-qxk" id="hNr-Vi-fYQ"/>
-                <outlet property="cloudDocumentsBoxHeight" destination="aCh-WL-S1o" id="Ly4-LY-8YM"/>
                 <outlet property="cloudDocumentsViewController" destination="icM-sk-XE7" id="b9t-ez-lLE"/>
-                <outlet property="createPDFBox" destination="OtM-0x-ayU" id="M8s-M6-JBU"/>
-                <outlet property="createPDFBoxHeight" destination="dGW-CI-1rZ" id="Hzs-Yv-0aK"/>
-                <outlet property="createPDFView" destination="Dbe-pI-QSy" id="zM8-ut-8Lw"/>
-                <outlet property="createPDFViewHeight" destination="7sf-xb-f7c" id="JuG-ik-kY7"/>
+                <outlet property="creatPDFView" destination="xMk-8H-B64" id="VFL-AK-nmd"/>
                 <outlet property="dragView" destination="3Ej-3j-QZ3" id="KI9-gS-ovH"/>
                 <outlet property="fastToolViewController" destination="O3f-x2-y6f" id="QUu-yY-afK"/>
-                <outlet property="favoriteDocumentsBox" destination="deA-td-u53" id="H5U-TM-gdP"/>
-                <outlet property="favoriteDocumentsImageView" destination="4co-jx-TpB" id="68M-ho-wX0"/>
-                <outlet property="favoriteDocumentsLabel" destination="7ZV-nI-jCF" id="axb-In-6AW"/>
                 <outlet property="historyFileViewController" destination="UcW-Sh-zFW" id="4rg-j2-0qB"/>
-                <outlet property="homeBox" destination="UKl-9H-uAO" id="9VZ-i7-XvE"/>
-                <outlet property="homeBoxHeight" destination="pzY-tk-NQO" id="zUP-by-VIf"/>
                 <outlet property="homeRightScrollViewView" destination="Fsd-Oz-v7c" id="AOG-NU-G8N"/>
                 <outlet property="homeSplitView" destination="yVp-SB-ljO" id="zSV-aW-5He"/>
                 <outlet property="leftBox" destination="ndG-c5-lCg" id="Gx0-kb-H6N"/>
-                <outlet property="openPDFBox" destination="IBc-Xn-ACX" id="rfa-yX-fM2"/>
-                <outlet property="openPDFBoxHeight" destination="mSn-iS-alV" id="UaX-Ju-Duw"/>
-                <outlet property="othersBox" destination="dvb-4g-gRa" id="Gm3-he-MwX"/>
-                <outlet property="othersBoxHeightConstraint" destination="OcR-4M-FWe" id="yX5-ZF-9T0"/>
-                <outlet property="pdfOthersBox" destination="c99-Fc-Xms" id="jRc-XY-ooZ"/>
-                <outlet property="pdfOthersBoxHeightConstraint" destination="kVJ-Vz-KsD" id="T0P-4a-BKt"/>
-                <outlet property="pdfProSeriesBox" destination="MnV-Ga-AMN" id="DKe-zP-XVL"/>
-                <outlet property="pdfProSeriesBoxHeightConstraint" destination="LAV-r3-x1g" id="TrS-Y4-gbQ"/>
-                <outlet property="pdfSeriesBox" destination="3fs-f7-jLw" id="bi1-U6-ad7"/>
-                <outlet property="pdfSeriesBoxHeight" destination="Lgb-0O-OC4" id="h4Y-hG-cYh"/>
-                <outlet property="pdfToolsBox" destination="20T-xp-Q2e" id="HkX-S5-4Hk"/>
-                <outlet property="pdfToolsBoxHeight" destination="ove-lb-j0e" id="OEe-Qi-xrd"/>
                 <outlet property="pdfToolsViewController" destination="cEr-ez-OtI" id="ZeS-9W-X1R"/>
-                <outlet property="productPromotionBox" destination="iRu-hZ-Eba" id="fSz-H5-uu0"/>
-                <outlet property="product_active_box" destination="TRt-mD-49a" id="sGu-TA-tH7"/>
-                <outlet property="product_active_scrollView" destination="Zv8-o9-nPx" id="zS7-N2-btc"/>
-                <outlet property="product_active_spacing" destination="Oxs-0g-w3P" id="VMf-lR-Qvd"/>
                 <outlet property="rightBottomBox" destination="UYd-oU-m2C" id="XYW-TM-vpq"/>
                 <outlet property="rightBottonHeight" destination="Rdc-5S-WLs" id="hLv-Q8-gGe"/>
                 <outlet property="rightBox" destination="47d-27-CfS" id="m44-Ey-vUw"/>
@@ -74,6 +50,39 @@
             <rect key="frame" x="0.0" y="0.0" width="1074" height="820"/>
             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
             <subviews>
+                <customView translatesAutoresizingMaskIntoConstraints="NO" id="3Ej-3j-QZ3" customClass="KMHomeDragView" customModule="PDF_Master" customModuleProvider="target">
+                    <rect key="frame" x="16" y="16" width="1042" height="788"/>
+                    <subviews>
+                        <customView translatesAutoresizingMaskIntoConstraints="NO" id="lTX-FO-7Ze">
+                            <rect key="frame" x="489" y="374" width="65" height="40"/>
+                            <subviews>
+                                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Hn2-R8-Bfv">
+                                    <rect key="frame" x="14" y="12" width="37" height="16"/>
+                                    <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="gkz-Hj-UOJ">
+                                        <font key="font" metaFont="system"/>
+                                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                    </textFieldCell>
+                                </textField>
+                            </subviews>
+                            <constraints>
+                                <constraint firstItem="Hn2-R8-Bfv" firstAttribute="centerY" secondItem="lTX-FO-7Ze" secondAttribute="centerY" id="0mX-xj-ymp"/>
+                                <constraint firstAttribute="trailing" secondItem="Hn2-R8-Bfv" secondAttribute="trailing" constant="16" id="8ZE-Sq-o1b"/>
+                                <constraint firstItem="Hn2-R8-Bfv" firstAttribute="leading" secondItem="lTX-FO-7Ze" secondAttribute="leading" constant="16" id="VWe-FK-0wL"/>
+                                <constraint firstAttribute="height" constant="40" id="tbq-SH-11p"/>
+                            </constraints>
+                        </customView>
+                    </subviews>
+                    <constraints>
+                        <constraint firstItem="lTX-FO-7Ze" firstAttribute="centerY" secondItem="3Ej-3j-QZ3" secondAttribute="centerY" id="VsN-Nk-XSF"/>
+                        <constraint firstItem="lTX-FO-7Ze" firstAttribute="centerX" secondItem="3Ej-3j-QZ3" secondAttribute="centerX" id="Z88-ci-g4b"/>
+                    </constraints>
+                    <connections>
+                        <outlet property="dragLabel" destination="Hn2-R8-Bfv" id="Bcu-KC-jTb"/>
+                        <outlet property="dragView" destination="lTX-FO-7Ze" id="l8P-gG-51q"/>
+                        <outlet property="dragViewHeight" destination="tbq-SH-11p" id="rKn-sf-EOE"/>
+                    </connections>
+                </customView>
                 <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="1v2-87-qa4">
                     <rect key="frame" x="537" y="410" width="0.0" height="0.0"/>
                     <buttonCell key="cell" type="square" title="Button" bezelStyle="shadowlessSquare" alignment="center" imageScaling="proportionallyDown" inset="2" id="Qq0-z1-7iI">
@@ -101,237 +110,7 @@ Gw
                                 <rect key="frame" x="0.0" y="0.0" width="270" height="820"/>
                                 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                 <subviews>
-                                    <box hidden="YES" boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="IBc-Xn-ACX">
-                                        <rect key="frame" x="32" y="740" width="206" height="48"/>
-                                        <view key="contentView" id="FXX-vK-R1B">
-                                            <rect key="frame" x="0.0" y="0.0" width="206" height="48"/>
-                                            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                        </view>
-                                        <constraints>
-                                            <constraint firstAttribute="height" constant="48" id="mSn-iS-alV"/>
-                                        </constraints>
-                                        <color key="fillColor" red="0.10196078431372549" green="0.10196078431372549" blue="0.10196078431372549" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-                                    </box>
-                                    <box hidden="YES" boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="OtM-0x-ayU">
-                                        <rect key="frame" x="32" y="676" width="206" height="48"/>
-                                        <view key="contentView" id="yiR-qy-ftP">
-                                            <rect key="frame" x="0.0" y="0.0" width="206" height="48"/>
-                                            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                        </view>
-                                        <constraints>
-                                            <constraint firstAttribute="height" constant="48" id="dGW-CI-1rZ"/>
-                                        </constraints>
-                                    </box>
-                                    <box hidden="YES" boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="Dbe-pI-QSy">
-                                        <rect key="frame" x="208" y="684" width="26" height="32"/>
-                                        <view key="contentView" id="BDS-se-7ty">
-                                            <rect key="frame" x="0.0" y="0.0" width="26" height="32"/>
-                                            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                        </view>
-                                        <constraints>
-                                            <constraint firstAttribute="height" constant="32" id="7sf-xb-f7c"/>
-                                            <constraint firstAttribute="width" constant="26" id="q8x-LK-dCe"/>
-                                        </constraints>
-                                    </box>
-                                    <box hidden="YES" boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="UKl-9H-uAO">
-                                        <rect key="frame" x="16" y="748" width="238" height="36"/>
-                                        <view key="contentView" id="Ttc-MZ-4Or">
-                                            <rect key="frame" x="0.0" y="0.0" width="238" height="36"/>
-                                            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                        </view>
-                                        <constraints>
-                                            <constraint firstAttribute="height" constant="36" id="pzY-tk-NQO"/>
-                                        </constraints>
-                                        <color key="fillColor" name="systemRedColor" catalog="System" colorSpace="catalog"/>
-                                    </box>
-                                    <box hidden="YES" boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="20T-xp-Q2e">
-                                        <rect key="frame" x="16" y="712" width="238" height="36"/>
-                                        <view key="contentView" id="CG6-fH-O7c">
-                                            <rect key="frame" x="0.0" y="0.0" width="238" height="36"/>
-                                            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                        </view>
-                                        <constraints>
-                                            <constraint firstAttribute="height" constant="36" id="ove-lb-j0e"/>
-                                        </constraints>
-                                        <color key="fillColor" name="systemRedColor" catalog="System" colorSpace="catalog"/>
-                                    </box>
-                                    <box hidden="YES" boxType="custom" borderWidth="0.0" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="deA-td-u53" customClass="KMBox" customModule="PDF_Master" customModuleProvider="target">
-                                        <rect key="frame" x="16" y="676" width="238" height="36"/>
-                                        <view key="contentView" id="RnK-oF-lcb">
-                                            <rect key="frame" x="0.0" y="0.0" width="238" height="36"/>
-                                            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                            <subviews>
-                                                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="7ZV-nI-jCF">
-                                                    <rect key="frame" x="10" y="9" width="150" height="19"/>
-                                                    <textFieldCell key="cell" lineBreakMode="clipping" title="Favorite Documents" id="QBs-vh-T79">
-                                                        <font key="font" metaFont="system" size="16"/>
-                                                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                                    </textFieldCell>
-                                                </textField>
-                                                <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="4co-jx-TpB">
-                                                    <rect key="frame" x="202" y="2" width="24" height="32"/>
-                                                    <constraints>
-                                                        <constraint firstAttribute="height" constant="24" id="ljf-Ia-Nyn"/>
-                                                        <constraint firstAttribute="width" constant="24" id="osy-b4-ius"/>
-                                                    </constraints>
-                                                    <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="NSTouchBarGoForwardTemplate" id="nK1-3C-IH9"/>
-                                                </imageView>
-                                            </subviews>
-                                            <constraints>
-                                                <constraint firstAttribute="trailing" secondItem="4co-jx-TpB" secondAttribute="trailing" constant="12" id="0f6-sB-9Gn"/>
-                                                <constraint firstItem="4co-jx-TpB" firstAttribute="centerY" secondItem="RnK-oF-lcb" secondAttribute="centerY" id="61M-Xp-1ef"/>
-                                                <constraint firstItem="7ZV-nI-jCF" firstAttribute="centerY" secondItem="RnK-oF-lcb" secondAttribute="centerY" id="Cw5-W3-LUw"/>
-                                                <constraint firstItem="7ZV-nI-jCF" firstAttribute="leading" secondItem="RnK-oF-lcb" secondAttribute="leading" constant="12" id="zx3-Rf-ka9"/>
-                                            </constraints>
-                                        </view>
-                                        <constraints>
-                                            <constraint firstAttribute="height" constant="36" id="CV3-EJ-XiW"/>
-                                        </constraints>
-                                    </box>
-                                    <box hidden="YES" boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="ntJ-b8-qxk">
-                                        <rect key="frame" x="16" y="676" width="238" height="36"/>
-                                        <view key="contentView" id="Odf-Mm-bKy">
-                                            <rect key="frame" x="0.0" y="0.0" width="238" height="36"/>
-                                            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                        </view>
-                                        <constraints>
-                                            <constraint firstAttribute="height" constant="36" id="aCh-WL-S1o"/>
-                                        </constraints>
-                                        <color key="fillColor" name="systemRedColor" catalog="System" colorSpace="catalog"/>
-                                    </box>
-                                    <box hidden="YES" boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="TRt-mD-49a">
-                                        <rect key="frame" x="0.0" y="0.0" width="270" height="652"/>
-                                        <view key="contentView" id="gKL-oe-inN">
-                                            <rect key="frame" x="0.0" y="0.0" width="270" height="652"/>
-                                            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                            <subviews>
-                                                <scrollView borderType="none" autohidesScrollers="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Zv8-o9-nPx">
-                                                    <rect key="frame" x="0.0" y="0.0" width="270" height="652"/>
-                                                    <clipView key="contentView" drawsBackground="NO" id="0m5-Ti-Llk">
-                                                        <rect key="frame" x="0.0" y="0.0" width="255" height="652"/>
-                                                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                                        <subviews>
-                                                            <view translatesAutoresizingMaskIntoConstraints="NO" id="TNl-3V-JVe">
-                                                                <rect key="frame" x="0.0" y="-9" width="255" height="661"/>
-                                                                <subviews>
-                                                                    <box boxType="custom" borderWidth="0.0" cornerRadius="8" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="iRu-hZ-Eba" customClass="KMBox" customModule="PDF_Master" customModuleProvider="target">
-                                                                        <rect key="frame" x="16" y="549" width="238" height="112"/>
-                                                                        <view key="contentView" id="Szn-qw-Fab">
-                                                                            <rect key="frame" x="0.0" y="0.0" width="238" height="112"/>
-                                                                            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                                                            <subviews>
-                                                                                <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="3fs-f7-jLw">
-                                                                                    <rect key="frame" x="0.0" y="80" width="238" height="32"/>
-                                                                                    <view key="contentView" id="Pht-vQ-L6e">
-                                                                                        <rect key="frame" x="0.0" y="0.0" width="238" height="32"/>
-                                                                                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                                                                    </view>
-                                                                                    <constraints>
-                                                                                        <constraint firstAttribute="height" constant="32" id="Lgb-0O-OC4"/>
-                                                                                    </constraints>
-                                                                                    <color key="fillColor" name="systemRedColor" catalog="System" colorSpace="catalog"/>
-                                                                                </box>
-                                                                                <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="MnV-Ga-AMN">
-                                                                                    <rect key="frame" x="0.0" y="60" width="238" height="20"/>
-                                                                                    <view key="contentView" id="kBq-4H-y0e">
-                                                                                        <rect key="frame" x="0.0" y="0.0" width="238" height="20"/>
-                                                                                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                                                                    </view>
-                                                                                    <constraints>
-                                                                                        <constraint firstAttribute="height" constant="20" id="LAV-r3-x1g"/>
-                                                                                    </constraints>
-                                                                                </box>
-                                                                                <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="c99-Fc-Xms">
-                                                                                    <rect key="frame" x="0.0" y="20" width="238" height="32"/>
-                                                                                    <view key="contentView" id="66O-AN-y7M">
-                                                                                        <rect key="frame" x="0.0" y="0.0" width="238" height="32"/>
-                                                                                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                                                                    </view>
-                                                                                    <constraints>
-                                                                                        <constraint firstAttribute="height" constant="32" id="kVJ-Vz-KsD"/>
-                                                                                    </constraints>
-                                                                                    <color key="fillColor" name="systemRedColor" catalog="System" colorSpace="catalog"/>
-                                                                                </box>
-                                                                                <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="dvb-4g-gRa">
-                                                                                    <rect key="frame" x="0.0" y="0.0" width="238" height="20"/>
-                                                                                    <view key="contentView" id="Sv3-Bf-g3Z">
-                                                                                        <rect key="frame" x="0.0" y="0.0" width="238" height="20"/>
-                                                                                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                                                                    </view>
-                                                                                    <constraints>
-                                                                                        <constraint firstAttribute="height" constant="20" id="OcR-4M-FWe"/>
-                                                                                    </constraints>
-                                                                                </box>
-                                                                            </subviews>
-                                                                            <constraints>
-                                                                                <constraint firstAttribute="bottom" secondItem="dvb-4g-gRa" secondAttribute="bottom" id="1l1-bA-wZf"/>
-                                                                                <constraint firstItem="MnV-Ga-AMN" firstAttribute="leading" secondItem="Szn-qw-Fab" secondAttribute="leading" id="ABQ-DA-ty9"/>
-                                                                                <constraint firstItem="dvb-4g-gRa" firstAttribute="leading" secondItem="Szn-qw-Fab" secondAttribute="leading" id="GgO-vB-P6G"/>
-                                                                                <constraint firstItem="dvb-4g-gRa" firstAttribute="top" secondItem="c99-Fc-Xms" secondAttribute="bottom" id="I8y-B6-bwh"/>
-                                                                                <constraint firstAttribute="trailing" secondItem="MnV-Ga-AMN" secondAttribute="trailing" id="SQf-5S-Q3Z"/>
-                                                                                <constraint firstItem="3fs-f7-jLw" firstAttribute="leading" secondItem="Szn-qw-Fab" secondAttribute="leading" id="Twx-QY-R83"/>
-                                                                                <constraint firstAttribute="trailing" secondItem="3fs-f7-jLw" secondAttribute="trailing" id="Wag-MM-Los"/>
-                                                                                <constraint firstItem="MnV-Ga-AMN" firstAttribute="top" secondItem="3fs-f7-jLw" secondAttribute="bottom" id="aRK-T9-DOq"/>
-                                                                                <constraint firstAttribute="trailing" secondItem="c99-Fc-Xms" secondAttribute="trailing" id="fkI-WB-r6L"/>
-                                                                                <constraint firstItem="c99-Fc-Xms" firstAttribute="leading" secondItem="Szn-qw-Fab" secondAttribute="leading" id="iYE-w9-lnv"/>
-                                                                                <constraint firstItem="c99-Fc-Xms" firstAttribute="top" secondItem="MnV-Ga-AMN" secondAttribute="bottom" constant="8" id="kHW-YE-fRr"/>
-                                                                                <constraint firstItem="3fs-f7-jLw" firstAttribute="top" secondItem="Szn-qw-Fab" secondAttribute="top" id="v1T-nw-EIf"/>
-                                                                                <constraint firstAttribute="trailing" secondItem="dvb-4g-gRa" secondAttribute="trailing" id="ycp-YP-93a"/>
-                                                                            </constraints>
-                                                                        </view>
-                                                                        <color key="fillColor" red="0.92156862745098034" green="0.92156862745098034" blue="0.92156862745098034" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-                                                                    </box>
-                                                                    <box boxType="custom" borderWidth="0.0" cornerRadius="8" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="MFa-T5-0wb" customClass="KMBox" customModule="PDF_Master" customModuleProvider="target">
-                                                                        <rect key="frame" x="32" y="30" width="206" height="242"/>
-                                                                        <view key="contentView" id="zIt-55-NjD">
-                                                                            <rect key="frame" x="0.0" y="0.0" width="206" height="242"/>
-                                                                            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                                                        </view>
-                                                                        <constraints>
-                                                                            <constraint firstAttribute="height" constant="242" id="ZYy-6w-xC5"/>
-                                                                        </constraints>
-                                                                        <color key="fillColor" red="0.92156862745098034" green="0.92156862745098034" blue="0.92156862745098034" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
-                                                                    </box>
-                                                                </subviews>
-                                                                <constraints>
-                                                                    <constraint firstAttribute="trailing" secondItem="iRu-hZ-Eba" secondAttribute="trailing" constant="1" id="DmO-aO-r6d"/>
-                                                                    <constraint firstAttribute="trailing" secondItem="MFa-T5-0wb" secondAttribute="trailing" constant="17" id="JVQ-b8-Vyc"/>
-                                                                    <constraint firstAttribute="bottom" secondItem="MFa-T5-0wb" secondAttribute="bottom" constant="30" id="LDy-Il-wNN"/>
-                                                                    <constraint firstItem="MFa-T5-0wb" firstAttribute="top" secondItem="iRu-hZ-Eba" secondAttribute="bottom" constant="277" id="Oxs-0g-w3P"/>
-                                                                    <constraint firstItem="MFa-T5-0wb" firstAttribute="leading" secondItem="TNl-3V-JVe" secondAttribute="leading" constant="32" id="giJ-wd-6vr"/>
-                                                                    <constraint firstItem="iRu-hZ-Eba" firstAttribute="leading" secondItem="TNl-3V-JVe" secondAttribute="leading" constant="16" id="hEc-lV-y6H"/>
-                                                                    <constraint firstItem="iRu-hZ-Eba" firstAttribute="top" secondItem="TNl-3V-JVe" secondAttribute="top" id="w4i-fZ-XXL"/>
-                                                                </constraints>
-                                                            </view>
-                                                        </subviews>
-                                                        <constraints>
-                                                            <constraint firstItem="TNl-3V-JVe" firstAttribute="top" secondItem="0m5-Ti-Llk" secondAttribute="top" id="5Ns-VC-Meg"/>
-                                                            <constraint firstAttribute="trailing" secondItem="TNl-3V-JVe" secondAttribute="trailing" id="7es-z8-SXZ"/>
-                                                            <constraint firstItem="TNl-3V-JVe" firstAttribute="leading" secondItem="0m5-Ti-Llk" secondAttribute="leading" id="jg3-iW-Reh"/>
-                                                        </constraints>
-                                                    </clipView>
-                                                    <scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="bah-bU-PmL">
-                                                        <rect key="frame" x="-100" y="-100" width="253" height="15"/>
-                                                        <autoresizingMask key="autoresizingMask"/>
-                                                    </scroller>
-                                                    <scroller key="verticalScroller" wantsLayer="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="eMA-3D-xnv" customClass="KMToolSetScroller" customModule="PDF_Master" customModuleProvider="target">
-                                                        <rect key="frame" x="255" y="0.0" width="15" height="652"/>
-                                                        <autoresizingMask key="autoresizingMask"/>
-                                                    </scroller>
-                                                </scrollView>
-                                            </subviews>
-                                            <constraints>
-                                                <constraint firstAttribute="bottom" secondItem="Zv8-o9-nPx" secondAttribute="bottom" id="8hJ-2A-rT1"/>
-                                                <constraint firstItem="Zv8-o9-nPx" firstAttribute="leading" secondItem="gKL-oe-inN" secondAttribute="leading" id="DcZ-5N-lti"/>
-                                                <constraint firstItem="Zv8-o9-nPx" firstAttribute="top" secondItem="gKL-oe-inN" secondAttribute="top" id="I8h-67-2lp"/>
-                                                <constraint firstAttribute="trailing" secondItem="Zv8-o9-nPx" secondAttribute="trailing" id="Meq-KO-B8A"/>
-                                            </constraints>
-                                        </view>
-                                        <color key="borderColor" red="1" green="0.99843658089999998" blue="0.99619259260000004" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
-                                        <color key="fillColor" red="1" green="0.99843658089999998" blue="0.99619259260000004" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
-                                    </box>
-                                    <customView translatesAutoresizingMaskIntoConstraints="NO" id="3io-Hj-Kiz">
+                                    <customView hidden="YES" translatesAutoresizingMaskIntoConstraints="NO" id="3io-Hj-Kiz">
                                         <rect key="frame" x="0.0" y="0.0" width="270" height="820"/>
                                         <subviews>
                                             <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="fGu-QI-qsr" customClass="KMBox" customModule="PDF_Master" customModuleProvider="target">
@@ -490,36 +269,50 @@ Gw
                                             <constraint firstItem="gfM-nc-QPH" firstAttribute="top" secondItem="0aC-uQ-5lW" secondAttribute="bottom" constant="8" id="m9w-w0-Rb8"/>
                                         </constraints>
                                     </customView>
+                                    <customView translatesAutoresizingMaskIntoConstraints="NO" id="eZs-02-dfp">
+                                        <rect key="frame" x="16" y="0.0" width="238" height="652"/>
+                                        <subviews>
+                                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="fnz-k9-XjO" customClass="KMAdvertisementTableView" customModule="PDF_Master" customModuleProvider="target">
+                                                <rect key="frame" x="0.0" y="152" width="238" height="500"/>
+                                                <constraints>
+                                                    <constraint firstAttribute="height" constant="500" id="Tot-Bo-gOe"/>
+                                                </constraints>
+                                            </customView>
+                                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="SYM-SV-gBY" customClass="KMAdvertisementShowView" customModule="PDF_Master" customModuleProvider="target">
+                                                <rect key="frame" x="0.0" y="16" width="238" height="120"/>
+                                                <constraints>
+                                                    <constraint firstAttribute="height" constant="120" id="zaj-sz-Tdy"/>
+                                                </constraints>
+                                            </customView>
+                                        </subviews>
+                                        <constraints>
+                                            <constraint firstItem="fnz-k9-XjO" firstAttribute="leading" secondItem="eZs-02-dfp" secondAttribute="leading" id="9nx-Kn-ay8"/>
+                                            <constraint firstAttribute="trailing" secondItem="fnz-k9-XjO" secondAttribute="trailing" id="Ea6-4t-JOh"/>
+                                            <constraint firstItem="SYM-SV-gBY" firstAttribute="leading" secondItem="eZs-02-dfp" secondAttribute="leading" id="I02-eo-zxb"/>
+                                            <constraint firstItem="fnz-k9-XjO" firstAttribute="top" secondItem="eZs-02-dfp" secondAttribute="top" id="SNd-w5-4mI"/>
+                                            <constraint firstItem="SYM-SV-gBY" firstAttribute="top" secondItem="fnz-k9-XjO" secondAttribute="bottom" constant="16" id="k1P-NP-gcR"/>
+                                            <constraint firstAttribute="trailing" secondItem="SYM-SV-gBY" secondAttribute="trailing" id="qLr-RD-68z"/>
+                                        </constraints>
+                                    </customView>
+                                    <customView translatesAutoresizingMaskIntoConstraints="NO" id="xMk-8H-B64" customClass="KMCreatPDFView" customModule="PDF_Master" customModuleProvider="target">
+                                        <rect key="frame" x="16" y="668" width="238" height="112"/>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="112" id="b2w-2J-Q98"/>
+                                        </constraints>
+                                    </customView>
                                 </subviews>
                                 <constraints>
-                                    <constraint firstItem="20T-xp-Q2e" firstAttribute="top" secondItem="UKl-9H-uAO" secondAttribute="bottom" id="6Ty-9p-ozz"/>
+                                    <constraint firstAttribute="trailing" secondItem="xMk-8H-B64" secondAttribute="trailing" constant="16" id="0Y5-Y0-JAP"/>
                                     <constraint firstAttribute="bottom" secondItem="3io-Hj-Kiz" secondAttribute="bottom" id="8hH-Nz-14P"/>
-                                    <constraint firstItem="ntJ-b8-qxk" firstAttribute="leading" secondItem="2gJ-MM-ZrB" secondAttribute="leading" constant="16" id="9G7-II-reM"/>
-                                    <constraint firstAttribute="trailing" secondItem="IBc-Xn-ACX" secondAttribute="trailing" constant="32" id="9bt-6N-Fpw"/>
-                                    <constraint firstAttribute="trailing" secondItem="20T-xp-Q2e" secondAttribute="trailing" constant="16" id="9h5-eC-BcV"/>
-                                    <constraint firstAttribute="bottom" secondItem="TRt-mD-49a" secondAttribute="bottom" id="LHh-fM-nsg"/>
-                                    <constraint firstItem="IBc-Xn-ACX" firstAttribute="top" secondItem="2gJ-MM-ZrB" secondAttribute="top" constant="32" id="OT0-pO-LgG"/>
+                                    <constraint firstItem="xMk-8H-B64" firstAttribute="top" secondItem="2gJ-MM-ZrB" secondAttribute="top" constant="40" id="BmM-pK-ELG"/>
+                                    <constraint firstItem="eZs-02-dfp" firstAttribute="top" secondItem="xMk-8H-B64" secondAttribute="bottom" constant="16" id="BoC-48-m5e"/>
                                     <constraint firstItem="3io-Hj-Kiz" firstAttribute="top" secondItem="2gJ-MM-ZrB" secondAttribute="top" id="OUk-vQ-edJ"/>
-                                    <constraint firstItem="IBc-Xn-ACX" firstAttribute="leading" secondItem="2gJ-MM-ZrB" secondAttribute="leading" constant="32" id="Pct-00-aes"/>
-                                    <constraint firstItem="Dbe-pI-QSy" firstAttribute="centerY" secondItem="OtM-0x-ayU" secondAttribute="centerY" id="Prm-NR-YvO"/>
-                                    <constraint firstItem="deA-td-u53" firstAttribute="top" secondItem="20T-xp-Q2e" secondAttribute="bottom" id="QfX-k5-vsv"/>
-                                    <constraint firstItem="Dbe-pI-QSy" firstAttribute="trailing" secondItem="OtM-0x-ayU" secondAttribute="trailing" constant="-4" id="T0b-Ta-Co1"/>
-                                    <constraint firstAttribute="trailing" secondItem="UKl-9H-uAO" secondAttribute="trailing" constant="16" id="WIR-G0-whr"/>
-                                    <constraint firstItem="TRt-mD-49a" firstAttribute="top" secondItem="deA-td-u53" secondAttribute="bottom" constant="24" id="dB5-BE-n63"/>
-                                    <constraint firstItem="OtM-0x-ayU" firstAttribute="top" secondItem="IBc-Xn-ACX" secondAttribute="bottom" constant="16" id="dJR-pr-FoO"/>
-                                    <constraint firstAttribute="trailing" secondItem="ntJ-b8-qxk" secondAttribute="trailing" constant="16" id="e8Q-or-Xvd"/>
                                     <constraint firstItem="3io-Hj-Kiz" firstAttribute="leading" secondItem="2gJ-MM-ZrB" secondAttribute="leading" id="eTW-ob-qK1"/>
-                                    <constraint firstItem="20T-xp-Q2e" firstAttribute="leading" secondItem="2gJ-MM-ZrB" secondAttribute="leading" constant="16" id="gtH-3g-pwb"/>
-                                    <constraint firstItem="deA-td-u53" firstAttribute="leading" secondItem="2gJ-MM-ZrB" secondAttribute="leading" constant="16" id="hLP-Mo-nJv"/>
-                                    <constraint firstItem="OtM-0x-ayU" firstAttribute="leading" secondItem="2gJ-MM-ZrB" secondAttribute="leading" constant="32" id="iC5-mp-yL7"/>
-                                    <constraint firstItem="TRt-mD-49a" firstAttribute="leading" secondItem="2gJ-MM-ZrB" secondAttribute="leading" id="iq0-o7-PiX"/>
-                                    <constraint firstAttribute="trailing" secondItem="TRt-mD-49a" secondAttribute="trailing" id="j9O-4p-xXv"/>
+                                    <constraint firstAttribute="bottom" secondItem="eZs-02-dfp" secondAttribute="bottom" id="hKB-Xy-3r7"/>
                                     <constraint firstAttribute="trailing" secondItem="3io-Hj-Kiz" secondAttribute="trailing" id="kZa-Sb-BLN"/>
-                                    <constraint firstItem="UKl-9H-uAO" firstAttribute="top" secondItem="OtM-0x-ayU" secondAttribute="bottom" constant="-108" id="o8v-Wg-KIZ"/>
-                                    <constraint firstAttribute="trailing" secondItem="deA-td-u53" secondAttribute="trailing" constant="16" id="qjB-C0-vh0"/>
-                                    <constraint firstAttribute="trailing" secondItem="OtM-0x-ayU" secondAttribute="trailing" constant="32" id="rZt-Tb-kjn"/>
-                                    <constraint firstItem="ntJ-b8-qxk" firstAttribute="top" secondItem="20T-xp-Q2e" secondAttribute="bottom" id="uKT-Vu-fQx"/>
-                                    <constraint firstItem="UKl-9H-uAO" firstAttribute="leading" secondItem="2gJ-MM-ZrB" secondAttribute="leading" constant="16" id="vXl-kK-q9y"/>
+                                    <constraint firstItem="xMk-8H-B64" firstAttribute="leading" secondItem="2gJ-MM-ZrB" secondAttribute="leading" constant="16" id="llZ-cI-Lb3"/>
+                                    <constraint firstAttribute="trailing" secondItem="eZs-02-dfp" secondAttribute="trailing" constant="16" id="pwm-0C-e6W"/>
+                                    <constraint firstItem="eZs-02-dfp" firstAttribute="leading" secondItem="2gJ-MM-ZrB" secondAttribute="leading" constant="16" id="s35-fX-Hao"/>
                                 </constraints>
                             </view>
                         </box>
@@ -614,39 +407,6 @@ Gw
                         <outlet property="delegate" destination="-2" id="Nyn-SM-8if"/>
                     </connections>
                 </splitView>
-                <customView translatesAutoresizingMaskIntoConstraints="NO" id="3Ej-3j-QZ3" customClass="KMHomeDragView" customModule="PDF_Master" customModuleProvider="target">
-                    <rect key="frame" x="16" y="16" width="1042" height="788"/>
-                    <subviews>
-                        <customView translatesAutoresizingMaskIntoConstraints="NO" id="lTX-FO-7Ze">
-                            <rect key="frame" x="489" y="374" width="65" height="40"/>
-                            <subviews>
-                                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Hn2-R8-Bfv">
-                                    <rect key="frame" x="14" y="12" width="37" height="16"/>
-                                    <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="gkz-Hj-UOJ">
-                                        <font key="font" metaFont="system"/>
-                                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                    </textFieldCell>
-                                </textField>
-                            </subviews>
-                            <constraints>
-                                <constraint firstItem="Hn2-R8-Bfv" firstAttribute="centerY" secondItem="lTX-FO-7Ze" secondAttribute="centerY" id="0mX-xj-ymp"/>
-                                <constraint firstAttribute="trailing" secondItem="Hn2-R8-Bfv" secondAttribute="trailing" constant="16" id="8ZE-Sq-o1b"/>
-                                <constraint firstItem="Hn2-R8-Bfv" firstAttribute="leading" secondItem="lTX-FO-7Ze" secondAttribute="leading" constant="16" id="VWe-FK-0wL"/>
-                                <constraint firstAttribute="height" constant="40" id="tbq-SH-11p"/>
-                            </constraints>
-                        </customView>
-                    </subviews>
-                    <constraints>
-                        <constraint firstItem="lTX-FO-7Ze" firstAttribute="centerY" secondItem="3Ej-3j-QZ3" secondAttribute="centerY" id="VsN-Nk-XSF"/>
-                        <constraint firstItem="lTX-FO-7Ze" firstAttribute="centerX" secondItem="3Ej-3j-QZ3" secondAttribute="centerX" id="Z88-ci-g4b"/>
-                    </constraints>
-                    <connections>
-                        <outlet property="dragLabel" destination="Hn2-R8-Bfv" id="Bcu-KC-jTb"/>
-                        <outlet property="dragView" destination="lTX-FO-7Ze" id="l8P-gG-51q"/>
-                        <outlet property="dragViewHeight" destination="tbq-SH-11p" id="rKn-sf-EOE"/>
-                    </connections>
-                </customView>
             </subviews>
             <constraints>
                 <constraint firstItem="3Ej-3j-QZ3" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="16" id="DZ1-ex-OuL"/>
@@ -670,7 +430,4 @@ Gw
         <customObject id="vQI-sm-WpY" customClass="KMAITranslationVC" customModule="PDF_Master" customModuleProvider="target"/>
         <customObject id="npC-Vy-evi" customClass="KMAIRewritingVC" customModule="PDF_Master" customModuleProvider="target"/>
     </objects>
-    <resources>
-        <image name="NSTouchBarGoForwardTemplate" width="12" height="17"/>
-    </resources>
 </document>

+ 25 - 26
PDF Office/PDF Master/Class/Home/WindowController/KMDeviceBrowserWindowController.swift

@@ -35,11 +35,18 @@ class KMDeviceBrowserWindowController: NSWindowController {
     
     override func windowDidLoad() {
         super.windowDidLoad()
+
+        if (self.type == .camera) {
+            self.deviceBrowserView.displaysLocalScanners = false;
+            self.deviceBrowserView.displaysNetworkScanners = false;
+        } else if (self.type == .scanner) {
+            self.deviceBrowserView.displaysLocalCameras = false;
+            self.deviceBrowserView.displaysNetworkCameras = false;
+        }
         
-        self.deviceBrowserView.displaysLocalCameras = false
-        self.deviceBrowserView.displaysNetworkCameras = false
-        
-        self.splitView.setPosition(300.0, ofDividerAt: 0)
+        self.cameraDeviceView.downloadSelectedControlLabel = NSLocalizedString("Import", comment: "")
+        self.cameraDeviceView.downloadAllControlLabel = NSLocalizedString("Import All", comment: "")
+        self.window!.title = NSLocalizedString("Import", comment: "")
     }
     
 }
@@ -56,22 +63,17 @@ extension KMDeviceBrowserWindowController: NSSplitViewDelegate {
 
 extension KMDeviceBrowserWindowController: IKDeviceBrowserViewDelegate {
     func deviceBrowserView(_ deviceBrowserView: IKDeviceBrowserView!, selectionDidChange device: ICDevice!) {
-//        if (device.type == .camera) {
-//            cameraDeviceView.cameraDevice = (device as! ICCameraDevice)
-//            cameraDeviceView.isHidden = false
-//            cameraDeviceView.isHidden = true
-//        } else if (device.type == .scanner) {
-//            scannerDeviceView.scannerDevice = (device as! ICScannerDevice)
-//            scannerDeviceView.isHidden = false
-//            scannerDeviceView.isHidden = true
-//        } else {
-//            scannerDeviceView.isHidden = true
-//            scannerDeviceView.isHidden = true
-//        }
-        if device != nil {
-            scannerDeviceView.scannerDevice = (device as! ICScannerDevice)
+        if (device.type == .camera) {
+            cameraDeviceView.cameraDevice = (device as! ICCameraDevice)
             cameraDeviceView.isHidden = false
             cameraDeviceView.isHidden = true
+        } else if (device.type == .scanner) {
+            scannerDeviceView.scannerDevice = (device as! ICScannerDevice)
+            scannerDeviceView.isHidden = false
+            scannerDeviceView.isHidden = true
+        } else {
+            scannerDeviceView.isHidden = true
+            scannerDeviceView.isHidden = true
         }
     }
     
@@ -81,14 +83,11 @@ extension KMDeviceBrowserWindowController: IKDeviceBrowserViewDelegate {
 }
 
 extension KMDeviceBrowserWindowController: IKCameraDeviceViewDelegate {
-    func cameraDeviceView(_ cameraDeviceView: IKCameraDeviceView!, didDownloadFile file: ICCameraFile!, location url: URL!, fileData data: Data!, error: Error!) {
-//        if (!error &&
-//            [file.UTI isEqualToString:(NSString *)kUTTypeImage]) {
-//            if (self.importCameraFileCallback) {
-//                self.importCameraFileCallback(url);
-//            }
-//        }
-        KMPrint("获取图片完成")
+    func cameraDeviceView(_ cameraDeviceView: IKCameraDeviceView, didDownloadFile file: ICCameraFile, location url: URL, fileData data: Data?, error: Error?) {
+        file.imageRepresentationType()
+        if error == nil {
+            importCameraFileCallback?(url as NSURL)
+        }
     }
 }
 

+ 4 - 3
PDF Office/PDF Master/Class/Home/WindowController/KMDeviceBrowserWindowController.xib

@@ -1,8 +1,9 @@
 <?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="22155" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
-        <plugIn identifier="com.apple.imagekit.ibplugin" version="21507"/>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22155"/>
+        <plugIn identifier="com.apple.imagekit.ibplugin" version="22155"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>

+ 3 - 2
PDF Office/PDF Master/Class/Home/WindowController/KMHomeWindowController.xib

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

+ 0 - 456
PDF Office/PDF Master/Class/Home/WindowController/KMURLToPDFWindowController.swift

@@ -1,456 +0,0 @@
-//
-//  KMURLToPDFWindowController.swift
-//  PDF Master
-//
-//  Created by wanjun on 2023/1/29.
-//
-
-import Cocoa
-
-class KMURLToPDFWindowController: NSWindowController {
-    
-    @IBOutlet weak var title: NSTextField!
-    @IBOutlet weak var urlView: NSView!
-    @IBOutlet weak var urlTextFieldBox: NSBox!
-    @IBOutlet weak var fileView: NSView!
-    @IBOutlet weak var fileTextFieldBox: NSBox!
-    @IBOutlet weak var fileButtonBox: NSBox!
-    @IBOutlet weak var pageConfigurationView: NSView!
-    @IBOutlet weak var pageConfigurationLabel: NSTextField!
-    @IBOutlet weak var pageSizeLabel: NSTextField!
-    @IBOutlet weak var pageSizePopUpButton: KMPopUpButton!
-    @IBOutlet weak var spacingLanel: NSTextField!
-    @IBOutlet weak var stepperBox: NSBox!
-    @IBOutlet weak var mmLabel: NSTextField!
-    @IBOutlet weak var cancelView: NSView!
-    @IBOutlet weak var openView: NSView!
-    
-    var urlButtonVC: KMDesignButton!
-    var urlTextfieldVC: KMTextfieldVC!
-    var fileButtonVC: KMDesignButton!
-    var fileTextfieldVC: KMTextfieldVC!
-    var openFileVC: KMDesignButton!
-    var stepperVC: KMStepperView!
-    var cancelVC: KMDesignButton!
-    var openVC: KMDesignButton!
-    
-    var filePath: String = ""
-    var gap: Float = 0.0
-    var pageSize: CGSize = NSZeroSize
-
-    override func windowDidLoad() {
-        super.windowDidLoad()
-
-        // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.
-        urlButtonVC     = KMDesignButton.init(withType: .RadioButton)
-        urlTextfieldVC  = KMTextfieldVC.init(nibName: "KMTextfieldVC", bundle: nil)
-        fileButtonVC    = KMDesignButton.init(withType: .RadioButton)
-        fileTextfieldVC = KMTextfieldVC.init(nibName: "KMTextfieldVC", bundle: nil)
-        openFileVC      = KMDesignButton.init(withType: .Image)
-        stepperVC       = KMStepperView.init(nibName: "KMStepperView", bundle: nil)
-        cancelVC        = KMDesignButton.init(withType: .Text)
-        openVC          = KMDesignButton.init(withType: .Text)
-
-        pageSizePopUpButton.removeAllItems()
-        
-        self.initializeUI()
-        self.initLocalization()
-        
-        refreshUI()
-    }
-    
-    // MARK: Init
-
-    func initializeUI() {
-        self.window?.backgroundColor = .white
-
-        title.font = NSFont.boldSystemFont(ofSize: 16.0)
-        title.textColor = NSColor(red: 37/255.0, green: 41/255.0, blue: 41/255.0, alpha: 1.0)
-        urlView.addSubview(urlButtonVC.view)
-        urlButtonVC.image = NSImage(named: "KMRadioButtonUnSelect")!
-        urlButtonVC.target = self
-        urlButtonVC.action = #selector(buttonChangeType)
-        urlButtonVC.state = .Checked
-//        let itemSpacing = KMDesignToken.shared.itemSpacing(withToken: "checkbox-radio.bg.def")
-//        urlButtonVC.radio_label = itemSpacing.stringToCGFloat()
-//        let typography = KMDesignToken.shared.typography(withToken: "checkbox-radio.mac-text.def")
-//        let fill = KMDesignToken.shared.fill(withToken: "checkbox-radio.mac-text.def")
-        urlTextFieldBox.contentView = urlTextfieldVC.view
-        urlTextfieldVC.borderColor = .gray
-        urlTextfieldVC.borderWidth = 1.0
-        urlTextfieldVC.cornerRadius = 4.0
-        urlTextfieldVC.width = 400.0
-        urlTextfieldVC.height = 32.0
-        urlTextfieldVC.editable = true
-        urlTextfieldVC.becomeFirstResponder = true
-        urlTextfieldVC.delete = self
-        
-        fileView.addSubview(fileButtonVC.view)
-        fileButtonVC.image = NSImage(named: "KMRadioButtonUnSelect")!
-        fileButtonVC.target = self
-        fileButtonVC.action = #selector(buttonChangeType)
-
-        fileTextFieldBox.contentView = fileTextfieldVC.view
-        fileTextfieldVC.borderColor = .gray
-        fileTextfieldVC.borderWidth = 1.0
-        fileTextfieldVC.cornerRadius = 4.0
-        fileTextfieldVC.width = 360.0
-        fileTextfieldVC.height = 32.0
-        fileTextfieldVC.editable = false
-        fileTextfieldVC.delete = self
-
-        fileButtonBox.contentView = openFileVC.view
-        openFileVC.image = NSImage(named: "KMFileIcon")!
-        openFileVC.borderColor = .gray
-        openFileVC.borderWidth = 1.0
-        openFileVC.cornerRadius = 4.0
-        openFileVC.width = 32.0
-        openFileVC.height = 32.0
-        openFileVC.target = self
-        openFileVC.action = #selector(selectFileAction)
-        openFileVC.enabled = false
-
-        stepperBox.contentView = stepperVC.view
-        stepperVC.borderColor = .gray
-        stepperVC.borderWidth = 1.0
-        stepperVC.cornerRadius = 4.0
-        stepperVC.width = 72.0
-        stepperVC.height = 32.0
-        stepperVC.delete = self
-        stepperVC.enabled = false
-
-        cancelView.addSubview(cancelVC.view)
-        cancelVC.borderColor = .gray
-        cancelVC.borderWidth = 1.0
-        cancelVC.cornerRadius = 4.0
-        cancelVC.width = 80.0
-        cancelVC.height = 32.0
-        cancelVC.textColor = .black
-        cancelVC.target = self
-        cancelVC.action = #selector(cancelAction)
-
-        openView.addSubview(openVC.view)
-        openVC.borderColor = .gray
-        openVC.borderWidth = 1.0
-        openVC.cornerRadius = 4.0
-        openVC.width = 80.0
-        openVC.height = 32.0
-        openVC.background = NSColor(red: 23/255.0, green: 112/255.0, blue: 244/255.0, alpha: 1.0)
-        openVC.textColor = .white
-        openVC.target = self
-        openVC.action = #selector(startAction)
-    }
-    
-    func initLocalization() {
-        title.stringValue = NSLocalizedString("New From Web Page", comment: "")
-        urlButtonVC.stringValue = NSLocalizedString("URL", comment: "")
-        urlTextfieldVC.placeholderString = NSLocalizedString("https://pdfreaderpro.com", comment: "")
-        fileButtonVC.stringValue = NSLocalizedString("File", comment: "")
-        fileTextfieldVC.placeholderString = NSLocalizedString("Select Files(.html,.webarchive)", comment: "")
-        pageConfigurationLabel.stringValue = NSLocalizedString("Page Configuration", comment: "")
-        pageSizeLabel.stringValue = NSLocalizedString("Page Size:", comment: "")
-        spacingLanel.stringValue = NSLocalizedString("Spacing:", comment: "")
-        mmLabel.stringValue = NSLocalizedString("mm:", comment: "")
-        cancelVC.stringValue = NSLocalizedString("Cancel", comment: "")
-        openVC.stringValue = NSLocalizedString("Open", comment: "")
-
-        pageSizePopUpButton.addItems(withTitles: [NSLocalizedString("Automatic resizing", comment: ""),
-                                                  "4A0 1682 × 2378 mm",
-                                                  "2A0 1189 × 1682 mm",
-                                                  "A0 841 × 1189 mm",
-                                                  "A1 594 × 841 mm",
-                                                  "A2 420 × 594 mm",
-                                                  "A3 297 × 420 mm",
-                                                  "A4 210 × 297 mm",
-                                                  "A5 148 × 210 mm",
-                                                  "A6 105 × 148 mm",
-                                                  "A7 74 × 105 mm",
-                                                  "A8 52 × 74 mm",
-                                                  "A9 37 × 52 mm",
-                                                  "A10 26 × 37 mm"])
-    }
-    
-    func refreshUI() -> Void {
-        urlButtonVC.updateUI()
-        urlTextfieldVC.updateUI()
-        fileButtonVC.updateUI()
-        fileTextfieldVC.updateUI()
-        openFileVC.updateUI()
-        stepperVC.updateUI()
-        cancelVC.updateUI()
-        openVC.updateUI()
-    }
-    
-    // MARK: Private Methods
-
-    func kUrlToPDFFolderPath() -> String {
-//        let searchPath = NSSearchPathForDirectoriesInDomains(.applicationSupportDirectory, .userDomainMask, true).last
-//        let append2 = searchPath!.stringByAppendingPathComponent("WebPage")
-        let append1: NSString = "WebPage"
-        let append2 = append1.kUrlToPDFFolderPath()
-        return append2 as String
-    }
-    
-    @objc func beginSheetModal(for window: NSWindow, completionHandler handler: ((_ filePath: String) -> Void)?) {
-        window.beginSheet(self.window!) { [weak self] returnCode in
-            if self != nil {
-                handler!(self!.filePath)
-            }
-        }
-    }
-
-    func formatFloat(_ f: Float) -> String {
-        if (fmodf(f, 1) == 0) {             //如果有一位小数点
-            return String(format: "%.0f",f)
-        } else if (fmodf(f*10, 1) == 0) {   //如果有两位小数点
-            return String(format: "%.1f",f)
-        } else {
-            return String(format: "%.2f",f)
-        }
-    }
-    
-    // MARK: Action
-    
-    @objc func buttonChangeType(_ sender: NSButton) -> Void {
-        if (sender == urlButtonVC.button) {
-            if urlButtonVC.state == .Norm {
-                urlButtonVC.image = NSImage(named: "KMRadioButtonSelect")!
-                urlButtonVC.state = .Checked
-                fileButtonVC.image = NSImage(named: "KMRadioButtonUnSelect")!
-                fileButtonVC.state = .Norm
-                urlTextfieldVC.editable = true
-                urlTextfieldVC.becomeFirstResponder = true
-                fileTextfieldVC.stringValue = ""
-                openFileVC.enabled = false
-                if urlTextfieldVC.stringValue.count > 0 {
-//                    openVC.enabled = true
-                } else {
-//                    openVC.enabled = false
-                }
-            }
-        } else if (sender == fileButtonVC.button) {
-            if fileButtonVC.state == .Norm {
-                urlButtonVC.image = NSImage(named: "KMRadioButtonUnSelect")!
-                urlButtonVC.state = .Norm
-                fileButtonVC.image = NSImage(named: "KMRadioButtonSelect")!
-                fileButtonVC.state = .Checked
-                urlTextfieldVC.editable = false
-                urlTextfieldVC.stringValue = ""
-                openFileVC.enabled = true
-                
-                if fileTextfieldVC.stringValue.count > 0 {
-//                    openVC.enabled = true
-                } else {
-//                    openVC.enabled = false
-                }
-            }
-        }
-        refreshUI()
-    }
-    
-    @objc func selectFileAction(_ sender: NSButton) -> Void {
-        urlButtonVC.state = .Norm
-        fileButtonVC.state = .Checked
-        urlTextfieldVC.editable = false
-        urlTextfieldVC.stringValue = ""
-//        openVC.enabled = false
-        
-        let openPanel = NSOpenPanel()
-        openPanel.canChooseFiles = true
-        openPanel.canChooseDirectories = false
-        openPanel.allowsMultipleSelection = false
-        openPanel.allowedFileTypes = ["HTML","html","webarchive","htm"]
-        openPanel.beginSheetModal(for: self.window!) { [self] response in
-            if response == .OK {
-                fileTextfieldVC.stringValue = openPanel.url!.path
-//                openVC.enabled = true
-                refreshUI()
-            }
-        }
-    }
- 
-    @objc func cancelAction(_ sender: NSButton) -> Void {
-        if (sender == cancelVC.button) {
-            NSApp.mainWindow!.endSheet(self.window!)
-            self.window?.orderOut(self)
-        }
-    }
-    
-    @objc func startAction(_ sender: NSButton) -> Void {
-        if (sender == openVC.button) {
-            if FileManager.default.fileExists(atPath: kUrlToPDFFolderPath()) {
-                try? FileManager.default.createDirectory(atPath: kUrlToPDFFolderPath(), withIntermediateDirectories: false)
-            }
-
-            var url: URL
-            var fileName: String = ""
-            if urlButtonVC.state == .Checked {
-                let urlstring = urlTextfieldVC.stringValue
-                var tUrl = URL(string: urlstring)
-                if tUrl?.scheme == nil {
-                    tUrl = URL(string: String(format: "http://%@", urlstring))
-                }
-                url = tUrl!
-            } else {
-                url = URL(fileURLWithPath: fileTextfieldVC.stringValue)
-                fileName = fileTextfieldVC.stringValue.lastPathComponent.deletingPathExtension.lastPathComponent
-            }
-            var string = stepperVC.text
-            let unitScanle: Float = (595.0/21.0) * 2.54
-            if Float(string)! <= 0 {
-                stepperVC.text = "0"
-                string = "0"
-            } else if Float(string)! * unitScanle > Float(pageSize.width)/2 {
-                let maxF = pageSize.width/(string.stringToCGFloat() * 2)
-                stepperVC.text = String(format: "%f",maxF)
-                string = String(format: "%f",maxF)
-            }
-            gap = Float(formatFloat(Float(string.stringToCGFloat()) * unitScanle))!
-            
-//            if url != nil {
-//                let convert = KMConvertURLToPDF.shareInstance()
-//                convert.fileName = fileName
-//                convert.convertUrl(toPDF: [url], toPath: kUrlToPDFFolderPath(), pageSize: pageSize, gap: CGFloat(gap)) { value in
-//                    
-//                } completionHandler: { successArray, failArray in
-//                    if failArray.count < 1 {
-//                        let filePath: String = successArray.first as! String
-//                        if FileManager.default.fileExists(atPath: filePath) {
-//                            self.filePath = filePath
-//                            NSApp.mainWindow!.endSheet(self.window!)
-//                            self.window?.orderOut(self)
-//                        }
-//                    } else {
-//                        let alert = NSAlert()
-//                        alert.alertStyle = .critical
-//                        alert.informativeText = NSLocalizedString("Conversion Failed", comment: "")
-//                        alert.messageText = NSLocalizedString("", comment: "")
-//                        alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
-//                        alert.runModal()
-//                    }
-//                }
-//            }
-        }
-    }
-    
-    @IBAction func comboBoxItemClick_PageSize(_ sender: KMPopUpButton) {
-        switch pageSizePopUpButton.indexOfSelectedItem {
-        case 0:
-            pageSize = CGSize(width: 0, height: 0)
-            break
-        case 1:
-            pageSize = CGSize(width: 4760, height: 6736)
-            break
-        case 2:
-            pageSize = CGSize(width: 3368, height: 4760)
-            break
-        case 3:
-            pageSize = CGSize(width: 2380, height: 3368)
-            break
-        case 4:
-            pageSize = CGSize(width: 1684, height: 2380)
-            break
-        case 5:
-            pageSize = CGSize(width: 1190, height: 1684)
-            break
-        case 6:
-            pageSize = CGSize(width: 842, height: 1190)
-            break
-        case 7:
-            pageSize = CGSize(width: 595, height: 842)
-            break
-        case 8:
-            pageSize = CGSize(width: 420, height: 595)
-            break
-        case 9:
-            pageSize = CGSize(width: 298, height: 420)
-            break
-        default:
-            pageSize = CGSize(width: 210, height: 298)
-            break
-        }
-        if (pageSizePopUpButton.indexOfSelectedItem != 0) {
-            stepperVC.text = "0"
-            stepperVC.enabled = true
-        } else {
-            stepperVC.text = "0"
-            stepperVC.enabled = false
-        }
-        refreshUI()
-    }
-}
-
-extension KMURLToPDFWindowController: KMStepperViewDelegate {
-    func km_controlTextDidEndEditing(_ obj: KMStepperView) {
-        if obj == stepperVC {
-            var string: String = obj.text
-            let unitScanle: Float = (595.0/21.0) * 2.54
-            if (string.stringToCGFloat() <= 0) {
-                stepperVC.text = "0"
-                string = "0"
-            } else if (Float(string.stringToCGFloat()) * unitScanle > Float(pageSize.width)/2) {
-                let maxF = pageSize.width / (string.stringToCGFloat() * 2)
-                stepperVC.text = String(format: "%f",maxF)
-                string = String(format: "%f",maxF)
-            }
-            gap = Float(formatFloat(Float(string.stringToCGFloat()) * unitScanle))!
-            refreshUI()
-        }
-    }
-    
-    func km_controlTextDidChange(_ obj: KMStepperView) {
-        if obj == stepperVC {
-            if (urlButtonVC.state == .Checked) {
-                if (urlTextfieldVC.stringValue.count > 0) {
-//                    openVC.enabled = true
-                } else {
-//                    openVC.enabled = false
-                }
-            } else {
-                if (fileTextfieldVC.stringValue.count > 0) {
-//                    openVC.enabled = true
-                } else {
-//                    openVC.enabled = false
-                }
-            }
-        }
-        refreshUI()
-    }
-    
-    func km_controlClick(_ obj: KMStepperView) {
-        if (obj.text.stringToCGFloat() < 0) {
-            stepperVC.text = "0"
-        }
-        let unitScanle = (595.0/21.0) * 2.54
-        let formatter = formatFloat(Float(obj.text.stringToCGFloat() * unitScanle))
-        gap = Float(formatter)!
-        
-        refreshUI()
-    }
-}
-
-extension KMURLToPDFWindowController: KMTextfieldVCDelegate {
-    func km_controlTextDidEndEditing(_ obj: KMTextfieldVC) {
-        
-    }
-    
-    func km_controlTextDidChange(_ obj: KMTextfieldVC) {
-        if urlButtonVC.state == .Checked {
-            if urlTextfieldVC.stringValue.count > 0 {
-                openVC.enabled = true
-                refreshUI()
-            } else {
-                openVC.enabled = false
-                refreshUI()
-            }
-        } else {
-            if fileTextfieldVC.stringValue.count > 0 {
-                openVC.enabled = true
-                refreshUI()
-            } else {
-                openVC.enabled = false
-                refreshUI()
-            }
-        }
-    }
-}

+ 0 - 292
PDF Office/PDF Master/Class/Home/WindowController/KMURLToPDFWindowController.xib

@@ -1,292 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22146" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
-    <dependencies>
-        <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22146"/>
-        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
-    </dependencies>
-    <objects>
-        <customObject id="-2" userLabel="File's Owner" customClass="KMURLToPDFWindowController" customModule="PDF_Master" customModuleProvider="target">
-            <connections>
-                <outlet property="cancelView" destination="137-mQ-meg" id="IeR-yR-8Al"/>
-                <outlet property="fileButtonBox" destination="3Ww-O2-STf" id="9xj-nd-Itu"/>
-                <outlet property="fileTextFieldBox" destination="Avh-hY-SXB" id="xDP-Zg-KMk"/>
-                <outlet property="fileView" destination="qXY-ql-qU4" id="ApS-Qq-4nh"/>
-                <outlet property="mmLabel" destination="6LX-3p-Wa9" id="4kH-mo-gkN"/>
-                <outlet property="openView" destination="BEe-XQ-4yv" id="AHi-Ae-OxO"/>
-                <outlet property="pageConfigurationLabel" destination="pQd-aG-W5t" id="PyS-3j-Vut"/>
-                <outlet property="pageConfigurationView" destination="1ob-vx-s0R" id="wTd-Dk-6v4"/>
-                <outlet property="pageSizeLabel" destination="A7s-pc-oH6" id="NtP-jZ-yZt"/>
-                <outlet property="pageSizePopUpButton" destination="Xdv-g4-jY0" id="dSj-eN-0TC"/>
-                <outlet property="spacingLanel" destination="6XK-Pz-ujn" id="ebk-qx-lC7"/>
-                <outlet property="stepperBox" destination="Urb-tD-cQm" id="nki-XD-DAR"/>
-                <outlet property="title" destination="pJU-XO-8iX" id="atc-RQ-s48"/>
-                <outlet property="urlTextFieldBox" destination="vPp-iu-2FN" id="eor-V4-mpN"/>
-                <outlet property="urlView" destination="Py4-BC-ARo" id="Iyb-2l-v4q"/>
-                <outlet property="window" destination="F0z-JX-Cv5" id="gIp-Ho-8D9"/>
-            </connections>
-        </customObject>
-        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
-        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
-        <window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="F0z-JX-Cv5">
-            <windowStyleMask key="styleMask" titled="YES"/>
-            <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
-            <rect key="contentRect" x="196" y="240" width="948" height="493"/>
-            <rect key="screenRect" x="0.0" y="0.0" width="2560" height="1415"/>
-            <view key="contentView" id="se5-gp-TjO">
-                <rect key="frame" x="0.0" y="0.0" width="948" height="370"/>
-                <autoresizingMask key="autoresizingMask"/>
-                <subviews>
-                    <customView translatesAutoresizingMaskIntoConstraints="NO" id="y7U-Dm-f0s">
-                        <rect key="frame" x="16" y="0.0" width="916" height="370"/>
-                        <subviews>
-                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="u8l-AB-pxk">
-                                <rect key="frame" x="0.0" y="333" width="916" height="24"/>
-                                <subviews>
-                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="pJU-XO-8iX">
-                                        <rect key="frame" x="-2" y="4" width="37" height="16"/>
-                                        <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="hRe-34-aDe">
-                                            <font key="font" usesAppearanceFont="YES"/>
-                                            <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                                            <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                        </textFieldCell>
-                                    </textField>
-                                </subviews>
-                                <constraints>
-                                    <constraint firstItem="pJU-XO-8iX" firstAttribute="centerY" secondItem="u8l-AB-pxk" secondAttribute="centerY" id="OvU-ex-uxc"/>
-                                    <constraint firstAttribute="height" constant="24" id="nUg-WN-GSh"/>
-                                    <constraint firstItem="pJU-XO-8iX" firstAttribute="leading" secondItem="u8l-AB-pxk" secondAttribute="leading" id="vQE-35-3b0"/>
-                                </constraints>
-                            </customView>
-                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="Py4-BC-ARo">
-                                <rect key="frame" x="0.0" y="298" width="916" height="22"/>
-                                <constraints>
-                                    <constraint firstAttribute="height" constant="22" id="wZo-Xp-0WB"/>
-                                </constraints>
-                            </customView>
-                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="wCP-ff-q0J">
-                                <rect key="frame" x="0.0" y="180" width="916" height="32"/>
-                                <subviews>
-                                    <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="Avh-hY-SXB">
-                                        <rect key="frame" x="0.0" y="0.0" width="876" height="32"/>
-                                        <view key="contentView" id="cl7-lg-Taj">
-                                            <rect key="frame" x="0.0" y="0.0" width="876" height="32"/>
-                                            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                        </view>
-                                    </box>
-                                    <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="3Ww-O2-STf">
-                                        <rect key="frame" x="884" y="0.0" width="32" height="32"/>
-                                        <view key="contentView" id="heH-4o-sO5">
-                                            <rect key="frame" x="0.0" y="0.0" width="32" height="32"/>
-                                            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                        </view>
-                                        <constraints>
-                                            <constraint firstAttribute="width" constant="32" id="2XY-4B-Yca"/>
-                                            <constraint firstAttribute="width" secondItem="3Ww-O2-STf" secondAttribute="height" multiplier="1:1" id="PWw-t2-7sq"/>
-                                        </constraints>
-                                    </box>
-                                </subviews>
-                                <constraints>
-                                    <constraint firstItem="Avh-hY-SXB" firstAttribute="leading" secondItem="wCP-ff-q0J" secondAttribute="leading" id="aDQ-3m-0MX"/>
-                                    <constraint firstAttribute="bottom" secondItem="Avh-hY-SXB" secondAttribute="bottom" id="cnq-4Z-D3M"/>
-                                    <constraint firstAttribute="trailing" secondItem="3Ww-O2-STf" secondAttribute="trailing" id="ezA-u7-puH"/>
-                                    <constraint firstItem="3Ww-O2-STf" firstAttribute="leading" secondItem="Avh-hY-SXB" secondAttribute="trailing" constant="8" id="nNS-Mw-wnM"/>
-                                    <constraint firstAttribute="bottom" secondItem="3Ww-O2-STf" secondAttribute="bottom" id="uhq-q1-H1x"/>
-                                    <constraint firstAttribute="height" constant="32" id="yB6-sP-T07"/>
-                                    <constraint firstItem="Avh-hY-SXB" firstAttribute="top" secondItem="wCP-ff-q0J" secondAttribute="top" id="zHz-fe-FqV"/>
-                                    <constraint firstItem="3Ww-O2-STf" firstAttribute="top" secondItem="wCP-ff-q0J" secondAttribute="top" id="zpM-sU-uup"/>
-                                </constraints>
-                            </customView>
-                            <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="vPp-iu-2FN">
-                                <rect key="frame" x="0.0" y="258" width="916" height="32"/>
-                                <view key="contentView" id="bnu-dm-hvU">
-                                    <rect key="frame" x="0.0" y="0.0" width="916" height="32"/>
-                                    <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                </view>
-                                <constraints>
-                                    <constraint firstAttribute="height" constant="32" id="mjF-Un-QOb"/>
-                                </constraints>
-                            </box>
-                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="1ob-vx-s0R">
-                                <rect key="frame" x="0.0" y="144" width="916" height="20"/>
-                                <subviews>
-                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="pQd-aG-W5t">
-                                        <rect key="frame" x="-2" y="2" width="37" height="16"/>
-                                        <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="Ic1-jB-Dow">
-                                            <font key="font" usesAppearanceFont="YES"/>
-                                            <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                                            <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                        </textFieldCell>
-                                    </textField>
-                                </subviews>
-                                <constraints>
-                                    <constraint firstAttribute="height" constant="20" id="287-jQ-YKq"/>
-                                    <constraint firstItem="pQd-aG-W5t" firstAttribute="leading" secondItem="1ob-vx-s0R" secondAttribute="leading" id="ClC-VL-020"/>
-                                    <constraint firstItem="pQd-aG-W5t" firstAttribute="centerY" secondItem="1ob-vx-s0R" secondAttribute="centerY" id="bA1-w0-efb"/>
-                                </constraints>
-                            </customView>
-                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="H2J-9d-Zrv">
-                                <rect key="frame" x="0.0" y="104" width="916" height="32"/>
-                                <subviews>
-                                    <box boxType="custom" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="uk7-mo-ZMr">
-                                        <rect key="frame" x="601" y="0.0" width="315" height="32"/>
-                                        <view key="contentView" id="hqg-xS-6zj">
-                                            <rect key="frame" x="1" y="1" width="313" height="30"/>
-                                            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                            <subviews>
-                                                <popUpButton translatesAutoresizingMaskIntoConstraints="NO" id="Xdv-g4-jY0" customClass="KMPopUpButton">
-                                                    <rect key="frame" x="-5" y="0.0" width="318" height="30"/>
-                                                    <popUpButtonCell key="cell" type="bevel" title="Item 1" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" imageScaling="proportionallyDown" inset="2" arrowPosition="noArrow" selectedItem="hZy-kr-YE8" id="b1x-JM-ryW">
-                                                        <behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
-                                                        <font key="font" metaFont="menu"/>
-                                                        <menu key="menu" id="TAo-el-XNS">
-                                                            <items>
-                                                                <menuItem title="Item 1" state="on" id="hZy-kr-YE8"/>
-                                                                <menuItem title="Item 2" id="GyX-Yu-W8h"/>
-                                                                <menuItem title="Item 3" id="xSn-aj-ht8"/>
-                                                            </items>
-                                                        </menu>
-                                                    </popUpButtonCell>
-                                                    <connections>
-                                                        <action selector="comboBoxItemClick_PageSize:" target="-2" id="7XV-B0-J5g"/>
-                                                    </connections>
-                                                </popUpButton>
-                                            </subviews>
-                                            <constraints>
-                                                <constraint firstAttribute="bottom" secondItem="Xdv-g4-jY0" secondAttribute="bottom" id="6rz-Er-UEP"/>
-                                                <constraint firstItem="Xdv-g4-jY0" firstAttribute="leading" secondItem="hqg-xS-6zj" secondAttribute="leading" id="ORX-FU-1KD"/>
-                                                <constraint firstItem="Xdv-g4-jY0" firstAttribute="top" secondItem="hqg-xS-6zj" secondAttribute="top" id="eYc-bd-mFb"/>
-                                                <constraint firstAttribute="trailing" secondItem="Xdv-g4-jY0" secondAttribute="trailing" id="sT4-5P-pv2"/>
-                                            </constraints>
-                                        </view>
-                                        <constraints>
-                                            <constraint firstAttribute="width" constant="315" id="aTI-iG-wY9"/>
-                                        </constraints>
-                                    </box>
-                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="A7s-pc-oH6">
-                                        <rect key="frame" x="-2" y="8" width="37" height="16"/>
-                                        <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="sOJ-pa-2O7">
-                                            <font key="font" usesAppearanceFont="YES"/>
-                                            <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                                            <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                        </textFieldCell>
-                                    </textField>
-                                </subviews>
-                                <constraints>
-                                    <constraint firstItem="Xdv-g4-jY0" firstAttribute="centerY" secondItem="A7s-pc-oH6" secondAttribute="centerY" id="1iH-GV-EX4"/>
-                                    <constraint firstItem="uk7-mo-ZMr" firstAttribute="top" secondItem="H2J-9d-Zrv" secondAttribute="top" id="58Y-iP-kZD"/>
-                                    <constraint firstAttribute="trailing" secondItem="uk7-mo-ZMr" secondAttribute="trailing" id="6we-aY-zAr"/>
-                                    <constraint firstAttribute="height" constant="32" id="86p-f3-3a7"/>
-                                    <constraint firstItem="A7s-pc-oH6" firstAttribute="leading" secondItem="H2J-9d-Zrv" secondAttribute="leading" id="E6V-sR-Biu"/>
-                                    <constraint firstAttribute="bottom" secondItem="uk7-mo-ZMr" secondAttribute="bottom" id="QQ5-xc-RHJ"/>
-                                </constraints>
-                            </customView>
-                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="Hqe-7Y-xOc">
-                                <rect key="frame" x="0.0" y="64" width="916" height="32"/>
-                                <subviews>
-                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="6XK-Pz-ujn">
-                                        <rect key="frame" x="-2" y="8" width="37" height="16"/>
-                                        <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="kaR-yG-KYb">
-                                            <font key="font" usesAppearanceFont="YES"/>
-                                            <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                                            <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                        </textFieldCell>
-                                    </textField>
-                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="6LX-3p-Wa9">
-                                        <rect key="frame" x="688" y="8" width="37" height="16"/>
-                                        <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="EWG-2f-7HR">
-                                            <font key="font" metaFont="system"/>
-                                            <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                                            <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                        </textFieldCell>
-                                    </textField>
-                                    <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="Urb-tD-cQm">
-                                        <rect key="frame" x="602" y="0.0" width="72" height="32"/>
-                                        <view key="contentView" id="dHM-jY-BRD">
-                                            <rect key="frame" x="0.0" y="0.0" width="72" height="32"/>
-                                            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                        </view>
-                                        <constraints>
-                                            <constraint firstAttribute="width" constant="72" id="VCP-ml-nOI"/>
-                                        </constraints>
-                                    </box>
-                                </subviews>
-                                <constraints>
-                                    <constraint firstItem="6LX-3p-Wa9" firstAttribute="leading" secondItem="Urb-tD-cQm" secondAttribute="trailing" constant="16" id="7Em-6V-IIo"/>
-                                    <constraint firstItem="6LX-3p-Wa9" firstAttribute="centerY" secondItem="Urb-tD-cQm" secondAttribute="centerY" id="B3d-Va-k9B"/>
-                                    <constraint firstItem="6XK-Pz-ujn" firstAttribute="leading" secondItem="Hqe-7Y-xOc" secondAttribute="leading" id="Egl-8C-J57"/>
-                                    <constraint firstAttribute="bottom" secondItem="Urb-tD-cQm" secondAttribute="bottom" id="KQC-wp-MJb"/>
-                                    <constraint firstItem="Urb-tD-cQm" firstAttribute="top" secondItem="Hqe-7Y-xOc" secondAttribute="top" id="Nbc-7X-yfA"/>
-                                    <constraint firstItem="6XK-Pz-ujn" firstAttribute="centerY" secondItem="Hqe-7Y-xOc" secondAttribute="centerY" id="VXE-st-Cex"/>
-                                    <constraint firstAttribute="height" constant="32" id="sl6-1U-SQm"/>
-                                </constraints>
-                            </customView>
-                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="qXY-ql-qU4">
-                                <rect key="frame" x="0.0" y="220" width="916" height="22"/>
-                                <constraints>
-                                    <constraint firstAttribute="height" constant="22" id="DYt-Mv-u59"/>
-                                </constraints>
-                            </customView>
-                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="BEe-XQ-4yv">
-                                <rect key="frame" x="836" y="16" width="80" height="32"/>
-                                <constraints>
-                                    <constraint firstAttribute="height" constant="32" id="ELy-KZ-rr2"/>
-                                    <constraint firstAttribute="width" constant="80" id="ZVh-hQ-VjF"/>
-                                </constraints>
-                            </customView>
-                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="137-mQ-meg">
-                                <rect key="frame" x="740" y="16" width="80" height="32"/>
-                                <constraints>
-                                    <constraint firstAttribute="width" constant="80" id="Tdx-qT-DmD"/>
-                                    <constraint firstAttribute="height" constant="32" id="j2y-fh-TrC"/>
-                                </constraints>
-                            </customView>
-                        </subviews>
-                        <constraints>
-                            <constraint firstItem="Xdv-g4-jY0" firstAttribute="leading" secondItem="Urb-tD-cQm" secondAttribute="leading" id="1MB-x3-AFI"/>
-                            <constraint firstItem="H2J-9d-Zrv" firstAttribute="leading" secondItem="y7U-Dm-f0s" secondAttribute="leading" id="1Uv-wV-2Q5"/>
-                            <constraint firstItem="wCP-ff-q0J" firstAttribute="leading" secondItem="y7U-Dm-f0s" secondAttribute="leading" id="2kG-2l-g4O"/>
-                            <constraint firstItem="vPp-iu-2FN" firstAttribute="leading" secondItem="y7U-Dm-f0s" secondAttribute="leading" id="6Q4-gd-ddF"/>
-                            <constraint firstAttribute="trailing" secondItem="qXY-ql-qU4" secondAttribute="trailing" id="EGM-Ng-g3h"/>
-                            <constraint firstItem="Py4-BC-ARo" firstAttribute="leading" secondItem="y7U-Dm-f0s" secondAttribute="leading" id="Ef4-uD-1Eg"/>
-                            <constraint firstItem="Py4-BC-ARo" firstAttribute="top" secondItem="u8l-AB-pxk" secondAttribute="bottom" constant="13" id="FsH-WW-fbl"/>
-                            <constraint firstAttribute="trailing" secondItem="vPp-iu-2FN" secondAttribute="trailing" id="G4A-n4-3hx"/>
-                            <constraint firstItem="qXY-ql-qU4" firstAttribute="leading" secondItem="y7U-Dm-f0s" secondAttribute="leading" id="HPn-oV-vfT"/>
-                            <constraint firstItem="BEe-XQ-4yv" firstAttribute="leading" secondItem="137-mQ-meg" secondAttribute="trailing" constant="16" id="IVH-s4-tiI"/>
-                            <constraint firstAttribute="trailing" secondItem="wCP-ff-q0J" secondAttribute="trailing" id="RZY-Vc-L0U"/>
-                            <constraint firstItem="H2J-9d-Zrv" firstAttribute="top" secondItem="1ob-vx-s0R" secondAttribute="bottom" constant="8" id="TJA-uy-YdO"/>
-                            <constraint firstAttribute="trailing" secondItem="Py4-BC-ARo" secondAttribute="trailing" id="Xvb-C0-k8d"/>
-                            <constraint firstItem="Hqe-7Y-xOc" firstAttribute="leading" secondItem="y7U-Dm-f0s" secondAttribute="leading" id="Y5z-ai-Lds"/>
-                            <constraint firstAttribute="trailing" secondItem="Hqe-7Y-xOc" secondAttribute="trailing" id="aYH-qK-OZo"/>
-                            <constraint firstAttribute="bottom" secondItem="BEe-XQ-4yv" secondAttribute="bottom" constant="16" id="axQ-9u-Ogm"/>
-                            <constraint firstItem="vPp-iu-2FN" firstAttribute="top" secondItem="Py4-BC-ARo" secondAttribute="bottom" constant="8" id="b9M-vS-eh0"/>
-                            <constraint firstItem="1ob-vx-s0R" firstAttribute="top" secondItem="wCP-ff-q0J" secondAttribute="bottom" constant="16" id="cHU-jD-GRO"/>
-                            <constraint firstAttribute="trailing" secondItem="H2J-9d-Zrv" secondAttribute="trailing" id="dmJ-ho-1s4"/>
-                            <constraint firstItem="BEe-XQ-4yv" firstAttribute="centerY" secondItem="137-mQ-meg" secondAttribute="centerY" id="gFE-SN-YhO"/>
-                            <constraint firstAttribute="trailing" secondItem="u8l-AB-pxk" secondAttribute="trailing" id="gLK-SP-Am0"/>
-                            <constraint firstItem="wCP-ff-q0J" firstAttribute="top" secondItem="qXY-ql-qU4" secondAttribute="bottom" constant="8" id="i6n-Qh-7ne"/>
-                            <constraint firstAttribute="trailing" secondItem="BEe-XQ-4yv" secondAttribute="trailing" id="jY9-WR-ybU"/>
-                            <constraint firstItem="BEe-XQ-4yv" firstAttribute="top" secondItem="Hqe-7Y-xOc" secondAttribute="bottom" constant="16" id="jds-AS-Fk0"/>
-                            <constraint firstItem="1ob-vx-s0R" firstAttribute="leading" secondItem="y7U-Dm-f0s" secondAttribute="leading" id="qyo-cu-fNc"/>
-                            <constraint firstItem="u8l-AB-pxk" firstAttribute="leading" secondItem="y7U-Dm-f0s" secondAttribute="leading" id="vTV-Ky-m8i"/>
-                            <constraint firstItem="qXY-ql-qU4" firstAttribute="top" secondItem="vPp-iu-2FN" secondAttribute="bottom" constant="16" id="w32-nd-Ghm"/>
-                            <constraint firstItem="Hqe-7Y-xOc" firstAttribute="top" secondItem="H2J-9d-Zrv" secondAttribute="bottom" constant="8" id="wJM-w1-5Pm"/>
-                            <constraint firstAttribute="trailing" secondItem="1ob-vx-s0R" secondAttribute="trailing" id="z0l-vC-sov"/>
-                            <constraint firstItem="u8l-AB-pxk" firstAttribute="top" secondItem="y7U-Dm-f0s" secondAttribute="top" constant="13" id="zbb-AU-0vW"/>
-                        </constraints>
-                    </customView>
-                </subviews>
-                <constraints>
-                    <constraint firstItem="y7U-Dm-f0s" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" constant="16" id="LTM-tp-dzh"/>
-                    <constraint firstAttribute="bottom" secondItem="y7U-Dm-f0s" secondAttribute="bottom" id="aAm-7t-IUH"/>
-                    <constraint firstItem="y7U-Dm-f0s" firstAttribute="top" secondItem="se5-gp-TjO" secondAttribute="top" id="wOZ-8s-PPz"/>
-                    <constraint firstAttribute="trailing" secondItem="y7U-Dm-f0s" secondAttribute="trailing" constant="16" id="zLY-Yl-Tgc"/>
-                </constraints>
-            </view>
-            <connections>
-                <outlet property="delegate" destination="-2" id="0bl-1N-AYu"/>
-            </connections>
-            <point key="canvasLocation" x="311" y="255.5"/>
-        </window>
-    </objects>
-</document>

+ 340 - 0
PDF Office/PDF Master/Class/Home/WindowController/KMURLToPDFWindowController/KMURLToPDFWindowController.swift

@@ -0,0 +1,340 @@
+//
+//  KMURLToPDFWindowController.swift
+//  PDF Master
+//
+//  Created by wanjun on 2023/1/29.
+//
+
+import Cocoa
+
+let kUrlToPDFFolderPath = (try? FileManager.default.url(for: .applicationSupportDirectory, in: .userDomainMask, appropriateFor: nil, create: true).appendingPathComponent(Bundle.main.bundleIdentifier ?? "").appendingPathComponent("WebPage"))?.path ?? ""
+
+
+typealias KMURLToPDFWindowControllerComplete = (_ filePath: String) -> Void
+class KMURLToPDFWindowController: NSWindowController, NSTextFieldDelegate {
+    @IBOutlet var urlBtn: NSButton!
+    @IBOutlet var localHtmlBtn: NSButton!
+    @IBOutlet var outputBackView: NSView!
+    @IBOutlet var outputText: NSTextField!
+    @IBOutlet var outputButton: NSButton!
+    @IBOutlet var pageSizeComboBox: NSComboBox!
+    @IBOutlet var pageViewLabel: NSTextField!
+    @IBOutlet var pageSizeLabel: NSTextField!
+    @IBOutlet var pageGapLabel: NSTextField!
+    @IBOutlet var pageGapTextField: NSTextField!
+    @IBOutlet var pagesGapStepper: NSStepper!
+    @IBOutlet var btnConvert: NSButton!
+    @IBOutlet var btnCancel: NSButton!
+    @IBOutlet var urlTextField: NSTextField!
+    
+    var filePath: String?
+//    var posterMaskView: KMBookletMaskView?
+    var gap: CGFloat = 0
+    var pageSize: CGSize = CGSizeMake(298, 420)
+    
+    var handler: KMURLToPDFWindowControllerComplete?
+
+    override init(window: NSWindow?) {
+        super.init(window: window)
+    }
+
+    required init?(coder: NSCoder) {
+        super.init(coder: coder)
+    }
+
+    override func windowDidLoad() {
+        super.windowDidLoad()
+
+        window?.title = NSLocalizedString("Web Page To PDF", comment: "")
+        
+        pageViewLabel.stringValue = NSLocalizedString("Page View", comment: "")
+        pageSizeLabel.stringValue = NSLocalizedString("Page size:", comment: "")
+        pageGapLabel.stringValue = "\(NSLocalizedString("Spacing", comment: "")):"
+        
+        urlBtn.title = NSLocalizedString("URL", comment: "")
+        localHtmlBtn.title = NSLocalizedString("File", comment: "")
+        btnConvert.title = NSLocalizedString("Save as PDF", comment: "")
+        btnCancel.title = NSLocalizedString("Cancel", comment: "")
+        outputButton.title = NSLocalizedString("Choose...", comment: "")
+        
+        outputBackView.wantsLayer = true
+        outputBackView.layer?.borderWidth = 0.8
+        outputBackView.layer?.borderColor = NSColor(red: 177.0/255, green: 178.0/255, blue: 177.0/255, alpha: 1).cgColor
+        urlTextField.placeholderString = "https://www.pdfreaderpro.com"
+        urlTextField.delegate = self
+        outputText.isEditable = false
+
+        pageSizeComboBox.addItems(withObjectValues: [
+            NSLocalizedString("Automatically Resize", comment: "Menu item title"),
+            "4A0 1682 × 2378 mm",
+            "2A0 1189 × 1682 mm",
+            "A0 841 × 1189 mm",
+            "A1 594 × 841 mm",
+            "A2 420 × 594 mm",
+            "A3 297 × 420 mm",
+            "A4 210 × 297 mm",
+            "A5 148 × 210 mm",
+            "A6 105 × 148 mm",
+            "A7 74 × 105 mm",
+            "A8 52 × 74 mm",
+            "A9 37 × 52 mm",
+            "A10 26 × 37 mm"
+        ])
+        pageSizeComboBox.selectItem(at: 0)
+        pageSizeComboBox.isEditable = false
+
+        pageSize = CGSizeMake(298, 420)
+        gap = 0
+
+        pagesGapStepper.stringValue = "0"
+        pagesGapStepper.isEnabled = false
+        pageGapTextField.isEnabled = false
+
+        if urlBtn.state == .on {
+            if urlTextField.stringValue.count > 0 {
+                btnConvert.isEnabled = true
+            } else {
+                btnConvert.isEnabled = false
+            }
+        } else {
+            if outputText.stringValue.count > 0 {
+                btnConvert.isEnabled = true
+            } else {
+                btnConvert.isEnabled = false
+            }
+        }
+
+        outputText.placeholderString = "\(NSLocalizedString("Select a File", comment: "")) (.html, .webarchive)"
+        outputButton.isEnabled = false
+    }
+
+    func isUrl(_ urlString: String?) -> Bool {
+        guard let urlString = urlString else { return false }
+        
+        // 实现方法有问题,暂不使用
+        var url: String
+        if urlString.count > 4, urlString.prefix(4) == "www." {
+            url = "http://\(urlString)"
+        } else {
+            url = urlString
+        }
+        let urlRegex = "\\bhttps?://[a-zA-Z0-9\\-.]+(?::(\\d+))?(?:(?:/[a-zA-Z0-9\\-._?,'+\\&%$=~*!():@\\\\]*)+)?"
+        let urlTest = NSPredicate(format: "SELF MATCHES %@", urlRegex)
+        return urlTest.evaluate(with: url)
+    }
+
+    func beginSheetModalForWindow(_ window: NSWindow, completionHandler handler: ((String) -> Void)?) {
+        self.handler = handler
+        NSWindow.currentWindow().beginSheet(self.window!) { response in
+            self.handler?(self.filePath ?? "")
+        }
+    }
+
+    @IBAction func buttonItemClicked_Cancel(_ sender: NSButton) {
+        self.window?.endSheet(NSWindow.currentWindow())
+    }
+
+    func urlValueEncode(_ str: String) -> String? {
+        let allowedCharacterSet = CharacterSet(charactersIn: "!*'();:@&=+$,?%#[]{}").inverted
+        return str.addingPercentEncoding(withAllowedCharacters: allowedCharacterSet)
+    }
+
+
+    @IBAction func buttonItemClicked_Start(_ sender: NSButton) {
+        if !FileManager.default.fileExists(atPath: kUrlToPDFFolderPath) {
+            try? FileManager.default.createDirectory(atPath: kUrlToPDFFolderPath, withIntermediateDirectories: false, attributes: nil)
+        }
+
+        var url: URL?
+        var fileName: String?
+        if urlBtn.state == .on {
+            let urlString = urlTextField.stringValue
+            var tUrl = URL(string: urlString)
+            if tUrl?.scheme?.count ?? 0 < 1 {
+                tUrl = URL(string: "http://\(urlString)")
+            }
+            url = tUrl
+        } else {
+            url = URL(fileURLWithPath: outputText.stringValue)
+            fileName = outputText.stringValue.lastPathComponent.deletingPathExtension
+        }
+
+        let string = pageGapTextField.stringValue
+        let unitScale: CGFloat = (595.0 / 21.0) * 2.54
+
+        if string.stringToCGFloat() <= 0 {
+            pageGapTextField.stringValue = "0"
+        } else if string.stringToCGFloat() * unitScale > pageSize.width / 2 {
+            let maxF = pageSize.width / (string.stringToCGFloat() * 2)
+            pageGapTextField.stringValue = "\(maxF)"
+        }
+        
+        gap = formatFloat(Float(string.stringToCGFloat() * unitScale)).stringToCGFloat()
+
+        if let url = url {
+            showWaitting()
+            let convert = KMConvertURLToPDF.shareInstance()
+            convert.fileName = fileName ?? ""
+            convert.convertUrl(toPDF: [url], toPath: kUrlToPDFFolderPath, pageSize: pageSize, gap: gap, progress: { value in
+                // Progress update
+            }, completionHandler: { successArray, failArray in
+                self.hideWaitting()
+                if failArray.isEmpty {
+                    if let filePath = successArray.first as? String, FileManager.default.fileExists(atPath: filePath) {
+                        self.filePath = filePath
+                        NSApp.endSheet(self.window!, returnCode: sender.tag)
+                        self.window?.orderOut(self)
+                    }
+                } else {
+                    let alert = NSAlert()
+                    alert.alertStyle = .critical
+                    alert.informativeText = NSLocalizedString("Conversion Failed", comment: "")
+                    alert.messageText = ""
+                    alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
+                    alert.runModal()
+                }
+            })
+        }
+    }
+
+    @IBAction func buttonItemClick_Add(_ sender: Any) {
+        urlBtn.state = .off
+        localHtmlBtn.state = .on
+        urlTextField.isEditable = false
+        urlTextField.stringValue = ""
+        btnConvert.isEnabled = false
+
+        let panel = NSOpenPanel()
+        panel.canChooseFiles = true
+        panel.canChooseDirectories = false
+        panel.allowsMultipleSelection = false
+        panel.allowedFileTypes = ["HTML", "html", "webarchive", "htm"]
+        panel.beginSheetModal(for: window!) { response in
+            if response == .OK {
+                self.outputText.stringValue = panel.url?.path ?? ""
+                self.btnConvert.isEnabled = true
+            }
+        }
+    }
+
+    @IBAction func buttonItemClick_ChangeType(_ sender: NSButton) {
+        if urlBtn.state == .on {
+            urlTextField.isEditable = true
+            urlTextField.becomeFirstResponder()
+            outputText.stringValue = ""
+            outputButton.isEnabled = false
+
+            if urlTextField.stringValue.count > 0 {
+                btnConvert.isEnabled = true
+            } else {
+                btnConvert.isEnabled = false
+            }
+        } else {
+            urlTextField.isEditable = false
+            urlTextField.stringValue = ""
+            outputButton.isEnabled = true
+
+            if outputText.stringValue.count > 0 {
+                btnConvert.isEnabled = true
+            } else {
+                btnConvert.isEnabled = false
+            }
+        }
+    }
+
+    @IBAction func comboBoxItemClick_PageSize(_ sender: NSComboBox) {
+        switch sender.indexOfSelectedItem {
+        case 0:
+            pageSize = CGSizeMake(298, 420)
+        case 1:
+            pageSize = CGSize(width: 4760, height: 6736)
+        case 2:
+            pageSize = CGSize(width: 3368, height: 4760)
+        case 3:
+            pageSize = CGSize(width: 2380, height: 3368)
+        case 4:
+            pageSize = CGSize(width: 1684, height: 2380)
+        case 5:
+            pageSize = CGSize(width: 1190, height: 1684)
+        case 6:
+            pageSize = CGSize(width: 842, height: 1190)
+        case 7:
+            pageSize = CGSize(width: 595, height: 842)
+        case 8:
+            pageSize = CGSize(width: 420, height: 595)
+        case 9:
+            pageSize = CGSize(width: 297, height: 420)
+        default:
+            pageSize = CGSize(width: 210, height: 297)
+        }
+        
+        if sender.indexOfSelectedItem != 0 {
+            pagesGapStepper.stringValue = "0"
+            pageGapTextField.stringValue = "0"
+            pageGapTextField.isEnabled = true
+            pagesGapStepper.isEnabled = true
+        } else {
+            pagesGapStepper.stringValue = "0"
+            pageGapTextField.stringValue = ""
+            pageGapTextField.isEnabled = false
+            pagesGapStepper.isEnabled = false
+        }
+    }
+
+    @IBAction func stepperItemClick_Gap(_ sender: NSStepper) {
+        let unitScale: CGFloat = (595.0 / 21.0) * 2.54
+        pageGapTextField.stringValue = String(format: "%.2f", pagesGapStepper.floatValue)
+        gap = formatFloat(pagesGapStepper.floatValue * Float(unitScale)).stringToCGFloat()
+    }
+
+    func controlTextDidEndEditing(_ obj: Notification) {
+        if let object = obj.object as? NSTextField, object == pageGapTextField {
+            let unitScale: CGFloat = (595.0 / 21.0) * 2.54
+            if object.stringValue.stringToCGFloat() <= 0 {
+                pageGapTextField.stringValue = "0"
+            } else if object.stringValue.stringToCGFloat() * unitScale > pageSize.width / 2 {
+                let maxF = pageSize.width / (object.stringValue.stringToCGFloat() * 2)
+                pageGapTextField.stringValue = "\(maxF)"
+            }
+            gap = formatFloat(Float(object.stringValue.stringToCGFloat() * unitScale)).stringToCGFloat()
+            pagesGapStepper.floatValue = Float(object.stringValue.stringToCGFloat())
+        }
+    }
+
+    func controlTextDidChange(_ notification: Notification) {
+        if urlBtn.state == .on {
+            if urlTextField.stringValue.count > 0 {
+                btnConvert.isEnabled = true
+            } else {
+                btnConvert.isEnabled = false
+            }
+        } else {
+            if outputText.stringValue.count > 0 {
+                btnConvert.isEnabled = true
+            } else {
+                btnConvert.isEnabled = false
+            }
+        }
+    }
+
+    func formatFloat(_ f: Float) -> String {
+        if f.truncatingRemainder(dividingBy: 1) == 0 {
+            return String(format: "%.0f", f)
+        } else if (f * 10).truncatingRemainder(dividingBy: 1) == 0 {
+            return String(format: "%.1f", f)
+        } else {
+            return String(format: "%.2f", f)
+        }
+    }
+
+    func showWaitting() {
+//        if posterMaskView == nil {
+//            posterMaskView = KMBookletMaskView(frame: NSMakeRect(0, 0, window?.frame.size.width ?? 0, window?.frame.size.height ?? 0))
+//        }
+//        window?.contentView?.addSubview(posterMaskView!)
+    }
+
+    func hideWaitting() {
+//        /*posterMaskView*/?.removeFromSuperview()
+    }
+}

+ 267 - 0
PDF Office/PDF Master/Class/Home/WindowController/KMURLToPDFWindowController/KMURLToPDFWindowController.xib

@@ -0,0 +1,267 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22155" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22155"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner" customClass="KMURLToPDFWindowController" customModule="PDF_Master" customModuleProvider="target">
+            <connections>
+                <outlet property="btnCancel" destination="RBm-Bc-rao" id="CGU-CY-d09"/>
+                <outlet property="btnConvert" destination="pGf-Iz-7zg" id="Nb0-CU-xQo"/>
+                <outlet property="localHtmlBtn" destination="lzo-55-xro" id="e1j-Mi-NAV"/>
+                <outlet property="outputBackView" destination="9as-I6-zpb" id="Mmf-50-4LV"/>
+                <outlet property="outputButton" destination="ivv-Jx-DtL" id="0rk-2K-u4y"/>
+                <outlet property="outputText" destination="CHD-gL-zXA" id="edK-6C-Ybt"/>
+                <outlet property="pageGapLabel" destination="Nyc-8R-qOb" id="zyg-eC-M2l"/>
+                <outlet property="pageGapTextField" destination="Cp6-0C-kLI" id="Rzi-4u-Cax"/>
+                <outlet property="pageSizeComboBox" destination="V7a-Ei-Dbd" id="U3R-we-Xjb"/>
+                <outlet property="pageSizeLabel" destination="cM6-kD-ec2" id="v27-jQ-Ew3"/>
+                <outlet property="pageViewLabel" destination="TbI-Vb-tNK" id="vpM-YB-QdK"/>
+                <outlet property="pagesGapStepper" destination="Edm-Zn-7sR" id="sQu-yk-Dzg"/>
+                <outlet property="urlBtn" destination="KNR-nf-HXd" id="qyj-SH-t5V"/>
+                <outlet property="urlTextField" destination="Z7f-fU-KFb" id="ElL-Vc-y7C"/>
+                <outlet property="window" destination="F0z-JX-Cv5" id="gIp-Ho-8D9"/>
+            </connections>
+        </customObject>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="F0z-JX-Cv5">
+            <windowStyleMask key="styleMask" titled="YES"/>
+            <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
+            <rect key="contentRect" x="196" y="240" width="948" height="493"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="2560" height="1415"/>
+            <view key="contentView" id="se5-gp-TjO">
+                <rect key="frame" x="0.0" y="0.0" width="948" height="281"/>
+                <autoresizingMask key="autoresizingMask"/>
+                <subviews>
+                    <view wantsLayer="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Tqy-vm-qC1">
+                        <rect key="frame" x="0.0" y="0.0" width="948" height="281"/>
+                        <subviews>
+                            <textField focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Z7f-fU-KFb">
+                                <rect key="frame" x="40" y="213" width="888" height="22"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="22" id="Rad-lJ-oiP"/>
+                                </constraints>
+                                <textFieldCell key="cell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="20f-Fu-B8e">
+                                    <font key="font" metaFont="system"/>
+                                    <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                                    <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                </textFieldCell>
+                            </textField>
+                            <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="pGf-Iz-7zg">
+                                <rect key="frame" x="825" y="13" width="110" height="32"/>
+                                <buttonCell key="cell" type="push" title="Save as PDF" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="AQ2-ge-gzy">
+                                    <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                    <font key="font" metaFont="system"/>
+                                    <string key="keyEquivalent" base64-UTF8="YES">
+Gw
+</string>
+                                </buttonCell>
+                                <connections>
+                                    <action selector="buttonItemClicked_Start:" target="-2" id="jzQ-rL-KD3"/>
+                                </connections>
+                            </button>
+                            <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="RBm-Bc-rao">
+                                <rect key="frame" x="743" y="13" width="76" height="32"/>
+                                <buttonCell key="cell" type="push" title="Cancel" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="JTu-XM-0VY">
+                                    <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                    <font key="font" metaFont="system"/>
+                                    <string key="keyEquivalent" base64-UTF8="YES">
+Gw
+</string>
+                                </buttonCell>
+                                <connections>
+                                    <action selector="buttonItemClicked_Cancel:" target="-2" id="Ekg-td-PxQ"/>
+                                </connections>
+                            </button>
+                            <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="KNR-nf-HXd">
+                                <rect key="frame" x="18" y="244" width="56" height="18"/>
+                                <buttonCell key="cell" type="radio" title="URL:" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="Uh4-mi-pjX">
+                                    <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
+                                    <font key="font" metaFont="system"/>
+                                </buttonCell>
+                                <connections>
+                                    <action selector="buttonItemClick_ChangeType:" target="-2" id="hxH-7L-y56"/>
+                                </connections>
+                            </button>
+                            <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="lzo-55-xro">
+                                <rect key="frame" x="18" y="186" width="138" height="18"/>
+                                <buttonCell key="cell" type="radio" title="Import local HTML" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="x5D-4h-UO1">
+                                    <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
+                                    <font key="font" metaFont="system"/>
+                                </buttonCell>
+                                <connections>
+                                    <action selector="buttonItemClick_ChangeType:" target="-2" id="EqF-Oe-XMb"/>
+                                </connections>
+                            </button>
+                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="9as-I6-zpb">
+                                <rect key="frame" x="40" y="155" width="816" height="22"/>
+                                <subviews>
+                                    <textField focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="CHD-gL-zXA">
+                                        <rect key="frame" x="0.0" y="0.0" width="816" height="20"/>
+                                        <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" drawsBackground="YES" id="aIt-sK-xvj">
+                                            <font key="font" metaFont="system"/>
+                                            <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                                            <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                        </textFieldCell>
+                                    </textField>
+                                </subviews>
+                                <constraints>
+                                    <constraint firstItem="CHD-gL-zXA" firstAttribute="top" secondItem="9as-I6-zpb" secondAttribute="top" constant="2" id="7Pi-jK-Drl"/>
+                                    <constraint firstAttribute="trailing" secondItem="CHD-gL-zXA" secondAttribute="trailing" id="COJ-1W-O6s"/>
+                                    <constraint firstAttribute="bottom" secondItem="CHD-gL-zXA" secondAttribute="bottom" id="VhB-vk-x3G"/>
+                                    <constraint firstAttribute="height" constant="22" id="X4h-8U-bgj"/>
+                                    <constraint firstItem="CHD-gL-zXA" firstAttribute="leading" secondItem="9as-I6-zpb" secondAttribute="leading" id="zi9-JF-Tqh"/>
+                                </constraints>
+                            </customView>
+                            <box boxType="custom" borderType="none" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="z2n-2N-gFR">
+                                <rect key="frame" x="20" y="60" width="908" height="75"/>
+                                <view key="contentView" id="5yg-ty-rMO">
+                                    <rect key="frame" x="0.0" y="0.0" width="908" height="75"/>
+                                    <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                    <subviews>
+                                        <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="TbI-Vb-tNK">
+                                            <rect key="frame" x="-2" y="59" width="67" height="16"/>
+                                            <textFieldCell key="cell" lineBreakMode="clipping" title="Page View" id="7ZZ-G7-Qyf">
+                                                <font key="font" usesAppearanceFont="YES"/>
+                                                <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                            </textFieldCell>
+                                        </textField>
+                                        <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="cM6-kD-ec2">
+                                            <rect key="frame" x="18" y="33" width="70" height="16"/>
+                                            <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Page Size:" id="XDg-YE-dH8">
+                                                <font key="font" metaFont="system"/>
+                                                <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                                            </textFieldCell>
+                                        </textField>
+                                        <comboBox focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="V7a-Ei-Dbd">
+                                            <rect key="frame" x="90" y="29" width="204" height="23"/>
+                                            <constraints>
+                                                <constraint firstAttribute="width" constant="200" id="TL9-WY-EbM"/>
+                                            </constraints>
+                                            <comboBoxCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" drawsBackground="YES" completes="NO" numberOfVisibleItems="5" id="xhz-r8-sXZ">
+                                                <font key="font" metaFont="system"/>
+                                                <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                                                <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                            </comboBoxCell>
+                                            <connections>
+                                                <action selector="comboBoxItemClick_PageSize:" target="-2" id="Wba-5w-30o"/>
+                                            </connections>
+                                        </comboBox>
+                                        <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Nyc-8R-qOb">
+                                            <rect key="frame" x="18" y="3" width="33" height="16"/>
+                                            <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Gap:" id="sQu-Ai-Hwl">
+                                                <font key="font" metaFont="system"/>
+                                                <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                                            </textFieldCell>
+                                        </textField>
+                                        <textField focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Cp6-0C-kLI">
+                                            <rect key="frame" x="54" y="0.0" width="50" height="21"/>
+                                            <constraints>
+                                                <constraint firstAttribute="width" constant="50" id="GON-5g-8vI"/>
+                                            </constraints>
+                                            <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" title="0" drawsBackground="YES" id="m1c-rH-6T7">
+                                                <font key="font" metaFont="system"/>
+                                                <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                                                <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                            </textFieldCell>
+                                        </textField>
+                                        <stepper horizontalHuggingPriority="750" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Edm-Zn-7sR">
+                                            <rect key="frame" x="101" y="-3" width="19" height="28"/>
+                                            <stepperCell key="cell" continuous="YES" alignment="left" increment="0.10000000000000001" maxValue="1000" doubleValue="1" id="QiQ-Ii-MfL"/>
+                                            <connections>
+                                                <action selector="stepperItemClick_Gap:" target="-2" id="GR6-UD-lfI"/>
+                                            </connections>
+                                        </stepper>
+                                        <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ZPM-dH-KQV">
+                                            <rect key="frame" x="115" y="3" width="27" height="16"/>
+                                            <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="mm" id="WiA-nn-tTh">
+                                                <font key="font" metaFont="system"/>
+                                                <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                                            </textFieldCell>
+                                        </textField>
+                                        <textField hidden="YES" focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="iTC-o3-i7q">
+                                            <rect key="frame" x="291" y="33" width="27" height="16"/>
+                                            <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="mm" id="qbG-7z-daY">
+                                                <font key="font" metaFont="system"/>
+                                                <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                                            </textFieldCell>
+                                        </textField>
+                                    </subviews>
+                                    <constraints>
+                                        <constraint firstItem="Edm-Zn-7sR" firstAttribute="leading" secondItem="Cp6-0C-kLI" secondAttribute="trailing" id="2Wo-Qn-RJh"/>
+                                        <constraint firstItem="ZPM-dH-KQV" firstAttribute="centerY" secondItem="Edm-Zn-7sR" secondAttribute="centerY" id="8QG-Mm-Dbb"/>
+                                        <constraint firstItem="Cp6-0C-kLI" firstAttribute="top" secondItem="V7a-Ei-Dbd" secondAttribute="bottom" constant="10" id="NCg-jP-sYb"/>
+                                        <constraint firstItem="cM6-kD-ec2" firstAttribute="leading" secondItem="5yg-ty-rMO" secondAttribute="leading" constant="20" id="Osg-sR-i6i"/>
+                                        <constraint firstItem="ZPM-dH-KQV" firstAttribute="leading" secondItem="Edm-Zn-7sR" secondAttribute="trailing" id="PPa-j2-KjQ"/>
+                                        <constraint firstItem="Edm-Zn-7sR" firstAttribute="centerY" secondItem="Cp6-0C-kLI" secondAttribute="centerY" id="Pa2-ov-nW6"/>
+                                        <constraint firstItem="iTC-o3-i7q" firstAttribute="centerY" secondItem="V7a-Ei-Dbd" secondAttribute="centerY" id="Tdl-fu-mF5"/>
+                                        <constraint firstItem="Cp6-0C-kLI" firstAttribute="centerY" secondItem="Nyc-8R-qOb" secondAttribute="centerY" id="Tpg-r5-UBH"/>
+                                        <constraint firstItem="V7a-Ei-Dbd" firstAttribute="centerY" secondItem="cM6-kD-ec2" secondAttribute="centerY" id="UYn-yI-LJg"/>
+                                        <constraint firstItem="TbI-Vb-tNK" firstAttribute="leading" secondItem="5yg-ty-rMO" secondAttribute="leading" id="Wi2-ze-8Al"/>
+                                        <constraint firstItem="cM6-kD-ec2" firstAttribute="top" secondItem="TbI-Vb-tNK" secondAttribute="bottom" constant="10" id="Wp9-Gu-QJV"/>
+                                        <constraint firstAttribute="bottom" secondItem="Cp6-0C-kLI" secondAttribute="bottom" id="X4S-8z-pF3"/>
+                                        <constraint firstItem="TbI-Vb-tNK" firstAttribute="top" secondItem="5yg-ty-rMO" secondAttribute="top" id="eFA-6x-8au"/>
+                                        <constraint firstItem="V7a-Ei-Dbd" firstAttribute="leading" secondItem="cM6-kD-ec2" secondAttribute="trailing" constant="5" id="eij-ab-n3f"/>
+                                        <constraint firstItem="iTC-o3-i7q" firstAttribute="leading" secondItem="V7a-Ei-Dbd" secondAttribute="trailing" constant="2" id="faz-MU-vRg"/>
+                                        <constraint firstItem="Cp6-0C-kLI" firstAttribute="leading" secondItem="Nyc-8R-qOb" secondAttribute="trailing" constant="5" id="iYZ-Eb-YPH"/>
+                                        <constraint firstItem="Nyc-8R-qOb" firstAttribute="leading" secondItem="5yg-ty-rMO" secondAttribute="leading" constant="20" id="xrC-uW-cDU"/>
+                                    </constraints>
+                                </view>
+                            </box>
+                            <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ivv-Jx-DtL">
+                                <rect key="frame" x="860" y="149" width="75" height="32"/>
+                                <buttonCell key="cell" type="push" title="Button" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="AML-js-IGv">
+                                    <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                    <font key="font" metaFont="system"/>
+                                </buttonCell>
+                                <connections>
+                                    <action selector="buttonItemClick_Add:" target="-2" id="c57-gn-vvz"/>
+                                </connections>
+                            </button>
+                        </subviews>
+                        <constraints>
+                            <constraint firstItem="KNR-nf-HXd" firstAttribute="top" secondItem="Tqy-vm-qC1" secondAttribute="top" constant="20" id="5j8-mt-tR1"/>
+                            <constraint firstItem="pGf-Iz-7zg" firstAttribute="centerY" secondItem="RBm-Bc-rao" secondAttribute="centerY" id="6lh-IN-JF6"/>
+                            <constraint firstItem="RBm-Bc-rao" firstAttribute="top" secondItem="z2n-2N-gFR" secondAttribute="bottom" constant="20" id="Bc9-v5-rty"/>
+                            <constraint firstItem="lzo-55-xro" firstAttribute="leading" secondItem="KNR-nf-HXd" secondAttribute="leading" id="BhK-R9-jeB"/>
+                            <constraint firstItem="ivv-Jx-DtL" firstAttribute="leading" secondItem="9as-I6-zpb" secondAttribute="trailing" constant="11" id="DRG-3o-0aZ"/>
+                            <constraint firstItem="z2n-2N-gFR" firstAttribute="top" secondItem="9as-I6-zpb" secondAttribute="bottom" constant="20" id="F1R-3w-84l"/>
+                            <constraint firstAttribute="trailing" secondItem="pGf-Iz-7zg" secondAttribute="trailing" constant="20" id="GVv-1D-s2a"/>
+                            <constraint firstItem="ivv-Jx-DtL" firstAttribute="centerY" secondItem="9as-I6-zpb" secondAttribute="centerY" id="IkZ-iF-gDn"/>
+                            <constraint firstItem="KNR-nf-HXd" firstAttribute="leading" secondItem="Tqy-vm-qC1" secondAttribute="leading" constant="20" id="KMH-n4-5WN"/>
+                            <constraint firstItem="Z7f-fU-KFb" firstAttribute="top" secondItem="KNR-nf-HXd" secondAttribute="bottom" constant="10" id="PdE-kI-gEE"/>
+                            <constraint firstItem="9as-I6-zpb" firstAttribute="leading" secondItem="Z7f-fU-KFb" secondAttribute="leading" id="Q2h-wB-8mx"/>
+                            <constraint firstItem="Z7f-fU-KFb" firstAttribute="leading" secondItem="Tqy-vm-qC1" secondAttribute="leading" constant="40" id="R62-8t-Hpm"/>
+                            <constraint firstItem="ivv-Jx-DtL" firstAttribute="trailing" secondItem="Z7f-fU-KFb" secondAttribute="trailing" id="ZPM-gn-CJZ"/>
+                            <constraint firstAttribute="trailing" secondItem="z2n-2N-gFR" secondAttribute="trailing" constant="20" id="Zg6-3l-bpT"/>
+                            <constraint firstAttribute="trailing" secondItem="Z7f-fU-KFb" secondAttribute="trailing" constant="20" id="dh4-4n-dZu"/>
+                            <constraint firstItem="pGf-Iz-7zg" firstAttribute="leading" secondItem="RBm-Bc-rao" secondAttribute="trailing" constant="20" id="hO6-Wy-1M5"/>
+                            <constraint firstItem="z2n-2N-gFR" firstAttribute="leading" secondItem="KNR-nf-HXd" secondAttribute="leading" id="jmG-cD-2jb"/>
+                            <constraint firstItem="9as-I6-zpb" firstAttribute="top" secondItem="lzo-55-xro" secondAttribute="bottom" constant="10" id="oOE-ND-STd"/>
+                            <constraint firstItem="lzo-55-xro" firstAttribute="top" secondItem="Z7f-fU-KFb" secondAttribute="bottom" constant="10" id="tQO-Sv-w71"/>
+                            <constraint firstAttribute="bottom" secondItem="pGf-Iz-7zg" secondAttribute="bottom" constant="20" id="xDy-1h-dx9"/>
+                        </constraints>
+                    </view>
+                </subviews>
+                <constraints>
+                    <constraint firstAttribute="bottom" secondItem="Tqy-vm-qC1" secondAttribute="bottom" id="FZb-2f-iKU"/>
+                    <constraint firstItem="Tqy-vm-qC1" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" id="HJs-Dc-n32"/>
+                    <constraint firstAttribute="trailing" secondItem="Tqy-vm-qC1" secondAttribute="trailing" id="Wkl-eP-uPd"/>
+                    <constraint firstItem="Tqy-vm-qC1" firstAttribute="top" secondItem="se5-gp-TjO" secondAttribute="top" id="zlA-8P-S9H"/>
+                </constraints>
+            </view>
+            <connections>
+                <outlet property="delegate" destination="-2" id="0bl-1N-AYu"/>
+            </connections>
+            <point key="canvasLocation" x="311" y="255.5"/>
+        </window>
+    </objects>
+</document>

+ 27 - 0
PDF Office/PDF Master/Class/Home/WindowController/KMURLToPDFWindowController/Model/KMConvertURLToPDF.h

@@ -0,0 +1,27 @@
+//
+//  KMConvertURLToPDF.h
+//  PDF Reader
+//
+//  Created by 丁林圭 on 2019/3/11.
+//  Copyright © 2019年 Kdan Mobile. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface KMConvertURLToPDF : NSObject
+
+@property (nonatomic,retain) NSString * fileName;
+
++ (KMConvertURLToPDF *)shareInstance;
+
+- (void)convertUrlToPDF:(NSArray <NSURL *>*)urls
+                  toPath:(NSString *)toPath
+                  pageSize:(CGSize)pageSize
+                  gap:(CGFloat)gap
+                progress:(void (^)(CGFloat value))progress
+       completionHandler:(void (^) (NSArray *successArray,NSArray *failArray))handler;
+@end
+
+NS_ASSUME_NONNULL_END

+ 228 - 0
PDF Office/PDF Master/Class/Home/WindowController/KMURLToPDFWindowController/Model/KMConvertURLToPDF.m

@@ -0,0 +1,228 @@
+//
+//  KMConvertURLToPDF.m
+//  PDF Reader
+//
+//  Created by 丁林圭 on 2019/3/11.
+//  Copyright © 2019年 Kdan Mobile. All rights reserved.
+//
+
+#import "KMConvertURLToPDF.h"
+#import <WebKit/WebKit.h>
+#import <Quartz/Quartz.h>
+
+@interface KMConvertURLToPDF () <WebFrameLoadDelegate,WebResourceLoadDelegate>{
+    BOOL isProgressing;
+}
+
+@property (nonatomic,retain) NSString *savePath;
+@property (nonatomic,assign) NSInteger pageIndex;
+@property (nonatomic,retain) NSMutableArray * urls;
+@property (nonatomic,retain) NSMutableArray * failArray;
+@property (nonatomic,retain) NSMutableArray * successArray;
+@property (nonatomic,assign) CGSize pageSize;
+@property (nonatomic,assign) CGFloat gap;
+
+@property (nonatomic,retain) WebView *webView;
+
+@property (nonatomic,copy) void (^progress)(CGFloat value);
+@property (nonatomic,copy) void (^handler)(NSArray *successArray,NSArray *failArray);
+
+@end
+
+@implementation KMConvertURLToPDF
+
+
+-(void)dealloc {
+
+}
+
++ (KMConvertURLToPDF *)shareInstance
+{
+    static KMConvertURLToPDF *sharedConvertUrlToPDF = nil;
+    static dispatch_once_t predicate;
+    dispatch_once(&predicate, ^{
+        sharedConvertUrlToPDF = [[KMConvertURLToPDF alloc] init];
+    });
+    return sharedConvertUrlToPDF;
+}
+
+
+- (void)convertUrlToPDF:(NSArray <NSURL *>*)urls
+                 toPath:(NSString *)toPath
+               pageSize:(CGSize)pageSize
+                    gap:(CGFloat)gap
+               progress:(void (^)(CGFloat value))progress
+      completionHandler:(void (^) (NSArray *successArray,NSArray *failArray))handler
+{
+    self.urls = [NSMutableArray arrayWithArray:urls];
+    self.failArray = [NSMutableArray array];
+    self.successArray = [NSMutableArray array];
+    self.savePath = toPath;
+    self.progress = progress;
+    self.pageSize = pageSize;
+    self.gap = gap;
+    self.handler = handler;
+    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+        self.pageIndex = 0;
+        dispatch_async(dispatch_get_main_queue(), ^{
+            [self convertFileAtPageIndex:self.pageIndex];
+        });
+    });
+}
+
+- (void)convertFileAtPageIndex:(NSInteger)pageIndex
+{
+    if (pageIndex >= self.urls.count) {
+        
+        if (self.handler) {
+            self.handler (self.successArray,self.failArray);
+            self.handler = nil;
+        }
+        return;
+    }
+    
+    NSURL *url = self.urls[pageIndex];
+    
+    if ([url.pathExtension.lowercaseString isEqualToString:@"pdf"]) {
+        NSData *urlData = [NSData dataWithContentsOfURL:url];
+        NSString *name = [NSString stringWithFormat:@"webpage%ld",self.pageIndex];
+        NSString *savePath = [self.savePath  stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.pdf",self.fileName?:name]];
+        
+        if ([urlData writeToFile:savePath atomically:YES]) {
+            [self.successArray addObject:savePath];
+            if (self.pageIndex + 1 >= self.urls.count) {
+                if (self.handler) {
+                    self.handler (self.successArray,self.failArray);
+                    self.handler= nil;
+                }
+            } else {
+                [self convertFileAtPageIndex:++self.pageIndex];
+                
+            }
+        } else {
+            [self.failArray addObject:self.urls[self.pageIndex]];
+            if (self.handler) {
+                self.handler (self.successArray,self.failArray);
+                self.handler= nil;
+            }
+        }
+    } else {
+       
+        if (!self.webView) {
+            _webView = [[WebView alloc] initWithFrame:NSMakeRect(0, 0, 400, 400)];
+            WebPreferences *webPrefs = [[WebPreferences alloc] init];
+            [webPrefs setShouldPrintBackgrounds:YES];
+            [self.webView setPreferences:webPrefs];
+            [self.webView setFrameLoadDelegate:self];
+            [self.webView setResourceLoadDelegate:self];
+        }
+        [[self.webView mainFrame] loadRequest:[NSURLRequest requestWithURL:url]];
+    }
+
+    if (pageIndex != 0 && self.progress) {
+        self.progress((float)self.pageIndex/self.urls.count);
+    }
+}
+
+- (void)convertWebViewFrame:(WebFrame *)frame
+{
+    if (isProgressing) {
+        return;
+    }
+    isProgressing = YES;
+    
+    NSString *name = [NSString stringWithFormat:@"webpage%ld",self.pageIndex];
+    if (self.fileName.length != 0) {
+        name = self.fileName;
+    }
+    NSString *savePath = [self.savePath  stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.pdf",name]];
+    CGFloat margin = self.gap;
+    NSSize paperSize = self.pageSize;
+    WebFrameView *frameView = [frame frameView];
+    NSPrintInfo *sharedInfo = [NSPrintInfo sharedPrintInfo];
+    NSMutableDictionary *printInfoDict = [NSMutableDictionary dictionaryWithDictionary:[sharedInfo dictionary]];
+    [printInfoDict setObject:NSPrintSaveJob forKey:NSPrintJobDisposition];
+    [printInfoDict setObject:[NSURL fileURLWithPath:savePath] forKey:NSPrintJobSavingURL];
+    
+    NSPrintInfo *printInfo = [[NSPrintInfo alloc] initWithDictionary:printInfoDict];
+    [printInfo setHorizontalPagination:NSPrintingPaginationModeAutomatic];
+    [printInfo setVerticalPagination:NSPrintingPaginationModeAutomatic];
+    [printInfo setVerticallyCentered:NO];
+    if (!CGSizeEqualToSize(paperSize, CGSizeZero)) {
+        [printInfo setBottomMargin:margin];
+        [printInfo setTopMargin:margin];
+        [printInfo setLeftMargin:margin];
+        [printInfo setRightMargin:margin];
+        [printInfo setPaperSize:paperSize];
+    }
+    [printInfo setOrientation:NSPaperOrientationPortrait];
+    
+    NSPrintOperation *printOp = [frameView printOperationWithPrintInfo:printInfo];
+    [printOp setShowsPrintPanel:NO];
+    [printOp setShowsProgressPanel:NO];
+    
+    if ([printOp runOperation]) {
+        [self.successArray addObject:savePath];
+        
+        if (self.pageIndex + 1 >= self.urls.count) {
+            if (self.handler) {
+                self.handler (self.successArray,self.failArray);
+                self.handler= nil;
+            }
+        } else {
+            [self convertFileAtPageIndex:++self.pageIndex];
+        }
+    } else {
+        [self.failArray addObject:self.urls[self.pageIndex]];
+        if (self.handler) {
+            self.handler (self.successArray,self.failArray);
+            self.handler= nil;
+        }
+    }
+}
+
+#pragma mark - WebView Delegate Methods
+
+- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame {
+    if (frame == [sender mainFrame]) {
+        NSString *htmlTitle = @"document.title";
+        
+        if (!self.fileName) {
+            self.fileName = [sender stringByEvaluatingJavaScriptFromString:htmlTitle];
+            
+            if ([self.fileName length] < 1) {
+                self.fileName = sender.mainFrameTitle;
+            }
+            
+            if ([self.fileName length] < 1) {
+                self.fileName = @"Untitled";
+            }
+        }
+        
+        [self performSelector:@selector(convertWebViewFrame:) withObject:frame afterDelay:0.3];
+    }
+}
+
+- (void)webView:(WebView *)sender didFailLoadWithError:(NSError *)error forFrame:(WebFrame *)frame
+{
+    if([error code] == NSURLErrorCancelled)  {
+      return;
+    }
+
+    [self.failArray addObject:self.urls[self.pageIndex]];
+    if (self.handler) {
+        self.handler (self.successArray,self.failArray);
+        self.handler= nil;
+    }
+}
+
+- (void)webView:(WebView *)sender didFailProvisionalLoadWithError:(NSError *)error forFrame:(WebFrame *)frame
+{
+    [self.failArray addObject:self.urls[self.pageIndex]];
+    if (self.handler) {
+        self.handler (self.successArray,self.failArray);
+        self.handler= nil;
+    }
+}
+
+@end

+ 43 - 0
PDF Office/PDF Master/Class/KMAdvertisement/Cache/KMAdvertisementCache.swift

@@ -0,0 +1,43 @@
+//
+//  KMAdvertisementCache.swift
+//  KMAdvertisement
+//
+//  Created by lizhe on 2022/11/25.
+//
+
+class KMAdvertisementCache: NSObject {
+    let kFilePath: NSString = NSTemporaryDirectory() + "Advertisement/advertisement.plist" as NSString
+    
+    //单例
+    public static let `default` = KMAdvertisementCache()
+    //存储
+    func saveData(data: [NSDictionary]) {
+        if (!FileManager.default.fileExists(atPath: kFilePath.deletingLastPathComponent as String)) {
+            try?FileManager.default.createDirectory(atPath: kFilePath.deletingLastPathComponent as String, withIntermediateDirectories: true, attributes: nil)
+        }
+        
+        if (!FileManager.default.fileExists(atPath: kFilePath as String)) {
+            FileManager.default.createFile(atPath: kFilePath as String, contents: nil);
+        }
+        
+        let saveData: NSArray = data as NSArray
+        let success = saveData.write(toFile: kFilePath.expandingTildeInPath as String, atomically: true)
+
+        if (success == true) {
+            print("成功 -" + (kFilePath.expandingTildeInPath as String))
+        } else {
+            print("失败 -" + (kFilePath.expandingTildeInPath as String))
+        }
+    }
+
+   //读取
+    func readData() -> [NSDictionary] {
+        print("数据地址 = " + (kFilePath.expandingTildeInPath as String))
+        let data =  NSArray.init(contentsOfFile: kFilePath.expandingTildeInPath as String)
+        if (data != nil) {
+            return data as! [NSDictionary]
+        } else {
+            return []
+        }
+    }
+}

+ 14 - 2
PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Headers/KMAdvertisementConfig.swift

@@ -99,20 +99,32 @@
     case zhTW //
 }
 
+//显示样式
+@objc public enum KMRecommondShowType: Int, Codable {
+    case unknow = 0
+    case URL = 1 //链接
+    case comparative = 2 //比价表
+}
+
 @objcMembers open class KMAdvertisementConfig: NSObject {
-    var appName: KMAdvertisementAppNameType = .FilmageEditorMac
+    var isDebug: Bool = false
+    var appName: KMAdvertisementAppNameType = .PDFReaderProMacPro
     var platform: KMAdvertisementPlatformType = .Mac
     public var subscribeType: KMAdvertisementSubscribeType = .unsubscribed
     public var language: KMAdvertisementLanguageType = .unknow
     
     func activityBaseURL() -> String {
-        if (KMAdvertisementManager.manager.debug) {
+        #if DEBUG
+        if (isDebug) {
             // 测试 服务器
             return "http://test-store.kdan.cn:3019"
         } else {
             //正式版 服务器
             return "https://store.filmagepro.com:3018"
         }
+        #else
+        return "https://store.filmagepro.com:3018"
+        #endif
     }
     
     public func initParameters(appName: KMAdvertisementAppNameType, subscribeType:KMAdvertisementSubscribeType, platform: KMAdvertisementPlatformType) {

+ 74 - 74
PDF Office/PDF Master/Class/KMAdvertisement/KMRecommondInfo.h

@@ -1,75 +1,75 @@
+////
+////  KMRecommondInfo.h
+////  PDF Reader Pro Edition
+////
+////  Created by Niehaoyu on 2023/4/11.
+////
 //
-//  KMRecommondInfo.h
-//  PDF Reader Pro Edition
-//
-//  Created by Niehaoyu on 2023/4/11.
-//
-
-#import <Foundation/Foundation.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-typedef enum : NSUInteger {
-    KMRecommondShowType_None,
-    KMRecommondShowType_All,//免费版跟付费版都需要显示
-    KMRecommondShowType_Pro,//只有付费用户显示
-    KMRecommondShowType_Lite,//只有免费用户显示
-} KMRecommondShowType;
-
-@class KMRecommondInfo;
-@interface KMRecommond : NSObject
-
-- (id)initWithDict:(NSDictionary *)dict;
-
-@property (nonatomic, strong) NSString *versionKey;
-
-@property (nonatomic, strong) NSString *name;
-
-@property (nonatomic, strong, readonly) NSMutableArray <KMRecommondInfo *> *recommondInfoArrM;
-
-@end
-
-@interface KMRecommondInfo : NSObject
-
-+ (NSString *)languageKey;
-+ (NSString *)cacheDirs;
-+ (BOOL)isDarkMode;
-
-- (id)initWithDict:(NSDictionary *)dict;
-
-- (void)updateValue:(NSString *)value forKey:(NSString *)key;
-
-@property (nonatomic, assign) BOOL show;//是否显示,内部有做了时间区间判断
-
-@property (nonatomic, assign) KMRecommondShowType showType;
-
-@property (nonatomic, strong) NSDate *startDate;
-
-@property (nonatomic, strong) NSDate *endDate;
-
-@property (nonatomic, strong) NSString *versionKey;//版本号,唯一标识符
-
-@property (nonatomic, assign) BOOL showCloseBtn;//是否显示关闭按钮,(左下角广告需要)
-
-@property (nonatomic, strong) NSImage *normalImage;//APP互推,常规状态下的图片
-
-@property (nonatomic, strong) NSImage *hoverImage;//APP互推悬浮状态下的图片
-
-@property (nonatomic, strong) NSImage *iconImage;//广告显示图片(自适应多语)
-
-@property (nonatomic, strong) NSString *title;//名称(自适应多语)
-
-@property (nonatomic, strong) NSString *tooltips;//提示语(自适应多语)
-
-@property (nonatomic, strong) NSString *linkURL;//跳转链接(自适应多语)
-
-//Firebase
-@property (nonatomic, strong) NSString *firebaseEvent;//
-
-@property (nonatomic, strong) NSString *firebasePropertyKey;//
-
-@property (nonatomic, strong) NSString *firebasePropertyValue;//
-
-@end
-
-NS_ASSUME_NONNULL_END
+//#import <Foundation/Foundation.h>
+//
+//NS_ASSUME_NONNULL_BEGIN
+//
+//typedef enum : NSUInteger {
+//    KMRecommondShowType_None,
+//    KMRecommondShowType_All,//免费版跟付费版都需要显示
+//    KMRecommondShowType_Pro,//只有付费用户显示
+//    KMRecommondShowType_Lite,//只有免费用户显示
+//} KMRecommondShowType;
+//
+//@class KMRecommondInfo;
+//@interface KMRecommond : NSObject
+//
+//- (id)initWithDict:(NSDictionary *)dict;
+//
+//@property (nonatomic, strong) NSString *versionKey;
+//
+//@property (nonatomic, strong) NSString *name;
+//
+//@property (nonatomic, strong, readonly) NSMutableArray <KMRecommondInfo *> *recommondInfoArrM;
+//
+//@end
+//
+//@interface KMRecommondInfo : NSObject
+//
+//+ (NSString *)languageKey;
+//+ (NSString *)cacheDirs;
+//+ (BOOL)isDarkMode;
+//
+//- (id)initWithDict:(NSDictionary *)dict;
+//
+//- (void)updateValue:(NSString *)value forKey:(NSString *)key;
+//
+//@property (nonatomic, assign) BOOL show;//是否显示,内部有做了时间区间判断
+//
+//@property (nonatomic, assign) KMRecommondShowType showType;
+//
+//@property (nonatomic, strong) NSDate *startDate;
+//
+//@property (nonatomic, strong) NSDate *endDate;
+//
+//@property (nonatomic, strong) NSString *versionKey;//版本号,唯一标识符
+//
+//@property (nonatomic, assign) BOOL showCloseBtn;//是否显示关闭按钮,(左下角广告需要)
+//
+//@property (nonatomic, strong) NSImage *normalImage;//APP互推,常规状态下的图片
+//
+//@property (nonatomic, strong) NSImage *hoverImage;//APP互推悬浮状态下的图片
+//
+//@property (nonatomic, strong) NSImage *iconImage;//广告显示图片(自适应多语)
+//
+//@property (nonatomic, strong) NSString *title;//名称(自适应多语)
+//
+//@property (nonatomic, strong) NSString *tooltips;//提示语(自适应多语)
+//
+//@property (nonatomic, strong) NSString *linkURL;//跳转链接(自适应多语)
+//
+////Firebase
+//@property (nonatomic, strong) NSString *firebaseEvent;//
+//
+//@property (nonatomic, strong) NSString *firebasePropertyKey;//
+//
+//@property (nonatomic, strong) NSString *firebasePropertyValue;//
+//
+//@end
+//
+//NS_ASSUME_NONNULL_END

+ 334 - 334
PDF Office/PDF Master/Class/KMAdvertisement/KMRecommondInfo.m

@@ -1,337 +1,337 @@
+////
+////  KMRecommondInfo.m
+////  PDF Reader Pro Edition
+////
+////  Created by Niehaoyu on 2023/4/11.
+////
 //
-//  KMRecommondInfo.m
-//  PDF Reader Pro Edition
-//
-//  Created by Niehaoyu on 2023/4/11.
-//
-
-#import "KMRecommondInfo.h"
-#import <Cocoa/Cocoa.h>
-
-@interface KMRecommond ()
-
-@property (nonatomic, strong, readwrite) NSMutableArray <KMRecommondInfo *> *recommondInfoArrM;
-
-@property (nonatomic, copy) NSDictionary *infoDict;
-
-@end
-
-@implementation KMRecommond
-
-- (id)init {
-    self = [super init];
-    if (self) {
-        self.recommondInfoArrM = [[NSMutableArray alloc] init];
-    }
-    return self;
-}
-
-- (id)initWithDict:(NSDictionary *)dict {
-    self = [super init];
-    if (self) {
-        self.infoDict = dict;
-        self.recommondInfoArrM = [[NSMutableArray alloc] init];
-        if (self.infoDict[@"content"]) {
-            for (NSDictionary *contentDict in self.infoDict[@"content"]) {
-                KMRecommondInfo *info = [[KMRecommondInfo alloc] initWithDict:contentDict];
-                [self.recommondInfoArrM addObject:info];
-            }
-        }
-    }
-    return self;
-}
-
-#pragma mark - Setter and Getter
-- (NSString *)versionKey {
-    if (!_versionKey) {
-        if (self.infoDict[@"version"]) {
-            _versionKey = self.infoDict[@"version"];
-        }
-    }
-    return _versionKey;
-}
-
-- (NSString *)name {
-    if (!_name) {
-        if (self.infoDict[@"name"]) {
-            NSDictionary *valueDict = self.infoDict[@"name"];
-            _name = [valueDict objectForKey:[KMRecommondInfo languageKey]];
-        }
-    }
-    return _name;
-}
-
-@end
-
-
-#pragma mark - KMRecommondInfo
-@interface KMRecommondInfo ()
-
-@property (nonatomic, copy) NSDictionary *infoDict;
-
-@end
-
-@implementation KMRecommondInfo
-
-+ (NSString *)languageKey {
-    NSString *language =  [[NSBundle mainBundle] preferredLocalizations][0];
-    if ([language isEqualToString:@"zh_CN"]) {
-        return @"zh_CN";
-    } else if ([language isEqualToString:@"zh_TW"]) {
-        return @"zh_TW";
-    }
-    return @"en";
-}
-
-+ (NSString *)cacheDirs {
-    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
-    NSString *cachesDir = [paths objectAtIndex:0];
-    
-    if ([[NSFileManager defaultManager] fileExistsAtPath:[cachesDir stringByAppendingPathComponent:[NSBundle mainBundle].bundleIdentifier]]) {
-        cachesDir = [cachesDir stringByAppendingPathComponent:[NSBundle mainBundle].bundleIdentifier];
-    }
-    cachesDir = [cachesDir stringByAppendingPathComponent:@"Advertisement/ImageCache"];
-    if (![[NSFileManager defaultManager] fileExistsAtPath:cachesDir]) {
-        [[NSFileManager defaultManager] createDirectoryAtPath:cachesDir withIntermediateDirectories:YES attributes:nil error:nil];
-    }
-    return cachesDir;
-}
-
-+ (BOOL)isDarkMode {
-    BOOL isDarkMode = NO;
-//    if (@available(macOS 10.14, *)) {
-//        NSAppearanceName appearanceName = [[NSApp effectiveAppearance] bestMatchFromAppearancesWithNames:@[NSAppearanceNameAqua, NSAppearanceNameDarkAqua]];
-//        if ([appearanceName isEqualToString:NSAppearanceNameDarkAqua]) {
-//            isDarkMode = YES;
+//#import "KMRecommondInfo.h"
+//#import <Cocoa/Cocoa.h>
+//
+//@interface KMRecommond ()
+//
+//@property (nonatomic, strong, readwrite) NSMutableArray <KMRecommondInfo *> *recommondInfoArrM;
+//
+//@property (nonatomic, copy) NSDictionary *infoDict;
+//
+//@end
+//
+//@implementation KMRecommond
+//
+//- (id)init {
+//    self = [super init];
+//    if (self) {
+//        self.recommondInfoArrM = [[NSMutableArray alloc] init];
+//    }
+//    return self;
+//}
+//
+//- (id)initWithDict:(NSDictionary *)dict {
+//    self = [super init];
+//    if (self) {
+//        self.infoDict = dict;
+//        self.recommondInfoArrM = [[NSMutableArray alloc] init];
+//        if (self.infoDict[@"content"]) {
+//            for (NSDictionary *contentDict in self.infoDict[@"content"]) {
+//                KMRecommondInfo *info = [[KMRecommondInfo alloc] initWithDict:contentDict];
+//                [self.recommondInfoArrM addObject:info];
+//            }
+//        }
+//    }
+//    return self;
+//}
+//
+//#pragma mark - Setter and Getter
+//- (NSString *)versionKey {
+//    if (!_versionKey) {
+//        if (self.infoDict[@"version"]) {
+//            _versionKey = self.infoDict[@"version"];
+//        }
+//    }
+//    return _versionKey;
+//}
+//
+//- (NSString *)name {
+//    if (!_name) {
+//        if (self.infoDict[@"name"]) {
+//            NSDictionary *valueDict = self.infoDict[@"name"];
+//            _name = [valueDict objectForKey:[KMRecommondInfo languageKey]];
+//        }
+//    }
+//    return _name;
+//}
+//
+//@end
+//
+//
+//#pragma mark - KMRecommondInfo
+//@interface KMRecommondInfo ()
+//
+//@property (nonatomic, copy) NSDictionary *infoDict;
+//
+//@end
+//
+//@implementation KMRecommondInfo
+//
+//+ (NSString *)languageKey {
+//    NSString *language =  [[NSBundle mainBundle] preferredLocalizations][0];
+//    if ([language isEqualToString:@"zh_CN"]) {
+//        return @"zh_CN";
+//    } else if ([language isEqualToString:@"zh_TW"]) {
+//        return @"zh_TW";
+//    }
+//    return @"en";
+//}
+//
+//+ (NSString *)cacheDirs {
+//    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
+//    NSString *cachesDir = [paths objectAtIndex:0];
+//    
+//    if ([[NSFileManager defaultManager] fileExistsAtPath:[cachesDir stringByAppendingPathComponent:[NSBundle mainBundle].bundleIdentifier]]) {
+//        cachesDir = [cachesDir stringByAppendingPathComponent:[NSBundle mainBundle].bundleIdentifier];
+//    }
+//    cachesDir = [cachesDir stringByAppendingPathComponent:@"Advertisement/ImageCache"];
+//    if (![[NSFileManager defaultManager] fileExistsAtPath:cachesDir]) {
+//        [[NSFileManager defaultManager] createDirectoryAtPath:cachesDir withIntermediateDirectories:YES attributes:nil error:nil];
+//    }
+//    return cachesDir;
+//}
+//
+//+ (BOOL)isDarkMode {
+//    BOOL isDarkMode = NO;
+////    if (@available(macOS 10.14, *)) {
+////        NSAppearanceName appearanceName = [[NSApp effectiveAppearance] bestMatchFromAppearancesWithNames:@[NSAppearanceNameAqua, NSAppearanceNameDarkAqua]];
+////        if ([appearanceName isEqualToString:NSAppearanceNameDarkAqua]) {
+////            isDarkMode = YES;
+////        }
+////    }
+//    return isDarkMode;
+//}
+//
+//- (id)initWithDict:(NSDictionary *)dict {
+//    self = [super init];
+//    if (self) {
+//        self.infoDict = dict;
+//    }
+//    return self;
+//}
+//
+//- (id)init {
+//    self = [super init];
+//    if (self) {
+//        
+//    }
+//    return self;
+//}
+//
+//- (BOOL)show {
+//    if ([self.infoDict[@"show"] boolValue]) {
+//        double startDateKey = [self.infoDict[@"startTime"] doubleValue];
+//        double endDateKey = [self.infoDict[@"endTime"] doubleValue];
+//        if (startDateKey > 1000000000) {
+//            startDateKey = startDateKey/1000;
+//        }
+//        if (endDateKey > 1000000000) {
+//            endDateKey = endDateKey/1000;
+//        }
+//        
+//        NSDate *startDate = [NSDate dateWithTimeIntervalSince1970:startDateKey];
+//        NSDate *endDate = [NSDate dateWithTimeIntervalSince1970:endDateKey];
+//
+//        if ([startDate compare:[NSDate date]] == NSOrderedAscending &&
+//            [endDate compare:[NSDate date]] == NSOrderedDescending) {
+//            return YES;
+//        };
+//    }
+//    return NO;
+//}
+//
+//- (KMRecommondShowType)showType {
+//    KMRecommondShowType type = KMRecommondShowType_None;
+//    if ([self.infoDict[@"subscriptionType"] isEqualToString:@"0"]) {
+//        type = KMRecommondShowType_All;
+//    } else if ([self.infoDict[@"subscriptionType"] isEqualToString:@"2"]) {
+//        type = KMRecommondShowType_Pro;
+//    } else if ([self.infoDict[@"subscriptionType"] isEqualToString:@"1"]) {
+//        type = KMRecommondShowType_Lite;
+//    }
+//    return type;
+//}
+//
+//- (NSDate *)startDate {
+//    if ([self.infoDict[@"endTime"] boolValue]) {
+//        double startDateKey = [self.infoDict[@"endTime"] doubleValue];
+//        if (startDateKey > 1000000000) {
+//            startDateKey = startDateKey/1000;
+//        }
+//        NSDate *startDate = [NSDate dateWithTimeIntervalSince1970:startDateKey];
+//        return startDate;
+//    }
+//    return nil;
+//}
+//
+//- (NSDate *)endDate {
+//    if ([self.infoDict[@"startTime"] boolValue]) {
+//        double startDateKey = [self.infoDict[@"startTime"] doubleValue];
+//        if (startDateKey > 1000000000) {
+//            startDateKey = startDateKey/1000;
 //        }
+//        NSDate *startDate = [NSDate dateWithTimeIntervalSince1970:startDateKey];
+//        return startDate;
+//    }
+//    return nil;
+//}
+//
+//- (NSString *)versionKey {
+//    if (self.infoDict[@"version"]) {
+//        return self.infoDict[@"version"];
+//    }
+//    return @"";
+//}
+//
+//- (BOOL)showCloseBtn {
+//    if ([self.infoDict[@"showCloseBtn"] boolValue]) {
+//        return YES;
+//    }
+//    return NO;
+//}
+//
+//- (NSString *)title {
+//    if (self.infoDict[@"name"]) {
+//        NSDictionary *valueDict = self.infoDict[@"name"];
+//        return [valueDict objectForKey:[KMRecommondInfo languageKey]]?:@"";
+//    }
+//    return @"";
+//}
+//
+//- (NSString *)tooltips {
+//    if (self.infoDict[@"tooltip"]) {
+//        NSDictionary *valueDict = self.infoDict[@"tooltip"];
+//        return [valueDict objectForKey:[KMRecommondInfo languageKey]]?:@"";
+//    }
+//    return @"";
+//}
+//
+//- (NSString *)linkURL {
+//    if (self.infoDict[@"linkURL"]) {
+//        NSDictionary *valueDict = self.infoDict[@"linkURL"];
+//        return [valueDict objectForKey:[KMRecommondInfo languageKey]]?:@"";
+//    }
+//    return @"";
+//}
+//
+//- (NSImage *)normalImage {
+//    NSString *imageName = [self versionKey]?:@"";
+//    if ([KMRecommondInfo isDarkMode]) {
+//        NSURL *url = [NSURL URLWithString:self.infoDict[@"image"][@"normal_Dark"]];
+//        imageName = [imageName stringByAppendingString:[NSString stringWithFormat:@"%@.%@",@"-normal_Dark",url.path.pathExtension]];
+//    } else {
+//        NSURL *url = [NSURL URLWithString:self.infoDict[@"image"][@"normal_Light"]];
+//        imageName = [imageName stringByAppendingString:[NSString stringWithFormat:@"%@.%@",@"-normal_Light",url.path.pathExtension]];
+//    }
+//    NSString *imgSavePath = [[KMRecommondInfo cacheDirs] stringByAppendingPathComponent:imageName];
+//    if ([[NSFileManager defaultManager] fileExistsAtPath:imgSavePath]) {
+//        return [[NSImage alloc] initWithContentsOfFile:imgSavePath];
 //    }
-    return isDarkMode;
-}
-
-- (id)initWithDict:(NSDictionary *)dict {
-    self = [super init];
-    if (self) {
-        self.infoDict = dict;
-    }
-    return self;
-}
-
-- (id)init {
-    self = [super init];
-    if (self) {
-        
-    }
-    return self;
-}
-
-- (BOOL)show {
-    if ([self.infoDict[@"show"] boolValue]) {
-        double startDateKey = [self.infoDict[@"startTime"] doubleValue];
-        double endDateKey = [self.infoDict[@"endTime"] doubleValue];
-        if (startDateKey > 1000000000) {
-            startDateKey = startDateKey/1000;
-        }
-        if (endDateKey > 1000000000) {
-            endDateKey = endDateKey/1000;
-        }
-        
-        NSDate *startDate = [NSDate dateWithTimeIntervalSince1970:startDateKey];
-        NSDate *endDate = [NSDate dateWithTimeIntervalSince1970:endDateKey];
-
-        if ([startDate compare:[NSDate date]] == NSOrderedAscending &&
-            [endDate compare:[NSDate date]] == NSOrderedDescending) {
-            return YES;
-        };
-    }
-    return NO;
-}
-
-- (KMRecommondShowType)showType {
-    KMRecommondShowType type = KMRecommondShowType_None;
-    if ([self.infoDict[@"subscriptionType"] isEqualToString:@"0"]) {
-        type = KMRecommondShowType_All;
-    } else if ([self.infoDict[@"subscriptionType"] isEqualToString:@"2"]) {
-        type = KMRecommondShowType_Pro;
-    } else if ([self.infoDict[@"subscriptionType"] isEqualToString:@"1"]) {
-        type = KMRecommondShowType_Lite;
-    }
-    return type;
-}
-
-- (NSDate *)startDate {
-    if ([self.infoDict[@"endTime"] boolValue]) {
-        double startDateKey = [self.infoDict[@"endTime"] doubleValue];
-        if (startDateKey > 1000000000) {
-            startDateKey = startDateKey/1000;
-        }
-        NSDate *startDate = [NSDate dateWithTimeIntervalSince1970:startDateKey];
-        return startDate;
-    }
-    return nil;
-}
-
-- (NSDate *)endDate {
-    if ([self.infoDict[@"startTime"] boolValue]) {
-        double startDateKey = [self.infoDict[@"startTime"] doubleValue];
-        if (startDateKey > 1000000000) {
-            startDateKey = startDateKey/1000;
-        }
-        NSDate *startDate = [NSDate dateWithTimeIntervalSince1970:startDateKey];
-        return startDate;
-    }
-    return nil;
-}
-
-- (NSString *)versionKey {
-    if (self.infoDict[@"version"]) {
-        return self.infoDict[@"version"];
-    }
-    return @"";
-}
-
-- (BOOL)showCloseBtn {
-    if ([self.infoDict[@"showCloseBtn"] boolValue]) {
-        return YES;
-    }
-    return NO;
-}
-
-- (NSString *)title {
-    if (self.infoDict[@"name"]) {
-        NSDictionary *valueDict = self.infoDict[@"name"];
-        return [valueDict objectForKey:[KMRecommondInfo languageKey]]?:@"";
-    }
-    return @"";
-}
-
-- (NSString *)tooltips {
-    if (self.infoDict[@"tooltip"]) {
-        NSDictionary *valueDict = self.infoDict[@"tooltip"];
-        return [valueDict objectForKey:[KMRecommondInfo languageKey]]?:@"";
-    }
-    return @"";
-}
-
-- (NSString *)linkURL {
-    if (self.infoDict[@"linkURL"]) {
-        NSDictionary *valueDict = self.infoDict[@"linkURL"];
-        return [valueDict objectForKey:[KMRecommondInfo languageKey]]?:@"";
-    }
-    return @"";
-}
-
-- (NSImage *)normalImage {
-    NSString *imageName = [self versionKey]?:@"";
-    if ([KMRecommondInfo isDarkMode]) {
-        NSURL *url = [NSURL URLWithString:self.infoDict[@"image"][@"normal_Dark"]];
-        imageName = [imageName stringByAppendingString:[NSString stringWithFormat:@"%@.%@",@"-normal_Dark",url.path.pathExtension]];
-    } else {
-        NSURL *url = [NSURL URLWithString:self.infoDict[@"image"][@"normal_Light"]];
-        imageName = [imageName stringByAppendingString:[NSString stringWithFormat:@"%@.%@",@"-normal_Light",url.path.pathExtension]];
-    }
-    NSString *imgSavePath = [[KMRecommondInfo cacheDirs] stringByAppendingPathComponent:imageName];
-    if ([[NSFileManager defaultManager] fileExistsAtPath:imgSavePath]) {
-        return [[NSImage alloc] initWithContentsOfFile:imgSavePath];
-    }
-
-    if ([KMRecommondInfo isDarkMode]) {
-        NSURL *url = [NSURL URLWithString:self.infoDict[@"image"][@"normal_Dark"]];
-        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-            NSData *data = [[NSData alloc] initWithContentsOfURL:url];
-            [data writeToFile:imgSavePath atomically:YES];
-            [[NSNotificationCenter defaultCenter] postNotificationName:@"KMRecommondInfoUpdateNoti" object:@{@"unique":[self versionKey]}];
-        });
-    } else {
-        NSURL *url = [NSURL URLWithString:self.infoDict[@"image"][@"normal_Light"]];
-        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-            NSData *data = [[NSData alloc] initWithContentsOfURL:url];
-            [data writeToFile:imgSavePath atomically:YES];
-            [[NSNotificationCenter defaultCenter] postNotificationName:@"KMRecommondInfoUpdateNoti" object:@{@"unique":[self versionKey]}];
-        });
-    }
-    
-    return nil;
-}
-
-- (NSImage *)hoverImage {
-    NSString *imageName = [self versionKey]?:@"";
-    if ([KMRecommondInfo isDarkMode]) {
-        NSURL *url = [NSURL URLWithString:self.infoDict[@"image"][@"hover_Dark"]];
-        imageName = [imageName stringByAppendingString:[NSString stringWithFormat:@"%@.%@",@"-hover_Dark",url.path.pathExtension]];
-    } else {
-        NSURL *url = [NSURL URLWithString:self.infoDict[@"image"][@"hover_Light"]];
-        imageName = [imageName stringByAppendingString:[NSString stringWithFormat:@"%@.%@",@"-hover_Light",url.path.pathExtension]];
-    }
-    NSString *imgSavePath = [[KMRecommondInfo cacheDirs] stringByAppendingPathComponent:imageName];
-    if ([[NSFileManager defaultManager] fileExistsAtPath:imgSavePath]) {
-        return [[NSImage alloc] initWithContentsOfFile:imgSavePath];
-    }
-
-    if ([KMRecommondInfo isDarkMode]) {
-        NSURL *url = [NSURL URLWithString:self.infoDict[@"image"][@"hover_Dark"]];
-        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-            NSData *data = [[NSData alloc] initWithContentsOfURL:url];
-            [data writeToFile:imgSavePath atomically:YES];
-            [[NSNotificationCenter defaultCenter] postNotificationName:@"KMRecommondInfoUpdateNoti" object:@{@"unique":[self versionKey]}];
-        });
-    } else {
-        NSURL *url = [NSURL URLWithString:self.infoDict[@"image"][@"hover_Light"]];
-        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-            NSData *data = [[NSData alloc] initWithContentsOfURL:url];
-            [data writeToFile:imgSavePath atomically:YES];
-            [[NSNotificationCenter defaultCenter] postNotificationName:@"KMRecommondInfoUpdateNoti" object:@{@"unique":[self versionKey]}];
-        });
-    }
-    return nil;
-}
-
-- (NSImage *)iconImage {
-    NSString *imageName = [self versionKey]?:@"";
-    NSURL *url = [NSURL URLWithString:[self.infoDict[@"image"] objectForKey:[KMRecommondInfo languageKey]]];
-    imageName = [imageName stringByAppendingString:[NSString stringWithFormat:@"%@.%@",@"-iconImage",url.path.pathExtension]];
-    
-    NSString *imgSavePath = [[KMRecommondInfo cacheDirs] stringByAppendingPathComponent:imageName];
-    if ([[NSFileManager defaultManager] fileExistsAtPath:imgSavePath]) {
-        return [[NSImage alloc] initWithContentsOfFile:imgSavePath];
-    }
-    
-    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-        NSData *data = [[NSData alloc] initWithContentsOfURL:url];
-        [data writeToFile:imgSavePath atomically:YES];
-        [[NSNotificationCenter defaultCenter] postNotificationName:@"KMRecommondInfoUpdateNoti" object:@{@"unique":[self versionKey]}];
-    });
-    
-    return nil;
-}
-
-- (NSString *)firebaseEvent {
-    if (self.infoDict[@"Firebase"]) {
-        return self.infoDict[@"Firebase"][@"Event"]?:@"";
-    }
-    return nil;
-}
-
-- (NSString *)firebasePropertyKey {
-    if (self.infoDict[@"Firebase"]) {
-        return self.infoDict[@"Firebase"][@"PropertyKey"]?:@"";
-    }
-    return nil;
-}
-
-- (NSString *)firebasePropertyValue {
-    if (self.infoDict[@"Firebase"]) {
-        return self.infoDict[@"Firebase"][@"PropertyValue"]?:@"";
-    }
-    return nil;
-}
-
-#pragma mark - Public Method
-- (void)updateValue:(NSString *)value forKey:(NSString *)key {
-    if (self.infoDict[key]) {
-        NSMutableDictionary *dict = [[NSMutableDictionary alloc] initWithDictionary:self.infoDict];
-        [dict setValue:value forKey:key];
-        self.infoDict = dict;
-    }
-}
-
-@end
+//
+//    if ([KMRecommondInfo isDarkMode]) {
+//        NSURL *url = [NSURL URLWithString:self.infoDict[@"image"][@"normal_Dark"]];
+//        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+//            NSData *data = [[NSData alloc] initWithContentsOfURL:url];
+//            [data writeToFile:imgSavePath atomically:YES];
+//            [[NSNotificationCenter defaultCenter] postNotificationName:@"KMRecommondInfoUpdateNoti" object:@{@"unique":[self versionKey]}];
+//        });
+//    } else {
+//        NSURL *url = [NSURL URLWithString:self.infoDict[@"image"][@"normal_Light"]];
+//        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+//            NSData *data = [[NSData alloc] initWithContentsOfURL:url];
+//            [data writeToFile:imgSavePath atomically:YES];
+//            [[NSNotificationCenter defaultCenter] postNotificationName:@"KMRecommondInfoUpdateNoti" object:@{@"unique":[self versionKey]}];
+//        });
+//    }
+//    
+//    return nil;
+//}
+//
+//- (NSImage *)hoverImage {
+//    NSString *imageName = [self versionKey]?:@"";
+//    if ([KMRecommondInfo isDarkMode]) {
+//        NSURL *url = [NSURL URLWithString:self.infoDict[@"image"][@"hover_Dark"]];
+//        imageName = [imageName stringByAppendingString:[NSString stringWithFormat:@"%@.%@",@"-hover_Dark",url.path.pathExtension]];
+//    } else {
+//        NSURL *url = [NSURL URLWithString:self.infoDict[@"image"][@"hover_Light"]];
+//        imageName = [imageName stringByAppendingString:[NSString stringWithFormat:@"%@.%@",@"-hover_Light",url.path.pathExtension]];
+//    }
+//    NSString *imgSavePath = [[KMRecommondInfo cacheDirs] stringByAppendingPathComponent:imageName];
+//    if ([[NSFileManager defaultManager] fileExistsAtPath:imgSavePath]) {
+//        return [[NSImage alloc] initWithContentsOfFile:imgSavePath];
+//    }
+//
+//    if ([KMRecommondInfo isDarkMode]) {
+//        NSURL *url = [NSURL URLWithString:self.infoDict[@"image"][@"hover_Dark"]];
+//        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+//            NSData *data = [[NSData alloc] initWithContentsOfURL:url];
+//            [data writeToFile:imgSavePath atomically:YES];
+//            [[NSNotificationCenter defaultCenter] postNotificationName:@"KMRecommondInfoUpdateNoti" object:@{@"unique":[self versionKey]}];
+//        });
+//    } else {
+//        NSURL *url = [NSURL URLWithString:self.infoDict[@"image"][@"hover_Light"]];
+//        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+//            NSData *data = [[NSData alloc] initWithContentsOfURL:url];
+//            [data writeToFile:imgSavePath atomically:YES];
+//            [[NSNotificationCenter defaultCenter] postNotificationName:@"KMRecommondInfoUpdateNoti" object:@{@"unique":[self versionKey]}];
+//        });
+//    }
+//    return nil;
+//}
+//
+//- (NSImage *)iconImage {
+//    NSString *imageName = [self versionKey]?:@"";
+//    NSURL *url = [NSURL URLWithString:[self.infoDict[@"image"] objectForKey:[KMRecommondInfo languageKey]]];
+//    imageName = [imageName stringByAppendingString:[NSString stringWithFormat:@"%@.%@",@"-iconImage",url.path.pathExtension]];
+//    
+//    NSString *imgSavePath = [[KMRecommondInfo cacheDirs] stringByAppendingPathComponent:imageName];
+//    if ([[NSFileManager defaultManager] fileExistsAtPath:imgSavePath]) {
+//        return [[NSImage alloc] initWithContentsOfFile:imgSavePath];
+//    }
+//    
+//    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+//        NSData *data = [[NSData alloc] initWithContentsOfURL:url];
+//        [data writeToFile:imgSavePath atomically:YES];
+//        [[NSNotificationCenter defaultCenter] postNotificationName:@"KMRecommondInfoUpdateNoti" object:@{@"unique":[self versionKey]}];
+//    });
+//    
+//    return nil;
+//}
+//
+//- (NSString *)firebaseEvent {
+//    if (self.infoDict[@"Firebase"]) {
+//        return self.infoDict[@"Firebase"][@"Event"]?:@"";
+//    }
+//    return nil;
+//}
+//
+//- (NSString *)firebasePropertyKey {
+//    if (self.infoDict[@"Firebase"]) {
+//        return self.infoDict[@"Firebase"][@"PropertyKey"]?:@"";
+//    }
+//    return nil;
+//}
+//
+//- (NSString *)firebasePropertyValue {
+//    if (self.infoDict[@"Firebase"]) {
+//        return self.infoDict[@"Firebase"][@"PropertyValue"]?:@"";
+//    }
+//    return nil;
+//}
+//
+//#pragma mark - Public Method
+//- (void)updateValue:(NSString *)value forKey:(NSString *)key {
+//    if (self.infoDict[key]) {
+//        NSMutableDictionary *dict = [[NSMutableDictionary alloc] initWithDictionary:self.infoDict];
+//        [dict setValue:value forKey:key];
+//        self.infoDict = dict;
+//    }
+//}
+//
+//@end

+ 69 - 69
PDF Office/PDF Master/Class/KMAdvertisement/KMRecommondManager.h

@@ -1,70 +1,70 @@
+////
+////  KMRecommondManager.h
+////  PDF Reader Pro Edition
+////
+////  Created by Niehaoyu on 2023/4/11.
+////
 //
-//  KMRecommondManager.h
-//  PDF Reader Pro Edition
-//
-//  Created by Niehaoyu on 2023/4/11.
-//
-
-#import <Foundation/Foundation.h>
-#import "KMRecommondInfo.h"
-
-NS_ASSUME_NONNULL_BEGIN
-
-//接口文档:https://www.showdoc.com.cn/p/645bf52c14b161408feb760a6e0583b4
-//配置说明文档:https://docs.google.com/spreadsheets/d/1anoKSGpI2piMUbOXtRBSaKHg8uh3x6iYwe4x_pzrRbM/edit#gid=0
-
-#define kTestMode   1
-
-#if kTestMode
-#define kRecommondInfoURL         @"http://test-store.kdan.cn:3019"
-#else
-#define kRecommondInfoURL         @"https://store.filmagepro.com:3018"
-#endif
-
-#define KMRecommondDatasUpdateNoti @"KMRecommondDatasUpdateNoti"
-
-typedef enum : NSUInteger {
-    KMRecommondAPP_None,
-    KMRecommondAPP_PDFReaderProMacLite,//PDF Reader Pro
-    KMRecommondAPP_PDFReaderProMacDMG,
-    KMRecommondAPP_PDFReaderProMacPro,
-    KMRecommondAPP_RecordIt,//Record It
-    KMRecommondAPP_RecordItPro,
-    KMRecommondAPP_RecordItDMG,
-    KMRecommondAPP_FilmageScreen,//Filmage Screen
-    KMRecommondAPP_FilmageScreenPro,
-    KMRecommondAPP_FilmageScreenDMG,
-    KMRecommondAPP_FilmageEditorMac,//Filmage Editor
-    KMRecommondAPP_FilmageEditorMacDMG,
-    KMRecommondAPP_FilmageConverterMac,//Filmage Converter
-    KMRecommondAPP_FilmageConverterMacPro,
-    KMRecommondAPP_FilmageConverterMacDMG,
-    KMRecommondAPP_FilmagePlayerMac,//Filmage Player
-    KMRecommondAPP_FilmagePlayerMacPro,
-    KMRecommondAPP_FilmagePlayerMacDMG,
-    KMRecommondAPP_PDFReaderProIOS,//PDF Reader Pro iOS
-    KMRecommondAPP_PDFReaderProIOSPro,
-    KMRecommondAPP_PDFReaderProAndroid,
-    KMRecommondAPP_PDFMasterMac,//PDF Master
-    KMRecommondAPP_PDFMasterMacPro,
-    KMRecommondAPP_PDFMasterMacDMG
-} KMRecommondAPP;
-@interface KMRecommondManager : NSObject
-
-@property (nonatomic, strong, readonly) KMRecommond *pdfProRecommond;
-
-@property (nonatomic, strong, readonly) KMRecommond *othersRecommond;
-
-@property (nonatomic, strong, readonly) KMRecommond *advertisimentRecommond;
-
-+ (KMRecommondManager *)manager;
-
-- (void)loadDataWithAppType:(KMRecommondAPP)appType completionHandler:(void (^)(NSError *error))handler;
-
-- (void)loadDataWithAppName:(NSString *)appName completionHandler:(void (^)(NSError *error))handler;
-
-
-@end
-
-
-NS_ASSUME_NONNULL_END
+//#import <Foundation/Foundation.h>
+//#import "KMRecommondInfo.h"
+//
+//NS_ASSUME_NONNULL_BEGIN
+//
+////接口文档:https://www.showdoc.com.cn/p/645bf52c14b161408feb760a6e0583b4
+////配置说明文档:https://docs.google.com/spreadsheets/d/1anoKSGpI2piMUbOXtRBSaKHg8uh3x6iYwe4x_pzrRbM/edit#gid=0
+//
+//#define kTestMode   1
+//
+//#if kTestMode
+//#define kRecommondInfoURL         @"http://test-store.kdan.cn:3019"
+//#else
+//#define kRecommondInfoURL         @"https://store.filmagepro.com:3018"
+//#endif
+//
+//#define KMRecommondDatasUpdateNoti @"KMRecommondDatasUpdateNoti"
+//
+//typedef enum : NSUInteger {
+//    KMRecommondAPP_None,
+//    KMRecommondAPP_PDFReaderProMacLite,//PDF Reader Pro
+//    KMRecommondAPP_PDFReaderProMacDMG,
+//    KMRecommondAPP_PDFReaderProMacPro,
+//    KMRecommondAPP_RecordIt,//Record It
+//    KMRecommondAPP_RecordItPro,
+//    KMRecommondAPP_RecordItDMG,
+//    KMRecommondAPP_FilmageScreen,//Filmage Screen
+//    KMRecommondAPP_FilmageScreenPro,
+//    KMRecommondAPP_FilmageScreenDMG,
+//    KMRecommondAPP_FilmageEditorMac,//Filmage Editor
+//    KMRecommondAPP_FilmageEditorMacDMG,
+//    KMRecommondAPP_FilmageConverterMac,//Filmage Converter
+//    KMRecommondAPP_FilmageConverterMacPro,
+//    KMRecommondAPP_FilmageConverterMacDMG,
+//    KMRecommondAPP_FilmagePlayerMac,//Filmage Player
+//    KMRecommondAPP_FilmagePlayerMacPro,
+//    KMRecommondAPP_FilmagePlayerMacDMG,
+//    KMRecommondAPP_PDFReaderProIOS,//PDF Reader Pro iOS
+//    KMRecommondAPP_PDFReaderProIOSPro,
+//    KMRecommondAPP_PDFReaderProAndroid,
+//    KMRecommondAPP_PDFMasterMac,//PDF Master
+//    KMRecommondAPP_PDFMasterMacPro,
+//    KMRecommondAPP_PDFMasterMacDMG
+//} KMRecommondAPP;
+//@interface KMRecommondManager : NSObject
+//
+//@property (nonatomic, strong, readonly) KMRecommond *pdfProRecommond;
+//
+//@property (nonatomic, strong, readonly) KMRecommond *othersRecommond;
+//
+//@property (nonatomic, strong, readonly) KMRecommond *advertisimentRecommond;
+//
+//+ (KMRecommondManager *)manager;
+//
+//- (void)loadDataWithAppType:(KMRecommondAPP)appType completionHandler:(void (^)(NSError *error))handler;
+//
+//- (void)loadDataWithAppName:(NSString *)appName completionHandler:(void (^)(NSError *error))handler;
+//
+//
+//@end
+//
+//
+//NS_ASSUME_NONNULL_END

+ 174 - 174
PDF Office/PDF Master/Class/KMAdvertisement/KMRecommondManager.m

@@ -1,175 +1,175 @@
+////
+////  KMRecommondManager.m
+////  PDF Reader Pro Edition
+////
+////  Created by Niehaoyu on 2023/4/11.
+////
 //
-//  KMRecommondManager.m
-//  PDF Reader Pro Edition
-//
-//  Created by Niehaoyu on 2023/4/11.
-//
-
-#import "KMRecommondManager.h"
-
-@interface KMRecommondManager ()
-
-@property (nonatomic, strong, readwrite) KMRecommond *pdfProRecommond;
-
-@property (nonatomic, strong, readwrite) KMRecommond *othersRecommond;
-
-@property (nonatomic, strong, readwrite) KMRecommond *advertisimentRecommond;
-
-@property (nonatomic, assign) BOOL isLoading;
-
-@end
-
-
-@implementation KMRecommondManager
-
-+ (KMRecommondManager *)manager {
-    static KMRecommondManager *__manager = nil;
-    if (!__manager) {
-        __manager = [[KMRecommondManager alloc] init];
-    }
-    return __manager;
-}
-
-- (id)init {
-    self = [super init];
-    if (self) {
-        
-    }
-    return self;
-}
-
-- (NSString *)appNameFromType:(KMRecommondAPP)appType {
-    if (appType == KMRecommondAPP_PDFReaderProMacLite) {
-        return @"PDFReaderProMac";
-    } else if (appType == KMRecommondAPP_PDFReaderProMacDMG) {
-        return @"PDFReaderProMacDMG";
-    } else if (appType == KMRecommondAPP_PDFReaderProMacPro) {
-        return @"PDFReaderProMacPro";
-    } else if (appType == KMRecommondAPP_RecordIt) {
-        return @"RecordIt";
-    } else if (appType == KMRecommondAPP_RecordItPro) {
-        return @"RecordItPro";
-    } else if (appType == KMRecommondAPP_RecordItDMG) {
-        return @"RecordItDMG";
-    } else if (appType == KMRecommondAPP_FilmageScreen) {
-        return @"FilmageScreen";
-    } else if (appType == KMRecommondAPP_FilmageScreenPro) {
-        return @"FilmageScreenPro";
-    } else if (appType == KMRecommondAPP_FilmageScreenDMG) {
-        return @"FilmageScreenDMG";
-    } else if (appType == KMRecommondAPP_FilmageEditorMac) {
-        return @"FilmageEditorMac";
-    } else if (appType == KMRecommondAPP_FilmageEditorMacDMG) {
-        return @"FilmageEditorMacDMG";
-    } else if (appType == KMRecommondAPP_FilmageConverterMac) {
-        return @"FilmageConverterMac";
-    } else if (appType == KMRecommondAPP_FilmageConverterMacPro) {
-        return @"FilmageConverterMacPro";
-    } else if (appType == KMRecommondAPP_FilmageConverterMacDMG) {
-        return @"FilmageConverterMacDMG";
-    } else if (appType == KMRecommondAPP_FilmagePlayerMac) {
-        return @"FilmagePlayerMac";
-    } else if (appType == KMRecommondAPP_FilmagePlayerMacPro) {
-        return @"FilmagePlayerMacPro";
-    } else if (appType == KMRecommondAPP_FilmagePlayerMacDMG) {
-        return @"FilmagePlayerMacDMG";
-    } else if (appType == KMRecommondAPP_PDFReaderProIOS) {
-        return @"PDFReaderProIOS";
-    } else if (appType == KMRecommondAPP_PDFReaderProIOSPro) {
-        return @"PDFReaderProIOSPro";
-    } else if (appType == KMRecommondAPP_PDFReaderProAndroid) {
-        return @"PDFReaderProAndroid";
-    } else if (appType == KMRecommondAPP_PDFMasterMac) {
-        return @"PDFMasterMac";
-    } else if (appType == KMRecommondAPP_PDFMasterMacPro) {
-        return @"PDFMasterMacPro";
-    } else if (appType == KMRecommondAPP_PDFMasterMacDMG) {
-        return @"PDFMasterMacDMG";
-    }
-    return @"";
-}
-
-
-
-- (void)loadDataWithAppType:(KMRecommondAPP)appType completionHandler:(void (^)(NSError * _Nonnull))handler {
-    if ([self appNameFromType:appType].length > 0) {
-        [self loadDataWithAppName:[self appNameFromType:appType] completionHandler:handler];
-    }
-}
-
-- (void)loadDataWithAppName:(NSString *)appName completionHandler:(void (^)(NSError *error))handler {
-    if (self.isLoading) {
-        return;
-    }
-    
-    if (self.pdfProRecommond ||
-        self.othersRecommond ||
-        self.advertisimentRecommond) {
-        if (handler) {
-            handler(nil);
-        }
-        [[NSNotificationCenter defaultCenter] postNotificationName:KMRecommondDatasUpdateNoti object:nil];
-        return;
-    }
-    
-    __weak typeof(self) weakSelf = self;
-    self.isLoading = YES;
-    //Send Request
-    NSString *urlString = [kRecommondInfoURL stringByAppendingString:[NSString stringWithFormat:@"/api/advertise-new?app_name=%@",appName?:@""]];
-
-    NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
-    configuration.requestCachePolicy = NSURLRequestReloadIgnoringLocalCacheData;
-    [configuration setURLCache:[NSURLCache sharedURLCache]];
-    
-    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:urlString]];
-    [request setHTTPMethod:@"GET"];
-    
-    [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
-
-    NSURLSession *session = [NSURLSession sessionWithConfiguration:configuration];
-    NSURLSessionDataTask *task = [session dataTaskWithRequest:request
-                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
-        self.isLoading = NO;
-        if (!error) {
-            NSDictionary *datas = [NSJSONSerialization JSONObjectWithData:data
-                                                             options:NSJSONReadingMutableContainers error:nil];
-            if ([datas isKindOfClass:[NSDictionary class]] && datas[@"list"]) {
-                NSArray *listArray = datas[@"list"];
-                
-                for (NSDictionary *listDict in listArray) {
-                    
-                    if ([listDict[@"status"] intValue] == 1) {
-                        NSString *detailString = listDict[@"detail"];
-                        NSData *jsonData = [detailString dataUsingEncoding:NSUTF8StringEncoding];
-                        NSDictionary *detailDic = [NSJSONSerialization JSONObjectWithData:jsonData
-                                                                            options:NSJSONReadingMutableContainers
-                                                                              error:nil];
-                        
-                        if (detailDic[@"recommondContent"]) {
-                            if (detailDic[@"recommondContent"][@"recommondContentPDFPro"]) {
-                                weakSelf.pdfProRecommond = [[KMRecommond alloc] initWithDict:detailDic[@"recommondContent"][@"recommondContentPDFPro"]];
-                             }
-                            if (detailDic[@"recommondContent"][@"recommondContentOther"]) {
-                                weakSelf.othersRecommond = [[KMRecommond alloc] initWithDict:detailDic[@"recommondContent"][@"recommondContentOther"]];
-                             }
-                        }
-                        
-                        if (detailDic[@"advertisement"]) {
-                            for (NSDictionary *adverDict in detailDic[@"advertisement"]) {
-                                weakSelf.advertisimentRecommond = [[KMRecommond alloc] initWithDict:detailDic[@"advertisement"]];
-                            }
-                        }
-                    }
-                }
-            }
-        }
-        if (handler) {
-            handler(error);
-        }
-        [[NSNotificationCenter defaultCenter] postNotificationName:KMRecommondDatasUpdateNoti object:nil];
-    }];
-    
-    [task resume];
-}
-
-@end
+//#import "KMRecommondManager.h"
+//
+//@interface KMRecommondManager ()
+//
+//@property (nonatomic, strong, readwrite) KMRecommond *pdfProRecommond;
+//
+//@property (nonatomic, strong, readwrite) KMRecommond *othersRecommond;
+//
+//@property (nonatomic, strong, readwrite) KMRecommond *advertisimentRecommond;
+//
+//@property (nonatomic, assign) BOOL isLoading;
+//
+//@end
+//
+//
+//@implementation KMRecommondManager
+//
+//+ (KMRecommondManager *)manager {
+//    static KMRecommondManager *__manager = nil;
+//    if (!__manager) {
+//        __manager = [[KMRecommondManager alloc] init];
+//    }
+//    return __manager;
+//}
+//
+//- (id)init {
+//    self = [super init];
+//    if (self) {
+//        
+//    }
+//    return self;
+//}
+//
+//- (NSString *)appNameFromType:(KMRecommondAPP)appType {
+//    if (appType == KMRecommondAPP_PDFReaderProMacLite) {
+//        return @"PDFReaderProMac";
+//    } else if (appType == KMRecommondAPP_PDFReaderProMacDMG) {
+//        return @"PDFReaderProMacDMG";
+//    } else if (appType == KMRecommondAPP_PDFReaderProMacPro) {
+//        return @"PDFReaderProMacPro";
+//    } else if (appType == KMRecommondAPP_RecordIt) {
+//        return @"RecordIt";
+//    } else if (appType == KMRecommondAPP_RecordItPro) {
+//        return @"RecordItPro";
+//    } else if (appType == KMRecommondAPP_RecordItDMG) {
+//        return @"RecordItDMG";
+//    } else if (appType == KMRecommondAPP_FilmageScreen) {
+//        return @"FilmageScreen";
+//    } else if (appType == KMRecommondAPP_FilmageScreenPro) {
+//        return @"FilmageScreenPro";
+//    } else if (appType == KMRecommondAPP_FilmageScreenDMG) {
+//        return @"FilmageScreenDMG";
+//    } else if (appType == KMRecommondAPP_FilmageEditorMac) {
+//        return @"FilmageEditorMac";
+//    } else if (appType == KMRecommondAPP_FilmageEditorMacDMG) {
+//        return @"FilmageEditorMacDMG";
+//    } else if (appType == KMRecommondAPP_FilmageConverterMac) {
+//        return @"FilmageConverterMac";
+//    } else if (appType == KMRecommondAPP_FilmageConverterMacPro) {
+//        return @"FilmageConverterMacPro";
+//    } else if (appType == KMRecommondAPP_FilmageConverterMacDMG) {
+//        return @"FilmageConverterMacDMG";
+//    } else if (appType == KMRecommondAPP_FilmagePlayerMac) {
+//        return @"FilmagePlayerMac";
+//    } else if (appType == KMRecommondAPP_FilmagePlayerMacPro) {
+//        return @"FilmagePlayerMacPro";
+//    } else if (appType == KMRecommondAPP_FilmagePlayerMacDMG) {
+//        return @"FilmagePlayerMacDMG";
+//    } else if (appType == KMRecommondAPP_PDFReaderProIOS) {
+//        return @"PDFReaderProIOS";
+//    } else if (appType == KMRecommondAPP_PDFReaderProIOSPro) {
+//        return @"PDFReaderProIOSPro";
+//    } else if (appType == KMRecommondAPP_PDFReaderProAndroid) {
+//        return @"PDFReaderProAndroid";
+//    } else if (appType == KMRecommondAPP_PDFMasterMac) {
+//        return @"PDFMasterMac";
+//    } else if (appType == KMRecommondAPP_PDFMasterMacPro) {
+//        return @"PDFMasterMacPro";
+//    } else if (appType == KMRecommondAPP_PDFMasterMacDMG) {
+//        return @"PDFMasterMacDMG";
+//    }
+//    return @"";
+//}
+//
+//
+//
+//- (void)loadDataWithAppType:(KMRecommondAPP)appType completionHandler:(void (^)(NSError * _Nonnull))handler {
+//    if ([self appNameFromType:appType].length > 0) {
+//        [self loadDataWithAppName:[self appNameFromType:appType] completionHandler:handler];
+//    }
+//}
+//
+//- (void)loadDataWithAppName:(NSString *)appName completionHandler:(void (^)(NSError *error))handler {
+//    if (self.isLoading) {
+//        return;
+//    }
+//    
+//    if (self.pdfProRecommond ||
+//        self.othersRecommond ||
+//        self.advertisimentRecommond) {
+//        if (handler) {
+//            handler(nil);
+//        }
+//        [[NSNotificationCenter defaultCenter] postNotificationName:KMRecommondDatasUpdateNoti object:nil];
+//        return;
+//    }
+//    
+//    __weak typeof(self) weakSelf = self;
+//    self.isLoading = YES;
+//    //Send Request
+//    NSString *urlString = [kRecommondInfoURL stringByAppendingString:[NSString stringWithFormat:@"/api/advertise-new?app_name=%@",appName?:@""]];
+//
+//    NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
+//    configuration.requestCachePolicy = NSURLRequestReloadIgnoringLocalCacheData;
+//    [configuration setURLCache:[NSURLCache sharedURLCache]];
+//    
+//    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:urlString]];
+//    [request setHTTPMethod:@"GET"];
+//    
+//    [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
+//
+//    NSURLSession *session = [NSURLSession sessionWithConfiguration:configuration];
+//    NSURLSessionDataTask *task = [session dataTaskWithRequest:request
+//                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
+//        self.isLoading = NO;
+//        if (!error) {
+//            NSDictionary *datas = [NSJSONSerialization JSONObjectWithData:data
+//                                                             options:NSJSONReadingMutableContainers error:nil];
+//            if ([datas isKindOfClass:[NSDictionary class]] && datas[@"list"]) {
+//                NSArray *listArray = datas[@"list"];
+//                
+//                for (NSDictionary *listDict in listArray) {
+//                    
+//                    if ([listDict[@"status"] intValue] == 1) {
+//                        NSString *detailString = listDict[@"detail"];
+//                        NSData *jsonData = [detailString dataUsingEncoding:NSUTF8StringEncoding];
+//                        NSDictionary *detailDic = [NSJSONSerialization JSONObjectWithData:jsonData
+//                                                                            options:NSJSONReadingMutableContainers
+//                                                                              error:nil];
+//                        
+//                        if (detailDic[@"recommondContent"]) {
+//                            if (detailDic[@"recommondContent"][@"recommondContentPDFPro"]) {
+//                                weakSelf.pdfProRecommond = [[KMRecommond alloc] initWithDict:detailDic[@"recommondContent"][@"recommondContentPDFPro"]];
+//                             }
+//                            if (detailDic[@"recommondContent"][@"recommondContentOther"]) {
+//                                weakSelf.othersRecommond = [[KMRecommond alloc] initWithDict:detailDic[@"recommondContent"][@"recommondContentOther"]];
+//                             }
+//                        }
+//                        
+//                        if (detailDic[@"advertisement"]) {
+//                            for (NSDictionary *adverDict in detailDic[@"advertisement"]) {
+//                                weakSelf.advertisimentRecommond = [[KMRecommond alloc] initWithDict:detailDic[@"advertisement"]];
+//                            }
+//                        }
+//                    }
+//                }
+//            }
+//        }
+//        if (handler) {
+//            handler(error);
+//        }
+//        [[NSNotificationCenter defaultCenter] postNotificationName:KMRecommondDatasUpdateNoti object:nil];
+//    }];
+//    
+//    [task resume];
+//}
+//
+//@end

+ 277 - 0
PDF Office/PDF Master/Class/KMAdvertisement/Manager/KMAdvertisementManager.swift

@@ -0,0 +1,277 @@
+//
+//  KMAdvertisementManager.swift
+//  KMAdvertisement
+//
+//  Created by lizhe on 2022/11/23.
+// 广告管理
+
+@objcMembers open class KMAdvertisementManager: NSObject {
+    //单例
+    @objc public static let manager = KMAdvertisementManager()
+    @objc public var configuration: KMAdvertisementConfig = KMAdvertisementConfig()
+    
+    /**
+     @abstract 测试模式,默认为false
+      */
+    @objc public var debug: Bool = false
+    
+    /**
+     @abstract 初始化数据
+     @param appID 产品名称
+     @param subscribeType 订阅状态,可单独在configuration设置
+     @param platform 平台
+     @return
+      */
+    @objc public func initConfig(appName: KMAdvertisementAppNameType,
+                                 subscribeType:KMAdvertisementSubscribeType,
+                                 platform: KMAdvertisementPlatformType) {
+        configuration.initParameters(appName: appName, subscribeType: subscribeType, platform: platform)
+    }
+    
+    private class InternalImplementation {
+            fileprivate var privateProperty: String = "Hidden"
+            fileprivate func internalMethod() {
+                // 实现细节
+            }
+        }
+        
+        private let internalImplementation = InternalImplementation()
+        
+        public func publicMethod() {
+            // 使用内部实现
+            internalImplementation.internalMethod()
+        }
+}
+
+extension KMAdvertisementManager {
+    //MARK: request
+    /**
+     @abstract 获取数据
+     @param data 传入参数 类型为KMAdvertisementModel
+     @return
+      */
+    @objc public func fetchData(completion: @escaping (_ data: KMAdvertisementInfo?, _ error:Error?) -> Void) -> Void {
+        self.fetchDataWithResponseObject { data, responseObject, error in
+            if completion != nil {
+                completion(data, error)
+            }
+        }
+    }
+    
+    @objc public func fetchDataWithResponseObject(completion:@escaping (_ data: KMAdvertisementInfo?, _ responseObject: AnyObject? , _ error:Error?) -> Void) -> Void {
+        print("开始获取数据")
+        var version: String = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString").debugDescription
+        if (version.count == 0) {
+            version = Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion").debugDescription
+            version = version.replacingOccurrences(of: ".", with: "")
+        }
+        
+        let urlString = configuration.activityBaseURL() + "/api/advertise-new"
+        let params: [String:Any] = ["app_name": configuration.appName.string(),
+                                    "app_version": version]
+        
+        //先拿缓存数据 再请求新数据
+        let cacheData = KMAdvertisementCache.default.readData()
+        if cacheData.count != 0 {
+            self.parseData(data: cacheData, isNeedLocalComparison: false) { result in
+                if result.count != 0 {
+                    completion(result.first, nil, nil)
+                }
+            }
+        }
+        
+        unowned let weakSelf = self
+        KMAdvertisementRequestServer.requestServer.request(urlString: urlString, method: "GET", params: params) { task, responseObject, error in
+            print("正在获取数据")
+            if (error == nil && responseObject != nil) {
+                let array = responseObject?["list"] ?? []
+                if array != nil {
+                    //解析数据
+                    print("开始解析数据")
+                    weakSelf.parseData(data: array as! [NSDictionary], isNeedLocalComparison: true) { data in
+                        print("数据处理完毕")
+                        if data.count != 0 {
+                            completion(data.first, responseObject, nil)
+                        }
+                    }
+                } else {
+                    print("解析数据失败array")
+                    completion(nil, responseObject, error)
+                }
+            } else {
+                print("解析数据失败数据不存在")
+                completion(nil, responseObject, error)
+            }
+        }
+    }
+}
+
+
+extension KMAdvertisementManager {
+    //MARK: data
+    /**
+     @abstract 解析数据
+     @param data 传入参数 NSDictionary
+     @param isNeedLocalComparison 是否需要对比本地版本,如果不一样将会刷新
+     @return KMAdvertisementModel
+      */
+    public func parseData(data: [NSDictionary], isNeedLocalComparison: Bool ,completion:(_ result: [KMAdvertisementInfo]) -> Void) -> Void {
+        //获取缓存数据
+        var isNeedSave = false
+        let cacheData = KMAdvertisementCache.default.readData()
+        
+        var resultArray:[KMAdvertisementInfo] = []
+        for model in data {
+            if (!(cacheData.contains(model) && isNeedLocalComparison)) {
+                if (self.allowLoadData(data: model)) {
+                    let jsonString: String = (model["detail"] as? String) ?? ""
+                    let jsonData: Data = jsonString.data(using: .utf8)!
+                    let dict = try?JSONSerialization.jsonObject(with: jsonData)
+                    let decoder = JSONDecoder()
+    //                decoder.dataDecodingStrategy = .base64
+    //                decoder.keyDecodingStrategy = .convertFromSnakeCase //带下划线命名
+
+                    decoder.nonConformingFloatDecodingStrategy = .convertFromString(positiveInfinity: "+∞", negativeInfinity: "-∞", nan: "NaN")
+    #if DEBUG
+                    //MARK: 测试使用
+                    var advertisementModel = try! decoder.decode(KMAdvertisementInfo.self, from: jsonData)
+                    if (self.allowLoadContentData(data: advertisementModel)) {
+                        resultArray.append(self.allowLoadItemData(advertisementModel))
+                        isNeedSave = true
+                    }
+    #else
+    //            MARK: 此处try 使用 ? ,如果数据出问题 advertisementModel将无参数, 测试时使用!
+                    var advertisementModel = try? decoder.decode(KMAdvertisementModel.self, from: jsonData)
+                    if (advertisementModel != nil) {
+                        if (self.allowLoadContentData(data: advertisementModel!)) {
+                            resultArray.append(self.allowLoadItemData(advertisementModel!))
+                            isNeedSave = true
+                        }
+                    }
+    #endif
+                }
+            }
+        }
+        
+        if isNeedSave && isNeedLocalComparison {
+            KMAdvertisementCache.default.saveData(data: data)
+            print("已更新本地数据")
+        } else {
+            print("不需要更新本地数据")
+        }
+        
+        completion(resultArray)
+    }
+    
+    func allowLoadData(data: NSDictionary) -> Bool {
+        var result = false
+        
+        let status = (data["status"] as? Int) ?? 0
+        let app_name: String = data["app_name"] as? String ?? ""
+        
+        if (status == 1 &&
+            app_name == configuration.appName.string()) {
+            result = true
+        }
+        return result
+        
+    }
+    
+    func allowLoadContentData(data: KMAdvertisementInfo) -> Bool {
+        var result = true
+        return result
+    }
+    
+//    func allowLoadContentData(data: KMAdvertisementModel) -> Bool {
+//        var result = false
+//        
+//        let time: NSInteger = NSInteger(KMAdvertisementTimeStampConversion.getCurrentTimeInterval())!
+//        let startTime: NSInteger = NSInteger(data.startTime!)!
+//        let endTime: NSInteger = NSInteger(data.endTime!)!
+//        let platform = configuration.platform
+//        let subscribeType = configuration.subscribeType
+//        let version = data.version ?? "1.0"
+//        let localVersion = self.getLocalVersion()
+//        let hidden = data.hidden ?? false
+//        
+//        if (time >= startTime &&
+//            time <= endTime &&
+//            platform == data.platform &&
+//            self.compareVersion(nowVersion:localVersion, newVersion: version) &&
+//            (subscribeType == data.subscribeType || data.subscribeType == .all) &&
+//            !hidden) {
+//            result = true
+//        }
+//        return result
+//    }
+    
+    //过滤item是否显示
+    func allowLoadItemData(_ data: KMAdvertisementInfo) -> KMAdvertisementInfo {
+        return data;
+    }
+    
+//    func allowLoadItemData(_ data: KMAdvertisementModel) -> KMAdvertisementModel {
+//        //获取缓存数据
+//        if (UserDefaults.standard.object(forKey: "KMAdvertisementShowScroll_iOS") == nil) {
+//            UserDefaults.standard.set([], forKey: "KMAdvertisementShowScroll_iOS")
+//        }
+//        let cacheArray: [String] = UserDefaults.standard.object(forKey: "KMAdvertisementShowScroll_iOS") as! [String]
+//        
+//        let model = data
+//        var sections: [KMAdvertisementModelSection] = []
+//        for section in data.content! {
+//            var items: [KMAdvertisementModelItem] = []
+//            for item in section.content! {
+//                let timeString = KMAdvertisementTimeStampConversion.getCurrentTimeInterval()
+//                let time: NSInteger = NSInteger(timeString)!
+//                let startTime: NSInteger = NSInteger(item.startTime ?? timeString)!
+//                let endTime: NSInteger = NSInteger(item.endTime ?? timeString)!
+//                let hidden = item.hidden ?? false
+//
+////                print(hidden ? "隐藏" : "显示")
+//                if (!hidden &&
+//                    time >= startTime &&
+//                    time <= endTime &&
+//                    !cacheArray.contains(item.productID ?? "")) {
+//                    items.append(item)
+//                }
+//            }
+//            section.content = items
+//            sections.append(section)
+//        }
+//        model.content = sections
+//        return model
+//    }
+    
+    //获取本地版本号
+    func getLocalVersion() -> String {
+        var localVersion = ""
+        if let v: String = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String {
+            localVersion = v
+        }
+        return localVersion
+    }
+    
+    func compareVersion(nowVersion: String, newVersion: String) -> Bool {
+        let nowArray = nowVersion.split(separator: ".")
+        let newArray = newVersion.split(separator: ".")
+        let big = nowArray.count > newArray.count ? newArray.count : nowArray.count
+        if big != 0 {
+            for index in 0...big - 1 {
+                let first = nowArray[index]
+                let second = newArray[index]
+                if Int(first)! < Int(second)!  {
+                    return true
+                }
+                if index == big - 1 {
+                    if Int(first)! <= Int(second)!  {
+                        return true
+                    }
+                }
+            }
+        } else {
+            return true
+        }
+        return false
+    }
+}

+ 92 - 0
PDF Office/PDF Master/Class/KMAdvertisement/Model/KMAdvertisementImage.swift

@@ -0,0 +1,92 @@
+//
+//  KMAdvertisementImage.swift
+//  KMAdvertisement
+//
+//  Created by lizhe on 2023/1/12.
+// 图片缓存
+
+import Foundation
+import AppKit
+
+typealias KMAdvertisementImageCompletion = (_ image: NSImage) -> Void
+class KMAdvertisementImage: NSObject {
+    static func imageWithURL(url : URL?, completion: KMAdvertisementImageCompletion?) -> NSImage {
+        var image: NSImage = NSImage()
+        if url != nil {
+            //获取缓存图片是否存在
+            let imageString: String = KMAdvertisementImageCache.fetchImageCache(url: url!)
+            if imageString != "" {
+                //存在获取本地图片
+                image = NSImage.init(contentsOfFile: imageString) ?? NSImage()
+                if completion != nil {
+                    completion!(image)
+                }
+            } else {
+                let path = KMAdvertisementImageCache.kImageCacheFilePath
+                let filePath = (path as String) + "/" + (NSString(string: NSString(string: url!.path).lastPathComponent) as String)
+                KMAdvertisementRequestServer.requestServer.downLoad(inputURL: url!, filePath: filePath) { progress in
+                    
+                } completion: { task, responseObject, error in
+                    if completion != nil {
+                        DispatchQueue.main.async {
+                            image = NSImage.init(contentsOfFile: KMAdvertisementImageCache.fetchImageCache(url: url!)) ?? NSImage()
+                            completion!(image)
+                        }
+                    }
+                }
+            }
+        }
+        return image
+    }
+}
+
+
+
+class KMAdvertisementImageCache: NSObject {
+    static let kImageCacheFilePath: NSString = NSTemporaryDirectory() + "Advertisement/ImageCache" as NSString
+    
+    static func saveImageCache(image: NSImage, name: String) {
+        if image.size.width != 0 {
+            
+            let path = KMAdvertisementImageCache.kImageCacheFilePath
+            let filePath = (path as String) + "/" + NSString(string: name).deletingPathExtension + ".png"
+            if (!FileManager.default.fileExists(atPath: path as String)) {
+                try?FileManager.default.createDirectory(atPath: path as String, withIntermediateDirectories: true, attributes: nil)
+            }
+            
+            #if os(iOS)
+            
+//            [UIImagePNGRepresentation(image) writeToFile:path + name
+//                                              atomically:YES]
+            #elseif os(OSX)
+            let cgimage = image.cgImage(forProposedRect: nil, context: nil, hints: nil)
+            if cgimage != nil {
+                let rep = NSBitmapImageRep.init(cgImage: cgimage!)
+                try?rep.representation(using: .png, properties: [:])?.write(to: URL(fileURLWithPath: filePath))
+            } else {
+                try?image.tiffRepresentation?.write(to: URL(fileURLWithPath: filePath))
+            }
+            print(path)
+            #endif
+        }
+    }
+    
+    static func fetchImageCache(url: URL) -> String {
+        if (!FileManager.default.fileExists(atPath: kImageCacheFilePath as String)) {
+            try?FileManager.default.createDirectory(atPath: kImageCacheFilePath as String, withIntermediateDirectories: true, attributes: nil)
+        }
+        
+        var string = ""
+        let name = NSString(string: url.path).lastPathComponent
+        let manager = FileManager.default
+        let contentsOfPath = try? manager.contentsOfDirectory(atPath: kImageCacheFilePath as String)
+        
+        if (contentsOfPath!.contains(name)) {
+            string = (kImageCacheFilePath as String) + "/" + name
+//            print("图片存在" + string)
+        } else {
+//            print("图片不存在" + (kImageCacheFilePath as String) + "/" + name)
+        }
+        return string
+    }
+}

+ 148 - 0
PDF Office/PDF Master/Class/KMAdvertisement/Model/KMAdvertisementModel.swift

@@ -0,0 +1,148 @@
+//
+//  KMAdvertisementModel.swift
+//  KMAdvertisement
+//
+//  Created by lizhe on 2022/11/30.
+//
+
+
+
+@objcMembers public class KMAdvertisementInfo: NSObject, Codable {
+    public var recommondContent: KMAdvertisementContent?
+    public var advertisement: KMAdvertisementItem?
+}
+
+@objcMembers public class KMAdvertisementContent: NSObject, Codable {
+    public var recommondContentOther: KMAdvertisementItem?
+    public var recommondContentPDFPro: KMAdvertisementItem?
+}
+
+@objcMembers public class KMAdvertisementItem: NSObject, Codable {
+    public var version: String?
+    public var name: Language?
+    public var content: [KMAdvertisementItemInfo]?
+}
+
+@objcMembers public class KMAdvertisementItemInfo: NSObject, Codable {
+    var index: Int?
+    var show: String? //是否显示,内部有做了时间区间判断
+    var showType: KMRecommondShowType?
+    var startDate: String?
+    var endDate: String?
+    var versionKey: String? //版本号,唯一标识符
+    var showCloseBtn: String? //是否显示关闭按钮,(左下角广告需要)
+    var image: Image? //APP互推,常规状态下的图片
+    var iconImage: String? //广告显示图片(自适应多语)
+    var name: Language? //名称(自适应多语)
+    var tooltip: Language? //提示语(自适应多语)
+    var linkURL: Language? //跳转链接(自适应多语)
+    
+    //Firebase
+    var firebaseEvent: String?
+    var firebasePropertyKey: String?
+    var firebasePropertyValue: String?
+    
+    public class Image: NSObject, Codable {
+        public let zh_TW: String?
+        public let hover_Dark: String?
+        public let hover_Light: String?
+        
+        public let zh_CN: String?
+        public let normal_Light: String?
+        public let normal_Dark: String?
+    }
+}
+
+public class Language: NSObject, Codable {
+    var en: String?
+    var zh_TW: String?
+    var zh_CN: String?
+}
+
+//@objcMembers public class KMAdvertisementModel: NSObject, Codable {
+//    public var appName: KMAdvertisementAppNameType = .FilmageEditorMac //产品名
+//    public var platform: KMAdvertisementPlatformType = .Mac //平台
+//    public var showType: KMAdvertisementShowType = .view //显示类型
+//    public let startTime: String? //开始时间 时间戳
+//    public let endTime: String? //结束时间 时间戳
+//    public let version: String? //小于等于此版本生效
+//    public let hidden: Bool? //是否显示
+//    let subscribeType: KMAdvertisementSubscribeType? //是否订阅
+//    public var content: [KMAdvertisementModelSection]?
+//}
+//
+//@objcMembers public class KMAdvertisementModelSection: NSObject, Codable {
+//    public let sectionTitle: KMAdvertisementModelItem.Text?
+//    public var content: [KMAdvertisementModelItem]?
+//}
+//
+//@objcMembers public class KMAdvertisementModelItem: NSObject, Codable {
+//    public var productID: String?
+//    public let startTime: String? //开始时间 时间戳
+//    public let endTime: String? //结束时间 时间戳
+//    public var hidden: Bool?
+//    
+//    public var index: Int?
+//    public let title: Text?
+//    public let imageURL: Image?
+//    public let ipadImageURL: Image?
+//    public let linkURL: Language?
+//    public let tips: Language?
+//    public let button: Text?
+//    public var actionType: KMAdvertisementActionType = .URL
+//    
+//    public struct Text: Codable {
+//        public let font: Font?
+//        public let color: Color?
+//        public let background: Background?
+//        public let language: Language?
+//    }
+//    
+//    public struct Font: Codable {
+//        public let name: String?
+//        public let size: Int?
+//    }
+//    
+//    public struct Color: Codable {
+//        let height: ColorState?
+//        let normal: ColorState?
+//        
+//        struct ColorState: Codable {
+//            public let dark: ColorInfo?
+//            public let universal: ColorInfo?
+//            
+//            struct ColorInfo: Codable {
+//                public var hex: String?
+//                public var alpha: Float?
+//            }
+//        }
+//    }
+//
+//    public struct Background: Codable {
+//        let color: Color?
+//        let layer: Layer?
+//        
+//        struct Layer: Codable {
+//            public let cornerRadius: CGFloat?
+//            public let borderWidth: CGFloat?
+//            public let borderColor: Color?
+//        }
+//    }
+//    
+//    public struct Image: Codable {
+//        public let height: ImageInfo?
+//        public let normal: ImageInfo?
+//        public let background: Background?
+//    }
+//    
+//    public struct ImageInfo: Codable {
+//        public let dark: Language?
+//        public let universal: Language?
+//    }
+//    
+//    public class Language: NSObject, Codable {
+//        public let en: String?
+//        public let zh_TW: String?
+//        public let zh_CN: String?
+//    }
+//}

+ 147 - 0
PDF Office/PDF Master/Class/KMAdvertisement/Model/KMAdvertisementModelTransition.swift

@@ -0,0 +1,147 @@
+//
+//  KMAdvertisementModelTansition.swift
+//  KMAdvertisement
+//
+//  Created by lizhe on 2022/12/2.
+//
+import AppKit
+@objcMembers open class KMAdvertisementModelTransition: NSObject {
+    //MARK: 模型转换
+    //颜色模型转换
+//    public static func transitionColor(color: KMAdvertisementModelItem.Color?, highlight:Bool) -> NSColor {
+//        var result = NSColor.clear
+//        guard let tempColor = color else { return result }
+//        
+//        if highlight {
+//            let darkHex = tempColor.height?.dark?.hex
+//            let darkAlpha = tempColor.height?.dark?.alpha
+//            let universalHex = tempColor.height?.universal?.hex
+//            let universalAlpha = tempColor.height?.universal?.alpha
+//            let light = NSColor.init(hex: universalHex ?? "").withAlphaComponent(CGFloat(universalAlpha ?? 1))
+//            let dark = NSColor.init(hex: darkHex ?? universalHex ?? "").withAlphaComponent(CGFloat(darkAlpha ?? universalAlpha ?? 1))
+//            
+//            result = KMAdvertisementConfig.adapterDark(light: light , dark: dark) as! NSColor
+//        } else {
+//            let darkHex = tempColor.normal?.dark?.hex
+//            let darkAlpha = tempColor.normal?.dark?.alpha
+//            let universalHex = tempColor.normal?.universal?.hex
+//            let universalAlpha = tempColor.normal?.universal?.alpha
+//            
+//            let light = NSColor.init(hex: universalHex ?? "").withAlphaComponent(CGFloat(universalAlpha ?? 1))
+//            let dark = NSColor.init(hex: darkHex ?? universalHex ?? "").withAlphaComponent(CGFloat(darkAlpha ?? universalAlpha ?? 1))
+//            result = KMAdvertisementConfig.adapterDark(light: light, dark: dark) as! NSColor
+//        }
+//        
+//        return result
+//    }
+    
+    //图片转换
+    public static func transitionImagePath(image: KMAdvertisementItemInfo.Image?, highlight:Bool) -> String {
+        var result = ""
+        guard let tempImage = image else { return result }
+        
+        if highlight {
+            result = (KMAdvertisementConfig.isDarkModel() ? tempImage.hover_Dark : tempImage.hover_Light) ?? ""
+        } else {
+            result = (KMAdvertisementConfig.isDarkModel() ? tempImage.normal_Dark : tempImage.normal_Light) ?? ""
+        }
+        
+        if result.count == 0 {
+            let language = Language()
+            language.en = image?.zh_TW
+            language.zh_TW = image?.zh_TW
+            language.zh_CN = image?.zh_CN
+            result = KMAdvertisementModelTransition.transitionLanguage(langeuage: language)
+        }
+        
+        return result
+    }
+    
+    //多语转换
+    @objc public static func transitionLanguage(langeuage: Language?) -> String {
+        var result = ""
+//        let languageConfig = KMAdvertisementManager.manager.configuration.language
+//        if languageConfig != .unknow {
+//            if languageConfig == .en {
+//                result = langeuage?.en ?? ""
+//            } else if languageConfig == .zhCN {
+//                result = langeuage?.zh_CN ?? ""
+//            } else if languageConfig == .zhTW {
+//                result = langeuage?.zh_TW ?? ""
+//            }
+//        } else {
+            let string = KMAdvertisementModelTransition.getLanguageType()
+            if string == "zh-Hans-CN" {
+                result = langeuage?.zh_CN ?? ""
+            } else if string == "zh-Hans-TW" {
+                result = langeuage?.zh_TW ?? ""
+            } else {
+                result = langeuage?.en ?? ""
+            }
+//        }
+        return result
+    }
+    
+    public static func getLanguageType() -> String {
+#if os(iOS)
+        let def = UserDefaults.standard
+        let allLanguages: [String] = def.object(forKey: "AppleLanguages") as! [String]
+        let chooseLanguage = allLanguages.first
+        return chooseLanguage ?? "en"
+#elseif os(OSX)
+//        let locale = NSLocale.current.languageCode
+        //        let chooseLanguage = Locale.preferredLanguages[0]
+        let allLanguages: [String] = UserDefaults.standard.object(forKey: "AppleLanguages") as! [String]
+        let chooseLanguage: String = allLanguages.first ?? "en"
+        return chooseLanguage
+#endif
+    }
+}
+
+extension NSColor {
+    convenience init(hex: String) {
+        var hexString = hex
+        if hex.starts(with: "#") {
+            hexString = String(hex.dropFirst())
+        }
+        if let ui64 = UInt64(hexString, radix: 16) {
+            self.init(hex: Int(ui64))
+        } else {
+            self.init(hex: 0)  // <--- black
+        }
+        // or using ternaries as requested
+        // let hexString = hex.starts(with: "#") ? String(hex.dropFirst()) : hex
+        // let ui64 = UInt64(hexString, radix: 16)
+        // self.init(hex: ui64 != nil ? Int(ui64!) : 0)
+    }
+        
+        convenience init(hex: Int) {
+            let components = (
+                R: CGFloat((hex >> 16) & 0xff) / 255,
+                G: CGFloat((hex >> 08) & 0xff) / 255,
+                B: CGFloat((hex >> 00) & 0xff) / 255
+            )
+            self.init(red: components.R, green: components.G, blue: components.B, alpha: 1)
+        }
+
+//     func toHex(alpha: Bool = false) -> String? {
+//        guard let components = cgColor.components, components.count >= 3 else {
+//            return nil
+//        }
+//        
+//        let r = Float(components[0])
+//        let g = Float(components[1])
+//        let b = Float(components[2])
+//        var a = Float(1.0)
+//        
+//        if components.count >= 4 {
+//            a = Float(components[3])
+//        }
+//        
+//        if alpha {
+//            return String(format: "%02lX%02lX%02lX%02lX", lroundf(r * 255), lroundf(g * 255), lroundf(b * 255), lroundf(a * 255))
+//        } else {
+//            return String(format: "%02lX%02lX%02lX", lroundf(r * 255), lroundf(g * 255), lroundf(b * 255))
+//        }
+//    }
+}

PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Headers/KMAdvertisementTimeStampConversion.swift → PDF Office/PDF Master/Class/KMAdvertisement/Model/KMAdvertisementTimeStampConversion.swift


PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Headers/KMAdvertisementRequestServer.swift → PDF Office/PDF Master/Class/KMAdvertisement/Request/KMAdvertisementRequestServer.swift


+ 48 - 0
PDF Office/PDF Master/Class/KMAdvertisement/View/Tableview/Cell/KMAdvertisementCollectionHeadView.swift

@@ -0,0 +1,48 @@
+//
+//  KMAdvertisementCollectionHeadView.swift
+//  KMAdvertisement
+//
+//  Created by lizhe on 2022/11/28.
+//
+
+#if os(OSX)
+    import AppKit
+#elseif os(iOS)
+    import UIKit
+#endif
+class KMAdvertisementCollectionHeadView: NSView {
+
+    lazy var titleTextField: NSTextField? = {
+        for view in self.subviews {
+            if view is NSTextField {
+                return view as? NSTextField
+            }
+        }
+        return nil
+    }()
+    
+    var model: KMAdvertisementItem! {
+        didSet {
+            self.reloadData()
+        }
+    }
+    
+    func reloadData() {
+        if model?.name != nil {
+            self.titleTextField?.stringValue = KMAdvertisementModelTransition.transitionLanguage(langeuage: (model?.name)!)
+        }
+        
+        self.titleTextField?.textColor = KMAppearance.Layout.h1Color()
+        
+//        if model.sectionTitle?.color != nil {
+//            self.titleTextField?.textColor = KMAdvertisementModelTransition.transitionColor(color: (model.sectionTitle?.color)!, highlight: false)
+//        }
+    }
+    
+    override func draw(_ dirtyRect: NSRect) {
+        super.draw(dirtyRect)
+
+        // Drawing code here.
+    }
+    
+}

+ 32 - 0
PDF Office/PDF Master/Class/KMAdvertisement/View/Tableview/Cell/KMAdvertisementCollectionHeadView.xib

@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22155" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22155"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner"/>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <customView id="c22-O7-iKe" customClass="KMAdvertisementCollectionHeadView" customModule="PDF_Master" customModuleProvider="target">
+            <rect key="frame" x="0.0" y="0.0" width="480" height="30"/>
+            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+            <subviews>
+                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="DuE-Mw-GiV">
+                    <rect key="frame" x="6" y="7" width="37" height="16"/>
+                    <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="KZj-T6-HnW">
+                        <font key="font" usesAppearanceFont="YES"/>
+                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                    </textFieldCell>
+                </textField>
+            </subviews>
+            <constraints>
+                <constraint firstItem="DuE-Mw-GiV" firstAttribute="centerY" secondItem="c22-O7-iKe" secondAttribute="centerY" id="b12-fX-rby"/>
+                <constraint firstItem="DuE-Mw-GiV" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" constant="8" id="rGK-BD-UB7"/>
+            </constraints>
+            <point key="canvasLocation" x="0.0" y="172"/>
+        </customView>
+    </objects>
+</document>

+ 61 - 0
PDF Office/PDF Master/Class/KMAdvertisement/View/Tableview/Cell/KMAdvertisementCollectionViewItem.swift

@@ -0,0 +1,61 @@
+//
+//  KMAdvertisementCollectionViewItem.swift
+//  KMAdvertisement
+//
+//  Created by lizhe on 2022/11/28.
+//
+
+import Cocoa
+class KMAdvertisementCollectionViewItem: NSCollectionViewItem {
+    @IBOutlet weak var iconImageView: NSImageView!
+    @IBOutlet weak var titleLabel: NSTextField!
+    
+    @IBOutlet weak var contentView: NSView!
+    var model: KMAdvertisementItemInfo? {
+        didSet {
+            self.reloadData()
+        }
+    }
+    
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        // Do view setup here.
+        self.view.addTrackingRect(self.view.bounds, owner: self, userData: nil, assumeInside: false)
+        self.contentView.wantsLayer = true
+        self.contentView.layer?.masksToBounds = true
+        self.updateColor(false)
+//        self.contentView.layer?.backgroundColor = NSColor.init(red: 38.0/255.0, green: 40/255.0, blue: 43/255.0, alpha: 1).cgColor
+    }
+    
+    func reloadData() {
+        self.titleLabel.stringValue = KMAdvertisementModelTransition.transitionLanguage(langeuage: model?.name)
+//        self.titleLabel.font = NSFont.init(name: model?.title?.font?.name ?? "AppleSystemUIFont", size: CGFloat(model?.title?.font?.size ?? 13))
+        self.contentView.toolTip = KMAdvertisementModelTransition.transitionLanguage(langeuage: model?.tooltip)
+        self.contentView.layer?.cornerRadius = 8
+        self.updateColor(false)
+    }
+    
+    func updateColor(_ highlight: Bool) {
+        
+        if highlight {
+            self.titleLabel.textColor = KMAppearance.Layout.mColor()
+            self.contentView.layer?.backgroundColor = KMAppearance.Status.hovColor().cgColor
+        } else {
+            self.titleLabel.textColor = KMAppearance.Layout.h1Color()
+            self.contentView.layer?.backgroundColor = KMAppearance.Layout.l0Color().cgColor
+        }
+        
+        let url = URL(string: KMAdvertisementModelTransition.transitionImagePath(image: model?.image, highlight: highlight))
+        self.iconImageView.image = KMAdvertisementImage.imageWithURL(url: url, completion: { [weak self] image in
+            self?.iconImageView.image = image
+        })
+    }
+    
+    override func mouseEntered(with event: NSEvent) {
+        self.updateColor(true)
+    }
+
+    override func mouseExited(with event: NSEvent) {
+        self.updateColor(false)
+    }
+}

+ 60 - 0
PDF Office/PDF Master/Class/KMAdvertisement/View/Tableview/Cell/KMAdvertisementCollectionViewItem.xib

@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22155" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22155"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner" customClass="KMAdvertisementCollectionViewItem" customModule="PDF_Master" customModuleProvider="target">
+            <connections>
+                <outlet property="contentView" destination="LdM-b2-48C" id="hxf-ZH-gmW"/>
+                <outlet property="iconImageView" destination="EPJ-sc-6wa" id="qq0-MW-YTG"/>
+                <outlet property="titleLabel" destination="8KY-8V-DxN" id="tt2-Pa-lKm"/>
+                <outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
+            </connections>
+        </customObject>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <customView clipsToBounds="YES" id="Hz6-mo-xeY">
+            <rect key="frame" x="0.0" y="0.0" width="480" height="40"/>
+            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+            <subviews>
+                <customView translatesAutoresizingMaskIntoConstraints="NO" id="LdM-b2-48C">
+                    <rect key="frame" x="8" y="0.0" width="464" height="40"/>
+                    <subviews>
+                        <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="EPJ-sc-6wa">
+                            <rect key="frame" x="8" y="11" width="18" height="18"/>
+                            <constraints>
+                                <constraint firstAttribute="width" constant="18" id="Ywl-Eq-mjQ"/>
+                                <constraint firstAttribute="height" constant="18" id="hZR-Bt-Rqf"/>
+                            </constraints>
+                            <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyUpOrDown" id="3Et-Pz-ChQ"/>
+                        </imageView>
+                        <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="8KY-8V-DxN">
+                            <rect key="frame" x="32" y="12" width="37" height="16"/>
+                            <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="Ikm-0K-43v">
+                                <font key="font" metaFont="system"/>
+                                <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                            </textFieldCell>
+                        </textField>
+                    </subviews>
+                    <constraints>
+                        <constraint firstItem="8KY-8V-DxN" firstAttribute="centerY" secondItem="LdM-b2-48C" secondAttribute="centerY" id="QhX-B6-0Gz"/>
+                        <constraint firstItem="EPJ-sc-6wa" firstAttribute="centerY" secondItem="LdM-b2-48C" secondAttribute="centerY" id="S3d-gc-JcD"/>
+                        <constraint firstItem="8KY-8V-DxN" firstAttribute="leading" secondItem="EPJ-sc-6wa" secondAttribute="trailing" constant="8" id="WvN-xe-2DQ"/>
+                        <constraint firstItem="EPJ-sc-6wa" firstAttribute="leading" secondItem="LdM-b2-48C" secondAttribute="leading" constant="8" id="ySs-Bg-GIy"/>
+                    </constraints>
+                </customView>
+            </subviews>
+            <constraints>
+                <constraint firstItem="LdM-b2-48C" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="8" id="3Z0-5E-Ft2"/>
+                <constraint firstAttribute="trailing" secondItem="LdM-b2-48C" secondAttribute="trailing" constant="8" id="QxU-Q6-tXm"/>
+                <constraint firstAttribute="bottom" secondItem="LdM-b2-48C" secondAttribute="bottom" id="Yfe-zv-dSm"/>
+                <constraint firstItem="LdM-b2-48C" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" id="vKN-hS-h44"/>
+            </constraints>
+            <point key="canvasLocation" x="157" y="45"/>
+        </customView>
+    </objects>
+</document>

+ 176 - 0
PDF Office/PDF Master/Class/KMAdvertisement/View/Tableview/KMAdvertisementTableView.swift

@@ -0,0 +1,176 @@
+//
+//  KMAdvertisementTableView.swift
+//  KMAdvertisement
+//
+//  Created by lizhe on 2022/11/28.
+//
+
+#if os(OSX)
+    import AppKit
+#elseif os(iOS)
+    import UIKit
+#endif
+
+typealias KMAdvertisementTableViewDidSelect = (_ view: KMAdvertisementTableView, _ item: KMAdvertisementItemInfo) -> Void
+@objcMembers open class KMAdvertisementTableView: NSView {
+
+    @IBOutlet var contentView: NSView!
+    
+    @IBOutlet weak var collectionView: NSCollectionView!
+
+    
+    var didSelect: KMAdvertisementTableViewDidSelect?
+    /**
+      @abstract 外部传入数据
+      @param inputData 文件路劲
+      */
+    open var inputData: KMAdvertisementContent! {
+        didSet {
+            self.reloadData()
+        }
+    }
+
+    //内部使用数据
+    fileprivate var data: [KMAdvertisementItem] = []
+
+    open override func draw(_ dirtyRect: NSRect) {
+        super.draw(dirtyRect)
+
+        // Drawing code here.
+    }
+    
+    convenience init (data: [KMAdvertisementItem], superView: NSView) {
+        self.init(frame: superView.bounds)
+        superView.addSubview(self)
+        self.autoresizingMask = [.height , .width]
+//        self.translatesAutoresizingMaskIntoConstraints = false
+//        NSLayoutConstraint.activate([
+//            self.topAnchor.constraint(equalTo: topAnchor),
+//            self.leftAnchor.constraint(equalTo: leftAnchor),
+//            self.rightAnchor.constraint(equalTo: rightAnchor),
+//            self.bottomAnchor.constraint(equalTo: bottomAnchor)])
+//        self.updateConstraintsForSubtreeIfNeeded()
+    }
+    
+    public override init(frame frameRect: NSRect) {
+        super.init(frame: frameRect)
+        initContentView()
+        setup()
+    }
+    
+    // MARK: 初始化
+    public required init?(coder decoder: NSCoder) {
+        super.init(coder: decoder)
+        initContentView()
+        setup()
+    }
+
+    private func initContentView() {
+        //绑定xib
+        let resource = NSNib(nibNamed: String(describing: self.classForCoder.self),
+                             bundle: Bundle(for: self.classForCoder.self))!
+        resource.instantiate(withOwner: self, topLevelObjects: nil)
+        addSubview(contentView)
+        contentView.translatesAutoresizingMaskIntoConstraints = false
+        NSLayoutConstraint.activate([
+            contentView.topAnchor.constraint(equalTo: topAnchor),
+            contentView.leftAnchor.constraint(equalTo: leftAnchor),
+            contentView.rightAnchor.constraint(equalTo: rightAnchor),
+            contentView.bottomAnchor.constraint(equalTo: bottomAnchor)])
+        contentView.updateConstraintsForSubtreeIfNeeded()
+    }
+    
+    func setup() {
+        //设置代理
+        self.collectionView.delegate = self
+        self.collectionView.dataSource = self
+        //是否可选中
+        self.collectionView.isSelectable = true
+        //注册cell
+        self.collectionView.register(KMAdvertisementCollectionViewItem.self, forItemWithIdentifier: NSUserInterfaceItemIdentifier(rawValue: "KMAdvertisementCollectionViewItem"))
+        
+        self.backgroundColor(KMAppearance.Layout.l0Color())
+    }
+    
+    func reloadData() {
+        self.data.removeAll()
+        if inputData.recommondContentPDFPro != nil {
+            self.data.append(inputData.recommondContentPDFPro!)
+        }
+        
+        if inputData.recommondContentOther != nil {
+            self.data.append(inputData.recommondContentOther!)
+        }
+        
+        self.collectionView.reloadData()
+    }
+}
+
+extension KMAdvertisementTableView: NSCollectionViewDelegate {
+    //当item被选中
+    public func collectionView(_ collectionView: NSCollectionView, didSelectItemsAt indexPaths: Set<IndexPath>) {
+        print("点击")
+        let view = collectionView.item(at: indexPaths.first!) as! KMAdvertisementCollectionViewItem
+        
+        let content = view.model
+        
+        guard let callBack = didSelect else { return }
+        
+        content?.index = indexPaths.first!.item
+        callBack(self, content!)
+    }
+    
+   //当item取消选中
+    public func collectionView(_ collectionView: NSCollectionView, didDeselectItemsAt indexPaths: Set<IndexPath>) {
+        _ = collectionView.item(at: indexPaths.first!) as! KMAdvertisementCollectionViewItem
+    }
+}
+
+extension KMAdvertisementTableView: NSCollectionViewDataSource {
+    public func numberOfSections(in collectionView: NSCollectionView) -> Int {
+        return self.data.count
+    }
+    
+    public func collectionView(_ collectionView: NSCollectionView, numberOfItemsInSection section: Int) -> Int {
+        let model: KMAdvertisementItem = (self.data[section])
+        return model.content!.count
+    }
+    
+    //返回对应的item自定义个体
+    public func collectionView(_ collectionView: NSCollectionView, itemForRepresentedObjectAt indexPath: IndexPath) -> NSCollectionViewItem {
+        let view = collectionView.makeItem(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "KMAdvertisementCollectionViewItem"), for: indexPath) as! KMAdvertisementCollectionViewItem
+        
+        let model = self.data[indexPath.section]
+        view.model = model.content![indexPath.item]
+        return view
+    }
+    
+    public func collectionView(_ collectionView: NSCollectionView, viewForSupplementaryElementOfKind kind: NSCollectionView.SupplementaryElementKind, at indexPath: IndexPath) -> NSView {
+        var nibName: String?
+        if kind == NSCollectionView.elementKindSectionHeader {
+            nibName = "KMAdvertisementCollectionHeadView"
+        }
+        
+        let view = collectionView.makeSupplementaryView(ofKind: kind, withIdentifier: NSUserInterfaceItemIdentifier(rawValue: nibName!), for: indexPath)
+        if let view = view as? KMAdvertisementCollectionHeadView {
+            let model = self.data[indexPath.section]
+            view.model = model
+        }
+        return view
+    }
+}
+
+extension KMAdvertisementTableView: NSCollectionViewDelegateFlowLayout {
+    
+    public func collectionView(_ collectionView: NSCollectionView, layout collectionViewLayout: NSCollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> NSSize {
+        return NSSize(width: self.contentView.bounds.width, height: 32)
+    }
+    
+    public func collectionView(_ collectionView: NSCollectionView, layout collectionViewLayout: NSCollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> NSSize {
+        return NSSize(width: 0, height: 30)
+    }
+    
+    public func collectionView(_ collectionView: NSCollectionView, layout collectionViewLayout: NSCollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat {
+        return 4
+    }
+}

+ 57 - 0
PDF Office/PDF Master/Class/KMAdvertisement/View/Tableview/KMAdvertisementTableView.xib

@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22155" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22155"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner" customClass="KMAdvertisementTableView" customModule="PDF_Master" customModuleProvider="target">
+            <connections>
+                <outlet property="collectionView" destination="DM1-E5-H8J" id="npq-W6-KFs"/>
+                <outlet property="contentView" destination="c22-O7-iKe" id="PMK-sn-xgD"/>
+            </connections>
+        </customObject>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <customView id="c22-O7-iKe">
+            <rect key="frame" x="0.0" y="0.0" width="246" height="431"/>
+            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+            <subviews>
+                <scrollView wantsLayer="YES" borderType="none" autohidesScrollers="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="UFo-Fd-Vqk">
+                    <rect key="frame" x="0.0" y="0.0" width="246" height="431"/>
+                    <clipView key="contentView" drawsBackground="NO" id="M51-ZI-aP5">
+                        <rect key="frame" x="0.0" y="0.0" width="246" height="431"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <subviews>
+                            <collectionView id="DM1-E5-H8J">
+                                <rect key="frame" x="0.0" y="0.0" width="246" height="431"/>
+                                <autoresizingMask key="autoresizingMask" widthSizable="YES"/>
+                                <collectionViewFlowLayout key="collectionViewLayout" id="QQ0-er-OSn">
+                                    <size key="itemSize" width="50" height="50"/>
+                                </collectionViewFlowLayout>
+                                <color key="primaryBackgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                            </collectionView>
+                        </subviews>
+                        <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                    </clipView>
+                    <scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="PAQ-UO-Nz6">
+                        <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="BXa-fT-rRG">
+                        <rect key="frame" x="234" y="1" width="15" height="143"/>
+                        <autoresizingMask key="autoresizingMask"/>
+                    </scroller>
+                </scrollView>
+            </subviews>
+            <constraints>
+                <constraint firstAttribute="bottom" secondItem="UFo-Fd-Vqk" secondAttribute="bottom" id="KWL-Zf-KFW"/>
+                <constraint firstItem="UFo-Fd-Vqk" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" id="ShF-i8-p4g"/>
+                <constraint firstItem="UFo-Fd-Vqk" firstAttribute="top" secondItem="c22-O7-iKe" secondAttribute="top" id="oVj-wf-0sg"/>
+                <constraint firstAttribute="trailing" secondItem="UFo-Fd-Vqk" secondAttribute="trailing" id="v5c-3v-n9k"/>
+            </constraints>
+            <point key="canvasLocation" x="27" y="170"/>
+        </customView>
+    </objects>
+</document>

+ 71 - 0
PDF Office/PDF Master/Class/KMAdvertisement/View/View/KMAdvertisementShowView.swift

@@ -0,0 +1,71 @@
+//
+//  KMAdvertisementShowView.swift
+//  PDF Master
+//
+//  Created by lizhe on 2023/10/26.
+//
+
+import Cocoa
+
+class KMAdvertisementShowView: NSView {
+    @IBOutlet var contentView: NSView!
+    @IBOutlet weak var iconImage: NSImageView!
+    @IBOutlet weak var closeButton: NSButton!
+    
+    open var inputData: KMAdvertisementItem! {
+        didSet {
+            self.reloadData()
+        }
+    }
+    
+    convenience init (data: [KMAdvertisementItem], superView: NSView) {
+        self.init(frame: superView.bounds)
+        superView.addSubview(self)
+        self.autoresizingMask = [.height , .width]
+    }
+    
+    public override init(frame frameRect: NSRect) {
+        super.init(frame: frameRect)
+        initContentView()
+        setup()
+    }
+    
+    // MARK: 初始化
+    public required init?(coder decoder: NSCoder) {
+        super.init(coder: decoder)
+        initContentView()
+        setup()
+    }
+
+    private func initContentView() {
+        //绑定xib
+        let resource = NSNib(nibNamed: String(describing: self.classForCoder.self),
+                             bundle: Bundle(for: self.classForCoder.self))!
+        resource.instantiate(withOwner: self, topLevelObjects: nil)
+        addSubview(contentView)
+        contentView.translatesAutoresizingMaskIntoConstraints = false
+        NSLayoutConstraint.activate([
+            contentView.topAnchor.constraint(equalTo: topAnchor),
+            contentView.leftAnchor.constraint(equalTo: leftAnchor),
+            contentView.rightAnchor.constraint(equalTo: rightAnchor),
+            contentView.bottomAnchor.constraint(equalTo: bottomAnchor)])
+        contentView.updateConstraintsForSubtreeIfNeeded()
+    }
+    
+    func setup() {
+        self.backgroundColor(NSColor.black)
+    }
+    
+    func reloadData() {
+        guard let model = inputData.content?.first else { return }
+        
+        let url = URL(string: KMAdvertisementModelTransition.transitionImagePath(image: model.image, highlight: false))
+        self.iconImage.image = KMAdvertisementImage.imageWithURL(url: url, completion: { [weak self] image in
+            self?.iconImage.image = image
+        })
+    }
+    
+    @IBAction func closeButtonAction(_ sender: Any) {
+        
+    }
+}

+ 78 - 0
PDF Office/PDF Master/Class/KMAdvertisement/View/View/KMAdvertisementShowView.xib

@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22155" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22155"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner" customClass="KMAdvertisementShowView" customModule="PDF_Master" customModuleProvider="target">
+            <connections>
+                <outlet property="closeButton" destination="Iay-VK-ICj" id="65i-qn-Dts"/>
+                <outlet property="contentView" destination="c22-O7-iKe" id="GO1-1D-DOk"/>
+                <outlet property="iconImage" destination="obQ-2R-s8Q" id="1En-Hz-bM1"/>
+            </connections>
+        </customObject>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <customView id="c22-O7-iKe">
+            <rect key="frame" x="0.0" y="0.0" width="208" height="120"/>
+            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+            <subviews>
+                <view translatesAutoresizingMaskIntoConstraints="NO" id="geo-Fe-wJO">
+                    <rect key="frame" x="0.0" y="0.0" width="208" height="120"/>
+                    <subviews>
+                        <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="obQ-2R-s8Q">
+                            <rect key="frame" x="0.0" y="0.0" width="208" height="120"/>
+                            <constraints>
+                                <constraint firstAttribute="width" secondItem="obQ-2R-s8Q" secondAttribute="height" multiplier="208:120" id="VpK-gc-yT8"/>
+                            </constraints>
+                            <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" id="DKy-5d-0cT"/>
+                        </imageView>
+                        <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="FlW-6z-t7c">
+                            <rect key="frame" x="0.0" y="0.0" width="208" height="120"/>
+                            <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" imagePosition="left" inset="2" id="RqG-IP-4V1">
+                                <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                <font key="font" metaFont="system"/>
+                            </buttonCell>
+                        </button>
+                        <button translatesAutoresizingMaskIntoConstraints="NO" id="Iay-VK-ICj">
+                            <rect key="frame" x="178" y="90" width="30" height="30"/>
+                            <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="ad_cancel_button00" imagePosition="only" alignment="center" imageScaling="proportionallyUpOrDown" inset="2" id="8hF-TJ-Gz3">
+                                <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                <font key="font" metaFont="system"/>
+                            </buttonCell>
+                            <connections>
+                                <action selector="closeButtonAction:" target="-2" id="o5y-02-xWU"/>
+                            </connections>
+                        </button>
+                    </subviews>
+                    <constraints>
+                        <constraint firstItem="Iay-VK-ICj" firstAttribute="top" secondItem="geo-Fe-wJO" secondAttribute="top" id="1h9-Vm-BE3"/>
+                        <constraint firstItem="FlW-6z-t7c" firstAttribute="leading" secondItem="geo-Fe-wJO" secondAttribute="leading" id="2Uc-K3-gXy"/>
+                        <constraint firstAttribute="trailing" secondItem="FlW-6z-t7c" secondAttribute="trailing" id="2gJ-5U-099"/>
+                        <constraint firstAttribute="bottom" secondItem="FlW-6z-t7c" secondAttribute="bottom" id="4Z2-Tb-tB1"/>
+                        <constraint firstAttribute="trailing" secondItem="obQ-2R-s8Q" secondAttribute="trailing" id="GgU-22-lBM"/>
+                        <constraint firstAttribute="bottom" secondItem="obQ-2R-s8Q" secondAttribute="bottom" id="Pd3-qI-Nx8"/>
+                        <constraint firstItem="obQ-2R-s8Q" firstAttribute="top" secondItem="geo-Fe-wJO" secondAttribute="top" id="f86-yV-16W"/>
+                        <constraint firstAttribute="trailing" secondItem="Iay-VK-ICj" secondAttribute="trailing" id="fkb-Kj-0hp"/>
+                        <constraint firstAttribute="height" constant="120" id="kze-Mi-xh1"/>
+                        <constraint firstItem="FlW-6z-t7c" firstAttribute="top" secondItem="geo-Fe-wJO" secondAttribute="top" id="oah-aB-v14"/>
+                        <constraint firstAttribute="width" constant="208" id="pzz-J5-rHf"/>
+                        <constraint firstItem="obQ-2R-s8Q" firstAttribute="leading" secondItem="geo-Fe-wJO" secondAttribute="leading" id="z7j-Ok-plA"/>
+                    </constraints>
+                </view>
+            </subviews>
+            <constraints>
+                <constraint firstItem="geo-Fe-wJO" firstAttribute="top" secondItem="c22-O7-iKe" secondAttribute="top" id="Wsc-Zz-Jcg"/>
+                <constraint firstAttribute="bottom" secondItem="geo-Fe-wJO" secondAttribute="bottom" id="XVI-eH-kLb"/>
+                <constraint firstItem="geo-Fe-wJO" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" id="pTB-hd-9WZ"/>
+                <constraint firstAttribute="trailing" secondItem="geo-Fe-wJO" secondAttribute="trailing" id="zJf-kp-Q7m"/>
+            </constraints>
+            <point key="canvasLocation" x="40" y="83.5"/>
+        </customView>
+    </objects>
+    <resources>
+        <image name="ad_cancel_button00" width="30" height="30"/>
+    </resources>
+</document>

+ 37 - 24
PDF Office/PDF Master/Class/PDFTools/PageEdit/Controller/KMPDFEditViewController.swift

@@ -142,6 +142,10 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
                     self.insertBlankPageAction()
                 } else if (index == KMPageEditType.insert_custom_page) {
                     self.item_insertCustomPage(sender: nil)
+                } else if (index == KMPageEditType.extract_selected_pages) {
+                    Swift.debugPrint("extract_selected_pages ... ")
+                } else if (index == KMPageEditType.split_selected_pages) {
+                    Swift.debugPrint("split_selected_pages ... ")
                 }
                 return
             }
@@ -165,11 +169,18 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
             } else if (type == .delete) {
                 self.deleteAction()
             } else if (type == .pageRange) {
-                self.km_comboBoxSelectionDidChange((item?.pageRangeView)!)
+//                self.km_comboBoxSelectionDidChange((item?.pageRangeView)!)
             } else if (type == .insert) {
                 self.trackEvent(type: .insert)
+            } else if (type == .copy) {
+                self.copyAction()
+            } else if (type == .paste) {
+                self.pasteAction()
             }
         }
+        toolBar.pageRangeitemClick = { [unowned self] type in
+            self.km_comboBoxSelectionDidChange(type)
+        }
         toolBar.pageRangeValueDidChange = { [unowned self] value, _ in
             self.km_controlTextDidEndEditing(self.toolBar.pageRangeView!)
         }
@@ -185,7 +196,7 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
             
             let enabled = (selectedIndexs.count > 0)
             for i in 0 ..< self.toolBar.toolBar.items.count {
-                let item: KMToolBoxItem = self.toolBar.toolBar.items[i]
+                let item = self.toolBar.toolBar.items[i]
                 if (item.itemIdentifier == KMToolbarPageEditExtractItemIdentifier ||
                     item.itemIdentifier == KMToolbarPageEditLeftRotateItemIdentifier ||
                     item.itemIdentifier == KMToolbarPageEditRightRotateItemIdentifier ||
@@ -897,25 +908,26 @@ extension KMPDFEditViewController {
 // MARK: - KMSelectPopButtonDelegate
 
 extension KMPDFEditViewController {
-    func km_comboBoxSelectionDidChange(_ obj: KMDesignSelect) {
+    func km_comboBoxSelectionDidChange(_ obj: KMPageRange) {
         self.pageIsUpdate = false
         
-        let index: Int = obj.indexOfSelectedItem
+//        let index: Int = obj.indexOfSelectedItem
+        let index = obj.rawValue
         var indexpaths: Set<IndexPath> = []
-        var type: KMPageRange?
-        if (index <= 0) { /// 全部页面
-            type = .all
-        } else if (index == 1) { /// 奇数页
-            type = .odd
-        } else if (index == 2) { /// 偶数页
-            type = .even
-        } else if (index == 3) { /// 横向页
-            type = .horizontal
-        } else if (index == 4) { /// 纵向页
-            type = .vertical
-        } else { /// 自定义
-            type = .custom
-        }
+        var type: KMPageRange? = obj
+//        if (index <= 0) { /// 全部页面
+//            type = .all
+//        } else if (index == 1) { /// 奇数页
+//            type = .odd
+//        } else if (index == 2) { /// 偶数页
+//            type = .even
+//        } else if (index == 3) { /// 横向页
+//            type = .horizontal
+//        } else if (index == 4) { /// 纵向页
+//            type = .vertical
+//        } else { /// 自定义
+//            type = .custom
+//        }
         
         for i in 0 ..< (self.pdfDocument?.pageCount)! {
             if (type == .all) {
@@ -945,13 +957,14 @@ extension KMPDFEditViewController {
             }
         }
         
-        obj.editable = type == .custom
+//        obj.editable = type == .custom
         if (type == .custom) {
-            self.clearSelectPages()
-            DispatchQueue.main.async {
-                self.toolBar.pageRangeView?.stringValue = ""
-                self.view.window?.makeFirstResponder(self.toolBar.pageRangeView?.textField)
-            }
+//            self.clearSelectPages()
+//            DispatchQueue.main.async {
+//                self.toolBar.pageRangeView?.stringValue = ""
+//                self.view.window?.makeFirstResponder(self.toolBar.pageRangeView?.textField)
+//            }
+            Swift.debugPrint("KMPDFEditViewController-km_comboBoxSelectionDidChange-custom ...")
         } else {
             self.pageEditThumbnailView.selectPages(at: indexpaths)
         }

+ 210 - 69
PDF Office/PDF Master/Class/PDFTools/PageEdit/View/KMPDFEditToolbar.swift

@@ -17,6 +17,7 @@ enum KMPageEditType: Int {
     case replace
     case split
     case reverse
+    case copy
     case delete
     
     case zoomOut
@@ -42,11 +43,23 @@ enum KMPageEditType: Int {
             return self.insert.rawValue + 1002
         }
     }
+    
+    static var extract_selected_pages: Int {
+        get {
+            return self.extract.rawValue + 2000
+        }
+    }
+    
+    static var split_selected_pages: Int {
+        get {
+            return self.split.rawValue + 3000
+        }
+    }
 }
 
 class KMPDFEditToolbar: NSView {
-    private var toolBar_ = KMToolbar()
-    var toolBar: KMToolbar {
+    private var toolBar_ = KMToolbarView.init(identifier: "KMPageEditIdentifier")
+    var toolBar: KMToolbarView {
         get {
             return self.toolBar_
         }
@@ -80,6 +93,7 @@ class KMPDFEditToolbar: NSView {
                               KMTools.pageRangeTypeString(pageRange: .custom)]
     
     var itemClick: KMItemClickBlock<KMPDFEditToolbar>?
+    var pageRangeitemClick: ((KMPageRange)->Void)?
     var pageRangeValueDidChange: KMValueDidChangeBlock?
     
     lazy var insertItemStrings: [String] = {
@@ -114,10 +128,10 @@ class KMPDFEditToolbar: NSView {
         self.toolBar.autoresizingMask = [.width, .height]
         self.toolBar.delegate = self
         
-        let rightItemView = self.rightItemView
-        self.addSubview(rightItemView)
-        rightItemView.frame = NSMakeRect(NSWidth(self.frame)-80, 0, 80, NSHeight(self.frame))
-        rightItemView.autoresizingMask = [.minXMargin, .height]
+//        let rightItemView = self.rightItemView
+//        self.addSubview(rightItemView)
+//        rightItemView.frame = NSMakeRect(NSWidth(self.frame)-80, 0, 80, NSHeight(self.frame))
+//        rightItemView.autoresizingMask = [.minXMargin, .height]
     }
     
     // MARK: - Publick Methods
@@ -127,8 +141,8 @@ class KMPDFEditToolbar: NSView {
         self.pageRangeView?.editable = true
     }
     
-    public func getItem(for itemId: String) -> KMToolBoxItem? {
-        return self.toolBar.item(forItemIdentifier: itemId)
+    public func getItem(for itemId: String) -> KMToolbarItemView? {
+        return self.toolBar.itemForItemIdentifier(itemId)
     }
     
     public func selectItem(for itemId: String) {
@@ -158,7 +172,19 @@ class KMPDFEditToolbar: NSView {
     // MARK: toolBar 菜单事件
     
     @objc func pageRangeMenuAction(sender: KMToolbarClickButton) {
-        
+        if let subMenu = (sender.clickObject as? KMToolbarItemView)?.menuFormRepresentation?.submenu {
+            subMenu.popUp(positioning: nil, at: sender.frame.origin, in: sender.superview)
+        }
+    }
+    
+    @objc private func _pageRangeAction(sender: NSMenuItem) {
+        guard let type = KMPageRange(rawValue: sender.tag) else {
+            return
+        }
+        guard let callback = self.pageRangeitemClick else {
+            return
+        }
+        callback(type)
     }
     
     @objc func leftRotateMenuAction(sender: KMToolbarClickButton?) {
@@ -216,10 +242,48 @@ class KMPDFEditToolbar: NSView {
     }
     
     @objc func extractMenuAction(sender: KMToolbarClickButton?) {
-        guard let callback = self.itemClick else {
+//        guard let callback = self.itemClick else {
+//            return
+//        }
+//        callback(self, KMPageEditType.insert.rawValue)
+        
+        if let _popover = self.popover, _popover.isShown {
+            self.popover?.close()
+            self.popover = nil
             return
         }
-        callback(self, KMPageEditType.extract.rawValue)
+        
+        let array = [NSLocalizedString("Extract selected pages", comment: ""), NSLocalizedString("Extract", comment: "")]
+        let vc: KMHomePopViewController = KMHomePopViewController().initWithPopViewDataArr(array)
+        let popover: NSPopover = NSPopover.init()
+        self.popover = popover
+        popover.contentViewController = vc
+        popover.animates = true
+        popover.behavior = .semitransient
+        popover.setValue(true, forKey: "shouldHideAnchor")
+        popover.show(relativeTo: CGRect(x: sender!.bounds.origin.x, y: 10, width: sender!.bounds.size.width, height: sender!.bounds.size.height), of: sender!, preferredEdge: .maxY)
+        vc.downCallback = { [weak self] downEntered, count in
+            self?.popover?.close()
+            self?.popover = nil
+            
+            if (!downEntered) {
+                return
+            }
+            guard let index = array.firstIndex(of: count) else {
+                return
+            }
+            if (index == 0) {
+                guard let callback = self?.itemClick else {
+                    return
+                }
+                callback(self, KMPageEditType.extract_selected_pages)
+            } else if (index == 1) {
+                guard let callback = self?.itemClick else {
+                    return
+                }
+                callback(self, KMPageEditType.extract.rawValue)
+            }
+        }
     }
     
     @objc func replaceMenuAction(sender: KMToolbarClickButton?) {
@@ -230,10 +294,9 @@ class KMPDFEditToolbar: NSView {
     }
     
     @objc func splitMenuAction(sender: KMToolbarClickButton) {
-        guard let callback = self.itemClick else {
-            return
+        if let subMenu = (sender.clickObject as? KMToolbarItemView)?.menuFormRepresentation?.submenu {
+            subMenu.popUp(positioning: nil, at: sender.frame.origin, in: sender.superview)
         }
-        callback(self, KMPageEditType.split.rawValue)
     }
     
     @objc func reverseMenuAction(sender: KMToolbarClickButton) {
@@ -243,6 +306,20 @@ class KMPDFEditToolbar: NSView {
         callback(self, KMPageEditType.reverse.rawValue)
     }
     
+    @objc func copyMenuAction(sender: KMToolbarClickButton) {
+        guard let callback = self.itemClick else {
+            return
+        }
+        callback(self, KMPageEditType.copy.rawValue)
+    }
+    
+    @objc func pasteMenuAction(sender: KMToolbarClickButton) {
+        guard let callback = self.itemClick else {
+            return
+        }
+        callback(self, KMPageEditType.paste.rawValue)
+    }
+    
     @objc func deleteMenuAction(sender: KMToolbarClickButton) {
         guard let callback = self.itemClick else {
             return
@@ -271,6 +348,20 @@ class KMPDFEditToolbar: NSView {
         callback(self, KMPageEditType.insert_custom_page)
     }
     
+    @objc private func _splitAction(sender: NSMenuItem) {
+        if (sender.tag == 1) {
+            guard let callback = self.itemClick else {
+                return
+            }
+            callback(self, KMPageEditType.split.rawValue)
+            return
+        }
+        guard let callback = self.itemClick else {
+            return
+        }
+        callback(self, KMPageEditType.split_selected_pages)
+    }
+    
     private lazy var rightItemView: NSView = {
         let view = NSView()
         
@@ -301,53 +392,75 @@ class KMPDFEditToolbar: NSView {
 
 // MARK: - KMNewToolbarDelegate
 
-extension KMPDFEditToolbar: KMNewToolbarDelegate {
-    func toolbarDefaultItemIdentifiers(_ toolbar: KMToolbar!) -> [String]! {
+extension KMPDFEditToolbar: KMToolbarViewDelegate {
+    func toolbarDefaultItemIdentifiers(_ toolbar: KMToolbarView) -> [String] {
         return [KMToolbarPageEditPageRangeItemIdentifier,
-                KMToolbarPageEditLeftRotateItemIdentifier,
-                KMToolbarPageEditRightRotateItemIdentifier,
+//                KMToolbarPageEditLeftRotateItemIdentifier,
+//                KMToolbarPageEditRightRotateItemIdentifier,
                 KMToolbarDividerItemIdentifier,
                 KMToolbarPageEditInsetItemIdentifier,
-                KMToolbarPageEditExtractItemIdentifier,
                 KMToolbarPageEditReplaceItemIdentifier,
+                KMToolbarPageEditExtractItemIdentifier,
                 KMToolbarPageEditSplitItemIdentifier,
+                KMToolbarPageEditRotateItemIdentifier,
                 KMToolbarPageEditReverseItemIdentifier,
-                KMToolbarDividerItemIdentifier,
+                KMToolbarPageEditCopyItemIdentifier,
+                KMToolbarPageEditPasteItemIdentifier,
                 KMToolbarPageEditDeleteItemIdentifier]
     }
     
-    func toolbar(_ toolbar: KMToolbar!, itemForItemIdentifier identifier: String!) -> KMToolBoxItem! {
-        let item = KMToolBoxItem(itemIdentifier: identifier)
+    
+    func toolbar(_ toolbar: KMToolbarView, itemFor identifier: String) -> KMToolbarItemView {
+        let item: KMToolbarItemView? = KMToolbarItemView(itemIdentifier: identifier)
         if (identifier == KMToolbarPageEditPageRangeItemIdentifier) {
-            item?.image = NSImage(named: "KMImageNameMainToolbarrRight")
-            item?.alternateImage = NSImage(named: "KMImageNameMainToolbarrRight")
+            item?.image = NSImage(named: KMImageNameUXIconSubtoolbarPageRange)
             item?.target = self
             item?.btnTag = KMPageEditType.pageRange.rawValue
 //            item?.toolTip = NSLocalizedString("pageRange", comment: "")
-            item?.titleName = NSLocalizedString("pageRange    ", comment: "")
-            item?.boxImagePosition = KMToolBoxImagePosition.left
+            item?.titleName = NSLocalizedString("Page Range", comment: "")
+            item?.boxImagePosition = .imageExpandLeft
             item?.btnAction = #selector(pageRangeMenuAction)
             
-            let view = NSView()
-            item?.addSubview(view)
-            view.frame = item!.bounds
-            view.autoresizingMask = [.width,.height]
-            view.wantsLayer = true
-            view.layer?.backgroundColor = NSColor.km_init(hex: "#F7F8FA").cgColor
+//            let view = NSView()
+//            item?.addSubview(view)
+//            view.frame = item!.bounds
+//            view.autoresizingMask = [.width,.height]
+//            view.wantsLayer = true
+//            view.layer?.backgroundColor = NSColor.km_init(hex: "#F7F8FA").cgColor
             
-            let comBoxView = KMDesignSelect(withType: .Combox)
-            view.addSubview(comBoxView.view)
-            comBoxView.view.frame = NSMakeRect(0, 0.5, NSWidth(view.frame), 21)
-            comBoxView.view.autoresizingMask = [.width]
-            comBoxView.removeAllItems()
-            comBoxView.addItems(withObjectValues: self.pageRangeViewItems)
-            comBoxView.selectItem(at: 0)
-            comBoxView.placeholderString = NSLocalizedString("eg .1,3-5,10", comment: "")
-            comBoxView.editable = false
-            comBoxView.delete = self
-            self.pageRangeView_ = comBoxView
+//            let comBoxView = KMDesignSelect(withType: .Combox)
+//            view.addSubview(comBoxView.view)
+//            comBoxView.view.frame = NSMakeRect(0, 0.5, NSWidth(view.frame), 21)
+//            comBoxView.view.autoresizingMask = [.width]
+//            comBoxView.removeAllItems()
+//            comBoxView.addItems(withObjectValues: self.pageRangeViewItems)
+//            comBoxView.selectItem(at: 0)
+//            comBoxView.placeholderString = NSLocalizedString("eg .1,3-5,10", comment: "")
+//            comBoxView.editable = false
+//            comBoxView.delete = self
+//            self.pageRangeView_ = comBoxView
+            
+            let menuItem = NSMenuItem.init(title: NSLocalizedString("Page Range", comment: ""), action: #selector(pageRangeMenuAction), target: self)
+            let subMenu = NSMenu()
+            subMenu.addItem(title: NSLocalizedString("Odd Pages Only", comment: ""), action: #selector(_pageRangeAction), target: self, tag: KMPageRange.odd.rawValue)
+            subMenu.addItem(title: NSLocalizedString("Even Pages Only", comment: ""), action: #selector(_pageRangeAction), target: self, tag: KMPageRange.even.rawValue)
+            subMenu.addItem(title: NSLocalizedString("Portrait pages", comment: ""), action: #selector(_pageRangeAction), target: self, tag: KMPageRange.vertical.rawValue)
+            subMenu.addItem(title: NSLocalizedString("Landscape pages", comment: ""), action: #selector(_pageRangeAction), target: self, tag: KMPageRange.horizontal.rawValue)
+            subMenu.addItem(title: NSLocalizedString("All Pages", comment: ""), action: #selector(_pageRangeAction), target: self, tag: KMPageRange.all.rawValue)
+            subMenu.addItem(title: NSLocalizedString("Customize", comment: ""), action: #selector(_pageRangeAction), target: self, tag: KMPageRange.custom.rawValue)
+            menuItem.submenu = subMenu
+            item?.menuFormRepresentation = menuItem
+        } else if (identifier == KMToolbarPageEditRotateItemIdentifier) {
+            item?.image = NSImage(named: KMImageNameUXIconSubtoolbarPageRotate)
+            item?.alternateImage = NSImage(named: KMImageNameUXIconSubtoolbarPageRotate)
+            item?.target = self
+            item?.btnTag = KMPageEditType.rightRotate.rawValue
+            item?.toolTip = NSLocalizedString("Rotate", comment: "")
+            item?.titleName = NSLocalizedString("Rotate", comment: "")
+            item?.boxImagePosition = .imageLeft
+            item?.btnAction = #selector(rightRotateMenuAction)
             
-            let menuItem = NSMenuItem.init(title: "pageRange", action: #selector(pageRangeMenuAction), target: self)
+            let menuItem = NSMenuItem.init(title: "", action: #selector(leftRotateMenuAction), target: self)
             item?.menuFormRepresentation = menuItem
         } else if (identifier == KMToolbarPageEditLeftRotateItemIdentifier) {
             item?.image = NSImage(named: "KMImageNameMainToolPageLeftRotate")
@@ -356,7 +469,7 @@ extension KMPDFEditToolbar: KMNewToolbarDelegate {
             item?.btnTag = KMPageEditType.leftRotate.rawValue
             item?.toolTip = NSLocalizedString("Rotate Left", comment: "")
             item?.titleName = NSLocalizedString("", comment: "")
-            item?.boxImagePosition = KMToolBoxImagePosition.left
+            item?.boxImagePosition = .imageLeft
             item?.btnAction = #selector(leftRotateMenuAction)
             
             let menuItem = NSMenuItem.init(title: "", action: #selector(leftRotateMenuAction), target: self)
@@ -368,86 +481,114 @@ extension KMPDFEditToolbar: KMNewToolbarDelegate {
             item?.btnTag = KMPageEditType.rightRotate.rawValue
             item?.toolTip = NSLocalizedString("Rotate Right", comment: "")
             item?.titleName = NSLocalizedString("", comment: "")
-            item?.boxImagePosition = KMToolBoxImagePosition.left
+            item?.boxImagePosition = .imageLeft
             item?.btnAction = #selector(rightRotateMenuAction)
             
             let menuItem = NSMenuItem.init(title: "", action: #selector(rightRotateMenuAction), target: self)
             item?.menuFormRepresentation = menuItem
         } else if (identifier == KMToolbarPageEditInsetItemIdentifier) {
-            item?.image = NSImage(named: "KMImageNameMainToolPageInsert")
-            item?.alternateImage = NSImage(named: "KMImageNameMainToolPageInsert")
+            item?.image = NSImage(named: KMImageNameUXIconSubtoolbarPageInsert)
+            item?.alternateImage = NSImage(named: KMImageNameUXIconSubtoolbarPageInsert)
             item?.target = self
             item?.btnTag = KMPageEditType.insert.rawValue
-            item?.toolTip = NSLocalizedString("Insert", comment: "")
+            item?.toolTip = NSLocalizedString("Inserting pages into an existing PDF", comment: "")
             item?.titleName = NSLocalizedString("Insert", comment: "")
-            item?.boxImagePosition = KMToolBoxImagePosition.expandLeft
+            item?.boxImagePosition = .imageExpandLeft
             item?.btnAction = #selector(insertMenuAction)
             
             let menuItem = NSMenuItem.init(title: "Insert", action: #selector(insertMenuAction), target: self)
             item?.menuFormRepresentation = menuItem
         } else if (identifier == KMToolbarPageEditExtractItemIdentifier) {
-            item?.image = NSImage(named: "KMImageNameMainToolPageExtract")
-            item?.alternateImage = NSImage(named: "KMImageNameMainToolPageExtract")
+            item?.image = NSImage(named: KMImageNameUXIconSubtoolbarPageExtract)
+            item?.alternateImage = NSImage(named: KMImageNameUXIconSubtoolbarPageExtract)
             item?.target = self
             item?.btnTag = KMPageEditType.extract.rawValue
-            item?.toolTip = NSLocalizedString("Extract", comment: "")
+            item?.toolTip = NSLocalizedString("Exctract selected pages", comment: "")
             item?.titleName = NSLocalizedString("Extract", comment: "")
-            item?.boxImagePosition = KMToolBoxImagePosition.left
+            item?.boxImagePosition = .imageExpandLeft
             item?.btnAction = #selector(extractMenuAction)
             
             let menuItem = NSMenuItem.init(title: "Extract", action: #selector(extractMenuAction), target: self)
             item?.menuFormRepresentation = menuItem
         } else if (identifier == KMToolbarPageEditReplaceItemIdentifier) {
-            item?.image = NSImage(named: "KMImageNameMainToolPageReplace")
-            item?.alternateImage = NSImage(named: "KMImageNameMainToolPageReplace")
+            item?.image = NSImage(named: KMImageNameToolbarReplace)
+            item?.alternateImage = NSImage(named: KMImageNameToolbarReplace)
             item?.target = self
             item?.btnTag = KMPageEditType.replace.rawValue
             item?.toolTip = NSLocalizedString("Replace", comment: "")
             item?.titleName = NSLocalizedString("Replace", comment: "")
-            item?.boxImagePosition = KMToolBoxImagePosition.left
+            item?.boxImagePosition = .imageLeft
             item?.btnAction = #selector(replaceMenuAction)
             
             let menuItem = NSMenuItem.init(title: "Replace", action: #selector(replaceMenuAction), target: self)
             item?.menuFormRepresentation = menuItem
         } else if (identifier == KMToolbarPageEditSplitItemIdentifier) {
-            item?.image = NSImage(named: "KMImageNameMainToolPageSplit")
-            item?.alternateImage = NSImage(named: "KMImageNameMainToolPageSplit")
+            item?.image = NSImage(named: KMImageNameUXIconSubtoolbarPageSplit)
+            item?.alternateImage = NSImage(named: KMImageNameUXIconSubtoolbarPageSplit)
             item?.target = self
             item?.btnTag = KMPageEditType.split.rawValue
-            item?.toolTip = NSLocalizedString("Split the PDF into multiple files", comment: "")
+            item?.toolTip = NSLocalizedString("Split and save selected PDF pages as a new separate document", comment: "")
             item?.titleName = NSLocalizedString("Split", comment: "")
-            item?.boxImagePosition = KMToolBoxImagePosition.left
+            item?.boxImagePosition = .imageExpandLeft
             item?.btnAction = #selector(splitMenuAction)
             
             let menuItem = NSMenuItem.init(title: "Split", action: #selector(splitMenuAction), target: self)
+            let subMenu = NSMenu()
+            subMenu.addItem(title: NSLocalizedString("Split selected pages", comment: ""), action: #selector(_splitAction), target: self, tag: 0)
+            subMenu.addItem(title: NSLocalizedString("Split", comment: ""), action: #selector(_splitAction), target: self, tag: 1)
+            menuItem.submenu = subMenu
             item?.menuFormRepresentation = menuItem
         } else if (identifier == KMToolbarPageEditReverseItemIdentifier) {
-            item?.image = NSImage(named: "KMImageNameMainToolPageReverse")
-            item?.alternateImage = NSImage(named: "KMImageNameMainToolPageReverse")
+            item?.image = NSImage(named: KMImageNameUXIconSubtoolbarPageReverse)
+            item?.alternateImage = NSImage(named: KMImageNameUXIconSubtoolbarPageReverse)
             item?.target = self
             item?.btnTag = KMPageEditType.reverse.rawValue
             item?.toolTip = NSLocalizedString("Reverse", comment: "")
             item?.titleName = NSLocalizedString("Reverse", comment: "")
-            item?.boxImagePosition = KMToolBoxImagePosition.left
+            item?.boxImagePosition = .imageLeft
             item?.btnAction = #selector(reverseMenuAction)
             
             let menuItem = NSMenuItem.init(title: "Reverse", action: #selector(reverseMenuAction), target: self)
             item?.menuFormRepresentation = menuItem
+        } else if (identifier == KMToolbarPageEditCopyItemIdentifier) {
+            item?.image = NSImage(named: KMImageNameUXIconSubtoolbarPageCopy)
+            item?.alternateImage = NSImage(named: KMImageNameUXIconSubtoolbarPageCopy)
+            item?.target = self
+            item?.btnTag = KMPageEditType.delete.rawValue
+            item?.toolTip = NSLocalizedString("Copy", comment: "")
+            item?.titleName = NSLocalizedString("Copy", comment: "")
+            item?.boxImagePosition = .imageLeft
+            item?.btnAction = #selector(copyMenuAction)
+            
+            let menuItem = NSMenuItem.init(title: "Delete", action: #selector(deleteMenuAction), target: self)
+            item?.menuFormRepresentation = menuItem
+        } else if (identifier == KMToolbarPageEditPasteItemIdentifier) {
+            item?.image = NSImage(named: KMImageNameUXIconSubtoolbarPagePaste)
+            item?.alternateImage = NSImage(named: KMImageNameUXIconSubtoolbarPagePaste)
+            item?.target = self
+            item?.btnTag = KMPageEditType.delete.rawValue
+            item?.toolTip = NSLocalizedString("Paste", comment: "")
+            item?.titleName = NSLocalizedString("Paste", comment: "")
+            item?.boxImagePosition = .imageLeft
+            item?.btnAction = #selector(pasteMenuAction)
+            
+            let menuItem = NSMenuItem.init(title: "Delete", action: #selector(deleteMenuAction), target: self)
+            item?.menuFormRepresentation = menuItem
         } else if (identifier == KMToolbarPageEditDeleteItemIdentifier) {
-            item?.image = NSImage(named: "KMImageNameMainToolPageDelete")
-            item?.alternateImage = NSImage(named: "KMImageNameMainToolPageDelete")
+            item?.image = NSImage(named: KMImageNameUXIconSubtoolbarPageDelete)
+            item?.alternateImage = NSImage(named: KMImageNameUXIconSubtoolbarPageDelete)
             item?.target = self
             item?.btnTag = KMPageEditType.delete.rawValue
             item?.toolTip = NSLocalizedString("Delete", comment: "")
-            item?.titleName = NSLocalizedString("", comment: "")
-            item?.boxImagePosition = KMToolBoxImagePosition.left
+            item?.titleName = NSLocalizedString("Delete", comment: "")
+            item?.boxImagePosition = .imageLeft
             item?.btnAction = #selector(deleteMenuAction)
             
             let menuItem = NSMenuItem.init(title: "Delete", action: #selector(deleteMenuAction), target: self)
             item?.menuFormRepresentation = menuItem
         }
         
-        return item
+        return item!
     }
 }
 

+ 0 - 18
PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolBarBox.swift

@@ -1,18 +0,0 @@
-//
-//  KMToolBarBox.swift
-//  PDF Master
-//
-//  Created by lxy on 2022/11/30.
-//
-
-import Cocoa
-
-class KMToolBarBox: NSBox {
-
-    override func draw(_ dirtyRect: NSRect) {
-        super.draw(dirtyRect)
-
-        
-    }
-    
-}

+ 0 - 107
PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbar.h

@@ -1,107 +0,0 @@
-//
-//  KMToolbar.h
-//
-
-//  Copyright © 2022 Kdan Mobile. All rights reserved.
-//
-
-#import <Cocoa/Cocoa.h>
-
-typedef NS_ENUM(NSInteger, KMToolBoxImagePosition) {
-    KMToolBoxImagePosition_Only = 0,
-    KMToolBoxImagePosition_Left,
-    KMToolBoxImagePosition_ExpandLeft,
-    KMToolBoxImagePosition_Above,
-};
-
-extern NSString *KMNewToolbarSpaceItemIdentifier;
-extern NSString *KMToolbarDividerItemIdentifier;
-
-@interface KMToolbarClickButton : NSButton
-
-@property (nonatomic,assign) id clickObject;
-
-@end
-
-@interface KMToolBoxItem : NSView
-
-@property (nonatomic,retain) NSMenuItem *menuFormRepresentation;
-
-@property (nonatomic,readonly) NSString *itemIdentifier;
-
-@property(nonatomic,readonly) KMToolbarClickButton *clickButton;
-
-@property (nonatomic,assign) BOOL isSelected;
-
-@property (nonatomic,assign) BOOL unEnabled;
-
-@property (nonatomic,assign) BOOL isShowCustomToolTip;
-
-@property (nonatomic,assign) KMToolBoxImagePosition boxImagePosition;
-
-@property (nonatomic,retain) NSImage * image;
-@property (nonatomic,retain) NSImage * selectedImage;
-
-@property (nonatomic,retain) NSString * titleName;
-
-@property (nonatomic,retain) NSImage * alternateImage;
-
-@property (nonatomic,assign) id target;
-
-@property (nonatomic,assign) BOOL needExpandAction;
-
-@property (nonatomic,assign) NSInteger btnTag;
-
-@property (nonatomic,assign) SEL btnAction;
-
-@property (nonatomic,retain) NSView *customizeView;
-
-@property (nonatomic,assign) BOOL isMainTool;
-
-@property (nonatomic,retain) NSView *linView;
-
-@property (nonatomic,retain) NSColor *normalBackgroundColor;
-@property (nonatomic,retain) NSColor *selectedBackgroundColor;
-
-//- (instancetype)initWithItemIdentifier:(NSString *)itemIdentifier
-//                             postition:(KMToolBoxImagePosition)imagePositionImagePosition
-//                           withPopMenu:(KMCustomButtonPopMenuViewController *)popMenuViewController;
-- (instancetype)initWithItemIdentifier:(NSString *)itemIdentifier
-                             postition:(KMToolBoxImagePosition)imagePositionImagePosition;
-
-
-- (instancetype)initWithItemIdentifier:(NSString *)itemIdentifier;
-
-@end
-
-
-@protocol KMNewToolbarDelegate;
-
-@interface KMToolbar : NSView
-
-@property (nonatomic,readonly) NSString *toolbarIdentifier;
-
-@property (nonatomic,weak) id<KMNewToolbarDelegate> delegate;
-
-@property (nonatomic,readonly) NSArray<KMToolBoxItem *> *items;
-
-- (instancetype)initWithIdentifier:(NSString *)identifier;
-
-- (void)reloadData;
-
-- (KMToolBoxItem  * _Nullable)itemForItemIdentifier:(NSString * _Nonnull)itemIdentifier;
-
-@end
-
-@protocol KMNewToolbarDelegate <NSObject>
-
-@optional
-- (KMToolBoxItem *)toolbar:(KMToolbar *)toolbar itemForItemIdentifier:(NSString *)identifier;
-
-- (NSArray<NSString *> *)toolbarAllowedItemIdentifiers:(KMToolbar *)toolbar;
-- (NSArray<NSString *> *)toolbarDefaultItemIdentifiers:(KMToolbar *)toolbar;
-
-- (NSArray<NSString *> *)toolbarLeftDefaultItemIdentifiers:(KMToolbar *)toolbar;
-- (NSArray<NSString *> *)toolbarRightDefaultItemIdentifiers:(KMToolbar *)toolbar;
-
-@end

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 1168
PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbar.m


+ 39 - 44
PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbarController.swift

@@ -34,19 +34,20 @@ extension CAnnotationType {
     @objc optional func changePDFViewGoToPreviousPageAction()
     @objc optional func changePDFViewGotoBackAction()
     @objc optional func changePDFViewGoToForwardAction()
-    @objc optional func showPDFViewPrintViewController()
     @objc optional func aiTranslationPDFFileAction()
     @objc optional func toolbarViewController(_ viewController:KMToolbarViewController, zoomModel selectedTag:Int)
     @objc optional func toolbarViewController(_ viewController:KMToolbarViewController, zoomSting : String)
-    @objc optional func mainToolDidClicked(_ toolController: KMToolbarController, _ beforeType: KMToolbarViewType, _ type: KMToolbarViewType, _ item: KMToolBoxItem, _ pages: [Int])
+    @objc optional func mainToolDidClicked(_ toolController: KMToolbarController, _ beforeType: KMToolbarViewType, _ type: KMToolbarViewType, _ item: KMToolbarItemView, _ pages: [Int])
     
-    @objc optional func toolbarViewController(_ viewController:KMToolbarViewController, shareAction toolbarItem: KMToolBoxItem)
+    @objc optional func toolbarViewController(_ viewController:KMToolbarViewController, shareAction toolbarItem: KMToolbarItemView)
     @objc optional func toolbarViewController(_ viewController:KMToolbarViewController, shareDocument item:NSMenuItem)
     @objc optional func toolbarViewController(_ viewController:KMToolbarViewController, shareFlatten item:NSMenuItem)
     @objc optional func toolbarViewController(_ viewController:KMToolbarViewController, shareOriginalPDF item:NSMenuItem)
     @objc optional func toolbarViewController(_ viewController:KMToolbarViewController, scanOCRModel selectedTag:Int)
-    @objc optional func toolbarViewController(_ viewController:KMToolbarViewController, rightPanel toolbarItem: KMToolBoxItem)
-    @objc optional func toolbarViewController(_ viewController:KMToolbarViewController, leftPanel toolbarItem: KMToolBoxItem)
+    
+    @objc optional func toolbarViewController(_ viewController:KMToolbarViewController, itemDidClick toolbarItem: KMToolbarItemView)
+    @objc optional func toolbarViewController(_ viewController:KMToolbarViewController, searchAction searchString: String)
+    @objc optional func toolbarViewController(_ viewController:KMToolbarViewController, menuItemDidClick toolbarItem: KMToolbarItemView, index: Int, info: Any?)
 }
 
 class KMToolbarController: NSViewController {
@@ -64,8 +65,8 @@ class KMToolbarController: NSViewController {
     open weak var delegate: KMToolbarControllerDelegate?
     var toolbarItems : [NSToolbarItem.Identifier : Any] = [:]
     var listView : CPDFListView?
-    var lastItemBox : KMToolBoxItem = KMToolBoxItem()
-    var lastChildItemBox : KMToolBoxItem = KMToolBoxItem()
+    var lastItemBox : KMToolbarItemView = KMToolbarItemView()
+    var lastChildItemBox : KMToolbarItemView = KMToolbarItemView()
     
     var popover: NSPopover?
     
@@ -224,7 +225,7 @@ class KMToolbarController: NSViewController {
         }
     }
     
-    public func findItem(_ identifier: String) -> KMToolBoxItem? {
+    public func findItem(_ identifier: String) -> KMToolbarItemView? {
         if (isMainToolItem(identifier)) {
             return self.findMainItem(identifier)
         }
@@ -239,10 +240,10 @@ class KMToolbarController: NSViewController {
             return
         }
         
-        var item: KMToolBoxItem?
+        var item: KMToolbarItemView?
         for (key, value) in self.mainToolBarView!.toolbarItems {
             if (key == identifier) {
-                item = (value as! KMToolBoxItem)
+                item = (value as! KMToolbarItemView)
                 break
             }
         }
@@ -258,10 +259,9 @@ class KMToolbarController: NSViewController {
                 identifier == KMDocumentToolToolbarItemIdentifier) {
                 self.mainToolBarView?.leftControllButtonAction(item: item!.clickButton)
             } else if (identifier == KMRightControlToolbarItemIdentifier) {
-                self.mainToolBarView?.rightPanelControllButtonAction(item: item!.clickButton)
+                self.mainToolBarView?.itemAction(item!)
             } else if (identifier == KMLeftControlToolbarItemIdentifier) {
-                item?.isSelected = !item!.isSelected
-                self.delegate?.toolbarViewController?(self.mainToolBarView!, leftPanel: item!)
+                self.mainToolBarView?.itemAction(item!)
             }
             
             return
@@ -270,11 +270,11 @@ class KMToolbarController: NSViewController {
     
     private func trySelectChildItem(_ identifier: String) -> Bool {
         // 子工具栏 item [当前主工具栏已开启]
-        var item: KMToolBoxItem?
+        var item: KMToolbarItemView?
         if (self.childToolBarView?.toolbarItems != nil && self.childToolBarView!.toolbarItems.count > 0) {
             for (key, value) in self.childToolBarView!.toolbarItems {
                 if (key == identifier) {
-                    item = (value as! KMToolBoxItem)
+                    item = (value as! KMToolbarItemView)
                     break
                 }
             }
@@ -289,11 +289,11 @@ class KMToolbarController: NSViewController {
     
     private func selectChildItem(_ identifier: String) {
         // 子工具栏 item [当前主工具栏已开启]
-        var item: KMToolBoxItem?
+        var item: KMToolbarItemView?
         if (self.childToolBarView?.toolbarItems != nil && self.childToolBarView!.toolbarItems.count > 0) {
             for (key, value) in self.childToolBarView!.toolbarItems {
                 if (key == identifier) {
-                    item = (value as! KMToolBoxItem)
+                    item = (value as! KMToolbarItemView)
                     break
                 }
             }
@@ -311,16 +311,16 @@ class KMToolbarController: NSViewController {
         }
     }
     
-    private func findMainItem(_ identifier: String) -> KMToolBoxItem? {
+    private func findMainItem(_ identifier: String) -> KMToolbarItemView? {
         if (self.mainToolBarView?.toolbarItems == nil) {
             return nil
         }
         
-        var item: KMToolBoxItem?
+        var item: KMToolbarItemView?
         if (isMainToolItem(identifier)) {
             for (key, value) in self.mainToolBarView!.toolbarItems {
                 if (key == identifier) {
-                    item = (value as! KMToolBoxItem)
+                    item = (value as! KMToolbarItemView)
                     break
                 }
             }
@@ -329,15 +329,15 @@ class KMToolbarController: NSViewController {
         return nil
     }
     
-    private func findChildItem(_ identifier: String) -> KMToolBoxItem? {
+    private func findChildItem(_ identifier: String) -> KMToolbarItemView? {
         if (self.childToolBarView?.toolbarItems == nil || self.childToolBarView!.toolbarItems.count == 0) {
             return nil
         }
             
-        var item: KMToolBoxItem?
+        var item: KMToolbarItemView?
         for (key, value) in self.childToolBarView!.toolbarItems {
             if (key == identifier) {
-                item = (value as! KMToolBoxItem)
+                item = (value as! KMToolbarItemView)
                 break
             }
         }
@@ -528,7 +528,7 @@ extension KMToolbarController: KMToolbarViewControllerDelegate {
             #endif
             //文字编辑 图片编辑 选中按钮逻辑(只能同时选中其中一个)
             if type == .addText || type == .addImage {
-                let boxItem = item.clickObject as? KMToolBoxItem
+                let boxItem = item.clickObject as? KMToolbarItemView
                 if boxItem != nil {
                     if self.lastChildItemBox != boxItem {
                         self.lastChildItemBox.isSelected = false
@@ -548,7 +548,7 @@ extension KMToolbarController: KMToolbarViewControllerDelegate {
         }
     }
     
-    func toolbarViewController(_ viewController: KMToolbarViewController, clickMode toolMode: KMToolbarViewType, toolbar toolbarItem: KMToolBoxItem, _ pages: [Int]) {
+    func toolbarViewController(_ viewController: KMToolbarViewController, clickMode toolMode: KMToolbarViewType, toolbar toolbarItem: KMToolbarItemView, _ pages: [Int]) {
         let beforeModel = KMToolbarViewType(rawValue: self.lastItemBox.clickButton.tag) ?? .None
         if self.lastItemBox != nil {
             if (toolbarItem.isSelected && toolMode.isToolMode()) {
@@ -575,7 +575,7 @@ extension KMToolbarController: KMToolbarViewControllerDelegate {
             }
         } else {
             if(toolMode != self.toolbarType && toolMode != .LeftPanel) {
-                let item : KMToolBoxItem = (self.mainToolBarView?.toolbarItemFindItemIdentifiers(value: KMDocumentAnnotationToolbarItemIdentifier))!
+                let item : KMToolbarItemView = (self.mainToolBarView?.toolbarItemFindItemIdentifiers(value: KMDocumentAnnotationToolbarItemIdentifier))!
                 item.isSelected = true
                 self.lastItemBox = item
             } else if (toolMode == .LeftPanel) {
@@ -591,23 +591,11 @@ extension KMToolbarController: KMToolbarViewControllerDelegate {
         self.delegate?.mainToolDidClicked?(self, beforeModel, toolMode, toolbarItem, pages)
     }
     
-    func toolbarViewController(_ viewController: KMToolbarViewController, rightPanel toolbarItem: KMToolBoxItem) {
-        toolbarItem.isSelected = !toolbarItem.isSelected
-        
-        self.delegate?.toolbarViewController?(viewController, rightPanel: toolbarItem)
-    }
-    
-    func toolbarViewController(_ viewController: KMToolbarViewController, leftPanel toolbarItem: KMToolBoxItem) {
-        toolbarItem.isSelected = !toolbarItem.isSelected
-        
-        self.delegate?.toolbarViewController?(viewController, leftPanel: toolbarItem)
-    }
-    
     func showPDFLayoutModeAction(show: Bool) {
         self.delegate?.showPDFLayoutModeAction?(show: show)
     }
     
-    func toolbarViewController(_ viewController: KMToolbarViewController, clickChaildToolType: KMToolbarType, toolbar toolbarItem: KMToolBoxItem) {
+    func toolbarViewController(_ viewController: KMToolbarViewController, clickChaildToolType: KMToolbarType, toolbar toolbarItem: KMToolbarItemView) {
         if (clickChaildToolType == .crop) {
             let titles = [NSLocalizedString("Crop Current Page - White Margins", comment: ""), NSLocalizedString("Crop All Pages - Auto", comment: "")]
             let vc: KMHomePopViewController = KMHomePopViewController().initWithPopViewDataArr(titles)
@@ -701,15 +689,11 @@ extension KMToolbarController: KMToolbarViewControllerDelegate {
         self.delegate?.changePDFViewGoToForwardAction?()
     }
     
-    func showPDFViewPrintViewController() {
-        self.delegate?.showPDFViewPrintViewController?()
-    }
-    
     func aiTranslationPDFFileAction() {
         self.delegate?.aiTranslationPDFFileAction?()
     }
     
-    func toolbarViewController(_ viewController: KMToolbarViewController, shareAction toolbarItem: KMToolBoxItem) {
+    func toolbarViewController(_ viewController: KMToolbarViewController, shareAction toolbarItem: KMToolbarItemView) {
         self.delegate?.toolbarViewController?(viewController, shareAction: toolbarItem)
     }
     
@@ -729,4 +713,15 @@ extension KMToolbarController: KMToolbarViewControllerDelegate {
         self.delegate?.toolbarViewController?(viewController, scanOCRModel: selectedTag)
     }
     
+    func toolbarViewController(_ viewController: KMToolbarViewController, itemDidClick toolbarItem: KMToolbarItemView) {
+        self.delegate?.toolbarViewController?(viewController, itemDidClick: toolbarItem)
+    }
+    
+    func toolbarViewController(_ viewController: KMToolbarViewController, searchAction searchString: String) {
+        self.delegate?.toolbarViewController?(viewController, searchAction: searchString)
+    }
+    
+    func toolbarViewController(_ viewController: KMToolbarViewController, menuItemDidClick toolbarItem: KMToolbarItemView, index: Int, info: Any?) {
+        self.delegate?.toolbarViewController?(viewController, menuItemDidClick: toolbarItem, index: index, info: info)
+    }
 }

+ 390 - 0
PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbarCustomViewController.swift

@@ -0,0 +1,390 @@
+//
+//  KMToolbarCustomViewController.swift
+//  PDF Master
+//
+//  Created by tangchao on 2023/10/26.
+//
+
+import Cocoa
+
+private let KMPasteboardTypeAllowedIndexSet: NSPasteboard.PasteboardType = NSPasteboard.PasteboardType(rawValue: "KMPasteboardTypeAllowedIndexSet")
+private let KMPasteboardTypeDefaultIndexSet: NSPasteboard.PasteboardType = NSPasteboard.PasteboardType(rawValue: "KMPasteboardTypeDefaultIndexSet")
+
+private let KMToolbarImageToPDFItemIdentifier = "KMToolbarImageToPDFItemIdentifier"
+private let KMToolbarRotateRightItemIdentifier = "KMToolbarRotateRightItemIdentifier"
+
+private let KMToolbarRotateLeftItemIdentifier = "KMToolbarRotateLeftItemIdentifier"
+private let KMToolbarPageBreaksItemIdentifier = "KMToolbarPageBreaksItemIdentifier"
+
+private let KMToolbarViewModeItemIdentifier = "KMToolbarViewModeItemIdentifier"
+private let KMToolbarDisplayModeItemIdentifier = "KMToolbarDisplayModeItemIdentifier"
+
+private let KMToolbarSpaceItemIdentifier = "KMToolbarSpaceItemIdentifier"
+//private let KMImageNameToolbarSpace = "KMImageNameToolbarSpace"
+private let KMToolbarFormAlignmentIdentifier = "KMToolbarFormAlignmentIdentifier"
+
+let KMToolbarCustomChangeNotification: Notification.Name = Notification.Name(rawValue: "KMToolbarCustomChangeNotification")
+
+class KMToolbarCellView: NSTableCellView {
+    @IBOutlet weak var tickImageView: NSImageView!
+}
+
+class KMToolbarCustomViewController: NSViewController {
+    
+    @IBOutlet weak var titleLabel: NSTextField!
+    @IBOutlet weak var leftLabel: NSTextField!
+    @IBOutlet weak var rightLabel: NSTextField!
+    @IBOutlet weak var subTitleLabel: NSTextField!
+    
+    @IBOutlet weak var okButton: NSButton!
+    @IBOutlet weak var cancelButton: NSButton!
+    @IBOutlet weak var resetButton: NSButton!
+    @IBOutlet weak var addButton: NSButton!
+    @IBOutlet weak var removeButton: NSButton!
+    
+    @IBOutlet weak var allowedItemsTableView: NSTableView!
+    @IBOutlet weak var defaultItemsTableView: NSTableView!
+    
+    private var _allowedItems: [String] = []
+    private var _defaultItems: [String] = []
+    
+    weak var toolbar: KMToolbarView?
+    
+    override func loadView() {
+        super.loadView()
+        
+        self.titleLabel.stringValue = KMLocalizedString("Customize Toolbar", nil)
+        self.subTitleLabel.stringValue = String(format: "%@", KMLocalizedString("Drag-and-drop tools to change their order", nil))
+        self.leftLabel.stringValue = KMLocalizedString("Choose tools to add:", nil)
+        self.rightLabel.stringValue = KMLocalizedString("Tools to show in Toolbar:", nil)
+
+        self.okButton.title = KMLocalizedString("Done", nil)
+        self.cancelButton.title = KMLocalizedString("Cancel", nil)
+        self.resetButton.title = KMLocalizedString("Reset", nil)
+        self.resetButton.toolTip = KMLocalizedString("Reset Toolbars", nil)
+        
+        self.addButton.title = String(format: "%@  >>", KMLocalizedString("Add", nil))
+        self.addButton.toolTip = KMLocalizedString("Add to Toolbar", nil)
+        
+        self.removeButton.title = String(format: "<<  %@", KMLocalizedString("Remove", nil))
+        self.removeButton.toolTip = KMLocalizedString("Remove from Toolbar", nil)
+        
+        var color = NSColor(red: 51.0/255.0, green: 51.0/255.0, blue: 51.0/255.0, alpha: 1.0)
+        if (KMAppearance.isSupportNewColor()) {
+            if (KMAppearance.isDarkMode()) {
+                color = NSColor(red: 1, green: 1, blue: 1, alpha: 0.5)
+            }
+        }
+        self.titleLabel.textColor = color
+        self.subTitleLabel.textColor = color
+        self.leftLabel.textColor = color
+        self.rightLabel.textColor = color
+        
+        self.addButton.wantsLayer = true
+        self.addButton.layer?.borderColor = NSColor(red: 153.0/255.0, green: 153.0/255.0, blue: 153.0/255.0, alpha: 1).cgColor
+        self.addButton.layer?.borderWidth = 1.0
+        self.addButton.layer?.cornerRadius = 4.0
+        self.removeButton.wantsLayer = true
+        self.removeButton.layer?.borderColor = NSColor(red: 153.0/255.0, green: 153.0/255.0, blue: 153.0/255.0, alpha: 1).cgColor
+        self.removeButton.layer?.borderWidth = 1.0
+        self.removeButton.layer?.cornerRadius = 4.0
+        
+        self.addButton.isEnabled = false
+        self.removeButton.isEnabled = false
+        
+        self.defaultItemsTableView.registerForDraggedTypes([KMPasteboardTypeAllowedIndexSet, KMPasteboardTypeDefaultIndexSet])
+
+        self._loadAllowedItems()
+        self._loadDefaultItems()
+    }
+    
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        // Do view setup here.
+    }
+    
+    @IBAction @objc func okButtonAction(_ sender: NSButton) {
+        NSApp.endSheet(self.view.window!)
+        self.view.window?.close()
+        if self.toolbar?.toolbarIdentifier != nil && self._defaultItems.count > 0 {
+            if let data = self.toolbar?.toolbarIdentifier {
+                UserDefaults.standard.set(self._defaultItems, forKey: data)
+            }
+            NotificationCenter.default.post(name: KMToolbarCustomChangeNotification, object: self.toolbar)
+        }
+    }
+    
+    @IBAction @objc func cancelButtonAction(_ sender: NSButton) {
+        NSApp.endSheet(self.view.window!)
+        self.view.window?.close()
+    }
+    
+    @IBAction @objc func resetButtonAction(_ sender: NSButton) {
+        if let data = self.toolbar?.toolbarIdentifier {
+            UserDefaults.standard.removeObject(forKey: data)
+            NotificationCenter.default.post(name: KMToolbarCustomChangeNotification, object: self.toolbar)
+        }
+        
+        self._loadDefaultItems()
+        self.allowedItemsTableView.reloadData()
+        self.defaultItemsTableView.reloadData()
+    }
+    
+    @IBAction @objc func addButtonAction(_ sender: NSButton) {
+        let selectedRowIndexes = self.allowedItemsTableView.selectedRowIndexes
+        if (selectedRowIndexes.count <= 0) {
+            return
+        }
+        var itemIdentifiers: [String] = []
+        for index in selectedRowIndexes {
+            itemIdentifiers.append(self._allowedItems[index])
+        }
+        if (itemIdentifiers.count > 0) {
+            var isAdded = false
+            for itemIdentifier in itemIdentifiers {
+                if self._defaultItems.contains(itemIdentifier) == false || itemIdentifier == KMToolbarSpaceItemIdentifier {
+                    self._defaultItems.append(itemIdentifier)
+                    isAdded = true
+                }
+            }
+            if (isAdded) {
+                self.allowedItemsTableView.reloadData()
+                self.defaultItemsTableView.reloadData()
+                self.defaultItemsTableView.scrollRowToVisible(self._defaultItems.count-1)
+                self.addButton.isEnabled = false
+            } else {
+                
+            }
+        }
+    }
+    
+    @IBAction @objc func removeButtonAction(_ sender: NSButton) {
+        let selectedRowIndexes = self.defaultItemsTableView.selectedRowIndexes
+        if (selectedRowIndexes.count <= 0) {
+            return
+        }
+        for index in selectedRowIndexes {
+            self._defaultItems.remove(at: index)
+        }
+        
+        self.allowedItemsTableView.reloadData()
+        self.defaultItemsTableView.reloadData()
+        self.removeButton.isEnabled = false
+    }
+    
+    @objc func delete(_ sender: Any?) {
+        if self.defaultItemsTableView.isEqual(to: self.view.window?.firstResponder) {
+            self.removeButtonAction(self.removeButton)
+        }
+    }
+}
+
+extension KMToolbarCustomViewController: NSTableViewDelegate, NSTableViewDataSource {
+    func numberOfRows(in tableView: NSTableView) -> Int {
+        var rows = 0
+        if (self.allowedItemsTableView.isEqual(to: tableView)) {
+            rows = self._allowedItems.count
+        } else if (self.defaultItemsTableView.isEqual(to: tableView)) {
+            rows = self._defaultItems.count
+        }
+        return rows
+    }
+    
+    func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? {
+        var cellView: NSTableCellView?
+        var itemIdentifier: String?
+        if (self.allowedItemsTableView == tableView) {
+            cellView = tableView.makeView(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "KMAllowedItemsCell"), owner: self) as! NSTableCellView
+            itemIdentifier = self._allowedItems[row]
+        } else if (self.defaultItemsTableView == tableView) {
+            cellView = tableView.makeView(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "KMDefaultItemsCell"), owner: self) as! NSTableCellView
+            itemIdentifier = self._defaultItems[row]
+        }
+        if itemIdentifier == KMToolbarSpaceItemIdentifier || itemIdentifier == KMNewToolbarSpaceItemIdentifier {
+            cellView?.textField?.stringValue = KMLocalizedString("", nil)
+            cellView?.imageView?.image = NSImage(named: KMImageNameToolbarSpace)
+        } else {
+            if let data = self.toolbar?.delegate?.toolbar?(self.toolbar!, itemFor: itemIdentifier!) {
+                if itemIdentifier == KMToolbarFormAlignmentIdentifier {
+                    cellView?.textField?.stringValue = KMLocalizedString("Alignment", nil)
+                } else {
+                    cellView?.textField?.stringValue = data.titleName ?? ""
+                }
+                cellView?.imageView?.image = data.image
+            }
+        }
+        if let data = cellView?.isKind(of: KMToolbarCellView.self), data {
+            if self._defaultItems.contains(itemIdentifier!) && itemIdentifier != KMToolbarSpaceItemIdentifier {
+                (cellView as? KMToolbarCellView)?.tickImageView.image = NSImage(named: "KMImageNameToolbarSelected")
+            } else {
+                (cellView as? KMToolbarCellView)?.tickImageView.image = nil
+            }
+        }
+        return cellView;
+    }
+    
+    func tableView(_ tableView: NSTableView, shouldSelectRow row: Int) -> Bool {
+        if (self.allowedItemsTableView == tableView) {
+            let itemIdentifier = self._allowedItems[row]
+            if (self._defaultItems.contains(itemIdentifier) && itemIdentifier != KMToolbarSpaceItemIdentifier) {
+                return false
+            }
+        }
+        return true
+    }
+    
+    func tableViewSelectionDidChange(_ notification: Notification) {
+        self.allowedItemsTableView.delegate = nil
+        self.defaultItemsTableView.delegate = nil
+        let tableView = notification.object as? NSTableView
+        if (self.allowedItemsTableView == tableView) {
+            self.addButton.isEnabled = tableView!.selectedRowIndexes.count > 0 ? true : false
+            let set = NSIndexSet()
+            self.defaultItemsTableView.selectRowIndexes(set as IndexSet, byExtendingSelection: false)
+            self.removeButton.isEnabled = false
+        } else if (self.defaultItemsTableView == tableView) {
+            self.removeButton.isEnabled = tableView!.selectedRowIndexes.count > 0 ? true : false
+            let set = NSIndexSet()
+            self.allowedItemsTableView.selectRowIndexes(set as IndexSet, byExtendingSelection: false)
+            self.addButton.isEnabled = false
+        }
+        self.allowedItemsTableView.delegate = self
+        self.defaultItemsTableView.delegate = self
+    }
+    
+    func tableView(_ tableView: NSTableView, writeRowsWith rowIndexes: IndexSet, to pboard: NSPasteboard) -> Bool {
+        let indexSetData = NSKeyedArchiver.archivedData(withRootObject: rowIndexes)
+        if (self.allowedItemsTableView == tableView) {
+            pboard.declareTypes([KMPasteboardTypeAllowedIndexSet], owner: self)
+            pboard.setData(indexSetData, forType: KMPasteboardTypeAllowedIndexSet)
+        } else if (self.defaultItemsTableView == tableView) {
+            pboard.declareTypes([KMPasteboardTypeDefaultIndexSet], owner: self)
+            pboard.setData(indexSetData, forType: KMPasteboardTypeDefaultIndexSet)
+        }
+        return true
+    }
+    
+    func tableView(_ tableView: NSTableView, validateDrop info: NSDraggingInfo, proposedRow row: Int, proposedDropOperation dropOperation: NSTableView.DropOperation) -> NSDragOperation {
+        if (self.defaultItemsTableView == tableView) {
+            if (dropOperation == .on) {
+                return NSDragOperation(rawValue: 0)
+            }
+            return .move
+        }
+        return NSDragOperation(rawValue: 0)
+    }
+    
+    func tableView(_ tableView: NSTableView, acceptDrop info: NSDraggingInfo, row: Int, dropOperation: NSTableView.DropOperation) -> Bool {
+        if (self.defaultItemsTableView == tableView) {
+            let pboard = info.draggingPasteboard
+            if pboard.availableType(from: [KMPasteboardTypeAllowedIndexSet]) != nil {
+                let rowData = pboard.data(forType: KMPasteboardTypeAllowedIndexSet)
+                let rowIndexes: IndexSet = NSKeyedUnarchiver.unarchiveObject(with: rowData!) as! IndexSet
+                var isAdded = false
+                for idx in rowIndexes.reversed() {
+                    let itemIdentifier = self._allowedItems[idx]
+                    if self._defaultItems.contains(itemIdentifier) == false || itemIdentifier == KMToolbarSpaceItemIdentifier {
+                        self._defaultItems.insert(itemIdentifier, at: row)
+                        isAdded = true
+                    }
+                }
+
+                if (isAdded) {
+                    self.allowedItemsTableView.reloadData()
+                    self.defaultItemsTableView.reloadData()
+                    return true
+                } else {
+                    
+                }
+            } else if pboard.availableType(from: [KMPasteboardTypeDefaultIndexSet]) != nil {
+                let rowData = pboard.data(forType: KMPasteboardTypeDefaultIndexSet)
+                let indexes: IndexSet = NSKeyedUnarchiver.unarchiveObject(with: rowData!) as! IndexSet
+                var items: [String] = []
+                for item in self._defaultItems {
+                    items.append(item)
+                }
+                
+                var moveItems: [String] = []
+                for index in indexes {
+                    moveItems.append(self._defaultItems[index])
+                }
+                
+                var index = 0
+                for index in indexes {
+                    self._defaultItems.remove(at: index)
+                }
+                var _row = row
+                if (_row > 0) {
+                    var item: String? = items[row-1]
+                    while (moveItems.contains(item ?? "")) {
+                        _row -= 1
+                        if (_row < 0) {
+                            item = nil
+                            break
+                        } else {
+                            item = items[_row]
+                        }
+                    }
+                    if (item != nil) {
+                        index = self._defaultItems.firstIndex(of: item!)!+1
+                    }
+                }
+                for i in 0 ..< moveItems.count {
+                    self._defaultItems.insert(moveItems[i], at: index+i)
+                }
+                self.allowedItemsTableView.reloadData()
+                self.defaultItemsTableView.reloadData()
+                return true
+            }
+        }
+        return false
+    }
+}
+
+extension KMToolbarCustomViewController: NSMenuItemValidation {
+    func validateMenuItem(_ menuItem: NSMenuItem) -> Bool {
+        if (menuItem.action == #selector(delete)) {
+            if (self.defaultItemsTableView != self.view.window!.firstResponder) {
+                return false
+            }
+        }
+        return true
+    }
+}
+
+// MARK: - Private Methods
+
+extension KMToolbarCustomViewController {
+    private func _loadAllowedItems() {
+        if let data = self.toolbar?.delegate?.toolbarAllowedItemIdentifiers?(self.toolbar!) {
+            self._allowedItems = data
+        }
+        
+        let itemArray = [KMToolbarImageToPDFItemIdentifier, KMToolbarRotateRightItemIdentifier, KMToolbarRotateLeftItemIdentifier, KMToolbarPageBreaksItemIdentifier, KMToolbarViewModeItemIdentifier, KMToolbarDisplayModeItemIdentifier]
+        for itemStr in itemArray {
+            if (self._allowedItems.contains(itemStr)) {
+                self._allowedItems.removeObject(itemStr)
+            }
+        }
+    }
+
+    private func _loadDefaultItems() {
+        var itemIdentifiers: [String]? = self.toolbar?.toolbarIdentifier != nil ? (UserDefaults.standard.object(forKey: self.toolbar!.toolbarIdentifier!) as? [String]) : []
+        if itemIdentifiers == nil || itemIdentifiers!.count <= 0 {
+            if let items = self.toolbar?.delegate?.toolbarDefaultItemIdentifiers?(self.toolbar!) {
+                itemIdentifiers = items
+            }
+        }
+        
+        self._defaultItems.removeAll()
+        if (itemIdentifiers != nil) {
+            for itemI in itemIdentifiers! {
+                if itemI != KMToolbarDividerItemIdentifier {
+                    self._defaultItems.append(itemI)
+                }
+            }
+        } else {
+            self._defaultItems = []
+        }
+    }
+}

+ 358 - 0
PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbarCustomViewController.xib

@@ -0,0 +1,358 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner" customClass="KMToolbarCustomViewController">
+            <connections>
+                <outlet property="addButton" destination="bkC-VM-YPd" id="ura-jE-Cnb"/>
+                <outlet property="allowedItemsTableView" destination="FdJ-Fj-oML" id="j2g-x5-02f"/>
+                <outlet property="cancelButton" destination="fOg-Is-A3R" id="kFP-DB-5bk"/>
+                <outlet property="defaultItemsTableView" destination="ABU-lf-FEL" id="BQn-Ut-uru"/>
+                <outlet property="leftLabel" destination="f1D-Pb-iyF" id="2S2-eF-diO"/>
+                <outlet property="okButton" destination="JZu-O5-GoZ" id="NQd-Xw-QS4"/>
+                <outlet property="removeButton" destination="S3L-VY-gDi" id="LsF-KG-Ihz"/>
+                <outlet property="resetButton" destination="VEO-jz-lfH" id="xUa-Zr-Pfm"/>
+                <outlet property="rightLabel" destination="rVi-sQ-x2v" id="mr6-Th-fQ6"/>
+                <outlet property="subTitleLabel" destination="FBc-ch-2ME" id="RUE-Vd-eWl"/>
+                <outlet property="titleLabel" destination="lpU-dG-ZRi" id="76P-AH-dBD"/>
+                <outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
+            </connections>
+        </customObject>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <customView id="Hz6-mo-xeY">
+            <rect key="frame" x="0.0" y="0.0" width="632" height="546"/>
+            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+            <subviews>
+                <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="JZu-O5-GoZ">
+                    <rect key="frame" x="513" y="13" width="94" height="32"/>
+                    <constraints>
+                        <constraint firstAttribute="width" constant="80" id="h2s-r9-6d8"/>
+                    </constraints>
+                    <buttonCell key="cell" type="push" title="Done" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="rfx-u3-2x9">
+                        <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                        <font key="font" metaFont="system"/>
+                        <string key="keyEquivalent" base64-UTF8="YES">
+DQ
+</string>
+                    </buttonCell>
+                    <connections>
+                        <action selector="okButtonAction:" target="-2" id="9tf-3v-g0t"/>
+                    </connections>
+                </button>
+                <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="fOg-Is-A3R">
+                    <rect key="frame" x="419" y="13" width="94" height="32"/>
+                    <constraints>
+                        <constraint firstAttribute="width" constant="80" id="1IZ-2V-dBT"/>
+                    </constraints>
+                    <buttonCell key="cell" type="push" title="Cancel" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="0x6-wB-v3u">
+                        <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                        <font key="font" metaFont="system"/>
+                        <string key="keyEquivalent" base64-UTF8="YES">
+Gw
+</string>
+                    </buttonCell>
+                    <connections>
+                        <action selector="cancelButtonAction:" target="-2" id="Ogb-1a-mak"/>
+                    </connections>
+                </button>
+                <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="VEO-jz-lfH">
+                    <rect key="frame" x="25" y="13" width="94" height="32"/>
+                    <constraints>
+                        <constraint firstAttribute="width" constant="80" id="wbC-5f-UKJ"/>
+                    </constraints>
+                    <buttonCell key="cell" type="push" title="Reset" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="bNS-W6-Syp">
+                        <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                        <font key="font" metaFont="system"/>
+                    </buttonCell>
+                    <connections>
+                        <action selector="resetButtonAction:" target="-2" id="NHV-fP-cgQ"/>
+                    </connections>
+                </button>
+                <scrollView autohidesScrollers="YES" horizontalLineScroll="38" horizontalPageScroll="10" verticalLineScroll="38" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="n2i-ID-avc">
+                    <rect key="frame" x="32" y="103" width="229" height="365"/>
+                    <clipView key="contentView" drawsBackground="NO" id="tYg-L5-HuW">
+                        <rect key="frame" x="1" y="1" width="227" height="363"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <subviews>
+                            <tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnSelection="YES" autosaveColumns="NO" rowHeight="36" rowSizeStyle="automatic" viewBased="YES" id="FdJ-Fj-oML">
+                                <rect key="frame" x="0.0" y="0.0" width="227" height="363"/>
+                                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                <size key="intercellSpacing" width="3" height="2"/>
+                                <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                <color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
+                                <tableColumns>
+                                    <tableColumn width="157" minWidth="40" maxWidth="1000" id="HMg-gy-4uB">
+                                        <tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border">
+                                            <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
+                                            <color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
+                                        </tableHeaderCell>
+                                        <textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" title="Text Cell" id="6ct-I8-OFf">
+                                            <font key="font" metaFont="system"/>
+                                            <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                                            <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                        </textFieldCell>
+                                        <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
+                                        <prototypeCellViews>
+                                            <tableCellView identifier="KMAllowedItemsCell" id="u8k-Vq-Sh4" customClass="KMToolbarCellView" customModule="PDF_Master" customModuleProvider="target">
+                                                <rect key="frame" x="1" y="1" width="166" height="36"/>
+                                                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                                <subviews>
+                                                    <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="UlQ-sL-b0L">
+                                                        <rect key="frame" x="8" y="8" width="20" height="20"/>
+                                                        <constraints>
+                                                            <constraint firstAttribute="height" constant="20" id="0kp-Kp-4Z2"/>
+                                                            <constraint firstAttribute="width" constant="20" id="dlo-Qq-Atd"/>
+                                                        </constraints>
+                                                        <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" id="ol3-6y-x6T"/>
+                                                    </imageView>
+                                                    <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="Dvo-uU-C7l">
+                                                        <rect key="frame" x="31" y="11" width="110" height="15"/>
+                                                        <textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="Table View Cell" id="odU-Fg-eBv">
+                                                            <font key="font" metaFont="cellTitle"/>
+                                                            <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                                                            <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                                                        </textFieldCell>
+                                                    </textField>
+                                                    <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="yMM-bR-gSP">
+                                                        <rect key="frame" x="144" y="11" width="14" height="14"/>
+                                                        <constraints>
+                                                            <constraint firstAttribute="height" constant="14" id="die-lI-6p0"/>
+                                                            <constraint firstAttribute="width" constant="14" id="hth-gj-lGP"/>
+                                                        </constraints>
+                                                        <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="ic_have" id="UZX-uW-L9B"/>
+                                                    </imageView>
+                                                </subviews>
+                                                <constraints>
+                                                    <constraint firstItem="yMM-bR-gSP" firstAttribute="leading" secondItem="Dvo-uU-C7l" secondAttribute="trailing" constant="5" id="PW0-nR-aVk"/>
+                                                    <constraint firstItem="yMM-bR-gSP" firstAttribute="centerY" secondItem="u8k-Vq-Sh4" secondAttribute="centerY" id="SMX-eR-vQh"/>
+                                                    <constraint firstItem="Dvo-uU-C7l" firstAttribute="leading" secondItem="UlQ-sL-b0L" secondAttribute="trailing" constant="5" id="Ud2-al-c5c"/>
+                                                    <constraint firstItem="UlQ-sL-b0L" firstAttribute="leading" secondItem="u8k-Vq-Sh4" secondAttribute="leading" constant="8" id="dOI-Lf-DTg"/>
+                                                    <constraint firstItem="Dvo-uU-C7l" firstAttribute="centerY" secondItem="u8k-Vq-Sh4" secondAttribute="centerY" id="m4B-3K-fOt"/>
+                                                    <constraint firstItem="UlQ-sL-b0L" firstAttribute="centerY" secondItem="u8k-Vq-Sh4" secondAttribute="centerY" id="pGU-g0-1rq"/>
+                                                    <constraint firstAttribute="trailing" secondItem="yMM-bR-gSP" secondAttribute="trailing" constant="8" id="vHp-7V-7Xs"/>
+                                                </constraints>
+                                                <connections>
+                                                    <outlet property="imageView" destination="UlQ-sL-b0L" id="aLb-T1-65t"/>
+                                                    <outlet property="textField" destination="Dvo-uU-C7l" id="Qlo-mk-yM0"/>
+                                                    <outlet property="tickImageView" destination="yMM-bR-gSP" id="z46-PJ-ZKJ"/>
+                                                </connections>
+                                            </tableCellView>
+                                        </prototypeCellViews>
+                                    </tableColumn>
+                                </tableColumns>
+                                <connections>
+                                    <outlet property="dataSource" destination="-2" id="0VP-YI-cEY"/>
+                                    <outlet property="delegate" destination="-2" id="2HG-0E-Euz"/>
+                                </connections>
+                            </tableView>
+                        </subviews>
+                        <nil key="backgroundColor"/>
+                    </clipView>
+                    <scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="6Mn-7M-jOy">
+                        <rect key="frame" x="1" y="261" width="203" height="16"/>
+                        <autoresizingMask key="autoresizingMask"/>
+                    </scroller>
+                    <scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="6lb-vU-nAU">
+                        <rect key="frame" x="224" y="17" width="15" height="102"/>
+                        <autoresizingMask key="autoresizingMask"/>
+                    </scroller>
+                </scrollView>
+                <scrollView autohidesScrollers="YES" horizontalLineScroll="38" horizontalPageScroll="10" verticalLineScroll="38" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="FCY-YF-hEJ">
+                    <rect key="frame" x="371" y="103" width="229" height="365"/>
+                    <clipView key="contentView" drawsBackground="NO" id="RDH-eA-U3m">
+                        <rect key="frame" x="1" y="1" width="227" height="363"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <subviews>
+                            <tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnSelection="YES" autosaveColumns="NO" rowHeight="36" rowSizeStyle="automatic" viewBased="YES" id="ABU-lf-FEL">
+                                <rect key="frame" x="0.0" y="0.0" width="227" height="363"/>
+                                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                <size key="intercellSpacing" width="3" height="2"/>
+                                <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                <color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
+                                <tableColumns>
+                                    <tableColumn width="157" minWidth="40" maxWidth="1000" id="qXF-na-3LA">
+                                        <tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border">
+                                            <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
+                                            <color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
+                                        </tableHeaderCell>
+                                        <textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" title="Text Cell" id="3py-GG-ZFS">
+                                            <font key="font" metaFont="system"/>
+                                            <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                                            <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                        </textFieldCell>
+                                        <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
+                                        <prototypeCellViews>
+                                            <tableCellView identifier="KMDefaultItemsCell" id="08K-im-PCm">
+                                                <rect key="frame" x="1" y="1" width="166" height="36"/>
+                                                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                                <subviews>
+                                                    <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="VZL-c9-MbX">
+                                                        <rect key="frame" x="8" y="8" width="20" height="20"/>
+                                                        <constraints>
+                                                            <constraint firstAttribute="width" constant="20" id="Lk9-5S-bN3"/>
+                                                            <constraint firstAttribute="height" constant="20" id="eEu-JG-kYY"/>
+                                                        </constraints>
+                                                        <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" id="UwL-bD-Gm5"/>
+                                                    </imageView>
+                                                    <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="nNa-su-WPu">
+                                                        <rect key="frame" x="31" y="11" width="129" height="15"/>
+                                                        <textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="Table View Cell" id="Lej-Ie-YTM">
+                                                            <font key="font" metaFont="cellTitle"/>
+                                                            <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                                                            <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                                                        </textFieldCell>
+                                                    </textField>
+                                                </subviews>
+                                                <constraints>
+                                                    <constraint firstAttribute="trailing" secondItem="nNa-su-WPu" secondAttribute="trailing" constant="8" id="2OL-vi-icS"/>
+                                                    <constraint firstItem="nNa-su-WPu" firstAttribute="centerY" secondItem="08K-im-PCm" secondAttribute="centerY" id="830-8w-gYQ"/>
+                                                    <constraint firstItem="nNa-su-WPu" firstAttribute="leading" secondItem="VZL-c9-MbX" secondAttribute="trailing" constant="5" id="CtL-Ul-5Jj"/>
+                                                    <constraint firstItem="VZL-c9-MbX" firstAttribute="centerY" secondItem="08K-im-PCm" secondAttribute="centerY" id="PxO-jw-loT"/>
+                                                    <constraint firstItem="VZL-c9-MbX" firstAttribute="leading" secondItem="08K-im-PCm" secondAttribute="leading" constant="8" id="fnn-2D-vSV"/>
+                                                </constraints>
+                                                <connections>
+                                                    <outlet property="imageView" destination="VZL-c9-MbX" id="J4c-9Q-Seu"/>
+                                                    <outlet property="textField" destination="nNa-su-WPu" id="8FN-0k-mKC"/>
+                                                </connections>
+                                            </tableCellView>
+                                        </prototypeCellViews>
+                                    </tableColumn>
+                                </tableColumns>
+                                <connections>
+                                    <outlet property="dataSource" destination="-2" id="m6K-2l-vyv"/>
+                                    <outlet property="delegate" destination="-2" id="shg-4Q-Xvo"/>
+                                </connections>
+                            </tableView>
+                        </subviews>
+                        <nil key="backgroundColor"/>
+                    </clipView>
+                    <scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="C0w-YU-B9o">
+                        <rect key="frame" x="1" y="261" width="203" height="16"/>
+                        <autoresizingMask key="autoresizingMask"/>
+                    </scroller>
+                    <scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="J5N-Ha-WLc">
+                        <rect key="frame" x="224" y="17" width="15" height="102"/>
+                        <autoresizingMask key="autoresizingMask"/>
+                    </scroller>
+                </scrollView>
+                <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="lpU-dG-ZRi">
+                    <rect key="frame" x="30" y="507" width="65" height="19"/>
+                    <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Custom" id="ejK-89-G5U">
+                        <font key="font" metaFont="systemBold" size="16"/>
+                        <color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/>
+                        <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                    </textFieldCell>
+                </textField>
+                <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="rVi-sQ-x2v">
+                    <rect key="frame" x="369" y="476" width="163" height="15"/>
+                    <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Options Currently Dispalyed" id="G51-Vy-5jr">
+                        <font key="font" metaFont="cellTitle"/>
+                        <color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/>
+                        <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                    </textFieldCell>
+                </textField>
+                <button translatesAutoresizingMaskIntoConstraints="NO" id="bkC-VM-YPd">
+                    <rect key="frame" x="276" y="291" width="80" height="32"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="32" id="XIj-w9-Jtq"/>
+                        <constraint firstAttribute="width" constant="80" id="gjT-bR-jWq"/>
+                    </constraints>
+                    <buttonCell key="cell" type="square" title="Add  &gt;&gt;" bezelStyle="shadowlessSquare" alignment="center" imageScaling="proportionallyUpOrDown" inset="2" id="o0x-D0-sKR">
+                        <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                        <font key="font" metaFont="system"/>
+                    </buttonCell>
+                    <connections>
+                        <action selector="addButtonAction:" target="-2" id="Grg-ih-bAv"/>
+                    </connections>
+                </button>
+                <button translatesAutoresizingMaskIntoConstraints="NO" id="S3L-VY-gDi">
+                    <rect key="frame" x="276" y="249" width="80" height="32"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="32" id="HNl-Lx-qyz"/>
+                        <constraint firstAttribute="width" constant="80" id="bPA-5o-8W1"/>
+                    </constraints>
+                    <buttonCell key="cell" type="square" title="&lt;&lt; Remove" bezelStyle="shadowlessSquare" alignment="center" imageScaling="proportionallyUpOrDown" inset="2" id="9YJ-YG-LgS">
+                        <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                        <font key="font" metaFont="system"/>
+                    </buttonCell>
+                    <connections>
+                        <action selector="removeButtonAction:" target="-2" id="XAH-uT-0wt"/>
+                    </connections>
+                </button>
+                <box verticalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="Teh-6Q-kqh">
+                    <rect key="frame" x="32" y="58" width="568" height="5"/>
+                </box>
+                <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="f1D-Pb-iyF">
+                    <rect key="frame" x="30" y="476" width="115" height="15"/>
+                    <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Choose Commands" id="HgT-hQ-cKy">
+                        <font key="font" metaFont="cellTitle"/>
+                        <color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/>
+                        <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                    </textFieldCell>
+                </textField>
+                <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="FBc-ch-2ME">
+                    <rect key="frame" x="393" y="67" width="180" height="30"/>
+                    <constraints>
+                        <constraint firstAttribute="width" constant="176" id="LR3-37-plu"/>
+                    </constraints>
+                    <textFieldCell key="cell" sendsActionOnEndEditing="YES" title="Drag-and-drop tools to change their order" id="JKk-71-bVk">
+                        <font key="font" metaFont="cellTitle"/>
+                        <color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/>
+                        <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                    </textFieldCell>
+                </textField>
+                <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="5pR-Xn-Eok">
+                    <rect key="frame" x="376" y="75" width="14" height="14"/>
+                    <constraints>
+                        <constraint firstAttribute="width" constant="14" id="l8n-ym-Gdf"/>
+                        <constraint firstAttribute="height" constant="14" id="sQa-ad-HqK"/>
+                    </constraints>
+                    <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="KMImageNameToolbarAttention" id="ZTs-js-DjY"/>
+                </imageView>
+            </subviews>
+            <constraints>
+                <constraint firstItem="bkC-VM-YPd" firstAttribute="centerY" secondItem="n2i-ID-avc" secondAttribute="centerY" constant="-21" id="3lg-8W-ZAq"/>
+                <constraint firstItem="VEO-jz-lfH" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="32" id="5RY-9w-OrC"/>
+                <constraint firstItem="bkC-VM-YPd" firstAttribute="centerX" secondItem="Hz6-mo-xeY" secondAttribute="centerX" id="5ir-zj-SNn"/>
+                <constraint firstItem="FCY-YF-hEJ" firstAttribute="top" secondItem="n2i-ID-avc" secondAttribute="top" id="7du-Zl-wm9"/>
+                <constraint firstAttribute="trailing" secondItem="Teh-6Q-kqh" secondAttribute="trailing" constant="32" id="A0x-cg-hCs"/>
+                <constraint firstItem="f1D-Pb-iyF" firstAttribute="top" secondItem="lpU-dG-ZRi" secondAttribute="bottom" constant="16" id="DXK-fg-dbv"/>
+                <constraint firstItem="FCY-YF-hEJ" firstAttribute="leading" secondItem="rVi-sQ-x2v" secondAttribute="leading" id="EhK-xd-4h3"/>
+                <constraint firstAttribute="bottom" secondItem="VEO-jz-lfH" secondAttribute="bottom" constant="20" id="H8o-vt-eEg"/>
+                <constraint firstItem="JZu-O5-GoZ" firstAttribute="centerY" secondItem="fOg-Is-A3R" secondAttribute="centerY" id="HO3-vq-K9D"/>
+                <constraint firstItem="FBc-ch-2ME" firstAttribute="top" secondItem="FCY-YF-hEJ" secondAttribute="bottom" constant="6" id="JKF-5e-AsK"/>
+                <constraint firstAttribute="trailing" secondItem="JZu-O5-GoZ" secondAttribute="trailing" constant="32" id="LKs-Ao-Bya"/>
+                <constraint firstItem="Teh-6Q-kqh" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="32" id="Law-Lv-Afs"/>
+                <constraint firstItem="n2i-ID-avc" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="32" id="NDd-Zq-S3K"/>
+                <constraint firstItem="JZu-O5-GoZ" firstAttribute="leading" secondItem="fOg-Is-A3R" secondAttribute="trailing" constant="14" id="Or8-ze-s31"/>
+                <constraint firstItem="VEO-jz-lfH" firstAttribute="top" secondItem="Teh-6Q-kqh" secondAttribute="bottom" constant="20" id="SIs-bM-pye"/>
+                <constraint firstItem="lpU-dG-ZRi" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="32" id="T07-QQ-n1a"/>
+                <constraint firstItem="FCY-YF-hEJ" firstAttribute="width" secondItem="n2i-ID-avc" secondAttribute="width" id="Twv-MG-1EC"/>
+                <constraint firstItem="S3L-VY-gDi" firstAttribute="top" secondItem="bkC-VM-YPd" secondAttribute="bottom" constant="10" id="U3u-rb-O2o"/>
+                <constraint firstItem="FBc-ch-2ME" firstAttribute="centerY" secondItem="5pR-Xn-Eok" secondAttribute="centerY" id="e97-Nn-lP7"/>
+                <constraint firstItem="n2i-ID-avc" firstAttribute="width" secondItem="Hz6-mo-xeY" secondAttribute="width" multiplier="1:2" constant="-87" id="hGB-iw-Df1"/>
+                <constraint firstItem="Teh-6Q-kqh" firstAttribute="top" secondItem="FBc-ch-2ME" secondAttribute="bottom" constant="6" id="i92-il-NQw"/>
+                <constraint firstAttribute="bottom" secondItem="JZu-O5-GoZ" secondAttribute="bottom" constant="20" id="mky-N7-Gjo"/>
+                <constraint firstItem="S3L-VY-gDi" firstAttribute="centerX" secondItem="Hz6-mo-xeY" secondAttribute="centerX" id="oFT-sh-8LX"/>
+                <constraint firstItem="n2i-ID-avc" firstAttribute="top" secondItem="f1D-Pb-iyF" secondAttribute="bottom" constant="8" id="qLV-of-cO4"/>
+                <constraint firstItem="5pR-Xn-Eok" firstAttribute="leading" secondItem="FCY-YF-hEJ" secondAttribute="leading" constant="5" id="sD0-xs-zjJ"/>
+                <constraint firstAttribute="trailing" secondItem="FCY-YF-hEJ" secondAttribute="trailing" constant="32" id="tRc-0z-aHi"/>
+                <constraint firstItem="FCY-YF-hEJ" firstAttribute="bottom" secondItem="n2i-ID-avc" secondAttribute="bottom" id="uvY-KL-Jz4"/>
+                <constraint firstItem="FBc-ch-2ME" firstAttribute="leading" secondItem="5pR-Xn-Eok" secondAttribute="trailing" constant="5" id="wMk-iR-oX4"/>
+                <constraint firstItem="n2i-ID-avc" firstAttribute="leading" secondItem="f1D-Pb-iyF" secondAttribute="leading" id="wUi-F6-eKX"/>
+                <constraint firstItem="FCY-YF-hEJ" firstAttribute="top" secondItem="rVi-sQ-x2v" secondAttribute="bottom" constant="8" id="xPI-fz-ZOT"/>
+                <constraint firstItem="lpU-dG-ZRi" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" constant="20" id="z5C-Um-97c"/>
+            </constraints>
+            <point key="canvasLocation" x="107" y="298"/>
+        </customView>
+    </objects>
+    <resources>
+        <image name="KMImageNameToolbarAttention" width="14" height="14"/>
+        <image name="ic_have" width="14" height="14"/>
+    </resources>
+</document>

+ 31 - 0
PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbarCustomWindowController.swift

@@ -0,0 +1,31 @@
+//
+//  KMToolbarCustomWindowController.swift
+//  PDF Master
+//
+//  Created by tangchao on 2023/10/26.
+//
+
+import Cocoa
+
+class KMToolbarCustomWindowController: NSWindowController {
+
+    weak var toolbar: KMToolbarView?
+    var toolbarCustomViewController: KMToolbarCustomViewController?
+    
+    deinit {
+        Swift.debugPrint("KMToolbarCustomWindowController deinit")
+    }
+    
+    convenience init() {
+        self.init(windowNibName: "KMToolbarCustomWindowController")
+    }
+    
+    override func windowDidLoad() {
+        super.windowDidLoad()
+    
+        self.toolbarCustomViewController = KMToolbarCustomViewController()
+//        self.toolbarCustomViewController?.updateToolbar(self.toolbar)
+        self.toolbarCustomViewController?.toolbar = self.toolbar
+        self.contentViewController = self.toolbarCustomViewController
+    }
+}

+ 32 - 0
PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbarCustomWindowController.xib

@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14113" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14113"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner" customClass="KMToolbarCustomWindowController">
+            <connections>
+                <outlet property="window" destination="F0z-JX-Cv5" id="gIp-Ho-8D9"/>
+            </connections>
+        </customObject>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="F0z-JX-Cv5">
+            <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
+            <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
+            <rect key="contentRect" x="196" y="240" width="574" height="570"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="1440" height="877"/>
+            <value key="minSize" type="size" width="574" height="480"/>
+            <value key="maxSize" type="size" width="574" height="1000"/>
+            <view key="contentView" wantsLayer="YES" id="se5-gp-TjO">
+                <rect key="frame" x="0.0" y="0.0" width="574" height="570"/>
+                <autoresizingMask key="autoresizingMask"/>
+            </view>
+            <connections>
+                <outlet property="delegate" destination="-2" id="0bl-1N-AYu"/>
+            </connections>
+        </window>
+    </objects>
+</document>

+ 569 - 0
PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbarItemView.swift

@@ -0,0 +1,569 @@
+//
+//  KMToolbarItemView.swift
+//  PDF Master
+//
+//  Created by tangchao on 2023/10/24.
+//
+
+import Cocoa
+
+class KMToolbarClickButton: NSButton {
+    weak var clickObject: AnyObject?
+}
+
+extension NSControl.ImagePosition {
+    static let imageExpandLeft: NSControl.ImagePosition = .init(rawValue: 100)!
+}
+
+private let KMPopOverClosedByWindowNotificationName = "KMPopOverClosedByWindowNotification"
+extension KMToolbarItemView {
+    public static let popOverClosedNotificationName = Notification.Name(KMPopOverClosedByWindowNotificationName)
+}
+
+@objcMembers class KMToolbarItemView: NSView {
+    
+    var menuFormRepresentation: NSMenuItem?
+    
+    private var _itemIdentifier: String?
+    var itemIdentifier: String? {
+        get {
+            return self._itemIdentifier
+        }
+    }
+    
+    lazy var clickButton: KMToolbarClickButton = {
+        let _clickButton = KMToolbarClickButton()
+        _clickButton.bezelStyle = .regularSquare
+        _clickButton.isBordered = false
+        _clickButton.imagePosition = .imageOnly
+        _clickButton.clickObject = self
+        return _clickButton
+    }()
+    
+    var isSelected = false {
+        didSet {
+            if self.itemIdentifier != KMToolbarDividerItemIdentifier {
+                if (isSelected) {
+                    if (isMainTool) {
+//                        self.layer?.backgroundColor = self.normalBackgroundColor.cgColor
+                        self.imageViewBox.fillColor = self.normalBackgroundColor
+                        self.nameBtn.setTitleColor(color: KMAppearance.titleColor(), font: .SFProTextSemiboldFont(14))
+                        self.linView.isHidden = false
+                        return
+                    }
+//                    self.layer?.backgroundColor = self.selectedBackgroundColor.cgColor
+                    self.imageViewBox.fillColor = self.selectedBackgroundColor
+                    if(self.image != nil && self.alternateImage != nil) {
+                        if (self.selectedImage != nil) {
+                            self.imageViewBtn.image = self.selectedImage!
+                        } else {
+                            self.imageViewBtn.image = self.alternateImage!
+                        }
+                    }
+                    if (self.nameBtn.superview != nil) {
+                        self.nameBtn.setTitleColor(color: KMAppearance.titleColor())
+                    }
+                    if(self.needExpandAction) {
+                        self.needExpandButton.image = NSImage(named: "KMImageNameUXIconBtnTriDownSel")
+                    }
+                } else {
+                    if (isMainTool) {
+//                        self.layer?.backgroundColor = self.normalBackgroundColor.cgColor
+                        self.imageViewBox.fillColor = self.normalBackgroundColor
+                        self.nameBtn.setTitleColor(color: NSColor(red: 97.0/255.0, green: 100.0/255.0, blue: 105.0/255.0, alpha: 1.0),font: .SFProTextRegularFont(14))
+                        self.linView.isHidden = true
+                        return
+                    }
+//                    self.layer?.backgroundColor = self.normalBackgroundColor.cgColor
+                    self.imageViewBox.fillColor = self.normalBackgroundColor
+                    if (self.needExpandAction) {
+                        self.needExpandButton.image = NSImage(named: "KMImageNameUXIconBtnTriDownNor")
+                    }
+                    if (self.image != nil) {
+                        self.imageViewBtn.image = self.image!
+                    }
+                    if (self.nameBtn.superview != nil) {
+                        self.nameBtn.setTitleColor(color: KMAppearance.titleColor())
+                    }
+                }
+            }
+        }
+    }
+    var unEnabled = false {
+        didSet {
+            self.clickButton.isEnabled = !self.unEnabled
+            self.nameBtn.isEnabled = !self.unEnabled
+            self.imageViewBtn.isEnabled = !self.unEnabled
+            self.needExpandButton.isEnabled = !self.unEnabled
+        }
+    }
+    var isShowCustomToolTip = false {
+        didSet {
+            if (self.isShowCustomToolTip) {
+                self.clickButton.toolTip = ""
+            }
+        }
+    }
+    var boxImagePosition: NSControl.ImagePosition = .imageLeft {
+        didSet {
+            self._layoutView()
+        }
+    }
+    
+    var image: NSImage? {
+        didSet {
+            self.imageViewBtn.image = self.image
+        }
+    }
+    var selectedImage: NSImage?
+    var alternateImage: NSImage?
+    
+    var titleName: String? {
+        didSet {
+            self.nameBtn.title = self.titleName ?? " "
+            self.nameBtn.setTitleColor(color: KMAppearance.titleColor())
+        }
+    }
+    
+    weak var target: AnyObject? {
+        didSet {
+            self.clickButton.target = self.target
+        }
+    }
+    var btnAction: Selector? {
+        didSet {
+            self.clickButton.action = self.btnAction
+        }
+    }
+    
+    var needExpandAction = false
+    var btnTag = 0 {
+        didSet {
+            self.clickButton.tag = self.btnTag
+        }
+    }
+    
+    var customizeView: NSView? {
+        didSet {
+            self._layoutView()
+        }
+    }
+    var isMainTool = false {
+        didSet {
+            if (isMainTool) {
+                self.nameBtn.setTitleColor(color: NSColor(red: 97.0/255.0, green: 100.0/255.0, blue: 105.0/255.0, alpha: 1), font: .SFProTextRegularFont(14))
+            } else {
+                self.nameBtn.setTitleColor(color: KMAppearance.titleColor())
+            }
+            self._layoutView()
+        }
+    }
+    
+    var linView: NSView = {
+        let _linView = NSView()
+        _linView.wantsLayer = true
+        _linView.layer?.backgroundColor = NSColor(red: 23/255.0, green: 112/255.0, blue: 244/255.0, alpha: 1).cgColor
+        _linView.layer?.cornerRadius = 2
+        return _linView
+    }()
+  
+    var normalBackgroundColor: NSColor = .clear
+    var selectedBackgroundColor: NSColor = KMAppearance.Status.selColor()
+    
+    var imageViewBox: NSBox = {
+        let _imageViewBox = NSBox()
+        _imageViewBox.borderWidth = 0
+        _imageViewBox.contentViewMargins = NSZeroSize
+        _imageViewBox.boxType = .custom
+        return _imageViewBox
+    }()
+    private lazy var imageViewBtn: NSButton = {
+        let _imageViewBtn = NSButton()
+        _imageViewBtn.bezelStyle = .regularSquare
+        _imageViewBtn.isBordered = false
+        _imageViewBtn.imagePosition = .imageOnly
+        return _imageViewBtn
+    }()
+    private var nameBtn: NSButton = {
+        let _nameBtn = NSButton()
+        _nameBtn.bezelStyle = .regularSquare
+        _nameBtn.isBordered = false
+        _nameBtn.imagePosition = .imageOnly
+        _nameBtn.font = .systemFont(ofSize: 12)
+        _nameBtn.title = ""
+        return _nameBtn
+    }()
+    private var needExpandButton: NSButton = {
+        let _needExpandButton = NSButton()
+        _needExpandButton.bezelStyle = .regularSquare
+        _needExpandButton.isBordered = false
+        _needExpandButton.imagePosition = .imageOnly
+        _needExpandButton.image = NSImage(named: "KMImageNameUXIconBtnTriDownNor")
+        return _needExpandButton
+    }()
+    private var _popOver: NSPopover?
+    var popOver: NSPopover? {
+        get {
+            return self._popOver
+        }
+        set {
+            if self._popOver?.isEqual(to: newValue) == false {
+                self._popOver = newValue
+                if (newValue != nil) {
+                    self.layer?.backgroundColor = self.selectedBackgroundColor.cgColor
+                } else {
+                    if (self.isSelected) {
+                        self.layer?.backgroundColor = self.selectedBackgroundColor.cgColor
+                    }else {
+                        self.layer?.backgroundColor = self.normalBackgroundColor.cgColor
+                    }
+                }
+            }
+        }
+    }
+    
+    private var _menuViewController: KMCustomButtonPopMenuViewController?
+    private var _kNormalImage: NSImage?
+    private var _originalHelpTip: String?
+    
+    deinit {
+        Swift.debugPrint("KMToolbarItemView deinit")
+        NotificationCenter.default.removeObserver(self)
+    }
+    
+    convenience init(itemIdentifier: String) {
+        self.init()
+        
+        self._itemIdentifier = itemIdentifier
+        self.boxImagePosition = .imageLeft
+        self.wantsLayer = true
+        self.layer?.cornerRadius = 5
+        self.layer?.masksToBounds = true
+        
+//        self.normalBackgroundColor = .clear
+//        self.selectedBackgroundColor = NSColor(red: 223.0/255.0, green: 225.0/255.0, blue: 229.0/255.0, alpha: 1)
+        
+        self._addTrackingArea()
+        NotificationCenter.default.addObserver(self, selector: #selector(_windowClosedPop), name: KMToolbarItemView.popOverClosedNotificationName, object: nil)
+    }
+    
+    convenience init(itemIdentifier: String, postition imagePositionImagePosition: NSControl.ImagePosition, withPopMenu popMenuViewController: KMCustomButtonPopMenuViewController?) {
+        self.init()
+        
+        self.boxImagePosition = imagePositionImagePosition
+        self._menuViewController = popMenuViewController
+        self._itemIdentifier = itemIdentifier
+        self.wantsLayer = true
+        self.layer?.cornerRadius = 4
+        self.layer?.masksToBounds = true
+        
+//        self.normalBackgroundColor = .clear
+//        self.selectedBackgroundColor = NSColor(red: 223.0/255.0, green: 225.0/255.0, blue: 229.0/255.0, alpha: 1)
+        
+        self._addTrackingArea()
+        self._layoutView()
+        if (popMenuViewController != nil) {
+            NotificationCenter.default.addObserver(self, selector: #selector(_windowClosedPop), name: KMToolbarItemView.popOverClosedNotificationName, object: nil)
+        }
+    }
+    
+    override func draw(_ dirtyRect: NSRect) {
+        if (self.itemIdentifier == KMToolbarDividerItemIdentifier) {
+            let context = NSGraphicsContext.current?.cgContext
+            KMContextSaveGState(context)
+            KMContextTranslateCTM(context, CGRectGetWidth(dirtyRect)/2.0, CGRectGetHeight(dirtyRect)/2.0-10)
+            KMContextMoveToPoint(context, 0, 0)
+            KMContextAddLineToPoint(context, 0, 20)
+            KMContextSetStrokeColorWithColor(context, NSColor(red: 0, green: 0, blue: 0, alpha: 0.1).cgColor)
+            KMContextStrokePath(context)
+            KMContextRestoreGState(context)
+        }
+    }
+    
+    override var toolTip: String? {
+        get {
+            return self._originalHelpTip
+        }
+        set {
+            self.clickButton.toolTip = newValue ?? ""
+            self._originalHelpTip = self.clickButton.toolTip
+            if(self.isShowCustomToolTip) {
+                self.clickButton.toolTip = ""
+            }
+        }
+    }
+    
+    // MARK: - Private Methods
+    
+    private func _addTrackingArea() {
+        let trackingArea = NSTrackingArea(rect: self.bounds, options: [.mouseEnteredAndExited, .inVisibleRect, .activeInKeyWindow], owner: self)
+        self.addTrackingArea(trackingArea)
+    }
+    
+    override func mouseEntered(with event: NSEvent) {
+        super.mouseEntered(with: event)
+        
+        guard let _window = self.window else {
+            return
+        }
+        
+        if (!_window.isKeyWindow) {
+            return
+        }
+        if (self.itemIdentifier == KMToolbarDividerItemIdentifier || self.customizeView != nil || self.image == nil) {
+            return
+        }
+        if (!self.isSelected) {
+//            self.layer?.backgroundColor = self.selectedBackgroundColor.cgColor
+            self.imageViewBox.fillColor = self.selectedBackgroundColor
+            if(self.image != nil && self.alternateImage != nil) {
+                self._kNormalImage = self.image
+                self.imageViewBtn.image = self.alternateImage
+                if(self.nameBtn.superview != nil) {
+                    self.nameBtn.setTitleColor(color: KMAppearance.titleColor())
+                }
+            }
+        }
+        if (self.needExpandAction) {
+            self.needExpandButton.image = NSImage(named: "KMImageNameUXIconBtnTriDownSel")
+//            [self showPop:self];
+        }else if (self.isShowCustomToolTip) {
+            self.perform(#selector(_showHUDHint), with: nil, afterDelay: 0.1)
+        }
+    }
+    
+    override func mouseExited(with event: NSEvent) {
+        super.mouseExited(with: event)
+        
+        if (!self.isSelected && !self.needExpandAction) {
+//            self.layer?.backgroundColor = self.normalBackgroundColor.cgColor
+            self.imageViewBox.fillColor = self.normalBackgroundColor
+            if(self.image != nil && self.alternateImage != nil) {
+                self.imageViewBtn.image = self._kNormalImage ?? self.image!
+            }
+        }
+
+        if(self.needExpandAction && !self.isSelected) {
+            self.layer?.backgroundColor = self.normalBackgroundColor.cgColor
+            if(self.image != nil && self.alternateImage != nil) {
+                self.imageViewBtn.image = self._kNormalImage ?? self.image!
+            }
+            
+            self.needExpandButton.image = NSImage(named: "KMImageNameUXIconBtnTriDownNor")
+        }
+        
+        guard let _window = self.window else {
+            return
+        }
+        if (!_window.isKeyWindow) {
+            return
+        }
+        
+        if(self.nameBtn.superview != nil && !self.isSelected && !self.isMainTool) {
+            self.nameBtn.setTitleColor(color: KMAppearance.titleColor())
+        }
+        
+        if (self.isShowCustomToolTip && !self.needExpandAction) {
+            NSObject.cancelPreviousPerformRequests(withTarget: self, selector: #selector(_showHUDHint), object: nil)
+            self._closePop()
+        }
+    }
+    
+    @objc private func _showHUDHint() {
+        //    KMToolbarItemPopViewController *popViewController = [[[KMToolbarItemPopViewController alloc] init] autorelease];
+        //    self.popOver = [[[NSPopover alloc] init] autorelease];
+        //    self.popOver.contentViewController = popViewController;
+        //    self.popOver.animates = NO;
+        //    self.popOver.behavior = NSPopoverBehaviorSemitransient;
+        //    self.popOver.backgroundColor = [KMAppearance KMBluegrey01Color];
+        //
+        //    self.popOver.contentSize = popViewController.view.frame.size;
+        //    [popViewController updateWithHelpTip:self.originalHelpTip];
+        //    [self.popOver showRelativeToRect:self.bounds ofView:self preferredEdge:NSRectEdgeMinY];
+    }
+    
+    @objc private func _windowClosedPop(sender: Notification) {
+        if let data = self._popOver?.isEqual(to: sender.object), data {
+            self.popOver = nil
+        }
+    }
+    
+    private func _closePop() {
+        self.popOver?.close()
+        self.popOver = nil
+    }
+    
+    private func _layoutView() {
+        let offset = 4.0
+        let offsetY = 2.0
+        let offsetX = 4.0
+        if self.nameBtn.superview != nil {
+            self.nameBtn.removeFromSuperview()
+        }
+        if self.linView.superview != nil {
+            self.linView.removeFromSuperview()
+        }
+        
+        if self.imageViewBox.superview != nil {
+            self.imageViewBox.removeFromSuperview()
+        }
+        if self.imageViewBtn.superview != nil {
+            self.imageViewBtn.removeFromSuperview()
+        }
+        
+        if self.customizeView != nil {
+            if self.customizeView?.superview != nil {
+                self.customizeView?.removeFromSuperview()
+            }
+            self.addSubview(self.customizeView!)
+            
+            self.customizeView?.mas_makeConstraints({ make in
+                make?.left.right().equalTo()(0)
+                make?.centerY.equalTo()(0)
+                make?.width.offset()(self.customizeView!.frame.size.width)
+                make?.height.offset()(self.customizeView!.frame.size.height)
+            })
+            return
+        }
+        if self.boxImagePosition == .imageOnly && self.itemIdentifier != KMToolbarDividerItemIdentifier {
+            self.addSubview(self.imageViewBox)
+            self.imageViewBox.mas_makeConstraints { make in
+                make?.left.right().top().bottom().equalTo()(0)
+            }
+            
+            self.imageViewBox.contentView?.addSubview(self.imageViewBtn)
+            self.imageViewBtn.mas_makeConstraints { make in
+                make?.left.equalTo()(self.imageViewBox.mas_left)?.offset()(offsetX)
+                make?.top.equalTo()(self.imageViewBox.mas_top)?.offset()(offsetY)
+                make?.bottom.equalTo()(self.imageViewBox.mas_bottom)?.offset()(-offsetY)
+                make?.right.equalTo()(self.imageViewBox.mas_right)?.offset()(-offsetX)
+            }
+        } else if (self.boxImagePosition == .imageLeft) {
+            self.addSubview(self.imageViewBox)
+            self.imageViewBox.mas_makeConstraints { make in
+                make?.left.top().bottom().equalTo()(0)
+            }
+            
+            self.imageViewBox.contentView?.addSubview(self.imageViewBtn)
+            self.imageViewBtn.mas_makeConstraints { make in
+                make?.left.equalTo()(self.imageViewBox.mas_left)?.offset()(2 * offsetX)
+                make?.top.equalTo()(self.imageViewBox.mas_top)?.offset()(offsetY)
+                make?.bottom.equalTo()(self.imageViewBox.mas_bottom)?.offset()(-offsetY)
+                make?.right.equalTo()(0)
+            }
+            
+            self.addSubview(self.nameBtn)
+            self.nameBtn.mas_makeConstraints { make in
+                make?.centerY.equalTo()(0)
+                make?.left.equalTo()(self.imageViewBox.mas_right)?.offset()(0)
+                if (self.needExpandAction) {
+                    make?.right.equalTo()(self.mas_right)?.offset()(-2*offsetX-8)
+                } else {
+                    make?.right.equalTo()(self.mas_right)?.offset()(-2*offsetX)
+                }
+            }
+            
+            if(self.needExpandAction) {
+                self.needExpandButton.image = NSImage(named: "KMImageNameUXIconBtnTriDownNor")
+                self.addSubview(self.needExpandButton)
+                self.needExpandButton.mas_makeConstraints { make in
+                    make?.centerY.equalTo()(0)
+                    make?.width.height().equalTo()(8)
+                    make?.right.equalTo()(self.mas_right)?.offset()(-offset)
+                }
+            }
+            
+            self.layer?.cornerRadius = 6
+        } else if (self.boxImagePosition == .imageExpandLeft) {
+            self.addSubview(self.imageViewBox)
+            self.imageViewBox.mas_makeConstraints { make in
+                make?.left.top().bottom().equalTo()(0)
+            }
+
+            self.imageViewBox.contentView?.addSubview(self.imageViewBtn)
+            self.imageViewBtn.mas_makeConstraints { make in
+                make?.left.equalTo()(self.imageViewBox.mas_left)?.offset()(offsetX)
+                make?.top.equalTo()(self.imageViewBox.mas_top)?.offset()(offsetY)
+                make?.bottom.equalTo()(self.imageViewBox.mas_bottom)?.offset()(-offsetY)
+                make?.right.equalTo()(0)
+            }
+
+            self.needExpandButton.image = NSImage(named: "KMImageNameUXIconBtnTriDownNor")
+            self.addSubview(self.needExpandButton)
+            self.needExpandButton.mas_makeConstraints { make in
+                make?.centerY.equalTo()(0)
+                make?.width.height().equalTo()(8)
+                make?.right.equalTo()(self.mas_right)?.offset()(-offset)
+            }
+
+            self.addSubview(self.nameBtn)
+            self.nameBtn.mas_makeConstraints { make in
+                make?.centerY.equalTo()(0)
+                make?.left.equalTo()(self.imageViewBox.mas_right)?.offset()(0)
+                make?.right.equalTo()(self.needExpandButton.mas_left)?.offset()(0)
+            }
+        } else if (self.boxImagePosition == .imageAbove) {
+            self.addSubview(self.nameBtn)
+            self.nameBtn.alignment = .center
+            self.nameBtn.mas_makeConstraints { make in
+                make?.left.right().equalTo()(0)
+                make?.width.greaterThanOrEqualTo()(32)
+                make?.bottom.equalTo()(self.mas_bottom)?.offset()(0)
+            }
+            
+            self.addSubview(self.imageViewBox)
+            self.imageViewBox.mas_makeConstraints { make in
+                make?.top.equalTo()(0)
+                make?.width.equalTo()(32)
+                make?.centerX.equalTo()(0)
+                make?.bottom.equalTo()(nameBtn.mas_top)?.offset()(0)
+            }
+        
+            self.imageViewBox.contentView?.addSubview(self.imageViewBtn)
+            self.imageViewBtn.mas_makeConstraints { make in
+                make?.left.equalTo()(offset)
+                make?.right.equalTo()(-offset)
+                make?.top.equalTo()(0)
+                make?.bottom.equalTo()(0)
+            }
+        } else {
+            if (self.itemIdentifier == KMToolbarDividerItemIdentifier) {
+                self.addSubview(self.imageViewBox)
+                self.imageViewBox.mas_makeConstraints { make in
+                    make?.top.equalTo()(0)
+                    make?.width.equalTo()(8)
+                    make?.left.equalTo()(0)
+                    make?.right.equalTo()(0)
+                    make?.bottom.equalTo()(self.mas_bottom)?.offset()(0)
+                }
+            }
+
+        }
+
+        if self.nameBtn.superview != nil && self.isMainTool {
+            self.addSubview(self.linView)
+            self.linView.mas_makeConstraints { make in
+                make?.width.offset()(32)
+                make?.height.offset()(3)
+                make?.centerX.equalTo()(self.mas_centerX)
+                make?.bottom.equalTo()(self.mas_bottom)?.offset()(0)
+            }
+            
+            self.nameBtn.font = .systemFont(ofSize: 14)
+            self.linView.isHidden = true
+        } else {
+            self.nameBtn.font = .systemFont(ofSize: 12)
+        }
+        
+        if self.itemIdentifier != KMToolbarDividerItemIdentifier {
+            self.imageViewBox.borderColor = .clear
+            self.imageViewBox.borderWidth = 1.0
+            self.imageViewBox.cornerRadius = 7.0
+            
+            self.addSubview(self.clickButton)
+            self.clickButton.mas_makeConstraints { make in
+                make?.left.right().top().bottom().equalTo()(0)
+            }
+        }
+    }
+}

+ 583 - 0
PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbarView.swift

@@ -0,0 +1,583 @@
+//
+//  KMToolbarView.swift
+//  PDF Master
+//
+//  Created by tangchao on 2023/10/24.
+//
+
+import Cocoa
+
+private let KMToolbarSpaceItemWidth = 30.0
+private let KMToolbarLineItemWidth = 1.0
+private let KMToolbarItemSpace = 8.0
+
+@objc protocol KMToolbarViewDelegate: NSObjectProtocol {
+    @objc optional func toolbar(_ toolbar: KMToolbarView, itemFor identifier: String) -> KMToolbarItemView
+    
+    @objc optional func toolbarAllowedItemIdentifiers(_ toolbar: KMToolbarView) -> [String]
+    @objc optional func toolbarDefaultItemIdentifiers(_ toolbar: KMToolbarView) -> [String]
+    
+    @objc optional func toolbarLeftDefaultItemIdentifiers(_ toolbar: KMToolbarView) -> [String]
+    @objc optional func toolbarRightDefaultItemIdentifiers(_ toolbar: KMToolbarView) -> [String]
+}
+
+@objcMembers class KMToolbarView: NSView {
+    private var _toolbarIdentifier: String?
+    var toolbarIdentifier: String? {
+        get {
+            return self._toolbarIdentifier
+        }
+    }
+    
+    private var _items: [KMToolbarItemView] = []
+    var items: [KMToolbarItemView] {
+        get {
+            return self._items
+        }
+    }
+    
+    weak var delegate: KMToolbarViewDelegate?
+    
+    private var _visibleItems: [KMToolbarItemView] = []
+    private var _invisibleItems: [KMToolbarItemView] = []
+    private var _contentView: NSView?
+    var contentView: NSView {
+        get {
+            if (self._contentView == nil) {
+                self._contentView = NSView()
+            }
+            
+            return self._contentView!
+        }
+    }
+    lazy var moreButton: NSButton = {
+        let _moreButton = NSButton()
+        _moreButton.bezelStyle = .regularSquare
+        _moreButton.isBordered = false
+        _moreButton.font = .systemFont(ofSize: 20)
+        _moreButton.title = " »"
+        _moreButton.isHidden = true
+        _moreButton.target = self
+        _moreButton.action = #selector(_moreButtonAction)
+        _moreButton.wantsLayer = true
+        _moreButton.layer?.backgroundColor = NSColor(red: 223.0/255.0, green: 225.0/255.0, blue: 229.0/255.0, alpha: 1).cgColor
+        return _moreButton
+    }()
+    
+    private lazy var centerView: NSView = {
+        let view = NSView()
+        return view
+    }()
+    private lazy var leftView: NSView = {
+        let view = NSView()
+        view.wantsLayer = true
+        view.layer?.backgroundColor = NSColor(red: 247/255.0, green: 248/255.0, blue: 250/255.0 , alpha: 1).cgColor
+        return view
+    }()
+    
+    private class KMToolbarView_rightView: NSView {}
+    private lazy var rightView: NSView = {
+        let view = KMToolbarView_rightView()
+        view.wantsLayer = true
+        view.layer?.backgroundColor = NSColor(red: 247/255.0, green: 248/255.0, blue: 250/255.0, alpha: 1).cgColor
+        return view
+    }()
+    
+    convenience init(identifier: String) {
+        self.init()
+        
+        self._toolbarIdentifier = identifier
+        self._addTrackingArea()
+        
+        NotificationCenter.default.addObserver(self, selector: #selector(toolbarCustomChangeNotification), name: KMToolbarCustomChangeNotification, object: nil)
+    }
+    
+    deinit {
+        Swift.debugPrint("KMToolbarView deinit")
+        NotificationCenter.default.removeObserver(self)
+    }
+    
+    // MARK: - Private Methods
+    
+    private func _addTrackingArea() {
+        let trackingArea = NSTrackingArea(rect: self.bounds, options: [.inVisibleRect, .activeInKeyWindow, .mouseMoved], owner: self)
+        self.addTrackingArea(trackingArea)
+    }
+    
+    override func mouseMoved(with event: NSEvent) {
+        self.window?.mouseMoved(with: event)
+        super.mouseMoved(with: event)
+    }
+    
+    @objc private func _moreButtonAction() {
+        let menu = NSMenu()
+        for item in self._invisibleItems {
+            if (item.itemIdentifier == KMToolbarDividerItemIdentifier) {
+                menu.addItem(NSMenuItem.separator())
+            } else if (item.menuFormRepresentation != nil) {
+                menu.addItem(item.menuFormRepresentation!)
+            }
+        }
+        menu.popUp(positioning: menu.items.first, at: NSMakePoint(CGRectGetMaxX(self.moreButton.frame), CGRectGetMaxY(self.moreButton.frame)-5), in: self)
+    }
+    
+    private func _updateMainView() {
+        if (self.centerView.superview == nil) {
+            self.addSubview(self.centerView)
+        }
+
+        self._updateLeftView()
+        self._updateRightView()
+        
+        self.centerView.mas_remakeConstraints { make in
+            make?.right.equalTo()(0)
+            make?.top.equalTo()(self.mas_top)?.offset()(0)
+            make?.bottom.equalTo()(self.mas_bottom)?.offset()(0)
+            make?.left.mas_equalTo()(0)
+        }
+        
+        if(self.contentView.superview == nil) {
+            self.centerView.addSubview(self.contentView)
+            self.contentView.mas_makeConstraints { make in
+                make?.centerX.equalTo()(0)
+                make?.centerY.equalTo()(0)
+            }
+        }
+        
+        for item in self.items {
+            item.removeFromSuperview()
+        }
+        self._items = []
+        
+        var posX = 0.0
+        var items: [KMToolbarItemView] = []
+        var itemIdentifiers = self.delegate?.toolbarDefaultItemIdentifiers?(self) ?? []
+        var lastItem: KMToolbarItemView?
+        for i in 0 ..< (itemIdentifiers.count-self._invisibleItems.count) {
+            let itemIdentifier = itemIdentifiers[i]
+//            if (![itemIdentifier isKindOfClass:[NSString class]]) {
+//                return;
+//            }
+            var item: KMToolbarItemView?
+            if itemIdentifier == KMToolbarDividerItemIdentifier {
+                item = KMToolbarItemView(itemIdentifier: itemIdentifier, postition: .imageOnly, withPopMenu: nil)
+            } else if itemIdentifier == KMNewToolbarSpaceItemIdentifier {
+                item = KMToolbarItemView(itemIdentifier: itemIdentifier, postition: .imageOnly, withPopMenu: nil)
+                item?.layer?.backgroundColor = .clear
+                item?.imageViewBox.borderColor = .clear
+                item?.layer?.cornerRadius = 0.0
+            } else if let data = self.delegate?.toolbar?(self, itemFor: itemIdentifier) {
+                item = data
+            }
+            if (item == nil) {
+                continue
+            }
+
+            self.contentView.addSubview(item!)
+            if (lastItem != nil) {
+                if (i == itemIdentifiers.count - 1) {
+                    item?.mas_makeConstraints({ make in
+                        make?.top.bottom().equalTo()(0)
+                        make?.left.equalTo()(lastItem!.mas_right)?.offset()(KMToolbarItemSpace)
+                        make?.right.equalTo()(self.contentView.mas_right)?.offset()(0)
+                    })
+                } else {
+                    item?.mas_makeConstraints({ make in
+                        make?.top.bottom().equalTo()(0)
+                        make?.left.equalTo()(lastItem!.mas_right)?.offset()(KMToolbarItemSpace)
+                    })
+                }
+                
+            } else {
+                if (item?.image != nil) {
+                    item?.mas_makeConstraints({ make in
+                        make?.top.bottom().equalTo()(0)
+                        make?.left.equalTo()(0)
+                    })
+                } else {
+                    item?.mas_makeConstraints({ make in
+                        make?.top.bottom().equalTo()(0)
+                        make?.left.equalTo()(0)
+                        make?.height.offset()(40)
+                    })
+                }
+            }
+            items.append(item!)
+            lastItem = item
+            posX += item!.frame.size.width
+        }
+        self._items = items
+        
+        self.addSubview(self.moreButton)
+    }
+    
+    // UI 20 16
+    // item w 28 h 24
+    private func _updateView() {
+        self._updateLeftView()
+        self._updateRightView()
+        
+        if(self.contentView.superview == nil) {
+            self.addSubview(self.contentView)
+            self.contentView.mas_makeConstraints { make in
+                make?.centerX.equalTo()(0)
+                make?.centerY.equalTo()(0)
+            }
+        }
+        
+        for item in self.items {
+            item.removeFromSuperview()
+        }
+        self._items = []
+        
+        var posX = 0.0
+        var items: [KMToolbarItemView] = []
+        var itemIdentifiers = self.delegate?.toolbarDefaultItemIdentifiers?(self) ?? []
+        
+        var lastItem: KMToolbarItemView?
+        for i in 0 ..< (itemIdentifiers.count-self._invisibleItems.count) {
+            let itemIdentifier = itemIdentifiers[i]
+//            if (![itemIdentifier isKindOfClass:[NSString class]]) {
+//                return;
+//            }
+            var item: KMToolbarItemView?
+            if itemIdentifier == KMToolbarDividerItemIdentifier {
+                item = KMToolbarItemView(itemIdentifier: itemIdentifier, postition: .imageOnly, withPopMenu: nil)
+            } else if itemIdentifier == KMNewToolbarSpaceItemIdentifier {
+                item = KMToolbarItemView(itemIdentifier: itemIdentifier, postition: .imageOnly, withPopMenu: nil)
+                item?.layer?.backgroundColor = .clear
+                item?.imageViewBox.borderColor = .clear
+                item?.layer?.cornerRadius = 0.0
+            } else if let data = self.delegate?.toolbar?(self, itemFor: itemIdentifier) {
+                item = data
+            }
+            if (item == nil) {
+                continue
+            }
+
+            self.contentView.addSubview(item!)
+            if (lastItem != nil) {
+                if (i == itemIdentifiers.count - 1) {
+                    item?.mas_makeConstraints({ make in
+                        make?.top.bottom().equalTo()(0)
+                        make?.left.equalTo()(lastItem!.mas_right)?.offset()(KMToolbarItemSpace)
+                        make?.right.equalTo()(self.contentView.mas_right)?.offset()(0)
+                    })
+                } else {
+                    if itemIdentifier == KMNewToolbarSpaceItemIdentifier {
+//                    if ([itemIdentifier isEqualToString:]) {
+                        item?.mas_makeConstraints({ make in
+                            make?.top.bottom().equalTo()(0)
+                            make?.left.equalTo()(lastItem!.mas_right)?.offset()(2)
+                        })
+                    } else {
+                        if lastItem?.itemIdentifier == KMNewToolbarSpaceItemIdentifier {
+//                        if ([lastItem.itemIdentifier isEqualToString:]) {
+                            item?.mas_makeConstraints({ make in
+                                make?.top.bottom().equalTo()(0)
+                                make?.left.equalTo()(lastItem!.mas_right)?.offset()(2)
+                            })
+                        } else {
+                            item?.mas_makeConstraints({ make in
+                                make?.top.bottom().equalTo()(0)
+                                make?.left.equalTo()(lastItem!.mas_right)?.offset()(KMToolbarItemSpace)
+                            })
+                        }
+                    }
+                }
+            } else {
+                if (item?.image != nil) {
+                    item?.mas_makeConstraints({ make in
+                        make?.top.bottom().equalTo()(0)
+                        make?.left.equalTo()(0)
+                    })
+                } else {
+                    item?.mas_makeConstraints({ make in
+                        make?.top.bottom().equalTo()(0)
+                        make?.left.equalTo()(0)
+                        make?.height.offset()(40)
+                    })
+                }
+            }
+            items.append(item!)
+            lastItem = item
+            posX += item!.frame.size.width
+        }
+        self._items = items;
+        
+        self.addSubview(self.moreButton)
+    }
+    
+    private func _updateLeftView() {
+        // 刷新前移除视图
+        for item in self.leftView.subviews {
+            item.removeFromSuperview()
+        }
+        
+        if let itemIdentifiers = self.delegate?.toolbarLeftDefaultItemIdentifiers?(self), itemIdentifiers.count > 0 {
+            if (self.leftView.superview == nil) {
+                self.addSubview(self.leftView)
+                
+                self.leftView.mas_makeConstraints { make in
+                    make?.left.equalTo()(self.mas_left)?.offset()(0)
+                    make?.top.equalTo()(self.mas_top)?.offset()(0)
+                    make?.bottom.equalTo()(self.mas_bottom)?.offset()(0)
+                }
+            }
+            
+            var lastItem: KMToolbarItemView?
+            for i in 0 ..< itemIdentifiers.count {
+                let itemIdentifier = itemIdentifiers[i]
+                var item: KMToolbarItemView?
+                if itemIdentifier == KMToolbarDividerItemIdentifier {
+                    item = KMToolbarItemView(itemIdentifier: itemIdentifier, postition: .imageOnly, withPopMenu: nil)
+                } else if itemIdentifier == KMNewToolbarSpaceItemIdentifier {
+                    item = KMToolbarItemView(itemIdentifier: itemIdentifier, postition: .imageOnly, withPopMenu: nil)
+                    item?.layer?.backgroundColor = .clear
+                    item?.imageViewBox.borderColor = .clear
+                    item?.layer?.cornerRadius = 0.0
+                } else if let data = self.delegate?.toolbar?(self, itemFor: itemIdentifier) {
+                    item = data
+                }
+                if (item == nil) {
+                    continue
+                }
+                
+                self.leftView.addSubview(item!)
+                if (lastItem != nil) {
+                    if (i == itemIdentifiers.count - 1) {
+                        item?.mas_makeConstraints({ make in
+                            make?.top.equalTo()(0)
+                            make?.bottom.equalTo()(0)
+                            make?.left.equalTo()(lastItem!.mas_right)?.offset()(KMToolbarItemSpace)
+                            make?.right.equalTo()(self.leftView.mas_right)?.offset()(0)
+                        })
+                    } else {
+                        item?.mas_makeConstraints({ make in
+                            make?.top.equalTo()(0)
+                            make?.bottom.equalTo()(0)
+                            make?.left.equalTo()(lastItem!.mas_right)?.offset()(KMToolbarItemSpace)
+                        })
+                    }
+                    
+                } else {
+                    item?.mas_makeConstraints({ make in
+                        make?.top.equalTo()(0)
+                        make?.bottom.equalTo()(0)
+                        make?.left.equalTo()(20)
+                    })
+                }
+                lastItem = item
+            }
+        }
+    }
+    
+    private func _updateRightView() {
+        // 刷新前移除视图
+        for item in self.rightView.subviews {
+            item.removeFromSuperview()
+        }
+        
+        if let itemIdentifiers = self.delegate?.toolbarRightDefaultItemIdentifiers?(self) {
+            if (self.rightView.superview == nil) {
+                self.addSubview(self.rightView)
+                
+                self.rightView.mas_makeConstraints { make in
+                    make?.right.equalTo()(self.mas_right)?.offset()(0)
+                    make?.top.equalTo()(self.mas_top)?.offset()(0)
+                    make?.bottom.equalTo()(self.mas_bottom)?.offset()(0)
+                }
+            }
+            
+            var lastItem: KMToolbarItemView?
+            for i in 0 ..< itemIdentifiers.count {
+                let itemIdentifier = itemIdentifiers[i]
+                
+                var item: KMToolbarItemView?
+                if itemIdentifier == KMToolbarDividerItemIdentifier {
+                    item = KMToolbarItemView(itemIdentifier: itemIdentifier, postition: .imageOnly, withPopMenu: nil)
+                } else if itemIdentifier == KMNewToolbarSpaceItemIdentifier {
+                    item = KMToolbarItemView(itemIdentifier: itemIdentifier, postition: .imageOnly, withPopMenu: nil)
+                    item?.layer?.backgroundColor = .clear
+                    item?.imageViewBox.borderColor = .clear
+                    item?.layer?.cornerRadius = 0.0;
+                } else if let data = self.delegate?.toolbar?(self, itemFor: itemIdentifier) {
+                    item = data
+                }
+                
+                if (item == nil) {
+                    continue
+                }
+                
+                self.rightView.addSubview(item!)
+                if (lastItem != nil) {
+                    if (i == itemIdentifiers.count - 1) {
+                        item?.mas_makeConstraints({ make in
+                            make?.top.equalTo()(0)
+                            make?.bottom.equalTo()(0)
+                            make?.left.equalTo()(lastItem!.mas_right)?.offset()(KMToolbarItemSpace)
+                            make?.right.equalTo()(self.rightView.mas_right)?.offset()(-20)
+                        })
+                    } else {
+                        item?.mas_makeConstraints({ make in
+                            make?.top.equalTo()(0)
+                            make?.bottom.equalTo()(0)
+                            make?.left.equalTo()(lastItem!.mas_right)?.offset()(KMToolbarItemSpace)
+                        })
+                    }
+                } else {
+                    if (i == itemIdentifiers.count - 1) {
+                        item?.mas_makeConstraints({ make in
+                            make?.top.equalTo()(0)
+                            make?.bottom.equalTo()(0)
+                            make?.left.equalTo()(self.rightView.mas_left)?.offset()(KMToolbarItemSpace)
+                            make?.right.equalTo()(self.rightView.mas_right)?.offset()(-20)
+                        })
+                    } else {
+                        item?.mas_makeConstraints({ make in
+                            make?.top.equalTo()(0)
+                            make?.bottom.equalTo()(0)
+                            make?.left.equalTo()(0)
+                        })
+                    }
+                }
+                lastItem = item
+            }
+        }
+    }
+    
+    override func updateLayer() {
+        super.updateLayer()
+        
+        self.layer?.backgroundColor = .clear
+    }
+    
+    // MARK: - View Methods
+    
+    override func viewWillMove(toWindow newWindow: NSWindow?) {
+        super.viewWillMove(toWindow: newWindow)
+        
+        if (newWindow != nil && self._contentView == nil) {
+            let leftitemIdentifiers = self.delegate?.toolbarLeftDefaultItemIdentifiers?(self) ?? []
+            if (leftitemIdentifiers.count > 0) {
+                self._updateMainView()
+            }else {
+                self._updateView()
+            }
+
+            self.resizeSubviews(withOldSize: self.frame.size)
+    
+//            NotificationCenter.default.addObserver(self, selector: #selector(toolbarCustomChangeNotification), name: KMToolbarCustomChangeNotification, object: nil)
+            let topLine = NSBox(frame: CGRectMake(0, 0, self.frame.size.width, 0.5))
+            topLine.boxType = .separator
+            topLine.fillColor = .black
+            self.addSubview(topLine)
+            topLine.mas_makeConstraints { make in
+                make?.left.right().equalTo()(self)
+                make?.bottom.equalTo()(self.mas_bottom)?.offset()(-0.5)
+                make?.height.offset()(0.5)
+            }
+
+//            NSBox *bottomLine = [[NSBox alloc] initWithFrame:];
+            let bottomLine = NSBox(frame: CGRectMake(0, 0, self.frame.size.width, 0.5))
+            bottomLine.boxType = .separator
+            bottomLine.fillColor = .black
+            self.addSubview(bottomLine)
+            bottomLine.mas_makeConstraints { make in
+                make?.left.right().equalTo()(self)
+                make?.top.equalTo()(self.mas_top)?.offset()(0.1)
+                make?.height.offset()(0.5)
+            }
+        };
+
+        if (newWindow != nil) {
+            self._addTrackingArea()
+        }
+    }
+    
+    override func resizeSubviews(withOldSize oldSize: NSSize) {
+        super.resizeSubviews(withOldSize: oldSize)
+        
+        if (self._contentView == nil) {
+            return;
+        }
+        let moreButtonWidth = 30.0
+        let leftButtonWidth = 10.0
+        var frame = self.contentView.frame
+
+        var count = self.items.count
+        var idx = count-1
+        for item in self.items.reversed() {
+            if (CGRectGetMaxX(item.frame) <= self.frame.size.width-moreButtonWidth-leftButtonWidth) {
+                count = idx
+                break
+            }
+            idx -= 1
+        }
+        if (count >= self.items.count) {
+            return
+        }
+        frame.size.width = CGRectGetMaxX(self.items[count].frame)
+        if (count == self.items.count-1) {
+            frame.origin.x = (self.frame.size.width-frame.size.width)/2.0;
+            self.moreButton.isHidden = true
+            self._visibleItems = self.items
+            self._invisibleItems = []
+            self.contentView.mas_remakeConstraints { make in
+                make?.centerX.equalTo()(0)
+                make?.centerY.equalTo()(0)
+            }
+        } else {
+            frame.origin.x = leftButtonWidth
+            self.moreButton.mas_makeConstraints { make in
+                make?.top.bottom().equalTo()(0)
+                make?.width.offset()(moreButtonWidth)
+                make?.right.equalTo()(self.mas_right)?.offset()(0)
+            }
+            self.moreButton.isHidden = false
+            self._visibleItems.removeAll()
+            for i in 0 ... count+1 {
+                self._visibleItems.append(self.items[i])
+            }
+    //        self.invisibleItems = [self.items subarrayWithRange:NSMakeRange(count+1, self.items.count-count-1)];
+            self.contentView.mas_remakeConstraints { make in
+                make?.left.equalTo()(self.mas_left)?.offset()(10)
+                make?.centerY.equalTo()(0)
+            }
+        }
+        
+        self._invisibleItems.removeAll()
+        for item in self.items.reversed() {
+            if (CGRectGetMaxX(item.frame) <= self.frame.size.width-moreButtonWidth-leftButtonWidth) {
+                item.isHidden = false
+            } else {
+                item.isHidden = true
+                self._invisibleItems.append(item)
+            }
+        }
+    }
+    
+    func reloadData() {
+        let leftitemIdentifiers = self.delegate?.toolbarLeftDefaultItemIdentifiers?(self) ?? []
+        if (leftitemIdentifiers.count > 0) {
+            self._updateMainView()
+        } else {
+            self._updateView()
+        }
+        
+        self.resizeSubviews(withOldSize: self.frame.size)
+    }
+    
+    func itemForItemIdentifier(_ itemIdentifier: String) -> KMToolbarItemView? {
+        for item in self.items {
+            if (item.itemIdentifier == itemIdentifier) {
+                return item
+            }
+        }
+        return nil
+    }
+    
+    @objc func toolbarCustomChangeNotification() {
+        self.reloadData()
+    }
+}

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 972 - 959
PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbarViewController.swift


+ 41 - 19
PDF Office/PDF Master/Class/PDFWindowController/Toolbar/PublicKey.swift

@@ -14,6 +14,7 @@ let KMDocumentZoomOutToolbarItemIdentifier = "KMDocumentZoomOutToolbarItemIdenti
 let KMDocumentZoomViewToolbarItemIdentifier = "KMDocumentZoomViewToolbarItemIdentifier"
 let KMDocumentPreviousPageToolbarItemIdentifier = "KMDocumentPreviousPageToolbarItemIdentifier"
 let KMDocumentNextPageToolbarItemIdentifier = "KMDocumentNextPageToolbarItemIdentifier"
+let KMDocumentHomeToolbarItemIdentifier = "KMDocumentHomeToolbarItemIdentifier"
 let KMDocumentAnnotationToolbarItemIdentifier  = "KMDocumentAnnotationToolbarItemIdentifier"
 let KMDocumentPageToolbarItemIdentifier = "KMDocumentPageToolbarItemIdentifier"
 let KMDocumentConversonToolbarItemIdentifier = "KMDocumentConversonToolbarItemIdentifier"
@@ -22,16 +23,19 @@ let KMDocumentFormToolbarItemIdentifier = "KMDocumentFormToolbarItemIdentifier"
 let KMDocumentEditToolbarItemIdentifier = "KMDocumentPageEditToolbarItemIdentifier"
 let KMDocumentFillSginToolbarItemIdentifier = "KMDocumentFillSginToolbarItemIdentifier"
 let KMDocumentToolToolbarItemIdentifier = "KMDocumentToolToolbarItemIdentifier"
+let KMDocumentRedactToolbarItemIdentifier = "KMDocumentRedactToolbarItemIdentifier"
+let KMDocumentViewSettingToolbarItemIdentifier = "KMDocumentViewSettingToolbarItemIdentifier"
 let KMDocumentPrintToolbarItemIdentifier = "KMDocumentPrintToolbarItemIdentifier"
 let KMDocumentAITranslationToolbarItemIdentifier = "KMDocumentAITranslationToolbarItemIdentifier"
 let KMDocumentShareToolbarItemIdentifier = "KMDocumentShareToolbarItemIdentifier"
+let KMDocumentSearchToolbarItemIdentifier = "KMDocumentSearchToolbarItemIdentifier"
 let KMRightControlToolbarItemIdentifier  = "KMRightControlToolbarItemIdentifier"
 let mainToolIdentifiers = [KMLeftControlToolbarItemIdentifier, KMDocumentZoomToolbarItemIdentifier, KMDocumentZoomOutToolbarItemIdentifier,
                            KMDocumentZoomViewToolbarItemIdentifier, KMDocumentPreviousPageToolbarItemIdentifier, KMDocumentNextPageToolbarItemIdentifier,
-                           KMDocumentAnnotationToolbarItemIdentifier, KMDocumentPageToolbarItemIdentifier, KMDocumentConversonToolbarItemIdentifier,
+                           KMDocumentHomeToolbarItemIdentifier, KMDocumentAnnotationToolbarItemIdentifier, KMDocumentPageToolbarItemIdentifier, KMDocumentConversonToolbarItemIdentifier,KMDocumentRedactToolbarItemIdentifier,KMDocumentViewSettingToolbarItemIdentifier,
                            KMDocumentScanOCRToolbarItemIdentifier, KMDocumentFormToolbarItemIdentifier, KMDocumentEditToolbarItemIdentifier,
                            KMDocumentFillSginToolbarItemIdentifier, KMDocumentToolToolbarItemIdentifier, KMDocumentPrintToolbarItemIdentifier,
-                           KMDocumentShareToolbarItemIdentifier, KMRightControlToolbarItemIdentifier]
+                           KMDocumentShareToolbarItemIdentifier, KMDocumentSearchToolbarItemIdentifier, KMRightControlToolbarItemIdentifier]
 
 /// annotation
 //
@@ -54,15 +58,17 @@ let KMToolbarLinkAnnotationItemIdentifier =  "KMToolbarLinkAnnotationItemIdentif
 let KMToolbarSignSignatureAnnotationItemIdentifier =  "KMToolbarSignSignatureAnnotationItemIdentifier"
 let KMAnnotationStampToolbarItemIdentifier =  "KMAnnotationStampToolbarItemIdentifier"
 let KMToolbarShowToolbarItemIdentifier =  "KMToolbarShowToolbarItemIdentifier"
+let KMToolbarAnnotationSettingItemIdentifier =  "KMToolbarAnnotationSettingItemIdentifier"
 let annotationToolIdentifiers = [KMToolbarMoveToolModeItemIdentifier, KMToolbarMagnifyToolModeItemIdentifier, KMToolbarSelectToolModeItemIdentifier,
                                  KMToolbarZoomToSelectionItemIdentifier, KMToolbarHighlightAnnotationItemIdentifier, KMToolbarUnderlineAnnotationItemIdentifier,
                                  KMToolbarStrikeOutAnnotationItemIdentifier, KMToolbarInkAnnotationItemIdentifier, KMToolbarFreeTextAnnotationItemIdentifier,
                                  KMToolbarAnchoredAnnotationItemIdentifier, KMToolbarSquareAnnotationItemIdentifier, KMToolbarCircleAnnotationItemIdentifier,
                                  KMToolbarLineAnnotationItemIdentifier, KMToolbarArrowAnnotationItemIdentifier, KMToolbarLinkAnnotationItemIdentifier,
-                                 KMToolbarSignSignatureAnnotationItemIdentifier, KMAnnotationStampToolbarItemIdentifier, KMToolbarShowToolbarItemIdentifier]
+                                 KMToolbarSignSignatureAnnotationItemIdentifier, KMAnnotationStampToolbarItemIdentifier, KMToolbarShowToolbarItemIdentifier, KMToolbarAnnotationSettingItemIdentifier]
 
 // PageEdit
 let KMToolbarPageEditPageRangeItemIdentifier = "KMToolbarPageEditPageRangeItemIdentifier"
+let KMToolbarPageEditRotateItemIdentifier = "KMToolbarPageEditRotateItemIdentifier"
 let KMToolbarPageEditLeftRotateItemIdentifier = "KMToolbarPageEditLeftRotateItemIdentifier"
 let KMToolbarPageEditRightRotateItemIdentifier = "KMToolbarPageEditRightRotateItemIdentifier"
 let KMToolbarPageEditInsetItemIdentifier = "KMToolbarPageEditInsetItemIdentifier"
@@ -70,10 +76,15 @@ let KMToolbarPageEditExtractItemIdentifier = "KMToolbarPageEditExtractItemIdenti
 let KMToolbarPageEditReplaceItemIdentifier = "KMToolbarPageEditReplaceItemIdentifier"
 let KMToolbarPageEditSplitItemIdentifier = "KMToolbarPageEditSplitItemIdentifier"
 let KMToolbarPageEditReverseItemIdentifier = "KMToolbarPageEditReverseItemIdentifier"
+let KMToolbarPageEditCopyItemIdentifier = "KMToolbarPageEditCopyItemIdentifier"
+let KMToolbarPageEditPasteItemIdentifier = "KMToolbarPageEditPasteItemIdentifier"
 let KMToolbarPageEditDeleteItemIdentifier = "KMToolbarPageEditDeleteItemIdentifier"
-let pageEditToolIdentifiers = [KMToolbarPageEditPageRangeItemIdentifier, KMToolbarPageEditLeftRotateItemIdentifier, KMToolbarPageEditRightRotateItemIdentifier,
-                               KMToolbarPageEditInsetItemIdentifier, KMToolbarPageEditExtractItemIdentifier, KMToolbarPageEditReplaceItemIdentifier,
-                               KMToolbarPageEditSplitItemIdentifier, KMToolbarPageEditReverseItemIdentifier, KMToolbarPageEditDeleteItemIdentifier]
+let pageEditToolIdentifiers = [KMToolbarPageEditPageRangeItemIdentifier, KMToolbarPageEditRotateItemIdentifier,
+                               KMToolbarPageEditLeftRotateItemIdentifier,KMToolbarPageEditRightRotateItemIdentifier,
+                               KMToolbarPageEditInsetItemIdentifier, KMToolbarPageEditExtractItemIdentifier,
+                               KMToolbarPageEditReplaceItemIdentifier, KMToolbarPageEditSplitItemIdentifier,
+                               KMToolbarPageEditReverseItemIdentifier, KMToolbarPageEditCopyItemIdentifier,
+                               KMToolbarPageEditPasteItemIdentifier, KMToolbarPageEditDeleteItemIdentifier]
 
 // conversion
 let KMToolbarConversionWordItemIdentifier = "KMToolbarConversionWordItemIdentifier"
@@ -84,14 +95,15 @@ let KMToolbarConversionCSVItemIdentifier = "KMToolbarConversionCSVItemIdentifier
 let KMToolbarConversionHTMLItemIdentifier = "KMToolbarConversionHTMLItemIdentifier"
 let KMToolbarConversionTextItemIdentifier = "KMToolbarConversionTextItemIdentifier"
 let KMToolbarConversionImageItemIdentifier = "KMToolbarConversionImageItemIdentifier"
-let conversionToolIdentifiers = [KMToolbarConversionWordItemIdentifier, KMToolbarConversionExcelItemIdentifier, KMToolbarConversionPPTItemIdentifier,
-                                 KMToolbarConversionRTFItemIdentifier, KMToolbarConversionCSVItemIdentifier, KMToolbarConversionHTMLItemIdentifier,
+let conversionToolIdentifiers = [KMToolbarConversionWordItemIdentifier, KMToolbarConversionExcelItemIdentifier,
+                                 KMToolbarConversionPPTItemIdentifier, KMToolbarConversionRTFItemIdentifier,
+                                 KMToolbarConversionCSVItemIdentifier, KMToolbarConversionHTMLItemIdentifier,
                                  KMToolbarConversionTextItemIdentifier, KMToolbarConversionImageItemIdentifier]
 
 // EditPDF
 let KMToolbarAddTextEditPDFItemIdentifier =  "KMToolbarAddTextEditPDFItemIdentifier"
 let KMToolbarAddImageEditPDFItemIdentifier =  "KMToolbarAddImageEditPDFItemIdentifier"
-let editPDFItemIdentifier = [KMToolbarAddTextEditPDFItemIdentifier, KMToolbarAddImageEditPDFItemIdentifier]
+let editPDFItemIdentifiers = [KMToolbarAddTextEditPDFItemIdentifier, KMToolbarAddImageEditPDFItemIdentifier]
 
 let KMToolbarDividerItemIdentifier = "KMToolbarDividerItemIdentifier"
 
@@ -105,9 +117,12 @@ let KMToolbarToolRedactItemIdentifier =  "KMToolbarToolRedactItemIdentifier"
 let KMToolbarToolCompressItemIdentifier =  "KMToolbarToolCompressItemIdentifier"
 let KMToolbarToolSecureItemIdentifier =  "KMToolbarToolSecureItemIdentifier"
 let KMToolbarToolMergeItemIdentifier =  "KMToolbarToolMergeItemIdentifier"
-let toolToolIdentifiers = [KMToolbarToolCropItemIdentifier, KMToolbarToolBatesItemIdentifier, KMToolbarToolHeaderFooterItemIdentifier,
-                           KMToolbarToolBackgroundItemIdentifier, KMToolbarToolWatermarkItemIdentifier, KMToolbarToolRedactItemIdentifier,
-                           KMToolbarToolCompressItemIdentifier, KMToolbarToolSecureItemIdentifier, KMToolbarToolMergeItemIdentifier]
+let KMToolbarComparisonItemIdentifier =  "KMToolbarComparisonItemIdentifier"
+let toolToolIdentifiers = [KMToolbarToolCropItemIdentifier, KMToolbarToolBatesItemIdentifier,
+                           KMToolbarToolHeaderFooterItemIdentifier, KMToolbarToolBackgroundItemIdentifier,
+                           KMToolbarToolWatermarkItemIdentifier, KMToolbarToolRedactItemIdentifier,
+                           KMToolbarToolCompressItemIdentifier, KMToolbarToolSecureItemIdentifier,
+                           KMToolbarToolMergeItemIdentifier,KMToolbarComparisonItemIdentifier]
 
 /// Form
 let KMToolbarToolTextFieldItemIdentifier =  "KMToolbarToolTextFieldItemIdentifier"
@@ -119,9 +134,11 @@ let KMToolbarToolButtonIdentifier =  "KMToolbarToolButtonIdentifier"
 let KMToolbarToolSignBoxIdentifier =  "KMToolbarToolSignBoxIdentifier"
 let KMToolbarToolFormAlignIdentifier =  "KMToolbarToolFormAlignIdentifier"
 let KMToolbarToolFormMoreIdentifier =  "KMToolbarToolFormMoreIdentifier"
-let formToolIdentifiers = [KMToolbarToolTextFieldItemIdentifier, KMToolbarToolCheckBoxItemIdentifier, KMToolbarToolRadioButtonItemIdentifier,
-                           KMToolbarToolListBoxItemIdentifier, KMToolbarToolPullDownmenuItemIdentifier, KMToolbarToolButtonIdentifier,
-                           KMToolbarToolSignBoxIdentifier, KMToolbarToolFormAlignIdentifier, KMToolbarToolFormMoreIdentifier]
+let formToolIdentifiers = [KMToolbarToolTextFieldItemIdentifier, KMToolbarToolCheckBoxItemIdentifier,
+                           KMToolbarToolRadioButtonItemIdentifier, KMToolbarToolListBoxItemIdentifier,
+                           KMToolbarToolPullDownmenuItemIdentifier, KMToolbarToolButtonIdentifier,
+                           KMToolbarToolSignBoxIdentifier, KMToolbarToolFormAlignIdentifier,
+                           KMToolbarToolFormMoreIdentifier]
 
 /// FillSign
 let KMToolbarToolHookItemIdentifier     =  "KMToolbarToolHookItemIdentifier"
@@ -131,15 +148,20 @@ let KMToolbarToolDotItemIdentifier      =  "KMToolbarToolDotItemIdentifier"
 let KMToolbarToolRectangleIdentifier    =  "KMToolbarToolRectangleIdentifier"
 let KMToolbarToolTextIdentifier         =  "KMToolbarToolTextIdentifier"
 let KMToolbarToolDateIdentifier         =  "KMToolbarToolDateIdentifier"
+let KMToolbarToolProfileIdentifier         =  "KMToolbarToolProfileIdentifier"
 let KMToolbarFillSignSignatureIdentifier = "KMToolbarFillSignSignatureIdentifier"
-let fillSignToolIdentifiers = [KMToolbarToolHookItemIdentifier, KMToolbarToolForkItemIdentifier, KMToolbarToolLineItemIdentifier,
-                               KMToolbarToolDotItemIdentifier, KMToolbarToolRectangleIdentifier, KMToolbarToolTextIdentifier,
-                               KMToolbarToolDateIdentifier, KMToolbarFillSignSignatureIdentifier]
+let fillSignToolIdentifiers = [KMToolbarToolHookItemIdentifier, KMToolbarToolForkItemIdentifier,
+                               KMToolbarToolLineItemIdentifier, KMToolbarToolDotItemIdentifier,
+                               KMToolbarToolRectangleIdentifier, KMToolbarToolTextIdentifier,
+                               KMToolbarToolDateIdentifier, KMToolbarToolProfileIdentifier,
+                               KMToolbarFillSignSignatureIdentifier]
 
 //Scan OCR
 let KMToolbarToolOCRTextIdentifier     =  "KMToolbarToolOCRTextIdentifier"
 let KMToolbarToolEnhancedScanIdentifier     =  "KMToolbarToolEnhancedScanIdentifier"
 
+let KMNewToolbarSpaceItemIdentifier         =  "KMNewToolbarSpaceItemIdentifier"
+//let KMToolbarDividerItemIdentifier          =  "KMToolbarDividerItemIdentifier"
 
 let KMToolBarToolPDFShapeStyle = "KMToolBarToolPDFShapeStyle"
 
@@ -148,7 +170,7 @@ public func parentIdentifier(_ identifier: String) -> String {
         return ""
     }
     
-    if (editPDFItemIdentifier.contains(identifier)) {
+    if (editPDFItemIdentifiers.contains(identifier)) {
         return KMDocumentEditToolbarItemIdentifier
     }
     if (annotationToolIdentifiers.contains(identifier)) {

+ 67 - 12
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift

@@ -517,7 +517,7 @@ extension KMMainViewController {
         default:
             break
         }
-        let item : KMToolBoxItem = (self.toolbarController.mainToolBarView?.toolbarItemFindItemIdentifiers(value: identifier))!
+        let item : KMToolbarItemView = (self.toolbarController.mainToolBarView?.toolbarItemFindItemIdentifiers(value: identifier))!
         self.toolbarController.mainToolBarView?.delegate?.toolbarViewController?(self.toolbarController.mainToolBarView!, clickMode:model, toolbar: item, [])
     }
     
@@ -2013,8 +2013,8 @@ extension KMMainViewController {
     }
     
     func updateZoomInOutButtonState() {
-        let item : KMToolBoxItem = (self.toolbarController.mainToolBarView?.toolbarItemFindItemIdentifiers(value: KMDocumentZoomOutToolbarItemIdentifier)) ?? KMToolBoxItem()
-        let toItem : KMToolBoxItem = (self.toolbarController.mainToolBarView?.toolbarItemFindItemIdentifiers(value: KMDocumentZoomToolbarItemIdentifier)) ?? KMToolBoxItem()
+        let item : KMToolbarItemView = (self.toolbarController.mainToolBarView?.toolbarItemFindItemIdentifiers(value: KMDocumentZoomOutToolbarItemIdentifier)) ?? KMToolbarItemView()
+        let toItem : KMToolbarItemView = (self.toolbarController.mainToolBarView?.toolbarItemFindItemIdentifiers(value: KMDocumentZoomToolbarItemIdentifier)) ?? KMToolbarItemView()
         if self.listView.canZoomIn {
             item.unEnabled = false
         } else {
@@ -2169,11 +2169,16 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
     
     func changePDFViewGotoNextPageAction() {
         self.listView.km_goBack(nil)
+        if (self.listView.canGoToNextPage()) {
+            self.listView.goToNextPage(nil)
+        }
         self.updateNextAndPreViousButtonState()
     }
     
     func changePDFViewGoToPreviousPageAction() {
-        self.listView.goToPreviousPage(nil)
+        if (self.listView.canGoToPreviousPage()) {
+            self.listView.goToPreviousPage(nil)
+        }
         self.updateNextAndPreViousButtonState()
     }
     
@@ -2187,12 +2192,6 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
         self.updateBackAndForwardButtonState()
     }
     
-    func showPDFViewPrintViewController() {
-        self.trackEvent_print()
-        
-        self.showPrintWindow()
-    }
-    
     func aiTranslationPDFFileAction() {
         #if VERSION_DMG
         #else
@@ -2255,7 +2254,7 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
         }
     }
     
-    func toolbarViewController(_ viewController: KMToolbarViewController, shareAction toolbarItem: KMToolBoxItem) {
+    func toolbarViewController(_ viewController: KMToolbarViewController, shareAction toolbarItem: KMToolbarItemView) {
         self.trackEvent_share()
     }
     
@@ -2355,7 +2354,7 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
         // 0 : Scan  1:OCR Text
     }
     
-    func mainToolDidClicked(_ toolController: KMToolbarController, _ beforeType: KMToolbarViewType, _ type: KMToolbarViewType, _ item: KMToolBoxItem , _ pages: [Int]) {
+    func mainToolDidClicked(_ toolController: KMToolbarController, _ beforeType: KMToolbarViewType, _ type: KMToolbarViewType, _ item: KMToolbarItemView , _ pages: [Int]) {
         if beforeType == .editPDF {
 //            self.asyncSaveDocument { params in
 //
@@ -2905,6 +2904,62 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
             }
         }
     }
+    
+    func toolbarViewController(_ viewController: KMToolbarViewController, itemDidClick toolbarItem: KMToolbarItemView) {
+        if let itemID = toolbarItem.itemIdentifier {
+            if isMainToolItem(itemID) {
+                if toolbarItem.itemIdentifier == KMDocumentHomeToolbarItemIdentifier {
+                    Swift.debugPrint("KMDocumentHomeToolbarItemIdentifier ...")
+                } else if toolbarItem.itemIdentifier == KMDocumentPreviousPageToolbarItemIdentifier {
+                    self.changePDFViewGoToPreviousPageAction()
+                } else if toolbarItem.itemIdentifier == KMDocumentNextPageToolbarItemIdentifier {
+                    self.changePDFViewGotoNextPageAction()
+                } else if toolbarItem.itemIdentifier == KMDocumentViewSettingToolbarItemIdentifier {
+                    Swift.debugPrint("KMDocumentViewSettingToolbarItemIdentifier ...")
+                } else if toolbarItem.itemIdentifier == KMLeftControlToolbarItemIdentifier {
+                    toolbarItem.isSelected = !toolbarItem.isSelected
+                    self.toggleLeftPane()
+                    self.leftSideViewController.showPanelView(show: toolbarItem.isSelected)
+                } else if toolbarItem.itemIdentifier == KMRightControlToolbarItemIdentifier {
+                    toolbarItem.isSelected = !toolbarItem.isSelected
+                    self.toggleRightPane()
+                } else if itemID == KMDocumentRedactToolbarItemIdentifier {
+                    Swift.debugPrint("KMDocumentRedactToolbarItemIdentifier ...")
+                } else if itemID == KMDocumentScanOCRToolbarItemIdentifier {
+                    Swift.debugPrint("KMDocumentScanOCRToolbarItemIdentifier ...")
+                }
+            } else {
+                if toolbarItem.itemIdentifier == KMToolbarAnnotationSettingItemIdentifier {
+                    let windowC = KMToolbarCustomWindowController()
+                    windowC.toolbar = self.toolbarController.childToolBarView?.toolbar
+                    self.km_beginSheet(windowC: windowC)
+                } else if toolbarItem.itemIdentifier == KMToolbarComparisonItemIdentifier {
+                    Swift.debugPrint("KMToolbarComparisonItemIdentifier ...")
+                } else if toolbarItem.itemIdentifier == KMDocumentPrintToolbarItemIdentifier {
+                    self.trackEvent_print()
+                    self.showPrintWindow()
+                } else if toolbarItem.itemIdentifier == KMToolbarToolProfileIdentifier {
+                    Swift.debugPrint("KMToolbarToolProfileIdentifier ...")
+                }
+            }
+        }
+    }
+    
+    func toolbarViewController(_ viewController: KMToolbarViewController, menuItemDidClick toolbarItem: KMToolbarItemView, index: Int, info: Any?) {
+        if (toolbarItem.itemIdentifier == KMToolbarToolWatermarkItemIdentifier) {
+            KMPrint("KMToolbarToolWatermarkItemIdentifier \(index)")
+        } else if (toolbarItem.itemIdentifier == KMToolbarToolBackgroundItemIdentifier) {
+            KMPrint("KMToolbarToolBackgroundItemIdentifier \(index)")
+        } else if (toolbarItem.itemIdentifier == KMToolbarToolHeaderFooterItemIdentifier) {
+            KMPrint("KMToolbarToolHeaderFooterItemIdentifier \(index)")
+        } else if (toolbarItem.itemIdentifier == KMToolbarToolBatesItemIdentifier) {
+            KMPrint("KMToolbarToolBatesItemIdentifier \(index)")
+        }
+    }
+    
+    func toolbarViewController(_ viewController: KMToolbarViewController, searchAction searchString: String) {
+        Swift.debugPrint("Search Result " + searchString)
+    }
 }
 
 // MARK: -

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

@@ -550,10 +550,10 @@ extension KMMainViewController {
     
     private func mainMenuUpdateAnnotationStyle(identifier : String) {
         if self.toolbarController.toolbarType != .Annatiton {
-            let item : KMToolBoxItem = (self.toolbarController.mainToolBarView?.toolbarItemFindItemIdentifiers(value: KMDocumentAnnotationToolbarItemIdentifier))!
+            let item : KMToolbarItemView = (self.toolbarController.mainToolBarView?.toolbarItemFindItemIdentifiers(value: KMDocumentAnnotationToolbarItemIdentifier))!
             self.toolbarController.mainToolBarView?.delegate?.toolbarViewController?(self.toolbarController.mainToolBarView!, clickMode: .Annatiton, toolbar: item, [])
         }
-        let childitem : KMToolBoxItem = (self.toolbarController.childToolBarView?.toolbarItemFindItemIdentifiers(value: identifier))!
+        let childitem : KMToolbarItemView = (self.toolbarController.childToolBarView?.toolbarItemFindItemIdentifiers(value: identifier))!
         self.toolbarController.mainToolBarView?.delegate?.changeAnnotationModeAction?(item: childitem.clickButton)
     }
 }

+ 16 - 25
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+UI.swift

@@ -120,20 +120,20 @@ extension KMMainViewController: KMToolbarControllerDelegate {
             editSelectd = true
         }
         //多边形工具栏点击特殊处理
-        if (self.listView.annotationType == .square ||
-            self.listView.annotationType == .circle ||
-            self.listView.annotationType == .arrow ||
-            self.listView.annotationType == .line) {
-            if CAnnotationType(rawValue: item.tag) ?? CAnnotationType.unkown == .square ||
-                CAnnotationType(rawValue: item.tag) ?? CAnnotationType.unkown == .circle ||
-                CAnnotationType(rawValue: item.tag) ?? CAnnotationType.unkown == .arrow ||
-                CAnnotationType(rawValue: item.tag) ?? CAnnotationType.unkown == .line {
-                isSelected = true
-            }
-        } else if (item.tag > 3 &&  item.tag < 8) {
-            let shape = UserDefaults.standard.object(forKey: KMToolBarToolPDFShapeStyle)
-            item.tag = shape as? Int ?? item.tag
-        }
+//        if (self.listView.annotationType == .square ||
+//            self.listView.annotationType == .circle ||
+//            self.listView.annotationType == .arrow ||
+//            self.listView.annotationType == .line) {
+//            if CAnnotationType(rawValue: item.tag) ?? CAnnotationType.unkown == .square ||
+//                CAnnotationType(rawValue: item.tag) ?? CAnnotationType.unkown == .circle ||
+//                CAnnotationType(rawValue: item.tag) ?? CAnnotationType.unkown == .arrow ||
+//                CAnnotationType(rawValue: item.tag) ?? CAnnotationType.unkown == .line {
+//                isSelected = true
+//            }
+//        } else if (item.tag > 3 &&  item.tag < 8) {
+//            let shape = UserDefaults.standard.object(forKey: KMToolBarToolPDFShapeStyle)
+//            item.tag = shape as? Int ?? item.tag
+//        }
         
         if isSelected {
             self.listView.toolMode = .textToolMode
@@ -254,15 +254,6 @@ extension KMMainViewController: KMToolbarControllerDelegate {
         self.listView.annotationType = .unkown
         self.showOrHideNotes()
     }
-    
-    func toolbarViewController(_ viewController: KMToolbarViewController, rightPanel toolbarItem: KMToolBoxItem) {
-        self.toggleRightPane()
-    }
-    
-    func toolbarViewController(_ viewController: KMToolbarViewController, leftPanel toolbarItem: KMToolBoxItem) {
-        self.toggleLeftPane()
-        self.leftSideViewController.showPanelView(show: toolbarItem.isSelected)
-    }
 }
 
 extension KMMainViewController : NSSplitViewDelegate {
@@ -417,7 +408,7 @@ extension KMMainViewController: KMLeftSideViewControllerDelegate {
     }
     
     func enterEditMode(_ obj: KMLeftSideViewController, _ pages: [Int]) {
-        let item : KMToolBoxItem = (self.toolbarController.mainToolBarView?.toolbarItemFindItemIdentifiers(value: KMDocumentPageToolbarItemIdentifier))!
+        let item : KMToolbarItemView = (self.toolbarController.mainToolBarView?.toolbarItemFindItemIdentifiers(value: KMDocumentPageToolbarItemIdentifier))!
         self.toolbarController.mainToolBarView?.delegate?.toolbarViewController?(self.toolbarController.mainToolBarView!, clickMode: .Page, toolbar: item, pages)
     }
     
@@ -467,7 +458,7 @@ extension KMMainViewController {
         readLeftViewShowPanel = self.leftSideViewController.isShowPanel
         readRightPanelOpen = rightPanelIsOpen
         readToolbarType = self.toolbarController.toolbarType
-        readToolbarItemIdentifier = self.toolbarController.lastItemBox.itemIdentifier
+        readToolbarItemIdentifier = self.toolbarController.lastItemBox.itemIdentifier ?? ""
         readToolMode = self.listView.toolMode
         readAnnotationType = self.listView.annotationType
         readSubViewType = self.rightSideViewController.subViewType ?? .None

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

@@ -200,8 +200,8 @@ import Cocoa
     
     override func viewDidAppear() {
         super.viewDidAppear()
-        //刷新向前向后按钮
-        self.updateBackAndForwardButtonState()
+        //刷新前一页后一页按钮
+        self.updateNextAndPreViousButtonState()
         
         KMLightMemberManager.manager.canShowAdvancedView = false
         Task { @MainActor in
@@ -541,7 +541,7 @@ import Cocoa
             let toolBarView: KMToolbarViewController = self.toolbarController.mainToolBarView!
             for (key, value) in toolBarView.toolbarItems {
                 if (key == KMRightControlToolbarItemIdentifier || key == KMLeftControlToolbarItemIdentifier) {
-                    (value as! KMToolBoxItem).unEnabled = true
+                    (value as! KMToolbarItemView).unEnabled = true
                 }
             }
         }
@@ -598,7 +598,7 @@ import Cocoa
             let toolBarView: KMToolbarViewController = self.toolbarController.mainToolBarView!
             for (key, value) in toolBarView.toolbarItems {
                 if (key == KMRightControlToolbarItemIdentifier || key == KMLeftControlToolbarItemIdentifier) {
-                    (value as! KMToolBoxItem).unEnabled = false
+                    (value as! KMToolbarItemView).unEnabled = false
                 }
             }
         }
@@ -1415,16 +1415,16 @@ import Cocoa
         if self.isReadMode {
             self.readModelView.currentPageIndex = self.listView.currentPageIndex
         }
-        //刷新向前向后按钮
-        self.updateBackAndForwardButtonState()
+        //刷新前一页后一页按钮
+        self.updateNextAndPreViousButtonState()
     }
     
     func CPDFDocumentPageCountChangedNotification(_ sender: Notification) {
         if self.isReadMode {
             self.readModelView.totalPagesCount = Int(self.listView.document.pageCount)
         }
-        //刷新向前向后按钮
-        self.updateBackAndForwardButtonState()
+        //刷新前一页后一页按钮
+        self.updateNextAndPreViousButtonState()
     }
     
     func CEditPDFToolModeChangeStateUnkownNotification(_ sender: Notification) {

+ 2 - 0
PDF Office/PDF Master/PDF_Master DMG-Bridging-Header.h

@@ -61,3 +61,5 @@
 #import "SKLocalization.h"
 #import "NSImage+PDFListView.h"
 #import "KMColorPickerViewController.h"
+
+#import "KMConvertURLToPDF.h"

+ 2 - 0
PDF Office/PDF Master/PDF_Master Pro-Bridging-Header.h

@@ -42,3 +42,5 @@
 #import "NSImage+PDFListView.h"
 
 #import "KMColorPickerViewController.h"
+
+#import "KMConvertURLToPDF.h"

+ 2 - 1
PDF Office/PDF Master/PDF_Master-Bridging-Header.h

@@ -8,7 +8,6 @@
 #import "ComPDFUIKit.h"
 
 #import "KMToolbarItem.h"
-#import "KMToolbar.h"
 #import <ComPDFKit_Conversion/ComPDFKit_Conversion.h>
 //#import <ComDocumentAIKit/ComDocumentAIKit.h>
 #import "CTTabContents.h"
@@ -54,3 +53,5 @@
 #import "SKLocalization.h"
 #import "NSImage+PDFListView.h"
 #import "KMColorPickerViewController.h"
+
+#import "KMConvertURLToPDF.h"

+ 0 - 1
PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Headers

@@ -1 +0,0 @@
-Versions/Current/Headers

+ 0 - 1
PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/KMAdvertisement

@@ -1 +0,0 @@
-Versions/Current/KMAdvertisement

+ 0 - 1
PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Modules

@@ -1 +0,0 @@
-Versions/Current/Modules

+ 0 - 1
PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Resources

@@ -1 +0,0 @@
-Versions/Current/Resources

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 998
PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Headers/KMAdvertisement-Swift.h


+ 0 - 21
PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Headers/KMAdvertisement.h

@@ -1,21 +0,0 @@
-//
-//  KMAdvertisement.h
-//  KMAdvertisement
-//
-//  Created by lizhe on 2022/11/23.
-//
-
-#import <Foundation/Foundation.h>
-
-//! Project version number for KMAdvertisement.
-FOUNDATION_EXPORT double KMAdvertisementVersionNumber;
-
-//! Project version string for KMAdvertisement.
-FOUNDATION_EXPORT const unsigned char KMAdvertisementVersionString[];
-
-// In this header, you should import all the public headers of your framework using statements like #import <KMAdvertisement/PublicHeader.h>
-//#import <KMAdvertisement/KMAdvertisementModel.swift>
-//#import <KMAdvertisement/KMAdvertisementManager.swift>
-//#import <KMAdvertisement/KMAdvertisementRequestServer.swift>
-//#import <KMAdvertisement/KMAdvertisementConfig.swift>
-//#import <KMAdvertisement/KMAdvertisementTableView.swift>

+ 0 - 391
PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Headers/KMAdvertisementManager.swift

@@ -1,391 +0,0 @@
-//
-//  KMAdvertisementManager.swift
-//  KMAdvertisement
-//
-//  Created by lizhe on 2022/11/23.
-// 广告管理
-
-#if os(OSX)
-    import AppKit
-    public typealias UIImage = NSImage
-    public typealias UIView = NSView
-    public typealias UIButton = NSButton
-    public typealias UIScrollView = NSScrollView
-    public typealias UIColor = NSColor
-    public typealias UIFont = NSFont
-    public typealias UITextView = NSTextView
-    public typealias UIImageView = NSImageView
-    public typealias UIEvent = NSEvent
-    public typealias UIBezierPath = NSBezierPath
-    public typealias UITextField = NSTextField
-    public typealias UIEdgeInsets = NSEdgeInsets
-#elseif os(iOS)
-    import UIKit
-    public typealias NSImage = UIImage
-    public typealias NSView = UIView
-    public typealias NSButton = UIButton
-    public typealias NSScrollView = UIScrollView
-    public typealias NSColor = UIColor
-    public typealias NSFont = UIFont
-    public typealias NSTextView = UITextView
-    public typealias NSImageView = UIImageView
-    public typealias NSEvent = UIEvent
-    public typealias NSBezierPath = UIBezierPath
-    public typealias NSTextField = UILabel
-    public typealias NSEdgeInsets = UIEdgeInsets
-#endif
-
-@objcMembers open class KMAdvertisementManager: NSObject {
-    //单例
-    @objc public static let manager = KMAdvertisementManager()
-    @objc public var configuration: KMAdvertisementConfig = KMAdvertisementConfig()
-    
-    /**
-     @abstract 测试模式,默认为false
-      */
-    @objc public var debug: Bool = false
-    
-    /**
-     @abstract 初始化数据
-     @param appID 产品名称
-     @param subscribeType 订阅状态,可单独在configuration设置
-     @param platform 平台
-     @return
-      */
-    @objc public func initConfig(appName: KMAdvertisementAppNameType,
-                                 subscribeType:KMAdvertisementSubscribeType,
-                                 platform: KMAdvertisementPlatformType) {
-        configuration.initParameters(appName: appName, subscribeType: subscribeType, platform: platform)
-    }
-}
-
-extension KMAdvertisementManager {
-    //MARK: request
-    /**
-     @abstract 获取数据
-     @param data 传入参数 类型为KMAdvertisementModel
-     @return
-      */
-    @objc public func fetchData(completion: @escaping (_ data: [KMAdvertisementModel]?, _ error:Error?) -> Void) -> Void {
-        self.fetchDataWithResponseObject { data, responseObject, error in
-            if completion != nil {
-                completion(data, error)
-            }
-        }
-    }
-    
-    @objc public func fetchDataWithResponseObject(completion:@escaping (_ data: [KMAdvertisementModel]?, _ responseObject: AnyObject? , _ error:Error?) -> Void) -> Void {
-        print("开始获取数据")
-        var version: String = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString").debugDescription
-        if (version.count == 0) {
-            version = Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion").debugDescription
-            version = version.replacingOccurrences(of: ".", with: "")
-        }
-        
-        let urlString = configuration.activityBaseURL() + "/api/advertise-new"
-        let params: [String:Any] = ["app_name": configuration.appName.string(),
-                                    "app_version": version]
-        
-        //先拿缓存数据 再请求新数据
-        let cacheData = KMAdvertisementCache.default.readData()
-        if cacheData.count != 0 {
-            self.parseData(data: cacheData, isNeedLocalComparison: false) { result in
-                if result.count != 0 {
-                    completion(result, nil, nil)
-                }
-            }
-        }
-        
-        unowned let weakSelf = self
-        KMAdvertisementRequestServer.requestServer.request(urlString: urlString, method: "GET", params: params) { task, responseObject, error in
-            print("正在获取数据")
-            if (error == nil && responseObject != nil) {
-                let array = responseObject?["list"] ?? []
-                if array != nil {
-                    //解析数据
-                    print("开始解析数据")
-                    weakSelf.parseData(data: array as! [NSDictionary], isNeedLocalComparison: true) { data in
-                        print("数据处理完毕")
-                        if data.count != 0 {
-                            completion(data, responseObject, nil)
-                        }
-                    }
-                } else {
-                    print("解析数据失败array")
-                    completion(nil, responseObject, error)
-                }
-            } else {
-                print("解析数据失败数据不存在")
-                completion(nil, responseObject, error)
-            }
-        }
-    }
-}
-
-extension KMAdvertisementManager {
-    //MARK: show
-    /**
-     @abstract 显示视图
-     @param type 显示类型 <KMAdvertisementShowType>
-     @param data 显示数据 <KMAdvertisementModel>
-     @param superView 父视图 <NSView>
-     @return KMAdvertisementModel
-      */
-    @objc public func show(type: KMAdvertisementShowType, data: KMAdvertisementModel?, superView: NSView?, _ action: KMAdvertisementActionCompletion?) -> NSView  {
-        return self.show(type: type, data: data, superView: superView, action, nil)
-    }
-    
-    @objc public func show(type: KMAdvertisementShowType, data: KMAdvertisementModel?, superView: NSView?, _ action: KMAdvertisementActionCompletion?, _ loadCompletion: KMAdvertisementLoadCompletion?) -> NSView {
-        if superView != nil {
-            for item in superView!.subviews {
-                item.removeFromSuperview()
-            }
-        }
-        var view = KMAdvertisementBaseView()
-#if os(OSX)
-        if data != nil {
-            if type == .list {
-                view = KMAdvertisementTableView.init(data: data!, superView: superView!)
-            } else if type == .view {
-                view = KMAdvertisementShowView.init(data: data!, superView: superView!)
-            }
-        }
-#else
-        if data != nil {
-            if type == .scroll {
-                view = KMAdvertisementShowScroll_iOS.init(data: data!, superView: superView!)
-            } else if type == .view {
-                view = KMAdvertisementShowView_iOS.init(data: data!, superView: superView!)
-            }
-        }
-#endif
-        if action == nil {
-            view.actionCompletion = { tap, content in
-                self.transitionAction(item: content)
-            }
-        } else {
-            view.actionCompletion = action
-        }
-        
-        if loadCompletion == nil {
-            
-        } else {
-            view.loadCompletion = loadCompletion
-        }
-        
-        return view
-    }
-    
-    func transitionAction(item: KMAdvertisementModelItem) {
-        if (item.actionType == .URL) {
-            let string = item.linkURL?.en ?? ""
-
-#if os(iOS)
-            if UIApplication.shared.canOpenURL(URL(string: string )!) {
-                UIApplication.shared.open(URL(string: string )!, options: [:])
-            }
-#elseif os(OSX)
-            if NSWorkspace.shared.open(URL.init(string: string)!) {
-                NSWorkspace.shared.open(URL.init(string: string)!)
-            }
-#endif
-            print("链接" + string)
-        } else if (item.actionType == .comparative) {
-            print("比较表")
-        } else {
-            print("其他")
-        }
-    }
-}
-
-
-extension KMAdvertisementManager {
-    //MARK: data
-    /**
-     @abstract 解析数据
-     @param data 传入参数 NSDictionary
-     @param isNeedLocalComparison 是否需要对比本地版本,如果不一样将会刷新
-     @return KMAdvertisementModel
-      */
-    public func parseData(data: [NSDictionary], isNeedLocalComparison: Bool ,completion:(_ result: [KMAdvertisementModel]) -> Void) -> Void {
-        //获取缓存数据
-        var isNeedSave = false
-        let cacheData = KMAdvertisementCache.default.readData()
-        
-        var resultArray:[KMAdvertisementModel] = []
-        for model in data {
-            if (!(cacheData.contains(model) && isNeedLocalComparison)) {
-                if (self.allowLoadData(data: model)) {
-                    let jsonString: String = (model["detail"] as? String) ?? ""
-                    let jsonData: Data = jsonString.data(using: .utf8)!
-                    
-                    let decoder = JSONDecoder()
-    //                decoder.dataDecodingStrategy = .base64
-    //                decoder.keyDecodingStrategy = .convertFromSnakeCase //带下划线命名
-
-                    decoder.nonConformingFloatDecodingStrategy = .convertFromString(positiveInfinity: "+∞", negativeInfinity: "-∞", nan: "NaN")
-    #if DEBUG
-                    //MARK: 测试使用
-                    var advertisementModel = try! decoder.decode(KMAdvertisementModel.self, from: jsonData)
-                    if (self.allowLoadContentData(data: advertisementModel)) {
-                        resultArray.append(self.allowLoadItemData(advertisementModel))
-                        isNeedSave = true
-                    }
-    #else
-    //            MARK: 此处try 使用 ? ,如果数据出问题 advertisementModel将无参数, 测试时使用!
-                    var advertisementModel = try? decoder.decode(KMAdvertisementModel.self, from: jsonData)
-                    if (advertisementModel != nil) {
-                        if (self.allowLoadContentData(data: advertisementModel!)) {
-                            resultArray.append(self.allowLoadItemData(advertisementModel!))
-                            isNeedSave = true
-                        }
-                    }
-    #endif
-                }
-            }
-        }
-        
-        if isNeedSave && isNeedLocalComparison {
-            KMAdvertisementCache.default.saveData(data: data)
-            print("已更新本地数据")
-        } else {
-            print("不需要更新本地数据")
-        }
-        
-        completion(resultArray)
-    }
-    
-    func allowLoadData(data: NSDictionary) -> Bool {
-        var result = false
-        
-        let status = (data["status"] as? Int) ?? 0
-        let app_name: String = data["app_name"] as? String ?? ""
-        
-        if (status == 1 &&
-            app_name == configuration.appName.string()) {
-            result = true
-        }
-        return result
-        
-    }
-    
-    func allowLoadContentData(data: KMAdvertisementModel) -> Bool {
-        var result = false
-        
-        let time: NSInteger = NSInteger(KMAdvertisementTimeStampConversion.getCurrentTimeInterval())!
-        let startTime: NSInteger = NSInteger(data.startTime!)!
-        let endTime: NSInteger = NSInteger(data.endTime!)!
-        let platform = configuration.platform
-        let subscribeType = configuration.subscribeType
-        let version = data.version ?? "1.0"
-        let localVersion = self.getLocalVersion()
-        let hidden = data.hidden ?? false
-        
-        if (time >= startTime &&
-            time <= endTime &&
-            platform == data.platform &&
-            self.compareVersion(nowVersion:localVersion, newVersion: version) &&
-            (subscribeType == data.subscribeType || data.subscribeType == .all) &&
-            !hidden) {
-            result = true
-        }
-        return result
-    }
-    
-    //过滤item是否显示
-    func allowLoadItemData(_ data: KMAdvertisementModel) -> KMAdvertisementModel {
-        //获取缓存数据
-        if (UserDefaults.standard.object(forKey: "KMAdvertisementShowScroll_iOS") == nil) {
-            UserDefaults.standard.set([], forKey: "KMAdvertisementShowScroll_iOS")
-        }
-        let cacheArray: [String] = UserDefaults.standard.object(forKey: "KMAdvertisementShowScroll_iOS") as! [String]
-        
-        let model = data
-        var sections: [KMAdvertisementModelSection] = []
-        for section in data.content! {
-            var items: [KMAdvertisementModelItem] = []
-            for item in section.content! {
-                let timeString = KMAdvertisementTimeStampConversion.getCurrentTimeInterval()
-                let time: NSInteger = NSInteger(timeString)!
-                let startTime: NSInteger = NSInteger(item.startTime ?? timeString)!
-                let endTime: NSInteger = NSInteger(item.endTime ?? timeString)!
-                let hidden = item.hidden ?? false
-
-//                print(hidden ? "隐藏" : "显示")
-                if (!hidden &&
-                    time >= startTime &&
-                    time <= endTime &&
-                    !cacheArray.contains(item.productID ?? "")) {
-                    items.append(item)
-                }
-            }
-            section.content = items
-            sections.append(section)
-        }
-        model.content = sections
-        return model
-    }
-    
-    //获取本地版本号
-    func getLocalVersion() -> String {
-        var localVersion = ""
-        if let v: String = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String {
-            localVersion = v
-        }
-        return localVersion
-    }
-    
-    func compareVersion(nowVersion: String, newVersion: String) -> Bool {
-        let nowArray = nowVersion.split(separator: ".")
-        let newArray = newVersion.split(separator: ".")
-        let big = nowArray.count > newArray.count ? newArray.count : nowArray.count
-        if big != 0 {
-            for index in 0...big - 1 {
-                let first = nowArray[index]
-                let second = newArray[index]
-                if Int(first)! < Int(second)!  {
-                    return true
-                }
-                if index == big - 1 {
-                    if Int(first)! <= Int(second)!  {
-                        return true
-                    }
-                }
-            }
-        } else {
-            return true
-        }
-        return false
-    }
-}
-
-extension KMAdvertisementManager {
-//    //MARK: image
-//    public func dynamic_sdkBundle_image()-> NSImage? {
-//        // class: 库里 任意class, dynamic bundle 和 mainBundle 不是同一个
-//        let bundle = Bundle(for: KMAdvertisementManager.self)
-////        let mainBundle = Bundle.main
-//        let path = bundle.path(forResource: "KMAdvertisement", ofType: "bundle")
-//        if let path = path {
-//            let sdkBundle = Bundle(path: path)
-//            let filePath = sdkBundle?.pathForImageResource("1")
-//            let image = NSImage.init(contentsOfFile: filePath!)
-////            let image = NSImage(named: "1", in: sdkBundle, compatibleWith: nil)
-//            return image
-//        }
-//        return nil
-//    }
-//
-//    public func staticSdk_image() -> NSImage? {
-//            // class: 库里 任意class
-//            let bundle = Bundle(for: KMAdvertisementManager.self)
-//            let path = bundle.path(forResource: "KMAdvertisement", ofType: "framework")
-//            if let path = path {
-//                let sdkBundle = Bundle(path: path)
-//                let filePath = sdkBundle?.pathForImageResource("1")
-//                let image = NSImage.init(contentsOfFile: filePath!)
-//                return image
-//            }
-//            return nil
-//    }
-}

+ 0 - 111
PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Headers/KMAdvertisementModel.swift

@@ -1,111 +0,0 @@
-//
-//  KMAdvertisementModel.swift
-//  KMAdvertisement
-//
-//  Created by lizhe on 2022/11/30.
-//
-
-//参考链接 https://www.jianshu.com/p/a24cf8f37860
-//func encode<T>(of model: T) throws where T: Codable {
-//    let encoder = JSONEncoder()
-//    encoder.outputFormatting = .prettyPrinted
-//    let encodedData = try encoder.encode(model)
-//    print(String(data: encodedData, encoding: .utf8)!)
-//}
-//func decode<T>(of jsonString: String, type: T.Type) throws -> T where T: Codable {
-//    let data = jsonString.data(using: .utf8)!
-//    let decoder = JSONDecoder()
-//    let model = try! decoder.decode(T.self, from: data)
-//    return model
-//}
-
-/**
- 
- */
-@objcMembers public class KMAdvertisementModel: NSObject, Codable {
-    public var appName: KMAdvertisementAppNameType = .FilmageEditorMac //产品名
-    public var platform: KMAdvertisementPlatformType = .Mac //平台
-    public var showType: KMAdvertisementShowType = .view //显示类型
-    public let startTime: String? //开始时间 时间戳
-    public let endTime: String? //结束时间 时间戳
-    public let version: String? //小于等于此版本生效
-    public let hidden: Bool? //是否显示
-    let subscribeType: KMAdvertisementSubscribeType? //是否订阅
-    public var content: [KMAdvertisementModelSection]?
-}
-
-@objcMembers public class KMAdvertisementModelSection: NSObject, Codable {
-    public let sectionTitle: KMAdvertisementModelItem.Text?
-    public var content: [KMAdvertisementModelItem]?
-}
-
-@objcMembers public class KMAdvertisementModelItem: NSObject, Codable {
-    public var productID: String?
-    public let startTime: String? //开始时间 时间戳
-    public let endTime: String? //结束时间 时间戳
-    public var hidden: Bool?
-    
-    public var index: Int?
-    public let title: Text?
-    public let imageURL: Image?
-    public let ipadImageURL: Image?
-    public let linkURL: Language?
-    public let tips: Language?
-    public let button: Text?
-    public var actionType: KMAdvertisementActionType = .URL
-    
-    public struct Text: Codable {
-        public let font: Font?
-        public let color: Color?
-        public let background: Background?
-        public let language: Language?
-    }
-    
-    public struct Font: Codable {
-        public let name: String?
-        public let size: Int?
-    }
-    
-    public struct Color: Codable {
-        let height: ColorState?
-        let normal: ColorState?
-        
-        struct ColorState: Codable {
-            public let dark: ColorInfo?
-            public let universal: ColorInfo?
-            
-            struct ColorInfo: Codable {
-                public var hex: String?
-                public var alpha: Float?
-            }
-        }
-    }
-
-    public struct Background: Codable {
-        let color: Color?
-        let layer: Layer?
-        
-        struct Layer: Codable {
-            public let cornerRadius: CGFloat?
-            public let borderWidth: CGFloat?
-            public let borderColor: Color?
-        }
-    }
-    
-    public struct Image: Codable {
-        public let height: ImageInfo?
-        public let normal: ImageInfo?
-        public let background: Background?
-    }
-    
-    public struct ImageInfo: Codable {
-        public let dark: Language?
-        public let universal: Language?
-    }
-    
-    public class Language: NSObject, Codable {
-        public let en: String?
-        public let zh_TW: String?
-        public let zh_CN: String?
-    }
-}

BIN
PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/KMAdvertisement


BIN
PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Modules/KMAdvertisement.swiftmodule/Project/arm64-apple-macos.swiftsourceinfo


BIN
PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Modules/KMAdvertisement.swiftmodule/Project/x86_64-apple-macos.swiftsourceinfo


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 10313
PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Modules/KMAdvertisement.swiftmodule/arm64-apple-macos.abi.json


+ 0 - 301
PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Modules/KMAdvertisement.swiftmodule/arm64-apple-macos.private.swiftinterface

@@ -1,301 +0,0 @@
-// swift-interface-format-version: 1.0
-// swift-compiler-version: Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51)
-// swift-module-flags: -target arm64-apple-macos10.13 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name KMAdvertisement
-// swift-module-flags-ignorable: -enable-bare-slash-regex
-import AFNetworking
-import AppKit
-import Cocoa
-import Foundation
-@_exported import KMAdvertisement
-import Swift
-import _Concurrency
-import _StringProcessing
-@objc @_inheritsConvenienceInitializers public class KMAdvertisementTimeStampConversion : ObjectiveC.NSObject {
-  public static func getCurrentCompainedDateString() -> Swift.String
-  public static func getCurrentTimeInterval() -> Swift.String
-  @objc override dynamic public init()
-  @objc deinit
-}
-@objc @_inheritsConvenienceInitializers @objcMembers @_Concurrency.MainActor(unsafe) open class KMAdvertisementTableView : KMAdvertisement.KMAdvertisementBaseView {
-  @objc @_Concurrency.MainActor(unsafe) open var inputData: KMAdvertisement.KMAdvertisementModel! {
-    @objc get
-    @objc set
-  }
-  @_Concurrency.MainActor(unsafe) @objc override dynamic open func draw(_ dirtyRect: Foundation.NSRect)
-  @_Concurrency.MainActor(unsafe) @objc override dynamic public init(frame frameRect: Foundation.NSRect)
-  @_Concurrency.MainActor(unsafe) @objc required dynamic public init?(coder decoder: Foundation.NSCoder)
-  @objc deinit
-}
-extension KMAdvertisement.KMAdvertisementTableView : AppKit.NSCollectionViewDelegate {
-  @_Concurrency.MainActor(unsafe) @objc dynamic public func collectionView(_ collectionView: AppKit.NSCollectionView, didSelectItemsAt indexPaths: Swift.Set<Foundation.IndexPath>)
-  @_Concurrency.MainActor(unsafe) @objc dynamic public func collectionView(_ collectionView: AppKit.NSCollectionView, didDeselectItemsAt indexPaths: Swift.Set<Foundation.IndexPath>)
-}
-extension KMAdvertisement.KMAdvertisementTableView : AppKit.NSCollectionViewDataSource {
-  @_Concurrency.MainActor(unsafe) @objc dynamic public func numberOfSections(in collectionView: AppKit.NSCollectionView) -> Swift.Int
-  @_Concurrency.MainActor(unsafe) @objc dynamic public func collectionView(_ collectionView: AppKit.NSCollectionView, numberOfItemsInSection section: Swift.Int) -> Swift.Int
-  @_Concurrency.MainActor(unsafe) @objc dynamic public func collectionView(_ collectionView: AppKit.NSCollectionView, itemForRepresentedObjectAt indexPath: Foundation.IndexPath) -> AppKit.NSCollectionViewItem
-  @_Concurrency.MainActor(unsafe) @objc dynamic public func collectionView(_ collectionView: AppKit.NSCollectionView, viewForSupplementaryElementOfKind kind: AppKit.NSCollectionView.SupplementaryElementKind, at indexPath: Foundation.IndexPath) -> AppKit.NSView
-}
-extension KMAdvertisement.KMAdvertisementTableView : AppKit.NSCollectionViewDelegateFlowLayout {
-  @_Concurrency.MainActor(unsafe) @objc dynamic public func collectionView(_ collectionView: AppKit.NSCollectionView, layout collectionViewLayout: AppKit.NSCollectionViewLayout, sizeForItemAt indexPath: Foundation.IndexPath) -> Foundation.NSSize
-  @_Concurrency.MainActor(unsafe) @objc dynamic public func collectionView(_ collectionView: AppKit.NSCollectionView, layout collectionViewLayout: AppKit.NSCollectionViewLayout, referenceSizeForHeaderInSection section: Swift.Int) -> Foundation.NSSize
-  @_Concurrency.MainActor(unsafe) @objc dynamic public func collectionView(_ collectionView: AppKit.NSCollectionView, layout collectionViewLayout: AppKit.NSCollectionViewLayout, minimumLineSpacingForSectionAt section: Swift.Int) -> CoreFoundation.CGFloat
-}
-@objc @objcMembers public class KMAdvertisementModel : ObjectiveC.NSObject, Swift.Codable {
-  @objc public var appName: KMAdvertisement.KMAdvertisementAppNameType
-  @objc public var platform: KMAdvertisement.KMAdvertisementPlatformType
-  @objc public var showType: KMAdvertisement.KMAdvertisementShowType
-  @objc final public let startTime: Swift.String?
-  @objc final public let endTime: Swift.String?
-  @objc final public let version: Swift.String?
-  final public let hidden: Swift.Bool?
-  @objc public var content: [KMAdvertisement.KMAdvertisementModelSection]?
-  @objc deinit
-  public func encode(to encoder: Swift.Encoder) throws
-  required public init(from decoder: Swift.Decoder) throws
-}
-@objc @objcMembers public class KMAdvertisementModelSection : ObjectiveC.NSObject, Swift.Codable {
-  final public let sectionTitle: KMAdvertisement.KMAdvertisementModelItem.Text?
-  @objc public var content: [KMAdvertisement.KMAdvertisementModelItem]?
-  @objc deinit
-  public func encode(to encoder: Swift.Encoder) throws
-  required public init(from decoder: Swift.Decoder) throws
-}
-@objc @objcMembers public class KMAdvertisementModelItem : ObjectiveC.NSObject, Swift.Codable {
-  @objc public var productID: Swift.String?
-  @objc final public let startTime: Swift.String?
-  @objc final public let endTime: Swift.String?
-  public var hidden: Swift.Bool?
-  public var index: Swift.Int?
-  final public let title: KMAdvertisement.KMAdvertisementModelItem.Text?
-  final public let imageURL: KMAdvertisement.KMAdvertisementModelItem.Image?
-  final public let ipadImageURL: KMAdvertisement.KMAdvertisementModelItem.Image?
-  @objc final public let linkURL: KMAdvertisement.KMAdvertisementModelItem.Language?
-  @objc final public let tips: KMAdvertisement.KMAdvertisementModelItem.Language?
-  final public let button: KMAdvertisement.KMAdvertisementModelItem.Text?
-  @objc public var actionType: KMAdvertisement.KMAdvertisementActionType
-  public struct Text : Swift.Codable {
-    public let font: KMAdvertisement.KMAdvertisementModelItem.Font?
-    public let color: KMAdvertisement.KMAdvertisementModelItem.Color?
-    public let background: KMAdvertisement.KMAdvertisementModelItem.Background?
-    public let language: KMAdvertisement.KMAdvertisementModelItem.Language?
-    public func encode(to encoder: Swift.Encoder) throws
-    public init(from decoder: Swift.Decoder) throws
-  }
-  public struct Font : Swift.Codable {
-    public let name: Swift.String?
-    public let size: Swift.Int?
-    public func encode(to encoder: Swift.Encoder) throws
-    public init(from decoder: Swift.Decoder) throws
-  }
-  public struct Color : Swift.Codable {
-    public func encode(to encoder: Swift.Encoder) throws
-    public init(from decoder: Swift.Decoder) throws
-  }
-  public struct Background : Swift.Codable {
-    public func encode(to encoder: Swift.Encoder) throws
-    public init(from decoder: Swift.Decoder) throws
-  }
-  public struct Image : Swift.Codable {
-    public let height: KMAdvertisement.KMAdvertisementModelItem.ImageInfo?
-    public let normal: KMAdvertisement.KMAdvertisementModelItem.ImageInfo?
-    public let background: KMAdvertisement.KMAdvertisementModelItem.Background?
-    public func encode(to encoder: Swift.Encoder) throws
-    public init(from decoder: Swift.Decoder) throws
-  }
-  public struct ImageInfo : Swift.Codable {
-    public let dark: KMAdvertisement.KMAdvertisementModelItem.Language?
-    public let universal: KMAdvertisement.KMAdvertisementModelItem.Language?
-    public func encode(to encoder: Swift.Encoder) throws
-    public init(from decoder: Swift.Decoder) throws
-  }
-  @objc public class Language : ObjectiveC.NSObject, Swift.Codable {
-    final public let en: Swift.String?
-    final public let zh_TW: Swift.String?
-    final public let zh_CN: Swift.String?
-    @objc deinit
-    public func encode(to encoder: Swift.Encoder) throws
-    required public init(from decoder: Swift.Decoder) throws
-  }
-  @objc deinit
-  public func encode(to encoder: Swift.Encoder) throws
-  required public init(from decoder: Swift.Decoder) throws
-}
-@objc public enum KMAdvertisementBaseViewActionType : Swift.Int {
-  case unknow = 0
-  case cancel
-  case tap
-  public init?(rawValue: Swift.Int)
-  public typealias RawValue = Swift.Int
-  public var rawValue: Swift.Int {
-    get
-  }
-}
-public typealias KMAdvertisementActionCompletion = (_ actionType: KMAdvertisement.KMAdvertisementBaseViewActionType, _ actionItem: KMAdvertisement.KMAdvertisementModelItem) -> Swift.Void
-public typealias KMAdvertisementLoadCompletion = (_ data: [KMAdvertisement.KMAdvertisementModelSection]) -> Swift.Void
-@_inheritsConvenienceInitializers @objc @_Concurrency.MainActor(unsafe) open class KMAdvertisementBaseView : AppKit.NSView {
-  @_Concurrency.MainActor(unsafe) public var actionCompletion: KMAdvertisement.KMAdvertisementActionCompletion?
-  @_Concurrency.MainActor(unsafe) public var loadCompletion: KMAdvertisement.KMAdvertisementLoadCompletion?
-  @_Concurrency.MainActor(unsafe) @objc override dynamic public init(frame frameRect: Foundation.NSRect)
-  @_Concurrency.MainActor(unsafe) @objc required dynamic public init?(coder: Foundation.NSCoder)
-  @objc deinit
-}
-@objc @_inheritsConvenienceInitializers @objcMembers open class KMAdvertisementModelTransition : ObjectiveC.NSObject {
-  public static func transitionColor(color: KMAdvertisement.KMAdvertisementModelItem.Color?, highlight: Swift.Bool) -> KMAdvertisement.UIColor
-  public static func transitionImagePath(image: KMAdvertisement.KMAdvertisementModelItem.Image?, highlight: Swift.Bool) -> Swift.String
-  @objc public static func transitionLanguage(langeuage: KMAdvertisement.KMAdvertisementModelItem.Language?) -> Swift.String
-  @objc public static func getLanguageType() -> Swift.String
-  @objc override dynamic public init()
-  @objc deinit
-}
-@objc @_inheritsConvenienceInitializers @objcMembers @_Concurrency.MainActor(unsafe) open class KMAdvertisementShowView : KMAdvertisement.KMAdvertisementBaseView {
-  @objc @_Concurrency.MainActor(unsafe) open var inputData: KMAdvertisement.KMAdvertisementModel? {
-    @objc get
-    @objc set
-  }
-  @_Concurrency.MainActor(unsafe) @objc required dynamic public init?(coder decoder: Foundation.NSCoder)
-  @_Concurrency.MainActor(unsafe) @objc override dynamic public init(frame frameRect: Foundation.NSRect)
-  @_Concurrency.MainActor(unsafe) @objc override dynamic public func draw(_ dirtyRect: Foundation.NSRect)
-  @_Concurrency.MainActor(unsafe) @objc override dynamic open func mouseDown(with event: AppKit.NSEvent)
-  @objc deinit
-}
-@objc public enum KMAdvertisementAppNameType : Swift.Int, Swift.Codable {
-  case RecordIt = 0
-  case RecordItPro = 1
-  case RecordItDMG = 2
-  case FilmageScreen = 3
-  case FilmageScreenPro = 4
-  case FilmageScreenDMG = 5
-  case FilmageEditorMac = 6
-  case FilmageEditorMacPro = 7
-  case FilmageEditorMacDMG = 8
-  case FilmageConverterMac = 9
-  case FilmageConverterMacPro = 10
-  case FilmageConverterMacDMG = 11
-  case FilmagePlayerMac = 12
-  case FilmagePlayerMacPro = 13
-  case FilmagePlayerMacDMG = 14
-  case PDFReaderProMac = 15
-  case PDFReaderProMacPro = 16
-  case PDFReaderProMacDMG = 17
-  case PDFReaderProIOS = 18
-  case PDFReaderProIOSPro = 19
-  public init?(rawValue: Swift.Int)
-  public typealias RawValue = Swift.Int
-  public var rawValue: Swift.Int {
-    get
-  }
-}
-@objc public enum KMAdvertisementShowType : Swift.Int, Swift.Codable {
-  case unknow = 0
-  case list = 1
-  case pop = 2
-  case scroll = 3
-  case view = 4
-  public init?(rawValue: Swift.Int)
-  public typealias RawValue = Swift.Int
-  public var rawValue: Swift.Int {
-    get
-  }
-}
-@objc public enum KMAdvertisementPlatformType : Swift.Int, Swift.Codable {
-  case unknow = 0
-  case Mac
-  case iOS
-  public init?(rawValue: Swift.Int)
-  public typealias RawValue = Swift.Int
-  public var rawValue: Swift.Int {
-    get
-  }
-}
-@objc public enum KMAdvertisementSubscribeType : Swift.Int, Swift.Codable {
-  case unknow = 0
-  case unsubscribed = 1
-  case subscribed = 2
-  case all = 3
-  public init?(rawValue: Swift.Int)
-  public typealias RawValue = Swift.Int
-  public var rawValue: Swift.Int {
-    get
-  }
-}
-@objc public enum KMAdvertisementActionType : Swift.Int, Swift.Codable {
-  case unknow = 0
-  case URL = 1
-  case comparative = 2
-  public init?(rawValue: Swift.Int)
-  public typealias RawValue = Swift.Int
-  public var rawValue: Swift.Int {
-    get
-  }
-}
-@objc public enum KMAdvertisementLanguageType : Swift.Int, Swift.Codable {
-  case unknow
-  case en
-  case zhCN
-  case zhTW
-  public init?(rawValue: Swift.Int)
-  public typealias RawValue = Swift.Int
-  public var rawValue: Swift.Int {
-    get
-  }
-}
-@objc @_inheritsConvenienceInitializers @objcMembers open class KMAdvertisementConfig : ObjectiveC.NSObject {
-  @objc public var subscribeType: KMAdvertisement.KMAdvertisementSubscribeType
-  @objc public var language: KMAdvertisement.KMAdvertisementLanguageType
-  @objc public func initParameters(appName: KMAdvertisement.KMAdvertisementAppNameType, subscribeType: KMAdvertisement.KMAdvertisementSubscribeType, platform: KMAdvertisement.KMAdvertisementPlatformType)
-  @objc override dynamic public init()
-  @objc deinit
-}
-public typealias UIImage = AppKit.NSImage
-public typealias UIView = AppKit.NSView
-public typealias UIButton = AppKit.NSButton
-public typealias UIScrollView = AppKit.NSScrollView
-public typealias UIColor = AppKit.NSColor
-public typealias UIFont = AppKit.NSFont
-public typealias UITextView = AppKit.NSTextView
-public typealias UIImageView = AppKit.NSImageView
-public typealias UIEvent = AppKit.NSEvent
-public typealias UIBezierPath = AppKit.NSBezierPath
-public typealias UITextField = AppKit.NSTextField
-public typealias UIEdgeInsets = Foundation.NSEdgeInsets
-@objc @_inheritsConvenienceInitializers @objcMembers open class KMAdvertisementManager : ObjectiveC.NSObject {
-  @objc public static let manager: KMAdvertisement.KMAdvertisementManager
-  @objc public var configuration: KMAdvertisement.KMAdvertisementConfig
-  @objc public var debug: Swift.Bool
-  @objc public func initConfig(appName: KMAdvertisement.KMAdvertisementAppNameType, subscribeType: KMAdvertisement.KMAdvertisementSubscribeType, platform: KMAdvertisement.KMAdvertisementPlatformType)
-  @objc override dynamic public init()
-  @objc deinit
-}
-extension KMAdvertisement.KMAdvertisementManager {
-  @objc dynamic public func fetchData(completion: @escaping (_ data: [KMAdvertisement.KMAdvertisementModel]?, _ error: Swift.Error?) -> Swift.Void)
-  @objc dynamic public func fetchDataWithResponseObject(completion: @escaping (_ data: [KMAdvertisement.KMAdvertisementModel]?, _ responseObject: Swift.AnyObject?, _ error: Swift.Error?) -> Swift.Void)
-}
-extension KMAdvertisement.KMAdvertisementManager {
-  @objc dynamic public func show(type: KMAdvertisement.KMAdvertisementShowType, data: KMAdvertisement.KMAdvertisementModel?, superView: AppKit.NSView?, _ action: KMAdvertisement.KMAdvertisementActionCompletion?) -> AppKit.NSView
-  @objc dynamic public func show(type: KMAdvertisement.KMAdvertisementShowType, data: KMAdvertisement.KMAdvertisementModel?, superView: AppKit.NSView?, _ action: KMAdvertisement.KMAdvertisementActionCompletion?, _ loadCompletion: KMAdvertisement.KMAdvertisementLoadCompletion?) -> AppKit.NSView
-}
-extension KMAdvertisement.KMAdvertisementManager {
-  @objc dynamic public func parseData(data: [Foundation.NSDictionary], isNeedLocalComparison: Swift.Bool, completion: (_ result: [KMAdvertisement.KMAdvertisementModel]) -> Swift.Void)
-}
-extension KMAdvertisement.KMAdvertisementBaseViewActionType : Swift.Equatable {}
-extension KMAdvertisement.KMAdvertisementBaseViewActionType : Swift.Hashable {}
-extension KMAdvertisement.KMAdvertisementBaseViewActionType : Swift.RawRepresentable {}
-extension KMAdvertisement.KMAdvertisementAppNameType : Swift.Equatable {}
-extension KMAdvertisement.KMAdvertisementAppNameType : Swift.Hashable {}
-extension KMAdvertisement.KMAdvertisementAppNameType : Swift.RawRepresentable {}
-extension KMAdvertisement.KMAdvertisementShowType : Swift.Equatable {}
-extension KMAdvertisement.KMAdvertisementShowType : Swift.Hashable {}
-extension KMAdvertisement.KMAdvertisementShowType : Swift.RawRepresentable {}
-extension KMAdvertisement.KMAdvertisementPlatformType : Swift.Equatable {}
-extension KMAdvertisement.KMAdvertisementPlatformType : Swift.Hashable {}
-extension KMAdvertisement.KMAdvertisementPlatformType : Swift.RawRepresentable {}
-extension KMAdvertisement.KMAdvertisementSubscribeType : Swift.Equatable {}
-extension KMAdvertisement.KMAdvertisementSubscribeType : Swift.Hashable {}
-extension KMAdvertisement.KMAdvertisementSubscribeType : Swift.RawRepresentable {}
-extension KMAdvertisement.KMAdvertisementActionType : Swift.Equatable {}
-extension KMAdvertisement.KMAdvertisementActionType : Swift.Hashable {}
-extension KMAdvertisement.KMAdvertisementActionType : Swift.RawRepresentable {}
-extension KMAdvertisement.KMAdvertisementLanguageType : Swift.Equatable {}
-extension KMAdvertisement.KMAdvertisementLanguageType : Swift.Hashable {}
-extension KMAdvertisement.KMAdvertisementLanguageType : Swift.RawRepresentable {}

BIN
PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Modules/KMAdvertisement.swiftmodule/arm64-apple-macos.swiftdoc


+ 0 - 301
PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Modules/KMAdvertisement.swiftmodule/arm64-apple-macos.swiftinterface

@@ -1,301 +0,0 @@
-// swift-interface-format-version: 1.0
-// swift-compiler-version: Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51)
-// swift-module-flags: -target arm64-apple-macos10.13 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name KMAdvertisement
-// swift-module-flags-ignorable: -enable-bare-slash-regex
-import AFNetworking
-import AppKit
-import Cocoa
-import Foundation
-@_exported import KMAdvertisement
-import Swift
-import _Concurrency
-import _StringProcessing
-@objc @_inheritsConvenienceInitializers public class KMAdvertisementTimeStampConversion : ObjectiveC.NSObject {
-  public static func getCurrentCompainedDateString() -> Swift.String
-  public static func getCurrentTimeInterval() -> Swift.String
-  @objc override dynamic public init()
-  @objc deinit
-}
-@objc @_inheritsConvenienceInitializers @objcMembers @_Concurrency.MainActor(unsafe) open class KMAdvertisementTableView : KMAdvertisement.KMAdvertisementBaseView {
-  @objc @_Concurrency.MainActor(unsafe) open var inputData: KMAdvertisement.KMAdvertisementModel! {
-    @objc get
-    @objc set
-  }
-  @_Concurrency.MainActor(unsafe) @objc override dynamic open func draw(_ dirtyRect: Foundation.NSRect)
-  @_Concurrency.MainActor(unsafe) @objc override dynamic public init(frame frameRect: Foundation.NSRect)
-  @_Concurrency.MainActor(unsafe) @objc required dynamic public init?(coder decoder: Foundation.NSCoder)
-  @objc deinit
-}
-extension KMAdvertisement.KMAdvertisementTableView : AppKit.NSCollectionViewDelegate {
-  @_Concurrency.MainActor(unsafe) @objc dynamic public func collectionView(_ collectionView: AppKit.NSCollectionView, didSelectItemsAt indexPaths: Swift.Set<Foundation.IndexPath>)
-  @_Concurrency.MainActor(unsafe) @objc dynamic public func collectionView(_ collectionView: AppKit.NSCollectionView, didDeselectItemsAt indexPaths: Swift.Set<Foundation.IndexPath>)
-}
-extension KMAdvertisement.KMAdvertisementTableView : AppKit.NSCollectionViewDataSource {
-  @_Concurrency.MainActor(unsafe) @objc dynamic public func numberOfSections(in collectionView: AppKit.NSCollectionView) -> Swift.Int
-  @_Concurrency.MainActor(unsafe) @objc dynamic public func collectionView(_ collectionView: AppKit.NSCollectionView, numberOfItemsInSection section: Swift.Int) -> Swift.Int
-  @_Concurrency.MainActor(unsafe) @objc dynamic public func collectionView(_ collectionView: AppKit.NSCollectionView, itemForRepresentedObjectAt indexPath: Foundation.IndexPath) -> AppKit.NSCollectionViewItem
-  @_Concurrency.MainActor(unsafe) @objc dynamic public func collectionView(_ collectionView: AppKit.NSCollectionView, viewForSupplementaryElementOfKind kind: AppKit.NSCollectionView.SupplementaryElementKind, at indexPath: Foundation.IndexPath) -> AppKit.NSView
-}
-extension KMAdvertisement.KMAdvertisementTableView : AppKit.NSCollectionViewDelegateFlowLayout {
-  @_Concurrency.MainActor(unsafe) @objc dynamic public func collectionView(_ collectionView: AppKit.NSCollectionView, layout collectionViewLayout: AppKit.NSCollectionViewLayout, sizeForItemAt indexPath: Foundation.IndexPath) -> Foundation.NSSize
-  @_Concurrency.MainActor(unsafe) @objc dynamic public func collectionView(_ collectionView: AppKit.NSCollectionView, layout collectionViewLayout: AppKit.NSCollectionViewLayout, referenceSizeForHeaderInSection section: Swift.Int) -> Foundation.NSSize
-  @_Concurrency.MainActor(unsafe) @objc dynamic public func collectionView(_ collectionView: AppKit.NSCollectionView, layout collectionViewLayout: AppKit.NSCollectionViewLayout, minimumLineSpacingForSectionAt section: Swift.Int) -> CoreFoundation.CGFloat
-}
-@objc @objcMembers public class KMAdvertisementModel : ObjectiveC.NSObject, Swift.Codable {
-  @objc public var appName: KMAdvertisement.KMAdvertisementAppNameType
-  @objc public var platform: KMAdvertisement.KMAdvertisementPlatformType
-  @objc public var showType: KMAdvertisement.KMAdvertisementShowType
-  @objc final public let startTime: Swift.String?
-  @objc final public let endTime: Swift.String?
-  @objc final public let version: Swift.String?
-  final public let hidden: Swift.Bool?
-  @objc public var content: [KMAdvertisement.KMAdvertisementModelSection]?
-  @objc deinit
-  public func encode(to encoder: Swift.Encoder) throws
-  required public init(from decoder: Swift.Decoder) throws
-}
-@objc @objcMembers public class KMAdvertisementModelSection : ObjectiveC.NSObject, Swift.Codable {
-  final public let sectionTitle: KMAdvertisement.KMAdvertisementModelItem.Text?
-  @objc public var content: [KMAdvertisement.KMAdvertisementModelItem]?
-  @objc deinit
-  public func encode(to encoder: Swift.Encoder) throws
-  required public init(from decoder: Swift.Decoder) throws
-}
-@objc @objcMembers public class KMAdvertisementModelItem : ObjectiveC.NSObject, Swift.Codable {
-  @objc public var productID: Swift.String?
-  @objc final public let startTime: Swift.String?
-  @objc final public let endTime: Swift.String?
-  public var hidden: Swift.Bool?
-  public var index: Swift.Int?
-  final public let title: KMAdvertisement.KMAdvertisementModelItem.Text?
-  final public let imageURL: KMAdvertisement.KMAdvertisementModelItem.Image?
-  final public let ipadImageURL: KMAdvertisement.KMAdvertisementModelItem.Image?
-  @objc final public let linkURL: KMAdvertisement.KMAdvertisementModelItem.Language?
-  @objc final public let tips: KMAdvertisement.KMAdvertisementModelItem.Language?
-  final public let button: KMAdvertisement.KMAdvertisementModelItem.Text?
-  @objc public var actionType: KMAdvertisement.KMAdvertisementActionType
-  public struct Text : Swift.Codable {
-    public let font: KMAdvertisement.KMAdvertisementModelItem.Font?
-    public let color: KMAdvertisement.KMAdvertisementModelItem.Color?
-    public let background: KMAdvertisement.KMAdvertisementModelItem.Background?
-    public let language: KMAdvertisement.KMAdvertisementModelItem.Language?
-    public func encode(to encoder: Swift.Encoder) throws
-    public init(from decoder: Swift.Decoder) throws
-  }
-  public struct Font : Swift.Codable {
-    public let name: Swift.String?
-    public let size: Swift.Int?
-    public func encode(to encoder: Swift.Encoder) throws
-    public init(from decoder: Swift.Decoder) throws
-  }
-  public struct Color : Swift.Codable {
-    public func encode(to encoder: Swift.Encoder) throws
-    public init(from decoder: Swift.Decoder) throws
-  }
-  public struct Background : Swift.Codable {
-    public func encode(to encoder: Swift.Encoder) throws
-    public init(from decoder: Swift.Decoder) throws
-  }
-  public struct Image : Swift.Codable {
-    public let height: KMAdvertisement.KMAdvertisementModelItem.ImageInfo?
-    public let normal: KMAdvertisement.KMAdvertisementModelItem.ImageInfo?
-    public let background: KMAdvertisement.KMAdvertisementModelItem.Background?
-    public func encode(to encoder: Swift.Encoder) throws
-    public init(from decoder: Swift.Decoder) throws
-  }
-  public struct ImageInfo : Swift.Codable {
-    public let dark: KMAdvertisement.KMAdvertisementModelItem.Language?
-    public let universal: KMAdvertisement.KMAdvertisementModelItem.Language?
-    public func encode(to encoder: Swift.Encoder) throws
-    public init(from decoder: Swift.Decoder) throws
-  }
-  @objc public class Language : ObjectiveC.NSObject, Swift.Codable {
-    final public let en: Swift.String?
-    final public let zh_TW: Swift.String?
-    final public let zh_CN: Swift.String?
-    @objc deinit
-    public func encode(to encoder: Swift.Encoder) throws
-    required public init(from decoder: Swift.Decoder) throws
-  }
-  @objc deinit
-  public func encode(to encoder: Swift.Encoder) throws
-  required public init(from decoder: Swift.Decoder) throws
-}
-@objc public enum KMAdvertisementBaseViewActionType : Swift.Int {
-  case unknow = 0
-  case cancel
-  case tap
-  public init?(rawValue: Swift.Int)
-  public typealias RawValue = Swift.Int
-  public var rawValue: Swift.Int {
-    get
-  }
-}
-public typealias KMAdvertisementActionCompletion = (_ actionType: KMAdvertisement.KMAdvertisementBaseViewActionType, _ actionItem: KMAdvertisement.KMAdvertisementModelItem) -> Swift.Void
-public typealias KMAdvertisementLoadCompletion = (_ data: [KMAdvertisement.KMAdvertisementModelSection]) -> Swift.Void
-@_inheritsConvenienceInitializers @objc @_Concurrency.MainActor(unsafe) open class KMAdvertisementBaseView : AppKit.NSView {
-  @_Concurrency.MainActor(unsafe) public var actionCompletion: KMAdvertisement.KMAdvertisementActionCompletion?
-  @_Concurrency.MainActor(unsafe) public var loadCompletion: KMAdvertisement.KMAdvertisementLoadCompletion?
-  @_Concurrency.MainActor(unsafe) @objc override dynamic public init(frame frameRect: Foundation.NSRect)
-  @_Concurrency.MainActor(unsafe) @objc required dynamic public init?(coder: Foundation.NSCoder)
-  @objc deinit
-}
-@objc @_inheritsConvenienceInitializers @objcMembers open class KMAdvertisementModelTransition : ObjectiveC.NSObject {
-  public static func transitionColor(color: KMAdvertisement.KMAdvertisementModelItem.Color?, highlight: Swift.Bool) -> KMAdvertisement.UIColor
-  public static func transitionImagePath(image: KMAdvertisement.KMAdvertisementModelItem.Image?, highlight: Swift.Bool) -> Swift.String
-  @objc public static func transitionLanguage(langeuage: KMAdvertisement.KMAdvertisementModelItem.Language?) -> Swift.String
-  @objc public static func getLanguageType() -> Swift.String
-  @objc override dynamic public init()
-  @objc deinit
-}
-@objc @_inheritsConvenienceInitializers @objcMembers @_Concurrency.MainActor(unsafe) open class KMAdvertisementShowView : KMAdvertisement.KMAdvertisementBaseView {
-  @objc @_Concurrency.MainActor(unsafe) open var inputData: KMAdvertisement.KMAdvertisementModel? {
-    @objc get
-    @objc set
-  }
-  @_Concurrency.MainActor(unsafe) @objc required dynamic public init?(coder decoder: Foundation.NSCoder)
-  @_Concurrency.MainActor(unsafe) @objc override dynamic public init(frame frameRect: Foundation.NSRect)
-  @_Concurrency.MainActor(unsafe) @objc override dynamic public func draw(_ dirtyRect: Foundation.NSRect)
-  @_Concurrency.MainActor(unsafe) @objc override dynamic open func mouseDown(with event: AppKit.NSEvent)
-  @objc deinit
-}
-@objc public enum KMAdvertisementAppNameType : Swift.Int, Swift.Codable {
-  case RecordIt = 0
-  case RecordItPro = 1
-  case RecordItDMG = 2
-  case FilmageScreen = 3
-  case FilmageScreenPro = 4
-  case FilmageScreenDMG = 5
-  case FilmageEditorMac = 6
-  case FilmageEditorMacPro = 7
-  case FilmageEditorMacDMG = 8
-  case FilmageConverterMac = 9
-  case FilmageConverterMacPro = 10
-  case FilmageConverterMacDMG = 11
-  case FilmagePlayerMac = 12
-  case FilmagePlayerMacPro = 13
-  case FilmagePlayerMacDMG = 14
-  case PDFReaderProMac = 15
-  case PDFReaderProMacPro = 16
-  case PDFReaderProMacDMG = 17
-  case PDFReaderProIOS = 18
-  case PDFReaderProIOSPro = 19
-  public init?(rawValue: Swift.Int)
-  public typealias RawValue = Swift.Int
-  public var rawValue: Swift.Int {
-    get
-  }
-}
-@objc public enum KMAdvertisementShowType : Swift.Int, Swift.Codable {
-  case unknow = 0
-  case list = 1
-  case pop = 2
-  case scroll = 3
-  case view = 4
-  public init?(rawValue: Swift.Int)
-  public typealias RawValue = Swift.Int
-  public var rawValue: Swift.Int {
-    get
-  }
-}
-@objc public enum KMAdvertisementPlatformType : Swift.Int, Swift.Codable {
-  case unknow = 0
-  case Mac
-  case iOS
-  public init?(rawValue: Swift.Int)
-  public typealias RawValue = Swift.Int
-  public var rawValue: Swift.Int {
-    get
-  }
-}
-@objc public enum KMAdvertisementSubscribeType : Swift.Int, Swift.Codable {
-  case unknow = 0
-  case unsubscribed = 1
-  case subscribed = 2
-  case all = 3
-  public init?(rawValue: Swift.Int)
-  public typealias RawValue = Swift.Int
-  public var rawValue: Swift.Int {
-    get
-  }
-}
-@objc public enum KMAdvertisementActionType : Swift.Int, Swift.Codable {
-  case unknow = 0
-  case URL = 1
-  case comparative = 2
-  public init?(rawValue: Swift.Int)
-  public typealias RawValue = Swift.Int
-  public var rawValue: Swift.Int {
-    get
-  }
-}
-@objc public enum KMAdvertisementLanguageType : Swift.Int, Swift.Codable {
-  case unknow
-  case en
-  case zhCN
-  case zhTW
-  public init?(rawValue: Swift.Int)
-  public typealias RawValue = Swift.Int
-  public var rawValue: Swift.Int {
-    get
-  }
-}
-@objc @_inheritsConvenienceInitializers @objcMembers open class KMAdvertisementConfig : ObjectiveC.NSObject {
-  @objc public var subscribeType: KMAdvertisement.KMAdvertisementSubscribeType
-  @objc public var language: KMAdvertisement.KMAdvertisementLanguageType
-  @objc public func initParameters(appName: KMAdvertisement.KMAdvertisementAppNameType, subscribeType: KMAdvertisement.KMAdvertisementSubscribeType, platform: KMAdvertisement.KMAdvertisementPlatformType)
-  @objc override dynamic public init()
-  @objc deinit
-}
-public typealias UIImage = AppKit.NSImage
-public typealias UIView = AppKit.NSView
-public typealias UIButton = AppKit.NSButton
-public typealias UIScrollView = AppKit.NSScrollView
-public typealias UIColor = AppKit.NSColor
-public typealias UIFont = AppKit.NSFont
-public typealias UITextView = AppKit.NSTextView
-public typealias UIImageView = AppKit.NSImageView
-public typealias UIEvent = AppKit.NSEvent
-public typealias UIBezierPath = AppKit.NSBezierPath
-public typealias UITextField = AppKit.NSTextField
-public typealias UIEdgeInsets = Foundation.NSEdgeInsets
-@objc @_inheritsConvenienceInitializers @objcMembers open class KMAdvertisementManager : ObjectiveC.NSObject {
-  @objc public static let manager: KMAdvertisement.KMAdvertisementManager
-  @objc public var configuration: KMAdvertisement.KMAdvertisementConfig
-  @objc public var debug: Swift.Bool
-  @objc public func initConfig(appName: KMAdvertisement.KMAdvertisementAppNameType, subscribeType: KMAdvertisement.KMAdvertisementSubscribeType, platform: KMAdvertisement.KMAdvertisementPlatformType)
-  @objc override dynamic public init()
-  @objc deinit
-}
-extension KMAdvertisement.KMAdvertisementManager {
-  @objc dynamic public func fetchData(completion: @escaping (_ data: [KMAdvertisement.KMAdvertisementModel]?, _ error: Swift.Error?) -> Swift.Void)
-  @objc dynamic public func fetchDataWithResponseObject(completion: @escaping (_ data: [KMAdvertisement.KMAdvertisementModel]?, _ responseObject: Swift.AnyObject?, _ error: Swift.Error?) -> Swift.Void)
-}
-extension KMAdvertisement.KMAdvertisementManager {
-  @objc dynamic public func show(type: KMAdvertisement.KMAdvertisementShowType, data: KMAdvertisement.KMAdvertisementModel?, superView: AppKit.NSView?, _ action: KMAdvertisement.KMAdvertisementActionCompletion?) -> AppKit.NSView
-  @objc dynamic public func show(type: KMAdvertisement.KMAdvertisementShowType, data: KMAdvertisement.KMAdvertisementModel?, superView: AppKit.NSView?, _ action: KMAdvertisement.KMAdvertisementActionCompletion?, _ loadCompletion: KMAdvertisement.KMAdvertisementLoadCompletion?) -> AppKit.NSView
-}
-extension KMAdvertisement.KMAdvertisementManager {
-  @objc dynamic public func parseData(data: [Foundation.NSDictionary], isNeedLocalComparison: Swift.Bool, completion: (_ result: [KMAdvertisement.KMAdvertisementModel]) -> Swift.Void)
-}
-extension KMAdvertisement.KMAdvertisementBaseViewActionType : Swift.Equatable {}
-extension KMAdvertisement.KMAdvertisementBaseViewActionType : Swift.Hashable {}
-extension KMAdvertisement.KMAdvertisementBaseViewActionType : Swift.RawRepresentable {}
-extension KMAdvertisement.KMAdvertisementAppNameType : Swift.Equatable {}
-extension KMAdvertisement.KMAdvertisementAppNameType : Swift.Hashable {}
-extension KMAdvertisement.KMAdvertisementAppNameType : Swift.RawRepresentable {}
-extension KMAdvertisement.KMAdvertisementShowType : Swift.Equatable {}
-extension KMAdvertisement.KMAdvertisementShowType : Swift.Hashable {}
-extension KMAdvertisement.KMAdvertisementShowType : Swift.RawRepresentable {}
-extension KMAdvertisement.KMAdvertisementPlatformType : Swift.Equatable {}
-extension KMAdvertisement.KMAdvertisementPlatformType : Swift.Hashable {}
-extension KMAdvertisement.KMAdvertisementPlatformType : Swift.RawRepresentable {}
-extension KMAdvertisement.KMAdvertisementSubscribeType : Swift.Equatable {}
-extension KMAdvertisement.KMAdvertisementSubscribeType : Swift.Hashable {}
-extension KMAdvertisement.KMAdvertisementSubscribeType : Swift.RawRepresentable {}
-extension KMAdvertisement.KMAdvertisementActionType : Swift.Equatable {}
-extension KMAdvertisement.KMAdvertisementActionType : Swift.Hashable {}
-extension KMAdvertisement.KMAdvertisementActionType : Swift.RawRepresentable {}
-extension KMAdvertisement.KMAdvertisementLanguageType : Swift.Equatable {}
-extension KMAdvertisement.KMAdvertisementLanguageType : Swift.Hashable {}
-extension KMAdvertisement.KMAdvertisementLanguageType : Swift.RawRepresentable {}

BIN
PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Modules/KMAdvertisement.swiftmodule/arm64-apple-macos.swiftmodule


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 10313
PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Modules/KMAdvertisement.swiftmodule/x86_64-apple-macos.abi.json


+ 0 - 301
PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Modules/KMAdvertisement.swiftmodule/x86_64-apple-macos.private.swiftinterface

@@ -1,301 +0,0 @@
-// swift-interface-format-version: 1.0
-// swift-compiler-version: Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51)
-// swift-module-flags: -target x86_64-apple-macos10.13 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name KMAdvertisement
-// swift-module-flags-ignorable: -enable-bare-slash-regex
-import AFNetworking
-import AppKit
-import Cocoa
-import Foundation
-@_exported import KMAdvertisement
-import Swift
-import _Concurrency
-import _StringProcessing
-@objc @_inheritsConvenienceInitializers public class KMAdvertisementTimeStampConversion : ObjectiveC.NSObject {
-  public static func getCurrentCompainedDateString() -> Swift.String
-  public static func getCurrentTimeInterval() -> Swift.String
-  @objc override dynamic public init()
-  @objc deinit
-}
-@objc @_inheritsConvenienceInitializers @objcMembers @_Concurrency.MainActor(unsafe) open class KMAdvertisementTableView : KMAdvertisement.KMAdvertisementBaseView {
-  @objc @_Concurrency.MainActor(unsafe) open var inputData: KMAdvertisement.KMAdvertisementModel! {
-    @objc get
-    @objc set
-  }
-  @_Concurrency.MainActor(unsafe) @objc override dynamic open func draw(_ dirtyRect: Foundation.NSRect)
-  @_Concurrency.MainActor(unsafe) @objc override dynamic public init(frame frameRect: Foundation.NSRect)
-  @_Concurrency.MainActor(unsafe) @objc required dynamic public init?(coder decoder: Foundation.NSCoder)
-  @objc deinit
-}
-extension KMAdvertisement.KMAdvertisementTableView : AppKit.NSCollectionViewDelegate {
-  @_Concurrency.MainActor(unsafe) @objc dynamic public func collectionView(_ collectionView: AppKit.NSCollectionView, didSelectItemsAt indexPaths: Swift.Set<Foundation.IndexPath>)
-  @_Concurrency.MainActor(unsafe) @objc dynamic public func collectionView(_ collectionView: AppKit.NSCollectionView, didDeselectItemsAt indexPaths: Swift.Set<Foundation.IndexPath>)
-}
-extension KMAdvertisement.KMAdvertisementTableView : AppKit.NSCollectionViewDataSource {
-  @_Concurrency.MainActor(unsafe) @objc dynamic public func numberOfSections(in collectionView: AppKit.NSCollectionView) -> Swift.Int
-  @_Concurrency.MainActor(unsafe) @objc dynamic public func collectionView(_ collectionView: AppKit.NSCollectionView, numberOfItemsInSection section: Swift.Int) -> Swift.Int
-  @_Concurrency.MainActor(unsafe) @objc dynamic public func collectionView(_ collectionView: AppKit.NSCollectionView, itemForRepresentedObjectAt indexPath: Foundation.IndexPath) -> AppKit.NSCollectionViewItem
-  @_Concurrency.MainActor(unsafe) @objc dynamic public func collectionView(_ collectionView: AppKit.NSCollectionView, viewForSupplementaryElementOfKind kind: AppKit.NSCollectionView.SupplementaryElementKind, at indexPath: Foundation.IndexPath) -> AppKit.NSView
-}
-extension KMAdvertisement.KMAdvertisementTableView : AppKit.NSCollectionViewDelegateFlowLayout {
-  @_Concurrency.MainActor(unsafe) @objc dynamic public func collectionView(_ collectionView: AppKit.NSCollectionView, layout collectionViewLayout: AppKit.NSCollectionViewLayout, sizeForItemAt indexPath: Foundation.IndexPath) -> Foundation.NSSize
-  @_Concurrency.MainActor(unsafe) @objc dynamic public func collectionView(_ collectionView: AppKit.NSCollectionView, layout collectionViewLayout: AppKit.NSCollectionViewLayout, referenceSizeForHeaderInSection section: Swift.Int) -> Foundation.NSSize
-  @_Concurrency.MainActor(unsafe) @objc dynamic public func collectionView(_ collectionView: AppKit.NSCollectionView, layout collectionViewLayout: AppKit.NSCollectionViewLayout, minimumLineSpacingForSectionAt section: Swift.Int) -> CoreFoundation.CGFloat
-}
-@objc @objcMembers public class KMAdvertisementModel : ObjectiveC.NSObject, Swift.Codable {
-  @objc public var appName: KMAdvertisement.KMAdvertisementAppNameType
-  @objc public var platform: KMAdvertisement.KMAdvertisementPlatformType
-  @objc public var showType: KMAdvertisement.KMAdvertisementShowType
-  @objc final public let startTime: Swift.String?
-  @objc final public let endTime: Swift.String?
-  @objc final public let version: Swift.String?
-  final public let hidden: Swift.Bool?
-  @objc public var content: [KMAdvertisement.KMAdvertisementModelSection]?
-  @objc deinit
-  public func encode(to encoder: Swift.Encoder) throws
-  required public init(from decoder: Swift.Decoder) throws
-}
-@objc @objcMembers public class KMAdvertisementModelSection : ObjectiveC.NSObject, Swift.Codable {
-  final public let sectionTitle: KMAdvertisement.KMAdvertisementModelItem.Text?
-  @objc public var content: [KMAdvertisement.KMAdvertisementModelItem]?
-  @objc deinit
-  public func encode(to encoder: Swift.Encoder) throws
-  required public init(from decoder: Swift.Decoder) throws
-}
-@objc @objcMembers public class KMAdvertisementModelItem : ObjectiveC.NSObject, Swift.Codable {
-  @objc public var productID: Swift.String?
-  @objc final public let startTime: Swift.String?
-  @objc final public let endTime: Swift.String?
-  public var hidden: Swift.Bool?
-  public var index: Swift.Int?
-  final public let title: KMAdvertisement.KMAdvertisementModelItem.Text?
-  final public let imageURL: KMAdvertisement.KMAdvertisementModelItem.Image?
-  final public let ipadImageURL: KMAdvertisement.KMAdvertisementModelItem.Image?
-  @objc final public let linkURL: KMAdvertisement.KMAdvertisementModelItem.Language?
-  @objc final public let tips: KMAdvertisement.KMAdvertisementModelItem.Language?
-  final public let button: KMAdvertisement.KMAdvertisementModelItem.Text?
-  @objc public var actionType: KMAdvertisement.KMAdvertisementActionType
-  public struct Text : Swift.Codable {
-    public let font: KMAdvertisement.KMAdvertisementModelItem.Font?
-    public let color: KMAdvertisement.KMAdvertisementModelItem.Color?
-    public let background: KMAdvertisement.KMAdvertisementModelItem.Background?
-    public let language: KMAdvertisement.KMAdvertisementModelItem.Language?
-    public func encode(to encoder: Swift.Encoder) throws
-    public init(from decoder: Swift.Decoder) throws
-  }
-  public struct Font : Swift.Codable {
-    public let name: Swift.String?
-    public let size: Swift.Int?
-    public func encode(to encoder: Swift.Encoder) throws
-    public init(from decoder: Swift.Decoder) throws
-  }
-  public struct Color : Swift.Codable {
-    public func encode(to encoder: Swift.Encoder) throws
-    public init(from decoder: Swift.Decoder) throws
-  }
-  public struct Background : Swift.Codable {
-    public func encode(to encoder: Swift.Encoder) throws
-    public init(from decoder: Swift.Decoder) throws
-  }
-  public struct Image : Swift.Codable {
-    public let height: KMAdvertisement.KMAdvertisementModelItem.ImageInfo?
-    public let normal: KMAdvertisement.KMAdvertisementModelItem.ImageInfo?
-    public let background: KMAdvertisement.KMAdvertisementModelItem.Background?
-    public func encode(to encoder: Swift.Encoder) throws
-    public init(from decoder: Swift.Decoder) throws
-  }
-  public struct ImageInfo : Swift.Codable {
-    public let dark: KMAdvertisement.KMAdvertisementModelItem.Language?
-    public let universal: KMAdvertisement.KMAdvertisementModelItem.Language?
-    public func encode(to encoder: Swift.Encoder) throws
-    public init(from decoder: Swift.Decoder) throws
-  }
-  @objc public class Language : ObjectiveC.NSObject, Swift.Codable {
-    final public let en: Swift.String?
-    final public let zh_TW: Swift.String?
-    final public let zh_CN: Swift.String?
-    @objc deinit
-    public func encode(to encoder: Swift.Encoder) throws
-    required public init(from decoder: Swift.Decoder) throws
-  }
-  @objc deinit
-  public func encode(to encoder: Swift.Encoder) throws
-  required public init(from decoder: Swift.Decoder) throws
-}
-@objc public enum KMAdvertisementBaseViewActionType : Swift.Int {
-  case unknow = 0
-  case cancel
-  case tap
-  public init?(rawValue: Swift.Int)
-  public typealias RawValue = Swift.Int
-  public var rawValue: Swift.Int {
-    get
-  }
-}
-public typealias KMAdvertisementActionCompletion = (_ actionType: KMAdvertisement.KMAdvertisementBaseViewActionType, _ actionItem: KMAdvertisement.KMAdvertisementModelItem) -> Swift.Void
-public typealias KMAdvertisementLoadCompletion = (_ data: [KMAdvertisement.KMAdvertisementModelSection]) -> Swift.Void
-@_inheritsConvenienceInitializers @objc @_Concurrency.MainActor(unsafe) open class KMAdvertisementBaseView : AppKit.NSView {
-  @_Concurrency.MainActor(unsafe) public var actionCompletion: KMAdvertisement.KMAdvertisementActionCompletion?
-  @_Concurrency.MainActor(unsafe) public var loadCompletion: KMAdvertisement.KMAdvertisementLoadCompletion?
-  @_Concurrency.MainActor(unsafe) @objc override dynamic public init(frame frameRect: Foundation.NSRect)
-  @_Concurrency.MainActor(unsafe) @objc required dynamic public init?(coder: Foundation.NSCoder)
-  @objc deinit
-}
-@objc @_inheritsConvenienceInitializers @objcMembers open class KMAdvertisementModelTransition : ObjectiveC.NSObject {
-  public static func transitionColor(color: KMAdvertisement.KMAdvertisementModelItem.Color?, highlight: Swift.Bool) -> KMAdvertisement.UIColor
-  public static func transitionImagePath(image: KMAdvertisement.KMAdvertisementModelItem.Image?, highlight: Swift.Bool) -> Swift.String
-  @objc public static func transitionLanguage(langeuage: KMAdvertisement.KMAdvertisementModelItem.Language?) -> Swift.String
-  @objc public static func getLanguageType() -> Swift.String
-  @objc override dynamic public init()
-  @objc deinit
-}
-@objc @_inheritsConvenienceInitializers @objcMembers @_Concurrency.MainActor(unsafe) open class KMAdvertisementShowView : KMAdvertisement.KMAdvertisementBaseView {
-  @objc @_Concurrency.MainActor(unsafe) open var inputData: KMAdvertisement.KMAdvertisementModel? {
-    @objc get
-    @objc set
-  }
-  @_Concurrency.MainActor(unsafe) @objc required dynamic public init?(coder decoder: Foundation.NSCoder)
-  @_Concurrency.MainActor(unsafe) @objc override dynamic public init(frame frameRect: Foundation.NSRect)
-  @_Concurrency.MainActor(unsafe) @objc override dynamic public func draw(_ dirtyRect: Foundation.NSRect)
-  @_Concurrency.MainActor(unsafe) @objc override dynamic open func mouseDown(with event: AppKit.NSEvent)
-  @objc deinit
-}
-@objc public enum KMAdvertisementAppNameType : Swift.Int, Swift.Codable {
-  case RecordIt = 0
-  case RecordItPro = 1
-  case RecordItDMG = 2
-  case FilmageScreen = 3
-  case FilmageScreenPro = 4
-  case FilmageScreenDMG = 5
-  case FilmageEditorMac = 6
-  case FilmageEditorMacPro = 7
-  case FilmageEditorMacDMG = 8
-  case FilmageConverterMac = 9
-  case FilmageConverterMacPro = 10
-  case FilmageConverterMacDMG = 11
-  case FilmagePlayerMac = 12
-  case FilmagePlayerMacPro = 13
-  case FilmagePlayerMacDMG = 14
-  case PDFReaderProMac = 15
-  case PDFReaderProMacPro = 16
-  case PDFReaderProMacDMG = 17
-  case PDFReaderProIOS = 18
-  case PDFReaderProIOSPro = 19
-  public init?(rawValue: Swift.Int)
-  public typealias RawValue = Swift.Int
-  public var rawValue: Swift.Int {
-    get
-  }
-}
-@objc public enum KMAdvertisementShowType : Swift.Int, Swift.Codable {
-  case unknow = 0
-  case list = 1
-  case pop = 2
-  case scroll = 3
-  case view = 4
-  public init?(rawValue: Swift.Int)
-  public typealias RawValue = Swift.Int
-  public var rawValue: Swift.Int {
-    get
-  }
-}
-@objc public enum KMAdvertisementPlatformType : Swift.Int, Swift.Codable {
-  case unknow = 0
-  case Mac
-  case iOS
-  public init?(rawValue: Swift.Int)
-  public typealias RawValue = Swift.Int
-  public var rawValue: Swift.Int {
-    get
-  }
-}
-@objc public enum KMAdvertisementSubscribeType : Swift.Int, Swift.Codable {
-  case unknow = 0
-  case unsubscribed = 1
-  case subscribed = 2
-  case all = 3
-  public init?(rawValue: Swift.Int)
-  public typealias RawValue = Swift.Int
-  public var rawValue: Swift.Int {
-    get
-  }
-}
-@objc public enum KMAdvertisementActionType : Swift.Int, Swift.Codable {
-  case unknow = 0
-  case URL = 1
-  case comparative = 2
-  public init?(rawValue: Swift.Int)
-  public typealias RawValue = Swift.Int
-  public var rawValue: Swift.Int {
-    get
-  }
-}
-@objc public enum KMAdvertisementLanguageType : Swift.Int, Swift.Codable {
-  case unknow
-  case en
-  case zhCN
-  case zhTW
-  public init?(rawValue: Swift.Int)
-  public typealias RawValue = Swift.Int
-  public var rawValue: Swift.Int {
-    get
-  }
-}
-@objc @_inheritsConvenienceInitializers @objcMembers open class KMAdvertisementConfig : ObjectiveC.NSObject {
-  @objc public var subscribeType: KMAdvertisement.KMAdvertisementSubscribeType
-  @objc public var language: KMAdvertisement.KMAdvertisementLanguageType
-  @objc public func initParameters(appName: KMAdvertisement.KMAdvertisementAppNameType, subscribeType: KMAdvertisement.KMAdvertisementSubscribeType, platform: KMAdvertisement.KMAdvertisementPlatformType)
-  @objc override dynamic public init()
-  @objc deinit
-}
-public typealias UIImage = AppKit.NSImage
-public typealias UIView = AppKit.NSView
-public typealias UIButton = AppKit.NSButton
-public typealias UIScrollView = AppKit.NSScrollView
-public typealias UIColor = AppKit.NSColor
-public typealias UIFont = AppKit.NSFont
-public typealias UITextView = AppKit.NSTextView
-public typealias UIImageView = AppKit.NSImageView
-public typealias UIEvent = AppKit.NSEvent
-public typealias UIBezierPath = AppKit.NSBezierPath
-public typealias UITextField = AppKit.NSTextField
-public typealias UIEdgeInsets = Foundation.NSEdgeInsets
-@objc @_inheritsConvenienceInitializers @objcMembers open class KMAdvertisementManager : ObjectiveC.NSObject {
-  @objc public static let manager: KMAdvertisement.KMAdvertisementManager
-  @objc public var configuration: KMAdvertisement.KMAdvertisementConfig
-  @objc public var debug: Swift.Bool
-  @objc public func initConfig(appName: KMAdvertisement.KMAdvertisementAppNameType, subscribeType: KMAdvertisement.KMAdvertisementSubscribeType, platform: KMAdvertisement.KMAdvertisementPlatformType)
-  @objc override dynamic public init()
-  @objc deinit
-}
-extension KMAdvertisement.KMAdvertisementManager {
-  @objc dynamic public func fetchData(completion: @escaping (_ data: [KMAdvertisement.KMAdvertisementModel]?, _ error: Swift.Error?) -> Swift.Void)
-  @objc dynamic public func fetchDataWithResponseObject(completion: @escaping (_ data: [KMAdvertisement.KMAdvertisementModel]?, _ responseObject: Swift.AnyObject?, _ error: Swift.Error?) -> Swift.Void)
-}
-extension KMAdvertisement.KMAdvertisementManager {
-  @objc dynamic public func show(type: KMAdvertisement.KMAdvertisementShowType, data: KMAdvertisement.KMAdvertisementModel?, superView: AppKit.NSView?, _ action: KMAdvertisement.KMAdvertisementActionCompletion?) -> AppKit.NSView
-  @objc dynamic public func show(type: KMAdvertisement.KMAdvertisementShowType, data: KMAdvertisement.KMAdvertisementModel?, superView: AppKit.NSView?, _ action: KMAdvertisement.KMAdvertisementActionCompletion?, _ loadCompletion: KMAdvertisement.KMAdvertisementLoadCompletion?) -> AppKit.NSView
-}
-extension KMAdvertisement.KMAdvertisementManager {
-  @objc dynamic public func parseData(data: [Foundation.NSDictionary], isNeedLocalComparison: Swift.Bool, completion: (_ result: [KMAdvertisement.KMAdvertisementModel]) -> Swift.Void)
-}
-extension KMAdvertisement.KMAdvertisementBaseViewActionType : Swift.Equatable {}
-extension KMAdvertisement.KMAdvertisementBaseViewActionType : Swift.Hashable {}
-extension KMAdvertisement.KMAdvertisementBaseViewActionType : Swift.RawRepresentable {}
-extension KMAdvertisement.KMAdvertisementAppNameType : Swift.Equatable {}
-extension KMAdvertisement.KMAdvertisementAppNameType : Swift.Hashable {}
-extension KMAdvertisement.KMAdvertisementAppNameType : Swift.RawRepresentable {}
-extension KMAdvertisement.KMAdvertisementShowType : Swift.Equatable {}
-extension KMAdvertisement.KMAdvertisementShowType : Swift.Hashable {}
-extension KMAdvertisement.KMAdvertisementShowType : Swift.RawRepresentable {}
-extension KMAdvertisement.KMAdvertisementPlatformType : Swift.Equatable {}
-extension KMAdvertisement.KMAdvertisementPlatformType : Swift.Hashable {}
-extension KMAdvertisement.KMAdvertisementPlatformType : Swift.RawRepresentable {}
-extension KMAdvertisement.KMAdvertisementSubscribeType : Swift.Equatable {}
-extension KMAdvertisement.KMAdvertisementSubscribeType : Swift.Hashable {}
-extension KMAdvertisement.KMAdvertisementSubscribeType : Swift.RawRepresentable {}
-extension KMAdvertisement.KMAdvertisementActionType : Swift.Equatable {}
-extension KMAdvertisement.KMAdvertisementActionType : Swift.Hashable {}
-extension KMAdvertisement.KMAdvertisementActionType : Swift.RawRepresentable {}
-extension KMAdvertisement.KMAdvertisementLanguageType : Swift.Equatable {}
-extension KMAdvertisement.KMAdvertisementLanguageType : Swift.Hashable {}
-extension KMAdvertisement.KMAdvertisementLanguageType : Swift.RawRepresentable {}

BIN
PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Modules/KMAdvertisement.swiftmodule/x86_64-apple-macos.swiftdoc


+ 0 - 301
PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Modules/KMAdvertisement.swiftmodule/x86_64-apple-macos.swiftinterface

@@ -1,301 +0,0 @@
-// swift-interface-format-version: 1.0
-// swift-compiler-version: Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51)
-// swift-module-flags: -target x86_64-apple-macos10.13 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name KMAdvertisement
-// swift-module-flags-ignorable: -enable-bare-slash-regex
-import AFNetworking
-import AppKit
-import Cocoa
-import Foundation
-@_exported import KMAdvertisement
-import Swift
-import _Concurrency
-import _StringProcessing
-@objc @_inheritsConvenienceInitializers public class KMAdvertisementTimeStampConversion : ObjectiveC.NSObject {
-  public static func getCurrentCompainedDateString() -> Swift.String
-  public static func getCurrentTimeInterval() -> Swift.String
-  @objc override dynamic public init()
-  @objc deinit
-}
-@objc @_inheritsConvenienceInitializers @objcMembers @_Concurrency.MainActor(unsafe) open class KMAdvertisementTableView : KMAdvertisement.KMAdvertisementBaseView {
-  @objc @_Concurrency.MainActor(unsafe) open var inputData: KMAdvertisement.KMAdvertisementModel! {
-    @objc get
-    @objc set
-  }
-  @_Concurrency.MainActor(unsafe) @objc override dynamic open func draw(_ dirtyRect: Foundation.NSRect)
-  @_Concurrency.MainActor(unsafe) @objc override dynamic public init(frame frameRect: Foundation.NSRect)
-  @_Concurrency.MainActor(unsafe) @objc required dynamic public init?(coder decoder: Foundation.NSCoder)
-  @objc deinit
-}
-extension KMAdvertisement.KMAdvertisementTableView : AppKit.NSCollectionViewDelegate {
-  @_Concurrency.MainActor(unsafe) @objc dynamic public func collectionView(_ collectionView: AppKit.NSCollectionView, didSelectItemsAt indexPaths: Swift.Set<Foundation.IndexPath>)
-  @_Concurrency.MainActor(unsafe) @objc dynamic public func collectionView(_ collectionView: AppKit.NSCollectionView, didDeselectItemsAt indexPaths: Swift.Set<Foundation.IndexPath>)
-}
-extension KMAdvertisement.KMAdvertisementTableView : AppKit.NSCollectionViewDataSource {
-  @_Concurrency.MainActor(unsafe) @objc dynamic public func numberOfSections(in collectionView: AppKit.NSCollectionView) -> Swift.Int
-  @_Concurrency.MainActor(unsafe) @objc dynamic public func collectionView(_ collectionView: AppKit.NSCollectionView, numberOfItemsInSection section: Swift.Int) -> Swift.Int
-  @_Concurrency.MainActor(unsafe) @objc dynamic public func collectionView(_ collectionView: AppKit.NSCollectionView, itemForRepresentedObjectAt indexPath: Foundation.IndexPath) -> AppKit.NSCollectionViewItem
-  @_Concurrency.MainActor(unsafe) @objc dynamic public func collectionView(_ collectionView: AppKit.NSCollectionView, viewForSupplementaryElementOfKind kind: AppKit.NSCollectionView.SupplementaryElementKind, at indexPath: Foundation.IndexPath) -> AppKit.NSView
-}
-extension KMAdvertisement.KMAdvertisementTableView : AppKit.NSCollectionViewDelegateFlowLayout {
-  @_Concurrency.MainActor(unsafe) @objc dynamic public func collectionView(_ collectionView: AppKit.NSCollectionView, layout collectionViewLayout: AppKit.NSCollectionViewLayout, sizeForItemAt indexPath: Foundation.IndexPath) -> Foundation.NSSize
-  @_Concurrency.MainActor(unsafe) @objc dynamic public func collectionView(_ collectionView: AppKit.NSCollectionView, layout collectionViewLayout: AppKit.NSCollectionViewLayout, referenceSizeForHeaderInSection section: Swift.Int) -> Foundation.NSSize
-  @_Concurrency.MainActor(unsafe) @objc dynamic public func collectionView(_ collectionView: AppKit.NSCollectionView, layout collectionViewLayout: AppKit.NSCollectionViewLayout, minimumLineSpacingForSectionAt section: Swift.Int) -> CoreFoundation.CGFloat
-}
-@objc @objcMembers public class KMAdvertisementModel : ObjectiveC.NSObject, Swift.Codable {
-  @objc public var appName: KMAdvertisement.KMAdvertisementAppNameType
-  @objc public var platform: KMAdvertisement.KMAdvertisementPlatformType
-  @objc public var showType: KMAdvertisement.KMAdvertisementShowType
-  @objc final public let startTime: Swift.String?
-  @objc final public let endTime: Swift.String?
-  @objc final public let version: Swift.String?
-  final public let hidden: Swift.Bool?
-  @objc public var content: [KMAdvertisement.KMAdvertisementModelSection]?
-  @objc deinit
-  public func encode(to encoder: Swift.Encoder) throws
-  required public init(from decoder: Swift.Decoder) throws
-}
-@objc @objcMembers public class KMAdvertisementModelSection : ObjectiveC.NSObject, Swift.Codable {
-  final public let sectionTitle: KMAdvertisement.KMAdvertisementModelItem.Text?
-  @objc public var content: [KMAdvertisement.KMAdvertisementModelItem]?
-  @objc deinit
-  public func encode(to encoder: Swift.Encoder) throws
-  required public init(from decoder: Swift.Decoder) throws
-}
-@objc @objcMembers public class KMAdvertisementModelItem : ObjectiveC.NSObject, Swift.Codable {
-  @objc public var productID: Swift.String?
-  @objc final public let startTime: Swift.String?
-  @objc final public let endTime: Swift.String?
-  public var hidden: Swift.Bool?
-  public var index: Swift.Int?
-  final public let title: KMAdvertisement.KMAdvertisementModelItem.Text?
-  final public let imageURL: KMAdvertisement.KMAdvertisementModelItem.Image?
-  final public let ipadImageURL: KMAdvertisement.KMAdvertisementModelItem.Image?
-  @objc final public let linkURL: KMAdvertisement.KMAdvertisementModelItem.Language?
-  @objc final public let tips: KMAdvertisement.KMAdvertisementModelItem.Language?
-  final public let button: KMAdvertisement.KMAdvertisementModelItem.Text?
-  @objc public var actionType: KMAdvertisement.KMAdvertisementActionType
-  public struct Text : Swift.Codable {
-    public let font: KMAdvertisement.KMAdvertisementModelItem.Font?
-    public let color: KMAdvertisement.KMAdvertisementModelItem.Color?
-    public let background: KMAdvertisement.KMAdvertisementModelItem.Background?
-    public let language: KMAdvertisement.KMAdvertisementModelItem.Language?
-    public func encode(to encoder: Swift.Encoder) throws
-    public init(from decoder: Swift.Decoder) throws
-  }
-  public struct Font : Swift.Codable {
-    public let name: Swift.String?
-    public let size: Swift.Int?
-    public func encode(to encoder: Swift.Encoder) throws
-    public init(from decoder: Swift.Decoder) throws
-  }
-  public struct Color : Swift.Codable {
-    public func encode(to encoder: Swift.Encoder) throws
-    public init(from decoder: Swift.Decoder) throws
-  }
-  public struct Background : Swift.Codable {
-    public func encode(to encoder: Swift.Encoder) throws
-    public init(from decoder: Swift.Decoder) throws
-  }
-  public struct Image : Swift.Codable {
-    public let height: KMAdvertisement.KMAdvertisementModelItem.ImageInfo?
-    public let normal: KMAdvertisement.KMAdvertisementModelItem.ImageInfo?
-    public let background: KMAdvertisement.KMAdvertisementModelItem.Background?
-    public func encode(to encoder: Swift.Encoder) throws
-    public init(from decoder: Swift.Decoder) throws
-  }
-  public struct ImageInfo : Swift.Codable {
-    public let dark: KMAdvertisement.KMAdvertisementModelItem.Language?
-    public let universal: KMAdvertisement.KMAdvertisementModelItem.Language?
-    public func encode(to encoder: Swift.Encoder) throws
-    public init(from decoder: Swift.Decoder) throws
-  }
-  @objc public class Language : ObjectiveC.NSObject, Swift.Codable {
-    final public let en: Swift.String?
-    final public let zh_TW: Swift.String?
-    final public let zh_CN: Swift.String?
-    @objc deinit
-    public func encode(to encoder: Swift.Encoder) throws
-    required public init(from decoder: Swift.Decoder) throws
-  }
-  @objc deinit
-  public func encode(to encoder: Swift.Encoder) throws
-  required public init(from decoder: Swift.Decoder) throws
-}
-@objc public enum KMAdvertisementBaseViewActionType : Swift.Int {
-  case unknow = 0
-  case cancel
-  case tap
-  public init?(rawValue: Swift.Int)
-  public typealias RawValue = Swift.Int
-  public var rawValue: Swift.Int {
-    get
-  }
-}
-public typealias KMAdvertisementActionCompletion = (_ actionType: KMAdvertisement.KMAdvertisementBaseViewActionType, _ actionItem: KMAdvertisement.KMAdvertisementModelItem) -> Swift.Void
-public typealias KMAdvertisementLoadCompletion = (_ data: [KMAdvertisement.KMAdvertisementModelSection]) -> Swift.Void
-@_inheritsConvenienceInitializers @objc @_Concurrency.MainActor(unsafe) open class KMAdvertisementBaseView : AppKit.NSView {
-  @_Concurrency.MainActor(unsafe) public var actionCompletion: KMAdvertisement.KMAdvertisementActionCompletion?
-  @_Concurrency.MainActor(unsafe) public var loadCompletion: KMAdvertisement.KMAdvertisementLoadCompletion?
-  @_Concurrency.MainActor(unsafe) @objc override dynamic public init(frame frameRect: Foundation.NSRect)
-  @_Concurrency.MainActor(unsafe) @objc required dynamic public init?(coder: Foundation.NSCoder)
-  @objc deinit
-}
-@objc @_inheritsConvenienceInitializers @objcMembers open class KMAdvertisementModelTransition : ObjectiveC.NSObject {
-  public static func transitionColor(color: KMAdvertisement.KMAdvertisementModelItem.Color?, highlight: Swift.Bool) -> KMAdvertisement.UIColor
-  public static func transitionImagePath(image: KMAdvertisement.KMAdvertisementModelItem.Image?, highlight: Swift.Bool) -> Swift.String
-  @objc public static func transitionLanguage(langeuage: KMAdvertisement.KMAdvertisementModelItem.Language?) -> Swift.String
-  @objc public static func getLanguageType() -> Swift.String
-  @objc override dynamic public init()
-  @objc deinit
-}
-@objc @_inheritsConvenienceInitializers @objcMembers @_Concurrency.MainActor(unsafe) open class KMAdvertisementShowView : KMAdvertisement.KMAdvertisementBaseView {
-  @objc @_Concurrency.MainActor(unsafe) open var inputData: KMAdvertisement.KMAdvertisementModel? {
-    @objc get
-    @objc set
-  }
-  @_Concurrency.MainActor(unsafe) @objc required dynamic public init?(coder decoder: Foundation.NSCoder)
-  @_Concurrency.MainActor(unsafe) @objc override dynamic public init(frame frameRect: Foundation.NSRect)
-  @_Concurrency.MainActor(unsafe) @objc override dynamic public func draw(_ dirtyRect: Foundation.NSRect)
-  @_Concurrency.MainActor(unsafe) @objc override dynamic open func mouseDown(with event: AppKit.NSEvent)
-  @objc deinit
-}
-@objc public enum KMAdvertisementAppNameType : Swift.Int, Swift.Codable {
-  case RecordIt = 0
-  case RecordItPro = 1
-  case RecordItDMG = 2
-  case FilmageScreen = 3
-  case FilmageScreenPro = 4
-  case FilmageScreenDMG = 5
-  case FilmageEditorMac = 6
-  case FilmageEditorMacPro = 7
-  case FilmageEditorMacDMG = 8
-  case FilmageConverterMac = 9
-  case FilmageConverterMacPro = 10
-  case FilmageConverterMacDMG = 11
-  case FilmagePlayerMac = 12
-  case FilmagePlayerMacPro = 13
-  case FilmagePlayerMacDMG = 14
-  case PDFReaderProMac = 15
-  case PDFReaderProMacPro = 16
-  case PDFReaderProMacDMG = 17
-  case PDFReaderProIOS = 18
-  case PDFReaderProIOSPro = 19
-  public init?(rawValue: Swift.Int)
-  public typealias RawValue = Swift.Int
-  public var rawValue: Swift.Int {
-    get
-  }
-}
-@objc public enum KMAdvertisementShowType : Swift.Int, Swift.Codable {
-  case unknow = 0
-  case list = 1
-  case pop = 2
-  case scroll = 3
-  case view = 4
-  public init?(rawValue: Swift.Int)
-  public typealias RawValue = Swift.Int
-  public var rawValue: Swift.Int {
-    get
-  }
-}
-@objc public enum KMAdvertisementPlatformType : Swift.Int, Swift.Codable {
-  case unknow = 0
-  case Mac
-  case iOS
-  public init?(rawValue: Swift.Int)
-  public typealias RawValue = Swift.Int
-  public var rawValue: Swift.Int {
-    get
-  }
-}
-@objc public enum KMAdvertisementSubscribeType : Swift.Int, Swift.Codable {
-  case unknow = 0
-  case unsubscribed = 1
-  case subscribed = 2
-  case all = 3
-  public init?(rawValue: Swift.Int)
-  public typealias RawValue = Swift.Int
-  public var rawValue: Swift.Int {
-    get
-  }
-}
-@objc public enum KMAdvertisementActionType : Swift.Int, Swift.Codable {
-  case unknow = 0
-  case URL = 1
-  case comparative = 2
-  public init?(rawValue: Swift.Int)
-  public typealias RawValue = Swift.Int
-  public var rawValue: Swift.Int {
-    get
-  }
-}
-@objc public enum KMAdvertisementLanguageType : Swift.Int, Swift.Codable {
-  case unknow
-  case en
-  case zhCN
-  case zhTW
-  public init?(rawValue: Swift.Int)
-  public typealias RawValue = Swift.Int
-  public var rawValue: Swift.Int {
-    get
-  }
-}
-@objc @_inheritsConvenienceInitializers @objcMembers open class KMAdvertisementConfig : ObjectiveC.NSObject {
-  @objc public var subscribeType: KMAdvertisement.KMAdvertisementSubscribeType
-  @objc public var language: KMAdvertisement.KMAdvertisementLanguageType
-  @objc public func initParameters(appName: KMAdvertisement.KMAdvertisementAppNameType, subscribeType: KMAdvertisement.KMAdvertisementSubscribeType, platform: KMAdvertisement.KMAdvertisementPlatformType)
-  @objc override dynamic public init()
-  @objc deinit
-}
-public typealias UIImage = AppKit.NSImage
-public typealias UIView = AppKit.NSView
-public typealias UIButton = AppKit.NSButton
-public typealias UIScrollView = AppKit.NSScrollView
-public typealias UIColor = AppKit.NSColor
-public typealias UIFont = AppKit.NSFont
-public typealias UITextView = AppKit.NSTextView
-public typealias UIImageView = AppKit.NSImageView
-public typealias UIEvent = AppKit.NSEvent
-public typealias UIBezierPath = AppKit.NSBezierPath
-public typealias UITextField = AppKit.NSTextField
-public typealias UIEdgeInsets = Foundation.NSEdgeInsets
-@objc @_inheritsConvenienceInitializers @objcMembers open class KMAdvertisementManager : ObjectiveC.NSObject {
-  @objc public static let manager: KMAdvertisement.KMAdvertisementManager
-  @objc public var configuration: KMAdvertisement.KMAdvertisementConfig
-  @objc public var debug: Swift.Bool
-  @objc public func initConfig(appName: KMAdvertisement.KMAdvertisementAppNameType, subscribeType: KMAdvertisement.KMAdvertisementSubscribeType, platform: KMAdvertisement.KMAdvertisementPlatformType)
-  @objc override dynamic public init()
-  @objc deinit
-}
-extension KMAdvertisement.KMAdvertisementManager {
-  @objc dynamic public func fetchData(completion: @escaping (_ data: [KMAdvertisement.KMAdvertisementModel]?, _ error: Swift.Error?) -> Swift.Void)
-  @objc dynamic public func fetchDataWithResponseObject(completion: @escaping (_ data: [KMAdvertisement.KMAdvertisementModel]?, _ responseObject: Swift.AnyObject?, _ error: Swift.Error?) -> Swift.Void)
-}
-extension KMAdvertisement.KMAdvertisementManager {
-  @objc dynamic public func show(type: KMAdvertisement.KMAdvertisementShowType, data: KMAdvertisement.KMAdvertisementModel?, superView: AppKit.NSView?, _ action: KMAdvertisement.KMAdvertisementActionCompletion?) -> AppKit.NSView
-  @objc dynamic public func show(type: KMAdvertisement.KMAdvertisementShowType, data: KMAdvertisement.KMAdvertisementModel?, superView: AppKit.NSView?, _ action: KMAdvertisement.KMAdvertisementActionCompletion?, _ loadCompletion: KMAdvertisement.KMAdvertisementLoadCompletion?) -> AppKit.NSView
-}
-extension KMAdvertisement.KMAdvertisementManager {
-  @objc dynamic public func parseData(data: [Foundation.NSDictionary], isNeedLocalComparison: Swift.Bool, completion: (_ result: [KMAdvertisement.KMAdvertisementModel]) -> Swift.Void)
-}
-extension KMAdvertisement.KMAdvertisementBaseViewActionType : Swift.Equatable {}
-extension KMAdvertisement.KMAdvertisementBaseViewActionType : Swift.Hashable {}
-extension KMAdvertisement.KMAdvertisementBaseViewActionType : Swift.RawRepresentable {}
-extension KMAdvertisement.KMAdvertisementAppNameType : Swift.Equatable {}
-extension KMAdvertisement.KMAdvertisementAppNameType : Swift.Hashable {}
-extension KMAdvertisement.KMAdvertisementAppNameType : Swift.RawRepresentable {}
-extension KMAdvertisement.KMAdvertisementShowType : Swift.Equatable {}
-extension KMAdvertisement.KMAdvertisementShowType : Swift.Hashable {}
-extension KMAdvertisement.KMAdvertisementShowType : Swift.RawRepresentable {}
-extension KMAdvertisement.KMAdvertisementPlatformType : Swift.Equatable {}
-extension KMAdvertisement.KMAdvertisementPlatformType : Swift.Hashable {}
-extension KMAdvertisement.KMAdvertisementPlatformType : Swift.RawRepresentable {}
-extension KMAdvertisement.KMAdvertisementSubscribeType : Swift.Equatable {}
-extension KMAdvertisement.KMAdvertisementSubscribeType : Swift.Hashable {}
-extension KMAdvertisement.KMAdvertisementSubscribeType : Swift.RawRepresentable {}
-extension KMAdvertisement.KMAdvertisementActionType : Swift.Equatable {}
-extension KMAdvertisement.KMAdvertisementActionType : Swift.Hashable {}
-extension KMAdvertisement.KMAdvertisementActionType : Swift.RawRepresentable {}
-extension KMAdvertisement.KMAdvertisementLanguageType : Swift.Equatable {}
-extension KMAdvertisement.KMAdvertisementLanguageType : Swift.Hashable {}
-extension KMAdvertisement.KMAdvertisementLanguageType : Swift.RawRepresentable {}

BIN
PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Modules/KMAdvertisement.swiftmodule/x86_64-apple-macos.swiftmodule


+ 0 - 11
PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Modules/module.modulemap

@@ -1,11 +0,0 @@
-framework module KMAdvertisement {
-  umbrella header "KMAdvertisement.h"
-
-  export *
-  module * { export * }
-}
-
-module KMAdvertisement.Swift {
-  header "KMAdvertisement-Swift.h"
-  requires objc
-}

+ 0 - 51
PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Resources/Info.plist

@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>BuildMachineOSBuild</key>
-	<string>22C5050e</string>
-	<key>CFBundleDevelopmentRegion</key>
-	<string>en</string>
-	<key>CFBundleExecutable</key>
-	<string>KMAdvertisement</string>
-	<key>CFBundleIdentifier</key>
-	<string>KMAdvertisement.KMAdvertisement</string>
-	<key>CFBundleInfoDictionaryVersion</key>
-	<string>6.0</string>
-	<key>CFBundleName</key>
-	<string>KMAdvertisement</string>
-	<key>CFBundlePackageType</key>
-	<string>FMWK</string>
-	<key>CFBundleShortVersionString</key>
-	<string>1.0</string>
-	<key>CFBundleSupportedPlatforms</key>
-	<array>
-		<string>MacOSX</string>
-	</array>
-	<key>CFBundleVersion</key>
-	<string>1</string>
-	<key>DTCompiler</key>
-	<string>com.apple.compilers.llvm.clang.1_0</string>
-	<key>DTPlatformBuild</key>
-	<string>14C18</string>
-	<key>DTPlatformName</key>
-	<string>macosx</string>
-	<key>DTPlatformVersion</key>
-	<string>13.1</string>
-	<key>DTSDKBuild</key>
-	<string>22C55</string>
-	<key>DTSDKName</key>
-	<string>macosx13.1</string>
-	<key>DTXcode</key>
-	<string>1420</string>
-	<key>DTXcodeBuild</key>
-	<string>14C18</string>
-	<key>LSMinimumSystemVersion</key>
-	<string>10.13</string>
-	<key>NSAppTransportSecurity</key>
-	<dict>
-		<key>NSAllowsArbitraryLoads</key>
-		<true/>
-	</dict>
-</dict>
-</plist>

BIN
PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Resources/KMAdvertisement.bundle/1.jpg


BIN
PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Resources/KMAdvertisement.bundle/2.png


BIN
PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Resources/KMAdvertisement.bundle/3.png


BIN
PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Resources/KMAdvertisement.bundle/ad_cancel_button00@2x.png


BIN
PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Resources/KMAdvertisementCollectionHeadView.nib


BIN
PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Resources/KMAdvertisementCollectionViewItem.nib


+ 0 - 0
PDF Office/PDF Master/Third Pard Library/KMAdvertisement.framework/Versions/A/Resources/KMAdvertisementShowView.nib


이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.