Browse Source

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

tangchao 1 year ago
parent
commit
dd4769ba4f

+ 18 - 20
PDF Office/PDF Master.xcodeproj/project.pbxproj

@@ -217,9 +217,6 @@
 		89E4E7382964148E002DBA6F /* KMAnnotationPropertiesViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 89E4E7342964148E002DBA6F /* KMAnnotationPropertiesViewController.xib */; };
 		89E4E7392964148E002DBA6F /* KMAnnotationPropertiesViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 89E4E7342964148E002DBA6F /* KMAnnotationPropertiesViewController.xib */; };
 		89E4E73A2964148E002DBA6F /* KMAnnotationPropertiesViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 89E4E7342964148E002DBA6F /* KMAnnotationPropertiesViewController.xib */; };
-		89E4E73E2964160F002DBA6F /* KMAnnotationLinkViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 89E4E73B2964160F002DBA6F /* KMAnnotationLinkViewController.m */; };
-		89E4E73F2964160F002DBA6F /* KMAnnotationLinkViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 89E4E73B2964160F002DBA6F /* KMAnnotationLinkViewController.m */; };
-		89E4E7402964160F002DBA6F /* KMAnnotationLinkViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 89E4E73B2964160F002DBA6F /* KMAnnotationLinkViewController.m */; };
 		89E4E7412964160F002DBA6F /* KMAnnotationLinkViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 89E4E73C2964160F002DBA6F /* KMAnnotationLinkViewController.xib */; };
 		89E4E7422964160F002DBA6F /* KMAnnotationLinkViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 89E4E73C2964160F002DBA6F /* KMAnnotationLinkViewController.xib */; };
 		89E4E7432964160F002DBA6F /* KMAnnotationLinkViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 89E4E73C2964160F002DBA6F /* KMAnnotationLinkViewController.xib */; };
@@ -729,6 +726,12 @@
 		9F53D54F2AD677A000CCF9D8 /* CPDFListViewConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F53D54E2AD677A000CCF9D8 /* CPDFListViewConfig.swift */; };
 		9F53D5502AD677A000CCF9D8 /* CPDFListViewConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F53D54E2AD677A000CCF9D8 /* CPDFListViewConfig.swift */; };
 		9F53D5512AD677A000CCF9D8 /* CPDFListViewConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F53D54E2AD677A000CCF9D8 /* CPDFListViewConfig.swift */; };
+		9F53D5532AD683A700CCF9D8 /* KMAnnotationPropertyBaseController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F53D5522AD683A700CCF9D8 /* KMAnnotationPropertyBaseController.swift */; };
+		9F53D5542AD683A700CCF9D8 /* KMAnnotationPropertyBaseController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F53D5522AD683A700CCF9D8 /* KMAnnotationPropertyBaseController.swift */; };
+		9F53D5552AD683A700CCF9D8 /* KMAnnotationPropertyBaseController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F53D5522AD683A700CCF9D8 /* KMAnnotationPropertyBaseController.swift */; };
+		9F53D5572AD6908600CCF9D8 /* KMAnnotationLinkViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F53D5562AD6908600CCF9D8 /* KMAnnotationLinkViewController.swift */; };
+		9F53D5582AD6908600CCF9D8 /* KMAnnotationLinkViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F53D5562AD6908600CCF9D8 /* KMAnnotationLinkViewController.swift */; };
+		9F53D5592AD6908600CCF9D8 /* KMAnnotationLinkViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F53D5562AD6908600CCF9D8 /* KMAnnotationLinkViewController.swift */; };
 		9F5664872988B16F00020985 /* KMTextfieldVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F5664852988B16F00020985 /* KMTextfieldVC.swift */; };
 		9F5664882988B16F00020985 /* KMTextfieldVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F5664852988B16F00020985 /* KMTextfieldVC.swift */; };
 		9F5664892988B16F00020985 /* KMTextfieldVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F5664852988B16F00020985 /* KMTextfieldVC.swift */; };
@@ -2475,9 +2478,6 @@
 		BB51074229A61B4100978662 /* ProgressSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = BB51073E29A61B4000978662 /* ProgressSheet.xib */; };
 		BB51074329A61B4100978662 /* ProgressSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = BB51073E29A61B4000978662 /* ProgressSheet.xib */; };
 		BB51074429A61B4100978662 /* ProgressSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = BB51073E29A61B4000978662 /* ProgressSheet.xib */; };
-		BB52372729C313CA00663BD7 /* KMAnnotationPropertyBaseController.m in Sources */ = {isa = PBXBuildFile; fileRef = BB52372529C313CA00663BD7 /* KMAnnotationPropertyBaseController.m */; };
-		BB52372829C313CA00663BD7 /* KMAnnotationPropertyBaseController.m in Sources */ = {isa = PBXBuildFile; fileRef = BB52372529C313CA00663BD7 /* KMAnnotationPropertyBaseController.m */; };
-		BB52372929C313CA00663BD7 /* KMAnnotationPropertyBaseController.m in Sources */ = {isa = PBXBuildFile; fileRef = BB52372529C313CA00663BD7 /* KMAnnotationPropertyBaseController.m */; };
 		BB52372A29C313CA00663BD7 /* KMAnnotationPropertyBaseController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BB52372629C313CA00663BD7 /* KMAnnotationPropertyBaseController.xib */; };
 		BB52372B29C313CA00663BD7 /* KMAnnotationPropertyBaseController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BB52372629C313CA00663BD7 /* KMAnnotationPropertyBaseController.xib */; };
 		BB52372C29C313CA00663BD7 /* KMAnnotationPropertyBaseController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BB52372629C313CA00663BD7 /* KMAnnotationPropertyBaseController.xib */; };
@@ -3566,9 +3566,9 @@
 		89E4E7322964148E002DBA6F /* KMAnnotationPropertiesViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KMAnnotationPropertiesViewController.h; path = "PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMAnnotationPropertiesViewController.h"; sourceTree = SOURCE_ROOT; };
 		89E4E7332964148E002DBA6F /* KMAnnotationPropertiesViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = KMAnnotationPropertiesViewController.m; path = "PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMAnnotationPropertiesViewController.m"; sourceTree = SOURCE_ROOT; };
 		89E4E7342964148E002DBA6F /* KMAnnotationPropertiesViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = KMAnnotationPropertiesViewController.xib; path = "PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMAnnotationPropertiesViewController.xib"; sourceTree = SOURCE_ROOT; };
-		89E4E73B2964160F002DBA6F /* KMAnnotationLinkViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KMAnnotationLinkViewController.m; sourceTree = "<group>"; };
 		89E4E73C2964160F002DBA6F /* KMAnnotationLinkViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = KMAnnotationLinkViewController.xib; sourceTree = "<group>"; };
-		89E4E73D2964160F002DBA6F /* KMAnnotationLinkViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KMAnnotationLinkViewController.h; sourceTree = "<group>"; };
+		89E4E744296418ED002DBA6F /* TextFieldFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextFieldFormatter.h; sourceTree = "<group>"; };
+		89E4E745296418ED002DBA6F /* TextFieldFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TextFieldFormatter.m; sourceTree = "<group>"; };
 		89E4E753296427E5002DBA6F /* NSImage_SKExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSImage_SKExtensions.m; sourceTree = "<group>"; };
 		89E4E754296427E5002DBA6F /* NSImage_SKExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSImage_SKExtensions.h; sourceTree = "<group>"; };
 		89E4E75E29656A88002DBA6F /* KMAnnotationStampViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KMAnnotationStampViewController.m; sourceTree = "<group>"; };
@@ -3791,6 +3791,8 @@
 		9F53D5462AD664C300CCF9D8 /* CPDFListHoverAnnotationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CPDFListHoverAnnotationViewController.swift; sourceTree = "<group>"; };
 		9F53D54A2AD6696B00CCF9D8 /* ComPDFUIConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ComPDFUIConfig.swift; sourceTree = "<group>"; };
 		9F53D54E2AD677A000CCF9D8 /* CPDFListViewConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CPDFListViewConfig.swift; sourceTree = "<group>"; };
+		9F53D5522AD683A700CCF9D8 /* KMAnnotationPropertyBaseController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMAnnotationPropertyBaseController.swift; sourceTree = "<group>"; };
+		9F53D5562AD6908600CCF9D8 /* KMAnnotationLinkViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMAnnotationLinkViewController.swift; sourceTree = "<group>"; };
 		9F5664852988B16F00020985 /* KMTextfieldVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMTextfieldVC.swift; sourceTree = "<group>"; };
 		9F5664862988B16F00020985 /* KMTextfieldVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMTextfieldVC.xib; sourceTree = "<group>"; };
 		9F705F74291A3A84005199AD /* KMHistoryFileDeleteWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMHistoryFileDeleteWindowController.swift; sourceTree = "<group>"; };
@@ -4453,8 +4455,6 @@
 		BB4EEF472976504C003A3537 /* KMRedactColorView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMRedactColorView.swift; sourceTree = "<group>"; };
 		BB4EEF4B2976544F003A3537 /* KMRedactAligementView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMRedactAligementView.swift; sourceTree = "<group>"; };
 		BB51073E29A61B4000978662 /* ProgressSheet.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ProgressSheet.xib; sourceTree = "<group>"; };
-		BB52372429C313CA00663BD7 /* KMAnnotationPropertyBaseController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KMAnnotationPropertyBaseController.h; sourceTree = "<group>"; };
-		BB52372529C313CA00663BD7 /* KMAnnotationPropertyBaseController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KMAnnotationPropertyBaseController.m; sourceTree = "<group>"; };
 		BB52372629C313CA00663BD7 /* KMAnnotationPropertyBaseController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMAnnotationPropertyBaseController.xib; sourceTree = "<group>"; };
 		BB5DF1E72959C5CB0025CDA1 /* KMHeaderFooterPreviewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMHeaderFooterPreviewController.swift; sourceTree = "<group>"; };
 		BB5DF1E82959C5CB0025CDA1 /* KMHeaderFooterPreviewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMHeaderFooterPreviewController.xib; sourceTree = "<group>"; };
@@ -5250,8 +5250,7 @@
 				89E4E7092963D62B002DBA6F /* KMAnnotationFontWindowController.xib */,
 				AD5999352AD7D9C200412F8B /* KMPropertiesViewPopController.swift */,
 				89E4E72E2963FBA1002DBA6F /* KMPropertiesViewPopController.xib */,
-				89E4E73D2964160F002DBA6F /* KMAnnotationLinkViewController.h */,
-				89E4E73B2964160F002DBA6F /* KMAnnotationLinkViewController.m */,
+				9F53D5562AD6908600CCF9D8 /* KMAnnotationLinkViewController.swift */,
 				89E4E73C2964160F002DBA6F /* KMAnnotationLinkViewController.xib */,
 				9F0CB44C29667FC700007028 /* ViewController */,
 			);
@@ -8021,8 +8020,7 @@
 		BB52372329C3136800663BD7 /* Base */ = {
 			isa = PBXGroup;
 			children = (
-				BB52372429C313CA00663BD7 /* KMAnnotationPropertyBaseController.h */,
-				BB52372529C313CA00663BD7 /* KMAnnotationPropertyBaseController.m */,
+				9F53D5522AD683A700CCF9D8 /* KMAnnotationPropertyBaseController.swift */,
 				BB52372629C313CA00663BD7 /* KMAnnotationPropertyBaseController.xib */,
 			);
 			path = Base;
@@ -10335,7 +10333,6 @@
 				BB146FBD299DC0D100784A6A /* GTMGatherInputStream.m in Sources */,
 				9F78EFC628F7E965001E66F4 /* KMHomeViewController+UI.swift in Sources */,
 				BB8F4582295B0F900037EA22 /* KMHeaderFooterMarginInfoView.swift in Sources */,
-				BB52372729C313CA00663BD7 /* KMAnnotationPropertyBaseController.m in Sources */,
 				9FDD0FAA29534FCC000C4DAD /* KMAliasLight.swift in Sources */,
 				BB147029299DC0D100784A6A /* OIDAuthorizationService.m in Sources */,
 				9FF94F1129A7476000B1EF69 /* KMDesignPropertySelector.swift in Sources */,
@@ -10457,7 +10454,6 @@
 				BBC745EA295F067B0072C2ED /* KMCropSettingWindowController.swift in Sources */,
 				9FCFEC6C2AC3D96800EAD2CB /* CPDFListViewAnimatedBorderlessWindow.swift in Sources */,
 				89752DF62938A236003FF08E /* PublicKey.swift in Sources */,
-				89E4E73E2964160F002DBA6F /* KMAnnotationLinkViewController.m in Sources */,
 				BBC3480C29558DC1008D2CD1 /* KMBackgroundController.swift in Sources */,
 				9FBC48B8299B44C600CA39D7 /* KMSecondaryViewController.m in Sources */,
 				BBC348142955920B008D2CD1 /* KMBackgroundPropertyController.swift in Sources */,
@@ -10513,6 +10509,7 @@
 				ADCB98E12924776F00B51A03 /* KMBatchProcessingSizeTableCell.swift in Sources */,
 				ADDEEA822AD4DAB200EF675D /* KMSignatureWindowController.swift in Sources */,
 				BB8F457A295AFB330037EA22 /* KMHeaderFooterFontInfoView.swift in Sources */,
+				9F53D5572AD6908600CCF9D8 /* KMAnnotationLinkViewController.swift in Sources */,
 				BBB5C80729F4CEE40054F261 /* KMLinkAnnotationPropertyEmptyController.swift in Sources */,
 				8997010628F4082C009AF911 /* KMFromViewController.swift in Sources */,
 				BBD1F78B296FACA300343885 /* KMPageEditExtractSettingView.swift in Sources */,
@@ -10948,6 +10945,7 @@
 				BB1CA5C6298E20820059E31C /* KMPreferenceAligementView.swift in Sources */,
 				8942F817292B678100389627 /* KMAnnotationTableCellView.swift in Sources */,
 				9F1FE4F629406E4700E952CA /* CTFloatingBarBackingView.m in Sources */,
+				9F53D5532AD683A700CCF9D8 /* KMAnnotationPropertyBaseController.swift in Sources */,
 				ADBC2D4429A0D09A006280C8 /* ImageToPDFTools.swift in Sources */,
 				AD8810A029A8459000178CA1 /* KMComparativeTableViewController.swift in Sources */,
 				BBEB93EF2AD6C72C00739573 /* KMPDFMergePageRangeTabelViewCell.swift in Sources */,
@@ -11134,7 +11132,6 @@
 				BB146FBE299DC0D100784A6A /* GTMGatherInputStream.m in Sources */,
 				9F1F82EF293609F60092C4B4 /* CPDFDocument+PageEditManager.swift in Sources */,
 				BB8F4583295B0F900037EA22 /* KMHeaderFooterMarginInfoView.swift in Sources */,
-				BB52372829C313CA00663BD7 /* KMAnnotationPropertyBaseController.m in Sources */,
 				9F1FE51229407B4000E952CA /* KMFileSearchView.swift in Sources */,
 				BB14702A299DC0D100784A6A /* OIDAuthorizationService.m in Sources */,
 				9FF94F1229A7476000B1EF69 /* KMDesignPropertySelector.swift in Sources */,
@@ -11156,6 +11153,7 @@
 				BBC3484F29582920008D2CD1 /* KMBackgroundColorView.swift in Sources */,
 				ADF1569429A62D1D001D1018 /* KMLoginLeftImageView.swift in Sources */,
 				ADDEEA5B2AD399BB00EF675D /* KMSignature.swift in Sources */,
+				9F53D5582AD6908600CCF9D8 /* KMAnnotationLinkViewController.swift in Sources */,
 				BBA762D329D2D98D00844513 /* KMCommonDefine.swift in Sources */,
 				AD867F9D29D9853200F00440 /* KMBOTAOutlineRowView.swift in Sources */,
 				BB146FDC299DC0D100784A6A /* GTLRDriveService.m in Sources */,
@@ -11264,7 +11262,6 @@
 				ADE614A82977954000F62ED7 /* KMBatchConvertPDFViewPresenter.swift in Sources */,
 				BBC745EB295F067B0072C2ED /* KMCropSettingWindowController.swift in Sources */,
 				ADCB98C62924730000B51A03 /* KMBatchProcessingTableViewModel.swift in Sources */,
-				89E4E73F2964160F002DBA6F /* KMAnnotationLinkViewController.m in Sources */,
 				ADDEEA7B2AD3F4C800EF675D /* KMPopUpButton.swift in Sources */,
 				BBC3480D29558DC1008D2CD1 /* KMBackgroundController.swift in Sources */,
 				BB6DD8262934D056001F0544 /* KMSecureEncryptSuccessTipView.swift in Sources */,
@@ -11640,6 +11637,7 @@
 				ADBC2D38299F0A5A006280C8 /* KMPrintHelpViewController.swift in Sources */,
 				9FBC48C0299E23B100CA39D7 /* NSViewController+DesignToken.swift in Sources */,
 				ADB2D6E7294740F30029D2B3 /* KMPrintPaperSetWindowController.swift in Sources */,
+				9F53D5542AD683A700CCF9D8 /* KMAnnotationPropertyBaseController.swift in Sources */,
 				BB2EDF47296E4618003BCF58 /* KMPageEditTools.swift in Sources */,
 				9FAAA32B290BD01D0046FFCE /* KMHomeHistoryFileViewController.swift in Sources */,
 				BB49ED16293F489500C82CA2 /* KMConvertImageSettingView.swift in Sources */,
@@ -12254,6 +12252,7 @@
 				ADB5E51B2A3711CB007110A8 /* KMSubscribeWaterMarkView.swift in Sources */,
 				89D9896028FD21E6003A3E87 /* KMAnnotationCollectionView.swift in Sources */,
 				89752D9C2936E675003FF08E /* KMToolBarBox.swift in Sources */,
+				9F53D5552AD683A700CCF9D8 /* KMAnnotationPropertyBaseController.swift in Sources */,
 				ADC25DFB2923BA710080A3F6 /* KMImageToPDFWindowController.swift in Sources */,
 				BB4DD049299B294000E80DF6 /* KMCloudFileEmptyView.swift in Sources */,
 				BB3198182AC55E6D00107371 /* CPDFDocument+KMExtension.swift in Sources */,
@@ -12360,7 +12359,6 @@
 				9FAAA33B290F72CC0046FFCE /* KMHistoryFileCollectionView.swift in Sources */,
 				9F3D819529A33A290087B5AD /* KMDesignDropdown.swift in Sources */,
 				ADB2D6EF2947415E0029D2B3 /* KMPrintPaperSetView.swift in Sources */,
-				89E4E7402964160F002DBA6F /* KMAnnotationLinkViewController.m in Sources */,
 				BB3EAEAF293E3D6000D92407 /* KMConvertBaseWindowController.swift in Sources */,
 				BB7FF5092A60E84400901C2D /* KMEnumExtensions.swift in Sources */,
 				9F1FE4A729406E4700E952CA /* CTToolbarView.m in Sources */,
@@ -12403,7 +12401,6 @@
 				9FD0FA2B29CD3ED400F2AB0D /* KMRightSideEmptyVC.swift in Sources */,
 				BB6B43682A04919200E02B54 /* KMBaseViewController.swift in Sources */,
 				9FBA0EF028FFC716001117AF /* KMHomeFastToolViewController.swift in Sources */,
-				BB52372929C313CA00663BD7 /* KMAnnotationPropertyBaseController.m in Sources */,
 				9F1FE4E329406E4700E952CA /* GTMNSAnimation+Duration.m in Sources */,
 				BB8F456B295ABDC10037EA22 /* KMWatermarkAdjectiveBaseModel.swift in Sources */,
 				9F0CB4FB298655E500007028 /* KMDesignToken+Border.swift in Sources */,
@@ -12439,6 +12436,7 @@
 				ADE8BC4029F9458700570F89 /* KMRecommondInfo.m in Sources */,
 				ADB2D6E8294740F30029D2B3 /* KMPrintPaperSetWindowController.swift in Sources */,
 				AD867FC329DFC39400F00440 /* KMBOTAAnnotationItem.swift in Sources */,
+				9F53D5592AD6908600CCF9D8 /* KMAnnotationLinkViewController.swift in Sources */,
 				89E4E7372964148E002DBA6F /* KMAnnotationPropertiesViewController.m in Sources */,
 				ADB1FE8829752F4C00ED072D /* KMBatchWatermarkView.swift in Sources */,
 				F37322F8292DF9410013862C /* CSelfSignAnnotation.m in Sources */,

+ 32 - 0
PDF Office/PDF Master.xcodeproj/xcuserdata/kdanwj.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -512,6 +512,38 @@
             endingLineNumber = "1381"
             landmarkName = "-buttonItemClick_Append:"
             landmarkType = "7">
+            <Locations>
+               <Location
+                  uuid = "5E7DBFF6-97BA-4011-B25E-2674C8DF0CD5 - c1c7efc213d86e6f"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "__48-[KMPDFEditAppendWindow buttonItemClick_Append:]_block_invoke_3"
+                  moduleName = "PDF Master"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/kdanwj/Git/Mac/PDF%20Office/PDF%20Office/PDF%20Master/Class/Merge/OCPart/KMPDFEditAppendWindow.m"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "1381"
+                  endingLineNumber = "1381"
+                  offsetFromSymbolStart = "72">
+               </Location>
+               <Location
+                  uuid = "5E7DBFF6-97BA-4011-B25E-2674C8DF0CD5 - c1c7efc213d86e6f"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "__48-[KMPDFEditAppendWindow buttonItemClick_Append:]_block_invoke_3"
+                  moduleName = "PDF Master"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/kdanwj/Git/Mac/PDF%20Office/PDF%20Office/PDF%20Master/Class/Merge/OCPart/KMPDFEditAppendWindow.m"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "1381"
+                  endingLineNumber = "1381"
+                  offsetFromSymbolStart = "152">
+               </Location>
+            </Locations>
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy

+ 0 - 23
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/Base/KMAnnotationPropertyBaseController.h

@@ -1,23 +0,0 @@
-//
-//  KMAnnotationPropertyBaseController.h
-//  PDF Master
-//
-//  Created by tangchao on 2023/3/16.
-//
-
-#import <Cocoa/Cocoa.h>
-#import "CPDFListView.h"
-
-NS_ASSUME_NONNULL_BEGIN
-
-@interface KMAnnotationPropertyBaseController : NSViewController
-
-@property (nonatomic, weak) CPDFListView * pdfview;
-@property (nonatomic, strong) CPDFDestination *startDestination;
-@property (nonatomic, strong) CPDFDestination *targetDestination;
-
-- (void)setupUI;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 26
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/Base/KMAnnotationPropertyBaseController.m

@@ -1,26 +0,0 @@
-//
-//  KMAnnotationPropertyBaseController.m
-//  PDF Master
-//
-//  Created by tangchao on 2023/3/16.
-//
-
-#import "KMAnnotationPropertyBaseController.h"
-
-@interface KMAnnotationPropertyBaseController ()
-
-@end
-
-@implementation KMAnnotationPropertyBaseController
-
-- (void)viewDidLoad {
-    [super viewDidLoad];
-    
-    [self setupUI];
-}
-
-- (void)setupUI {
-    
-}
-
-@end

+ 35 - 0
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/Base/KMAnnotationPropertyBaseController.swift

@@ -0,0 +1,35 @@
+//
+//  KMAnnotationPropertyBaseController.swift
+//  PDF Master
+//
+//  Created by wanjun on 2023/10/11.
+//
+
+import Cocoa
+
+@objcMembers
+class KMAnnotationPropertyBaseController: NSViewController {
+
+    weak var _pdfview: CPDFListView?
+    var startDestination: CPDFDestination?
+    var targetDestination: CPDFDestination?
+    
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        
+        self.setupUI()
+    }
+
+    func setupUI() {
+        // 在这里执行设置界面的操作
+    }
+    
+    weak var pdfview: CPDFListView? {
+        get {
+           return _pdfview
+        }
+        set {
+            _pdfview = newValue
+        }
+    }
+}

+ 7 - 4
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/Base/KMAnnotationPropertyBaseController.xib

@@ -1,10 +1,12 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11134" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22154" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11134"/>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22154"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
-        <customObject id="-2" userLabel="File's Owner" customClass="KMAnnotationPropertyBaseController">
+        <customObject id="-2" userLabel="File's Owner" customClass="KMAnnotationPropertyBaseController" customModule="PDF_Master" customModuleProvider="target">
             <connections>
                 <outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
             </connections>
@@ -14,6 +16,7 @@
         <customView id="Hz6-mo-xeY">
             <rect key="frame" x="0.0" y="0.0" width="480" height="272"/>
             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+            <point key="canvasLocation" x="73" y="154"/>
         </customView>
     </objects>
 </document>

+ 0 - 22
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMAnnotationLinkViewController.h

@@ -1,22 +0,0 @@
-//
-//  KMAnnotationLinkViewController.h
-//  SignFlow
-//
-//  Created by wanjun on 2021/6/23.
-//
-
-#import "KMAnnotationPropertyBaseController.h"
-#import "CPDFListView+Tool.h"
-#import "CPDFAnnotationModel.h"
-
-@interface KMAnnotationLinkViewController : KMAnnotationPropertyBaseController
-
-@property (nonatomic,retain) CPDFAnnotationModel *annotationModel;
-
-@property (nonatomic, retain) NSString *content;
-
-@property (nonatomic, assign) NSInteger pageCount;
-
-@property (nonatomic, assign) BOOL isCreateLink;
-
-@end

+ 686 - 0
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMAnnotationLinkViewController.swift

@@ -0,0 +1,686 @@
+//
+//  KMAnnotationLinkViewController.swift
+//  PDF Master
+//
+//  Created by wanjun on 2023/10/11.
+//
+
+import Cocoa
+
+let URLPlaceholder = "https://www.pdfreaderpro.com"
+let EmailPlaceholder = "support@pdfreaderpro.com"
+
+enum KMAnnotationLinkType: Int {
+    case Page
+    case URL
+    case Email
+}
+
+enum KMAnnotationLinkState: Int {
+    case Normal
+    case Hover
+    case Selected
+}
+
+class KMAnnotationLinkViewController: KMAnnotationPropertyBaseController {
+    
+    var annotationModel: CPDFAnnotationModel?
+    var _content: String = ""
+    var pageCount: Int = 0
+    var _isCreateLink: Bool = false
+    
+    @IBOutlet weak var linkStyleView: NSView!
+    @IBOutlet var linkPageBox: KMBox!
+    @IBOutlet var linkPageImageView: NSImageView!
+    @IBOutlet weak var pageImageThumible: NSImageView!
+    @IBOutlet weak var targetButton: KMCoverButton!
+    @IBOutlet weak var targetLabel: NSTextField!
+    @IBOutlet weak var tagrgetBox: NSBox!
+
+    @IBOutlet var linkUrlBox: KMBox!
+    @IBOutlet var linkUrlImageView: NSImageView!
+
+    @IBOutlet var linkEmailBox: KMBox!
+    @IBOutlet var linkEmailImageView: NSImageView!
+
+    @IBOutlet var contentBox: NSBox!
+
+    @IBOutlet var urlView: NSView!
+    @IBOutlet var urlLabel: NSTextField!
+    @IBOutlet var inputUrlTextField: NSTextField!
+    @IBOutlet weak var inputUrlBox: NSBox!
+
+    @IBOutlet var goButton: NSButton!
+    @IBOutlet var errorLabel: NSTextField!
+    @IBOutlet weak var goButtonTopComstraint: NSLayoutConstraint!
+
+    var annotation: CPDFLinkAnnotation?
+    var _linkType: KMAnnotationLinkType = .Page
+    var mouseDownBox: KMBox?
+    var pageRecord: String = ""
+    var urlRecord: String = ""
+    var emailRecord: String = ""
+    var startPage: String = ""
+    var isGo: Bool = false
+
+    var boxNormalBorderColor: NSColor = NSColor(red: 223.0/255.0, green: 225.0/255.0, blue: 229.0/255.0, alpha: 1)
+    var boxErrorBorderColor: NSColor = NSColor(red: 243/255.0, green: 70/255.0, blue: 91/255.0, alpha: 1)
+    var targetButtonState: KMAnnotationLinkState = .Normal
+
+
+    //MARK: Init Methods
+    
+    override init(nibName nibNameOrNil: NSNib.Name?, bundle nibBundleOrNil: Bundle?) {
+        super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
+        
+        self.boxNormalBorderColor = NSColor(red: 223.0/255.0, green: 225.0/255.0, blue: 229.0/255.0, alpha: 1)
+        self.boxErrorBorderColor = NSColor(red: 243/255.0, green: 70/255.0, blue: 91/255.0, alpha: 1)
+
+    }
+    
+    required init?(coder: NSCoder) {
+        super.init(coder: coder)
+    }
+    
+    deinit {
+        NotificationCenter.default.removeObserver(self)
+        inputUrlTextField.delegate = nil
+
+        print("\(#function)")
+    }
+
+    //MARK: View Methods
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        // Do view setup here.
+        
+        self.annotation = self.annotationModel?.annotation as? CPDFLinkAnnotation
+        
+        self.pageRecord = ""
+        self.urlRecord = ""
+        self.emailRecord = ""
+        
+        self.linkStyleView.wantsLayer = true
+        self.linkPageImageView.wantsLayer = true
+        self.linkUrlImageView.wantsLayer = true
+        self.linkEmailImageView.wantsLayer = true
+        
+        self.linkStyleView.layer?.backgroundColor = NSColor(red: 223.0/255.0, green: 225.0/255.0, blue: 229.0/255.0, alpha: 1.0).cgColor
+        self.linkStyleView.layer?.cornerRadius = 6.0
+        self.linkStyleView.layer?.masksToBounds = true
+        
+        let boxArr: [KMBox] = [linkPageBox, linkUrlBox, linkEmailBox]
+        for box in boxArr {
+            box.downCallback = { [weak self] downEntered, mouseBox, event in
+                guard let self = self else { return }
+                if downEntered {
+                    if self.mouseDownBox === mouseBox {
+                        return
+                    }
+                    var mouseDownInt = 0
+                    if self.linkPageBox === mouseBox {
+                        self.inputUrlTextField.stringValue = ""
+                        self.linkType = .Page
+                        mouseDownInt = 0
+                    } else if self.linkUrlBox === mouseBox {
+                        self.inputUrlTextField.stringValue = ""
+                        self.linkType = .URL
+                        mouseDownInt = 1
+                    } else if self.linkEmailBox === mouseBox {
+                        self.inputUrlTextField.stringValue = ""
+                        self.linkType = .Email
+                        mouseDownInt = 2
+                    }
+                    UserDefaults.standard.set(mouseDownInt, forKey: "kmLinkSelectIndex")
+                    UserDefaults.standard.synchronize()
+                    self.mouseDownBox = mouseBox
+                }
+            }
+        }
+        
+        self.isGo = true
+        self.targetLabel.stringValue = NSLocalizedString("Locate the target page", tableName: "MainMenu", comment: "")
+        self.inputUrlTextField.wantsLayer = true
+        self.inputUrlTextField.focusRingType = .none
+        self.linkPageImageView.layer?.cornerRadius = 4.0
+        self.linkUrlImageView.layer?.cornerRadius = 4.0
+        self.linkEmailImageView.layer?.cornerRadius = 4.0
+        let inputUrlTextFieldCell = self.inputUrlTextField.cell as! NSTextFieldCell
+        inputUrlTextFieldCell.allowedInputSourceLocales = [NSAllRomanInputSourcesLocaleIdentifier]
+        
+        if self.linkType == .Email {
+            self.linkType = .Email
+            self.mouseDownBox = linkEmailBox
+        } else if linkType == .URL {
+            self.linkType = .URL
+            self.mouseDownBox = linkUrlBox
+        } else if linkType == .Page {
+            self.linkType = .Page
+            self.mouseDownBox = linkPageBox
+        }
+        
+        self.targetButton.coverAction = { [weak self] button, action in
+            guard let self = self, self.targetButtonState != .Selected else {
+                return
+            }
+            if action == .enter {
+                self.updateTargetBoxState(state: .Hover)
+            } else if action == .exit {
+                self.updateTargetBoxState(state: .Normal)
+            }
+        }
+        
+        NSEvent.addLocalMonitorForEvents(matching: .keyDown) { [weak self] event in
+            guard let self = self else { return event }
+            if event.keyCode == 53 {
+                if self.inputUrlTextField.isEditable {
+                    self.pdfview?.annotationType = .unkown
+                }
+            }
+            return event
+        }
+    }
+    
+    override func viewDidAppear() {
+        super.viewDidAppear()
+        
+        self.inputUrlTextField.delegate = self
+    }
+    
+    override func setupUI() {
+        super.setupUI()
+        
+        let fontName = "SFProText-Regular"
+
+        self.urlLabel.font = NSFont(name: fontName, size: 12)
+        self.urlLabel.textColor = NSColor(red: 97.0/255.0, green: 100.0/255.0, blue: 105.0/255.0, alpha: 1)
+
+        self.inputUrlBox.borderColor = self.boxNormalBorderColor
+        self.inputUrlBox.fillColor = NSColor.white
+        self.errorLabel.textColor = self.boxErrorBorderColor
+        self.errorLabel.font = NSFont(name: fontName, size: 12)
+
+        self.tagrgetBox.fillColor = NSColor.white
+        self.updateTargetBoxState(state: .Normal)
+        self.targetLabel.font = NSFont(name: fontName, size: 14)
+        self.targetLabel.textColor = NSColor(red: 37/255.0, green: 38/255.0, blue: 41/255.0, alpha: 1)
+
+        self.goButton.title = NSLocalizedString("Go", comment: "")
+        self.goButton.attributedTitle = NSAttributedString(string: self.goButton.title, attributes: [.foregroundColor: NSColor(red: 23.0/255.0, green: 112.0/255.0, blue: 244.0/255.0, alpha: 1)])
+    }
+    
+    //MARK: Set、Get
+    
+    var linkType: KMAnnotationLinkType {
+        get {
+            return _linkType
+        }
+        set {
+           _linkType = newValue
+            switch _linkType {
+            case .Page:
+                self.createLinkPageView()
+                self.inputUrlTextField.becomeFirstResponder()
+            case .URL:
+                self.createLinkURLView()
+                self.inputUrlTextField.becomeFirstResponder()
+            case .Email:
+                self.createLinkEmailView()
+                self.inputUrlTextField.becomeFirstResponder()
+            default:
+                break
+            }
+        }
+    }
+    
+    var content: String {
+        get {
+            return _content
+        }
+        set {
+            _content = newValue
+  
+            if _content != "" {
+                if _content.count > 0 {
+                    let typeLocal = _content.first ?? Character("\0")
+                    if typeLocal == "0" {
+                        _content = (_content as NSString).substring(from: 1)
+                        self.linkType = .Page
+                        self.inputUrlTextField.stringValue = _content
+                        self.mouseDownBox = self.linkPageBox
+                    } else {
+                        if content.dropFirst().hasPrefix("mailto:") {
+                            _content = (_content as NSString).substring(from: 8)
+                            self.linkType = .Email
+                            self.mouseDownBox = self.linkEmailBox
+                        } else {
+                            _content = (_content as NSString).substring(from: 1)
+                            self.linkType = .URL
+                            self.mouseDownBox = self.linkUrlBox
+                        }
+                    }
+                }
+            } else {
+                _content = "http://"
+                self.linkType = .URL
+                self.mouseDownBox = self.linkUrlBox
+            }
+
+        }
+    }
+
+    override var pdfview: CPDFListView? {
+        get {
+            return _pdfview
+        }
+        set {
+            _pdfview = newValue
+            self.startPage = String(format: "%ld", _pdfview!.currentPageIndex+1)
+        }
+    }
+
+    var isCreateLink: Bool {
+        get {
+            return _isCreateLink
+        }
+        set {
+            _isCreateLink = newValue
+            if _isCreateLink {
+                self.linkType = .Page
+                self.mouseDownBox = self.linkPageBox
+            }
+        }
+    }
+    
+    //MARK: private
+    
+    func createLinkPageView() {
+        self.annotationLinkSelectBox(self.linkPageBox)
+        self.urlLabel.stringValue = NSLocalizedString("Page", comment: "")
+        
+        self.inputUrlTextField.formatter = TextFieldFormatter()
+        if self.pdfview!.document?.pageCount ?? 0 > 1 {
+            self.inputUrlTextField.placeholderString = NSLocalizedString("Enter target page", comment: "")
+        } else {
+            self.inputUrlTextField.placeholderString = "1"
+        }
+        
+        if let destination = self.annotation!.destination() {
+            let pageIndex = destination.pageIndex
+            self.inputUrlTextField.stringValue = "\(pageIndex + 1)"
+            self.pageRecord = "\(pageIndex + 1)"
+        } else {
+            self.pageRecord = "1"
+        }
+        
+        if self.inputUrlTextField.stringValue.count == 0 {
+            self.inputUrlTextField.stringValue = self.pageRecord
+        }
+        
+        self.tagrgetBox.isHidden = false
+        self.pageImageThumible.isHidden = true
+        self.goButton.isHidden = true
+        self.goButtonTopComstraint.constant = 20
+        self.errorLabel.stringValue = NSLocalizedString("Page number out of range", comment: "")
+        
+        if self.inputUrlTextField.stringValue.count == 0 {
+            
+        } else {
+            if let dexPage = Int(self.inputUrlTextField.stringValue) {
+                self.dealThumibleImage(dexPage: UInt(dexPage))
+            }
+        }
+    }
+    
+    func createLinkURLView() {
+        self.annotationLinkSelectBox(self.linkUrlBox)
+        self.urlLabel.stringValue = NSLocalizedString("URL:", comment: "")
+
+        self.inputUrlTextField.formatter = nil
+        self.inputUrlTextField.placeholderString = "https://www.pdfreaderpro.com"
+        
+        if let urlString = self.annotation?.url() {
+            var modifiedURL = urlString
+            if modifiedURL.hasPrefix("http://") {
+                modifiedURL = (modifiedURL as NSString).substring(from: 7)
+            } else if modifiedURL.hasPrefix("https://://") {
+                modifiedURL = (modifiedURL as NSString).substring(from: 8)
+            }
+            self.inputUrlTextField.stringValue = modifiedURL
+            self.urlRecord = modifiedURL
+        }
+        
+        if self.inputUrlTextField.stringValue.count == 0 {
+            self.inputUrlTextField.stringValue = self.urlRecord
+        }
+        
+        self.tagrgetBox.isHidden = true
+        self.pageImageThumible.isHidden = true
+        self.goButton.isHidden = true
+        self.goButtonTopComstraint.constant = -390
+        self.errorLabel.stringValue = NSLocalizedString("Invalid Email. Please re-enter correct email.", comment: "")
+        self.goButton.title = NSLocalizedString("Go", comment: "")
+        self.goButton.attributedTitle = NSAttributedString(string: goButton.title, attributes: [NSAttributedString.Key.foregroundColor: NSColor(red: 23.0/255.0, green: 112.0/255.0, blue: 244.0/255.0, alpha: 1)])
+        
+        if self.inputUrlTextField.stringValue.count > 0 {
+            self.goButton.isHidden = false
+        }
+    }
+    
+    func createLinkEmailView() {
+        self.annotationLinkSelectBox(self.linkEmailBox)
+        self.urlLabel.stringValue = NSLocalizedString("Email:", comment: "")
+        self.inputUrlTextField.formatter = nil
+        self.inputUrlTextField.placeholderString = "support@pdfreaderpro.com"
+        
+        if let urlString = annotation?.url(), urlString.contains("mailto") {
+            if urlString.hasPrefix("mailto:") {
+                let email = String(urlString.suffix(from: urlString.index(urlString.startIndex, offsetBy: 7)))
+                inputUrlTextField.stringValue = email
+                emailRecord = email
+            }
+            
+            if inputUrlTextField.stringValue.isEmpty {
+                inputUrlTextField.stringValue = emailRecord
+            }
+        }
+        
+        tagrgetBox.isHidden = true
+        pageImageThumible.isHidden = true
+        goButton.isHidden = true
+        goButtonTopComstraint.constant = -390
+        errorLabel.stringValue = NSLocalizedString("Invalid Email. Please re-enter correct email.", comment: "")
+        goButton.title = NSLocalizedString("Go", comment: "")
+        goButton.attributedTitle = NSAttributedString(string: goButton.title, attributes: [
+            .foregroundColor: NSColor(red: 23.0/255.0, green: 112.0/255.0, blue: 244.0/255.0, alpha: 1)
+        ])
+        
+        if !inputUrlTextField.stringValue.isEmpty {
+            goButton.isHidden = false
+        }
+    }
+    
+    func isValidateEmail(_ email: String) -> Bool {
+        let emailRegex = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}"
+        let emailTest = NSPredicate(format: "SELF MATCHES %@", emailRegex)
+        return emailTest.evaluate(with: email)
+    }
+
+    func judgeWebURL(_ urlString: String) -> String {
+        var updatedURL = urlString
+        if !updatedURL.hasPrefix("http://") && !updatedURL.hasPrefix("https://") {
+            updatedURL = "https://" + updatedURL
+        }
+        if updatedURL == "https://" {
+            updatedURL = ""
+        }
+        return updatedURL
+    }
+
+    func judgeEmailURL(_ urlString: String) -> String {
+        var updatedURL = urlString
+        if !updatedURL.hasPrefix("mailto:") {
+            updatedURL = "mailto:" + updatedURL
+        }
+        if updatedURL == "mailto:" {
+            updatedURL = ""
+        }
+        return updatedURL
+    }
+    
+    func annotationLinkSelectBox(_ box: KMBox) {
+        if box.isEqual(self.linkPageBox) {
+            self.linkPageBox.fillColor = NSColor.white
+            self.linkEmailBox.fillColor = NSColor.clear
+            self.linkUrlBox.fillColor = NSColor.clear
+            self.linkPageImageView.image = NSImage(named: "KMImageNamePropertybarLinkPageSel")
+            self.linkUrlImageView.image = NSImage(named: "KMImageNamePropertybarLinkUrlNor")
+            self.linkEmailImageView.image = NSImage(named: "KMImageNamePropertybarLinkEmailNor")
+            let dexPage = Int(self.pageRecord) ?? 0
+            if self.pageRecord.count < 1 {
+                return
+            }
+            if dexPage < 1 || dexPage > self.pageCount {
+                self.errorLabel.isHidden = false
+            } else {
+                self.errorLabel.isHidden = true
+            }
+        } else if box.isEqual(self.linkUrlBox) {
+            self.linkUrlBox.fillColor = NSColor.white
+            self.linkEmailBox.fillColor = NSColor.clear
+            self.linkPageBox.fillColor = NSColor.clear
+            self.linkPageImageView.image = NSImage(named: "KMImageNamePropertybarLinkPageNor")
+            self.linkUrlImageView.image = NSImage(named: "KMImageNamePropertybarLinkUrlSel")
+            self.linkEmailImageView.image = NSImage(named: "KMImageNamePropertybarLinkEmailNor")
+            self.errorLabel.isHidden = true
+        } else if box.isEqual(self.linkEmailBox) {
+            self.linkEmailBox.fillColor = NSColor.white
+            self.linkUrlBox.fillColor = NSColor.clear
+            self.linkPageBox.fillColor = NSColor.clear
+            self.linkPageImageView.image = NSImage(named: "KMImageNamePropertybarLinkPageNor")
+            self.linkUrlImageView.image = NSImage(named: "KMImageNamePropertybarLinkUrlNor")
+            self.linkEmailImageView.image = NSImage(named: "KMImageNamePropertybarLinkEmailSel")
+            self.errorLabel.isHidden = true
+        }
+
+        self.updateInputUrlBoxState()
+    }
+    
+    func updateInputUrlBoxState() {
+        DispatchQueue.main.async {
+            if !self.errorLabel.isHidden {
+                self.inputUrlBox.borderColor = self.boxErrorBorderColor
+            } else {
+                self.inputUrlBox.borderColor = self.boxNormalBorderColor
+            }
+        }
+    }
+
+    func updateTargetBoxState(state: KMAnnotationLinkState) {
+        self.targetButtonState = state
+        if Thread.isMainThread {
+            if state == .Normal {
+                self.tagrgetBox.borderColor = self.boxNormalBorderColor
+            } else if state == .Hover {
+                self.tagrgetBox.borderColor = NSColor(red: 104/255.0, green: 172/255.0, blue: 248/255.0, alpha: 1.0)
+            } else if state == .Selected {
+                self.tagrgetBox.borderColor = NSColor(red: 23/255.0, green: 112/255.0, blue: 244/255.0, alpha: 1.0)
+            }
+        } else {
+            DispatchQueue.main.async {
+                if state == .Normal {
+                    self.tagrgetBox.borderColor = self.boxNormalBorderColor
+                } else if state == .Hover {
+                    self.tagrgetBox.borderColor = NSColor(red: 104/255.0, green: 172/255.0, blue: 248/255.0, alpha: 1.0)
+                } else if state == .Selected {
+                    self.tagrgetBox.borderColor = NSColor(red: 23/255.0, green: 112/255.0, blue: 244/255.0, alpha: 1.0)
+                }
+            }
+        }
+    }
+
+    func dealThumibleImage(dexPage: UInt) {
+        if dexPage > 0 && dexPage <= self.pageCount && self.pageRecord.count > 0 {
+            self.pageImageThumible.isHidden = false
+            self.goButton.isHidden = false
+            let goPage = Int(self.inputUrlTextField.stringValue)! - 1
+            if let page = self.pdfview?.document.page(at: UInt(goPage)) {
+                self.pageImageThumible.image = page.thumbnail(of: page.bounds(for: .mediaBox).size)
+            }
+        } else {
+            self.pageImageThumible.isHidden = true
+            self.goButton.isHidden = true
+        }
+    }
+    
+    //MARK: Action
+    
+    @IBAction func goButtonAction(_ sender: NSButton) {
+        switch self.linkType {
+        case .Page:
+            if let linkAnnotation = self.pdfview?.activeAnnotation as? CPDFLinkAnnotation {
+                linkAnnotation.setURL(nil)
+                
+                var dexPage: UInt = 0
+                if self.isGo {
+                    self.isGo = false
+                    self.startPage = "\(self.pdfview!.currentPageIndex + 1)"
+                    if let goPageIndex = UInt(inputUrlTextField.stringValue) {
+                        dexPage = goPageIndex
+                    }
+                    
+                    goButton.title = NSLocalizedString("Go Back", comment: "")
+                    goButton.attributedTitle = NSAttributedString(string: goButton.title, attributes: [
+                        .foregroundColor: NSColor(red: 23.0/255.0, green: 112.0/255.0, blue: 244.0/255.0, alpha: 1)
+                    ])
+                } else {
+                    self.isGo = true
+                    if let startPageIndex = UInt(self.startPage) {
+                        dexPage = startPageIndex
+                    }
+                    
+                    self.goButton.title = NSLocalizedString("Go", comment: "")
+                    self.goButton.attributedTitle = NSAttributedString(string: goButton.title, attributes: [
+                        .foregroundColor: NSColor(red: 23.0/255.0, green: 112.0/255.0, blue: 244.0/255.0, alpha: 1)
+                    ])
+                }
+                
+                if dexPage < 1 || dexPage > self.pageCount {
+                    let alert = NSAlert()
+                    alert.alertStyle = .critical
+                    alert.messageText = NSLocalizedString("Invalid page range or the page number is out of range. Please try again.", comment: "")
+                    alert.runModal()
+                    return
+                }
+                
+                if let goPageIndex = UInt(self.inputUrlTextField.stringValue),
+                   let destination = self.targetDestination ?? CPDFDestination(document: self.pdfview!.document, pageIndex: Int(goPageIndex) - 1) {
+                    linkAnnotation.setDestination(destination)
+                    self.pdfview!.setNeedsDisplay(self.annotation)
+                    
+                    if self.isGo, let startDest = self.startDestination {
+                        self.pdfview!.go(to: startDest)
+                        return
+                    } else if let targetDest = targetDestination {
+                        self.pdfview!.go(to: targetDest)
+                        return
+                    }
+                    
+                    if let dest = CPDFDestination(document: self.pdfview!.document, pageIndex: Int(dexPage) - 1) {
+                        self.pdfview!.go(toPageIndex: dest.pageIndex, animated: true)
+                    }
+                }
+            }
+            
+            self.updateTargetBoxState(state: .Selected)
+            self.pdfview!.isSetLinkDestinationArea = true
+
+        case .URL:
+            if let linkAnnotation = self.pdfview!.activeAnnotation as? CPDFLinkAnnotation {
+                linkAnnotation.setDestination(nil)
+                let linkUrlPath = self.judgeWebURL(inputUrlTextField.stringValue)
+                linkAnnotation.setURL(linkUrlPath)
+                self.pdfview!.setNeedsDisplay(self.annotation)
+                
+                if let url = URL(string: linkAnnotation.url() ?? "") {
+                    NSWorkspace.shared.open(url)
+                }
+            }
+        case .Email:
+            if let linkAnnotation = self.pdfview?.activeAnnotation as? CPDFLinkAnnotation {
+                linkAnnotation.setDestination(nil)
+                
+                if !isValidateEmail(inputUrlTextField.stringValue) {
+                    let alert = NSAlert()
+                    alert.alertStyle = .critical
+                    alert.messageText = NSLocalizedString("Invalid email address. Please enter a valid email address.", comment: "")
+                    alert.runModal()
+                    return
+                }
+                
+                let linkUrlPath = self.judgeEmailURL(self.inputUrlTextField.stringValue)
+                linkAnnotation.setURL(linkUrlPath)
+                self.pdfview!.setNeedsDisplay(self.annotation)
+                
+                if let url = URL(string: linkAnnotation.url() ?? "") {
+                    NSWorkspace.shared.open(url)
+                }
+            }
+        default:
+            break
+        }
+    }
+    
+    
+}
+
+extension KMAnnotationLinkViewController: NSTextFieldDelegate {
+    @objc func controlTextDidChange(_ obj: Notification) {
+        guard let textField = obj.object as? NSTextField else {
+            return
+        }
+
+        self.errorLabel.isHidden = true
+        if self.mouseDownBox == self.linkPageBox {
+            self.pageRecord = textField.stringValue
+        } else if self.mouseDownBox == self.linkUrlBox {
+            self.urlRecord = textField.stringValue
+        } else if mouseDownBox == linkEmailBox {
+            self.emailRecord = textField.stringValue
+        }
+
+        if self.linkType == .Page {
+            (self.pdfview?.activeAnnotation as! CPDFLinkAnnotation as CPDFLinkAnnotation).setURL(nil)
+            let dexPage = Int(self.inputUrlTextField.stringValue) ?? 1
+            if (dexPage < 1 || dexPage > self.pageCount) && self.pageRecord.count > 0 {
+                (self.pdfview?.activeAnnotation as? CPDFLinkAnnotation)?.setDestination(nil)
+                self.errorLabel.isHidden = false
+                self.dealThumibleImage(dexPage: UInt(dexPage))
+                self.updateInputUrlBoxState()
+                return
+            } else if self.pageRecord.count > 0 {
+                self.errorLabel.isHidden = true
+            }
+            let page: CPDFPage = (self.pdfview?.document.page(at: UInt(dexPage - 1)))!
+            let destination: CPDFDestination = CPDFDestination(document: self.pdfview!.document, pageIndex: dexPage - 1, at: CGPoint(x: 0, y: page.bounds.size.height), zoom: self.pdfview!.scaleFactor)
+            (self.pdfview?.activeAnnotation as? CPDFLinkAnnotation)?.setDestination(destination)
+            self.pdfview?.setNeedsDisplayAnnotationViewFor(self.pdfview?.activeAnnotation.page)
+            
+            // 显示预览图
+            self.dealThumibleImage(dexPage: UInt(dexPage))
+            self.updateInputUrlBoxState()
+        } else if self.linkType == .URL {
+            (pdfview?.activeAnnotation as? CPDFLinkAnnotation)?.setDestination(nil)
+            let linkUrlPath: String = self.urlRecord
+            if linkUrlPath == "" {
+                (self.pdfview?.activeAnnotation as? CPDFLinkAnnotation)?.setURL(nil)
+            } else {
+                (self.pdfview?.activeAnnotation as? CPDFLinkAnnotation)?.setURL(linkUrlPath)
+            }
+            self.pdfview?.setNeedsDisplayAnnotationViewFor(self.pdfview?.activeAnnotation.page)
+        } else if self.linkType == .Email {
+            (self.pdfview?.activeAnnotation as? CPDFLinkAnnotation)?.setDestination(nil)
+            let linkUrlPath = self.judgeEmailURL(self.emailRecord)
+            if linkUrlPath == "" {
+                (self.pdfview?.activeAnnotation as? CPDFLinkAnnotation)?.setURL(nil)
+            } else {
+                (self.pdfview?.activeAnnotation as? CPDFLinkAnnotation)?.setURL(linkUrlPath)
+            }
+            self.pdfview?.setNeedsDisplayAnnotationViewFor(pdfview?.activeAnnotation.page)
+        }
+    }
+    
+    func control(_ control: NSControl, textView: NSTextView, doCommandBy commandSelector: Selector) -> Bool {
+        if commandSelector == #selector(insertNewline(_:)) {
+            self.view.window?.makeFirstResponder(self.pdfview)
+            return true
+        }
+        return false
+    }
+
+    override func mouseDown(with event: NSEvent) {
+        super.mouseDown(with: event)
+        
+        self.view.window?.makeFirstResponder(self.pdfview)
+    }
+}

+ 9 - 9
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMAnnotationLinkViewController.xib

@@ -1,19 +1,19 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22154" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22154"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
-        <customObject id="-2" userLabel="File's Owner" customClass="KMAnnotationLinkViewController">
+        <customObject id="-2" userLabel="File's Owner" customClass="KMAnnotationLinkViewController" customModule="PDF_Master" customModuleProvider="target">
             <connections>
                 <outlet property="contentBox" destination="94r-0f-N69" id="Fy4-rc-5Tb"/>
                 <outlet property="errorLabel" destination="2yT-h2-4Do" id="PDb-xn-rUj"/>
                 <outlet property="goButton" destination="TsP-Zh-f0P" id="1Iy-J0-SZr"/>
                 <outlet property="goButtonTopComstraint" destination="UJZ-v2-jlA" id="Pi8-k7-Amh"/>
                 <outlet property="inputUrlBox" destination="bVE-f9-ez4" id="fhQ-zV-pzl"/>
-                <outlet property="inputUrlTextField" destination="Yob-EH-V55" id="WKr-G8-aaB"/>
+                <outlet property="inputUrlTextField" destination="Yob-EH-V55" id="la2-aw-2ZL"/>
                 <outlet property="linkEmailBox" destination="gpf-Ry-9Ts" id="DeX-UD-B8o"/>
                 <outlet property="linkEmailImageView" destination="UN1-b0-bTv" id="tLT-Og-HLk"/>
                 <outlet property="linkPageBox" destination="zgu-Qr-Ncj" id="3mr-4u-KVj"/>
@@ -137,7 +137,7 @@
                                                 <customView translatesAutoresizingMaskIntoConstraints="NO" id="620-dg-Oal">
                                                     <rect key="frame" x="0.0" y="0.0" width="241" height="62"/>
                                                     <subviews>
-                                                        <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="xvX-qn-QjN">
+                                                        <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="xvX-qn-QjN">
                                                             <rect key="frame" x="-2" y="44" width="37" height="18"/>
                                                             <constraints>
                                                                 <constraint firstAttribute="height" constant="18" id="FeU-MA-ANP"/>
@@ -154,7 +154,7 @@
                                                                 <rect key="frame" x="1" y="1" width="239" height="30"/>
                                                                 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                                                 <subviews>
-                                                                    <textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Yob-EH-V55">
+                                                                    <textField focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Yob-EH-V55">
                                                                         <rect key="frame" x="8" y="7" width="223" height="16"/>
                                                                         <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" alignment="left" drawsBackground="YES" id="cAq-l1-e8L">
                                                                             <font key="font" metaFont="system"/>
@@ -193,7 +193,7 @@
                                         </view>
                                         <color key="fillColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
                                     </box>
-                                    <textField hidden="YES" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="2yT-h2-4Do">
+                                    <textField hidden="YES" focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="2yT-h2-4Do">
                                         <rect key="frame" x="-2" y="528" width="35" height="15"/>
                                         <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="Bs1-Ow-Dc4">
                                             <font key="font" metaFont="cellTitle"/>
@@ -247,7 +247,7 @@
                                                     </constraints>
                                                     <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="KMImagePropertPanelADDLocation" id="Pa9-LN-oi0"/>
                                                 </imageView>
-                                                <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="9ys-US-7EM">
+                                                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="9ys-US-7EM">
                                                     <rect key="frame" x="43" y="7" width="193" height="17"/>
                                                     <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="Ms7-0i-eJz">
                                                         <font key="font" metaFont="system" size="14"/>
@@ -262,7 +262,7 @@
                                                         <font key="font" metaFont="system"/>
                                                     </buttonCell>
                                                     <connections>
-                                                        <action selector="goButtonAction:" target="-2" id="dzJ-gv-tf7"/>
+                                                        <action selector="goButtonAction:" target="-2" id="WDl-oN-wXb"/>
                                                     </connections>
                                                 </button>
                                             </subviews>

+ 4 - 5
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMAnnotationPropertiesViewController.m

@@ -7,7 +7,7 @@
 
 #import "KMAnnotationPropertiesViewController.h"
 #import "KMGeneralAnnotationViewController.h"
-#import "KMAnnotationLinkViewController.h"
+//#import "NSString_SKExtensions.h"
 #import "KMAnnotationStampViewController.h"
 #import <PDF_Master-Swift.h>
 #import "KMSignatureAnnotationViewController.h"
@@ -212,8 +212,10 @@
         }
         
         KMAnnotationLinkViewController *vc = [[KMAnnotationLinkViewController alloc] init];
-        vc.annotationModel = annotationModel;
         vc.pdfview = self.pdfView;
+        vc.annotationModel = annotationModel;
+        self.propertiesBox.contentView = vc.view;
+        self.contentViewController = vc;
         vc.pageCount = self.pdfView.document.pageCount;
         [vc setContent:contents];
         vc.startDestination = [[CPDFDestination alloc] initWithDocument:self.pdfView.document pageIndex:linkAnnotation.page.pageIndex atPoint:linkAnnotation.bounds.origin zoom:self.pdfView.scaleFactor];
@@ -221,9 +223,6 @@
             CPDFDestination *des = linkAnnotation.destination;
             vc.targetDestination = [[CPDFDestination alloc] initWithDocument:des.document pageIndex:des.pageIndex atPoint:des.point zoom:des.zoom];
         }
-        
-        self.propertiesBox.contentView = vc.view;
-        self.contentViewController = vc;
     } else if ([annotation isKindOfClass:[CSelfSignAnnotation class]]) {
         CSelfSignAnnotation *newAnnotation = (CSelfSignAnnotation *)annotation;
         if (newAnnotation.annotationType == CAnnotationTypeSignFalse ||