Pārlūkot izejas kodu

CPDFView(iOS) - 新项目架构构建

yangliuhua 5 mēneši atpakaļ
vecāks
revīzija
4961fbc927
100 mainītis faili ar 0 papildinājumiem un 16199 dzēšanām
  1. 0 470
      Annotations/Annotations.xcodeproj/project.pbxproj
  2. 0 18
      Annotations/Annotations/Annotations.entitlements
  3. 0 24
      Annotations/Annotations/AppDelegate.h
  4. 0 118
      Annotations/Annotations/AppDelegate.m
  5. 0 21
      Annotations/Annotations/CPDFViewController.h
  6. 0 549
      Annotations/Annotations/CPDFViewController.m
  7. 0 23
      Annotations/Annotations/Info.plist
  8. 0 20
      Annotations/Annotations/SceneDelegate.h
  9. 0 63
      Annotations/Annotations/SceneDelegate.m
  10. 0 23
      Annotations/Annotations/main.m
  11. 0 2118
      ComPDFKit_Tools/ComPDFKit_Tools.xcodeproj/project.pbxproj
  12. 0 24
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnatationList/CAnnotListHeaderInSection.h
  13. 0 117
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnatationList/CAnnotListHeaderInSection.m
  14. 0 34
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnatationList/CPDFAnnotationListCell.h
  15. 0 295
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnatationList/CPDFAnnotationListCell.m
  16. 0 37
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnatationList/CPDFAnnotationViewController.h
  17. 0 319
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnatationList/CPDFAnnotationViewController.m
  18. 0 33
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnatationList/CPDFAnnotionColorDrawView.h
  19. 0 58
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnatationList/CPDFAnnotionColorDrawView.m
  20. 0 23
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationBar/CPDFAnnotationBarButton.h
  21. 0 63
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationBar/CPDFAnnotationBarButton.m
  22. 0 87
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationBar/CPDFAnnotationToolBar.h
  23. 0 1077
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationBar/CPDFAnnotationToolBar.m
  24. 0 81
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFAnnotationManage/CAnnotStyle.h
  25. 0 997
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFAnnotationManage/CAnnotStyle.m
  26. 0 61
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFAnnotationManage/CAnnotationManage.h
  27. 0 112
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFAnnotationManage/CAnnotationManage.m
  28. 0 19
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFAnnotationManage/CPDFListViewAnnotationConfig.h
  29. 0 30
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFAnnotationManage/CPDFListViewAnnotationConfig.m
  30. 0 117
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFAnnotationManage/CStringConstants.h
  31. 0 118
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFAnnotationManage/CStringConstants.m
  32. 0 27
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFBase/CPDFAnnotationBaseViewController.h
  33. 0 211
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFBase/CPDFAnnotationBaseViewController.m
  34. 0 47
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFBase/CPDFAnnotationBaseViewController_Header.h
  35. 0 37
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFFreeText/CPDFFreeTextViewController.h
  36. 0 476
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFFreeText/CPDFFreeTextViewController.m
  37. 0 34
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFHighlight/CPDFHighlightViewController.h
  38. 0 97
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFHighlight/CPDFHighlightViewController.m
  39. 0 38
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFInk/CPDFDrawPencilKitFuncView.h
  40. 0 178
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFInk/CPDFDrawPencilKitFuncView.m
  41. 0 44
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFInk/CPDFInkTopToolBar.h
  42. 0 154
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFInk/CPDFInkTopToolBar.m
  43. 0 36
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFInk/CPDFInkViewController.h
  44. 0 170
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFInk/CPDFInkViewController.m
  45. 0 47
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFLink/CPDFFormLinkViewController.h
  46. 0 417
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFLink/CPDFFormLinkViewController.m
  47. 0 50
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFLink/CPDFLinkViewController.h
  48. 0 488
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFLink/CPDFLinkViewController.m
  49. 0 40
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFNote/CPDFNoteOpenViewController.h
  50. 0 211
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFNote/CPDFNoteOpenViewController.m
  51. 0 38
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFNote/CPDFNoteViewController.h
  52. 0 185
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFNote/CPDFNoteViewController.m
  53. 0 34
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFShape/CPDFShapeArrowViewController.h
  54. 0 355
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFShape/CPDFShapeArrowViewController.m
  55. 0 34
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFShape/CPDFShapeCircleViewController.h
  56. 0 334
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFShape/CPDFShapeCircleViewController.m
  57. 0 35
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFShape/CPDFShareCircleViewController_Header.h
  58. 0 40
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFShape/CShapeSelectView.h
  59. 0 83
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFShape/CShapeSelectView.m
  60. 0 25
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFShape/Line/CPDFArrowStyleCell.h
  61. 0 31
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFShape/Line/CPDFArrowStyleCell.m
  62. 0 39
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFShape/Line/CPDFArrowStyleView.h
  63. 0 122
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFShape/Line/CPDFArrowStyleView.m
  64. 0 34
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFShape/Line/CPDFDrawArrowView.h
  65. 0 118
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFShape/Line/CPDFDrawArrowView.m
  66. 0 39
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFSignature/CPDFSignatureEditViewController.h
  67. 0 658
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFSignature/CPDFSignatureEditViewController.m
  68. 0 35
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFSignature/CPDFSignatureViewCell.h
  69. 0 68
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFSignature/CPDFSignatureViewCell.m
  70. 0 42
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFSignature/CPDFSignatureViewController.h
  71. 0 235
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFSignature/CPDFSignatureViewController.m
  72. 0 50
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFSignature/CSignatureDrawView.h
  73. 0 196
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFSignature/CSignatureDrawView.m
  74. 0 33
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFSignature/CSignatureManager.h
  75. 0 114
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFSignature/CSignatureManager.m
  76. 0 16
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFSignature/CSignatureTextField.h
  77. 0 28
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFSignature/CSignatureTextField.m
  78. 0 16
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFSignature/SignatureCustomPresentationController.h
  79. 0 362
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFSignature/SignatureCustomPresentationController.m
  80. 0 33
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFSound/CPDFMediaManager.h
  81. 0 26
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFSound/CPDFMediaManager.m
  82. 0 62
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFSound/CPDFSoundPlayBar.h
  83. 0 373
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFSound/CPDFSoundPlayBar.m
  84. 0 34
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFSquiggly/CPDFSquigglyViewController.h
  85. 0 98
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFSquiggly/CPDFSquigglyViewController.m
  86. 0 35
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFStamp/CCustomizeStampTableViewCell.h
  87. 0 68
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFStamp/CCustomizeStampTableViewCell.m
  88. 0 45
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFStamp/CPDFStampViewController.h
  89. 0 759
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFStamp/CPDFStampViewController.m
  90. 0 25
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFStamp/CStampButton.h
  91. 0 40
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFStamp/CStampButton.m
  92. 0 58
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFStamp/CStampCollectionViewCell.h
  93. 0 143
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFStamp/CStampCollectionViewCell.m
  94. 0 37
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFStamp/CStampColorSelectView.h
  95. 0 117
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFStamp/CStampColorSelectView.m
  96. 0 50
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFStamp/CStampFileManger.h
  97. 0 297
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFStamp/CStampFileManger.m
  98. 0 60
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFStamp/CStampPreview.h
  99. 0 489
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFStamp/CStampPreview.m
  100. 0 0
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFStamp/CStampShapView.h

+ 0 - 470
Annotations/Annotations.xcodeproj/project.pbxproj

@@ -1,470 +0,0 @@
-// !$*UTF8*$!
-{
-	archiveVersion = 1;
-	classes = {
-	};
-	objectVersion = 55;
-	objects = {
-
-/* Begin PBXBuildFile section */
-		4F06AB5D29F6852C007797E4 /* CPDFViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F06AB5C29F6852C007797E4 /* CPDFViewController.m */; };
-		C931D07E2A860B9100921918 /* license_key_ios.xml in Resources */ = {isa = PBXBuildFile; fileRef = C931D07D2A860B9100921918 /* license_key_ios.xml */; };
-		C9AF185129F267DD00EC4979 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C9AF185029F267DD00EC4979 /* AppDelegate.m */; };
-		C9AF185429F267DD00EC4979 /* SceneDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C9AF185329F267DD00EC4979 /* SceneDelegate.m */; };
-		C9AF185A29F267DD00EC4979 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C9AF185829F267DD00EC4979 /* Main.storyboard */; };
-		C9AF185C29F267E000EC4979 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C9AF185B29F267E000EC4979 /* Assets.xcassets */; };
-		C9AF185F29F267E000EC4979 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C9AF185D29F267E000EC4979 /* LaunchScreen.storyboard */; };
-		C9AF186229F267E000EC4979 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = C9AF186129F267E000EC4979 /* main.m */; };
-		C9AF187C29F26ADF00EC4979 /* Form_Widgets_Test.pdf in Resources */ = {isa = PBXBuildFile; fileRef = C9AF187829F26ADF00EC4979 /* Form_Widgets_Test.pdf */; };
-		C9AF187D29F26ADF00EC4979 /* PDF32000_2008.pdf in Resources */ = {isa = PBXBuildFile; fileRef = C9AF187929F26ADF00EC4979 /* PDF32000_2008.pdf */; };
-		F32776912A04A6D900C5F0A6 /* ComPDFKit.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = C918CEBB29F904E400D43974 /* ComPDFKit.xcframework */; };
-		F32776922A04A6D900C5F0A6 /* ComPDFKit.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C918CEBB29F904E400D43974 /* ComPDFKit.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
-		F384DB182A48208100798045 /* developer_guide_ios.pdf in Resources */ = {isa = PBXBuildFile; fileRef = F384DB172A48208100798045 /* developer_guide_ios.pdf */; };
-		F384DB872A49369400798045 /* XMLReader.m in Sources */ = {isa = PBXBuildFile; fileRef = F384DB852A49369400798045 /* XMLReader.m */; };
-		F3C0CC582A4321B700007C0A /* ComPDFKit_Tools.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F3C0CC572A4321B700007C0A /* ComPDFKit_Tools.framework */; };
-		F3C0CC592A4321B700007C0A /* ComPDFKit_Tools.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = F3C0CC572A4321B700007C0A /* ComPDFKit_Tools.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
-/* End PBXBuildFile section */
-
-/* Begin PBXCopyFilesBuildPhase section */
-		C9AF188429F26B4D00EC4979 /* Embed Frameworks */ = {
-			isa = PBXCopyFilesBuildPhase;
-			buildActionMask = 2147483647;
-			dstPath = "";
-			dstSubfolderSpec = 10;
-			files = (
-				F3C0CC592A4321B700007C0A /* ComPDFKit_Tools.framework in Embed Frameworks */,
-				F32776922A04A6D900C5F0A6 /* ComPDFKit.xcframework in Embed Frameworks */,
-			);
-			name = "Embed Frameworks";
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXCopyFilesBuildPhase section */
-
-/* Begin PBXFileReference section */
-		4F06AB5B29F6852C007797E4 /* CPDFViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPDFViewController.h; sourceTree = "<group>"; };
-		4F06AB5C29F6852C007797E4 /* CPDFViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPDFViewController.m; sourceTree = "<group>"; };
-		C918CEBB29F904E400D43974 /* ComPDFKit.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = ComPDFKit.xcframework; path = ../Lib/ComPDFKit.xcframework; sourceTree = "<group>"; };
-		C931D07D2A860B9100921918 /* license_key_ios.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = license_key_ios.xml; path = ../license_key_ios.xml; sourceTree = "<group>"; };
-		C9AF184C29F267DD00EC4979 /* Annotations.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Annotations.app; sourceTree = BUILT_PRODUCTS_DIR; };
-		C9AF184F29F267DD00EC4979 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
-		C9AF185029F267DD00EC4979 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
-		C9AF185229F267DD00EC4979 /* SceneDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SceneDelegate.h; sourceTree = "<group>"; };
-		C9AF185329F267DD00EC4979 /* SceneDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SceneDelegate.m; sourceTree = "<group>"; };
-		C9AF185929F267DD00EC4979 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
-		C9AF185B29F267E000EC4979 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
-		C9AF185E29F267E000EC4979 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
-		C9AF186029F267E000EC4979 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
-		C9AF186129F267E000EC4979 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
-		C9AF187829F26ADF00EC4979 /* Form_Widgets_Test.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = Form_Widgets_Test.pdf; sourceTree = "<group>"; };
-		C9AF187929F26ADF00EC4979 /* PDF32000_2008.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = PDF32000_2008.pdf; sourceTree = "<group>"; };
-		F384DB172A48208100798045 /* developer_guide_ios.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = developer_guide_ios.pdf; sourceTree = "<group>"; };
-		F384DB852A49369400798045 /* XMLReader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XMLReader.m; sourceTree = "<group>"; };
-		F384DB862A49369400798045 /* XMLReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLReader.h; sourceTree = "<group>"; };
-		F384DBB72A4B012B00798045 /* Annotations.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Annotations.entitlements; sourceTree = "<group>"; };
-		F3C0CC572A4321B700007C0A /* ComPDFKit_Tools.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = ComPDFKit_Tools.framework; sourceTree = BUILT_PRODUCTS_DIR; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
-		C9AF184929F267DD00EC4979 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				F3C0CC582A4321B700007C0A /* ComPDFKit_Tools.framework in Frameworks */,
-				F32776912A04A6D900C5F0A6 /* ComPDFKit.xcframework in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
-		C918CEB029F903CF00D43974 /* Frameworks */ = {
-			isa = PBXGroup;
-			children = (
-				F3C0CC572A4321B700007C0A /* ComPDFKit_Tools.framework */,
-				C918CEBB29F904E400D43974 /* ComPDFKit.xcframework */,
-			);
-			name = Frameworks;
-			sourceTree = "<group>";
-		};
-		C9AF184329F267DD00EC4979 = {
-			isa = PBXGroup;
-			children = (
-				C931D07D2A860B9100921918 /* license_key_ios.xml */,
-				F384DB5C2A48238500798045 /* XMLParse */,
-				C9AF187729F26ADF00EC4979 /* TestFile */,
-				C9AF184E29F267DD00EC4979 /* Annotations */,
-				C9AF184D29F267DD00EC4979 /* Products */,
-				C918CEB029F903CF00D43974 /* Frameworks */,
-			);
-			sourceTree = "<group>";
-		};
-		C9AF184D29F267DD00EC4979 /* Products */ = {
-			isa = PBXGroup;
-			children = (
-				C9AF184C29F267DD00EC4979 /* Annotations.app */,
-			);
-			name = Products;
-			sourceTree = "<group>";
-		};
-		C9AF184E29F267DD00EC4979 /* Annotations */ = {
-			isa = PBXGroup;
-			children = (
-				F384DBB72A4B012B00798045 /* Annotations.entitlements */,
-				C9AF184F29F267DD00EC4979 /* AppDelegate.h */,
-				C9AF185029F267DD00EC4979 /* AppDelegate.m */,
-				C9AF185229F267DD00EC4979 /* SceneDelegate.h */,
-				C9AF185329F267DD00EC4979 /* SceneDelegate.m */,
-				4F06AB5B29F6852C007797E4 /* CPDFViewController.h */,
-				4F06AB5C29F6852C007797E4 /* CPDFViewController.m */,
-				C9AF185829F267DD00EC4979 /* Main.storyboard */,
-				C9AF185B29F267E000EC4979 /* Assets.xcassets */,
-				C9AF185D29F267E000EC4979 /* LaunchScreen.storyboard */,
-				C9AF186029F267E000EC4979 /* Info.plist */,
-				C9AF186129F267E000EC4979 /* main.m */,
-			);
-			path = Annotations;
-			sourceTree = "<group>";
-		};
-		C9AF187729F26ADF00EC4979 /* TestFile */ = {
-			isa = PBXGroup;
-			children = (
-				F384DB172A48208100798045 /* developer_guide_ios.pdf */,
-				C9AF187829F26ADF00EC4979 /* Form_Widgets_Test.pdf */,
-				C9AF187929F26ADF00EC4979 /* PDF32000_2008.pdf */,
-			);
-			name = TestFile;
-			path = ../TestFile;
-			sourceTree = "<group>";
-		};
-		F384DB5C2A48238500798045 /* XMLParse */ = {
-			isa = PBXGroup;
-			children = (
-				F384DB862A49369400798045 /* XMLReader.h */,
-				F384DB852A49369400798045 /* XMLReader.m */,
-			);
-			name = XMLParse;
-			path = ../XMLParse;
-			sourceTree = "<group>";
-		};
-/* End PBXGroup section */
-
-/* Begin PBXNativeTarget section */
-		C9AF184B29F267DD00EC4979 /* Annotations */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = C9AF186529F267E000EC4979 /* Build configuration list for PBXNativeTarget "Annotations" */;
-			buildPhases = (
-				C9AF184829F267DD00EC4979 /* Sources */,
-				C9AF184929F267DD00EC4979 /* Frameworks */,
-				C9AF184A29F267DD00EC4979 /* Resources */,
-				C9AF188429F26B4D00EC4979 /* Embed Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = Annotations;
-			productName = "Annotation-Ctrl-Demo";
-			productReference = C9AF184C29F267DD00EC4979 /* Annotations.app */;
-			productType = "com.apple.product-type.application";
-		};
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
-		C9AF184429F267DD00EC4979 /* Project object */ = {
-			isa = PBXProject;
-			attributes = {
-				BuildIndependentTargetsInParallel = 1;
-				LastUpgradeCheck = 1420;
-				TargetAttributes = {
-					C9AF184B29F267DD00EC4979 = {
-						CreatedOnToolsVersion = 14.2;
-					};
-				};
-			};
-			buildConfigurationList = C9AF184729F267DD00EC4979 /* Build configuration list for PBXProject "Annotations" */;
-			compatibilityVersion = "Xcode 13.0";
-			developmentRegion = en;
-			hasScannedForEncodings = 0;
-			knownRegions = (
-				en,
-				Base,
-			);
-			mainGroup = C9AF184329F267DD00EC4979;
-			productRefGroup = C9AF184D29F267DD00EC4979 /* Products */;
-			projectDirPath = "";
-			projectRoot = "";
-			targets = (
-				C9AF184B29F267DD00EC4979 /* Annotations */,
-			);
-		};
-/* End PBXProject section */
-
-/* Begin PBXResourcesBuildPhase section */
-		C9AF184A29F267DD00EC4979 /* Resources */ = {
-			isa = PBXResourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				C9AF187C29F26ADF00EC4979 /* Form_Widgets_Test.pdf in Resources */,
-				C9AF185F29F267E000EC4979 /* LaunchScreen.storyboard in Resources */,
-				F384DB182A48208100798045 /* developer_guide_ios.pdf in Resources */,
-				C931D07E2A860B9100921918 /* license_key_ios.xml in Resources */,
-				C9AF185C29F267E000EC4979 /* Assets.xcassets in Resources */,
-				C9AF185A29F267DD00EC4979 /* Main.storyboard in Resources */,
-				C9AF187D29F26ADF00EC4979 /* PDF32000_2008.pdf in Resources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXResourcesBuildPhase section */
-
-/* Begin PBXSourcesBuildPhase section */
-		C9AF184829F267DD00EC4979 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				4F06AB5D29F6852C007797E4 /* CPDFViewController.m in Sources */,
-				C9AF185129F267DD00EC4979 /* AppDelegate.m in Sources */,
-				F384DB872A49369400798045 /* XMLReader.m in Sources */,
-				C9AF186229F267E000EC4979 /* main.m in Sources */,
-				C9AF185429F267DD00EC4979 /* SceneDelegate.m in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXSourcesBuildPhase section */
-
-/* Begin PBXVariantGroup section */
-		C9AF185829F267DD00EC4979 /* Main.storyboard */ = {
-			isa = PBXVariantGroup;
-			children = (
-				C9AF185929F267DD00EC4979 /* Base */,
-			);
-			name = Main.storyboard;
-			sourceTree = "<group>";
-		};
-		C9AF185D29F267E000EC4979 /* LaunchScreen.storyboard */ = {
-			isa = PBXVariantGroup;
-			children = (
-				C9AF185E29F267E000EC4979 /* Base */,
-			);
-			name = LaunchScreen.storyboard;
-			sourceTree = "<group>";
-		};
-/* End PBXVariantGroup section */
-
-/* Begin XCBuildConfiguration section */
-		C9AF186329F267E000EC4979 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ALWAYS_SEARCH_USER_PATHS = NO;
-				CLANG_ANALYZER_NONNULL = YES;
-				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
-				CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
-				CLANG_ENABLE_MODULES = YES;
-				CLANG_ENABLE_OBJC_ARC = YES;
-				CLANG_ENABLE_OBJC_WEAK = YES;
-				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
-				CLANG_WARN_BOOL_CONVERSION = YES;
-				CLANG_WARN_COMMA = YES;
-				CLANG_WARN_CONSTANT_CONVERSION = YES;
-				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
-				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
-				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
-				CLANG_WARN_EMPTY_BODY = YES;
-				CLANG_WARN_ENUM_CONVERSION = YES;
-				CLANG_WARN_INFINITE_RECURSION = YES;
-				CLANG_WARN_INT_CONVERSION = YES;
-				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
-				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
-				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
-				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
-				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
-				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
-				CLANG_WARN_STRICT_PROTOTYPES = YES;
-				CLANG_WARN_SUSPICIOUS_MOVE = YES;
-				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
-				CLANG_WARN_UNREACHABLE_CODE = YES;
-				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
-				COPY_PHASE_STRIP = NO;
-				DEBUG_INFORMATION_FORMAT = dwarf;
-				ENABLE_STRICT_OBJC_MSGSEND = YES;
-				ENABLE_TESTABILITY = YES;
-				GCC_C_LANGUAGE_STANDARD = gnu11;
-				GCC_DYNAMIC_NO_PIC = NO;
-				GCC_NO_COMMON_BLOCKS = YES;
-				GCC_OPTIMIZATION_LEVEL = 0;
-				GCC_PREPROCESSOR_DEFINITIONS = (
-					"DEBUG=1",
-					"$(inherited)",
-				);
-				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
-				GCC_WARN_UNDECLARED_SELECTOR = YES;
-				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
-				GCC_WARN_UNUSED_FUNCTION = YES;
-				GCC_WARN_UNUSED_VARIABLE = YES;
-				IPHONEOS_DEPLOYMENT_TARGET = 16.2;
-				MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
-				MTL_FAST_MATH = YES;
-				ONLY_ACTIVE_ARCH = YES;
-				SDKROOT = iphoneos;
-			};
-			name = Debug;
-		};
-		C9AF186429F267E000EC4979 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ALWAYS_SEARCH_USER_PATHS = NO;
-				CLANG_ANALYZER_NONNULL = YES;
-				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
-				CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
-				CLANG_ENABLE_MODULES = YES;
-				CLANG_ENABLE_OBJC_ARC = YES;
-				CLANG_ENABLE_OBJC_WEAK = YES;
-				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
-				CLANG_WARN_BOOL_CONVERSION = YES;
-				CLANG_WARN_COMMA = YES;
-				CLANG_WARN_CONSTANT_CONVERSION = YES;
-				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
-				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
-				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
-				CLANG_WARN_EMPTY_BODY = YES;
-				CLANG_WARN_ENUM_CONVERSION = YES;
-				CLANG_WARN_INFINITE_RECURSION = YES;
-				CLANG_WARN_INT_CONVERSION = YES;
-				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
-				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
-				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
-				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
-				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
-				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
-				CLANG_WARN_STRICT_PROTOTYPES = YES;
-				CLANG_WARN_SUSPICIOUS_MOVE = YES;
-				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
-				CLANG_WARN_UNREACHABLE_CODE = YES;
-				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
-				COPY_PHASE_STRIP = NO;
-				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-				ENABLE_NS_ASSERTIONS = NO;
-				ENABLE_STRICT_OBJC_MSGSEND = YES;
-				GCC_C_LANGUAGE_STANDARD = gnu11;
-				GCC_NO_COMMON_BLOCKS = YES;
-				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
-				GCC_WARN_UNDECLARED_SELECTOR = YES;
-				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
-				GCC_WARN_UNUSED_FUNCTION = YES;
-				GCC_WARN_UNUSED_VARIABLE = YES;
-				IPHONEOS_DEPLOYMENT_TARGET = 16.2;
-				MTL_ENABLE_DEBUG_INFO = NO;
-				MTL_FAST_MATH = YES;
-				SDKROOT = iphoneos;
-				VALIDATE_PRODUCT = YES;
-			};
-			name = Release;
-		};
-		C9AF186629F267E000EC4979 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
-				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
-				CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
-				CODE_SIGN_ENTITLEMENTS = Annotations/Annotations.entitlements;
-				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 1;
-				DEVELOPMENT_TEAM = 4GGQPGRTSV;
-				ENABLE_BITCODE = NO;
-				GENERATE_INFOPLIST_FILE = YES;
-				INFOPLIST_FILE = Annotations/Info.plist;
-				INFOPLIST_KEY_CFBundleDisplayName = Annotations_ComPDFKit;
-				INFOPLIST_KEY_NSBluetoothPeripheralUsageDescription = "Your consent is required before you could access the function.";
-				INFOPLIST_KEY_NSCalendarsUsageDescription = "Your consent is required before you could access the function.";
-				INFOPLIST_KEY_NSCameraUsageDescription = "Your consent is required before you could access the function.";
-				INFOPLIST_KEY_NSContactsUsageDescription = "Your consent is required before you could access the function.";
-				INFOPLIST_KEY_NSLocationAlwaysUsageDescription = "Your consent is required before you could access the function.";
-				INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "Your consent is required before you could access the function.";
-				INFOPLIST_KEY_NSMicrophoneUsageDescription = "Your consent is required before you could access the function.";
-				INFOPLIST_KEY_NSPhotoLibraryAddUsageDescription = "Enable camera access so that you can create scans with your camera.";
-				INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "Your consent is required before you could access the function.";
-				INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
-				INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
-				INFOPLIST_KEY_UIMainStoryboardFile = Main;
-				INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
-				INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
-				IPHONEOS_DEPLOYMENT_TARGET = 10.0;
-				LD_RUNPATH_SEARCH_PATHS = (
-					"$(inherited)",
-					"@executable_path/Frameworks",
-				);
-				MARKETING_VERSION = 1.0;
-				PRODUCT_BUNDLE_IDENTIFIER = com.compdfkit.annotations;
-				PRODUCT_NAME = "$(TARGET_NAME)";
-				SWIFT_EMIT_LOC_STRINGS = YES;
-				TARGETED_DEVICE_FAMILY = "1,2";
-			};
-			name = Debug;
-		};
-		C9AF186729F267E000EC4979 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
-				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
-				CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
-				CODE_SIGN_ENTITLEMENTS = Annotations/Annotations.entitlements;
-				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 1;
-				DEVELOPMENT_TEAM = 4GGQPGRTSV;
-				ENABLE_BITCODE = NO;
-				GENERATE_INFOPLIST_FILE = YES;
-				INFOPLIST_FILE = Annotations/Info.plist;
-				INFOPLIST_KEY_CFBundleDisplayName = Annotations_ComPDFKit;
-				INFOPLIST_KEY_NSBluetoothPeripheralUsageDescription = "Your consent is required before you could access the function.";
-				INFOPLIST_KEY_NSCalendarsUsageDescription = "Your consent is required before you could access the function.";
-				INFOPLIST_KEY_NSCameraUsageDescription = "Your consent is required before you could access the function.";
-				INFOPLIST_KEY_NSContactsUsageDescription = "Your consent is required before you could access the function.";
-				INFOPLIST_KEY_NSLocationAlwaysUsageDescription = "Your consent is required before you could access the function.";
-				INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "Your consent is required before you could access the function.";
-				INFOPLIST_KEY_NSMicrophoneUsageDescription = "Your consent is required before you could access the function.";
-				INFOPLIST_KEY_NSPhotoLibraryAddUsageDescription = "Enable camera access so that you can create scans with your camera.";
-				INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "Your consent is required before you could access the function.";
-				INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
-				INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
-				INFOPLIST_KEY_UIMainStoryboardFile = Main;
-				INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
-				INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
-				IPHONEOS_DEPLOYMENT_TARGET = 10.0;
-				LD_RUNPATH_SEARCH_PATHS = (
-					"$(inherited)",
-					"@executable_path/Frameworks",
-				);
-				MARKETING_VERSION = 1.0;
-				PRODUCT_BUNDLE_IDENTIFIER = com.compdfkit.annotations;
-				PRODUCT_NAME = "$(TARGET_NAME)";
-				SWIFT_EMIT_LOC_STRINGS = YES;
-				TARGETED_DEVICE_FAMILY = "1,2";
-			};
-			name = Release;
-		};
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
-		C9AF184729F267DD00EC4979 /* Build configuration list for PBXProject "Annotations" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				C9AF186329F267E000EC4979 /* Debug */,
-				C9AF186429F267E000EC4979 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-		C9AF186529F267E000EC4979 /* Build configuration list for PBXNativeTarget "Annotations" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				C9AF186629F267E000EC4979 /* Debug */,
-				C9AF186729F267E000EC4979 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-/* End XCConfigurationList section */
-	};
-	rootObject = C9AF184429F267DD00EC4979 /* Project object */;
-}

+ 0 - 18
Annotations/Annotations/Annotations.entitlements

@@ -1,18 +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>com.apple.developer.icloud-container-identifiers</key>
-	<array>
-		<string>iCloud.com.brother.pdfreaderpro</string>
-	</array>
-	<key>com.apple.developer.icloud-services</key>
-	<array>
-		<string>CloudDocuments</string>
-	</array>
-	<key>com.apple.developer.ubiquity-container-identifiers</key>
-	<array>
-		<string>iCloud.com.brother.pdfreaderpro</string>
-	</array>
-</dict>
-</plist>

+ 0 - 24
Annotations/Annotations/AppDelegate.h

@@ -1,24 +0,0 @@
-//
-//  AppDelegate.h
-//  Annotations
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <UIKit/UIKit.h>
-
-@interface AppDelegate : UIResponder <UIApplicationDelegate>
-
-@property (nonatomic, readonly) UIWindow *window;
-
-+ (AppDelegate *)sharedAppDelegate;
-
-- (void)configWindow:(UIWindow *)window;
-
-@end
-

+ 0 - 118
Annotations/Annotations/AppDelegate.m

@@ -1,118 +0,0 @@
-//
-//  AppDelegate.m
-//  Annotations
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import "AppDelegate.h"
-
-#import <ComPDFKit/ComPDFKit.h>
-#import <ComPDFKit_Tools/ComPDFKit_Tools.h>
-
-#import "CPDFViewController.h"
-#import "XMLReader.h"
-
-static AppDelegate *appDelegate = NULL;
-
-@interface AppDelegate ()
-
-@property (nonatomic, strong) UIWindow *window;
-
-@end
-
-
-@implementation AppDelegate
-
-
-- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
-    
-    NSString *xmlFileString = [[NSBundle mainBundle] pathForResource:@"license_key_ios" ofType:@"xml"];
-    NSData *xmlData = [NSData dataWithContentsOfFile:xmlFileString];
-    NSError *error = nil;
-    
-    NSDictionary *result = [XMLReader dictionaryForXMLData:xmlData error:&error];
-    if (error)
-        NSLog(@"License key can not be empty.");
-    
-    if([result isKindOfClass:[NSDictionary class]]) {
-        NSDictionary *license = [result objectForKey:@"license"];
-        if([license isKindOfClass:[NSDictionary class]]) {
-            NSDictionary * keysDic = license[@"key"];
-            NSDictionary * secretDic = license[@"secret"];
-            
-            NSString * key = keysDic[@"text"];
-            NSString * secret = secretDic[@"text"];
-            [CPDFKit setLicenseKey:key secret:secret];
-        }  else {
-            NSLog(@"License key can not be empty.");
-        }
-    } else {
-        NSLog(@"License key can not be empty.");
-    }
-    
-    if (@available(iOS 13.0, *)) {
-        
-    } else {
-        UIWindow *windows = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
-        [self configWindow:windows];
-
-    }
-    return YES;
-}
-
-- (void)configWindow:(UIWindow *)window {
-    self.window = window;
-    self.window.backgroundColor = [UIColor whiteColor];
-    
-    NSString *filePath = [[NSBundle mainBundle] pathForResource:@"PDF32000_2008" ofType:@"pdf"];
-    
-    NSString *documentFolder = [NSHomeDirectory() stringByAppendingFormat:@"/%@/%@", @"Documents",@"Samples"];
-
-    if (![[NSFileManager defaultManager] fileExistsAtPath:documentFolder])
-        [[NSFileManager defaultManager] createDirectoryAtURL:[NSURL fileURLWithPath:documentFolder] withIntermediateDirectories:YES attributes:nil error:nil];
-    
-    NSString * documentPath = [documentFolder stringByAppendingPathComponent:filePath.lastPathComponent];
-    if (![[NSFileManager defaultManager] fileExistsAtPath:documentPath])
-        [[NSFileManager defaultManager] copyItemAtURL:[NSURL fileURLWithPath:filePath] toURL:[NSURL fileURLWithPath:documentPath] error:nil];
-
-    CPDFViewController *pdfViewController = [[CPDFViewController alloc] initWithFilePath:documentPath password:nil];
-    CNavigationController *navController = [[CNavigationController alloc]initWithRootViewController:pdfViewController];
-
-    self.window.rootViewController = navController;
-    
-    [self.window makeKeyAndVisible];
-
-}
-
-+ (AppDelegate *)sharedAppDelegate {
-    if (!appDelegate)
-        appDelegate = [[AppDelegate alloc] init];
-    
-    return appDelegate;
-}
-
-
-#pragma mark - UISceneSession lifecycle
-
-
-- (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options API_AVAILABLE(ios(13.0)){
-    // Called when a new scene session is being created.
-    // Use this method to select a configuration to create the new scene with.
-    return [[UISceneConfiguration alloc] initWithName:@"Default Configuration" sessionRole:connectingSceneSession.role];
-}
-
-
-- (void)application:(UIApplication *)application didDiscardSceneSessions:(NSSet<UISceneSession *> *)sceneSessions API_AVAILABLE(ios(13.0)){
-    // Called when the user discards a scene session.
-    // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
-    // Use this method to release any resources that were specific to the discarded scenes, as they will not return.
-}
-
-
-@end

+ 0 - 21
Annotations/Annotations/CPDFViewController.h

@@ -1,21 +0,0 @@
-//
-//  ViewController.h
-//  ContentEditor
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <ComPDFKit_Tools/ComPDFKit_Tools.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@interface CPDFViewController : CPDFViewBaseController
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 549
Annotations/Annotations/CPDFViewController.m

@@ -1,549 +0,0 @@
-//
-//  CPDFViewController.m
-//   ContentEditor
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import "CPDFViewController.h"
-
-#import <ComPDFKit/ComPDFKit.h>
-#import <ComPDFKit_Tools/ComPDFKit_Tools.h>
-#import <AVFAudio/AVFAudio.h>
-#import <AVFoundation/AVFoundation.h>
-
-@interface CPDFViewController () <CPDFSoundPlayBarDelegate,CPDFAnnotationBarDelegate,CPDFToolsViewControllerDelegate,CPDFNoteOpenViewControllerDelegate,CPDFBOTAViewControllerDelegate,CPDFKeyboardToolbarDelegate>
-
-@property(nonatomic, strong) CPDFAnnotationToolBar *annotationBar;
-
-@property(nonatomic, strong) CPDFSoundPlayBar *soundPlayBar;
-
-@property(nonatomic, strong) CAnnotationManage *annotationManage;
-
-@end
-
-@implementation CPDFViewController
-
-- (void)viewDidLoad {
-    [super viewDidLoad];
-    
-    self.pdfListView.toolModel = CToolModelAnnotation;
-    self.view.backgroundColor = [CPDFColorUtils CPDFViewControllerBackgroundColor];
-    
-    [self initAnnotationBar];
-
-    [self enterAnnotationMode];
-    
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(PDFPageDidRemoveAnnotationNotification:) name:CPDFPageDidRemoveAnnotationNotification object:nil];
-}
-
-- (void)initAnnotationBar {
-    self.annotationManage = [[CAnnotationManage alloc] initWithPDFView:self.pdfListView];
-        
-    self.annotationBar = [[CPDFAnnotationToolBar alloc] initAnnotationManage:self.annotationManage];
-    
-    CGFloat height = 44.0;
-    if (@available(iOS 11.0, *))
-        height += self.view.safeAreaInsets.bottom;
-    
-    self.annotationBar.frame = CGRectMake(0, self.view.frame.size.height - height, self.view.frame.size.width, height);
-    self.annotationBar.delegate = self;
-    [self.annotationBar setParentVC:self];
-    [self.view addSubview:self.annotationBar];
-}
-
-- (void)initWitNavigationTitle {
-    //titleButton
-    CNavigationBarTitleButton * navTitleButton = [[CNavigationBarTitleButton alloc] init];
-    self.titleButton = navTitleButton;
-    self.navigationTitle = NSLocalizedString(@"Annotation", nil);
-    [navTitleButton setImage:[UIImage imageNamed:@"syasarrow"] forState:UIControlStateNormal];
-    [navTitleButton addTarget:self action:@selector(titleButtonClickd:) forControlEvents:UIControlEventTouchUpInside];
-    [navTitleButton setTitle:self.navigationTitle forState:UIControlStateNormal];
-    [navTitleButton setTitleColor:[CPDFColorUtils CAnyReverseBackgooundColor] forState:UIControlStateNormal];
-    self.titleButton.frame = CGRectMake(0, 0, 50, 30);
-    self.navigationItem.titleView = self.titleButton;
-}
-
-- (void)viewWillLayoutSubviews {
-    [super viewWillLayoutSubviews];
-    
-    if([self.popMenu superview]) {
-        if (@available(iOS 11.0, *)) {
-            [self.popMenu showMenuInRect:CGRectMake(self.view.frame.size.width - self.view.safeAreaInsets.right - 250, CGRectGetMaxY(self.navigationController.navigationBar.frame), 250, 250)];
-        } else {
-            // Fallback on earlier versions
-            [self.popMenu showMenuInRect:CGRectMake(self.view.frame.size.width - 250, CGRectGetMaxY(self.navigationController.navigationBar.frame), 250, 250)];
-        }
-    }
-    
-    CGFloat height = 44.0;
-    
-    if (@available(iOS 11.0, *))
-        height += self.view.safeAreaInsets.bottom;
-
-    if(CToolModelAnnotation == self.pdfListView.toolModel) {
-        if (@available(iOS 11.0, *)) {
-            self.annotationBar.frame = CGRectMake(self.view.safeAreaInsets.left, self.view.frame.size.height - height, self.view.frame.size.width- self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, height);
-        } else {
-            self.annotationBar.frame = CGRectMake(0, self.view.frame.size.height - height, self.view.frame.size.width, height);
-        }
-    } else {
-        self.annotationBar.frame = CGRectMake(0, self.view.bounds.size.height, self.view.frame.size.width, height);
-    }
-    
-    CGFloat tPosY = 0;
-    CGFloat tBottomY = 0;
-
-    if(CToolModelAnnotation == self.pdfListView.toolModel) {
-        if (!self.navigationController.navigationBarHidden) {
-            [UIView animateWithDuration:0.3 animations:^{
-                CGRect frame = self.annotationBar.frame;
-                frame.origin.y = self.view.bounds.size.height-frame.size.height;
-                self.annotationBar.frame = frame;
-            }];
-            CGRect rectStatus = [[UIApplication sharedApplication] statusBarFrame];
-            tPosY = self.navigationController.navigationBar.frame.size.height + rectStatus.size.height;
-            
-            tBottomY = self.annotationBar.frame.size.height;
-        } else {
-            [UIView animateWithDuration:0.3 animations:^{
-                CGRect frame = self.annotationBar.frame;
-                frame.origin.y = self.view.bounds.size.height;
-                self.annotationBar.frame = frame;
-            }];
-        }
-    } else {
-        tPosY = 0;
-        if (!self.navigationController.navigationBarHidden) {
-            CGRect rectStatus = [[UIApplication sharedApplication] statusBarFrame];
-            tPosY = self.navigationController.navigationBar.frame.size.height + rectStatus.size.height;
-        }
-    }
-    
-    if (CPDFDisplayDirectionVertical == [CPDFKitConfig  sharedInstance].displayDirection) {
-            UIEdgeInsets inset = self.pdfListView.documentView.contentInset;
-            inset.bottom = 10 + self.annotationBar.frame.size.height;
-            self.pdfListView.documentView.contentInset = inset;
-    } else{
-            UIEdgeInsets inset = self.pdfListView.documentView.contentInset;
-            inset.bottom = 0;
-            self.pdfListView.documentView.contentInset = inset;
-    }
-}
-
-#pragma mark - Public Methods
-
-- (void)selectDocumentRefresh {
-    self.pdfListView.annotationMode = CPDFViewAnnotationModeNone;
-    [self.annotationBar updatePropertiesButtonState];
-    [self.annotationBar reloadData];
-    [self.annotationBar updateUndoRedoState];
-}
-
-#pragma mark - Private Methods
-
-- (void)enterAnnotationMode {
-    self.pdfListView.toolModel = CToolModelAnnotation;
-    self.navigationTitle = NSLocalizedString(@"Annotation", nil);
-    [self.titleButton setTitle:self.navigationTitle forState:UIControlStateNormal];
-    
-    CGFloat tPosY = 0;
-    CGFloat tBottomY = 0;
-    CGRect frame = self.annotationBar.frame;
-    frame.origin.y = self.view.bounds.size.height-frame.size.height;
-    self.annotationBar.frame = frame;
-    
-    CGRect rectStatus = [[UIApplication sharedApplication] statusBarFrame];
-    tPosY = self.navigationController.navigationBar.frame.size.height + rectStatus.size.height;
-    tBottomY = self.annotationBar.frame.size.height;
-    
-    if (CPDFDisplayDirectionVertical == [CPDFKitConfig  sharedInstance].displayDirection) {
-            UIEdgeInsets inset = self.pdfListView.documentView.contentInset;
-            inset.bottom = 10 + self.annotationBar.frame.size.height;
-            self.pdfListView.documentView.contentInset = inset;
-    } else{
-            UIEdgeInsets inset = self.pdfListView.documentView.contentInset;
-            inset.bottom = 0;
-            self.pdfListView.documentView.contentInset = inset;
-    }
-}
-
-- (void)enterViewerMode {
-    
-    if (self.pdfListView.isEdited) {
-        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-            [self.pdfListView commitEditing];
-            dispatch_async(dispatch_get_main_queue(), ^{
-                [self.pdfListView endOfEditing];
-            });
-        });
-    } else {
-        [self.pdfListView endOfEditing];
-    }
-    
-    self.pdfListView.toolModel = CToolModelViewer;
-    self.navigationTitle = NSLocalizedString(@"Viewer", nil);
-    [self.titleButton setTitle:self.navigationTitle forState:UIControlStateNormal];
-    
-    CGRect frame = self.annotationBar.frame;
-    frame.origin.y = self.view.bounds.size.height;
-    self.annotationBar.frame = frame;
-    
-    if (CPDFDisplayDirectionVertical == [CPDFKitConfig  sharedInstance].displayDirection) {
-            UIEdgeInsets inset = self.pdfListView.documentView.contentInset;
-            inset.bottom = 10 + self.annotationBar.frame.size.height;
-            self.pdfListView.documentView.contentInset = inset;
-    } else{
-            UIEdgeInsets inset = self.pdfListView.documentView.contentInset;
-            inset.bottom = 0;
-            self.pdfListView.documentView.contentInset = inset;
-    }
-}
-
-- (void)titleButtonClickd:(UIButton *) button {
-    CPDFToolsViewController * toolsVc = [[CPDFToolsViewController alloc] initCustomizeWithToolArrays:@[@(CToolModelViewer),@(CToolModelAnnotation)]];
-    toolsVc.delegate = self;
-    AAPLCustomPresentationController *presentationController NS_VALID_UNTIL_END_OF_SCOPE;
-    presentationController = [[AAPLCustomPresentationController alloc] initWithPresentedViewController:toolsVc presentingViewController:self];
-    toolsVc.transitioningDelegate = presentationController;
-    [self presentViewController:toolsVc animated:YES completion:nil];
-}
-
-- (void)navigationRightItemBota {
-    CPDFBOTAViewController *botaViewController = [[CPDFBOTAViewController alloc] initCustomizeWithPDFView:self.pdfListView navArrays:@[@(CPDFBOTATypeStateOutline),@(CPDFBOTATypeStateBookmark),@(CPDFBOTATypeStateAnnotation)]];
-    botaViewController.delegate = self;
-    
-    AAPLCustomPresentationController *presentationController NS_VALID_UNTIL_END_OF_SCOPE;
-   
-    presentationController = [[AAPLCustomPresentationController alloc] initWithPresentedViewController:botaViewController presentingViewController:self];
-    botaViewController.transitioningDelegate = presentationController;
-    
-    [self presentViewController:botaViewController animated:YES completion:nil];
-}
-
-- (void)setTitleRefresh {
-    if (CToolModelAnnotation == self.pdfListView.toolModel) {
-        [self enterAnnotationMode];
-    } else if (CToolModelViewer == self.pdfListView.toolModel) {
-        [self enterViewerMode];
-    }
-}
-
-#pragma mark - CPDFViewDelegate
-
-- (void)PDFViewShouldBeginEditing:(CPDFView *)pdfView textView:(UITextView *)textView forAnnotation:(CPDFFreeTextAnnotation *)annotation {
-    CPDFKeyboardToolbar *keyBoadrdToolbar = [[CPDFKeyboardToolbar alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, 50)];
-    keyBoadrdToolbar.delegate = self;
-    [keyBoadrdToolbar bindToTextView:textView];
-}
-
-#pragma mark - CPDFListViewDelegate
-
-- (void)PDFListViewPerformTouchEnded:(CPDFListView *)pdfView {
-    CGFloat tPosY = 0;
-    CGFloat tBottomY = 0;
-
-    if(CToolModelAnnotation == self.pdfListView.toolModel) {
-        if (self.navigationController.navigationBarHidden) {
-            [self.navigationController setNavigationBarHidden:NO animated:YES];
-            [UIView animateWithDuration:0.3 animations:^{
-                CGRect frame = self.annotationBar.frame;
-                frame.origin.y = self.view.bounds.size.height-frame.size.height;
-                self.annotationBar.frame = frame;
-                self.pdfListView.pageSliderView.alpha = 1.0;
-                self.annotationBar.topToolBar.alpha = 1.0;
-                self.annotationBar.drawPencilFuncView.alpha = 1.0;
-            }];
-            CGRect rectStatus = [[UIApplication sharedApplication] statusBarFrame];
-            tPosY = self.navigationController.navigationBar.frame.size.height + rectStatus.size.height;
-            
-            tBottomY = self.annotationBar.frame.size.height;
-        } else {
-            [self.navigationController setNavigationBarHidden:YES animated:YES];
-            [UIView animateWithDuration:0.3 animations:^{
-                CGRect frame = self.annotationBar.frame;
-                frame.origin.y = self.view.bounds.size.height;
-                self.annotationBar.frame = frame;
-                self.pdfListView.pageSliderView.alpha = 0.0;
-                self.annotationBar.topToolBar.alpha = 0.0;
-                self.annotationBar.drawPencilFuncView.alpha = 0.0;
-
-            }];
-        }
-    } else {
-        CGFloat tPosY = 0;
-        if (self.navigationController.navigationBarHidden) {
-            [self.navigationController setNavigationBarHidden:NO animated:YES];
-            [UIView animateWithDuration:0.3 animations:^{
-                self.pdfListView.pageSliderView.alpha = 1.0;
-            }];
-            CGRect rectStatus = [[UIApplication sharedApplication] statusBarFrame];
-            tPosY = self.navigationController.navigationBar.frame.size.height + rectStatus.size.height;
-
-        } else {
-            [self.navigationController setNavigationBarHidden:YES animated:YES];
-            [UIView animateWithDuration:0.3 animations:^{
-                self.pdfListView.pageSliderView.alpha = 0.0;
-            }];
-        }
-    }
-    
-    if (CPDFDisplayDirectionVertical == [CPDFKitConfig  sharedInstance].displayDirection) {
-            UIEdgeInsets inset = self.pdfListView.documentView.contentInset;
-            inset.bottom = 10 + self.annotationBar.frame.size.height;
-            self.pdfListView.documentView.contentInset = inset;
-    } else{
-            UIEdgeInsets inset = self.pdfListView.documentView.contentInset;
-            inset.bottom = 0;
-            self.pdfListView.documentView.contentInset = inset;
-    }
-}
-
-- (void)PDFListViewEditNote:(CPDFListView *)pdfListView forAnnotation:(CPDFAnnotation *)annotation {
-    if([annotation isKindOfClass:[CPDFLinkAnnotation class]]) {
-        [self.annotationBar buttonItemClicked_openAnnotation:self.titleButton];
-    } else {
-        CGRect rect = [self.pdfListView convertRect:annotation.bounds fromPage:annotation.page];
-        CPDFNoteOpenViewController *noteVC = [[CPDFNoteOpenViewController alloc]initWithAnnotation:annotation];
-        noteVC.delegate = self;
-        [noteVC showViewController:self inRect:rect];
-    }
-}
-
-- (void)PDFListViewChangedAnnotationType:(CPDFListView *)pdfListView forAnnotationMode:(CPDFViewAnnotationMode)annotationMode {
-    [self.annotationBar reloadData];
-}
-
-- (void)PDFListViewPerformAddStamp:(CPDFListView *)pdfView atPoint:(CGPoint)point forPage:(CPDFPage *)page {
-    [self.annotationBar addStampAnnotationWithPage:page point:point];
-}
-
-- (void)PDFListViewPerformAddImage:(CPDFListView *)pdfView atPoint:(CGPoint)point forPage:(CPDFPage *)page {
-    [self.annotationBar addImageAnnotationWithPage:page point:point];
-}
-
-- (BOOL)PDFListViewerTouchEndedIsAudioRecordMedia:(CPDFListView *)pdfListView {
-    if (CPDFMediaStateAudioRecord == [CPDFMediaManager shareManager].mediaState) {
-        [self PDFListViewPerformTouchEnded:self.pdfListView];
-        return YES;
-    }
-    return NO;
-}
-
-- (void)PDFListViewPerformCancelMedia:(CPDFListView *)pdfView atPoint:(CGPoint)point forPage:(CPDFPage *)page {
-    [CPDFMediaManager shareManager].mediaState = CPDFMediaStateStop;
-}
-
-- (void)PDFListViewPerformRecordMedia:(CPDFListView *)pdfView atPoint:(CGPoint)point forPage:(CPDFPage *)page {
-    if([self.soundPlayBar superview]) {
-        if(self.soundPlayBar.soundState == CPDFSoundStatePlay) {
-            [self.soundPlayBar stopAudioPlay];
-            [self.soundPlayBar removeFromSuperview];
-        } else if (self.soundPlayBar.soundState == CPDFSoundStateRecord) {
-            [self.soundPlayBar stopRecord];
-            [self.soundPlayBar removeFromSuperview];
-        }
-    }
-    
-    AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeAudio];
-    if (authStatus == AVAuthorizationStatusNotDetermined || authStatus == AVAuthorizationStatusDenied) {
-        [AVCaptureDevice requestAccessForMediaType:AVMediaTypeAudio completionHandler:^(BOOL granted) {
-            if (granted) {
-                
-            } else {
-                NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
-                if ([[UIApplication sharedApplication] canOpenURL:url]) {
-                    [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
-                }
-            }
-        }];
-    }
-    
-    if (authStatus == AVAuthorizationStatusAuthorized) {
-        NSInteger pageindex = [self.pdfListView.document indexForPage:page];
-        [CPDFMediaManager shareManager].mediaState = CPDFMediaStateAudioRecord;
-        [CPDFMediaManager shareManager].pageNum = pageindex;
-        [CPDFMediaManager shareManager].ptInPdf = point;
-        
-        _soundPlayBar = [[CPDFSoundPlayBar alloc] initWithStyle:self.annotationManage.annotStyle];
-        _soundPlayBar.delegate = self;
-        [_soundPlayBar showInView:self.pdfListView soundState:CPDFSoundStateRecord];
-        [_soundPlayBar startAudioRecord];
-       
-    } else {
-        return;
-    }
-}
-
-- (void)PDFListViewPerformPlay:(CPDFListView *)pdfView forAnnotation:(CPDFSoundAnnotation *)annotation {
-    NSString *filePath = [annotation mediaPath];
-    if (filePath) {
-        NSURL *URL = [NSURL fileURLWithPath:filePath];
-        
-        _soundPlayBar = [[CPDFSoundPlayBar alloc] initWithStyle:self.annotationManage.annotStyle];
-        _soundPlayBar.delegate = self;
-        [_soundPlayBar showInView:self.pdfListView soundState:CPDFSoundStatePlay];
-        [_soundPlayBar setURL:URL];
-        [_soundPlayBar startAudioPlay];
-        [CPDFMediaManager shareManager].mediaState = CPDFMediaStateVedioPlaying;
-    }
-}
-
-- (void)PDFListViewPerformSignatureWidget:(CPDFListView *)pdfView forAnnotation:(CPDFSignatureWidgetAnnotation *)annotation {
-    [self.annotationBar openSignatureAnnotation:annotation];
-}
-
-- (void)PDFListViewEditProperties:(CPDFListView *)pdfListView forAnnotation:(CPDFAnnotation *)annotation {
-    [self.annotationBar buttonItemClicked_openAnnotation:self.titleButton];
-}
-
-#pragma mark - CPDFKeyboardToolbarDelegate
-
-- (void)keyboardShouldDissmiss:(CPDFKeyboardToolbar *)toolbar {
-    [self.pdfListView commitEditAnnotationFreeText];
-    self.pdfListView.annotationMode = CPDFViewAnnotationModeNone;
-    [self.annotationBar reloadData];
-}
-
-#pragma mark - CPDFBOTAViewControllerDelegate
-
-- (void)botaViewControllerDismiss:(CPDFBOTAViewController *)botaViewController {
-    [self.navigationController dismissViewControllerAnimated:YES completion:nil];
-}
-
-#pragma mark - CPDFAnnotationBarDelegate
-
-- (void)annotationBarClick:(CPDFAnnotationToolBar *)annotationBar clickAnnotationMode:(CPDFViewAnnotationMode)annotationMode forSelected:(BOOL)isSelected forButton:(UIButton *)button {
-    if(CPDFViewAnnotationModeInk == annotationMode || CPDFViewAnnotationModePencilDrawing == annotationMode) {
-        CGFloat tPosY = 0;
-        if(isSelected) {
-            [self.navigationController setNavigationBarHidden:YES animated:YES];
-            [UIView animateWithDuration:0.3 animations:^{
-                CGRect frame = self.annotationBar.frame;
-                frame.origin.y = self.view.bounds.size.height;
-                self.annotationBar.frame = frame;
-                self.pdfListView.pageSliderView.alpha = 0.0;
-               
-                UIEdgeInsets inset = self.pdfListView.documentView.contentInset;
-                inset.bottom = 0;
-                self.pdfListView.documentView.contentInset = inset;
-
-            }];
-        } else {
-            [self.navigationController setNavigationBarHidden:NO animated:YES];
-            [UIView animateWithDuration:0.3 animations:^{
-                CGRect frame = self.annotationBar.frame;
-                frame.origin.y = self.view.bounds.size.height-frame.size.height;
-                self.annotationBar.frame = frame;
-                self.pdfListView.pageSliderView.alpha = 1.0;
-            }];
-            CGRect rectStatus = [[UIApplication sharedApplication] statusBarFrame];
-            tPosY = self.navigationController.navigationBar.frame.size.height + rectStatus.size.height;
-
-            UIEdgeInsets inset = self.pdfListView.documentView.contentInset;
-            inset.bottom = self.annotationBar.frame.size.height;
-            self.pdfListView.documentView.contentInset = inset;
-        }
-    } else if (CPDFViewAnnotationModeSound == annotationMode && !isSelected) {
-        if(CPDFSoundStateRecord == self.soundPlayBar.soundState) {
-            [self.soundPlayBar stopRecord];
-
-        } else if (CPDFSoundStatePlay== self.soundPlayBar.soundState) {
-            [self.soundPlayBar stopAudioPlay];
-        }
-    }
-}
-
-#pragma mark - CPDFNoteOpenViewControllerDelegate
-
-- (void)getNoteOpenViewController:(CPDFNoteOpenViewController *)noteOpenVC content:(NSString *)content isDelete:(BOOL)isDelete {
-    if (isDelete) {
-        [noteOpenVC.annotation.page removeAnnotation:noteOpenVC.annotation];
-        [self.pdfListView setNeedsDisplayForPage:noteOpenVC.annotation.page];
-        if([self.pdfListView.activeAnnotations containsObject:noteOpenVC.annotation]) {
-            NSMutableArray *activeAnnotations = [NSMutableArray arrayWithArray:self.pdfListView.activeAnnotations];
-            [activeAnnotations removeObject:noteOpenVC.annotation];
-            [self.pdfListView updateActiveAnnotations:activeAnnotations];
-        }
-    } else {
-        if([noteOpenVC.annotation isKindOfClass:[CPDFMarkupAnnotation class]]) {
-            CPDFMarkupAnnotation *markupAnnotation = (CPDFMarkupAnnotation *)noteOpenVC.annotation;
-            [markupAnnotation setContents:content?:@""];
-        } else if(([noteOpenVC.annotation isKindOfClass:[CPDFTextAnnotation class]])){
-            if(content && content.length > 0) {
-                noteOpenVC.annotation.contents = content?:@"";
-            } else {
-                if([self.pdfListView.activeAnnotations containsObject:noteOpenVC.annotation]) {
-                    [self.pdfListView updateActiveAnnotations:@[]];
-                }
-                [noteOpenVC.annotation.page removeAnnotation:noteOpenVC.annotation];
-                [self.pdfListView setNeedsDisplayForPage:noteOpenVC.annotation.page];
-            }
-        } else {
-            noteOpenVC.annotation.contents = content?:@"";
-        }
-    }
-}
-
-#pragma mark - CPDFSoundPlayBarDelegate
-
-- (void)soundPlayBarRecordFinished:(CPDFSoundPlayBar *)soundPlayBar withFile:(NSString *)filePath {
-
-    CPDFPage *page = [self.pdfListView.document pageAtIndex:[CPDFMediaManager shareManager].pageNum];
-    CPDFSoundAnnotation *annotation = [[CPDFSoundAnnotation alloc] initWithDocument:self.pdfListView.document];
-    
-    if ([annotation setMediaPath:filePath]) {
-        CGRect bounds = annotation.bounds;
-        bounds.origin.x = [CPDFMediaManager shareManager].ptInPdf.x-bounds.size.width/2.0;
-        bounds.origin.y = [CPDFMediaManager shareManager].ptInPdf.y-bounds.size.height/2.0;
-        annotation.bounds = bounds;
-        [self.pdfListView addAnnotation:annotation forPage:page];
-    }
-
-    [CPDFMediaManager shareManager].mediaState = CPDFMediaStateStop;
-    [self.pdfListView stopRecord];
-}
-
-- (void)soundPlayBarRecordCancel:(CPDFSoundPlayBar *)soundPlayBar {
-    if(CPDFSoundStateRecord == self.soundPlayBar.soundState) {
-        [self.pdfListView stopRecord];
-    }
-    [CPDFMediaManager shareManager].mediaState = CPDFMediaStateStop;
-}
-
-- (void)soundPlayBarPlayClose:(CPDFSoundPlayBar *)soundPlayBar {
-    [CPDFMediaManager shareManager].mediaState = CPDFMediaStateStop;
-}
-
-#pragma mark - Notification
-
-- (void)PDFPageDidRemoveAnnotationNotification:(NSNotification *)notification {
-    CPDFAnnotation *annotation = [notification object];
-
-    if ([annotation isKindOfClass:[CPDFSoundAnnotation class]]) {
-        [self.soundPlayBar stopAudioPlay];
-        if ([self.soundPlayBar isDescendantOfView:self.view]) {
-            [self.soundPlayBar removeFromSuperview];
-        }
-    }
-}
-
-#pragma mark - CPDFToolsViewControllerDelegate
-
-- (void)CPDFToolsViewControllerDismiss:(CPDFToolsViewController *) viewController selectItemAtIndex:(CToolModel)selectIndex {
-    if(CToolModelViewer == selectIndex) {
-        //viewwer
-        [self enterViewerMode];
-    }else{
-        //Annotation
-        [self enterAnnotationMode];
-    }
-}
-
-@end

+ 0 - 23
Annotations/Annotations/Info.plist

@@ -1,23 +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>UIApplicationSceneManifest</key>
-	<dict>
-		<key>UIApplicationSupportsMultipleScenes</key>
-		<false/>
-		<key>UISceneConfigurations</key>
-		<dict>
-			<key>UIWindowSceneSessionRoleApplication</key>
-			<array>
-				<dict>
-					<key>UISceneConfigurationName</key>
-					<string>Default Configuration</string>
-					<key>UISceneDelegateClassName</key>
-					<string>SceneDelegate</string>
-				</dict>
-			</array>
-		</dict>
-	</dict>
-</dict>
-</plist>

+ 0 - 20
Annotations/Annotations/SceneDelegate.h

@@ -1,20 +0,0 @@
-//
-//  SceneDelegate.h
-//  Annotations
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <UIKit/UIKit.h>
-
-@interface SceneDelegate : UIResponder <UIWindowSceneDelegate>
-
-@property (strong, nonatomic) UIWindow * window;
-
-@end
-

+ 0 - 63
Annotations/Annotations/SceneDelegate.m

@@ -1,63 +0,0 @@
-//
-//  SceneDelegate.m
-//  Annotations
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import "SceneDelegate.h"
-#import "AppDelegate.h"
-
-@interface SceneDelegate ()
-
-@end
-
-@implementation SceneDelegate
-
-
-- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions API_AVAILABLE(ios(13.0)){
-    UIWindow * window = [[UIWindow alloc] initWithWindowScene:scene];
-    
-    [[AppDelegate sharedAppDelegate] configWindow:window];
-}
-
-
-- (void)sceneDidDisconnect:(UIScene *)scene API_AVAILABLE(ios(13.0)){
-    // Called as the scene is being released by the system.
-    // This occurs shortly after the scene enters the background, or when its session is discarded.
-    // Release any resources associated with this scene that can be re-created the next time the scene connects.
-    // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead).
-}
-
-
-- (void)sceneDidBecomeActive:(UIScene *)scene API_AVAILABLE(ios(13.0)){
-    // Called when the scene has moved from an inactive state to an active state.
-    // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
-}
-
-
-- (void)sceneWillResignActive:(UIScene *)scene API_AVAILABLE(ios(13.0)){
-    // Called when the scene will move from an active state to an inactive state.
-    // This may occur due to temporary interruptions (ex. an incoming phone call).
-}
-
-
-- (void)sceneWillEnterForeground:(UIScene *)scene API_AVAILABLE(ios(13.0)){
-    // Called as the scene transitions from the background to the foreground.
-    // Use this method to undo the changes made on entering the background.
-}
-
-
-- (void)sceneDidEnterBackground:(UIScene *)scene API_AVAILABLE(ios(13.0)){
-    // Called as the scene transitions from the foreground to the background.
-    // Use this method to save data, release shared resources, and store enough scene-specific state information
-    // to restore the scene back to its current state.
-}
-
-
-@end

+ 0 - 23
Annotations/Annotations/main.m

@@ -1,23 +0,0 @@
-//
-//  main.m
-//  Annotations
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <UIKit/UIKit.h>
-#import "AppDelegate.h"
-
-int main(int argc, char * argv[]) {
-    NSString * appDelegateClassName;
-    @autoreleasepool {
-        // Setup code that might create autoreleased objects goes here.
-        appDelegateClassName = NSStringFromClass([AppDelegate class]);
-    }
-    return UIApplicationMain(argc, argv, nil, appDelegateClassName);
-}

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 2118
ComPDFKit_Tools/ComPDFKit_Tools.xcodeproj/project.pbxproj


+ 0 - 24
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnatationList/CAnnotListHeaderInSection.h

@@ -1,24 +0,0 @@
-//
-//  CAnnotListHeaderInSection.h
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//
-
-#import <UIKit/UIKit.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@interface CAnnotListHeaderInSection : UITableViewHeaderFooterView
-
-- (void)setPageNumber:(NSInteger)number;
-
-- (void)setAnnotsCount:(NSInteger)count;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 117
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnatationList/CAnnotListHeaderInSection.m

@@ -1,117 +0,0 @@
-//
-//  CAnnotListHeaderInSection.m
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//
-
-#import "CAnnotListHeaderInSection.h"
-
-#import "CPDFColorUtils.h"
-
-@interface CAnnotListHeaderInSection()
-
-@property (nonatomic, strong) UIView* shadowView;
-
-@property (nonatomic, strong) UILabel* pagenumber;
-
-@property (nonatomic, strong) UILabel* annotscount;
-
-@property (nonatomic, strong) UIView* mainView;
-
-@property (nonatomic, assign) CGFloat mainViewHeight;
-
-@end
-
-@implementation CAnnotListHeaderInSection
-
-- (id)initWithFrame:(CGRect)frame {
-    self = [super initWithFrame:frame];
-    if (self) {
-        _mainViewHeight = frame.size.height;
-        self.contentView.backgroundColor = [CPDFColorUtils CViewBackgroundColor];
-        _mainView = [[UIView alloc] init];
-        _mainView.layer.cornerRadius = 2;
-        _mainView.layer.masksToBounds = YES;
-        [self.contentView addSubview:_mainView];
-    }
-    return self;
-}
-
-- (void)layoutSubviews
-{
-    [super layoutSubviews];
-    
-    CGFloat width = [UIScreen mainScreen].bounds.size.width;
-    if((UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) &&
-       ([UIApplication sharedApplication].statusBarOrientation == UIDeviceOrientationLandscapeLeft || [UIApplication sharedApplication].statusBarOrientation == UIDeviceOrientationLandscapeRight))  {
-        width = [UIScreen mainScreen].bounds.size.width - self.window.safeAreaInsets.left;
-    }
-    if ((UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)) {
-        width = self.frame.size.width;
-    }
-    
-    _mainView.frame = CGRectMake(0, 0, width - 21, _mainViewHeight);
-    _shadowView.center = _annotscount.center;
-}
-
-- (void)setPageNumber:(NSInteger)number {
-    if (!_pagenumber) {
-        _pagenumber = [[UILabel alloc] init];
-        _pagenumber.backgroundColor = [UIColor clearColor];
-        if (@available(iOS 13.0, *)) {
-            _pagenumber.textColor = [UIColor labelColor];
-        } else {
-            _pagenumber.textColor = [UIColor blackColor];
-        }
-        [_pagenumber setFont:[UIFont systemFontOfSize:13.0f]];
-        [_mainView addSubview:_pagenumber];
-    }
-    
-    _pagenumber.text = [NSString stringWithFormat:NSLocalizedString(@"Page %ld",nil), (long)number];
-    [_pagenumber sizeToFit];
-    
-    CGRect rect = [_pagenumber frame];
-    rect.origin = CGPointMake(16, (self.contentView.frame.size.height-rect.size.height)/2.0);
-    _pagenumber.frame = rect;
-}
-
-- (void)setAnnotsCount:(NSInteger)count {
-    if (!_shadowView) {
-        _shadowView = [[UIView alloc] init];
-        _shadowView.layer.shadowColor = [UIColor blackColor].CGColor;
-        _shadowView.layer.shadowOffset = CGSizeMake(0,1.0);
-        _shadowView.layer.shadowOpacity = 0.3;
-        [_mainView addSubview:_shadowView];
-    }
-    
-    if (!_annotscount) {
-        _annotscount = [[UILabel alloc] init];
-        if (@available(iOS 13.0, *)) {
-            _annotscount.textColor = [UIColor labelColor];
-        } else {
-            _annotscount.textColor = [UIColor blackColor];
-        }
-        [_annotscount setFont:[UIFont boldSystemFontOfSize:13.0f]];
-        _annotscount.textAlignment = NSTextAlignmentCenter;
-        _annotscount.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
-        _annotscount.layer.cornerRadius = 2;
-        _annotscount.layer.masksToBounds = YES;
-        [_mainView addSubview:_annotscount];
-    }
-    
-    _annotscount.text = [NSString stringWithFormat:@"%ld", (long)count];
-    [_annotscount sizeToFit];
-    CGRect rect = [_annotscount frame];
-    rect.size.width = rect.size.width < 8 ? 16 : rect.size.width + 8;
-    rect.size.height = 16;
-    rect.origin = CGPointMake(_mainView.frame.size.width - rect.size.width - 5, (self.contentView.frame.size.height-rect.size.height)/2.0);
-    _annotscount.frame = rect;
-    _shadowView.frame = rect;
-}
-
-@end

+ 0 - 34
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnatationList/CPDFAnnotationListCell.h

@@ -1,34 +0,0 @@
-//
-//  CPDFAnnotationListCell.h
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//
-
-#import <UIKit/UIKit.h>
-
-@class CPDFAnnotation;
-
-NS_ASSUME_NONNULL_BEGIN
-
-@interface CPDFAnnotationListCell : UITableViewCell
-
-@property(nonatomic, strong) UIImageView *typeImageView;
-
-@property(nonatomic, strong) UILabel *dateLabel;
-
-@property(nonatomic, strong) UILabel *contentLabel;
-
-@property(nonatomic, readonly)CPDFAnnotation *annot;
-
-@property(nonatomic, assign)NSInteger pageNumber;
-
-- (void)updateCellWithAnnotation:(CPDFAnnotation *)annotation;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 295
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnatationList/CPDFAnnotationListCell.m

@@ -1,295 +0,0 @@
-//
-//  CPDFAnnotationListCell.m
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//
-
-#import "CPDFAnnotationListCell.h"
-
-#import "CPDFAnnotionColorDrawView.h"
-#import <ComPDFKit/ComPDFKit.h>
-
-@interface CPDFAnnotationListCell()
-
-@property(nonatomic, strong)CPDFAnnotation *annot;
-
-@end
-
-@implementation CPDFAnnotationListCell
-
-- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
-    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
-    if (self) {
-        self.backgroundColor = [UIColor clearColor];
-                
-        _typeImageView = [[UIImageView alloc] initWithFrame:CGRectZero];
-        _typeImageView.frame = CGRectMake(15.0, 18.0, 20, 20);
-        [_typeImageView setImage:[UIImage imageNamed:@"CImageNamePDFAnnotationShapeCircle"
-                                            inBundle:[NSBundle bundleForClass:self.class]
-                       compatibleWithTraitCollection:nil]];
-                
-        _dateLabel = [[UILabel alloc] initWithFrame:CGRectZero];
-        [_dateLabel setFont:[UIFont systemFontOfSize:12.0f]];
-        if (@available(iOS 13.0, *)) {
-            [_dateLabel setTextColor:[UIColor secondaryLabelColor]];
-        } else {
-            [_dateLabel setTextColor:[UIColor blackColor]];
-        }
-        _dateLabel.minimumScaleFactor = 0.5;
-        _dateLabel.numberOfLines = 1;
-        _dateLabel.adjustsFontSizeToFitWidth = YES;
-        [_dateLabel setTextAlignment:NSTextAlignmentLeft];
-        [_dateLabel setBackgroundColor:[UIColor clearColor]];
-        
-        _contentLabel = [[UILabel alloc] initWithFrame:CGRectZero];
-        if (@available(iOS 13.0, *)) {
-            [_contentLabel setTextColor:[UIColor secondaryLabelColor]];
-        } else {
-            [_contentLabel setTextColor:[UIColor blackColor]];
-        }
-        _contentLabel.lineBreakMode = NSLineBreakByTruncatingTail;
-        _contentLabel.numberOfLines = 3;
-        _contentLabel.font = [UIFont systemFontOfSize:15.0f];
-        [_contentLabel setBackgroundColor:[UIColor clearColor]];
-                
-        [self.contentView addSubview:_typeImageView];
-        [self.contentView addSubview:_dateLabel];
-        [self.contentView addSubview:_contentLabel];
-    }
-    return self;
-}
-
-- (void)layoutSubviews {
-    [super layoutSubviews];
-        
-    _dateLabel.frame = CGRectMake(43.0, 18, self.contentView.frame.size.width - 43 - 15.0, 20);
-
-    _contentLabel.frame = CGRectMake(15, 51, self.contentView.frame.size.width-30, _contentLabel.frame.size.height);
-}
-
-- (void)setPageNumber:(NSInteger)pageNumber {
-    _dateLabel.text = NSLocalizedString(@"Loading...", nil);
-    
-    _contentLabel.text = @"";
-    [_typeImageView setImage:nil];
-}
-
-- (void)updateCellWithAnnotation:(CPDFAnnotation *)annotation {
-    self.annot = annotation;
-    
-    [self setTypeImage:annotation];
-    
-    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
-    formatter.dateFormat = @"yyyy-MM-dd HH:mm";
-    _dateLabel.text = [formatter stringFromDate:annotation.modificationDate];
-    
-    if ([annotation isKindOfClass:[CPDFMarkupAnnotation class]]) {
-        NSString *text = [(CPDFMarkupAnnotation *)annotation markupText];
-        if (text && text.length > 0) {
-            _contentLabel.hidden = NO;
-            _contentLabel.text = text;
-        } else {
-            CPDFPage * page = annotation.page;
-            NSString * exproString = nil;
-            NSArray * points =  [(CPDFMarkupAnnotation*)annotation quadrilateralPoints];
-            NSInteger count = 4;
-            for (NSUInteger i=0; i+count <= points.count;) {
-                CGPoint ptlt = [points[i++] CGPointValue];
-                CGPoint ptrt = [points[i++] CGPointValue];
-                CGPoint ptlb = [points[i++] CGPointValue];
-                CGPoint ptrb = [points[i++] CGPointValue];
-                
-                CGRect rect = CGRectMake(ptlb.x, ptlb.y, ptrt.x - ptlb.x, ptrt.y - ptlb.y);
-                NSString *tString = [page stringForRect:rect];
-                if (tString && tString.length >0) {
-                    if(exproString) {
-                        exproString = [NSString stringWithFormat:@"%@\n%@",exproString,tString];
-                    } else {
-                        exproString  = tString;
-                    }
-                }
-            }
-            
-            if (exproString && exproString.length > 0) {
-                _contentLabel.hidden = NO;
-                _contentLabel.text = exproString;
-            } else {
-                _contentLabel.hidden = YES;
-            }
-        }
-    } else {
-        if ([annotation contents] && ![[annotation contents] isEqualToString:@""]){
-            NSArray<NSString *> *contextArray = [[annotation contents] componentsSeparatedByString:@"\n"];
-            if (contextArray.count >3) {
-                NSString *newContents = @"";
-                for (int i = 0; i < 2; i++) {
-                    newContents = [newContents stringByAppendingFormat:@"%@\n", contextArray[i]];
-                }
-                _contentLabel.hidden = NO;
-                _contentLabel.text = [newContents stringByAppendingString:@"..."];
-            } else {
-                _contentLabel.hidden = NO;
-                _contentLabel.text = [annotation contents];
-            }
-        }else{
-            _contentLabel.hidden = YES;
-        }
-    }
-    [_contentLabel sizeToFit];
-    [_dateLabel sizeToFit];
-}
-
-- (void)setTypeImage:(CPDFAnnotation *)annot {
-    for (UIView* subView in [_typeImageView subviews]) {
-        [subView removeFromSuperview];
-    }
-    
-    if ([annot isKindOfClass:[CPDFCircleAnnotation  class]]) {
-        
-        [_typeImageView setImage:[UIImage imageNamed:@"CImageNamePDFAnnotationShapeCircle"
-                                            inBundle:[NSBundle bundleForClass:self.class]
-                       compatibleWithTraitCollection:nil]];
-    } else if ([annot isKindOfClass:[CPDFFreeTextAnnotation class]]) {
-        [_typeImageView setImage:[UIImage imageNamed:@"CImageNamePDFAnnotationText"
-                                            inBundle:[NSBundle bundleForClass:self.class]
-                       compatibleWithTraitCollection:nil]];
-    } else if ([annot isKindOfClass:[CPDFInkAnnotation  class]]) {
-        dispatch_async(dispatch_get_main_queue(), ^{
-            UIColor* color = [annot color];
-            CPDFAnnotionColorDrawView* drawView = [self getTextMarkColorView:annot size:self.typeImageView.bounds.size color:color];
-            [self.typeImageView addSubview:drawView];
-            [self.typeImageView setImage:[UIImage imageNamed:@"CImageNamePDFAnnotationFreehand"
-                                                    inBundle:[NSBundle bundleForClass:self.class]
-                               compatibleWithTraitCollection:nil]];
-        });
-    } else if ([annot isKindOfClass:[CPDFLineAnnotation  class]]) {
-        if ([(CPDFLineAnnotation  *)annot startLineStyle] == CPDFLineStyleClosedArrow ||
-            [(CPDFLineAnnotation  *)annot endLineStyle] == CPDFLineStyleClosedArrow) {
-            [_typeImageView setImage:[UIImage imageNamed:@"CImageNamePDFAnnotationShapeArrow"
-                                                inBundle:[NSBundle bundleForClass:self.class]
-                           compatibleWithTraitCollection:nil]];
-        } else {
-            [_typeImageView setImage:[UIImage imageNamed:@"CImageNamePDFAnnotationShapeLine"
-                                                inBundle:[NSBundle bundleForClass:self.class]
-                           compatibleWithTraitCollection:nil]];
-        }
-    } else if ([annot isKindOfClass:[CPDFLinkAnnotation class]]){
-        //do nothing
-    } else if ([annot isKindOfClass:[CPDFSoundAnnotation class]] || [annot isKindOfClass:[CPDFMovieAnnotation  class]]) {
-        //add type
-        [_typeImageView setImage:[UIImage imageNamed:@"CImageNamePDFAnnotationRecord"
-                                            inBundle:[NSBundle bundleForClass:self.class]
-                       compatibleWithTraitCollection:nil]];
-    } else if ([annot isKindOfClass:[CPDFTextAnnotation class]]) {
-        [_typeImageView setImage:[UIImage imageNamed:@"CImageNamePDFAnnotationNote"
-                                            inBundle:[NSBundle bundleForClass:self.class]
-                       compatibleWithTraitCollection:nil]];
-    } else if ([annot isKindOfClass:[CPDFSquareAnnotation  class]]) {
-        [_typeImageView setImage:[UIImage imageNamed:@"CImageNamePDFAnnotationShapeRectangle"
-                                            inBundle:[NSBundle bundleForClass:self.class]
-                       compatibleWithTraitCollection:nil]];
-    } else if ([annot isKindOfClass:[CPDFStampAnnotation class]]) {
-        if (CPDFStampTypeImage == [(CPDFStampAnnotation *)annot stampType]) {
-            [_typeImageView setImage:[UIImage imageNamed:@"CImageNamePDFAnnotationPhoto"
-                                                inBundle:[NSBundle bundleForClass:self.class]
-                           compatibleWithTraitCollection:nil]];
-        } else {
-            [_typeImageView setImage:[UIImage imageNamed:@"CImageNamePDFAnnotationStamp"
-                                                inBundle:[NSBundle bundleForClass:self.class]
-                           compatibleWithTraitCollection:nil]];
-        }
-    } else if ([annot isKindOfClass:[CPDFMarkupAnnotation class]]){
-        UIColor* color = [annot color];
-        CPDFMarkupType markupType = [(CPDFMarkupAnnotation *)annot markupType];
-        switch (markupType) {
-            case CPDFMarkupTypeHighlight:
-                [_typeImageView setImage:[UIImage imageNamed:@"CImageNamePDFAnnotationHighlight"
-                                                    inBundle:[NSBundle bundleForClass:self.class]
-                               compatibleWithTraitCollection:nil]];
-                break;
-            case CPDFMarkupTypeUnderline:
-                [_typeImageView setImage:[UIImage imageNamed:@"CImageNamePDFAnnotationUnderline"
-                                                    inBundle:[NSBundle bundleForClass:self.class]
-                               compatibleWithTraitCollection:nil]];
-                break;
-            case CPDFMarkupTypeStrikeOut:
-                [_typeImageView setImage:[UIImage imageNamed:@"CImageNamePDFAnnotationStrikethrough"
-                                                    inBundle:[NSBundle bundleForClass:self.class]
-                               compatibleWithTraitCollection:nil]];
-                break;
-            case CPDFMarkupTypeSquiggly:
-                [_typeImageView setImage:[UIImage imageNamed:@"CImageNamePDFAnnotationUnderline"
-                                                    inBundle:[NSBundle bundleForClass:self.class]
-                               compatibleWithTraitCollection:nil]];
-                break;
-            default:
-                break;
-        }
-        dispatch_async(dispatch_get_main_queue(), ^{
-            CPDFAnnotionColorDrawView* drawView = [self getTextMarkColorView:annot size:self.typeImageView.bounds.size color:color];
-            [self.typeImageView addSubview:drawView];
-        });
-    } else if ([annot isKindOfClass:[CPDFSignatureAnnotation class]]) {
-        [_typeImageView setImage:[UIImage imageNamed:@"CImageNamePDFAnnotationSign"
-                                            inBundle:[NSBundle bundleForClass:self.class]
-                       compatibleWithTraitCollection:nil]];
-    }
-
-}
-
-- (CPDFAnnotionColorDrawView*) getTextMarkColorView:(CPDFAnnotation *)annotation size:(CGSize)size color:(UIColor*)color {
-    CPDFAnnotionMarkUpType markupType;
-    CPDFAnnotionColorDrawView* drawView = [[CPDFAnnotionColorDrawView alloc] initWithFrame:CGRectZero];
-    drawView.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleWidth;
-    
-        float tHeight  = 20;
-        float tWidth  = 20;
-        float tSpaceY   = 16;
-        float tOffsetX = (size.width - tWidth)/2;
-        
-        if ([annotation isKindOfClass:[CPDFMarkupAnnotation class]]) {
-            CPDFMarkupType type = [(CPDFMarkupAnnotation *)annotation markupType];
-            switch (type) {
-                case CPDFMarkupTypeHighlight:
-                    markupType = CPDFAnnotionMarkUpTypeHighlight;
-                    drawView.frame = CGRectMake(tOffsetX, (size.height - tHeight)/2, tWidth, tHeight);
-                    break;
-                case CPDFMarkupTypeUnderline:
-                    markupType = CPDFAnnotionMarkUpTypeUnderline;
-                    tHeight = 2.0;
-                    drawView.frame = CGRectMake(tOffsetX, size.height - tHeight, tWidth, tHeight);
-                    break;
-                case CPDFMarkupTypeStrikeOut:
-                    markupType = CPDFAnnotionMarkUpTypeStrikeout;
-                    tHeight = 2.0;
-                    drawView.frame = CGRectMake(tOffsetX, (size.height - tHeight)/2, tWidth, tHeight);
-                    break;
-                case CPDFMarkupTypeSquiggly:
-                    markupType = CPDFAnnotionMarkUpTypeSquiggly;
-                    tHeight = 6.0;
-                    drawView.frame = CGRectMake(tOffsetX, size.height-2.0, tWidth, tHeight);
-                    break;
-                default:
-                    break;
-            }
-        } else if ([annotation isKindOfClass:[CPDFInkAnnotation class]]) {
-            markupType = CPDFAnnotionMarkUpTypeFreehand;
-            tHeight = 6.0;
-            drawView.frame = CGRectMake(tOffsetX, size.height - 2.0, tWidth, tHeight);
-        } else {
-            markupType = CPDFAnnotionMarkUpTypeFreehand;
-            drawView.frame = CGRectZero;
-        }
-        drawView.markUpType = markupType;
-        drawView.lineColor = color;
-        [drawView setNeedsDisplay];
-    
-    return drawView;
-}
-
-@end

+ 0 - 37
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnatationList/CPDFAnnotationViewController.h

@@ -1,37 +0,0 @@
-//
-//  CPDFAnnotationViewController.h
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//
-
-#import <UIKit/UIKit.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@class CPDFView;
-@class CPDFAnnotation;
-@class CPDFAnnotationViewController;
-
-@protocol CPDFAnnotationViewControllerDelegate <NSObject>
-
-- (void)annotationViewController:(CPDFAnnotationViewController *)annotationViewController jumptoPage:(NSInteger)pageIndex selectAnnot:(CPDFAnnotation*)annot;
-
-@end
-
-
-@interface CPDFAnnotationViewController : UIViewController
-
-@property (nonatomic, readonly) CPDFView *pdfView;
-
-@property (nonatomic, weak) id<CPDFAnnotationViewControllerDelegate> delegate;
-
-- (instancetype)initWithPDFView:(CPDFView *)pdfView;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 319
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnatationList/CPDFAnnotationViewController.m

@@ -1,319 +0,0 @@
-//
-//  CPDFAnnotationViewController.m
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//
-
-#import "CPDFAnnotationViewController.h"
-
-#import "CAnnotListHeaderInSection.h"
-#import "CPDFAnnotationListCell.h"
-#import "CActivityIndicatorView.h"
-
-#import <ComPDFKit/ComPDFKit.h>
-
-@interface CPDFAnnotationViewController ()<UITableViewDelegate, UITableViewDataSource>
-
-@property (nonatomic, strong) UITableView* tableView;
-
-@property (nonatomic, strong) NSMutableArray* sequenceList;
-
-@property (nonatomic, strong) NSMutableDictionary* annotsDict;
-
-@property (nonatomic, strong) NSMutableDictionary* totalAnnotlistDict;
-
-@property (nonatomic, strong) NSMutableArray *selectIndexArray;
-
-@property (nonatomic, strong) UILabel* emptyLabel;
-
-@property (nonatomic, strong) CPDFView *pdfView;
-
-@property (nonatomic, strong) CActivityIndicatorView* activityView;
-
-@property (nonatomic,assign) BOOL stopLoadAnnots;
-
-@end
-
-@implementation CPDFAnnotationViewController
-
-- (instancetype)initWithPDFView:(CPDFView *)pdfView {
-    if (self = [super init]) {
-        self.pdfView = pdfView;
-    }
-    return self;
-}
-
-- (void)viewDidLoad {
-    [super viewDidLoad];
-    
-    _tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];
-    _tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-    _tableView.delegate = self;
-    _tableView.dataSource = self;
-    _tableView.separatorStyle=UITableViewCellSeparatorStyleNone;
-    _tableView.rowHeight = UITableViewAutomaticDimension;
-    _tableView.estimatedRowHeight = 60;
-    _tableView.tableFooterView = [[UIView alloc] init];
-    [self.view addSubview:self.tableView];
-    
-    self.emptyLabel.hidden = YES;
-
-    // Do any additional setup after loading the view.
-}
-
-- (void)viewWillAppear:(BOOL)animated {
-    [super viewWillAppear:animated];
-    
-    self.stopLoadAnnots = NO;
-    
-    [self.activityView startAnimating];
-    
-    [self loadAndRefreshAnnots];
-}
-
-- (void)viewWillDisappear:(BOOL)animated {
-    [super viewWillDisappear:animated];
-    
-    self.stopLoadAnnots = YES;
-}
-
-#pragma mark - Asset
-
-- (UILabel *)emptyLabel {
-    if (!_emptyLabel) {
-        _emptyLabel = [[UILabel alloc] init];
-        if (@available(iOS 13.0, *)) {
-            [_emptyLabel setTextColor:[UIColor labelColor]];
-        } else {
-            [_emptyLabel setTextColor:[UIColor blackColor]];
-        }
-        _emptyLabel.font = [UIFont boldSystemFontOfSize:16.0];
-        _emptyLabel.text = NSLocalizedString(@"No annotations", nil);
-        _emptyLabel.textColor = [UIColor grayColor];
-        [_emptyLabel sizeToFit];
-        [self.view addSubview:_emptyLabel];
-        [self.view bringSubviewToFront:_emptyLabel];
-        _emptyLabel.center = CGPointMake(self.view.bounds.size.width/2.0, self.view.bounds.size.height/2.0);
-        _emptyLabel.autoresizingMask = UIViewAutoresizingFlexibleTopMargin|UIViewAutoresizingFlexibleBottomMargin|UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleRightMargin;
-    }
-    return _emptyLabel;
-}
-
-- (CActivityIndicatorView *)activityView {
-    if (!_activityView) {
-        _activityView = [[CActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
-        _activityView.center = self.view.center;
-        _activityView.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
-    }
-    return _activityView;
-}
-
-- (void)loadAndRefreshAnnots {
-    self.stopLoadAnnots = NO;
-
-    self.totalAnnotlistDict = [[NSMutableDictionary alloc] init];
-    self.annotsDict = [[NSMutableDictionary alloc] init];
-    self.sequenceList = [[NSMutableArray alloc] init];
-    
-    [self.activityView startAnimating];
-    
-    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-        NSInteger pageCount = self.pdfView.document.pageCount;
-        NSInteger currentPage = 0;
-        for (NSInteger i=0; i < pageCount; i++) {
-            if (self.stopLoadAnnots) {
-                break;
-            }
-            
-            currentPage = i;
-            CPDFPage *page = [self.pdfView.document pageAtIndex:i];
-            NSArray *annotations = page.annotations;
-            NSMutableArray *annotsInpage = [NSMutableArray array];
-            for (CPDFAnnotation *annotation in annotations) {
-                if (![annotation isKindOfClass:[CPDFWidgetAnnotation  class]] &&
-                    ![annotation isKindOfClass:[CPDFLinkAnnotation class]] &&
-                    ![annotation isKindOfClass:[CPDFSignatureAnnotation class]]) {
-                    [annotsInpage addObject:annotation];
-                }
-            }
-            if ([annotsInpage count] > 0) {
-                NSArray *sortArray = [self annotSort:(NSArray *)annotsInpage];
-                if (sortArray) {
-                    [self.totalAnnotlistDict setObject:[NSMutableArray arrayWithArray:sortArray] forKey:[NSNumber numberWithInteger:i]];
-                    [self.sequenceList addObject:[NSNumber numberWithInteger:i]];
-                }
-            }
-            
-            if (currentPage == pageCount - 1) {
-                self.stopLoadAnnots = YES;
-            }
-        }
-        [self.totalAnnotlistDict enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
-            [self.annotsDict setObject:[NSMutableArray arrayWithArray:obj] forKey:key];
-        }];
-        dispatch_async(dispatch_get_main_queue(), ^{
-            [self.activityView stopAnimating];
-            [self.tableView reloadData];
-        });
-    });
-}
-
-- (NSMutableArray *)selectIndexArray {
-    if (!_selectIndexArray) {
-        _selectIndexArray = [[NSMutableArray alloc] init];
-    }
-    return _selectIndexArray;
-}
-
-static NSInteger sortByDate(CPDFAnnotation *annot1, CPDFAnnotation *annot2, void *context) {
-    return NSOrderedAscending;
-}
-
-- (NSArray *)annotSort:(NSArray *)array {
-    NSArray *result;
-    NSInteger (*sortFunction)(id, id, void *) = NULL;
-    sortFunction = sortByDate;
-    
-    if (sortFunction) {
-        result = [array sortedArrayUsingFunction:sortFunction context:NULL];
-    } else {
-        result = array;
-    }
-    
-    return result;
-}
-
-#pragma mark - tableView Delegate
-
-- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
-    NSInteger count = [self.sequenceList count];
-    if (count < 1) {
-        self.emptyLabel.hidden = NO;
-        self.tableView.hidden = YES;
-    } else {
-        self.emptyLabel.hidden = YES;
-        self.tableView.hidden = NO;
-    }
-
-    return count;
-}
-
-- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
-    if ([self.sequenceList count] == section)
-        return 1;
-    
-    if (section >= self.sequenceList.count) {
-        return 0;
-    }
-    NSNumber *key = [self.sequenceList objectAtIndex:section];
-    NSArray *val = [self.annotsDict objectForKey:key];
-    
-    return [val count];
-}
-
-- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
-    if ([self.sequenceList count] == section) {
-        return 0;
-    }
-    return 44.0;
-}
-
-- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
-{
-    if ([self.sequenceList count] == indexPath.section){
-        return 44;
-    }
-    
-    NSNumber *key = [self.sequenceList objectAtIndex:indexPath.section];
-    NSArray *val = [self.annotsDict objectForKey:key];
-    
-    CPDFAnnotation *annot = [val objectAtIndex:indexPath.row];
-    if ([annot isKindOfClass:[CPDFMarkupAnnotation class]]){
-        NSString *text = [(CPDFMarkupAnnotation *)annot markupText];
-        NSArray<NSString *> *contextArray = [text componentsSeparatedByString:@"\n"];
-        switch (contextArray.count) {
-            case 0:
-                return 44;
-            case 1:
-                return 44+25;
-            case 2:
-                return 44+45;
-            case 3:
-                return 44+60;
-            default:
-                return 44+60;
-        }
-        
-    }else if (([annot contents] && ![[annot contents] isEqualToString:@""])){
-        NSArray<NSString *> *contextArray = [[annot contents] componentsSeparatedByString:@"\n"];
-        switch (contextArray.count) {
-            case 1:
-                return 44+25;
-            case 2:
-                return 44+40;
-            case 3:
-                return 44+60;
-            default:
-                return 44+60;
-        }
-    }else{
-        return 40;
-    }
-}
-
-- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
-    if ([self.sequenceList count] == section)
-        return nil;
-    
-    if (section >= self.sequenceList.count) {
-        return nil;
-    }
-    
-    NSNumber *key = [self.sequenceList objectAtIndex:section];
-    NSArray *val = [self.annotsDict objectForKey:key];
-    
-    CAnnotListHeaderInSection *headerView = [[CAnnotListHeaderInSection alloc] initWithFrame:CGRectMake(0, 0, self.tableView.frame.size.width, 44.0)];
-    [headerView setPageNumber:[key integerValue] + 1];
-    [headerView setAnnotsCount:[val count]];
-    
-    return headerView;
-}
-
-- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
-    CPDFAnnotationListCell *cell = (CPDFAnnotationListCell*)[tableView dequeueReusableCellWithIdentifier:@"cell"];
-    if (cell == nil) {
-        cell = [[CPDFAnnotationListCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
-    }
-    [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
-    if ([self.sequenceList count] == indexPath.section){
- 
-    }else{
-        NSNumber *key = [self.sequenceList objectAtIndex:indexPath.section];
-        NSArray *val = [self.annotsDict objectForKey:key];
-        CPDFAnnotation *annot = [val objectAtIndex:indexPath.row];
-        
-        [cell updateCellWithAnnotation:annot];
-    }
-    return cell;
-}
-
-- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
-    if ([self.sequenceList count] == indexPath.section){
-        return;
-    }
-    
-    NSNumber *key = [self.sequenceList objectAtIndex:indexPath.section];
-    NSArray *val = [self.annotsDict objectForKey:key];
-    CPDFAnnotation *annot = [val objectAtIndex:indexPath.row];
-    
-    if ([self.delegate respondsToSelector:@selector(annotationViewController:jumptoPage:selectAnnot:)]) {
-        [self.delegate annotationViewController:self jumptoPage:[key integerValue] selectAnnot:annot];
-    }
-}
-
-@end

+ 0 - 33
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnatationList/CPDFAnnotionColorDrawView.h

@@ -1,33 +0,0 @@
-//
-//  CPDFAnnotionColorDrawView.h
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//
-
-#import <UIKit/UIKit.h>
-
-typedef NS_ENUM(NSInteger, CPDFAnnotionMarkUpType) {
-    CPDFAnnotionMarkUpTypeHighlight,
-    CPDFAnnotionMarkUpTypeUnderline,
-    CPDFAnnotionMarkUpTypeStrikeout,
-    CPDFAnnotionMarkUpTypeSquiggly,
-    CPDFAnnotionMarkUpTypeFreehand
-};
-
-
-NS_ASSUME_NONNULL_BEGIN
-
-@interface CPDFAnnotionColorDrawView : UIView
-
-@property(nonatomic, strong)UIColor * lineColor;
-
-@property(nonatomic, assign)CPDFAnnotionMarkUpType markUpType;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 58
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnatationList/CPDFAnnotionColorDrawView.m

@@ -1,58 +0,0 @@
-//
-//  CPDFAnnotionColorDrawView.m
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//
-
-#import "CPDFAnnotionColorDrawView.h"
-
-@implementation CPDFAnnotionColorDrawView
-
-- (id)initWithFrame:(CGRect)frame {
-    self = [super initWithFrame:frame];
-    if (self) {
-        // Initialization code
-        self.backgroundColor = [UIColor clearColor];
-        self.alpha = 0.7;
-        self.userInteractionEnabled = NO;
-    }
-    return self;
-}
-
-
-// Only override drawRect: if you perform custom drawing.
-// An empty implementation adversely affects performance during animation.
-- (void)drawRect:(CGRect)rect
-{
-    CGContextRef ctx = UIGraphicsGetCurrentContext();
-    if (!ctx) {
-        return;
-    }
-    
-    CGContextSetStrokeColorWithColor(ctx, _lineColor.CGColor);
-    if (CPDFAnnotionMarkUpTypeUnderline == _markUpType ||
-        CPDFAnnotionMarkUpTypeStrikeout == _markUpType) {
-        CGContextMoveToPoint(ctx, 0, 0);
-        CGContextSetLineWidth(ctx, self.frame.size.width);
-        CGContextAddLineToPoint(ctx, self.frame.size.width,  0);
-    }else if (CPDFAnnotionMarkUpTypeHighlight == _markUpType){
-        CGContextMoveToPoint(ctx, 0, self.frame.size.height/2);
-        CGContextSetLineWidth(ctx, self.frame.size.height);
-        CGContextAddLineToPoint(ctx, self.frame.size.width, self.frame.size.height/2);
-    } else if (CPDFAnnotionMarkUpTypeSquiggly == _markUpType || CPDFAnnotionMarkUpTypeFreehand == _markUpType) {
-        float tWidth = self.frame.size.width / 6.0;
-        CGContextMoveToPoint(ctx, 0, self.frame.size.height/2.0);
-        CGContextSetLineWidth(ctx, 2.0);
-        CGContextAddCurveToPoint(ctx,tWidth,self.frame.size.height,tWidth*2.0,0.0,tWidth*3.0,self.frame.size.height/2.0);
-        CGContextAddCurveToPoint(ctx,tWidth*4.0,self.frame.size.height,tWidth*5.0,0.0,tWidth*6.0,self.frame.size.height/2.0);
-    }
-    CGContextStrokePath(ctx);
-}
-
-
-@end

+ 0 - 23
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationBar/CPDFAnnotationBarButton.h

@@ -1,23 +0,0 @@
-//
-//  CPDFAnnotationBarButton.h
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <UIKit/UIKit.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@interface CPDFAnnotationBarButton : UIButton
-
-@property (nonatomic, strong) UIColor *lineColor;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 63
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationBar/CPDFAnnotationBarButton.m

@@ -1,63 +0,0 @@
-//
-//  CPDFAnnotationBarButton.m
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import "CPDFAnnotationBarButton.h"
-#import "CPDFListView.h"
-
-@implementation CPDFAnnotationBarButton
-
-- (void)drawRect:(CGRect)rect {
-    [super drawRect:rect];
-    CGRect imageFrame = self.imageView.frame;
-    CGContextRef ctx = UIGraphicsGetCurrentContext();
-    CGContextSetStrokeColorWithColor(ctx, self.lineColor.CGColor);
-    if (self.tag == CPDFViewAnnotationModeHighlight) {
-        CGContextMoveToPoint(ctx, CGRectGetMinX(imageFrame)-2, CGRectGetMidY(imageFrame));
-        CGContextSetLineWidth(ctx, CGRectGetHeight(imageFrame));
-        CGContextAddLineToPoint(ctx, CGRectGetMaxX(imageFrame)+2, CGRectGetMidY(imageFrame));
-    }else if (self.tag == CPDFViewAnnotationModeUnderline) {
-        CGContextMoveToPoint(ctx, CGRectGetMinX(imageFrame), CGRectGetMaxY(imageFrame));
-        CGContextSetLineWidth(ctx, 2.0);
-        CGContextAddLineToPoint(ctx, CGRectGetMaxX(imageFrame), CGRectGetMaxY(imageFrame));
-    } else if (self.tag == CPDFViewAnnotationModeStrikeout) {
-        CGContextMoveToPoint(ctx, CGRectGetMinX(imageFrame), CGRectGetMidY(imageFrame));
-        CGContextSetLineWidth(ctx, 2.0);
-        CGContextAddLineToPoint(ctx, CGRectGetMaxX(imageFrame), CGRectGetMidY(imageFrame));
-    } else if (self.tag == CPDFViewAnnotationModeSquiggly) {
-        float tWidth = imageFrame.size.width / 6.0;
-        CGContextMoveToPoint(ctx, CGRectGetMinX(imageFrame), CGRectGetMaxY(imageFrame));
-        CGContextSetLineWidth(ctx, 2.0);
-        CGContextAddCurveToPoint(ctx,
-                                 CGRectGetMinX(imageFrame)+tWidth,CGRectGetMaxY(imageFrame)+4,
-                                 CGRectGetMinX(imageFrame)+tWidth*2.0,CGRectGetMaxY(imageFrame)-4,
-                                 CGRectGetMinX(imageFrame)+tWidth*3.0,CGRectGetMaxY(imageFrame));
-        CGContextAddCurveToPoint(ctx,
-                                 CGRectGetMinX(imageFrame)+tWidth*4.0,CGRectGetMaxY(imageFrame)+4,
-                                 CGRectGetMinX(imageFrame)+tWidth*5.0,CGRectGetMaxY(imageFrame)-4,
-                                 CGRectGetMinX(imageFrame)+tWidth*6.0,CGRectGetMaxY(imageFrame));
-    } else if (self.tag == CPDFViewAnnotationModeInk) {
-        float tWidth = imageFrame.size.width / 6.0;
-        CGContextMoveToPoint(ctx, CGRectGetMinX(imageFrame), CGRectGetMaxY(imageFrame));
-        CGContextSetLineWidth(ctx, 2.0);
-        CGContextAddCurveToPoint(ctx,
-                                 CGRectGetMinX(imageFrame)+tWidth,CGRectGetMaxY(imageFrame)+4,
-                                 CGRectGetMinX(imageFrame)+tWidth*2.0,CGRectGetMaxY(imageFrame)-4,
-                                 CGRectGetMinX(imageFrame)+tWidth*3.0,CGRectGetMaxY(imageFrame));
-        CGContextAddCurveToPoint(ctx,
-                                 CGRectGetMinX(imageFrame)+tWidth*4.0,CGRectGetMaxY(imageFrame)+4,
-                                 CGRectGetMinX(imageFrame)+tWidth*5.0,CGRectGetMaxY(imageFrame)-4,
-                                 CGRectGetMinX(imageFrame)+tWidth*6.0,CGRectGetMaxY(imageFrame));
-    }
-    CGContextStrokePath(ctx);
-}
-
-@end

+ 0 - 87
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationBar/CPDFAnnotationToolBar.h

@@ -1,87 +0,0 @@
-//
-//  CPDFAnnotationToolBar.h
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <UIKit/UIKit.h>
-#import <ComPDFKit_Tools/CPDFListView.h>
-
-typedef NS_ENUM(NSInteger, CPDFToolbarSelectedIndex) {
-    CPDFToolbarNone = 0,
-    CPDFToolbarNote,
-    CPDFToolbarHighlight,
-    CPDFToolbarUnderline,
-    CPDFToolbarStrikeout,
-    CPDFToolbarSquiggly,
-    CPDFToolbarShapeCircle,
-    CPDFToolbarShapeRectangle,
-    CPDFToolbarShapeArrow,
-    CPDFToolbarShapeLine,
-    CPDFToolbarFreehand,
-    CPDFToolbarPencilDrawing,
-    CPDFToolbarFreeText,
-    CPDFToolbarSignature,
-    CPDFToolbarStamp,
-    CPDFToolbarImage,
-    CPDFToolbarLink,
-    CPDFToolbarLSound,
-};
-
-NS_ASSUME_NONNULL_BEGIN
-
-@class CPDFAnnotationToolBar;
-@class CPDFListView;
-@class CPDFInkTopToolBar;
-@class CPDFDrawPencilKitFuncView;
-@class CAnnotationManage;
-
-@protocol CPDFAnnotationBarDelegate <NSObject>
-
-@optional
-
-- (void)annotationBarClick:(CPDFAnnotationToolBar *)annotationBar clickAnnotationMode:(CPDFViewAnnotationMode)annotationMode forSelected:(BOOL)isSelected forButton:(UIButton *)button;
-
-@end
-
-@interface CPDFAnnotationToolBar : UIView
-
-@property (nonatomic, assign) NSInteger shapeStyle;
-
-@property (nonatomic, weak) id<CPDFAnnotationBarDelegate> delegate;
-
-@property (nonatomic, strong) UIViewController *parentVC;
-
-@property (nonatomic, readonly) CPDFListView *pdfListView;
-
-@property (nonatomic, strong) CPDFInkTopToolBar *topToolBar;
-
-@property (nonatomic, strong) CPDFDrawPencilKitFuncView *drawPencilFuncView;
-
-- (instancetype)initAnnotationManage:(CAnnotationManage *)annotationManage;
-
-- (void)reloadData;
-
-- (void)updatePropertiesButtonState;
-
-- (void)updateUndoRedoState;
-
-- (void)buttonItemClicked_openAnnotation:(id)button;
-
-- (void)buttonItemClicked_openModel:(id)button;
-
-- (void)openSignatureAnnotation:(CPDFSignatureWidgetAnnotation *)signatureAnnotation;
-
-- (void)addStampAnnotationWithPage:(CPDFPage *)page point:(CGPoint)point;
-
-- (void)addImageAnnotationWithPage:(CPDFPage *)page point:(CGPoint)point;
-
-@end
-
-NS_ASSUME_NONNULL_END

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 1077
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationBar/CPDFAnnotationToolBar.m


+ 0 - 81
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFAnnotationManage/CAnnotStyle.h

@@ -1,81 +0,0 @@
-//
-//  CAnnotStyle.h
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <UIKit/UIKit.h>
-#import "CPDFListView.h"
-
-NS_ASSUME_NONNULL_BEGIN
-
-@class CPDFPage;
-@class CPDFBorder;
-@class CPDFAnnotation;
-
-@interface CAnnotStyle : NSObject
-
-@property (nonatomic, readonly) CPDFViewAnnotationMode annotMode;
-
-@property (nonatomic, readonly) NSArray *annotations;
-
-@property (nonatomic, readonly) BOOL isSelectAnnot;
-
-- (instancetype)initWithAnnotionMode:(CPDFViewAnnotationMode)annotionMode annotations:(NSArray *)annotations;
-
-#pragma mark - Common
-
-- (UIColor *)color;
-- (void)setColor:(UIColor *)color;
-
-- (CGFloat)opacity;
-- (void)setOpacity:(CGFloat)opacity;
-
-- (CPDFBorderStyle)style;
-- (void)setStyle:(CPDFBorderStyle)style;
-
-- (NSArray *)dashPattern;
-- (void)setDashPattern:(NSArray *)dashPattern;
-
-- (CGFloat)lineWidth;
-- (void)setLineWidth:(CGFloat)lineWidth;
-
-#pragma mark - Line
-
-- (CPDFLineStyle)startLineStyle;
-- (void)setStartLineStyle:(CPDFLineStyle)startLineStyle;
-
-- (CPDFLineStyle)endLineStyle;
-- (void)setEndLineStyle:(CPDFLineStyle)endLineStyle;
-
-#pragma mark - FreeText
-
-- (UIColor *)fontColor;
-- (void)setFontColor:(UIColor *)fontColor;
-
-- (CGFloat)fontSize;
-- (void)setFontSize:(CGFloat)fontSize;
-
-- (NSString *)fontName;
-- (void)setFontName:(NSString *)fontName;
-
-- (NSTextAlignment)alignment;
-- (void)setAlignment:(NSTextAlignment)alignment;
-
-#pragma mark - Circle&Square
-
-- (UIColor *)interiorColor;
-- (void)setInteriorColor:(UIColor *)interiorColor;
-
-- (CGFloat)interiorOpacity;
-- (void)setInteriorOpacity:(CGFloat)interiorOpacity;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 997
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFAnnotationManage/CAnnotStyle.m

@@ -1,997 +0,0 @@
-//
-//  CAnnotStyle.m
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import "CAnnotStyle.h"
-#import "CPDFListView.h"
-#import "CStringConstants.h"
-
-#import "CPDFAnnotation+PDFListView.h"
-
-#pragma mark - NSUserDefaults
-
-@interface NSUserDefaults (PDFListView)
-
-- (UIColor *)PDFListViewColorForKey:(NSString *)key;
-
-- (void)setPDFListViewColor:(UIColor *)color forKey:(NSString *)key;
-
-@end
-
-@implementation NSUserDefaults (PDFListView)
-
-- (UIColor *)PDFListViewColorForKey:(NSString *)key {
-    NSString *colorString = [self objectForKey:key];
-    UIColor *color;
-    if ([colorString isKindOfClass:[NSData class]]) {
-        NSData *data = (NSData *)colorString;
-        color = [NSKeyedUnarchiver unarchiveObjectWithData:data];
-    } else {
-        color = [NSUserDefaults colorWithHexString:colorString];
-    }
-    return color;
-}
-
-- (void)setPDFListViewColor:(UIColor *)color forKey:(NSString *)key {
-    NSString *colorString = [NSUserDefaults hexStringWithAlphaColor:color];
-    [self setObject:colorString forKey:key];
-    [self synchronize];
-}
-
-+ (NSString *)hexStringWithAlphaColor:(UIColor *)color {
-    NSString *colorStr = [NSUserDefaults hexStringWithColor:color];
-    CGFloat a = 1.;
-    CGFloat r,g,b;
-    [color getRed:&r green:&g blue:&b alpha:&a];
-    NSString *alphaStr = [NSUserDefaults getHexByDecimal:a*255];
-    if (alphaStr.length < 2) {
-        alphaStr = [@"0" stringByAppendingString:alphaStr];
-    }
-    return [colorStr stringByAppendingString:alphaStr];
-}
-
-+ (NSString *)hexStringWithColor:(UIColor *)color {
-    if (!color) {
-        return nil;
-    }
-    CGFloat r,g,b,a;
-    [color getRed:&r green:&g blue:&b alpha:&a];
-    
-    return [NSString stringWithFormat:@"#%@%@%@",[NSUserDefaults colorStringWithValue:r],[NSUserDefaults colorStringWithValue:g],[NSUserDefaults colorStringWithValue:b]];
-}
-
-+ (NSString *)colorStringWithValue:(CGFloat )value {
-    NSString *str = [NSUserDefaults getHexByDecimal:(NSInteger)(value*255)];
-    if (str.length < 2) {
-        return [NSString stringWithFormat:@"0%@",str];
-    }
-    return str;
-}
-
-+ (NSString *)getHexByDecimal:(NSInteger)decimal {
-    NSString *hex =@"";
-    NSString *letter;
-    NSInteger number;
-    for (int i = 0; i<9; i++) {
-        
-        number = decimal % 16;
-        decimal = decimal / 16;
-        switch (number) {
-            case 10:
-                letter =@"A"; break;
-            case 11:
-                letter =@"B"; break;
-            case 12:
-                letter =@"C"; break;
-            case 13:
-                letter =@"D"; break;
-            case 14:
-                letter =@"E"; break;
-            case 15:
-                letter =@"F"; break;
-            default:
-                letter = [NSString stringWithFormat:@"%ld", number];
-        }
-        hex = [letter stringByAppendingString:hex];
-        if (decimal == 0) {
-            
-            break;
-        }
-    }
-    return hex;
-}
-
-+ (UIColor *)colorWithHexString:(NSString *)hexStr {
-    NSString *cString = [[hexStr stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] uppercaseString];
-    
-    // String should be 6 or 8 characters
-    if ([cString length] < 6) {
-        return nil;
-    }
-    if ([cString hasPrefix:@"0X"])
-        cString = [cString substringFromIndex:2];
-    if ([cString hasPrefix:@"#"])
-        cString = [cString substringFromIndex:1];
-    if ([cString length] < 6)
-        return nil;
-
-    NSRange range;
-    range.location = 0;
-    range.length = 2;
-    //R、G、B
-    NSString *rString = [cString substringWithRange:range];
-    range.location = 2;
-    NSString *gString = [cString substringWithRange:range];
-    range.location = 4;
-    NSString *bString = [cString substringWithRange:range];
-    // Scan values
-    unsigned int r, g, b,a;
-    [[NSScanner scannerWithString:rString] scanHexInt:&r];
-    [[NSScanner scannerWithString:gString] scanHexInt:&g];
-    [[NSScanner scannerWithString:bString] scanHexInt:&b];
-    float alpha = 1.;
-    if ([cString length] == 8) {
-        NSString *aStr = [cString substringWithRange:NSMakeRange(6, 2)];
-        [[NSScanner scannerWithString:aStr] scanHexInt:&a];
-        alpha = a/255.;
-    }
-    return [UIColor colorWithRed:((float) r / 255.0f) green:((float) g / 255.0f) blue:((float) b / 255.0f) alpha:alpha];
-}
-
-@end
-
-
-#pragma mark - CAnnotStyle
-
-@interface CAnnotStyle ()
-
-@property (nonatomic, strong) NSArray *headKeys;
-
-@property (nonatomic, strong) NSArray *trialKeys;
-
-@property (nonatomic, strong) NSArray *annotations;
-
-@property (nonatomic, assign) CPDFViewAnnotationMode annotMode;
-
-@property (nonatomic, assign) BOOL isSelectAnnot;
-
-@end
-
-@implementation CAnnotStyle
-
-
-- (instancetype)initWithAnnotionMode:(CPDFViewAnnotationMode)annotionMode annotations:(NSArray *)annotations {
-    if (self = [super init]) {
-        if(annotations.count > 0) {
-            self.isSelectAnnot = YES;
-            self.annotations = annotations;
-            self.annotMode = [self convertAnnotationType];
-        } else {
-            self.isSelectAnnot = NO;
-            self.annotMode = annotionMode;
-        }
-    }
-    return self;
-}
-
-- (CPDFAnnotation *)annotation {
-    return self.annotations.firstObject;
-}
-
-- (CPDFViewAnnotationMode)convertAnnotationType {
-    CPDFViewAnnotationMode annotationType = CPDFViewAnnotationModeNone;
-    if ([self.annotation isKindOfClass:[CPDFFreeTextAnnotation class]]) {
-        annotationType = CPDFViewAnnotationModeFreeText;
-    } else if ([self.annotation isKindOfClass:[CPDFTextAnnotation class]]) {
-        annotationType = CPDFViewAnnotationModeNote;
-    } else if ([self.annotation isKindOfClass:[CPDFCircleAnnotation class]]) {
-        annotationType = CPDFViewAnnotationModeCircle;
-    } else if ([self.annotation isKindOfClass:[CPDFSquareAnnotation class]]) {
-        annotationType = CPDFViewAnnotationModeSquare;
-    } else if ([self.annotation isKindOfClass:[CPDFMarkupAnnotation class]]) {
-        CPDFMarkupAnnotation *markup = (CPDFMarkupAnnotation *)self.annotation;
-        if (CPDFMarkupTypeHighlight == markup.markupType) {
-            annotationType = CPDFViewAnnotationModeHighlight;
-        } else if (CPDFMarkupTypeStrikeOut == markup.markupType) {
-            annotationType = CPDFViewAnnotationModeStrikeout;
-        } else if (CPDFMarkupTypeUnderline == markup.markupType) {
-            annotationType = CPDFViewAnnotationModeUnderline;
-        } else if (CPDFMarkupTypeSquiggly == markup.markupType) {
-            annotationType = CPDFViewAnnotationModeSquiggly;
-        }
-    } else if ([self.annotation isKindOfClass:[CPDFLineAnnotation class]]) {
-        CPDFLineAnnotation *line = (CPDFLineAnnotation *)self.annotation;
-        if (CPDFLineStyleNone == line.endLineStyle && CPDFLineStyleNone == line.startLineStyle) {
-            annotationType = CPDFViewAnnotationModeLine;
-        } else {
-            annotationType = CPDFViewAnnotationModeArrow;
-        }
-    } else if ([self.annotation isKindOfClass:[CPDFInkAnnotation class]]) {
-        annotationType = CPDFViewAnnotationModeInk;
-    } else if ([self.annotation isKindOfClass:[CPDFLinkAnnotation class]]) {
-        annotationType = CPDFViewAnnotationModeLink;
-    } else if ([self.annotation isKindOfClass:[CPDFSignatureAnnotation class]]) {
-        annotationType = CPDFViewAnnotationModeSignature;
-    } else if ([self.annotation isKindOfClass:[CPDFStampAnnotation class]]) {
-        annotationType = CPDFViewAnnotationModeStamp;
-    } else if ([self.annotation isKindOfClass:[CPDFSoundAnnotation class]]) {
-        annotationType = CPDFViewAnnotationModeSound;
-    }else if([self.annotation isKindOfClass:[CPDFTextWidgetAnnotation class]]){
-        annotationType = CPDFViewFormModeText;
-    }else if([self.annotation isKindOfClass:[CPDFButtonWidgetAnnotation class]]) {
-        CPDFButtonWidgetAnnotation * annotation = (CPDFButtonWidgetAnnotation*)self.annotation;
-        if(annotation.controlType == CPDFWidgetCheckBoxControl) {
-            annotationType = CPDFViewFormModeCheckBox;
-        }else if(annotation.controlType == CPDFWidgetRadioButtonControl) {
-            annotationType = CPDFViewFormModeRadioButton;
-        }else if(annotation.controlType == CPDFWidgetPushButtonControl) {
-            annotationType = CPDFViewFormModeButton;
-        }
-    }else if([self.annotation isKindOfClass:[CPDFChoiceWidgetAnnotation class]]){
-        CPDFChoiceWidgetAnnotation * annotation = (CPDFChoiceWidgetAnnotation*)self.annotation;
-        if(annotation.isListChoice){
-            annotationType = CPDFViewFormModeList;
-        }else {
-            annotationType = CPDFViewFormModeCombox;
-        }
-    }
-
-    return annotationType;
-}
-
-#pragma mark - Common
-
-- (UIColor *)color {
-    UIColor  *color = nil;
-    if (self.isSelectAnnot) {
-        color = [self annotation].color;
-    } else {
-        NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
-        switch (_annotMode) {
-            case CPDFViewAnnotationModeNote:
-                color = [userDefaults PDFListViewColorForKey:CAnchoredNoteColorKey];
-                break;
-            case CPDFViewAnnotationModeCircle:
-                color = [userDefaults PDFListViewColorForKey:CCircleNoteColorKey];
-                break;
-            case CPDFViewAnnotationModeSquare:
-                color = [userDefaults PDFListViewColorForKey:CSquareNoteColorKey];
-                break;
-            case CPDFViewAnnotationModeHighlight:
-                color = [userDefaults PDFListViewColorForKey:CHighlightNoteColorKey];
-                break;
-            case CPDFViewAnnotationModeUnderline:
-                color = [userDefaults PDFListViewColorForKey:CUnderlineNoteColorKey];
-                break;
-            case CPDFViewAnnotationModeStrikeout:
-                color = [userDefaults PDFListViewColorForKey:CStrikeOutNoteColorKey];
-                break;
-            case CPDFViewAnnotationModeSquiggly:
-                color = [userDefaults PDFListViewColorForKey:CSquigglyNoteColorKey];
-                break;
-            case CPDFViewAnnotationModeLine:
-                color = [userDefaults PDFListViewColorForKey:CLineNoteColorKey];
-                break;
-            case CPDFViewAnnotationModeArrow:
-                color = [userDefaults PDFListViewColorForKey:CArrowNoteColorKey];
-                break;
-            case CPDFViewAnnotationModeInk:
-                color = [CPDFKitConfig sharedInstance].freehandAnnotationColor;
-                break;
-            default:
-                break;
-        }
-    }
-    return color;
-}
-
-- (void)setColor:(UIColor *)color {
-    if (self.isSelectAnnot) {
-        for (CPDFAnnotation *annotation in self.annotations) {
-            annotation.color = color;
-        }
-    } else {
-        NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
-        switch (self.annotMode) {
-            case CPDFViewAnnotationModeNote:
-                [userDefaults setPDFListViewColor:color forKey:CAnchoredNoteColorKey];
-                break;
-            case CPDFViewAnnotationModeCircle:
-                [userDefaults setPDFListViewColor:color forKey:CCircleNoteColorKey];
-                break;
-            case CPDFViewAnnotationModeSquare:
-                [userDefaults setPDFListViewColor:color forKey:CSquareNoteColorKey];
-                break;
-            case CPDFViewAnnotationModeHighlight:
-                [userDefaults setPDFListViewColor:color forKey:CHighlightNoteColorKey];
-                break;
-            case CPDFViewAnnotationModeUnderline:
-                [userDefaults setPDFListViewColor:color forKey:CUnderlineNoteColorKey];
-                break;
-            case CPDFViewAnnotationModeStrikeout:
-                [userDefaults setPDFListViewColor:color forKey:CStrikeOutNoteColorKey];
-                break;
-            case CPDFViewAnnotationModeSquiggly:
-                [userDefaults setPDFListViewColor:color forKey:CSquigglyNoteColorKey];
-                break;
-            case CPDFViewAnnotationModeLine:
-                [userDefaults setPDFListViewColor:color forKey:CLineNoteColorKey];
-                break;
-            case CPDFViewAnnotationModeArrow:
-                [userDefaults setPDFListViewColor:color forKey:CArrowNoteColorKey];
-                break;
-            case CPDFViewAnnotationModeInk:
-                [[CPDFKitConfig sharedInstance] setFreehandAnnotationColor:color];
-                [userDefaults setPDFListViewColor:color forKey:CInkNoteColorKey];
-                break;
-            default:
-                break;
-        }
-        [userDefaults synchronize];
-    }
-}
-
-- (CGFloat)opacity {
-    CGFloat opacity = 0;
-    if (self.isSelectAnnot) {
-        opacity = self.annotation.opacity;
-    } else {
-        NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
-        switch (self.annotMode) {
-            case CPDFViewAnnotationModeFreeText:
-                opacity = [userDefaults floatForKey:CFreeTextNoteOpacityKey];
-                break;
-            case CPDFViewAnnotationModeNote:
-                opacity = [userDefaults floatForKey:CAnchoredNoteOpacityKey];
-                break;
-            case CPDFViewAnnotationModeCircle:
-                opacity = [userDefaults floatForKey:CCircleNoteOpacityKey];
-                break;
-            case CPDFViewAnnotationModeSquare:
-                opacity = [userDefaults floatForKey:CSquareNoteOpacityKey];
-                break;
-            case CPDFViewAnnotationModeHighlight:
-                opacity = [userDefaults floatForKey:CHighlightNoteOpacityKey];
-                break;
-            case CPDFViewAnnotationModeUnderline:
-                opacity = [userDefaults floatForKey:CUnderlineNoteOpacityKey];
-                break;
-            case CPDFViewAnnotationModeStrikeout:
-                opacity = [userDefaults floatForKey:CStrikeOutNoteOpacityKey];
-                break;
-            case CPDFViewAnnotationModeSquiggly:
-                opacity = [userDefaults floatForKey:CSquigglyNoteOpacityKey];
-                break;
-            case CPDFViewAnnotationModeLine:
-                opacity = [userDefaults floatForKey:CLineNoteOpacityKey];
-                break;
-            case CPDFViewAnnotationModeArrow:
-                opacity = [userDefaults floatForKey:CArrowNoteOpacityKey];
-                break;
-            case CPDFViewAnnotationModeInk:
-                opacity = [CPDFKitConfig sharedInstance].freehandAnnotationOpacity;
-                opacity/=100;
-                break;
-            default:
-                break;
-        }
-    }
-    return opacity;
-}
-
-- (void)setOpacity:(CGFloat)opacity {
-    if (self.isSelectAnnot) {
-        for (CPDFAnnotation *annotation in self.annotations) {
-            [annotation setOpacity:opacity];
-        }
-    } else {
-        NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
-        switch (self.annotMode) {
-            case CPDFViewAnnotationModeFreeText:
-                [userDefaults setFloat:opacity forKey:CFreeTextNoteOpacityKey];
-                break;
-            case CPDFViewAnnotationModeNote:
-                [userDefaults setFloat:opacity forKey:CAnchoredNoteOpacityKey];
-                break;
-            case CPDFViewAnnotationModeCircle:
-                [userDefaults setFloat:opacity forKey:CCircleNoteOpacityKey];
-                break;
-            case CPDFViewAnnotationModeSquare:
-                [userDefaults setFloat:opacity forKey:CSquareNoteOpacityKey];
-                break;
-            case CPDFViewAnnotationModeHighlight:
-                [userDefaults setFloat:opacity forKey:CHighlightNoteOpacityKey];
-                break;
-            case CPDFViewAnnotationModeUnderline:
-                [userDefaults setFloat:opacity forKey:CUnderlineNoteOpacityKey];
-                break;
-            case CPDFViewAnnotationModeStrikeout:
-                [userDefaults setFloat:opacity forKey:CStrikeOutNoteOpacityKey];
-                break;
-            case CPDFViewAnnotationModeSquiggly:
-                [userDefaults setFloat:opacity forKey:CSquigglyNoteOpacityKey];
-                break;
-            case CPDFViewAnnotationModeLine:
-                [userDefaults setFloat:opacity forKey:CLineNoteOpacityKey];
-                break;
-            case CPDFViewAnnotationModeArrow:
-                [userDefaults setFloat:opacity forKey:CArrowNoteOpacityKey];
-                break;
-            case CPDFViewAnnotationModeInk:
-                [[CPDFKitConfig sharedInstance] setFreehandAnnotationOpacity:opacity * 100];
-
-                [userDefaults setFloat:opacity forKey:CInkNoteOpacityKey];
-                break;
-            default:
-                break;
-        }
-        [userDefaults synchronize];
-    }
-}
-
-- (CPDFBorderStyle)style {
-    CPDFBorderStyle style = CPDFBorderStyleSolid;
-    if (self.isSelectAnnot) {
-        style = self.annotation.borderStyle;
-    } else {
-        NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
-        switch (self.annotMode) {
-            case CPDFViewAnnotationModeFreeText:
-                style = [userDefaults integerForKey:CFreeTextNoteLineStyleKey];
-                break;
-            case CPDFViewAnnotationModeCircle:
-                style = [userDefaults integerForKey:CCircleNoteLineStyleKey];
-                break;
-            case CPDFViewAnnotationModeSquare:
-                style = [userDefaults integerForKey:CSquareNoteLineStyleKey];
-                break;
-            case CPDFViewAnnotationModeLine:
-                style = [userDefaults integerForKey:CLineNoteLineStyleKey];
-                break;
-            case CPDFViewAnnotationModeArrow:
-                style = [userDefaults integerForKey:CArrowNoteLineStyleKey];
-                break;
-            case CPDFViewAnnotationModeInk:
-                style = [userDefaults integerForKey:CInkNoteLineStyleyKey];
-                break;
-            default:
-                break;
-        }
-    }
-    return style;
-}
-
-- (void)setStyle:(CPDFBorderStyle)style {
-    if (self.isSelectAnnot) {
-        for (CPDFAnnotation *annotation in self.annotations) {
-            [annotation setBorderStyle:style];
-        }
-    } else {
-        NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
-        switch (self.annotMode) {
-            case CPDFViewAnnotationModeFreeText:
-                [userDefaults setInteger:style forKey:CFreeTextNoteLineStyleKey];
-                break;
-            case CPDFViewAnnotationModeCircle:
-                [userDefaults setInteger:style forKey:CCircleNoteLineStyleKey];
-                break;
-            case CPDFViewAnnotationModeSquare:
-                [userDefaults setInteger:style forKey:CSquareNoteLineStyleKey];
-                break;
-            case CPDFViewAnnotationModeLine:
-                [userDefaults setInteger:style forKey:CLineNoteLineStyleKey];
-                break;
-            case CPDFViewAnnotationModeArrow:
-                [userDefaults setInteger:style forKey:CArrowNoteLineStyleKey];
-                break;
-            case CPDFViewAnnotationModeInk:
-                [userDefaults setInteger:style forKey:CInkNoteLineStyleyKey];
-                break;
-            default:
-                break;
-        }
-        [userDefaults synchronize];
-    }
-}
-
-- (NSArray *)dashPattern {
-    if (self.isSelectAnnot) {
-        if(CPDFBorderStyleDashed == self.annotation.border.style) {
-            return self.annotation.dashPattern;
-        } else {
-            return 0;
-        }
-    } else {
-        NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
-        NSInteger dashPattern = 0;
-        switch (self.annotMode) {
-            case CPDFViewAnnotationModeFreeText:
-                dashPattern = [userDefaults integerForKey:CFreeTextNoteDashPatternKey];
-                break;
-            case CPDFViewAnnotationModeCircle:
-                dashPattern = [userDefaults integerForKey:CCircleNoteDashPatternKey];
-                break;
-            case CPDFViewAnnotationModeSquare:
-                dashPattern = [userDefaults integerForKey:CSquareNoteDashPatternKey];
-                break;
-            case CPDFViewAnnotationModeLine:
-                dashPattern = [userDefaults integerForKey:CLineNoteDashPatternKey];
-                break;
-            case CPDFViewAnnotationModeArrow:
-                dashPattern = [userDefaults integerForKey:CArrowNoteDashPatternKey];
-                break;
-            case CPDFViewAnnotationModeInk:
-                dashPattern = [userDefaults integerForKey:CInkNoteDashPatternKey];
-                break;
-            default:
-                break;
-        }
-        if(CPDFBorderStyleDashed != self.style) {
-            dashPattern=  0;
-        }
-        return @[@(dashPattern)];
-    }
-}
-- (void)setDashPattern:(NSArray *)dashPatterns {
-    if (self.isSelectAnnot) {
-        for (CPDFAnnotation *annotation in self.annotations) {
-            [annotation setDashPattern:dashPatterns];
-        }
-    } else {
-        NSInteger dashPattern = [dashPatterns.firstObject integerValue];
-
-        NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
-        switch (self.annotMode) {
-            case CPDFViewAnnotationModeFreeText:
-                [userDefaults setInteger:dashPattern forKey:CFreeTextNoteDashPatternKey];
-                break;
-            case CPDFViewAnnotationModeCircle:
-                [userDefaults setInteger:dashPattern forKey:CCircleNoteDashPatternKey];
-                break;
-            case CPDFViewAnnotationModeSquare:
-                [userDefaults setInteger:dashPattern forKey:CSquareNoteDashPatternKey];
-                break;
-            case CPDFViewAnnotationModeLine:
-                [userDefaults setInteger:dashPattern forKey:CLineNoteDashPatternKey];
-                break;
-            case CPDFViewAnnotationModeArrow:
-                [userDefaults setInteger:dashPattern forKey:CArrowNoteDashPatternKey];
-                break;
-            case CPDFViewAnnotationModeInk:
-                [userDefaults setInteger:dashPattern forKey:CInkNoteDashPatternKey];
-                break;
-            default:
-                break;
-        }
-        [userDefaults synchronize];
-    }
-}
-
-- (CGFloat)lineWidth {
-    CGFloat lineWidth = 0;
-    if (self.isSelectAnnot) {
-        lineWidth = self.annotation.lineWidth;
-    } else {
-        NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
-        switch (self.annotMode) {
-            case CPDFViewAnnotationModeCircle:
-                lineWidth = [userDefaults floatForKey:CCircleNoteLineWidthKey];
-                break;
-            case CPDFViewAnnotationModeSquare:
-                lineWidth = [userDefaults floatForKey:CSquareNoteLineWidthKey];
-                break;
-            case CPDFViewAnnotationModeLine:
-                lineWidth = [userDefaults floatForKey:CLineNoteLineWidthKey];
-                break;
-            case CPDFViewAnnotationModeArrow:
-                lineWidth = [userDefaults floatForKey:CArrowNoteLineWidthKey];
-                break;
-            case CPDFViewAnnotationModeInk:
-                lineWidth = [CPDFKitConfig sharedInstance].freehandAnnotationBorderWidth;
-                break;
-            default:
-                break;
-        }
-    }
-    return lineWidth;
-}
-
-- (void)setLineWidth:(CGFloat)lineWidth {
-    if (self.isSelectAnnot) {
-        for (CPDFAnnotation *annotation in self.annotations) {
-            [annotation setBorderWidth:lineWidth];
-        }
-    } else {
-        NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
-        switch (self.annotMode) {
-            case CPDFViewAnnotationModeCircle:
-                [userDefaults setFloat:lineWidth forKey:CCircleNoteLineWidthKey];
-                break;
-            case CPDFViewAnnotationModeSquare:
-                [userDefaults setFloat:lineWidth forKey:CSquareNoteLineWidthKey];
-                break;
-            case CPDFViewAnnotationModeLine:
-                [userDefaults setFloat:lineWidth forKey:CLineNoteLineWidthKey];
-                break;
-            case CPDFViewAnnotationModeArrow:
-                [userDefaults setFloat:lineWidth forKey:CArrowNoteLineWidthKey];
-                break;
-            case CPDFViewAnnotationModeInk:
-                [[CPDFKitConfig sharedInstance] setFreehandAnnotationBorderWidth:lineWidth];
-
-                [userDefaults setFloat:lineWidth forKey:CInkNoteLineWidthKey];
-                break;
-            default:
-                break;
-        }
-        [userDefaults synchronize];
-    }
-}
-
-
-- (CPDFLineStyle)startLineStyle {
-    CPDFLineStyle startLineStyle = CPDFLineStyleNone;
-    if (self.isSelectAnnot) {
-        if ([self.annotation isKindOfClass:[CPDFLineAnnotation class]]) {
-            startLineStyle = [(CPDFLineAnnotation *)self.annotation startLineStyle];
-        }
-    } else {
-        NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
-        switch (self.annotMode) {
-            case CPDFViewAnnotationModeArrow:
-                startLineStyle = [userDefaults integerForKey:CArrowNoteStartStyleKey];
-                break;
-            case CPDFViewAnnotationModeLine:
-                startLineStyle = [userDefaults integerForKey:CLineNoteStartStyleKey];
-                break;
-            default:
-                break;
-        }
-    }
-    return startLineStyle;
-}
-
-- (void)setStartLineStyle:(CPDFLineStyle)startLineStyle {
-    if(self.isSelectAnnot) {
-        for (CPDFAnnotation *annotation in self.annotations) {
-            if([annotation isKindOfClass:[CPDFLineAnnotation class]]){
-                [(CPDFLineAnnotation*)annotation setStartLineStyle:startLineStyle];
-            }
-        }
-    } else {
-        NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
-        switch (self.annotMode) {
-            case CPDFViewAnnotationModeArrow:
-                [userDefaults setInteger:startLineStyle forKey:CArrowNoteStartStyleKey];
-                break;
-            case CPDFViewAnnotationModeLine:
-                [userDefaults setInteger:startLineStyle forKey:CLineNoteStartStyleKey];
-                break;
-            default:
-                break;
-        }
-        [userDefaults synchronize];
-    }
-}
-
-- (CPDFLineStyle)endLineStyle {
-    CPDFLineStyle endLineStyle = CPDFLineStyleNone;
-    if(self.isSelectAnnot) {
-        if ([self.annotation isKindOfClass:[CPDFLineAnnotation class]]) {
-            endLineStyle = [(CPDFLineAnnotation *)self.annotation endLineStyle];
-        }
-    } else {
-        NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
-        switch (self.annotMode) {
-            case CPDFViewAnnotationModeArrow:
-                endLineStyle = [userDefaults integerForKey:CArrowNoteEndStyleKey];
-                break;
-            case CPDFViewAnnotationModeLine:
-                endLineStyle = [userDefaults integerForKey:CLineNoteEndStyleKey];
-                break;
-            default:
-                break;
-        }
-    }
-    return endLineStyle;
-}
-
--(void)setEndLineStyle:(CPDFLineStyle)endLineStyle {
-    if(self.isSelectAnnot) {
-        for (CPDFAnnotation *annotation in self.annotations) {
-            if([annotation isKindOfClass:[CPDFLineAnnotation class]]){
-                [(CPDFLineAnnotation*)annotation setEndLineStyle:endLineStyle];
-            }
-        }
-    } else {
-        NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
-        switch (self.annotMode) {
-            case CPDFViewAnnotationModeArrow:
-                [userDefaults setInteger:endLineStyle forKey:CArrowNoteEndStyleKey];
-                break;
-            case CPDFViewAnnotationModeLine:
-                [userDefaults setInteger:endLineStyle forKey:CLineNoteEndStyleKey];
-                break;
-            default:
-                break;
-        }
-        [userDefaults synchronize];
-    }
-}
-
-#pragma mark - FreeText
-
-- (UIColor *)fontColor {
-    UIColor  *color = nil;
-    if (self.isSelectAnnot) {
-        if([self.annotation isKindOfClass:[CPDFFreeTextAnnotation class]]) {
-            color = [(CPDFFreeTextAnnotation *)self.annotation fontColor];
-        }
-    } else {
-        NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
-        switch (self.annotMode) {
-            case CPDFViewAnnotationModeFreeText:
-                color = [userDefaults PDFListViewColorForKey:CFreeTextNoteFontColorKey];
-                break;
-            default:
-                break;
-        }
-    }
-    return color;
-}
-
-- (void)setFontColor:(UIColor *)fontColor {
-    if (self.isSelectAnnot) {
-        for (CPDFAnnotation *annotation in self.annotations) {
-            if ([annotation isKindOfClass:[CPDFFreeTextAnnotation class]]) {
-                CGFloat red,green,blue,alpha;
-                [fontColor getRed:&red green:&green blue:&blue alpha:&alpha];
-                [(CPDFFreeTextAnnotation *)annotation setFontColor:[UIColor colorWithRed:red green:green blue:blue alpha:self.opacity]];
-            }
-        }
-    } else {
-        NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
-        switch (self.annotMode) {
-            case CPDFViewAnnotationModeFreeText:
-                [userDefaults setPDFListViewColor:fontColor forKey:CFreeTextNoteFontColorKey];
-                break;
-            default:
-                break;
-        }
-        [userDefaults synchronize];
-    }
-}
-
-- (CGFloat)fontSize {
-    CGFloat fontSize = 11;
-    if (self.isSelectAnnot) {
-        if ([self.annotation isKindOfClass:[CPDFFreeTextAnnotation class]]) {
-            fontSize = [(CPDFFreeTextAnnotation *)self.annotation font].pointSize;
-        }
-    } else {
-        NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
-        switch (self.annotMode) {
-            case CPDFViewAnnotationModeFreeText:
-                fontSize = [userDefaults floatForKey:CFreeTextNoteFontSizeKey];
-                break;
-            default:
-                break;
-        }
-    }
-    return fontSize;
-}
-
-- (void)setFontSize:(CGFloat)fontSize {
-    if (self.isSelectAnnot) {
-        for (CPDFAnnotation *annotation in self.annotations) {
-            if ([annotation isKindOfClass:[CPDFFreeTextAnnotation class]]) {
-                UIFont  *font = [(CPDFFreeTextAnnotation *)annotation font];
-                [(CPDFFreeTextAnnotation *)annotation setFont:[UIFont fontWithName:font.fontName size:fontSize]];
-            }
-        }
-    } else {
-        NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
-        switch (self.annotMode) {
-            case CPDFViewAnnotationModeFreeText:
-                [userDefaults setFloat:fontSize forKey:CFreeTextNoteFontSizeKey];
-                break;
-            default:
-                break;
-        }
-        [userDefaults synchronize];
-    }
-
-}
-
-- (NSString *)fontName {
-    NSString  *fontName = nil;
-    if (self.isSelectAnnot) {
-        if ([self.annotation isKindOfClass:[CPDFFreeTextAnnotation class]]) {
-            fontName = [(CPDFFreeTextAnnotation *)self.annotation font].fontName;
-        }
-    } else {
-        NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
-        switch (self.annotMode) {
-            case CPDFViewAnnotationModeFreeText:
-                fontName = [userDefaults objectForKey:CFreeTextNoteFontNameKey];
-                break;
-            default:
-                break;
-        }
-    }
-    return fontName;
-}
-
-- (void)setFontName:(NSString *)fontName {
-    if (self.isSelectAnnot) {
-        for (CPDFAnnotation *annotation in self.annotations) {
-            if ([annotation isKindOfClass:[CPDFFreeTextAnnotation class]]) {
-                UIFont  *font = [(CPDFFreeTextAnnotation *)annotation font];
-                [(CPDFFreeTextAnnotation *)annotation setFont:[UIFont fontWithName:fontName size:font.pointSize]];
-            }
-        }
-    } else {
-        NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
-        switch (self.annotMode) {
-            case CPDFViewAnnotationModeFreeText:
-                [userDefaults setObject:fontName forKey:CFreeTextNoteFontNameKey];
-                break;
-            default:
-                break;
-        }
-        [userDefaults synchronize];
-    }
-}
-
-- (NSTextAlignment)alignment {
-    NSTextAlignment alignment = NSTextAlignmentLeft;
-    if (self.isSelectAnnot) {
-        if ([self.annotation isKindOfClass:[CPDFFreeTextAnnotation class]]) {
-            alignment = [(CPDFFreeTextAnnotation *)self.annotation alignment];
-        }
-    } else {
-        NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
-        switch (self.annotMode) {
-            case CPDFViewAnnotationModeFreeText:
-                alignment = [userDefaults integerForKey:CFreeTextNoteAlignmentKey];
-                break;
-            default:
-                break;
-        }
-    }
-    return alignment;
-}
-
-- (void)setAlignment:(NSTextAlignment)alignment {
-    if (self.isSelectAnnot){
-        for (CPDFAnnotation *annotation in self.annotations) {
-        if ([annotation isKindOfClass:[CPDFFreeTextAnnotation class]]) {
-                [(CPDFFreeTextAnnotation *)annotation setAlignment:alignment];
-            }
-        }
-    } else {
-        NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
-        switch (self.annotMode) {
-            case CPDFViewAnnotationModeFreeText:
-                [userDefaults setInteger:alignment forKey:CFreeTextNoteAlignmentKey];
-                break;
-            default:
-                break;
-        }
-        [userDefaults synchronize];
-    }
-}
-
-#pragma mark - Circle&Square
-
-- (UIColor *)interiorColor {
-    UIColor  *interiorColor = nil;
-    if (self.isSelectAnnot) {
-        if([self.annotation isKindOfClass:[CPDFCircleAnnotation class]] ||
-            [self.annotation isKindOfClass:[CPDFSquareAnnotation class]]) {
-            interiorColor = [(CPDFCircleAnnotation *)self.annotation interiorColor];
-        } else if ([self.annotation isKindOfClass:[CPDFFreeTextAnnotation class]]) {
-            interiorColor = [(CPDFFreeTextAnnotation *)self.annotation color];
-        }
-    } else {
-        NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
-        switch (self.annotMode) {
-            case CPDFViewAnnotationModeCircle:
-                interiorColor = [userDefaults PDFListViewColorForKey:CCircleNoteInteriorColorKey];
-                break;
-            case CPDFViewAnnotationModeSquare:
-                interiorColor = [userDefaults PDFListViewColorForKey:CSquareNoteInteriorColorKey];
-                break;
-            default:
-                break;
-        }
-    }
-
-    return interiorColor;
-}
-
-- (void)setInteriorColor:(UIColor *)interiorColor {
-    if (self.isSelectAnnot){
-        for (CPDFAnnotation *annotation in self.annotations) {
-            if ([annotation isKindOfClass:[CPDFCircleAnnotation class]] ||
-                [annotation isKindOfClass:[CPDFSquareAnnotation class]]) {
-                [(CPDFCircleAnnotation *)annotation setInteriorColor:interiorColor];
-            } else if ([annotation isKindOfClass:[CPDFFreeTextAnnotation class]]) {
-                [(CPDFFreeTextAnnotation *)annotation setColor:interiorColor];
-            }
-        }
-    } else {
-        NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
-        switch (self.annotMode) {
-            case CPDFViewAnnotationModeCircle:
-                [userDefaults setPDFListViewColor:interiorColor forKey:CCircleNoteInteriorColorKey];
-                break;
-            case CPDFViewAnnotationModeSquare:
-                [userDefaults setPDFListViewColor:interiorColor forKey:CSquareNoteInteriorColorKey];
-                break;
-            default:
-                break;
-        }
-    }
-}
-
-- (CGFloat)interiorOpacity {
-    CGFloat opacity = 0;
-    if (self.isSelectAnnot) {
-        if([self.annotation isKindOfClass:[CPDFCircleAnnotation class]] ||
-           [self.annotation isKindOfClass:[CPDFSquareAnnotation class]]) {
-            opacity = [(CPDFCircleAnnotation *)self.annotation interiorOpacity];
-        } else {
-            opacity = [self.annotation opacity];
-        }
-    } else {
-        NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
-        switch (self.annotMode) {
-            case CPDFViewAnnotationModeCircle:
-                opacity = [userDefaults floatForKey:CCircleNoteInteriorOpacityKey];
-                break;
-            case CPDFViewAnnotationModeSquare:
-                opacity = [userDefaults floatForKey:CSquareNoteInteriorOpacityKey];
-                break;
-            default:
-                break;
-        }
-    }
-    return opacity;
-}
-
-- (void)setInteriorOpacity:(CGFloat)interiorOpacity {
-    if (self.isSelectAnnot) {
-        for (CPDFAnnotation *annotation in self.annotations) {
-            if ([annotation isKindOfClass:[CPDFCircleAnnotation class]] ||
-                [annotation isKindOfClass:[CPDFSquareAnnotation class]]) {
-                [(CPDFCircleAnnotation *)annotation setInteriorOpacity:interiorOpacity];
-            } else {
-                [(CPDFCircleAnnotation *)annotation setOpacity:interiorOpacity];
-            }
-        }
-    } else {
-        NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
-        switch (self.annotMode) {
-            case CPDFViewAnnotationModeCircle:
-                [userDefaults setFloat:interiorOpacity forKey:CCircleNoteInteriorOpacityKey];
-                break;
-            case CPDFViewAnnotationModeSquare:
-                [userDefaults setFloat:interiorOpacity forKey:CSquareNoteInteriorOpacityKey];
-                break;
-            default:
-                break;
-        }
-        [userDefaults synchronize];
-    }
-}
-
-@end

+ 0 - 61
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFAnnotationManage/CAnnotationManage.h

@@ -1,61 +0,0 @@
-//
-//  CAnnotationManage.h
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <UIKit/UIKit.h>
-#import <ComPDFKit_Tools/CPDFListView.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@class CPDFListView;
-@class CAnnotStyle;
-@class CPDFAnnotation;
-
-@interface CAnnotationManage : NSObject
-
-@property (nonatomic, readonly) CPDFListView *pdfListView;
-
-@property (nonatomic, readonly) CAnnotStyle *annotStyle;
-
-- (instancetype)initWithPDFView:(CPDFListView *)pdfListView;
-
-- (void)setAnnotStyleFromAnnotations:(NSArray<CPDFAnnotation *> *)annotations;
-
-- (void)setAnnotStyleFromMode:(CPDFViewAnnotationMode)annotationMode;
-
-- (void)refreshPageWithAnnotations:(NSArray *)annotations;
-/**
- * Get the default color of highlight annotations.
- */
-+ (UIColor *)highlightAnnotationColor;
-/**
- * Get the default color of underline annotations.
- */
-+ (UIColor *)underlineAnnotationColor;
-
-/**
- * Get the default color of strikeout annotations.
- */
-+ (UIColor *)strikeoutAnnotationColor;
-
-/**
- * Get the default color of squiggly annotations.
- */
-+ (UIColor *)squigglyAnnotationColor;
-
-/**
- * Get the default color of freehand annotations.
- */
-+ (UIColor *)freehandAnnotationColor;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 112
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFAnnotationManage/CAnnotationManage.m

@@ -1,112 +0,0 @@
-//
-//  CAnnotationManage.m
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import "CAnnotationManage.h"
-#import "CPDFListView.h"
-#import "CAnnotStyle.h"
-
-#import <ComPDFKit/ComPDFKit.h>
-
-@interface CAnnotationManage ()
-
-@property (nonatomic, strong) CPDFListView *pdfListView;
-
-@property (nonatomic, strong) CPDFAnnotation *annotation;
-
-@property (nonatomic, strong) CAnnotStyle *annotStyle;
-
-@end
-
-@implementation CAnnotationManage
-
-- (instancetype)initWithPDFView:(CPDFListView *)pdfListView {
-    if (self = [super init]) {
-        self.pdfListView = pdfListView;
-    }
-    return self;
-}
-
-#pragma mark - Publice Methods
-
-- (void)setAnnotStyleFromAnnotations:(NSArray<CPDFAnnotation *> *)annotations {
-    self.annotStyle = [[CAnnotStyle alloc] initWithAnnotionMode:CPDFViewAnnotationModeNone annotations:annotations];
-}
-
-- (void)refreshPageWithAnnotations:(NSArray *)annotations {
-    NSMutableArray *pages = [NSMutableArray array];
-    for (CPDFAnnotation * annotation in annotations) {
-        CPDFPage *page = annotation.page;
-        if(![pages containsObject:page]) {
-            [pages addObject:page];
-        }
-        
-    }
-    for (CPDFPage *page in pages) {
-           [self.pdfListView setNeedsDisplayForPage:page];
-    }
-}
-
-- (void)setAnnotStyleFromMode:(CPDFViewAnnotationMode)annotationMode {
-    self.annotStyle = [[CAnnotStyle alloc] initWithAnnotionMode:annotationMode annotations:@[]];
-}
-
-+ (CPDFKitPlatformColor *)highlightAnnotationColor {
-    CPDFKitPlatformColor *highlightAnnotationColor = nil;
-    CAnnotStyle *annotStyle = [[CAnnotStyle alloc] initWithAnnotionMode:CPDFViewAnnotationModeHighlight annotations:@[]];
-    CGFloat red, green, blue, alpha;
-    [annotStyle.color getRed:&red green:&green blue:&blue alpha:&alpha];
-    
-    highlightAnnotationColor = [CPDFKitPlatformColor colorWithRed:red green:green blue:blue alpha:annotStyle.opacity];
-    return highlightAnnotationColor;
-}
-
-+ (CPDFKitPlatformColor *)underlineAnnotationColor {
-    CPDFKitPlatformColor *underlineAnnotationColor = nil;
-    CAnnotStyle *annotStyle = [[CAnnotStyle alloc] initWithAnnotionMode:CPDFViewAnnotationModeUnderline annotations:@[]];
-    CGFloat red, green, blue, alpha;
-    [annotStyle.color getRed:&red green:&green blue:&blue alpha:&alpha];
-    
-    underlineAnnotationColor = [CPDFKitPlatformColor colorWithRed:red green:green blue:blue alpha:annotStyle.opacity];
-    return underlineAnnotationColor;
-}
-
-+ (CPDFKitPlatformColor *)strikeoutAnnotationColor {
-    CPDFKitPlatformColor *strikeoutAnnotationColor = nil;
-    CAnnotStyle *annotStyle = [[CAnnotStyle alloc] initWithAnnotionMode:CPDFViewAnnotationModeStrikeout annotations:@[]];
-    CGFloat red, green, blue, alpha;
-    [annotStyle.color getRed:&red green:&green blue:&blue alpha:&alpha];
-    
-    strikeoutAnnotationColor = [CPDFKitPlatformColor colorWithRed:red green:green blue:blue alpha:annotStyle.opacity];
-    return strikeoutAnnotationColor;
-}
-
-+ (CPDFKitPlatformColor *)squigglyAnnotationColor {
-    CPDFKitPlatformColor *squigglyAnnotationColor = nil;
-    CAnnotStyle *annotStyle = [[CAnnotStyle alloc] initWithAnnotionMode:CPDFViewAnnotationModeSquiggly annotations:@[]];
-    CGFloat red, green, blue, alpha;
-    [annotStyle.color getRed:&red green:&green blue:&blue alpha:&alpha];
-    
-    squigglyAnnotationColor = [CPDFKitPlatformColor colorWithRed:red green:green blue:blue alpha:annotStyle.opacity];
-    return squigglyAnnotationColor;
-}
-
-+ (CPDFKitPlatformColor *)freehandAnnotationColor {
-    CPDFKitPlatformColor *freehandAnnotationColor = nil;
-    CAnnotStyle *annotStyle = [[CAnnotStyle alloc] initWithAnnotionMode:CPDFViewAnnotationModeInk annotations:@[]];
-    CGFloat red, green, blue, alpha;
-    [annotStyle.color getRed:&red green:&green blue:&blue alpha:&alpha];
-    
-    freehandAnnotationColor = [CPDFKitPlatformColor colorWithRed:red green:green blue:blue alpha:annotStyle.opacity];
-    return freehandAnnotationColor;
-}
-
-@end

+ 0 - 19
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFAnnotationManage/CPDFListViewAnnotationConfig.h

@@ -1,19 +0,0 @@
-//
-//  CPDFListViewAnnotationConfig.h
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <Foundation/Foundation.h>
-
-@interface CPDFListViewAnnotationConfig : NSObject
-
-+ (void)initializeAnnotationConfig;
-
-@end

+ 0 - 30
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFAnnotationManage/CPDFListViewAnnotationConfig.m

@@ -1,30 +0,0 @@
-//
-//  CPDFListViewAnnotationConfig.m
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import "CPDFListViewAnnotationConfig.h"
-
-#import <ComPDFKit/ComPDFKit.h>
-@implementation CPDFListViewAnnotationConfig
-
-+ (void)initializeAnnotationConfig {
-    NSURL *initialUserDefaultsURL = [[NSBundle bundleForClass:self.class] URLForResource:@"AnnotationUserDefaults" withExtension:@"plist"];
-    NSDictionary *initialUserDefaultsDict = [NSDictionary dictionaryWithContentsOfURL:initialUserDefaultsURL];
-    NSDictionary *initialValuesDict = [initialUserDefaultsDict objectForKey:@"RegisteredDefaults"];
-    
-    if(![[NSUserDefaults standardUserDefaults] floatForKey:@"CInkNoteLineWidth"]) 
-        [[CPDFKitConfig sharedInstance] setFreehandAnnotationBorderWidth:10.0];
-
-    // set them in the standard user defaults
-    [[NSUserDefaults standardUserDefaults] registerDefaults:initialValuesDict];
-}
-
-@end

+ 0 - 117
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFAnnotationManage/CStringConstants.h

@@ -1,117 +0,0 @@
-//
-//  CStringConstants.h
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <Foundation/Foundation.h>
-
-extern NSString *CHighlightNoteColorKey;
-
-extern NSString *CHighlightNoteOpacityKey;
-
-extern NSString *CUnderlineNoteColorKey;
-
-extern NSString *CUnderlineNoteOpacityKey;
-
-extern NSString *CStrikeOutNoteColorKey;
-
-extern NSString *CStrikeOutNoteOpacityKey;
-
-extern NSString *CSquigglyNoteColorKey;
-
-extern NSString *CSquigglyNoteOpacityKey;
-
-extern NSString *CInkNoteColorKey;
-
-extern NSString *CInkNoteOpacityKey;
-
-extern NSString *CInkNoteLineWidthKey;
-
-extern NSString *CInkNoteLineStyleyKey;
-
-extern NSString *CInkNoteDashPatternKey;
-
-extern NSString *CFreeTextNoteFontNameKey;
-
-extern NSString *CFreeTextNoteFontSizeKey;
-
-extern NSString *CFreeTextNoteFontColorKey;
-
-extern NSString *CFreeTextNoteAlignmentKey;
-
-extern NSString *CFreeTextNoteOpacityKey;
-
-extern NSString *CFreeTextNoteLineStyleKey;
-
-extern NSString *CFreeTextNoteLineWidthKey;
-
-extern NSString *CFreeTextNoteDashPatternKey;
-
-extern NSString *CAnchoredNoteColorKey;
-
-extern NSString *CAnchoredNoteOpacityKey;
-
-extern NSString *CAnchoredNoteIconTypeKey;
-
-extern NSString *CCircleNoteColorKey;
-
-extern NSString *CCircleNoteOpacityKey;
-
-extern NSString *CCircleNoteInteriorColorKey;
-
-extern NSString *CCircleNoteInteriorOpacityKey;
-
-extern NSString *CCircleNoteLineWidthKey;
-
-extern NSString *CCircleNoteLineStyleKey;
-
-extern NSString *CCircleNoteDashPatternKey;
-
-extern NSString *CSquareNoteColorKey;
-
-extern NSString *CSquareNoteOpacityKey;
-
-extern NSString *CSquareNoteInteriorColorKey;
-
-extern NSString *CSquareNoteInteriorOpacityKey;
-
-extern NSString *CSquareNoteLineWidthKey;
-
-extern NSString *CSquareNoteLineStyleKey;
-
-extern NSString *CSquareNoteDashPatternKey;
-
-extern NSString *CLineNoteColorKey;
-
-extern NSString *CLineNoteOpacityKey;
-
-extern NSString *CLineNoteLineWidthKey;
-
-extern NSString *CLineNoteLineStyleKey;
-
-extern NSString *CLineNoteDashPatternKey;
-
-extern NSString *CArrowNoteColorKey;
-
-extern NSString *CArrowNoteOpacityKey;
-
-extern NSString *CArrowNoteLineWidthKey;
-
-extern NSString *CArrowNoteLineStyleKey;
-
-extern NSString *CArrowNoteStartStyleKey;
-
-extern NSString *CArrowNoteEndStyleKey;
-
-extern NSString *CLineNoteStartStyleKey;
-
-extern NSString *CLineNoteEndStyleKey;
-
-extern NSString *CArrowNoteDashPatternKey;

+ 0 - 118
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFAnnotationManage/CStringConstants.m

@@ -1,118 +0,0 @@
-//
-//  CStringConstants.m
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import "CStringConstants.h"
-
-NSString *CHighlightNoteColorKey = @"CHighlightNoteColor";
-
-NSString *CHighlightNoteOpacityKey = @"CHighlightNoteOpacity";
-
-NSString *CUnderlineNoteColorKey = @"CUnderlineNoteColor";
-
-NSString *CUnderlineNoteOpacityKey = @"CUnderlineNoteOpacity";
-
-NSString *CStrikeOutNoteColorKey = @"CStrikeOutNoteColor";
-
-NSString *CStrikeOutNoteOpacityKey = @"CStrikeOutNoteOpacity";
-
-NSString *CSquigglyNoteColorKey = @"CSquigglyNoteColor";
-
-NSString *CSquigglyNoteOpacityKey = @"CSquigglyNoteOpacity";
-
-NSString *CInkNoteColorKey = @"CInkNoteColor";
-
-NSString *CInkNoteOpacityKey = @"CInkNoteOpacity";
-
-NSString *CInkNoteLineWidthKey = @"CInkNoteLineWidth";
-
-NSString * CInkNoteLineStyleyKey = @"CInkNoteLineStyley";
-
-NSString * CInkNoteDashPatternKey = @"CInkNoteDashPattern";
-
-NSString *CFreeTextNoteFontNameKey = @"CFreeTextNoteFontName";
-
-NSString *CFreeTextNoteFontSizeKey = @"CFreeTextNoteFontSize";
-
-NSString *CFreeTextNoteFontColorKey = @"CFreeTextNoteFontColor";
-
-NSString *CFreeTextNoteAlignmentKey = @"CFreeTextNoteAlignment";
-
-NSString *CFreeTextNoteOpacityKey = @"CFreeTextNoteOpacity";
-
-NSString *CFreeTextNoteLineStyleKey = @"CFreeTextNoteLineStyle";
-
-NSString *CFreeTextNoteLineWidthKey = @"CFreeTextNoteLineWidth";
-
-NSString *CFreeTextNoteDashPatternKey = @"CFreeTextNoteDashPattern";
-
-NSString *CAnchoredNoteColorKey = @"CAnchoredNoteColor";
-
-NSString *CAnchoredNoteOpacityKey = @"CAnchoredNoteOpacity";
-
-NSString *CAnchoredNoteIconTypeKey = @"CAnchoredNoteIconType";
-
-NSString *CCircleNoteColorKey = @"CCircleNoteColor";
-
-NSString *CCircleNoteOpacityKey = @"CCircleNoteOpacity";
-
-NSString *CCircleNoteInteriorColorKey = @"CCircleNoteInteriorColor";
-
-NSString *CCircleNoteInteriorOpacityKey = @"CCircleNoteInteriorOpacity";
-
-NSString *CCircleNoteLineWidthKey = @"CCircleNoteLineWidth";
-
-NSString *CCircleNoteLineStyleKey = @"CCircleNoteLineStyle";
-
-NSString *CCircleNoteDashPatternKey = @"CCircleNoteDashPattern";
-
-NSString *CSquareNoteColorKey = @"CSquareNoteColor";
-
-NSString *CSquareNoteOpacityKey = @"CSquareNoteOpacity";
-
-NSString *CSquareNoteInteriorColorKey = @"CSquareNoteInteriorColor";
-
-NSString *CSquareNoteInteriorOpacityKey = @"CSquareNoteInteriorOpacity";
-
-NSString *CSquareNoteLineWidthKey = @"CSquareNoteLineWidth";
-
-NSString *CSquareNoteLineStyleKey = @"CSquareNoteLineStyle";
-
-NSString *CSquareNoteDashPatternKey = @"CSquareNoteDashPattern";
-
-NSString *CLineNoteColorKey = @"CLineNoteColor";
-
-NSString *CLineNoteOpacityKey = @"CLineNoteOpacity";
-
-NSString *CLineNoteLineWidthKey = @"CLineNoteLineWidth";
-
-NSString *CLineNoteLineStyleKey = @"CLineNoteLineStyle";
-
-NSString *CLineNoteDashPatternKey = @"CLineNoteDashPattern";
-
-NSString *CArrowNoteColorKey = @"CArrowNoteColor";
-
-NSString *CArrowNoteOpacityKey = @"CArrowNoteOpacity";
-
-NSString *CArrowNoteLineWidthKey = @"CArrowNoteLineWidth";
-
-NSString *CArrowNoteLineStyleKey = @"CArrowNoteLineStyle";
-
-NSString *CArrowNoteStartStyleKey = @"CArrowNoteStartStyle";
-
-NSString *CArrowNoteEndStyleKey = @"CArrowNoteEndStyle";
-
-NSString *CLineNoteStartStyleKey = @"CLineNoteStartStyleKey";
-
-NSString *CLineNoteEndStyleKey = @"CLineNoteEndStyleKey";
-
-NSString *CArrowNoteDashPatternKey = @"CArrowNoteDashPattern";
-

+ 0 - 27
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFBase/CPDFAnnotationBaseViewController.h

@@ -1,27 +0,0 @@
-//
-//  CPDFAnnotationBaseViewController.h
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <UIKit/UIKit.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@class CAnnotStyle;
-
-@interface CPDFAnnotationBaseViewController : UIViewController
-
-@property (nonatomic, readonly) CAnnotStyle *annotStyle;
-
-- (instancetype)initWithStyle:(CAnnotStyle *)annotStyle;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 211
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFBase/CPDFAnnotationBaseViewController.m

@@ -1,211 +0,0 @@
-//
-//  CPDFAnnotationBaseViewController.m
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import "CPDFAnnotationBaseViewController.h"
-#import "CPDFAnnotationBaseViewController_Header.h"
-
-#import <ComPDFKit_Tools/CPDFColorUtils.h>
-
-@interface CPDFAnnotationBaseViewController () <UIColorPickerViewControllerDelegate, CPDFColorSelectViewDelegate, CPDFColorPickerViewDelegate, CPDFOpacitySliderViewDelegate>
-
-@end
-
-@implementation CPDFAnnotationBaseViewController
-
-#pragma mark - Initializers
-
-- (instancetype)initWithStyle:(CAnnotStyle *)annotStyle {
-    if (self = [super init]) {
-        self.annotStyle = annotStyle;
-    }
-    return self;
-}
-
-#pragma mark - ViewController Methods
-
-- (void)viewDidLoad {
-    [super viewDidLoad];
-    // Do any additional setup after loading the view.
-    self.headerView = [[UIView alloc] init];
-    self.headerView.layer.borderColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.1].CGColor;
-    self.headerView.layer.borderWidth = 1.0;
-    self.headerView.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
-    [self.view addSubview:self.headerView];
-    
-    self.titleLabel = [[UILabel alloc] init];
-    self.titleLabel.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;
-    self.titleLabel.textAlignment = NSTextAlignmentCenter;
-    self.titleLabel.font = [UIFont systemFontOfSize:20];
-    self.titleLabel.adjustsFontSizeToFitWidth = YES;
-    [self.headerView addSubview:self.titleLabel];
-    
-    self.scrcollView = [[UIScrollView alloc] init];
-    self.scrcollView.scrollEnabled = YES;
-    [self.view addSubview:self.scrcollView];
-    
-    self.backBtn = [[UIButton alloc] init];
-    self.backBtn.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
-    [self.backBtn setImage:[UIImage imageNamed:@"CPDFAnnotationBaseImageBack" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-    [self.backBtn addTarget:self action:@selector(buttonItemClicked_back:) forControlEvents:UIControlEventTouchUpInside];
-    [self.headerView addSubview:self.backBtn];
-    
-    self.sampleBackgoundView = [[UIView alloc] init];
-    self.sampleBackgoundView.layer.borderColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.1].CGColor;
-    self.sampleBackgoundView.layer.borderWidth = 1.0;
-    self.sampleBackgoundView.backgroundColor = [CPDFColorUtils CAnnotationSampleBackgoundColor];
-    [self.headerView addSubview:self.sampleBackgoundView];
-    
-    self.sampleView = [[CPDFSampleView alloc] init];
-    self.sampleView.backgroundColor = [UIColor whiteColor];
-    self.sampleView.layer.borderColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.1].CGColor;
-    self.sampleView.layer.borderWidth = 1.0;
-    self.sampleView.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;
-    [self.sampleBackgoundView addSubview:self.sampleView];
-    
-    self.colorView = [[CPDFColorSelectView alloc] init];
-    self.colorView.delegate = self;
-    self.colorView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
-    [self.scrcollView addSubview:self.colorView];
-    
-    self.opacitySliderView = [[CPDFOpacitySliderView alloc] init];
-    self.opacitySliderView.delegate = self;
-    self.opacitySliderView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
-    [self.scrcollView addSubview:self.opacitySliderView];
-    
-    self.view.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
-    [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
-}
-
-- (void)viewWillLayoutSubviews {
-    [super viewWillLayoutSubviews];
-    self.titleLabel.frame = CGRectMake((self.view.frame.size.width - 120)/2, 5, 120, 50);
-    self.scrcollView.frame = CGRectMake(0, 170, self.view.frame.size.width, 210);
-    self.headerView.frame = CGRectMake(0, 0, self.view.frame.size.width, 170);
-    self.scrcollView.contentSize = CGSizeMake(self.view.frame.size.width, 330);
-    self.sampleBackgoundView.frame = CGRectMake(0, 50, self.view.bounds.size.width, 120);
-    self.sampleView.frame  = CGRectMake((self.view.frame.size.width - 300)/2, 15, 300, self.sampleBackgoundView.bounds.size.height - 30);
-    
-    if (@available(iOS 11.0, *)) {
-        self.colorPicker.frame = CGRectMake(self.view.safeAreaInsets.left, 0, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, self.view.frame.size.height);
-        self.colorView.frame = CGRectMake(self.view.safeAreaInsets.left, 0,self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 90);
-        self.opacitySliderView.frame = CGRectMake(self.view.safeAreaInsets.left, 90, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 90);
-        self.backBtn.frame = CGRectMake(self.view.frame.size.width - 60 - self.view.safeAreaInsets.right, 5, 50, 50);
-    } else {
-        self.colorView.frame = CGRectMake(0, 0, self.view.frame.size.width, 90);
-        self.opacitySliderView.frame = CGRectMake(0, 90, self.view.frame.size.width, 90);
-        self.backBtn.frame = CGRectMake(self.view.frame.size.width - 60, 5, 50, 50);
-    }
-}
-
-- (void)willTransitionToTraitCollection:(UITraitCollection *)newCollection withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
-    [super willTransitionToTraitCollection:newCollection withTransitionCoordinator:coordinator];
-    [self updatePreferredContentSizeWithTraitCollection:newCollection];
-}
-
-- (void)viewWillAppear:(BOOL)animated {
-    [super viewWillAppear:animated];
-    [self commomInitTitle];
-    [self commomInitFromAnnotStyle];
-}
-
-#pragma mark - Protect Methods
-
-- (void)commomInitTitle {
-    self.titleLabel.text = NSLocalizedString(@"Note", nil);
-    self.sampleView.selecIndex = CPDFSamplesHighlight;
-    self.colorView.colorLabel.text = NSLocalizedString(@"Color:", nil);
-    self.colorView.selectedColor = self.annotStyle.color;
-    [self.colorView setNeedsLayout];
-}
-
-- (void)commomInitFromAnnotStyle {
-    self.sampleView.color = self.annotStyle.color;
-    self.sampleView.opcity = self.annotStyle.opacity;
-    self.opacitySliderView.opacitySlider.value = self.annotStyle.opacity;
-    self.opacitySliderView.startLabel.text = [NSString stringWithFormat:@"%d%%", (int)((self.opacitySliderView.opacitySlider.value/1)*100)];
-}
-
-- (void)updatePreferredContentSizeWithTraitCollection:(UITraitCollection *)traitCollection {
-    if ([self.colorPicker superview]) {
-        UIDevice *currentDevice = [UIDevice currentDevice];
-        if (currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad) {
-            // This is an iPad
-            self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, 520);
-        } else {
-            // This is an iPhone or iPod touch
-            self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, 320);
-        }
-       
-    } else {
-        self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact ? 350 : 420);
-    }
-}
-
-#pragma mark - Action
-
-- (void)buttonItemClicked_back:(id)sender {
-    [self dismissViewControllerAnimated:YES completion:nil];
-}
-
-#pragma mark - CPDFColorSelectViewDelegate
-
-- (void)selectColorView:(CPDFColorSelectView *)select {
-    if (@available(iOS 14.0, *)) {
-        UIColorPickerViewController *picker = [[UIColorPickerViewController alloc] init];
-        picker.delegate = self;
-        [self presentViewController:picker animated:YES completion:nil];
-    } else {
-        UIDevice *currentDevice = [UIDevice currentDevice];
-        if (currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad) {
-            // This is an iPad
-            _colorPicker = [[CPDFColorPickerView alloc] initWithFrame:CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y, self.view.frame.size.width, 520)];
-        } else {
-            // This is an iPhone or iPod touch
-            _colorPicker = [[CPDFColorPickerView alloc] initWithFrame:CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y, self.view.frame.size.width, 320)];
-        }
-       
-        _colorPicker.delegate = self;
-        _colorView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-        _colorPicker.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
-        [self.view addSubview:self.colorPicker];
-        [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
-    }
-}
-
-- (void)selectColorView:(CPDFColorSelectView *)select color:(UIColor *)color {
-    self.sampleView.color = color;
-    [self.sampleView setNeedsDisplay];
-}
-
-#pragma mark - CPDFColorPickerViewDelegate
-
-- (void)pickerView:(CPDFColorPickerView *)colorPickerView color:(UIColor *)color {
-    self.sampleView.color = color;
-    [self.sampleView setNeedsDisplay];
-    
-    CGFloat red, green, blue, alpha;
-    [color getRed:&red green:&green blue:&blue alpha:&alpha];
-    self.opacitySliderView.opacitySlider.value = alpha;
-    self.opacitySliderView.startLabel.text = [NSString stringWithFormat:@"%d%%", (int)((self.opacitySliderView.opacitySlider.value/1)*100)];
-    
-    [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
-}
-
-#pragma mark - CPDFOpacitySliderViewDelegate
-
-- (void)opacitySliderView:(CPDFOpacitySliderView *)opacitySliderView opacity:(CGFloat)opacity {
-    self.sampleView.opcity = opacity;
-    [self.sampleView setNeedsDisplay];
-    
-}
-
-@end

+ 0 - 47
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFBase/CPDFAnnotationBaseViewController_Header.h

@@ -1,47 +0,0 @@
-//
-//  CPDFAnnotationBaseViewController_Header.h
-//  ComPDFKit_Tools
-//
-//  Created by kdanmobile_2 on 2023/4/23.
-//
-
-#ifndef CPDFAnnotationBaseViewController_Header_h
-#define CPDFAnnotationBaseViewController_Header_h
-
-#import "CPDFSampleView.h"
-#import "CPDFColorSelectView.h"
-#import "CPDFOpacitySliderView.h"
-#import "CPDFColorPickerView.h"
-#import "CAnnotStyle.h"
-
-@interface CPDFAnnotationBaseViewController ()
-
-@property (nonatomic, strong) CPDFSampleView *sampleView;
-
-@property (nonatomic, strong) CPDFColorSelectView *colorView;
-
-@property (nonatomic, strong) CPDFOpacitySliderView *opacitySliderView;
-
-@property (nonatomic, strong) CPDFColorPickerView *colorPicker;
-
-@property (nonatomic, strong) UIScrollView *scrcollView;
-
-@property (nonatomic, strong) UIButton *backBtn;
-
-@property (nonatomic, strong) UILabel *titleLabel;
-
-@property (nonatomic, strong) CAnnotStyle *annotStyle;
-
-@property (nonatomic, strong) UIView *sampleBackgoundView;
-
-@property (nonatomic, strong) UIView *headerView;
-
-- (void)commomInitTitle;
-
-- (void)commomInitFromAnnotStyle;
-
-- (void)updatePreferredContentSizeWithTraitCollection:(UITraitCollection *)traitCollection;
-
-@end
-
-#endif /* CPDFAnnotationBaseViewController_Header_h */

+ 0 - 37
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFFreeText/CPDFFreeTextViewController.h

@@ -1,37 +0,0 @@
-//
-//  CPDFFreeTextViewController.h
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <ComPDFKit_Tools/ComPDFKit_Tools.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@class CPDFFreeTextViewController;
-@class CAnnotStyle;
-@class CPDFListView;
-
-@protocol CPDFFreeTextViewControllerDelegate <NSObject>
-
-@optional
-
-- (void)freeTextViewController:(CPDFFreeTextViewController *)freeTextViewController annotStyle:(CAnnotStyle *)annotStyle;
-
-@end
-
-@interface CPDFFreeTextViewController : CPDFAnnotationBaseViewController
-
-@property (nonatomic, weak) id<CPDFFreeTextViewControllerDelegate> delegate;
-
-@property (nonatomic, strong) CPDFListView *pdfListView;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 476
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFFreeText/CPDFFreeTextViewController.m

@@ -1,476 +0,0 @@
-//
-//  CPDFFreeTextViewController.m
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import "CPDFFreeTextViewController.h"
-#import "CPDFAnnotationBaseViewController_Header.h"
-#import "CPDFThicknessSliderView.h"
-#import "CPDFFontStyleTableView.h"
-
-#import <ComPDFKit_Tools/CPDFColorUtils.h>
-
-@interface CPDFFreeTextViewController () <UIColorPickerViewControllerDelegate, CPDFThicknessSliderViewDelegate, CPDFFontStyleTableViewDelegate, CPDFColorPickerViewDelegate>
-
-@property (nonatomic, strong) UIButton *boldBtn;
-
-@property (nonatomic, strong) UIButton *italicBtn;
-
-@property (nonatomic, strong) UILabel *alignmentLabel;
-
-@property (nonatomic, strong) UIButton *leftBtn;
-
-@property (nonatomic, strong) UIButton *centerBtn;
-
-@property (nonatomic, strong) UIButton *rightBtn;
-
-@property (nonatomic, strong) CPDFThicknessSliderView *fontsizeSliderView;
-
-@property (nonatomic, assign) BOOL isBold;
-
-@property (nonatomic, assign) BOOL isItalic;
-
-@property (nonatomic, assign) NSString *baseName;
-
-@property (nonatomic, strong) CPDFFontStyleTableView *fontStyleTableView;
-
-@property (nonatomic, strong) UIView * dropMenuView;
-
-@property (nonatomic, strong) UIView * splitView;
-
-@property (nonatomic, strong) UIButton * fontSelectBtn;
-
-@property (nonatomic, strong) UIImageView *dropDownIcon;
-
-@property (nonatomic, strong) UILabel * fontNameLabel;
-
-@property (nonatomic, strong) UILabel * fontNameSelectLabel;
-
-@end
-
-@implementation CPDFFreeTextViewController
-
-#pragma mark - ViewController Methods
-
-- (void)viewDidLoad {
-    [super viewDidLoad];
-    // Do any additional setup after loading the view.
-    self.fontNameLabel = [[UILabel alloc] init];
-    self.fontNameLabel.text =  NSLocalizedString(@"Font", nil);
-    self.fontNameLabel.font = [UIFont systemFontOfSize:14];
-    self.fontNameLabel.textColor = [UIColor colorWithRed:153./255 green:153./255 blue:153./255 alpha:1.];
-    [self.scrcollView addSubview:self.fontNameLabel];
-    
-    self.dropMenuView = [[UIView alloc] init];
-    [self.scrcollView addSubview:self.dropMenuView];
-    
-    self.splitView = [[UIView alloc] init];
-    self.splitView.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.2];
-    [self.dropMenuView addSubview:self.splitView];
-    
-    self.dropDownIcon = [[UIImageView alloc] init];
-    self.dropDownIcon.image = [UIImage imageNamed:@"CPDFEditArrow" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil];
-    [self.dropMenuView addSubview:self.dropDownIcon];
-    
-    self.fontNameSelectLabel = [[UILabel alloc] init];
-    self.fontNameSelectLabel.font = [UIFont systemFontOfSize:14];
-    self.fontNameSelectLabel.textColor = [UIColor blackColor];
-    [self.dropMenuView addSubview:self.fontNameSelectLabel];
-    
-    self.fontSelectBtn = [UIButton buttonWithType:UIButtonTypeCustom];
-    self.fontSelectBtn.backgroundColor = [UIColor clearColor];
-    [self.fontSelectBtn addTarget:self action:@selector(buttonItemClicked_FontStyle:) forControlEvents:UIControlEventTouchUpInside];
-    [self.dropMenuView addSubview:self.fontSelectBtn];
-    
-    self.boldBtn = [[UIButton alloc] init];
-    [self.boldBtn setImage:[UIImage imageNamed:@"CPDFFreeTextImageBold" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-    [self.boldBtn setImage:[UIImage imageNamed:@"CPDFFreeTextImageBoldHighLinght" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateSelected];
-    [self.boldBtn addTarget:self action:@selector(buttonItemClicked_Bold:) forControlEvents:UIControlEventTouchUpInside];
-    [self.scrcollView addSubview:self.boldBtn];
-    
-    self.italicBtn = [[UIButton alloc] init];
-    [self.italicBtn setImage:[UIImage imageNamed:@"CPDFFreeTextImageUnderline" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-    [self.italicBtn setImage:[UIImage imageNamed:@"CPDFFreeTextImageItailcHighLight" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateSelected];
-    [self.italicBtn addTarget:self action:@selector(buttonItemClicked_Italic:) forControlEvents:UIControlEventTouchUpInside];
-    [self.scrcollView addSubview:self.italicBtn];
-    
-    self.alignmentLabel = [[UILabel alloc] init];
-    self.alignmentLabel.text = NSLocalizedString(@"Alignment", nil);
-    self.alignmentLabel.textColor = [UIColor grayColor];
-    self.alignmentLabel.font = [UIFont systemFontOfSize:12.0];
-    [self.scrcollView addSubview:self.alignmentLabel];
-    
-    self.leftBtn = [[UIButton alloc] init];
-    [self.leftBtn setImage:[UIImage imageNamed:@"CPDFFreeTextImageLeft" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-    [self.leftBtn addTarget:self action:@selector(buttonItemClicked_Left:) forControlEvents:UIControlEventTouchUpInside];
-    [self.scrcollView addSubview:self.leftBtn];
-    
-    self.centerBtn = [[UIButton alloc] init];
-    [self.centerBtn setImage:[UIImage imageNamed:@"CPDFFreeTextImageCenter" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-    [self.centerBtn addTarget:self action:@selector(buttonItemClicked_Center:) forControlEvents:UIControlEventTouchUpInside];
-    [self.scrcollView addSubview:self.centerBtn];
-    
-    self.rightBtn = [[UIButton alloc] init];
-    [self.rightBtn setImage:[UIImage imageNamed:@"CPDFFreeTextImageRight" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-    [self.rightBtn addTarget:self action:@selector(buttonItemClicked_Right:) forControlEvents:UIControlEventTouchUpInside];
-    [self.scrcollView addSubview:self.rightBtn];
-    
-    self.fontsizeSliderView = [[CPDFThicknessSliderView alloc] init];
-    self.fontsizeSliderView.thicknessSlider.value = 20;
-    self.fontsizeSliderView.thicknessSlider.minimumValue = 1;
-    self.fontsizeSliderView.thicknessSlider.maximumValue = 100;
-    self.fontsizeSliderView.titleLabel.text = NSLocalizedString(@"Font Size", nil);
-    self.fontsizeSliderView.startLabel.text = @"1";
-    self.fontsizeSliderView.delegate = self;
-    self.fontsizeSliderView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
-    [self.scrcollView addSubview:self.fontsizeSliderView];
-    
-    self.baseName = @"Helvetica";
-    
-    self.view.backgroundColor = [CPDFColorUtils CAnnotationSampleBackgoundColor];
-}
-
-- (void)viewWillLayoutSubviews {
-    [super viewWillLayoutSubviews];
-    self.scrcollView.frame = CGRectMake(0, 170, self.view.frame.size.width, self.view.frame.size.height-170);
-    self.scrcollView.contentSize = CGSizeMake(self.view.frame.size.width, 470);
-    
-    if (@available(iOS 11.0, *)) {
-        self.backBtn.frame = CGRectMake(self.view.frame.size.width - 60 - self.view.safeAreaInsets.right, 5, 50, 50);
-        self.fontNameLabel.frame = CGRectMake(self.view.safeAreaInsets.left+20, 195, 30, 30);
-        self.dropMenuView.frame = CGRectMake(self.view.safeAreaInsets.left+60, 195, self.view.frame.size.width - 150 - self.view.safeAreaInsets.right-self.view.safeAreaInsets.left, 30);
-        self.dropDownIcon.frame = CGRectMake(self.dropMenuView.bounds.size.width - 24 - 5, 3, 24, 24);
-        self.fontNameSelectLabel.frame = CGRectMake(10, 0, self.dropMenuView.bounds.size.width - 40, 29);
-        self.fontSelectBtn.frame = self.dropMenuView.bounds;
-        self.splitView.frame = CGRectMake(0, 29, self.dropMenuView.bounds.size.width, 1);
-        
-        self.boldBtn.frame = CGRectMake(self.view.frame.size.width - 80 - self.view.safeAreaInsets.right, 195, 30, 30);
-        self.italicBtn.frame = CGRectMake(self.view.frame.size.width - 50 - self.view.safeAreaInsets.right, 195, 30, 30);
-        self.alignmentLabel.frame = CGRectMake(self.view.safeAreaInsets.left+20, 225, 120, 45);
-        self.leftBtn.frame = CGRectMake(self.view.frame.size.width - 130 - self.view.safeAreaInsets.right, 240, 30, 30);
-        self.centerBtn.frame = CGRectMake(self.view.frame.size.width - 90 - self.view.safeAreaInsets.right, 240, 30, 30);
-        self.rightBtn.frame = CGRectMake(self.view.frame.size.width - 50, 240, 30, 30);
-        self.fontsizeSliderView.frame = CGRectMake(self.view.safeAreaInsets.left, 280, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 90);
-    } else {
-        self.backBtn.frame = CGRectMake(self.view.frame.size.width - 60, 5, 50, 50);
-        self.boldBtn.frame = CGRectMake(self.view.frame.size.width - 80, 195, 30, 30);
-        self.italicBtn.frame = CGRectMake(self.view.frame.size.width - 50, 195, 30, 30);
-        self.alignmentLabel.frame = CGRectMake(20, 225, 120, 45);
-        self.leftBtn.frame = CGRectMake(self.view.frame.size.width - 110, 240, 30, 30);
-        self.centerBtn.frame = CGRectMake(self.view.frame.size.width - 80, 240, 30, 30);
-        self.rightBtn.frame = CGRectMake(self.view.frame.size.width - 50, 240, 30, 30);
-        self.fontsizeSliderView.frame = CGRectMake(0, 280, self.view.frame.size.width, 90);
-        
-        self.fontNameLabel.frame = CGRectMake(20, 195, 30, 30);
-        self.dropMenuView.frame = CGRectMake(60, 195, self.view.frame.size.width - 140, 30);
-        self.dropDownIcon.frame = CGRectMake(self.dropMenuView.bounds.size.width - 24 - 5, 3, 24, 24);
-        self.fontNameSelectLabel.frame = CGRectMake(10, 0, self.dropMenuView.bounds.size.width-40, 29);
-        self.fontSelectBtn.frame = self.dropMenuView.bounds;
-        self.splitView.frame = CGRectMake(0, 29, self.dropMenuView.bounds.size.width, 1);
-    }
-}
-
-#pragma mark - Protect Mehtods
-
-- (void)commomInitTitle {
-    self.titleLabel.text = NSLocalizedString(@"FreeText", nil);
-    self.colorView.colorLabel.text = NSLocalizedString(@"Font Color", nil);
-    self.colorView.selectedColor = self.annotStyle.fontColor;
-    
-    self.sampleView.selecIndex = CPDFSamplesFreeText;
-    self.sampleView.color = [UIColor blueColor];
-}
-
-- (void)updatePreferredContentSizeWithTraitCollection:(UITraitCollection *)traitCollection {
-    self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact ? 350 : 600);
-}
-
-- (void)commomInitFromAnnotStyle {
-    self.opacitySliderView.opacitySlider.value = self.annotStyle.opacity;
-    self.opacitySliderView.startLabel.text = [NSString stringWithFormat:@"%d%%", (int)((self.opacitySliderView.opacitySlider.value/1)*100)];
-    self.fontsizeSliderView.thicknessSlider.value = self.annotStyle.fontSize;
-    self.fontsizeSliderView.startLabel.text = [NSString stringWithFormat:@"%d",(int)self.annotStyle.fontSize];
-    self.fontNameSelectLabel.text = self.annotStyle.fontName;
-    [self analyzeFont:self.annotStyle.fontName];
-    [self analyzeAlignment:self.annotStyle.alignment];
-
-    self.sampleView.color = self.annotStyle.fontColor;
-    self.sampleView.opcity = self.annotStyle.opacity;
-    self.sampleView.thickness = self.annotStyle.fontSize;
-    self.sampleView.fontName = self.annotStyle.fontName;
-    self.sampleView.textAlignment = self.annotStyle.alignment;
-    [self.sampleView setNeedsDisplay];
-}
-
-#pragma mark - Private
-
-- (void)analyzeFont:(NSString *)fontName {
-    if ([fontName rangeOfString:@"Bold"].location != NSNotFound) {
-        self.isBold = YES;
-        self.sampleView.isBold = self.isBold;
-        self.boldBtn.backgroundColor = [CPDFColorUtils CAnnotationBarSelectBackgroundColor];
-        [self.sampleView setNeedsDisplay];
-    } else {
-        self.isBold = NO;
-        self.sampleView.isBold = self.isBold;
-        self.boldBtn.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
-        [self.sampleView setNeedsDisplay];
-    }
-    if (([fontName rangeOfString:@"Italic"].location != NSNotFound) || ([fontName rangeOfString:@"Oblique"].location != NSNotFound)) {
-        self.isItalic = YES;
-        self.sampleView.isItalic = self.isItalic;
-        self.italicBtn.backgroundColor = [CPDFColorUtils CAnnotationBarSelectBackgroundColor];
-        [self.sampleView setNeedsDisplay];
-    } else {
-        self.isItalic = NO;
-        self.sampleView.isItalic = self.isBold;
-        self.italicBtn.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
-        [self.sampleView setNeedsDisplay];
-    }
-    if ([fontName rangeOfString:@"Helvetica"].location != NSNotFound)
-    {
-        self.baseName = @"Helvetica";
-        self.sampleView.fontName = self.baseName;
-        return ;
-    }
-    if ([fontName rangeOfString:@"Courier"].location != NSNotFound)
-    {
-        self.baseName = @"Courier";
-        self.sampleView.fontName = self.baseName;
-        return ;
-    }
-    if ([fontName rangeOfString:@"Times"].location != NSNotFound)
-    {
-        self.baseName = @"Times-Roman";
-        self.sampleView.fontName = self.baseName;
-    }
-}
-
-- (void)analyzeAlignment:(NSTextAlignment)aligment {
-    switch (aligment) {
-        case NSTextAlignmentLeft:
-        {
-            self.leftBtn.backgroundColor = [CPDFColorUtils CAnnotationBarSelectBackgroundColor];
-        }
-            break;
-        case NSTextAlignmentCenter:
-        {
-            self.centerBtn.backgroundColor = [CPDFColorUtils CAnnotationBarSelectBackgroundColor];
-        }
-            break;
-        case NSTextAlignmentRight:
-        {
-            self.rightBtn.backgroundColor = [CPDFColorUtils CAnnotationBarSelectBackgroundColor];
-        }
-            break;
-            
-        default:
-            break;
-    }
-}
-
-- (NSString *)constructionFontname:(NSString *)baseName isBold:(BOOL)isBold isItalic:(BOOL)isItalic {
-    NSString *result;
-    if ([baseName rangeOfString:@"Times"].location != NSNotFound) {
-       if (isBold || isItalic) {
-           if (isBold && isItalic) return @"Times-BoldItalic";
-           if (isBold) return @"Times-Bold";
-           if (isItalic) return @"Times-Italic";
-       }
-       else
-           return @"Times-Roman";
-    }
-    if (isBold || isItalic) {
-       result = [NSString stringWithFormat:@"%@-",baseName];
-       if (isBold) result = [NSString stringWithFormat:@"%@Bold",result];
-       if (isItalic) result = [NSString stringWithFormat:@"%@Oblique",result];
-    }
-    else return baseName;
-    return result;
-}
-
-#pragma mark - Action
-
-- (void)buttonItemClicked_Bold:(id)sender {
-    self.isBold = !(self.isBold);
-    if (self.isBold) {
-        self.boldBtn.backgroundColor = [CPDFColorUtils CAnnotationBarSelectBackgroundColor];
-    } else {
-        self.boldBtn.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
-    }
-
-    self.sampleView.fontName = [self constructionFontname:self.baseName isBold:self.isBold isItalic:self.isItalic];
-    [self.sampleView setNeedsDisplay];
-    self.annotStyle.fontName = [self constructionFontname:self.baseName isBold:self.isBold isItalic:self.isItalic];
-    if (self.delegate && [self.delegate respondsToSelector:@selector(freeTextViewController:annotStyle:)]) {
-        [self.delegate freeTextViewController:self annotStyle:self.annotStyle];
-    }
-}
-
-- (void)buttonItemClicked_Italic:(id)sender {
-    self.isItalic = !(self.isItalic);
-    if (self.isItalic) {
-        self.italicBtn.backgroundColor = [CPDFColorUtils CAnnotationBarSelectBackgroundColor];
-    } else {
-        self.italicBtn.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
-    }
-    
-    self.annotStyle.fontName = [self constructionFontname:self.baseName isBold:self.isBold isItalic:self.isItalic];
-    self.sampleView.fontName = [self constructionFontname:self.baseName isBold:self.isBold isItalic:self.isItalic];
-    [self.sampleView setNeedsDisplay];
-    
-    if (self.delegate && [self.delegate respondsToSelector:@selector(freeTextViewController:annotStyle:)]) {
-        [self.delegate freeTextViewController:self annotStyle:self.annotStyle];
-    }
-}
-
-- (void)buttonItemClicked_FontStyle:(id)sender {
-    self.fontStyleTableView = [[CPDFFontStyleTableView alloc] initWithFrame:self.view.bounds];
-    self.fontStyleTableView.delegate = self;
-    self.fontStyleTableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-    self.fontStyleTableView.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
-    [self.view addSubview:self.fontStyleTableView];
-}
-
-- (void)buttonItemClicked_Left:(id)sender {
-    self.leftBtn.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
-    self.centerBtn.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
-    self.rightBtn.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
-    
-    self.leftBtn.backgroundColor = [CPDFColorUtils CAnnotationBarSelectBackgroundColor];
-    self.annotStyle.alignment = NSTextAlignmentLeft;
-    self.sampleView.textAlignment = NSTextAlignmentLeft;
-    if (self.delegate && [self.delegate respondsToSelector:@selector(freeTextViewController:annotStyle:)]) {
-        [self.delegate freeTextViewController:self annotStyle:self.annotStyle];
-    }
-    [self.sampleView setNeedsDisplay];
-}
-
-- (void)buttonItemClicked_Center:(id)sender {
-    self.leftBtn.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
-    self.centerBtn.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
-    self.rightBtn.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
-    
-    self.centerBtn.backgroundColor = [CPDFColorUtils CAnnotationBarSelectBackgroundColor];
-    self.annotStyle.alignment = NSTextAlignmentCenter;
-    self.sampleView.textAlignment = NSTextAlignmentCenter;
-    if (self.delegate && [self.delegate respondsToSelector:@selector(freeTextViewController:annotStyle:)]) {
-        [self.delegate freeTextViewController:self annotStyle:self.annotStyle];
-    }
-    [self.sampleView setNeedsDisplay];
-}
-
-- (void)buttonItemClicked_Right:(id)sender {
-    self.leftBtn.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
-    self.centerBtn.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
-    self.rightBtn.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
-    
-    self.rightBtn.backgroundColor = [CPDFColorUtils CAnnotationBarSelectBackgroundColor];
-    self.annotStyle.alignment = NSTextAlignmentRight;
-    self.sampleView.textAlignment = NSTextAlignmentRight;
-    if (self.delegate && [self.delegate respondsToSelector:@selector(freeTextViewController:annotStyle:)]) {
-        [self.delegate freeTextViewController:self annotStyle:self.annotStyle];
-    }
-    [self.sampleView setNeedsDisplay];
-}
-
-#pragma mark - CPDFOpacitySliderViewDelegate
-
-- (void)opacitySliderView:(CPDFOpacitySliderView *)opacitySliderView opacity:(CGFloat)opacity {
-    self.sampleView.opcity = opacity;
-    self.annotStyle.opacity = opacity;
-    if (self.delegate && [self.delegate respondsToSelector:@selector(freeTextViewController:annotStyle:)]) {
-        [self.delegate freeTextViewController:self annotStyle:self.annotStyle];
-    }
-    [self.sampleView setNeedsDisplay];
-}
-
-#pragma mark - CPDFThicknessSliderViewDelegate
-
-- (void)thicknessSliderView:(CPDFThicknessSliderView *)thicknessSliderView thickness:(CGFloat)thickness {
-    self.sampleView.thickness = thickness;
-    self.annotStyle.fontSize = self.fontsizeSliderView.thicknessSlider.value;
-    if (self.delegate && [self.delegate respondsToSelector:@selector(freeTextViewController:annotStyle:)]) {
-        [self.delegate freeTextViewController:self annotStyle:self.annotStyle];
-    }
-    [self.sampleView setNeedsDisplay];
-}
-
-#pragma mark - CPDFFontStyleTableViewDelegate
-
-- (void)fontStyleTableView:(CPDFFontStyleTableView *)fontStyleTableView fontName:(NSString *)fontName {
-    self.sampleView.fontName = fontName;
-    self.baseName = fontName;
-    self.annotStyle.fontName = [self constructionFontname:self.baseName isBold:self.isBold isItalic:self.isItalic];
-    self.fontNameSelectLabel.text = fontName;
-    if (self.delegate && [self.delegate respondsToSelector:@selector(freeTextViewController:annotStyle:)]) {
-        [self.delegate freeTextViewController:self annotStyle:self.annotStyle];
-    }
-    [self.sampleView setNeedsDisplay];
-}
-
-#pragma mark - CPDFColorSelectViewDelegate
-
-- (void)selectColorView:(CPDFColorSelectView *)select color:(UIColor *)color {
-    self.sampleView.color = color;
-    self.annotStyle.fontColor = color;
-    if (self.delegate && [self.delegate respondsToSelector:@selector(freeTextViewController:annotStyle:)]) {
-        [self.delegate freeTextViewController:self annotStyle:self.annotStyle];
-    }
-    [self.sampleView setNeedsDisplay];
-}
-
-- (void)selectColorView:(CPDFColorSelectView *)select {
-    if (@available(iOS 14.0, *)) {
-        UIColorPickerViewController *picker = [[UIColorPickerViewController alloc] init];
-        picker.delegate = self;
-        [self presentViewController:picker animated:YES completion:nil];
-    } else {
-        self.colorPicker = [[CPDFColorPickerView alloc] initWithFrame:self.view.frame];
-        self.colorPicker.delegate = self;
-        self.colorPicker.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-        self.colorPicker.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
-        [self.view addSubview:self.colorPicker];
-    }
-}
-
-#pragma mark - CPDFColorPickerViewDelegate
-
-- (void)pickerView:(CPDFColorPickerView *)colorPickerView color:(UIColor *)color {
-    self.sampleView.color = color;
-    self.annotStyle.fontColor = color;
-    if (self.delegate && [self.delegate respondsToSelector:@selector(freeTextViewController:annotStyle:)]) {
-        [self.delegate freeTextViewController:self annotStyle:self.annotStyle];
-    }
-    [self.sampleView setNeedsDisplay];
-    
-    CGFloat red, green, blue, alpha;
-    [color getRed:&red green:&green blue:&blue alpha:&alpha];
-    self.opacitySliderView.opacitySlider.value = alpha;
-    self.opacitySliderView.startLabel.text = [NSString stringWithFormat:@"%d%%", (int)((self.opacitySliderView.opacitySlider.value/1)*100)];
-}
-
-#pragma mark - UIColorPickerViewControllerDelegate
-
-- (void)colorPickerViewControllerDidFinish:(UIColorPickerViewController *)viewController API_AVAILABLE(ios(14.0)) {
-    self.sampleView.color = viewController.selectedColor;
-    self.annotStyle.fontColor = self.sampleView.color;
-    if (self.delegate && [self.delegate respondsToSelector:@selector(freeTextViewController:annotStyle:)]) {
-        [self.delegate freeTextViewController:self annotStyle:self.annotStyle];
-    }
-    [self.sampleView setNeedsDisplay];
-    
-    CGFloat red, green, blue, alpha;
-    [viewController.selectedColor getRed:&red green:&green blue:&blue alpha:&alpha];
-    self.opacitySliderView.opacitySlider.value = alpha;
-    self.opacitySliderView.startLabel.text = [NSString stringWithFormat:@"%d%%", (int)((self.opacitySliderView.opacitySlider.value/1)*100)];
-}
-
-@end

+ 0 - 34
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFHighlight/CPDFHighlightViewController.h

@@ -1,34 +0,0 @@
-//
-//  CPDFHighlightViewController.h
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <ComPDFKit_Tools/ComPDFKit_Tools.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@class CPDFHighlightViewController;
-@class CAnnotStyle;
-
-@protocol CPDFHighlightViewControllerDelegate <NSObject>
-
-@optional
-
-- (void)highlightViewController:(CPDFHighlightViewController *)highlightViewController annotStyle:(CAnnotStyle *)annotStyle;
-
-@end
-
-@interface CPDFHighlightViewController : CPDFAnnotationBaseViewController
-
-@property (nonatomic, weak) id<CPDFHighlightViewControllerDelegate> delegate;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 97
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFHighlight/CPDFHighlightViewController.m

@@ -1,97 +0,0 @@
-//
-//  CPDFHighlightViewController.m
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import "CPDFHighlightViewController.h"
-#import "CPDFAnnotationBaseViewController_Header.h"
-
-@interface CPDFHighlightViewController ()
-
-@end
-
-@implementation CPDFHighlightViewController
-
-- (void)viewDidLoad {
-    [super viewDidLoad];
-    // Do any additional setup after loading the view.
-}
-
-- (void)commomInitTitle {
-    self.titleLabel.text = NSLocalizedString(@"Highlight", nil);
-    self.sampleView.selecIndex = CPDFSamplesHighlight;
-    self.colorView.selectedColor = self.annotStyle.color;
-}
-
-- (void)commomInitFromAnnotStyle {
-    self.sampleView.color = self.annotStyle.color;
-    self.sampleView.opcity = self.annotStyle.opacity;
-    
-    self.opacitySliderView.opacitySlider.value = self.annotStyle.opacity;
-    self.opacitySliderView.startLabel.text = [NSString stringWithFormat:@"%d%%", (int)((self.opacitySliderView.opacitySlider.value/1)*100)];
-    [self.sampleView setNeedsDisplay];
-}
-
-#pragma mark - CPDFColorSelectViewDelegate
-
-- (void)selectColorView:(CPDFColorSelectView *)select color:(UIColor *)color {
-    self.sampleView.color = color;
-    self.annotStyle.color = color;
-    if (self.delegate && [self.delegate respondsToSelector:@selector(highlightViewController:annotStyle:)]) {
-        [self.delegate highlightViewController:self annotStyle:self.annotStyle];
-    }
-    [self.sampleView setNeedsDisplay];
-}
-
-#pragma mark - CPDFColorPickerViewDelegate
-
-- (void)pickerView:(CPDFColorPickerView *)colorPickerView color:(UIColor *)color {
-    self.sampleView.color = color;
-    self.annotStyle.color = color;
-    if (self.delegate && [self.delegate respondsToSelector:@selector(highlightViewController:annotStyle:)]) {
-        [self.delegate highlightViewController:self annotStyle:self.annotStyle];
-    }
-    [self.sampleView setNeedsDisplay];
-    
-    CGFloat red, green, blue, alpha;
-    [color getRed:&red green:&green blue:&blue alpha:&alpha];
-    self.opacitySliderView.opacitySlider.value = alpha;
-    self.opacitySliderView.startLabel.text = [NSString stringWithFormat:@"%d%%", (int)((self.opacitySliderView.opacitySlider.value/1)*100)];
-    [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
-}
-
-#pragma mark - CPDFOpacitySliderViewDelegate
-
-- (void)opacitySliderView:(CPDFOpacitySliderView *)opacitySliderView opacity:(CGFloat)opacity {
-    self.sampleView.opcity = opacity;
-    self.annotStyle.opacity = opacity;
-    if (self.delegate && [self.delegate respondsToSelector:@selector(highlightViewController:annotStyle:)]) {
-        [self.delegate highlightViewController:self annotStyle:self.annotStyle];
-    }
-    [self.sampleView setNeedsDisplay];
-}
-
-#pragma mark - UIColorPickerViewControllerDelegate
-
-- (void)colorPickerViewControllerDidFinish:(UIColorPickerViewController *)viewController API_AVAILABLE(ios(14.0)) {
-    self.sampleView.color = viewController.selectedColor;
-    self.annotStyle.color = self.sampleView.color;
-    if (self.delegate && [self.delegate respondsToSelector:@selector(highlightViewController:annotStyle:)]) {
-        [self.delegate highlightViewController:self annotStyle:self.annotStyle];
-    }
-    [self.sampleView setNeedsDisplay];
-    
-    CGFloat red, green, blue, alpha;
-    [viewController.selectedColor getRed:&red green:&green blue:&blue alpha:&alpha];
-    self.opacitySliderView.opacitySlider.value = alpha;
-    self.opacitySliderView.startLabel.text = [NSString stringWithFormat:@"%d%%", (int)((self.opacitySliderView.opacitySlider.value/1)*100)];
-}
-
-@end

+ 0 - 38
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFInk/CPDFDrawPencilKitFuncView.h

@@ -1,38 +0,0 @@
-//
-//  CPDFDrawPencilKitFuncView.h
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <UIKit/UIKit.h>
-
-typedef NS_ENUM(NSInteger, CPDFDrawPencilKitFuncType) {
-    CPDFDrawPencilKitFuncType_Eraser,
-    CPDFDrawPencilKitFuncType_Cancel,
-    CPDFDrawPencilKitFuncType_Done,
-};
-
-@class CPDFDrawPencilKitFuncView;
-@protocol CPDFDrawPencilViewDelegate <NSObject>
-
-- (void)drawPencilFuncView:(CPDFDrawPencilKitFuncView *)view eraserBtn:(UIButton *)btn;
-
-- (void)drawPencilFuncView:(CPDFDrawPencilKitFuncView *)view saveBtn:(UIButton *)btn;
-
-- (void)drawPencilFuncView:(CPDFDrawPencilKitFuncView *)view cancelBtn:(UIButton *)btn;
-
-@end
-
-@interface CPDFDrawPencilKitFuncView : UIView
-
-@property(nonatomic,assign) id<CPDFDrawPencilViewDelegate> delegate;
-
-- (void)resetAllSubviews;
-
-@end

+ 0 - 178
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFInk/CPDFDrawPencilKitFuncView.m

@@ -1,178 +0,0 @@
-//
-//  CPDFDrawPencilKitFuncView.m
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import "CPDFDrawPencilKitFuncView.h"
-#import "CPDFColorUtils.h"
-
-@interface CPDFDrawPencilKitFuncView ()
-
-@property (nonatomic,strong) UIButton *eraseButton;
-
-@end
-
-@implementation CPDFDrawPencilKitFuncView
-
-
-- (id)initWithFrame:(CGRect)frame {
-    self = [super initWithFrame:frame];
-    if (self) {
-        // Initialization code
-        self.backgroundColor = [CPDFColorUtils CPDFViewControllerBackgroundColor];
-        self.layer.borderColor = [UIColor lightGrayColor].CGColor;
-        self.layer.borderWidth = 1.0;
-        self.layer.cornerRadius = 5.0;
-        [self initSubViews];
-    }
-    return self;
-}
-
-- (void)layoutSubviews {
-    [super layoutSubviews];
-    float tWidth  = 182.0;
-    float tHeight = 54.0;
-    
-    self.transform = CGAffineTransformIdentity;
-    self.frame = CGRectMake(0, 0, tWidth, tHeight);
-    
-    CGFloat width = self.superview.bounds.size.width-30;
-    CGFloat scale = width/self.bounds.size.width;
-    if (self.frame.size.width > width) {
-        self.transform = CGAffineTransformMakeScale(scale,scale);
-        
-        self.center = CGPointMake(self.superview.frame.size.width/2.0,
-                                  self.frame.size.height/2.0 + 22);
-
-    } else {
-        if (@available(iOS 11.0, *)) {
-            if (self.window.safeAreaInsets.bottom > 0) {
-                self.center = CGPointMake(self.superview.frame.size.width - self.frame.size.width/2.0 - 40,
-                                          self.frame.size.height/2.0 + 42);
-                
-            } else{
-                self.center = CGPointMake(self.superview.frame.size.width - self.frame.size.width/2.0 - 30,
-                                          self.frame.size.height/2.0 + 22);
-            }
-        }
-    }
-}
-
-- (void)initSubViews {
-    float tSpace = 10.0;
-    float tOffsetX = tSpace;
-    float tOffsetY = 5.0;
-    float tWidth = 44.0;
-    
-    UIButton* eraseBtn = [UIButton buttonWithType:UIButtonTypeCustom];
-    eraseBtn.tag = CPDFDrawPencilKitFuncType_Eraser;
-    eraseBtn.layer.cornerRadius = 2.0;
-    eraseBtn.frame = CGRectMake(tOffsetX, tOffsetY, tWidth, self.height - tOffsetY*2.0);
-    [eraseBtn setImage:[UIImage imageNamed:@"CImageNamePencilEraserOff" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-    [eraseBtn setImage:[UIImage imageNamed:@"CImageNamePencilEraserOn" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateSelected];
-    [eraseBtn addTarget:self action:@selector(eraserBtnClicked:) forControlEvents:UIControlEventTouchUpInside];
-    [self addSubview:eraseBtn];
-    self.eraseButton = eraseBtn;
-    tOffsetX = tOffsetX + eraseBtn.frame.size.width + tSpace;
-    
-    UIButton* clearBtn = [UIButton buttonWithType:UIButtonTypeCustom];
-    clearBtn.tag = CPDFDrawPencilKitFuncType_Cancel;
-    clearBtn.layer.cornerRadius = 2.0;
-    clearBtn.frame = CGRectMake(tOffsetX, tOffsetY, tWidth+10, self.height - tOffsetY*2.0);
-    if (@available(iOS 13.0, *)) {
-        [clearBtn setTitleColor:[UIColor labelColor] forState:UIControlStateNormal];
-    } else {
-        [clearBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
-    }
-    [clearBtn setTitle:NSLocalizedString(@"Discard", nil) forState:UIControlStateNormal];
-    clearBtn.titleLabel.font = [UIFont systemFontOfSize:13.0];
-    clearBtn.titleLabel.adjustsFontSizeToFitWidth = YES;
-    [clearBtn addTarget:self action:@selector(clearBtnClicked:) forControlEvents:UIControlEventTouchUpInside];
-    [self addSubview:clearBtn];
-    tOffsetX = tOffsetX + clearBtn.frame.size.width + tSpace;
-    
-    UIButton* saveBtn = [UIButton buttonWithType:UIButtonTypeCustom];
-    saveBtn.tag = CPDFDrawPencilKitFuncType_Done;
-    saveBtn.layer.cornerRadius = 2.0;
-    saveBtn.frame = CGRectMake(tOffsetX, tOffsetY, tWidth, self.frame.size.height - tOffsetY*2.0);
-    if (@available(iOS 13.0, *)) {
-        [saveBtn setTitleColor:[UIColor labelColor] forState:UIControlStateNormal];
-    } else {
-        [saveBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
-    }
-    [saveBtn setTitle:NSLocalizedString(@"Save", nil) forState:UIControlStateNormal];
-    saveBtn.titleLabel.font = [UIFont systemFontOfSize:13.0];
-    [saveBtn addTarget:self action:@selector(saveBtnClicked:) forControlEvents:UIControlEventTouchUpInside];
-    [self addSubview:saveBtn];
-}
-
-- (void)resetAllSubviews {
-    for (UIView *tSubview in self.subviews) {
-        if ([tSubview isKindOfClass:[UIButton class]]) {
-            UIButton *tBtn = (UIButton *)tSubview;
-            tBtn.selected = NO;
-            tBtn.backgroundColor = [UIColor clearColor];
-        }
-    }
-}
-
-- (void)clearBtnClicked:(UIButton *)sender {
-    [self resetAllSubviews];
-    dispatch_async(dispatch_get_main_queue(), ^{
-        if ([self.delegate respondsToSelector:@selector(drawPencilFuncView:cancelBtn:)]) {
-            [self.delegate drawPencilFuncView:self cancelBtn:(UIButton *)sender];
-        }
-    });
-}
-
-- (void)saveBtnClicked:(UIButton *)sender {
-    [self resetAllSubviews];
-    dispatch_async(dispatch_get_main_queue(), ^{
-        if ([self.delegate respondsToSelector:@selector(drawPencilFuncView:saveBtn:)]) {
-            [self.delegate drawPencilFuncView:self saveBtn:(UIButton *)sender];
-        }
-    });
-}
-
-- (void)eraserBtnClicked:(UIButton *)sender {
-    BOOL isSelected = !sender.selected;
-    [self resetAllSubviews];
-    sender.selected = isSelected;
-    dispatch_async(dispatch_get_main_queue(), ^{
-        if ([self.delegate respondsToSelector:@selector(drawPencilFuncView:eraserBtn:)]) {
-            [self.delegate drawPencilFuncView:self eraserBtn:(UIButton *)sender];
-        }
-    });
-}
-
-- (CGFloat)width {
-   return CGRectGetWidth([self frame]);
-}
-
-- (void)setWidth:(CGFloat)width {
-   CGRect frame = [self frame];
-   frame.size.width = width;
-   
-   
-   [self setFrame:CGRectStandardize(frame)];
-}
-
-- (CGFloat)height {
-   return CGRectGetHeight([self frame]);
-}
-
-
-- (void)setHeight:(CGFloat)height {
-   CGRect frame = [self frame];
-   frame.size.height = height;
-   [self setFrame:CGRectStandardize(frame)];
-}
-
-@end

+ 0 - 44
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFInk/CPDFInkTopToolBar.h

@@ -1,44 +0,0 @@
-//
-//  CPDFFreehandView.h
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <UIKit/UIKit.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-typedef NS_ENUM(NSInteger, CPDFInkTopToolBarSelect) {
-    CPDFInkTopToolBarSetting = 0,
-    CPDFInkTopToolBarErase,
-    CPDFInkTopToolBarUndo,
-    CPDFInkTopToolBarRedo,
-    CPDFInkTopToolBarClear,
-    CPDFInkTopToolBarSave
-};
-
-@class CPDFInkTopToolBar;
-
-@protocol CPDFInkTopToolBarDelegate <NSObject>
-
-@optional
-
-- (void)inkTopToolBar:(CPDFInkTopToolBar *)inkTopToolBar tag:(CPDFInkTopToolBarSelect)tag isSelect:(BOOL)isSelect;
-
-@end
-
-@interface CPDFInkTopToolBar : UIView
-
-@property (nonatomic, weak) id<CPDFInkTopToolBarDelegate> delegate;
-
-@property (nonatomic, strong) NSMutableArray *buttonArray;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 154
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFInk/CPDFInkTopToolBar.m

@@ -1,154 +0,0 @@
-//
-//  CPDFFreehandView.m
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import "CPDFInkTopToolBar.h"
-
-#import <ComPDFKit_Tools/CPDFColorUtils.h>
-
-@interface CPDFInkTopToolBar ()
-
-@end
-
-@implementation CPDFInkTopToolBar
-
-#pragma mark - Initializers
-
-- (instancetype)initWithFrame:(CGRect)frame {
-    if (self = [super initWithFrame:frame]) {
-        self.layer.borderColor = [UIColor colorWithRed:170.0/255.0 green:170.0/255.0  blue:170.0/255.0  alpha:1.0].CGColor;
-        self.layer.borderWidth = 1.0;
-        self.layer.cornerRadius = 5.0;
-        
-        CGFloat width = self.bounds.size.width/6;
-        CGFloat height = self.bounds.size.height;
-        
-        self.buttonArray = [NSMutableArray array];
-        
-        UIButton *settingButton = [UIButton buttonWithType:UIButtonTypeCustom];
-        settingButton.tag = CPDFInkTopToolBarSetting;
-        settingButton.frame = CGRectMake(0, 0, width, height);
-        [settingButton setImage:[UIImage imageNamed:@"CPDFInkImageSetting" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-        [settingButton addTarget:self action:@selector(buttonItemClicked_Switch:) forControlEvents:UIControlEventTouchUpInside];
-        [self addSubview:settingButton];
-        [self.buttonArray addObject:settingButton];
-        
-        UIButton *eraseButton = [UIButton buttonWithType:UIButtonTypeCustom];
-        eraseButton.tag = CPDFInkTopToolBarErase;
-        eraseButton.frame = CGRectMake(width, 0, width, height);
-        [eraseButton setImage:[UIImage imageNamed:@"CPDFInkImageEraer" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-        [eraseButton addTarget:self action:@selector(buttonItemClicked_Switch:) forControlEvents:UIControlEventTouchUpInside];
-        [self addSubview:eraseButton];
-        [self.buttonArray addObject:eraseButton];
-        
-        UIButton *undoButton = [[UIButton alloc] init];
-        undoButton.tag = CPDFInkTopToolBarUndo;
-        undoButton.frame = CGRectMake(width*2, 0, width, height);
-        [undoButton setImage:[UIImage imageNamed:@"CPDFInkImageUndo" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-        [undoButton addTarget:self action:@selector(buttonItemClicked_Switch:) forControlEvents:UIControlEventTouchUpInside];
-        [self addSubview:undoButton];
-        [self.buttonArray addObject:undoButton];
-        
-        UIButton *redoButton = [UIButton buttonWithType:UIButtonTypeCustom];
-        redoButton.tag = CPDFInkTopToolBarRedo;
-        redoButton.frame = CGRectMake(width*3, 0, width, height);
-        [redoButton setImage:[UIImage imageNamed:@"CPDFInkImageRedo" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-        [redoButton addTarget:self action:@selector(buttonItemClicked_Switch:) forControlEvents:UIControlEventTouchUpInside];
-        [self addSubview:redoButton];
-        [self.buttonArray addObject:redoButton];
-        
-        UIButton *clearButton = [UIButton buttonWithType:UIButtonTypeSystem];
-        clearButton.tag = CPDFInkTopToolBarClear;
-        clearButton.frame = CGRectMake(4*width, 0, width, height);
-        [clearButton setTitle:NSLocalizedString(@"Clear", nil) forState:UIControlStateNormal];
-        [clearButton setTitleColor:[CPDFColorUtils CPageEditToolbarFontColor] forState:UIControlStateNormal];
-        clearButton.titleLabel.font = [UIFont systemFontOfSize:15.0];
-        [clearButton addTarget:self action:@selector(buttonItemClicked_Switch:) forControlEvents:UIControlEventTouchUpInside];
-        [self addSubview:clearButton];
-        [self.buttonArray addObject:clearButton];
-        
-        UIView *view = [[UIView alloc] initWithFrame:CGRectMake(4*width, 10, 1, height-20)];
-        view.backgroundColor = [UIColor colorWithRed:0.0/255.0 green:0.0/255.0 blue:0.0/255.0 alpha:0.1];
-        [self addSubview:view];
-        
-        UIButton *saveButton = [UIButton buttonWithType:UIButtonTypeSystem];
-        saveButton.tag = CPDFInkTopToolBarSave;
-        saveButton.frame = CGRectMake(5*width, 0, width, height);
-        [saveButton setTitle:NSLocalizedString(@"Save", nil) forState:UIControlStateNormal];
-        [saveButton setTitleColor:[UIColor colorWithRed:20.0/255.0 green:96.0/255.0 blue:243.0/255.0 alpha:1.0] forState:UIControlStateNormal];
-        saveButton.titleLabel.font = [UIFont systemFontOfSize:15.0];
-        [saveButton addTarget:self action:@selector(buttonItemClicked_Switch:) forControlEvents:UIControlEventTouchUpInside];
-        [self addSubview:saveButton];
-        [self.buttonArray addObject:saveButton];
-        
-        self.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
-    }
-    return self;
- }
-
-#pragma mark - Action
-
-- (void)buttonItemClicked_Switch:(UIButton *)button {
-    for (int j = 0; j < self.buttonArray.count; j++) {
-        ((UIButton *)self.buttonArray[j]).backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
-    }
-    ((UIButton *)self.buttonArray[button.tag]).backgroundColor = [CPDFColorUtils CAnnotationBarSelectBackgroundColor];
-    
-    switch (button.tag) {
-        case CPDFInkTopToolBarSetting: {
-            if (self.delegate && [self.delegate respondsToSelector:@selector(inkTopToolBar:tag:isSelect:)]) {
-                [self.delegate inkTopToolBar:self tag:(CPDFInkTopToolBarSelect)button.tag isSelect:button.isSelected];
-            }
-        }
-            break;
-        case CPDFInkTopToolBarErase: {
-            button.selected = !button.isSelected;
-            if (!button.selected) {
-                button.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
-            }
-            if (self.delegate && [self.delegate respondsToSelector:@selector(inkTopToolBar:tag:isSelect:)]) {
-                [self.delegate inkTopToolBar:self tag:(CPDFInkTopToolBarSelect)button.tag isSelect:button.isSelected];
-            }
-        }
-            break;
-        case CPDFInkTopToolBarUndo: {
-            if (self.delegate && [self.delegate respondsToSelector:@selector(inkTopToolBar:tag:isSelect:)]) {
-                [self.delegate inkTopToolBar:self tag:(CPDFInkTopToolBarSelect)button.tag isSelect:button.isSelected];
-            }
-            ((UIButton *)self.buttonArray[button.tag]).backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
-        }
-            break;
-        case CPDFInkTopToolBarRedo: {
-            if (self.delegate && [self.delegate respondsToSelector:@selector(inkTopToolBar:tag:isSelect:)]) {
-                [self.delegate inkTopToolBar:self tag:(CPDFInkTopToolBarSelect)button.tag isSelect:button.isSelected];
-            }
-            ((UIButton *)self.buttonArray[button.tag]).backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
-        }
-            break;
-        case CPDFInkTopToolBarClear: {
-            if (self.delegate && [self.delegate respondsToSelector:@selector(inkTopToolBar:tag:isSelect:)]) {
-                [self.delegate inkTopToolBar:self tag:(CPDFInkTopToolBarSelect)button.tag isSelect:button.isSelected];
-            }
-            [self removeFromSuperview];
-        }
-            break;
-            
-        case CPDFInkTopToolBarSave:{
-            if (self.delegate && [self.delegate respondsToSelector:@selector(inkTopToolBar:tag:isSelect:)]) {
-                [self.delegate inkTopToolBar:self tag:(CPDFInkTopToolBarSelect)button.tag isSelect:button.isSelected];
-            }
-            [self removeFromSuperview];
-        }
-            break;
-    }
-}
-
-@end

+ 0 - 36
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFInk/CPDFInkViewController.h

@@ -1,36 +0,0 @@
-//
-//  CPDFInkViewController.h
-//  ;-tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <ComPDFKit_Tools/ComPDFKit_Tools.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@class CPDFInkViewController;
-@class CAnnotStyle;
-
-@protocol CPDFInkViewControllerDelegate <NSObject>
-
-@optional
-
-- (void)inkViewController:(CPDFInkViewController *)inkViewController annotStyle:(CAnnotStyle *)annotStyle;
-
-- (void)inkViewControllerDimiss:(CPDFInkViewController *)inkViewController;
-
-@end
-
-@interface CPDFInkViewController : CPDFAnnotationBaseViewController
-
-@property (nonatomic, weak) id<CPDFInkViewControllerDelegate> delegate;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 170
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFInk/CPDFInkViewController.m

@@ -1,170 +0,0 @@
-//
-//  CPDFInkViewController.m
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import "CPDFInkViewController.h"
-#import "CPDFAnnotationBaseViewController_Header.h"
-#import "CPDFThicknessSliderView.h"
-#import "CPDFInkTopToolBar.h"
-
-@interface CPDFInkViewController () <CPDFThicknessSliderViewDelegate>
-
-@property (nonatomic, strong) CPDFThicknessSliderView *thicknessView;
-
-@end
-
-@implementation CPDFInkViewController
-
-#pragma mark - ViewController Methods
-
-- (void)viewDidLoad {
-    [super viewDidLoad];
-    
-    _thicknessView = [[CPDFThicknessSliderView alloc] init];
-    _thicknessView.delegate = self;
-    _thicknessView.thicknessSlider.value = 4.0;
-    _thicknessView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
-    [self.scrcollView addSubview:self.thicknessView];
-}
-
-- (void)viewWillLayoutSubviews {
-    [super viewWillLayoutSubviews];
-    self.scrcollView.frame = CGRectMake(0, 170, self.view.frame.size.width, 310);
-    self.scrcollView.contentSize = CGSizeMake(self.view.frame.size.width, 400);
-    if (@available(iOS 11.0, *)) {
-        self.thicknessView.frame = CGRectMake(self.view.safeAreaInsets.left, 180, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 90);
-    } else {
-        self.colorView.frame = CGRectMake(0, 0, self.view.frame.size.width, 90);
-        self.thicknessView.frame = CGRectMake(0, 180, self.view.frame.size.width, 90);
-    }
-}
-
-- (void)viewWillDisappear:(BOOL)animated {
-    if (self.delegate && [self.delegate respondsToSelector:@selector(inkViewControllerDimiss:)]) {
-        [self.delegate inkViewControllerDimiss:self];
-    }
-}
-
-#pragma mark - Private Methods
-
-- (void)commomInitTitle {
-    self.titleLabel.text = NSLocalizedString(@"Ink", nil);
-    self.thicknessView.titleLabel.text = NSLocalizedString(@"Line Width", nil);
-    self.sampleView.selecIndex = CPDFSamplesFreehand;
-    self.sampleView.thickness = 4.0;
-    self.colorView.selectedColor = self.annotStyle.color;
-}
-
-- (void)commomInitFromAnnotStyle {
-    self.sampleView.color = self.annotStyle.color;
-    self.sampleView.opcity = self.annotStyle.opacity;
-    self.sampleView.thickness = self.annotStyle.lineWidth;
-    
-    self.opacitySliderView.opacitySlider.value = self.annotStyle.opacity;
-    self.opacitySliderView.startLabel.text = [NSString stringWithFormat:@"%d%%", (int)((self.opacitySliderView.opacitySlider.value/1)*100)];
-    self.thicknessView.thicknessSlider.value = self.annotStyle.lineWidth;
-    self.thicknessView.startLabel.text = [NSString stringWithFormat:@"%d pt", (int)self.thicknessView.thicknessSlider.value];
-    [self.sampleView setNeedsDisplay];
-}
-
-- (void)updatePreferredContentSizeWithTraitCollection:(UITraitCollection *)traitCollection {
-    if ([self.colorPicker superview]) {
-        UIDevice *currentDevice = [UIDevice currentDevice];
-        if (currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad) {
-            // This is an iPad
-            self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, 520);
-        } else {
-            // This is an iPhone or iPod touch
-            self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, 320);
-        }
-    } else {
-        self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact ? 350 : 520);
-    }
-}
-
-#pragma mark - Action
-
-- (void)buttonItemClicked_back:(id)sender {
-    [self dismissViewControllerAnimated:YES completion:nil];
-    
-    if (self.delegate && [self.delegate respondsToSelector:@selector(inkViewControllerDimiss:)]) {
-        [self.delegate inkViewControllerDimiss:self];
-    }
-}
-
-#pragma mark - CPDFThicknessSliderViewDelegate
-
-- (void)thicknessSliderView:(CPDFThicknessSliderView *)thicknessSliderView thickness:(CGFloat)thickness {
-    self.sampleView.thickness = thickness;
-    self.annotStyle.lineWidth = thickness;
-    if (self.delegate && [self.delegate respondsToSelector:@selector(inkViewController:annotStyle:)]) {
-        [self.delegate inkViewController:self annotStyle:self.annotStyle];
-    }
-    [self.sampleView setNeedsDisplay];
-}
-
-#pragma mark - CPDFColorSelectViewDelegate
-
-- (void)selectColorView:(CPDFColorSelectView *)select color:(UIColor *)color {
-    self.sampleView.color = color;
-    self.annotStyle.color = color;
-    if (self.delegate && [self.delegate respondsToSelector:@selector(inkViewController:annotStyle:)]) {
-        [self.delegate inkViewController:self annotStyle:self.annotStyle];
-    }
-    [self.sampleView setNeedsDisplay];
-}
-
-#pragma mark - CPDFColorPickerViewDelegate
-
-- (void)pickerView:(CPDFColorPickerView *)colorPickerView color:(UIColor *)color {
-    self.sampleView.color = color;
-    self.annotStyle.color = color;
-    if (self.delegate && [self.delegate respondsToSelector:@selector(inkViewController:annotStyle:)]) {
-        [self.delegate inkViewController:self annotStyle:self.annotStyle];
-    }
-    [self.sampleView setNeedsDisplay];
-    
-    CGFloat red, green, blue, alpha;
-    [color getRed:&red green:&green blue:&blue alpha:&alpha];
-    self.opacitySliderView.opacitySlider.value = alpha;
-    self.opacitySliderView.startLabel.text = [NSString stringWithFormat:@"%d%%", (int)((self.opacitySliderView.opacitySlider.value/1)*100)];
-    
-    [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
-}
-
-#pragma mark - CPDFOpacitySliderViewDelegate
-
-- (void)opacitySliderView:(CPDFOpacitySliderView *)opacitySliderView opacity:(CGFloat)opacity {
-    self.sampleView.opcity = opacity;
-    self.annotStyle.opacity = opacity;
-    if (self.delegate && [self.delegate respondsToSelector:@selector(inkViewController:annotStyle:)]) {
-        [self.delegate inkViewController:self annotStyle:self.annotStyle];
-    }
-    [self.sampleView setNeedsDisplay];
-}
-
-#pragma mark - UIColorPickerViewControllerDelegate
-
-- (void)colorPickerViewControllerDidFinish:(UIColorPickerViewController *)viewController API_AVAILABLE(ios(14.0)) {
-    self.sampleView.color = viewController.selectedColor;
-    self.annotStyle.color = self.sampleView.color;
-    if (self.delegate && [self.delegate respondsToSelector:@selector(inkViewController:annotStyle:)]) {
-        [self.delegate inkViewController:self annotStyle:self.annotStyle];
-    }
-    [self.sampleView setNeedsDisplay];
-    
-    CGFloat red, green, blue, alpha;
-    [viewController.selectedColor getRed:&red green:&green blue:&blue alpha:&alpha];
-    self.opacitySliderView.opacitySlider.value = alpha;
-    self.opacitySliderView.startLabel.text = [NSString stringWithFormat:@"%d%%", (int)((self.opacitySliderView.opacitySlider.value/1)*100)];
-}
-
-@end

+ 0 - 47
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFLink/CPDFFormLinkViewController.h

@@ -1,47 +0,0 @@
-//
-//  CPDFLinkViewController.h
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <UIKit/UIKit.h>
-
-typedef NS_ENUM(NSInteger, CPDFFormLinkType) {
-    CPDFFormLinkTypeLink = 0,
-    CPDFFormLinkTypePage
-};
-
-@class CPDFFormLinkViewController;
-@class CAnnotStyle;
-
-NS_ASSUME_NONNULL_BEGIN
-
-@protocol CPDFLinkViewControllerDelegate <NSObject>
-
-- (void)linkViewController:(CPDFFormLinkViewController *)linkViewController linkType:(CPDFFormLinkType)linkType linkString:(NSString *)linkString;
-
-- (void)linkViewControllerDismiss:(CPDFFormLinkViewController *)linkViewController isLink:(BOOL)isLink;
-
-@optional
-
-@end
-
-@interface CPDFFormLinkViewController : UIViewController
-
-@property (nonatomic, readonly) CAnnotStyle *annotStyle;
-
-@property (nonatomic, assign) NSInteger pageCount;
-
-- (instancetype)initWithStyle:(CAnnotStyle *)annotStyle;
-
-@property (nonatomic, weak) id<CPDFLinkViewControllerDelegate> delegate;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 417
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFLink/CPDFFormLinkViewController.m

@@ -1,417 +0,0 @@
-//
-//  CPDFLinkViewController.m
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import "CPDFFormLinkViewController.h"
-#import "CPDFColorUtils.h"
-#import "CAnnotStyle.h"
-
-@interface CPDFFormLinkViewController ()<UITextFieldDelegate>
-
-@property (nonatomic, strong) CAnnotStyle *annotStyle;
-
-@property (nonatomic, strong) UIScrollView *scrcollView;
-
-@property (nonatomic, strong) UIButton *backBtn;
-
-@property (nonatomic, strong) UILabel *titleLabel;
-
-@property (nonatomic, strong) UISegmentedControl *segmentedControl;
-
-@property (nonatomic, strong) UITextField *pageTextField;
-
-@property (nonatomic, strong) UITextField *urlTextField;
-
-@property (nonatomic, strong) UIButton *saveButton;
-
-@property (nonatomic, assign) CPDFFormLinkType linkType;
-
-@property (nonatomic, strong) UIView *headerView;
-
-@end
-
-@implementation CPDFFormLinkViewController
-
-#pragma mark - Initializers
-
-- (instancetype)initWithStyle:(CAnnotStyle *)annotStyle {
-    if (self = [super init]) {
-        self.annotStyle = annotStyle;
-    }
-    return self;
-}
-
-- (void)viewDidLoad {
-    [super viewDidLoad];
-    
-    self.view.backgroundColor = [CPDFColorUtils CAnnotationSampleBackgoundColor];
-    
-    self.headerView = [[UIView alloc] init];
-    self.headerView.layer.borderColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.1].CGColor;
-    self.headerView.layer.borderWidth = 1.0;
-    self.headerView.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
-    [self.view addSubview:self.headerView];
-
-    [self initWithView];
-    
-   if([self.annotStyle.annotations.firstObject isKindOfClass:[CPDFButtonWidgetAnnotation class]]){
-        self.segmentedControl.selectedSegmentIndex = 0;
-       CPDFButtonWidgetAnnotation * mAnnotation = (CPDFButtonWidgetAnnotation*)self.annotStyle.annotations.firstObject;
-       if([mAnnotation.action isKindOfClass:[CPDFURLAction class]]){
-           CPDFURLAction * mAction =(CPDFURLAction*)mAnnotation.action;
-           self.linkType = CPDFFormLinkTypeLink;
-           self.urlTextField.text = mAction.url;
-           if(self.urlTextField.text.length > 0 ) {
-               [self.saveButton setEnabled:YES];
-               self.saveButton.backgroundColor = [UIColor systemBlueColor];
-               [self.saveButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
-           }
-       }else if([mAnnotation.action isKindOfClass:[CPDFGoToAction class]]){
-           CPDFButtonWidgetAnnotation * mAnnotation = (CPDFButtonWidgetAnnotation*)self.annotStyle.annotations.firstObject;
-           NSUInteger pageIndex = [mAnnotation.page.document indexForPage:mAnnotation.page];
-           self.linkType = CPDFFormLinkTypePage;
-           self.pageTextField.text = [NSString stringWithFormat:@"%@", @(pageIndex+1)];
-           self.segmentedControl.selectedSegmentIndex = 1;
-           if(self.pageTextField.text.length > 0 ) {
-               [self.saveButton setEnabled:YES];
-               self.saveButton.backgroundColor = [UIColor systemBlueColor];
-               [self.saveButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
-           }
-       }else{
-           CPDFURLAction * mAction =(CPDFURLAction*)mAnnotation.action;
-           self.linkType = CPDFFormLinkTypeLink;
-           self.urlTextField.text = mAction.url;
-       }
-
-    }
-    [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
-}
-
--(void)viewDidAppear:(BOOL)animated {
-    [super viewDidAppear:animated];
-    
-    UITextField *currentTextField = nil;
-
-    switch (_linkType) {
-        case CPDFFormLinkTypeLink:
-            currentTextField = self.urlTextField;
-            break;
-        default:
-        case CPDFFormLinkTypePage:
-            currentTextField = self.pageTextField;
-            break;
-    }
-    
-    [currentTextField becomeFirstResponder];
-}
-
-- (void)setLinkType:(CPDFFormLinkType)linkType {
-    _linkType = linkType;
-    
-    UITextField *currentTextField = nil;
-
-    switch (_linkType) {
-        case CPDFFormLinkTypeLink:
-            self.pageTextField.hidden = YES;
-            self.urlTextField.hidden = NO;
-            currentTextField = self.urlTextField;
-            break;
-        default:
-        case CPDFFormLinkTypePage:
-            self.urlTextField.hidden = YES;
-            self.pageTextField.hidden = NO;
-            currentTextField = self.pageTextField;
-            break;
-    }
-    
-    [currentTextField becomeFirstResponder];
-
-    if(currentTextField.text.length > 0) {
-        self.saveButton.enabled = YES;
-        self.saveButton.backgroundColor = [UIColor systemBlueColor];
-        [self.saveButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
-    } else {
-        self.saveButton.enabled = NO;
-        self.saveButton.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.2];
-        [self.saveButton setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
-    }
-}
-
-- (void)viewWillLayoutSubviews {
-    [super viewWillLayoutSubviews];
-    self.titleLabel.frame = CGRectMake(0, 17.5, self.view.frame.size.width, 25.0);
-    self.headerView.frame = CGRectMake(0, 0, self.view.frame.size.width, 50);
-    
-    if (@available(iOS 11.0, *)) {
-        self.backBtn.frame = CGRectMake(self.view.frame.size.width - 60 - self.view.safeAreaInsets.right, 5, 50, 50);
-    } else {
-        self.backBtn.frame = CGRectMake(self.view.frame.size.width - 60, 5, 50, 50);
-    }
-    
-    if (@available(iOS 11.0, *)) {
-        _scrcollView.frame = CGRectMake(self.view.safeAreaInsets.left, 50, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, self.view.frame.size.height);
-    } else {
-        _scrcollView.frame = CGRectMake(0, 50, self.view.frame.size.width, self.view.frame.size.height);
-    }
-    self.scrcollView.contentSize = CGSizeMake(_scrcollView.frame.size.width, self.scrcollView.contentSize.height);
-    self.saveButton.frame  = CGRectMake((self.scrcollView.frame.size.width - 120)/2, self.saveButton.frame.origin.y, 120, 32);
-    
-}
-
-- (void)willTransitionToTraitCollection:(UITraitCollection *)newCollection withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
-    [super willTransitionToTraitCollection:newCollection withTransitionCoordinator:coordinator];
-    [self updatePreferredContentSizeWithTraitCollection:newCollection];
-}
-
-
-- (void)updatePreferredContentSizeWithTraitCollection:(UITraitCollection *)traitCollection {
-    
-    self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact ? 350 : 600);
-
-    [self.urlTextField resignFirstResponder];
-    [self.pageTextField resignFirstResponder];
-
-}
-
-#pragma mark - Private
-
-- (void)initWithView {
-    _titleLabel = [[UILabel alloc] init];
-    _titleLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth;
-    _titleLabel.text = NSLocalizedString(@"Button Action", nil);
-    _titleLabel.textAlignment = NSTextAlignmentCenter;
-    _titleLabel.font = [UIFont systemFontOfSize:20];
-    _titleLabel.adjustsFontSizeToFitWidth = YES;
-    [self.headerView addSubview:_titleLabel];
-    
-    _scrcollView = [[UIScrollView alloc] init];
-    _scrcollView.frame = CGRectMake(0, 50, self.view.frame.size.width, self.view.frame.size.height);
-    _scrcollView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-    _scrcollView.scrollEnabled = YES;
-    [self.view addSubview:_scrcollView];
-    
-    self.backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
-    if (@available(iOS 11.0, *)) {
-        self.backBtn.frame = CGRectMake(self.view.frame.size.width - 60 - self.view.safeAreaInsets.right, 5, 50, 50);
-    } else {
-        self.backBtn.frame = CGRectMake(self.view.frame.size.width - 60, 5, 50, 50);
-    }
-    self.backBtn.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
-    [self.backBtn setImage:[UIImage imageNamed:@"CPDFAnnotationBaseImageBack" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-    [self.backBtn addTarget:self action:@selector(buttonItemClicked_back:) forControlEvents:UIControlEventTouchUpInside];
-    [self.headerView addSubview:self.backBtn];
-    
-    CGFloat offstY = 10;
-    _segmentedControl = [[UISegmentedControl alloc] initWithItems:@[NSLocalizedString(@"URL", nil),NSLocalizedString(@"Page",nil)]];
-    _segmentedControl.frame = CGRectMake(30, offstY, self.scrcollView.frame.size.width - 30 *2, 32.0);
-    _segmentedControl.autoresizingMask = UIViewAutoresizingFlexibleWidth;
-    [_segmentedControl addTarget:self action:@selector(segmentedControlValueChanged_Mode:) forControlEvents:UIControlEventValueChanged];
-    [self.scrcollView addSubview:_segmentedControl];
-    offstY +=_segmentedControl.frame.size.height;
-
-    offstY+= 32.0;
-    _urlTextField = [[UITextField alloc]initWithFrame:CGRectMake(30.0, offstY, self.scrcollView.frame.size.width - 60.0, 28.0)];
-    _urlTextField.autoresizingMask = UIViewAutoresizingFlexibleWidth;
-
-    _urlTextField.layer.borderWidth = 1.0;
-    _urlTextField.layer.borderColor = [UIColor lightGrayColor].CGColor;
-    _urlTextField.layer.cornerRadius = 5.0;
-    _urlTextField.leftView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 8, 0)];
-    _urlTextField.leftViewMode = UITextFieldViewModeAlways;
-    _urlTextField.rightView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 8, 0)];
-    _urlTextField.rightViewMode = UITextFieldViewModeAlways;
-    _urlTextField.delegate = self;
-    _urlTextField.hidden = YES;
-    _urlTextField.font = [UIFont systemFontOfSize:18.0];
-    _urlTextField.placeholder = @"https://www.compdf.com";
-    [self.scrcollView addSubview:_urlTextField];
-
-    
-    _pageTextField = [[UITextField alloc]initWithFrame:CGRectMake(30.0, offstY, self.view.frame.size.width - 60.0, 28.0)];
-    _pageTextField.autoresizingMask = UIViewAutoresizingFlexibleWidth;
-    _pageTextField.leftView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 8, 0)];
-    _pageTextField.layer.borderColor = [UIColor lightGrayColor].CGColor;
-    _pageTextField.leftViewMode = UITextFieldViewModeAlways;
-    _pageTextField.rightView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 8, 0)];
-    _pageTextField.rightViewMode = UITextFieldViewModeAlways;
-    _pageTextField.hidden = YES;
-    _pageTextField.layer.borderWidth = 1.0;
-    _pageTextField.layer.cornerRadius = 5.0;
-    _pageTextField.delegate = self;
-    _pageTextField.font = [UIFont systemFontOfSize:18.0];
-    NSString *str = [NSString stringWithFormat:@"Add a Page Number Between 1~%ld", self.pageCount];
-    _pageTextField.placeholder = NSLocalizedString(str, nil);
-    [self.scrcollView addSubview:_pageTextField];
-    offstY +=_urlTextField.frame.size.height;
-    
-    [_pageTextField addTarget:self action:@selector(textFieldTextChange:) forControlEvents:UIControlEventEditingChanged];
-    [_urlTextField addTarget:self action:@selector(textFieldTextChange:) forControlEvents:UIControlEventEditingChanged];
-    
-    offstY+= 30.0;
-    self.saveButton = [UIButton buttonWithType:UIButtonTypeCustom];
-    self.saveButton.frame  = CGRectMake((self.scrcollView.frame.size.width - 120)/2, offstY, 120, 32);
-    self.saveButton.layer.cornerRadius = 5.0;
-    self.saveButton.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
-    [self.saveButton setTitle:NSLocalizedString(@"Save",nil) forState:UIControlStateNormal];
-    [self.saveButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
-    [self.saveButton addTarget:self action:@selector(buttonItemClicked_Save:) forControlEvents:UIControlEventTouchUpInside];
-    self.saveButton.backgroundColor = [UIColor systemBlueColor];
-    [self.scrcollView addSubview:self.saveButton];
-
-    offstY += self.saveButton.frame.size.height;
-    
-    self.scrcollView.contentSize = CGSizeMake(self.view.frame.size.width, self.view.frame.size.height);
-    
-    [[NSNotificationCenter defaultCenter] addObserver:self
-                                             selector:@selector(keyboardwillChangeFrame:)
-                                                 name:UIKeyboardWillChangeFrameNotification
-                                               object:nil];
-    [[NSNotificationCenter defaultCenter] addObserver:self
-                                             selector:@selector(keyboardWillHide:)
-                                                 name:UIKeyboardWillHideNotification
-                                               object:nil];
-}
-
-#pragma mark - Action
-
-- (void)buttonItemClicked_back:(id)sender {
-    NSString *currentTextField = nil;
-
-    switch (self.segmentedControl.selectedSegmentIndex) {
-        case 0:
-            currentTextField = self.urlTextField.text;
-            break;
-     
-        default:
-        case 1:
-            currentTextField = self.pageTextField.text;
-            break;
-    }
-    
-    BOOL isLink;
-    if (!([currentTextField isEqual:@""])) {
-        isLink = YES;
-    } else {
-        isLink = NO;
-    }
-    
-    [self dismissViewControllerAnimated:YES completion:^{
-        if (self.delegate && [self.delegate respondsToSelector:@selector(linkViewControllerDismiss:isLink:)]) {
-            [self.delegate linkViewControllerDismiss:self isLink:isLink];
-        }
-    }];
-}
-
-- (void)segmentedControlValueChanged_Mode:(id)sender {
-    UITextField *currentTextField = nil;
-
-    switch (self.segmentedControl.selectedSegmentIndex) {
-        case 0:
-            self.linkType = CPDFFormLinkTypeLink;
-            currentTextField = self.urlTextField;
-            break;
-        default:
-        case 1:
-            self.linkType = CPDFFormLinkTypePage;
-            currentTextField = self.pageTextField;
-            break;
-    }
-}
-
-- (void)buttonItemClicked_Save:(id)sender {
-    NSString *string = nil;
-    if(CPDFFormLinkTypeLink == self.linkType) {
-        string = self.urlTextField.text;
-        string = [string lowercaseString];
-        if (![string hasPrefix:@"https://"] && ![string hasPrefix:@"http://"]) {
-            string = [NSString stringWithFormat:@"https://%@",string];
-        }
-
-    } else if (CPDFFormLinkTypePage == self.linkType) {
-        string = self.pageTextField.text;
-        CPDFAnnotation *annotation = self.annotStyle.annotations.firstObject;
-        CPDFDocument *document = annotation.page.document;
-        
-        if([string integerValue] > document.pageCount || [string intValue] < 1) {
-            UIAlertController *alert = [UIAlertController alertControllerWithTitle:@""
-                                                                           message:NSLocalizedString(@"Config Error", nil)
-                                                                    preferredStyle:UIAlertControllerStyleAlert];
-            UIAlertAction *okAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
-                self.pageTextField.text = @"";
-            }];
-            [alert addAction:okAction];
-            [self presentViewController:alert animated:YES completion:nil];
-
-            return;
-        }
-        
-    }
-    if([self.annotStyle.annotations.firstObject isKindOfClass:[CPDFButtonWidgetAnnotation class]]){
-        CPDFButtonWidgetAnnotation *mAnnotation = (CPDFButtonWidgetAnnotation*)self.annotStyle.annotations.firstObject;
-        
-        if(self.linkType == CPDFFormLinkTypeLink){
-            CPDFURLAction * urlAction = [[CPDFURLAction alloc] initWithURL:string];
-            [mAnnotation setAction:urlAction];
-        }else if(self.linkType == CPDFFormLinkTypePage){
-            CPDFDestination * destination = [[CPDFDestination alloc] initWithDocument:mAnnotation.page.document pageIndex:[string intValue] - 1];
-            CPDFGoToAction * goToAction = [[CPDFGoToAction alloc] initWithDestination:destination];
-            [mAnnotation setAction:goToAction];
-        }
-    }
-    
-    [self dismissViewControllerAnimated:YES completion:^{
-            if([self.delegate respondsToSelector:@selector(linkViewController:linkType:linkString:)]) {
-                [self.delegate linkViewController:self linkType:self.linkType linkString:string];
-            }
-    }];
-}
-
-#pragma mark - UITextFieldDelegate
-
-- (void)textFieldTextChange:(UITextField *)textField {
-    if(textField.text.length > 0) {
-        self.saveButton.enabled = YES;
-        self.saveButton.backgroundColor = [UIColor colorWithRed:20.0/255.0 green:96.0/255.0 blue:243.0/255.0 alpha:1.0];
-        [self.saveButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
-    } else {
-        self.saveButton.enabled = NO;
-        self.saveButton.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.2];
-        [self.saveButton setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
-    }
-    
-}
-
-- (BOOL)textFieldShouldReturn:(UITextField *)textField {
-    [textField resignFirstResponder];
-    return YES;
-}
-
-#pragma mark - NSNotification
-
-- (void)keyboardwillChangeFrame:(NSNotification *)notification {
-    NSDictionary *userInfo = [notification userInfo];
-    NSValue *value = [userInfo objectForKey:UIKeyboardFrameEndUserInfoKey];
-    CGRect frame = value.CGRectValue;
-    CGRect rect = [self.urlTextField convertRect:self.urlTextField.frame toView:self.view];
-    if(CGRectGetMaxY(rect) > self.view.frame.size.height - frame.size.height) {
-        UIEdgeInsets insets = self.scrcollView.contentInset;
-        insets.bottom = frame.size.height + self.urlTextField.frame.size.height;
-        self.scrcollView.contentInset = insets;
-    }
-}
-
-- (void)keyboardWillHide:(NSNotification *)notification {
-    UIEdgeInsets insets = self.scrcollView.contentInset;
-    insets.bottom = 0;
-    self.scrcollView.contentInset = insets;
-}
-
-@end

+ 0 - 50
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFLink/CPDFLinkViewController.h

@@ -1,50 +0,0 @@
-//
-//  CPDFLinkViewController.h
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <UIKit/UIKit.h>
-
-typedef NS_ENUM(NSInteger, CPDFLinkType) {
-    CPDFLinkTypeLink = 0,
-    CPDFLinkTypePage,
-    CPDFLinkTypeEmail
-};
-
-@class CPDFLinkViewController;
-@class CAnnotStyle;
-
-NS_ASSUME_NONNULL_BEGIN
-
-@protocol CPDFLinkViewControllerDelegate <NSObject>
-
-- (void)linkViewController:(CPDFLinkViewController *)linkViewController linkType:(CPDFLinkType)linkType linkString:(NSString *)linkString;
-
-- (void)linkViewControllerDismiss:(CPDFLinkViewController *)linkViewController isLink:(BOOL)isLink;
-
-@optional
-
-@end
-
-@interface CPDFLinkViewController : UIViewController
-
-@property (nonatomic, readonly) CAnnotStyle *annotStyle;
-
-@property (nonatomic, assign) NSInteger pageCount;
-
-@property (nonatomic, assign) BOOL isLink;
-
-- (instancetype)initWithStyle:(CAnnotStyle *)annotStyle;
-
-@property (nonatomic, weak) id<CPDFLinkViewControllerDelegate> delegate;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 488
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFLink/CPDFLinkViewController.m

@@ -1,488 +0,0 @@
-//
-//  CPDFLinkViewController.m
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import "CPDFLinkViewController.h"
-#import "CPDFColorUtils.h"
-#import "CAnnotStyle.h"
-
-@interface CPDFLinkViewController ()<UITextFieldDelegate>
-
-@property (nonatomic, strong) CAnnotStyle *annotStyle;
-
-@property (nonatomic, strong) UIScrollView *scrcollView;
-
-@property (nonatomic, strong) UIButton *backBtn;
-
-@property (nonatomic, strong) UILabel *titleLabel;
-
-@property (nonatomic, strong) UISegmentedControl *segmentedControl;
-
-@property (nonatomic, strong) UITextField *pageTextField;
-
-@property (nonatomic, strong) UITextField *emailTextField;
-
-@property (nonatomic, strong) UITextField *urlTextField;
-
-@property (nonatomic, strong) UIButton *saveButton;
-
-@property (nonatomic, assign) CPDFLinkType linkType;
-
-@property (nonatomic, strong) UIView *headerView;
-
-@end
-
-@implementation CPDFLinkViewController
-
-#pragma mark - Initializers
-
-- (instancetype)initWithStyle:(CAnnotStyle *)annotStyle {
-    if (self = [super init]) {
-        self.annotStyle = annotStyle;
-    }
-    return self;
-}
-
-- (void)viewDidLoad {
-    [super viewDidLoad];
-    
-    self.view.backgroundColor = [CPDFColorUtils CAnnotationSampleBackgoundColor];
-    
-    self.headerView = [[UIView alloc] init];
-    self.headerView.layer.borderColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.1].CGColor;
-    self.headerView.layer.borderWidth = 1.0;
-    self.headerView.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
-    [self.view addSubview:self.headerView];
-
-    [self initWithView];
-    
-    if(!self.annotStyle.isSelectAnnot) {
-        self.linkType = CPDFLinkTypeLink;
-        self.segmentedControl.selectedSegmentIndex = 0;
-    } else if([self.annotStyle.annotations.firstObject isKindOfClass:[CPDFButtonWidgetAnnotation class]]){
-        self.segmentedControl.selectedSegmentIndex = 0;
-        self.linkType = CPDFLinkTypeLink;
-    }else{
-        CPDFLinkAnnotation *link = self.annotStyle.annotations.firstObject;
-        
-        NSString *url = link.URL;
-        CPDFDestination *destination = link.destination;
-        if (url) {
-            if ([url hasPrefix:@"mailto:"]) {
-                self.emailTextField.text = [url substringFromIndex:7]?:@"";
-                self.linkType = CPDFLinkTypeEmail;
-                self.segmentedControl.selectedSegmentIndex = 2;
-            } else {
-                self.urlTextField.text = url?:@"";
-                self.linkType = CPDFLinkTypeLink;
-                self.segmentedControl.selectedSegmentIndex = 0;
-
-            }
-        } else if (destination) {
-            self.linkType = CPDFLinkTypePage;
-            self.pageTextField.text = [NSString stringWithFormat:@"%@", @(destination.pageIndex+1)];
-            self.segmentedControl.selectedSegmentIndex = 1;
-        } else {
-            self.linkType = CPDFLinkTypeLink;
-            self.segmentedControl.selectedSegmentIndex = 0;
-        }
-    }
-    [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
-}
-
--(void)viewDidAppear:(BOOL)animated {
-    [super viewDidAppear:animated];
-    
-    UITextField *currentTextField = nil;
-
-    switch (_linkType) {
-        case CPDFLinkTypeLink:
-            currentTextField = self.urlTextField;
-            break;
-        case CPDFLinkTypePage:
-            currentTextField = self.pageTextField;
-            break;
-        default:
-        case CPDFLinkTypeEmail:
-            currentTextField = self.emailTextField;
-            break;
-    }
-    
-    [currentTextField becomeFirstResponder];
-}
-
-- (void)viewWillDisappear:(BOOL)animated {
-    
-}
-
-- (BOOL)isLink {
-    NSString *currentTextField = nil;
-
-    switch (self.segmentedControl.selectedSegmentIndex) {
-        case 0:
-            currentTextField = self.urlTextField.text;
-            break;
-        case 1:
-            currentTextField = self.pageTextField.text;
-            break;
-        default:
-        case 2:
-            currentTextField = self.emailTextField.text;
-            break;
-    }
-    
-    if (!([currentTextField isEqual:@""])) {
-        return YES;
-    } else {
-        return NO;
-    }
-}
-
-- (void)setLinkType:(CPDFLinkType)linkType {
-    _linkType = linkType;
-    
-    UITextField *currentTextField = nil;
-
-    switch (_linkType) {
-        case CPDFLinkTypeLink:
-            self.pageTextField.hidden = self.emailTextField.hidden = YES;
-            self.urlTextField.hidden = NO;
-            currentTextField = self.urlTextField;
-            break;
-        case CPDFLinkTypePage:
-            self.urlTextField.hidden = self.emailTextField.hidden = YES;
-            self.pageTextField.hidden = NO;
-            currentTextField = self.pageTextField;
-            break;
-        default:
-        case CPDFLinkTypeEmail:
-            self.urlTextField.hidden = self.pageTextField.hidden = YES;
-            self.emailTextField.hidden = NO;
-            currentTextField = self.emailTextField;
-            break;
-    }
-    
-    [currentTextField becomeFirstResponder];
-
-    if(currentTextField.text.length > 0) {
-        self.saveButton.enabled = YES;
-        self.saveButton.backgroundColor = [UIColor systemBlueColor];
-        [self.saveButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
-    } else {
-        self.saveButton.enabled = NO;
-        self.saveButton.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.2];
-        [self.saveButton setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
-    }
-}
-
-- (void)viewWillLayoutSubviews {
-    [super viewWillLayoutSubviews];
-    self.titleLabel.frame = CGRectMake((self.view.frame.size.width - 120)/2, 5, 120, 50);
-    self.headerView.frame = CGRectMake(0, 0, self.view.frame.size.width, 50);
-    
-    if (@available(iOS 11.0, *)) {
-        self.backBtn.frame = CGRectMake(self.view.frame.size.width - 60 - self.view.safeAreaInsets.right, 5, 50, 50);
-    } else {
-        self.backBtn.frame = CGRectMake(self.view.frame.size.width - 60, 5, 50, 50);
-    }
-    if (@available(iOS 11.0, *)) {
-        _scrcollView.frame = CGRectMake(self.view.safeAreaInsets.left, 50, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, self.view.frame.size.height);
-    } else {
-        _scrcollView.frame = CGRectMake(0, 50, self.view.frame.size.width, self.view.frame.size.height);
-    }
-    self.scrcollView.contentSize = CGSizeMake(_scrcollView.frame.size.width, self.scrcollView.contentSize.height);
-    self.saveButton.frame  = CGRectMake((self.scrcollView.frame.size.width - 120)/2, self.saveButton.frame.origin.y, 120, 32);
-    
-}
-
-- (void)willTransitionToTraitCollection:(UITraitCollection *)newCollection withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
-    [super willTransitionToTraitCollection:newCollection withTransitionCoordinator:coordinator];
-    [self updatePreferredContentSizeWithTraitCollection:newCollection];
-}
-
-- (void)updatePreferredContentSizeWithTraitCollection:(UITraitCollection *)traitCollection {
-    
-    self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact ? 350 : 600);
-
-    [self.urlTextField resignFirstResponder];
-    [self.emailTextField resignFirstResponder];
-    [self.pageTextField resignFirstResponder];
-
-}
-
-#pragma mark - Private
-
-- (void)initWithView {
-    _titleLabel = [[UILabel alloc] init];
-    _titleLabel.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;
-    _titleLabel.text = NSLocalizedString(@"Link to", nil);
-    _titleLabel.textAlignment = NSTextAlignmentCenter;
-    _titleLabel.font = [UIFont systemFontOfSize:20];
-    _titleLabel.adjustsFontSizeToFitWidth = YES;
-    [self.headerView addSubview:_titleLabel];
-    
-    _scrcollView = [[UIScrollView alloc] init];
-    _scrcollView.frame = CGRectMake(0, 50, self.view.frame.size.width, self.view.frame.size.height);
-    _scrcollView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-    _scrcollView.scrollEnabled = YES;
-    [self.view addSubview:_scrcollView];
-    
-    self.backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
-    if (@available(iOS 11.0, *)) {
-        self.backBtn.frame = CGRectMake(self.view.frame.size.width - 60 - self.view.safeAreaInsets.right, 5, 50, 50);
-    } else {
-        self.backBtn.frame = CGRectMake(self.view.frame.size.width - 60, 5, 50, 50);
-    }
-    self.backBtn.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
-    [self.backBtn setImage:[UIImage imageNamed:@"CPDFAnnotationBaseImageBack" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-    [self.backBtn addTarget:self action:@selector(buttonItemClicked_back:) forControlEvents:UIControlEventTouchUpInside];
-    [self.headerView addSubview:self.backBtn];
-    
-    CGFloat offstY = 10;
-    _segmentedControl = [[UISegmentedControl alloc] initWithItems:@[NSLocalizedString(@"URL", nil), NSLocalizedString(@"Page",nil),NSLocalizedString(@"Email",nil)]];
-    _segmentedControl.frame = CGRectMake(30, offstY, self.scrcollView.frame.size.width - 30 *2, 32.0);
-    _segmentedControl.autoresizingMask = UIViewAutoresizingFlexibleWidth;
-    [_segmentedControl addTarget:self action:@selector(segmentedControlValueChanged_Mode:) forControlEvents:UIControlEventValueChanged];
-    [self.scrcollView addSubview:_segmentedControl];
-    offstY +=_segmentedControl.frame.size.height;
-
-    offstY+= 32.0;
-    _urlTextField = [[UITextField alloc]initWithFrame:CGRectMake(30.0, offstY, self.scrcollView.frame.size.width - 60.0, 28.0)];
-    _urlTextField.autoresizingMask = UIViewAutoresizingFlexibleWidth;
-
-    _urlTextField.layer.borderWidth = 1.0;
-    _urlTextField.layer.borderColor = [UIColor lightGrayColor].CGColor;
-    _urlTextField.layer.cornerRadius = 5.0;
-    _urlTextField.leftView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 8, 0)];
-    _urlTextField.leftViewMode = UITextFieldViewModeAlways;
-    _urlTextField.rightView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 8, 0)];
-    _urlTextField.rightViewMode = UITextFieldViewModeAlways;
-    _urlTextField.delegate = self;
-    _urlTextField.hidden = YES;
-    _urlTextField.font = [UIFont systemFontOfSize:18.0];
-    _urlTextField.placeholder = @"https://www.compdf.com";
-    [self.scrcollView addSubview:_urlTextField];
-
-    _pageTextField = [[UITextField alloc]initWithFrame:CGRectMake(30.0, offstY, self.view.frame.size.width - 60.0, 28.0)];
-    _pageTextField.autoresizingMask = UIViewAutoresizingFlexibleWidth;
-
-    _pageTextField.leftView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 8, 0)];
-    _pageTextField.layer.borderColor = [UIColor lightGrayColor].CGColor;
-    _pageTextField.leftViewMode = UITextFieldViewModeAlways;
-    _pageTextField.rightView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 8, 0)];
-    _pageTextField.rightViewMode = UITextFieldViewModeAlways;
-    _pageTextField.hidden = YES;
-    _pageTextField.layer.borderWidth = 1.0;
-    _pageTextField.layer.cornerRadius = 5.0;
-    _pageTextField.delegate = self;
-    _pageTextField.font = [UIFont systemFontOfSize:18.0];
-    NSString *str = [NSString stringWithFormat:@"1~%ld", self.pageCount];
-    _pageTextField.placeholder = NSLocalizedString(str, nil);
-    [_pageTextField setKeyboardType:UIKeyboardTypeNumberPad];
-    [self.scrcollView addSubview:_pageTextField];
-    
-    _emailTextField = [[UITextField alloc]initWithFrame:CGRectMake(30.0, offstY, self.view.frame.size.width - 60.0, 28.0)];
-    _emailTextField.autoresizingMask = UIViewAutoresizingFlexibleWidth;
-    _emailTextField.leftView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 8, 0)];
-    _emailTextField.layer.borderColor = [UIColor lightGrayColor].CGColor;
-    _emailTextField.leftViewMode = UITextFieldViewModeAlways;
-    _emailTextField.rightView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 8, 0)];
-    _emailTextField.rightViewMode = UITextFieldViewModeAlways;
-    _emailTextField.hidden = YES;
-    _emailTextField.layer.borderWidth = 1.0;
-    _emailTextField.layer.cornerRadius = 5.0;
-    _emailTextField.delegate = self;
-    _emailTextField.font = [UIFont systemFontOfSize:18.0];
-    _emailTextField.placeholder = NSLocalizedString(@"support@compdf.com", nil);
-    [self.scrcollView addSubview:_emailTextField];
-    offstY +=_urlTextField.frame.size.height;
-    
-    [_emailTextField addTarget:self action:@selector(textFieldTextChange:) forControlEvents:UIControlEventEditingChanged];
-    [_pageTextField addTarget:self action:@selector(textFieldTextChange:) forControlEvents:UIControlEventEditingChanged];
-    [_urlTextField addTarget:self action:@selector(textFieldTextChange:) forControlEvents:UIControlEventEditingChanged];
-    
-    offstY+= 30.0;
-    self.saveButton = [UIButton buttonWithType:UIButtonTypeCustom];
-    self.saveButton.frame  = CGRectMake((self.scrcollView.frame.size.width - 120)/2, offstY, 120, 32);
-    self.saveButton.layer.cornerRadius = 5.0;
-    self.saveButton.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
-    [self.saveButton setTitle:NSLocalizedString(@"Save",nil) forState:UIControlStateNormal];
-    [self.saveButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
-    [self.saveButton addTarget:self action:@selector(buttonItemClicked_Save:) forControlEvents:UIControlEventTouchUpInside];
-    self.saveButton.backgroundColor = [UIColor systemBlueColor];
-    [self.scrcollView addSubview:self.saveButton];
-
-    offstY += self.saveButton.frame.size.height;
-    
-    self.scrcollView.contentSize = CGSizeMake(self.view.frame.size.width, self.view.frame.size.height);
-    
-    [[NSNotificationCenter defaultCenter] addObserver:self
-                                             selector:@selector(keyboardwillChangeFrame:)
-                                                 name:UIKeyboardWillChangeFrameNotification
-                                               object:nil];
-    [[NSNotificationCenter defaultCenter] addObserver:self
-                                             selector:@selector(keyboardWillHide:)
-                                                 name:UIKeyboardWillHideNotification
-                                               object:nil];
-}
-
-#pragma mark - Action
-
-- (void)buttonItemClicked_back:(id)sender {
-    NSString *currentTextField = nil;
-
-    switch (self.segmentedControl.selectedSegmentIndex) {
-        case 0:
-            currentTextField = self.urlTextField.text;
-            break;
-        case 1:
-            currentTextField = self.pageTextField.text;
-            break;
-        default:
-        case 2:
-            currentTextField = self.emailTextField.text;
-            break;
-    }
-    
-    BOOL isLink;
-    if (!([currentTextField isEqual:@""])) {
-        isLink = YES;
-    } else {
-        isLink = NO;
-    }
-    
-    [self dismissViewControllerAnimated:YES completion:^{
-        if (self.delegate && [self.delegate respondsToSelector:@selector(linkViewControllerDismiss:isLink:)]) {
-            [self.delegate linkViewControllerDismiss:self isLink:isLink];
-        }
-    }];
-}
-
-- (void)segmentedControlValueChanged_Mode:(id)sender {
-    UITextField *currentTextField = nil;
-
-    switch (self.segmentedControl.selectedSegmentIndex) {
-        case 0:
-            self.linkType = CPDFLinkTypeLink;
-            currentTextField = self.urlTextField;
-            break;
-        case 1:
-            self.linkType = CPDFLinkTypePage;
-            currentTextField = self.pageTextField;
-            break;
-        default:
-        case 2:
-            self.linkType = CPDFLinkTypeEmail;
-            currentTextField = self.emailTextField;
-            break;
-    }
-}
-
-- (void)buttonItemClicked_Save:(id)sender {
-    NSString *string = nil;
-    if(CPDFLinkTypeLink == self.linkType) {
-        string = self.urlTextField.text;
-        string = [string lowercaseString];
-        if (![string hasPrefix:@"https://"] && ![string hasPrefix:@"http://"]) {
-            string = [NSString stringWithFormat:@"https://%@",string];
-        }
-
-    } else if (CPDFLinkTypePage == self.linkType) {
-        string = self.pageTextField.text;
-        CPDFAnnotation *annotation = self.annotStyle.annotations.firstObject;
-        CPDFDocument *document = annotation.page.document;
-        
-        if([string integerValue] > document.pageCount || [string intValue] < 1) {
-            UIAlertController *alert = [UIAlertController alertControllerWithTitle:@""
-                                                                           message:NSLocalizedString(@"Config Error", nil)
-                                                                    preferredStyle:UIAlertControllerStyleAlert];
-            UIAlertAction *okAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
-                self.pageTextField.text = @"";
-            }];
-            [alert addAction:okAction];
-            [self presentViewController:alert animated:YES completion:nil];
-
-            return;
-        }
-        
-    } else if (CPDFLinkTypeEmail == self.linkType) {
-        string = self.emailTextField.text;
-        if (![string hasPrefix:@"mailto:"]) {
-            string = [NSString stringWithFormat:@"mailto:%@",string];
-        }
-    }
-    
-    if([self.annotStyle.annotations.firstObject isKindOfClass:[CPDFButtonWidgetAnnotation class]]){
-        CPDFButtonWidgetAnnotation *mAnnotation = (CPDFButtonWidgetAnnotation*)self.annotStyle.annotations.firstObject;
-        
-        if(self.linkType == CPDFLinkTypeEmail || self.linkType == CPDFLinkTypeLink){
-            CPDFURLAction * urlAction = [[CPDFURLAction alloc] initWithURL:string];
-            [mAnnotation setAction:urlAction];
-        }else{
-            NSLog(@"Desting Nation");
-        }
-    }
-    
-    [self dismissViewControllerAnimated:YES completion:^{
-            if([self.delegate respondsToSelector:@selector(linkViewController:linkType:linkString:)]) {
-                [self.delegate linkViewController:self linkType:self.linkType linkString:string];
-            }
-    }];
-}
-
-#pragma mark - UITextFieldDelegate
-
-- (void)textFieldTextChange:(UITextField *)textField {
-    if(textField.text.length > 0) {
-        self.saveButton.enabled = YES;
-        self.saveButton.backgroundColor = [UIColor colorWithRed:20.0/255.0 green:96.0/255.0 blue:243.0/255.0 alpha:1.0];
-        [self.saveButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
-    } else {
-        self.saveButton.enabled = NO;
-        self.saveButton.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.2];
-        [self.saveButton setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
-    }
-    
-    if (textField == self.pageTextField) {
-        if ([self.pageTextField.text floatValue] > self.pageCount) {
-            self.saveButton.enabled = NO;
-            self.saveButton.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.2];
-            [self.saveButton setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
-        }
-    }
-}
-
-- (BOOL)textFieldShouldReturn:(UITextField *)textField {
-    [textField resignFirstResponder];
-    return YES;
-}
-
-#pragma mark - NSNotification
-
-- (void)keyboardwillChangeFrame:(NSNotification *)notification {
-    NSDictionary *userInfo = [notification userInfo];
-    NSValue *value = [userInfo objectForKey:UIKeyboardFrameEndUserInfoKey];
-    CGRect frame = value.CGRectValue;
-    CGRect rect = [self.urlTextField convertRect:self.urlTextField.frame toView:self.view];
-    if(CGRectGetMaxY(rect) > self.view.frame.size.height - frame.size.height) {
-        UIEdgeInsets insets = self.scrcollView.contentInset;
-        insets.bottom = frame.size.height + self.urlTextField.frame.size.height;
-        self.scrcollView.contentInset = insets;
-    }
-}
-
-- (void)keyboardWillHide:(NSNotification *)notification {
-    UIEdgeInsets insets = self.scrcollView.contentInset;
-    insets.bottom = 0;
-    self.scrcollView.contentInset = insets;
-}
-
-@end

+ 0 - 40
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFNote/CPDFNoteOpenViewController.h

@@ -1,40 +0,0 @@
-//
-//  CPDFNoteOpenViewController.h
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <UIKit/UIKit.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@class CPDFNoteOpenViewController;
-@class CPDFAnnotation;
-
-@protocol CPDFNoteOpenViewControllerDelegate <NSObject>
-
-@optional
-
-- (void)getNoteOpenViewController:(CPDFNoteOpenViewController *)noteOpenVC content:(NSString *)content isDelete:(BOOL)isDelete;
-
-@end
-
-@interface CPDFNoteOpenViewController : UIViewController
-
-@property (nonatomic, weak) id<CPDFNoteOpenViewControllerDelegate> delegate;
-
-@property (nonatomic, readonly) CPDFAnnotation * annotation;
-
-- (instancetype)initWithAnnotation:(CPDFAnnotation *)annotation;
-
-- (void)showViewController:(UIViewController *)viewController inRect:(CGRect)rect;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 211
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFNote/CPDFNoteOpenViewController.m

@@ -1,211 +0,0 @@
-//
-//  CPDFNoteOpenViewController.m
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import "CPDFNoteOpenViewController.h"
-
-#import <ComPDFKit/ComPDFKit.h>
-#import <ComPDFKit_Tools/CPDFColorUtils.h>
-
-#pragma mark - UIPopBackgroundView
-
-@interface UIPopBackgroundView : UIPopoverBackgroundView
-
-@property (nonatomic, assign) CGFloat fArrowOffset;
-@property (nonatomic, assign) UIPopoverArrowDirection direction;
-
-@end
-
-
-@implementation UIPopBackgroundView
-
-+ (BOOL)wantsDefaultContentAppearance {
-    return NO;
-}
-
-+ (CGFloat)arrowBase{
-    return 0;
-}
-
-+ (UIEdgeInsets)contentViewInsets {
-    return UIEdgeInsetsMake(0, 0, 0, 0);
-}
-
-+ (CGFloat)arrowHeight{
-    return 0;
-}
-
-- (UIPopoverArrowDirection)arrowDirection {
-    return self.direction;
-}
-
-- (void)setArrowDirection:(UIPopoverArrowDirection)arrowDirection {
-    self.direction = arrowDirection;
-}
-- (void)setArrowOffset:(CGFloat)arrowOffset {
-    self.fArrowOffset = arrowOffset;
-}
-
-- (instancetype)initWithFrame:(CGRect)frame {
-    self = [super initWithFrame:frame];
-    if (self) {
-        self.backgroundColor = [UIColor clearColor];
-        self.layer.cornerRadius = 3.0f;
-        
-        UIView *shadowView = [[UIView alloc] initWithFrame:frame];
-        shadowView.backgroundColor = self.backgroundColor;
-        [self addSubview:shadowView];
-        shadowView.layer.shadowColor = [UIColor colorWithRed:163.0/255.0 green:163.0/255.0 blue:163.0/255.0 alpha:0.5].CGColor;
-        shadowView.layer.shadowOpacity = 1.0f;
-        shadowView.layer.shadowRadius = 1.0;
-        shadowView.layer.shadowOffset = CGSizeMake(2, 1);
-        shadowView.layer.cornerRadius = 3.0f;
-        
-        CALayer *maskLayer = [CALayer layer];
-        maskLayer.frame = shadowView.layer.bounds;
-        maskLayer.masksToBounds = YES;
-        [shadowView.layer addSublayer:maskLayer];
-    }
-    return self;
-}
-
-- (void)layoutSubviews {
-    [super layoutSubviews];
-}
-
-@end
-
-#pragma mark - CPDFNoteOpenViewController
-
-@interface CPDFNoteOpenViewController () <UIPopoverPresentationControllerDelegate, UITextViewDelegate>
-
-@property (nonatomic, strong) UITextView *noteTextView;
-
-@property (nonatomic, strong) NSString *textViewContent;
-
-@property (nonatomic, strong) CPDFAnnotation * annotation;
-
-@property (nonatomic, strong) UIView *contentView;
-
-@end
-
-@implementation CPDFNoteOpenViewController
-
-- (instancetype)initWithAnnotation:(id)annotation {
-    if(self = [super init]) {
-        self.annotation = annotation;
-    }
-    return self;
-}
-
-#pragma mark - UIViewController Methods
-
-- (void)viewDidLoad {
-    [super viewDidLoad];
-    // Do any additional setup after loading the view.
-    self.view.backgroundColor = [CPDFColorUtils CNoteOpenBackgooundColor];
-    
-    _noteTextView = [[UITextView alloc] initWithFrame:CGRectMake(0, 10, self.view.bounds.size.width, self.view.bounds.size.height-45)];
-    _noteTextView.delegate = self;
-    _noteTextView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
-    [_noteTextView setBackgroundColor:[UIColor clearColor]];
-    [_noteTextView setFont:[UIFont systemFontOfSize:14]];
-    [_noteTextView setTextAlignment:NSTextAlignmentLeft];
-    [_noteTextView setTextColor:[UIColor blackColor]];
-    [self.view addSubview:_noteTextView];
-    _noteTextView.text = self.textViewContent;
-    
-    UIButton *deleteButton = [UIButton buttonWithType:UIButtonTypeCustom];
-    [deleteButton setImage:[UIImage imageNamed:@"CPDFNoteContentImageNameDelete"
-                                      inBundle:[NSBundle bundleForClass:self.class]
-                 compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-    [deleteButton sizeToFit];
-    CGRect frame = deleteButton.frame;
-    frame.origin.x = 10;
-    frame.origin.y = self.view.bounds.size.height-deleteButton.bounds.size.height-10;
-    deleteButton.frame = frame;
-    deleteButton.autoresizingMask = UIViewAutoresizingFlexibleTopMargin;
-    [deleteButton addTarget:self action:@selector(buttonItemClicked_Delete:) forControlEvents:UIControlEventTouchUpInside];
-    [self.view addSubview:deleteButton];
-    
-    UIButton *saveButton = [UIButton buttonWithType:UIButtonTypeCustom];
-    [saveButton setImage:[UIImage imageNamed:@"CPDFNoteContentImageNameSave"
-                                    inBundle:[NSBundle bundleForClass:self.class]
-               compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-    [saveButton sizeToFit];
-    frame = saveButton.frame;
-    frame.origin.x = self.view.bounds.size.width-saveButton.bounds.size.width-10;
-    frame.origin.y = self.view.bounds.size.height-saveButton.bounds.size.height-10;
-    saveButton.frame = frame;
-    saveButton.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleTopMargin;
-    [saveButton addTarget:self action:@selector(buttonItemClicked_Save:) forControlEvents:UIControlEventTouchUpInside];
-    [self.view addSubview:saveButton];
-    
-    self.noteTextView.text = self.annotation.contents?:@"";
-}
-
-- (void)viewDidAppear:(BOOL)animation {
-    [super viewDidAppear:animation];
-    
-    [_noteTextView becomeFirstResponder];
-}
-
-- (void)viewWillDisappear:(BOOL)animation {
-    [super viewWillDisappear:animation];
-    
-    if ([_noteTextView isFirstResponder]) {
-        [_noteTextView resignFirstResponder];
-    }
-}
-
-- (void)showViewController:(UIViewController *)viewController inRect:(CGRect)rect {
-    self.preferredContentSize = CGSizeMake(280, 305);
-    self.modalPresentationStyle = UIModalPresentationPopover;
-    UIPopoverPresentationController *popVC = self.popoverPresentationController;
-    popVC.delegate = self;
-    popVC.sourceRect = rect;
-    popVC.sourceView = viewController.view;
-    popVC.canOverlapSourceViewRect = YES;
-    popVC.popoverBackgroundViewClass = [UIPopBackgroundView class];
-    [viewController presentViewController:self animated:YES completion:nil];
-}
-
-#pragma mark - Button Event Action
-
-- (void)buttonItemClicked_Delete:(id)sender {
-    [self dismissViewControllerAnimated:YES completion:^{
-        if (self.delegate && [self.delegate respondsToSelector:@selector(getNoteOpenViewController:content:isDelete:)]) {
-            [self.delegate getNoteOpenViewController:self content:self.noteTextView.text isDelete:YES];
-        }
-    }];
-}
-
-- (void)buttonItemClicked_Save:(id)sender {
-    [self dismissViewControllerAnimated:YES completion:^{
-        if (self.delegate && [self.delegate respondsToSelector:@selector(getNoteOpenViewController:content:isDelete:)]) {
-            [self.delegate getNoteOpenViewController:self content:self.noteTextView.text isDelete:NO];
-        }
-    }];
-}
-
-#pragma mark - UIPopoverPresentationControllerDelegate
-
-- (UIModalPresentationStyle)adaptivePresentationStyleForPresentationController:(UIPresentationController *)controller traitCollection:(UITraitCollection *)traitCollection {
-    return UIModalPresentationNone;
-}
-
-- (void)popoverPresentationControllerDidDismissPopover:(UIPopoverPresentationController *)popoverPresentationController {
-    if (self.delegate && [self.delegate respondsToSelector:@selector(getNoteOpenViewController:content:isDelete:)]) {
-        [self.delegate getNoteOpenViewController:self content:self.noteTextView.text isDelete:NO];
-    }
-}
-
-@end

+ 0 - 38
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFNote/CPDFNoteViewController.h

@@ -1,38 +0,0 @@
-//
-//  CPDFNoteViewController.h
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <UIKit/UIKit.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@class CAnnotStyle;
-@class CPDFNoteViewController;
-
-@protocol CPDFNoteViewControllerDelegate <NSObject>
-
-@optional
-
-- (void)noteViewController:(CPDFNoteViewController *)noteViewController annotSytle:(CAnnotStyle *)annotStyle;
-
-@end
-
-@interface CPDFNoteViewController : UIViewController
-
-@property (nonatomic, readonly) CAnnotStyle *annoStyle;
-
-@property (nonatomic, weak) id<CPDFNoteViewControllerDelegate> delegate;
-
-- (instancetype)initWithStyle:(CAnnotStyle *)annotStyle;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 185
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFNote/CPDFNoteViewController.m

@@ -1,185 +0,0 @@
-//
-//  CPDFNoteViewController.m
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import "CPDFNoteViewController.h"
-#import "CPDFSampleView.h"
-#import "CPDFColorSelectView.h"
-#import "CPDFColorPickerView.h"
-#import "CAnnotStyle.h"
-
-#import <ComPDFKit_Tools/CPDFColorUtils.h>
-
-
-@interface CPDFNoteViewController () <UIColorPickerViewControllerDelegate, CPDFColorSelectViewDelegate, CPDFColorPickerViewDelegate>
-
-@property (nonatomic, strong) CPDFSampleView *sampleView;
-
-@property (nonatomic, strong) UIView *sampleBackgoundView;
-
-@property (nonatomic, strong) CPDFColorSelectView *colorView;
-
-@property (nonatomic, strong) CPDFColorPickerView *colorPicker;
-
-@property (nonatomic, strong) UILabel *titleLabel;
-
-@property (nonatomic, strong) CAnnotStyle *annotStyle;
-
-@property (nonatomic, strong) UIButton *backBtn;
-
-@end
-
-@implementation CPDFNoteViewController
-
-#pragma mark - Initializers
-
-- (instancetype)initWithStyle:(CAnnotStyle *)annotStyle {
-    if (self = [super init]) {
-        self.annotStyle = annotStyle;
-    }
-    return self;
-}
-
-#pragma mark - ViewController Methods
-
-- (void)viewDidLoad {
-    [super viewDidLoad];
-    // Do any additional setup after loading the view.
-    self.titleLabel = [[UILabel alloc] init];
-    self.titleLabel.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleHeight;
-    self.titleLabel.text = NSLocalizedString(@"Note", nil);
-    self.titleLabel.textAlignment = NSTextAlignmentCenter;
-    self.titleLabel.font = [UIFont systemFontOfSize:20];
-    self.titleLabel.adjustsFontSizeToFitWidth = YES;
-    [self.view addSubview:self.titleLabel];
-    
-    self.backBtn = [[UIButton alloc] init];
-    self.backBtn.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleHeight;
-    [self.backBtn setImage:[UIImage imageNamed:@"CPDFAnnotationBaseImageBack" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-    [self.backBtn addTarget:self action:@selector(buttonItemClicked_back:) forControlEvents:UIControlEventTouchUpInside];
-    [self.view addSubview:self.backBtn];
-    
-    self.sampleBackgoundView = [[UIView alloc] init];
-    self.sampleBackgoundView.layer.borderColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.1].CGColor;
-    self.sampleBackgoundView.layer.borderWidth = 1.0;
-    self.sampleBackgoundView.backgroundColor = [CPDFColorUtils CAnnotationSampleBackgoundColor];
-    [self.view addSubview:self.sampleBackgoundView];
-    
-    self.sampleView = [[CPDFSampleView alloc] init];
-    self.sampleView.backgroundColor = [UIColor whiteColor];
-    self.sampleView.layer.borderColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.1].CGColor;
-    self.sampleView.layer.borderWidth = 1.0;
-    self.sampleView.opcity = 1.0;
-    self.sampleView.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleHeight;
-    [self.sampleBackgoundView addSubview:self.sampleView];
-    
-    self.colorView = [[CPDFColorSelectView alloc] init];
-    self.colorView.selectedColor = self.annotStyle.color;
-    self.colorView.delegate = self;
-    self.colorView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-    [self.view addSubview:self.colorView];
-    
-    self.view.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
-    [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
-}
-
-- (void)viewWillLayoutSubviews {
-    [super viewWillLayoutSubviews];
-    self.titleLabel.frame = CGRectMake((self.view.frame.size.width - 120)/2, 5, 120, ((self.view.frame.size.height)/7));
-    self.backBtn.frame = CGRectMake(self.view.frame.size.width - 60, 5, 50, ((self.view.frame.size.height)/7));
-    self.sampleBackgoundView.frame = CGRectMake(0, ((self.view.frame.size.height)/7), self.view.bounds.size.width, ((self.view.frame.size.height)/7)*3);
-    self.sampleView.frame  = CGRectMake((self.view.frame.size.width - 300)/2, 15, 300, self.sampleBackgoundView.bounds.size.height - 30);
-    self.colorView.frame = CGRectMake(0, ((self.view.frame.size.height)/7)*4, self.view.frame.size.width, ((self.view.frame.size.height)/7)*2);
-    if (@available(iOS 11.0, *)) {
-        self.colorPicker.frame = CGRectMake(self.view.safeAreaInsets.left, 0, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, self.view.frame.size.height);
-        self.colorView.frame = CGRectMake(self.view.safeAreaInsets.left, ((self.view.frame.size.height)/7)*4,self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, ((self.view.frame.size.height)/7)*2);
-        self.backBtn.frame = CGRectMake(self.view.frame.size.width - 60 - self.view.safeAreaInsets.right, 5, 50, ((self.view.frame.size.height)/7));
-    } else {
-        self.colorPicker.frame = self.view.frame;
-        self.colorView.frame = CGRectMake(0, ((self.view.frame.size.height)/7)*4, self.view.frame.size.width, ((self.view.frame.size.height)/7)*2);
-        self.backBtn.frame = CGRectMake(self.view.frame.size.width - 60, 5, 50, ((self.view.frame.size.height)/7));
-    }
-}
-
-- (void)willTransitionToTraitCollection:(UITraitCollection *)newCollection withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
-    [super willTransitionToTraitCollection:newCollection withTransitionCoordinator:coordinator];
-    [self updatePreferredContentSizeWithTraitCollection:newCollection];
-}
-
-- (void)viewWillAppear:(BOOL)animated {
-    self.sampleView.color = self.annotStyle.color;
-    self.sampleView.selecIndex = CPDFSamplesNote;
-    [self.sampleView setNeedsDisplay];
-}
-
-#pragma mark - Protect Methods
-
-- (void)updatePreferredContentSizeWithTraitCollection:(UITraitCollection *)traitCollection
-{
-    self.preferredContentSize = CGSizeMake(MIN(self.view.bounds.size.width, self.view.bounds.size.height), traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact ? 320 : 320);
-}
-
-#pragma mark - Action
-
-- (void)buttonItemClicked_back:(id)sender {
-    [self dismissViewControllerAnimated:YES completion:nil];
-}
-
-#pragma mark - CPDFColorSelectViewDelegate
-
-- (void)selectColorView:(CPDFColorSelectView *)select {
-    if (@available(iOS 14.0, *)) {
-        UIColorPickerViewController *picker = [[UIColorPickerViewController alloc] init];
-        picker.delegate = self;
-        [self presentViewController:picker animated:YES completion:nil];
-    } else {
-        _colorPicker = [[CPDFColorPickerView alloc] initWithFrame:self.view.frame];
-        _colorPicker.delegate = self;
-        _colorView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-        _colorPicker.backgroundColor = [UIColor whiteColor];
-        [self.view addSubview:self.colorPicker];
-    }
-}
-
-- (void)selectColorView:(CPDFColorSelectView *)select color:(UIColor *)color {
-    self.sampleView.color = color;
-    self.annotStyle.color = color;
-    [self.sampleView setNeedsDisplay];
-    
-    if (self.delegate && [self.delegate respondsToSelector:@selector(noteViewController:annotSytle:)]) {
-        [self.delegate noteViewController:self annotSytle:self.annotStyle];
-    }
-}
-
-#pragma mark - CPDFColorPickerViewDelegate
-
-- (void)pickerView:(CPDFColorPickerView *)colorPickerView color:(UIColor *)color {
-    self.sampleView.color = color;
-    self.annotStyle.color = color;
-    [self.sampleView setNeedsDisplay];
-    
-    if (self.delegate && [self.delegate respondsToSelector:@selector(noteViewController:annotSytle:)]) {
-        [self.delegate noteViewController:self annotSytle:self.annotStyle];
-    }
-}
-
-#pragma mark - UIColorPickerViewControllerDelegate
-
-- (void)colorPickerViewControllerDidFinish:(UIColorPickerViewController *)viewController API_AVAILABLE(ios(14.0)) {
-    self.sampleView.color = viewController.selectedColor;
-    self.annotStyle.color = self.sampleView.color;
-    if (self.delegate && [self.delegate respondsToSelector:@selector(noteViewController:annotSytle:)]) {
-        [self.delegate noteViewController:self annotSytle:self.annotStyle];
-    }
-    [self.sampleView setNeedsDisplay];
-}
-
-@end

+ 0 - 34
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFShape/CPDFShapeArrowViewController.h

@@ -1,34 +0,0 @@
-//
-//  CPDFShapeArrowViewController.h
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import "CPDFShapeCircleViewController.h"
-
-NS_ASSUME_NONNULL_BEGIN
-
-@class CPDFShapeArrowViewController;
-@class CAnnotStyle;
-
-@protocol CPDFShapeArrowViewControllerDelegate <NSObject>
-
-@optional
-
-- (void)arrowViewController:(CPDFShapeArrowViewController *)arrowViewController annotStyle:(CAnnotStyle *)annotStyle;
-
-@end
-
-@interface CPDFShapeArrowViewController : CPDFShapeCircleViewController
-
-@property (nonatomic, weak) id<CPDFShapeArrowViewControllerDelegate> lineDelegate;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 355
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFShape/CPDFShapeArrowViewController.m

@@ -1,355 +0,0 @@
-//
-//  CPDFShapeArrowViewController.m
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import "CPDFShapeArrowViewController.h"
-#import "CPDFShareCircleViewController_Header.h"
-#import "CPDFArrowStyleView.h"
-#import "CShapeSelectView.h"
-#import "CPDFDrawArrowView.h"
-
-#import <ComPDFKit_Tools/CPDFColorUtils.h>
-
-@interface CPDFShapeArrowViewController () <UIColorPickerViewControllerDelegate, CPDFArrowStyleViewDelegate, CShapeSelectViewDelegate, CPDFColorPickerViewDelegate>
-
-@property (nonatomic, strong) UILabel *arrowLabel;
-
-@property (nonatomic, strong) UIButton *arrowBtn;
-
-@property (nonatomic, strong) UILabel *trialLabel;
-
-@property (nonatomic, strong) UIButton *trialBtn;
-
-@property (nonatomic, strong) CPDFArrowStyleView *startArrowStyleView;
-
-@property (nonatomic, strong) CPDFArrowStyleView *endArrowStyleView;
-
-@property (nonatomic, strong) CPDFDrawArrowView *startDrawView;
-
-@property (nonatomic, strong) CPDFDrawArrowView *endDrawView;
-
-@property (nonatomic, strong) NSMutableArray *dashPattern;
-
-@property (nonatomic, strong) CShapeSelectView *shapeSelectView;
-
-@property (nonatomic, strong) UIColorPickerViewController *picker API_AVAILABLE(ios(14.0));
-
-@property (nonatomic, strong) UIColorPickerViewController *fillPicker API_AVAILABLE(ios(14.0));
-
-@end
-
-@implementation CPDFShapeArrowViewController
-
-#pragma mark - ViewController Methods
-
-- (void)viewDidLoad {
-    [super viewDidLoad];
-    // Do any additional setup after loading the view.
-    self.arrowLabel = [[UILabel alloc] init];
-    self.arrowLabel.text = NSLocalizedString(@"Start", nil);
-    self.arrowLabel.textColor = [UIColor grayColor];
-    self.arrowLabel.font = [UIFont systemFontOfSize:12.0];
-    [self.scrcollView addSubview:self.arrowLabel];
-
-    self.arrowBtn = [[UIButton alloc] init];
-    [self.arrowBtn setImage:[UIImage imageNamed:@"CPDFShapeArrowImageStart" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-    self.arrowBtn.layer.borderWidth = 1.0;
-    self.arrowBtn.layer.borderColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.1].CGColor;
-    self.arrowBtn.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
-    [self.arrowBtn addTarget:self action:@selector(buttonItemClicked_start:) forControlEvents:UIControlEventTouchUpInside];
-    [self.scrcollView addSubview:self.arrowBtn];
-    
-    self.startDrawView = [[CPDFDrawArrowView alloc] init];
-    self.startDrawView.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
-    [self.arrowBtn addSubview:self.startDrawView];
-    
-    self.trialLabel = [[UILabel alloc] init];
-    self.trialLabel.text = NSLocalizedString(@"End", nil);
-    self.trialLabel.textColor = [UIColor grayColor];
-    self.trialLabel.font = [UIFont systemFontOfSize:12.0];
-    self.trialLabel.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;
-    [self.scrcollView addSubview:self.trialLabel];
-    
-    self.trialBtn = [[UIButton alloc] init];
-    [self.trialBtn setImage:[UIImage imageNamed:@"CPDFShapeArrowImageEnd" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-    self.trialBtn.layer.borderWidth = 1.0;
-    self.trialBtn.layer.borderColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.1].CGColor;
-    [self.trialBtn addTarget:self action:@selector(buttonItemClicked_trial:) forControlEvents:UIControlEventTouchUpInside];
-    self.trialBtn.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
-    [self.scrcollView addSubview:self.trialBtn];
-    
-    self.endDrawView = [[CPDFDrawArrowView alloc]init];
-    self.endDrawView.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
-    [self.trialBtn addSubview:self.endDrawView];
-    
-    self.fillColorSelectView.hidden = YES;
-    
-    self.view.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
-}
-
-- (void)viewWillLayoutSubviews {
-    [super viewWillLayoutSubviews];
-    self.scrcollView.frame = CGRectMake(0, 170, self.view.frame.size.width, self.view.frame.size.height-170);
-    self.scrcollView.contentSize = CGSizeMake(self.view.frame.size.width, 500);
-    
-    if (@available(iOS 11.0, *)) {
-        CGFloat offsetY = 0;
-        self.colorView.frame = CGRectMake(self.view.safeAreaInsets.left, 0,self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 90);
-        offsetY+= self.colorView.frame.size.height;
-        self.opacitySliderView.frame = CGRectMake(self.view.safeAreaInsets.left, offsetY, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 90);
-        offsetY+= self.opacitySliderView.frame.size.height;
-
-        self.thicknessView.frame = CGRectMake(self.view.safeAreaInsets.left, offsetY, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 90);
-        offsetY+= self.thicknessView.frame.size.height;
-
-        self.dottedView.frame = CGRectMake(self.view.safeAreaInsets.left, offsetY, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 90);
-        offsetY+= self.dottedView.frame.size.height;
-
-        self.arrowLabel.frame = CGRectMake(self.view.safeAreaInsets.left+20, offsetY, 100, 45);
-        self.arrowBtn.frame = CGRectMake(self.view.frame.size.width - 100 - self.view.safeAreaInsets.right, offsetY + 7.5, 80, 30);
-        offsetY+= self.arrowLabel.frame.size.height;
-        self.startDrawView.frame = CGRectMake(0, 0, 40, 30);
-        
-        self.trialLabel.frame = CGRectMake(self.view.safeAreaInsets.left+20, offsetY, 100, 45);
-        self.trialBtn.frame = CGRectMake(self.view.frame.size.width - 100- self.view.safeAreaInsets.right, offsetY + 7.5, 80, 30);
-        self.endDrawView.frame = CGRectMake(0, 0, 40, 30);
-    } else {
-        CGFloat offsetY = 0;
-        self.colorView.frame = CGRectMake(0, 0,self.view.frame.size.width, 90);
-        offsetY+= self.colorView.frame.size.height;
-        self.opacitySliderView.frame = CGRectMake(0, offsetY, self.view.frame.size.width - 0, 90);
-        offsetY+= self.opacitySliderView.frame.size.height;
-
-        self.thicknessView.frame = CGRectMake(0, offsetY, self.view.frame.size.width, 90);
-        offsetY+= self.thicknessView.frame.size.height;
-
-        self.dottedView.frame = CGRectMake(0, offsetY, self.view.frame.size.width, 90);
-        offsetY+= self.dottedView.frame.size.height;
-
-        self.arrowLabel.frame = CGRectMake(20, offsetY, 100, 45);
-        self.arrowBtn.frame = CGRectMake(self.view.frame.size.width - 100, offsetY + 7.5, 80, 30);
-        offsetY+= self.arrowLabel.frame.size.height;
-        self.startDrawView.frame = CGRectMake(0, 0, 40, 30);
-        
-        self.trialLabel.frame = CGRectMake(20, offsetY, 100, 45);
-        self.trialBtn.frame = CGRectMake(self.view.frame.size.width - 100, offsetY + 7.5, 80, 30);
-        self.endDrawView.frame = CGRectMake(0, 0, 40, 30);
-    }
-}
-
-#pragma mark - Protect Mehthods
-
-- (void)commomInitFromAnnotStyle {
-    self.opacitySliderView.opacitySlider.value = self.annotStyle.opacity;
-    self.opacitySliderView.startLabel.text = [NSString stringWithFormat:@"%d%%", (int)((self.opacitySliderView.opacitySlider.value/1)*100)];
-    self.thicknessView.thicknessSlider.value = self.annotStyle.lineWidth;
-    self.thicknessView.startLabel.text = [NSString stringWithFormat:@"%d pt", (int)self.thicknessView.thicknessSlider.value];
-    self.dashPattern = (NSMutableArray *)self.annotStyle.dashPattern;
-    self.dottedView.thicknessSlider.value = [self.dashPattern.firstObject floatValue];
-    self.dottedView.startLabel.text = [NSString stringWithFormat:@"%d pt", (int)self.dottedView.thicknessSlider.value];
-    
-    self.sampleView.color = self.annotStyle.color;
-    self.sampleView.opcity = self.annotStyle.opacity;
-    self.sampleView.dotted = self.dottedView.thicknessSlider.value;
-    self.sampleView.interiorColor = self.annotStyle.interiorColor;
-    self.sampleView.startArrowStyleIndex = (NSInteger)self.annotStyle.startLineStyle;
-    self.sampleView.endArrowStyleIndex = (NSInteger)self.annotStyle.endLineStyle;
-    [self.sampleView setNeedsDisplay];
-
-    self.startDrawView.selectIndex = (NSInteger)self.annotStyle.startLineStyle;
-    [self.startDrawView setNeedsDisplay];
-    self.endDrawView.selectIndex = (NSInteger)self.annotStyle.endLineStyle;
-    [self.endDrawView setNeedsDisplay];
-}
-    
-
-- (void)updatePreferredContentSizeWithTraitCollection:(UITraitCollection *)traitCollection {
-    if([self.startArrowStyleView superview] || [self.endArrowStyleView superview]) {
-        self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, 120);
-    } else if ([self.colorPicker superview]) {
-        UIDevice *currentDevice = [UIDevice currentDevice];
-        if (currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad) {
-            // This is an iPad
-            self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, 520);
-        } else {
-            // This is an iPhone or iPod touch
-            self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, 320);
-        }
-    } else {
-        self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact ? 350 : 660);
-
-    }
-}
-
-#pragma mark - Action
-
-- (void)buttonItemClicked_start:(id)sender {
-    self.startArrowStyleView = [[CPDFArrowStyleView alloc] initWirhTitle:NSLocalizedString(@"Arrow Style",nil)];
-    self.startArrowStyleView.frame = self.view.frame;
-    self.startArrowStyleView.delegate = self;
-    self.startArrowStyleView.selectIndex = self.startDrawView.selectIndex;
-    self.startArrowStyleView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-    [self.view addSubview:self.startArrowStyleView];
-    [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
-}
-
-- (void)buttonItemClicked_trial:(id)sender {
-    self.endArrowStyleView = [[CPDFArrowStyleView alloc] initWirhTitle:NSLocalizedString(@"Arrowtail style",nil)];
-    self.endArrowStyleView.frame = self.view.frame;
-    self.endArrowStyleView.delegate = self;
-    self.endArrowStyleView.selectIndex = self.endDrawView.selectIndex;
-    self.endArrowStyleView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-    [self.view addSubview:self.endArrowStyleView];
-    [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
-}
-
-#pragma mark - CPDFArrowStyleViewDelegate
-
-- (void)arrowStyleView:(CPDFArrowStyleView *)arrowStyleView selectIndex:(NSInteger)selectIndex {
-    if (arrowStyleView == self.startArrowStyleView) {
-        self.sampleView.startArrowStyleIndex = selectIndex;
-        self.annotStyle.startLineStyle = selectIndex;
-        if (self.lineDelegate && [self.lineDelegate respondsToSelector:@selector(arrowViewController:annotStyle:)]) {
-            [self.lineDelegate arrowViewController:self annotStyle:self.annotStyle];
-        }
-        [self.sampleView setNeedsDisplay];
-        
-        self.startDrawView.selectIndex = selectIndex;
-        [self.startDrawView setNeedsDisplay];
-    } else if (arrowStyleView == self.endArrowStyleView) {
-        self.sampleView.endArrowStyleIndex = selectIndex;
-        self.annotStyle.endLineStyle = selectIndex;
-        if (self.lineDelegate && [self.lineDelegate respondsToSelector:@selector(arrowViewController:annotStyle:)]) {
-            [self.lineDelegate arrowViewController:self annotStyle:self.annotStyle];
-        }
-        [self.sampleView setNeedsDisplay];
-        
-        self.endDrawView.selectIndex = selectIndex;
-        [self.endDrawView setNeedsDisplay];
-    }
-}
-
-- (void)arrowStyleRemoveView:(CPDFArrowStyleView *)arrowStyleView {
-    [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
-}
-
-#pragma mark - CPDFOpacitySliderViewDelegate
-
-- (void)opacitySliderView:(CPDFOpacitySliderView *)opacitySliderView opacity:(CGFloat)opacity {
-    self.sampleView.opcity = opacity;
-    self.annotStyle.opacity = opacity;
-    if (self.lineDelegate && [self.lineDelegate respondsToSelector:@selector(arrowViewController:annotStyle:)]) {
-        [self.lineDelegate arrowViewController:self annotStyle:self.annotStyle];
-    }
-    [self.sampleView setNeedsDisplay];
-}
-
-#pragma mark - CPDFThicknessSliderViewDelegate
-
-- (void)thicknessSliderView:(CPDFThicknessSliderView *)thicknessSliderView thickness:(CGFloat)thickness {
-    if (thicknessSliderView == self.thicknessView) {
-        self.sampleView.thickness = thickness;
-        self.annotStyle.lineWidth = thickness;
-        [self.sampleView setNeedsDisplay];
-        if (self.lineDelegate && [self.lineDelegate respondsToSelector:@selector(arrowViewController:annotStyle:)]) {
-            [self.lineDelegate arrowViewController:self annotStyle:self.annotStyle];
-        }
-    } else if (thicknessSliderView == self.dottedView) {
-        self.sampleView.dotted = thickness;
-        self.annotStyle.style = CPDFBorderStyleDashed;
-        self.annotStyle.dashPattern = @[[NSNumber numberWithFloat:(float)thickness]];
-        if (self.lineDelegate && [self.lineDelegate respondsToSelector:@selector(arrowViewController:annotStyle:)]) {
-            [self.lineDelegate arrowViewController:self annotStyle:self.annotStyle];
-        }
-        [self.sampleView setNeedsDisplay];
-    }
-}
-
-#pragma mark - CPDFColorSelectViewDelegate
-
-- (void)selectColorView:(CPDFColorSelectView *)select {
-    if (select == self.colorView) {
-        if (@available(iOS 14.0, *)) {
-            self.picker = [[UIColorPickerViewController alloc] init];
-            self.picker.delegate = self;
-            [self presentViewController:self.picker animated:YES completion:nil];
-        } else {
-            UIDevice *currentDevice = [UIDevice currentDevice];
-            if (currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad) {
-                // This is an iPad
-                self.colorPicker = [[CPDFColorPickerView alloc] initWithFrame:CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y, self.view.frame.size.width, 520)];
-            } else {
-                // This is an iPhone or iPod touch
-                self.colorPicker = [[CPDFColorPickerView alloc] initWithFrame:CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y, self.view.frame.size.width, 320)];
-            }
-            self.colorPicker.delegate = self;
-            self.colorPicker.backgroundColor = [UIColor whiteColor];
-            [self.view addSubview:self.colorPicker];
-            [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
-        }
-    }
-}
-
-- (void)selectColorView:(CPDFColorSelectView *)select color:(UIColor *)color {
-    if (select == self.colorView) {
-        self.sampleView.color = color;
-        self.annotStyle.color = color;
-        [self.sampleView setNeedsDisplay];
-        if (self.lineDelegate && [self.lineDelegate respondsToSelector:@selector(arrowViewController:annotStyle:)]) {
-            [self.lineDelegate arrowViewController:self annotStyle:self.annotStyle];
-        }
-    } else if (select == self.fillColorSelectView) {
-        self.sampleView.interiorColor = color;
-        self.annotStyle.interiorColor = color;
-        [self.sampleView setNeedsDisplay];
-        if (self.lineDelegate && [self.lineDelegate respondsToSelector:@selector(arrowViewController:annotStyle:)]) {
-            [self.lineDelegate arrowViewController:self annotStyle:self.annotStyle];
-        }
-    }
-}
-
-#pragma mark - CPDFColorPickerViewDelegate
-
-- (void)pickerView:(CPDFColorPickerView *)colorPickerView color:(UIColor *)color {
-    if (colorPickerView == self.colorPicker) {
-        self.sampleView.color = color;
-        self.annotStyle.color = color;
-        [self.sampleView setNeedsDisplay];
-        if (self.lineDelegate && [self.lineDelegate respondsToSelector:@selector(arrowViewController:annotStyle:)]) {
-            [self.lineDelegate arrowViewController:self annotStyle:self.annotStyle];
-        }
-    }
-    
-    CGFloat red, green, blue, alpha;
-    [color getRed:&red green:&green blue:&blue alpha:&alpha];
-    self.opacitySliderView.opacitySlider.value = alpha;
-    self.opacitySliderView.startLabel.text = [NSString stringWithFormat:@"%d%%", (int)((self.opacitySliderView.opacitySlider.value/1)*100)];
-    [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
-}
-
-#pragma mark - UIColorPickerViewControllerDelegate
-
-- (void)colorPickerViewControllerDidFinish:(UIColorPickerViewController *)viewController API_AVAILABLE(ios(14.0)) {
-    if (viewController == self.picker) {
-        self.sampleView.color = viewController.selectedColor;
-        self.annotStyle.color = self.sampleView.color;
-        if (self.lineDelegate && [self.lineDelegate respondsToSelector:@selector(arrowViewController:annotStyle:)]) {
-            [self.lineDelegate arrowViewController:self annotStyle:self.annotStyle];
-        }
-        [self.sampleView setNeedsDisplay];
-    }
-    CGFloat red, green, blue, alpha;
-    [viewController.selectedColor getRed:&red green:&green blue:&blue alpha:&alpha];
-    self.opacitySliderView.opacitySlider.value = alpha;
-    self.opacitySliderView.startLabel.text = [NSString stringWithFormat:@"%d%%", (int)((self.opacitySliderView.opacitySlider.value/1)*100)];
-}
-
-@end

+ 0 - 34
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFShape/CPDFShapeCircleViewController.h

@@ -1,34 +0,0 @@
-//
-//  CPDFShapeCircleViewController.h
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <ComPDFKit_Tools/ComPDFKit_Tools.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@class CPDFShapeCircleViewController;
-@class CAnnotStyle;
-
-@protocol CPDFShapeCircleViewControllerDelegate <NSObject>
-
-@optional
-
-- (void)circleViewController:(CPDFShapeCircleViewController *)circleViewController annotStyle:(CAnnotStyle *)annotStyle;
-
-@end
-
-@interface CPDFShapeCircleViewController : CPDFAnnotationBaseViewController
-
-@property (nonatomic, weak) id<CPDFShapeCircleViewControllerDelegate> delegate;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 334
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFShape/CPDFShapeCircleViewController.m

@@ -1,334 +0,0 @@
-//
-//  CPDFShapeCircleViewController.m
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import "CPDFShapeCircleViewController.h"
-#import "CPDFShareCircleViewController_Header.h"
-
-@interface CPDFShapeCircleViewController () <UIColorPickerViewControllerDelegate, CPDFThicknessSliderViewDelegate, CPDFColorSelectViewDelegate, CPDFColorPickerViewDelegate>
-
-@property (nonatomic, strong) NSMutableArray *dashPattern;
-
-@property (nonatomic, strong) UIColorPickerViewController *picker API_AVAILABLE(ios(14.0));
-
-@property (nonatomic, strong) UIColorPickerViewController *fillPicker API_AVAILABLE(ios(14.0));
-
-@end
-
-@implementation CPDFShapeCircleViewController
-
-#pragma mark - Initializers
-
-- (instancetype)initWithStyle:(CAnnotStyle *)annotStyle selectIndex:(NSInteger)index title:(NSString *)title {
-    if (self = [super init]) {
-        self.annotStyle = annotStyle;
-        self.index = index;
-        self.titles = title;
-    }
-    return self;
-}
-
-#pragma mark - ViewController Methods
-
-- (void)viewDidLoad {
-    [super viewDidLoad];
-    // Do any additional setup after loading the view.
-    _thicknessView = [[CPDFThicknessSliderView alloc] init];
-    _thicknessView.delegate = self;
-    _thicknessView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
-    [self.scrcollView addSubview:self.thicknessView];
-    
-    self.dottedView = [[CPDFThicknessSliderView alloc] init];
-    self.dottedView.delegate = self;
-    self.dottedView.thicknessSlider.minimumValue = 0.0;
-    self.dottedView.thicknessSlider.maximumValue = 10.0;
-    self.dottedView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
-    [self.scrcollView addSubview:self.dottedView];
-    
-    self.fillColorSelectView = [[CPDFColorSelectView alloc] init];
-    self.fillColorSelectView.delegate = self;
-    self.fillColorSelectView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
-    [self.scrcollView addSubview:self.fillColorSelectView];
-}
-
-- (void)viewWillLayoutSubviews {
-    [super viewWillLayoutSubviews];
-    self.scrcollView.frame = CGRectMake(0, 170, self.view.frame.size.width, self.view.frame.size.height-170);
-    self.scrcollView.contentSize = CGSizeMake(self.view.frame.size.width, 550);
-    
-    if (@available(iOS 11.0, *)) {
-        self.colorView.frame = CGRectMake(self.view.safeAreaInsets.left, 0,self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 90);
-        self.fillColorSelectView.frame = CGRectMake(self.view.safeAreaInsets.left, 90, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 90);
-        self.opacitySliderView.frame = CGRectMake(self.view.safeAreaInsets.left, 180, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 90);
-        self.thicknessView.frame = CGRectMake(self.view.safeAreaInsets.left, 270, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 90);
-        self.dottedView.frame = CGRectMake(self.view.safeAreaInsets.left, 360, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 90);
-        self.backBtn.frame = CGRectMake(self.view.frame.size.width - 60 - self.view.safeAreaInsets.right, 5, 50, 50);
-    } else {
-        self.colorView.frame = CGRectMake(0, 0, self.view.frame.size.width, 90);
-        self.opacitySliderView.frame = CGRectMake(0, 180, self.view.frame.size.width, 90);
-        self.fillColorSelectView.frame = CGRectMake(0, 90, self.view.frame.size.width, 90);
-        self.thicknessView.frame = CGRectMake(0, 270, self.view.frame.size.width, 90);
-        self.dottedView.frame = CGRectMake(0, 360, self.view.frame.size.width, 90);
-        self.backBtn.frame = CGRectMake(self.view.frame.size.width - 60, 5, 50, 50);
-    }
-    
-}
-
-#pragma mark - Protect Mehthods
-
-- (void)commomInitFromAnnotStyle {
-    self.opacitySliderView.opacitySlider.value = self.annotStyle.opacity;
-    self.opacitySliderView.startLabel.text = [NSString stringWithFormat:@"%d%%", (int)((self.opacitySliderView.opacitySlider.value/1)*100)];
-    self.thicknessView.thicknessSlider.value = self.annotStyle.lineWidth;
-    self.thicknessView.startLabel.text = [NSString stringWithFormat:@"%d pt", (int)self.thicknessView.thicknessSlider.value];
-    self.dashPattern = (NSMutableArray *)self.annotStyle.dashPattern;
-    self.dottedView.thicknessSlider.value = [self.dashPattern.firstObject floatValue];
-    self.dottedView.startLabel.text = [NSString stringWithFormat:@"%d pt", (int)self.dottedView.thicknessSlider.value];
-    
-    self.sampleView.color = self.annotStyle.color;
-    self.sampleView.opcity = self.annotStyle.opacity;
-    self.sampleView.thickness = self.annotStyle.lineWidth;
-    self.sampleView.dotted = self.dottedView.thicknessSlider.value;
-    self.sampleView.interiorColor = self.annotStyle.interiorColor?:[UIColor clearColor];
-    [self.sampleView setNeedsDisplay];
-}
-
-- (void)commomInitTitle {
-    self.sampleView.color = self.annotStyle.color;
-    self.sampleView.interiorColor = [UIColor whiteColor];
-    self.sampleView.thickness = 4.0;
-    self.sampleView.selecIndex = (NSInteger)self.annotStyle.annotMode;
-    switch (self.annotStyle.annotMode) {
-        case CPDFViewAnnotationModeCircle:
-        {
-            self.titleLabel.text = NSLocalizedString(@"Circle", nil);
-        }
-            break;
-        case CPDFViewAnnotationModeSquare:
-        {
-            self.titleLabel.text = NSLocalizedString(@"Square", nil);
-        }
-            break;
-        case CPDFViewAnnotationModeArrow:
-        {
-            self.titleLabel.text = NSLocalizedString(@"Arrow", nil);
-        }
-            break;
-        case CPDFViewAnnotationModeLine:
-        {
-            self.titleLabel.text = NSLocalizedString(@"Line", nil);
-        }
-            break;
-            
-        default:
-            break;
-    }
-    
-    self.fillColorSelectView.colorLabel.text = NSLocalizedString(@"Fill Color", nil);
-    self.thicknessView.titleLabel.text = NSLocalizedString(@"Line Width", nil);
-    self.colorView.colorLabel.text = NSLocalizedString(@"Line Color", nil);
-    self.dottedView.titleLabel.text = NSLocalizedString(@"Line and Border Style", nil);
-    self.colorView.selectedColor = self.annotStyle.color;
-    self.fillColorSelectView.selectedColor = self.annotStyle.interiorColor;
-}
-
-- (void)updatePreferredContentSizeWithTraitCollection:(UITraitCollection *)traitCollection {
-    if ([self.colorPicker superview] || [self.fillColorPicker superview]) {
-        UIDevice *currentDevice = [UIDevice currentDevice];
-        if (currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad) {
-            // This is an iPad
-            self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, 520);
-        } else {
-            // This is an iPhone or iPod touch
-            self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, 320);
-        }
-       
-    } else {
-        self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact ? 350 : 660);
-    }
-}
-
-- (void)updateBordColor:(UIColor *)color {
-    if(color) {
-        CGFloat red, green, blue, alpha;
-        [color getRed:&red green:&green blue:&blue alpha:&alpha];
-        
-        self.sampleView.color = [UIColor colorWithRed:red green:green blue:blue alpha:1.0];
-        self.sampleView.opcity = alpha;
-
-        self.annotStyle.color = self.sampleView.color;
-        self.annotStyle.opacity = self.sampleView.opcity;
-        self.annotStyle.interiorOpacity = self.sampleView.opcity;
-    } else {
-        self.sampleView.color = color;
-        self.sampleView.opcity = 0;
-
-        self.annotStyle.color = color;
-    }
-    [self.sampleView setNeedsDisplay];
-    
-    if (self.delegate && [self.delegate respondsToSelector:@selector(circleViewController:annotStyle:)]) {
-        [self.delegate circleViewController:self annotStyle:self.annotStyle];
-    }
-    self.opacitySliderView.opacitySlider.value = self.annotStyle.opacity;
-    self.opacitySliderView.startLabel.text = [NSString stringWithFormat:@"%d%%", (int)((self.opacitySliderView.opacitySlider.value/1)*100)];;
-}
-
-- (void)updateFillColor:(UIColor *)color {
-    if(color) {
-        CGFloat red, green, blue, alpha;
-        [color getRed:&red green:&green blue:&blue alpha:&alpha];
-        
-        self.sampleView.interiorColor = [UIColor colorWithRed:red green:green blue:blue alpha:1.0];
-        self.sampleView.opcity = alpha;
-
-        self.annotStyle.interiorColor = self.sampleView.interiorColor;
-        self.annotStyle.opacity = self.sampleView.opcity;
-        self.annotStyle.interiorOpacity = self.sampleView.opcity;
-    } else {
-        self.sampleView.interiorColor = color;
-        self.sampleView.opcity = 0;
-
-        self.annotStyle.color = color;
-    }
-    [self.sampleView setNeedsDisplay];
-    if (self.delegate && [self.delegate respondsToSelector:@selector(circleViewController:annotStyle:)]) {
-        [self.delegate circleViewController:self annotStyle:self.annotStyle];
-    }
-    self.opacitySliderView.opacitySlider.value = self.annotStyle.opacity;
-    self.opacitySliderView.startLabel.text = [NSString stringWithFormat:@"%d%%", (int)((self.opacitySliderView.opacitySlider.value/1)*100)];;
-
-}
-
-#pragma mark - CPDFOpacitySliderViewDelegate
-
-- (void)opacitySliderView:(CPDFOpacitySliderView *)opacitySliderView opacity:(CGFloat)opacity {
-    self.sampleView.opcity = opacity;
-
-    self.annotStyle.opacity = opacity;
-    self.annotStyle.interiorOpacity = opacity;
-
-    if (self.delegate && [self.delegate respondsToSelector:@selector(circleViewController:annotStyle:)]) {
-        [self.delegate circleViewController:self annotStyle:self.annotStyle];
-    }
-    [self.sampleView setNeedsDisplay];
-}
-
-#pragma mark - CPDFThicknessSliderViewDelegate
-
-- (void)thicknessSliderView:(CPDFThicknessSliderView *)thicknessSliderView thickness:(CGFloat)thickness {
-    if (thicknessSliderView == self.thicknessView) {
-        self.sampleView.thickness = thickness;
-        self.annotStyle.lineWidth = thickness;
-        [self.sampleView setNeedsDisplay];
-        if (self.delegate && [self.delegate respondsToSelector:@selector(circleViewController:annotStyle:)]) {
-            [self.delegate circleViewController:self annotStyle:self.annotStyle];
-        }
-    } else if (thicknessSliderView == self.dottedView) {
-        self.sampleView.dotted = thickness;
-        self.annotStyle.style = CPDFBorderStyleDashed;
-        self.annotStyle.dashPattern = @[[NSNumber numberWithFloat:(float)thickness]];
-        if (self.delegate && [self.delegate respondsToSelector:@selector(circleViewController:annotStyle:)]) {
-            [self.delegate circleViewController:self annotStyle:self.annotStyle];
-        }
-        [self.sampleView setNeedsDisplay];
-    }
-}
-
-#pragma mark - CPDFColorSelectViewDelegate
-
-- (void)selectColorView:(CPDFColorSelectView *)select {
-    if (select == self.colorView) {
-        if (@available(iOS 14.0, *)) {
-            self.picker = [[UIColorPickerViewController alloc] init];
-            self.picker.delegate = self;
-            [self presentViewController:self.picker animated:YES completion:nil];
-        } else {
-            UIDevice *currentDevice = [UIDevice currentDevice];
-            if (currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad) {
-                // This is an iPad
-                self.colorPicker = [[CPDFColorPickerView alloc] initWithFrame:CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y, self.view.frame.size.width, 520)];
-            } else {
-                // This is an iPhone or iPod touch
-                self.colorPicker = [[CPDFColorPickerView alloc] initWithFrame:CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y, self.view.frame.size.width, 320)];
-            }
-            self.colorPicker.delegate = self;
-            self.colorPicker.backgroundColor = [UIColor whiteColor];
-            [self.view addSubview:self.colorPicker];
-            
-            [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
-        }
-    } else if (select == self.fillColorSelectView) {
-        if (@available(iOS 14.0, *)) {
-            self.fillPicker = [[UIColorPickerViewController alloc] init];
-            self.fillPicker.delegate = self;
-            [self presentViewController:self.fillPicker animated:YES completion:nil];
-        } else {
-            UIDevice *currentDevice = [UIDevice currentDevice];
-            if (currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad) {
-                // This is an iPad
-                self.fillColorPicker = [[CPDFColorPickerView alloc] initWithFrame:CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y, self.view.frame.size.width, 520)];
-            } else {
-                // This is an iPhone or iPod touch
-                self.fillColorPicker = [[CPDFColorPickerView alloc] initWithFrame:CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y, self.view.frame.size.width, 320)];
-            }
-            self.fillColorPicker.delegate = self;
-            self.fillColorPicker.backgroundColor = [UIColor whiteColor];
-            [self.view addSubview:self.fillColorPicker];
-            
-            [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
-        }
-    }
-}
-
-- (void)selectColorView:(CPDFColorSelectView *)select color:(UIColor *)color {
-    if (select == self.colorView) {
-        [self updateBordColor:color];
-    } else if (select == self.fillColorSelectView) {
-        [self updateFillColor:color];
-    }
-}
-
-#pragma mark - CPDFColorPickerViewDelegate
-
-- (void)pickerView:(CPDFColorPickerView *)colorPickerView color:(UIColor *)color {
-    if (colorPickerView == self.colorPicker) {
-        [self updateBordColor:color];
-    } else if (colorPickerView == self.fillColorPicker) {
-        [self updateFillColor:color];
-    }
-    
-    CGFloat red, green, blue, alpha;
-    [color getRed:&red green:&green blue:&blue alpha:&alpha];
-    self.opacitySliderView.opacitySlider.value = alpha;
-    self.opacitySliderView.startLabel.text = [NSString stringWithFormat:@"%d%%", (int)((self.opacitySliderView.opacitySlider.value/1)*100)];
-    
-    [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
-}
-
-#pragma mark - UIColorPickerViewControllerDelegate
-
-- (void)colorPickerViewControllerDidFinish:(UIColorPickerViewController *)viewController API_AVAILABLE(ios(14.0)) {
-    UIColor *color = viewController.selectedColor;
-
-    if (viewController == self.picker) {
-        [self updateBordColor:color];
-    } else if (viewController == self.fillPicker) {
-        [self updateFillColor:color];
-    }
-    
-    CGFloat red, green, blue, alpha;
-    [viewController.selectedColor getRed:&red green:&green blue:&blue alpha:&alpha];
-    self.opacitySliderView.opacitySlider.value = alpha;
-    self.opacitySliderView.startLabel.text = [NSString stringWithFormat:@"%d%%", (int)((self.opacitySliderView.opacitySlider.value/1)*100)];
-}
-
-@end

+ 0 - 35
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFShape/CPDFShareCircleViewController_Header.h

@@ -1,35 +0,0 @@
-//
-//  CPDFShareCircleViewController_Header.h
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#ifndef CPDFShareCircleViewController_Header_h
-#define CPDFShareCircleViewController_Header_h
-
-#import "CPDFAnnotationBaseViewController_Header.h"
-#import "CPDFThicknessSliderView.h"
-
-@interface CPDFShapeCircleViewController ()
-
-@property (nonatomic, strong) CPDFColorSelectView *fillColorSelectView;
-
-@property (nonatomic, strong) CPDFThicknessSliderView *thicknessView;
-
-@property (nonatomic, strong) CPDFThicknessSliderView *dottedView;
-
-@property (nonatomic, strong) CPDFColorPickerView *fillColorPicker;
-
-@property (nonatomic, assign) NSInteger index;
-
-@property (nonatomic, strong) NSString *titles;
-
-@end
-
-#endif /* CPDFShareCircleViewController_Header_h */

+ 0 - 40
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFShape/CShapeSelectView.h

@@ -1,40 +0,0 @@
-//
-//  CShapeSelectView.h
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <UIKit/UIKit.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-typedef NS_ENUM(NSInteger, CShapeSelectType) {
-    CShapeSelectTypeSquare = 0,
-    CShapeSelectTypeCircle,
-    CShapeSelectTypeArrow,
-    CShapeSelectTypeLine
-};
-
-@class CShapeSelectView;
-
-@protocol CShapeSelectViewDelegate <NSObject>
-
-@optional
-
-- (void)shapeSelectView:(CShapeSelectView *)shapeSelectView tag:(NSInteger)tag;
-
-@end
-
-@interface CShapeSelectView : UIView
-
-@property (nonatomic, weak) id<CShapeSelectViewDelegate> delegate;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 83
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFShape/CShapeSelectView.m

@@ -1,83 +0,0 @@
-//
-//  CShapeSelectView.m
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import "CShapeSelectView.h"
-
-#import <ComPDFKit_Tools/CPDFColorUtils.h>
-
-@interface CShapeSelectView ()
-
-@property (nonatomic, strong) NSMutableArray *buttonArray;
-
-@end
-
-@implementation CShapeSelectView
-
-#pragma mark - Initializers
-
-- (instancetype)initWithFrame:(CGRect)frame {
-    if (self = [super initWithFrame:frame]) {
-        self.buttonArray = [NSMutableArray array];
-        
-        UIButton *squareButton = [[UIButton alloc] init];
-        [squareButton setImage:[UIImage imageNamed:@"CPDFShapeArrowImageSquare" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-        [squareButton addTarget:self action:@selector(buttonItemClicked_select:) forControlEvents:UIControlEventTouchUpInside];
-        squareButton.tag = CShapeSelectTypeSquare;
-        [self addSubview:squareButton];
-        [self.buttonArray addObject:squareButton];
-        
-        UIButton *circleButton = [[UIButton alloc] init];
-        [circleButton setImage:[UIImage imageNamed:@"CPDFShapeArrowImageCircle" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-        [circleButton addTarget:self action:@selector(buttonItemClicked_select:) forControlEvents:UIControlEventTouchUpInside];
-        circleButton.tag = CShapeSelectTypeCircle;
-        [self addSubview:circleButton];
-        [self.buttonArray addObject:circleButton];
-        
-        UIButton *arrowButton = [[UIButton alloc] init];
-        [arrowButton setImage:[UIImage imageNamed:@"CPDFShapeArrowImageArrow" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-        [arrowButton addTarget:self action:@selector(buttonItemClicked_select:) forControlEvents:UIControlEventTouchUpInside];
-        arrowButton.tag = CShapeSelectTypeArrow;
-        [self addSubview:arrowButton];
-        [self.buttonArray addObject:arrowButton];
-        
-        UIButton *lineButton = [[UIButton alloc] init];
-        [lineButton setImage:[UIImage imageNamed:@"CPDFShapeArrowImageLine" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-        [lineButton addTarget:self action:@selector(buttonItemClicked_select:) forControlEvents:UIControlEventTouchUpInside];
-        lineButton.tag = CShapeSelectTypeLine;
-        [self addSubview:lineButton];
-        [self.buttonArray addObject:lineButton];
-    }
-    return self;
-}
-
-- (void)layoutSubviews {
-    [super layoutSubviews];
-    for (int i = 0; i < self.buttonArray.count; i++) {
-        ((UIButton *)self.buttonArray[i]).frame = CGRectMake((self.bounds.size.width - (self.bounds.size.height*4))/5*(i+1) + self.bounds.size.height*i, 0, self.bounds.size.height, self.bounds.size.height);
-        
-    }
-}
-
-#pragma mark - Action
-
-- (void)buttonItemClicked_select:(UIButton *)button {
-    for (int j = 0; j < self.buttonArray.count; j++) {
-        ((UIButton *)self.buttonArray[j]).backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
-    }
-    ((UIButton *)self.buttonArray[button.tag]).backgroundColor = [CPDFColorUtils CAnnotationBarSelectBackgroundColor];
-    
-    if (self.delegate && [self.delegate respondsToSelector:@selector(shapeSelectView:tag:)]) {
-        [self.delegate shapeSelectView:self tag:button.tag];
-    }
-}
-
-@end

+ 0 - 25
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFShape/Line/CPDFArrowStyleCell.h

@@ -1,25 +0,0 @@
-//
-//  CPDFArrowStyleCell.h
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <UIKit/UIKit.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@class CPDFDrawArrowView;
-
-@interface CPDFArrowStyleCell : UICollectionViewCell
-
-@property (nonatomic, strong) CPDFDrawArrowView *contextView;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 31
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFShape/Line/CPDFArrowStyleCell.m

@@ -1,31 +0,0 @@
-//
-//  CPDFArrowStyleCell.m
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import "CPDFArrowStyleCell.h"
-#import "CPDFDrawArrowView.h"
-#import "CPDFColorUtils.h"
-
-@implementation CPDFArrowStyleCell
-
-#pragma mark - Initializers
-
-- (instancetype)initWithFrame:(CGRect)frame {
-    if (self = [super initWithFrame:frame]) {
-        self.contextView = [[CPDFDrawArrowView alloc] initWithFrame:CGRectMake(1, 1, self.bounds.size.width - 2, self.bounds.size.height - 2)];
-        self.contextView.backgroundColor = [CPDFColorUtils CAnnotationBarNoSelectBackgroundColor];
-        self.contentView.backgroundColor = [CPDFColorUtils CAnnotationBarNoSelectBackgroundColor];
-        [self addSubview:self.contextView];
-    }
-    return self;
-}
-
-@end

+ 0 - 39
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFShape/Line/CPDFArrowStyleView.h

@@ -1,39 +0,0 @@
-//
-//  CPDFArrowStyleView.h
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <UIKit/UIKit.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@class CPDFArrowStyleView;
-
-@protocol CPDFArrowStyleViewDelegate <NSObject>
-
-@optional
-
-- (void)arrowStyleView:(CPDFArrowStyleView *)arrowStyleView selectIndex:(NSInteger)selectIndex;
-
-- (void)arrowStyleRemoveView:(CPDFArrowStyleView *)arrowStyleView;
-
-@end
-
-@interface CPDFArrowStyleView : UIView
-
-@property (nonatomic, weak) id<CPDFArrowStyleViewDelegate> delegate;
-
-@property (nonatomic, assign) NSInteger selectIndex;
-
-- (instancetype)initWirhTitle:(NSString *)title;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 122
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFShape/Line/CPDFArrowStyleView.m

@@ -1,122 +0,0 @@
-//
-//  CPDFArrowStyleView.m
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import "CPDFArrowStyleView.h"
-#import "CPDFArrowStyleCell.h"
-#import "CPDFDrawArrowView.h"
-
-#import <ComPDFKit_Tools/CPDFColorUtils.h>
-
-@interface CPDFArrowStyleView () <UICollectionViewDelegate,UICollectionViewDataSource>
-
-@property (nonatomic, strong) UIButton *backBtn;
-
-@property (nonatomic, strong) UILabel *titleLabel;
-
-@property (nonatomic, strong) UICollectionView *collectView;
-
-@property (nonatomic, strong) UIView *headerView;
-
-@end
-
-@implementation CPDFArrowStyleView
-
-#pragma mark - Initializers
-
-- (instancetype)initWirhTitle:(NSString *)title {
-    if (self = [super init]) {
-        self.headerView = [[UIView alloc] init];
-        self.headerView.layer.borderColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.1].CGColor;
-        self.headerView.layer.borderWidth = 1.0;
-        self.headerView.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
-        [self addSubview:self.headerView];
-        
-        self.backBtn = [[UIButton alloc] init];
-        [self.backBtn setImage:[UIImage imageNamed:@"CPDFAnnotationBarImageUndo" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-        [self.backBtn addTarget:self action:@selector(buttonItemClicked_back:) forControlEvents:UIControlEventTouchUpInside];
-        [self.headerView addSubview:self.backBtn];
-        
-        self.titleLabel = [[UILabel alloc] init];
-        self.titleLabel.text = title;
-        self.titleLabel.textAlignment = NSTextAlignmentCenter;
-        [self.headerView addSubview:self.titleLabel];
-        
-        UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
-        layout.itemSize = CGSizeMake((self.frame.size.width - 5.0* 7)/6, 30);
-        layout.sectionInset = UIEdgeInsetsMake(5, 5, 5, 5);
-        layout.minimumInteritemSpacing = 5;
-        layout.minimumLineSpacing = 5;
-        self.collectView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 50, self.frame.size.width, self.frame.size.height) collectionViewLayout:layout];
-        [self.collectView registerClass:[CPDFArrowStyleCell class] forCellWithReuseIdentifier:@"cell"];
-        self.collectView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-        self.collectView.delegate = self;
-        self.collectView.dataSource = self;
-        self.collectView.backgroundColor = [CPDFColorUtils CAnnotationSampleBackgoundColor];
-        [self addSubview:self.collectView];
-        
-        self.backgroundColor = [CPDFColorUtils CAnnotationSampleBackgoundColor];
-    }
-    return self;
-}
-
-- (void)layoutSubviews {
-    [super layoutSubviews];
-    self.backBtn.frame = CGRectMake(15, 5, 60, 50);
-    self.titleLabel.frame = CGRectMake((self.frame.size.width - 150)/2, 5, 150, 50);
-    self.headerView.frame = CGRectMake(0, 0, self.bounds.size.width, 50);
-}
-
-#pragma mark - Action
-
-- (void)buttonItemClicked_back:(id)sender {
-    [self removeFromSuperview];
-    if (self.delegate && [self.delegate respondsToSelector:@selector(arrowStyleRemoveView:)]) {
-        [self.delegate arrowStyleRemoveView:self];
-    }
-}
-
-#pragma mark - UICollectionViewDataSource
-
-- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
-    return CGSizeMake((self.frame.size.width - 5.0* 7)/6, 30);
-}
-
-- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
-    return 6;
-}
-
-- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
-    CPDFArrowStyleCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath];
-    if (self.selectIndex == indexPath.item) {
-        cell.contextView.backgroundColor = [CPDFColorUtils CAnnotationBarSelectBackgroundColor];
-    }
-    cell.contextView.selectIndex = indexPath.item;
-    [cell.contentView setNeedsDisplay];
-    cell.backgroundColor = [UIColor clearColor];
-    return cell;
-}
-
-#pragma mark - UICollectionViewDelegate
-
-- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
-    NSArray<UICollectionViewCell *> *cells = [collectionView visibleCells];
-    for (UICollectionViewCell *cell in cells) {
-        ((CPDFArrowStyleCell *)cell).contextView.backgroundColor = [CPDFColorUtils CAnnotationBarNoSelectBackgroundColor];
-    }
-    CPDFArrowStyleCell *cell = (CPDFArrowStyleCell *)[collectionView cellForItemAtIndexPath:indexPath];
-    cell.contextView.backgroundColor = [CPDFColorUtils CAnnotationBarSelectBackgroundColor];
-    if (self.delegate && [self.delegate respondsToSelector:@selector(arrowStyleView:selectIndex:)]) {
-        [self.delegate arrowStyleView:self selectIndex:indexPath.item];
-    }
-}
-
-@end

+ 0 - 34
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFShape/Line/CPDFDrawArrowView.h

@@ -1,34 +0,0 @@
-//
-//  CPDFDrawArrowView.h
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <UIKit/UIKit.h>
-
-typedef NS_ENUM(NSInteger, CPDFDrawSelectedIndex) {
-    CPDFDrawNone = 0,
-    CPDFDrawArrow,
-    CPDFDrawTriangle,
-    CPDFDrawSquare,
-    CPDFDrawCircle,
-    CPDFDrawDiamond
-};
-
-NS_ASSUME_NONNULL_BEGIN
-
-@interface CPDFDrawArrowView : UIView
-
-@property (nonatomic, assign) NSInteger selectIndex;
-
-- (UIImage *)shotShareImage;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 118
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFShape/Line/CPDFDrawArrowView.m

@@ -1,118 +0,0 @@
-//
-//  CPDFDrawArrowView.m
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import "CPDFDrawArrowView.h"
-
-@interface CPDFDrawArrowView ()
-
-@end
-
-@implementation CPDFDrawArrowView
-
-- (void)drawRect:(CGRect)rect {
-    [super drawRect:rect];
-    CGContextRef context = UIGraphicsGetCurrentContext();
-    CGPoint start = CGPointMake(CGRectGetMinX(rect)+10, CGRectGetMidY(rect));
-    CGPoint end = CGPointMake(CGRectGetMaxX(rect)-10, CGRectGetMidY(rect));
-    [self drawArrow:context startPoint:start endPoint:end];
-}
-
-#pragma mark - Private Methods
-
-- (void)drawArrow:(CGContextRef)context startPoint:(CGPoint)start endPoint:(CGPoint)end {
-    CGContextSetStrokeColorWithColor(context, [UIColor colorWithRed:151.0/255.0 green:151.0/255.0 blue:151.0/255.0 alpha:1.0].CGColor);
-    CGContextSetLineWidth(context, 2);
-    switch (self.selectIndex) {
-        case CPDFDrawNone:
-        {
-            CGContextMoveToPoint(context, start.x, start.y);
-            CGContextAddLineToPoint(context, end.x, end.y);
-            CGContextStrokePath(context);
-        }
-            break;
-        case CPDFDrawArrow:
-        {
-            CGContextMoveToPoint(context, start.x, start.y);
-            CGContextAddLineToPoint(context, end.x, end.y);
-            
-            CGContextMoveToPoint(context, end.x-5, end.y-5);
-            CGContextAddLineToPoint(context, end.x, end.y);
-            CGContextAddLineToPoint(context, end.x-5, end.y+5);
-            CGContextStrokePath(context);
-        }
-            break;
-        case CPDFDrawTriangle:
-        {
-            CGContextMoveToPoint(context, start.x-5, start.y);
-            CGContextAddLineToPoint(context, end.x-5, end.y);
-            CGContextStrokePath(context);
-            
-            CGContextMoveToPoint(context, end.x-5, end.y-5);
-            CGContextAddLineToPoint(context, end.x, end.y);
-            CGContextAddLineToPoint(context, end.x-5, end.y+5);
-            CGContextClosePath(context);
-            CGContextStrokePath(context);
-        }
-            break;
-        case CPDFDrawSquare:
-        {
-            CGContextMoveToPoint(context, start.x, start.y);
-            CGContextAddLineToPoint(context, end.x-10, end.y);
-            CGContextStrokePath(context);
-            
-            CGContextMoveToPoint(context, end.x-10, end.y-5);
-            CGContextAddLineToPoint(context, end.x-10, end.y+5);
-            CGContextAddLineToPoint(context, end.x, end.y+5);
-            CGContextAddLineToPoint(context, end.x, end.y-5);
-            CGContextClosePath(context);
-            CGContextStrokePath(context);
-        }
-            break;
-        case CPDFDrawCircle:
-        {
-            CGContextMoveToPoint(context, start.x, start.y);
-            CGContextAddLineToPoint(context, end.x-10, end.y);
-            CGContextStrokePath(context);
-            
-            CGContextAddArc(context, end.x-7, end.y, 5, 0, 2*M_PI, 0);
-            CGContextDrawPath(context, kCGPathStroke);
-        }
-            break;
-        case CPDFDrawDiamond:
-        {
-            CGContextMoveToPoint(context, start.x, start.y);
-            CGContextAddLineToPoint(context, end.x-10, end.y);
-            CGContextStrokePath(context);
-            
-            CGContextMoveToPoint(context, end.x-10, end.y);
-            CGContextAddLineToPoint(context, end.x-5, end.y+5);
-            CGContextAddLineToPoint(context, end.x, end.y);
-            CGContextAddLineToPoint(context, end.x-5, end.y-5);
-            CGContextClosePath(context);
-            CGContextStrokePath(context);
-        }
-            break;
-        default:
-            break;
-    }
-}
-
-- (UIImage *)shotShareImage {
-    UIGraphicsBeginImageContext(CGSizeMake(self.layer.bounds.size.width, self.layer.bounds.size.height));
-    CGContextRef context = UIGraphicsGetCurrentContext();
-    [self.layer renderInContext:context];
-    UIImage* tImage = UIGraphicsGetImageFromCurrentImageContext();
-    UIGraphicsEndImageContext();
-    return tImage;
-}
-
-@end

+ 0 - 39
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFSignature/CPDFSignatureEditViewController.h

@@ -1,39 +0,0 @@
-//
-//  CPDFSignatureEditViewController.h
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <UIKit/UIKit.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-typedef NS_ENUM(NSInteger, CSignatureTopBarSelectedIndex) {
-    CSignatureTopBarDefault = 0,
-    CSignatureTopBarText,
-    CSignatureTopBarImage
-};
-
-@class CPDFSignatureEditViewController;
-
-@protocol CPDFSignatureEditViewControllerDelegate <NSObject>
-
-@optional
-
-- (void)signatureEditViewController:(CPDFSignatureEditViewController *)signatureEditViewController image:(UIImage *)image;
-
-@end
-
-@interface CPDFSignatureEditViewController : UIViewController
-
-@property (nonatomic, weak) id<CPDFSignatureEditViewControllerDelegate> delegate;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 658
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFSignature/CPDFSignatureEditViewController.m

@@ -1,658 +0,0 @@
-//
-//  CPDFSignatureEditViewController.m
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import "CPDFSignatureEditViewController.h"
-#import "CPDFColorSelectView.h"
-#import "CPDFColorPickerView.h"
-#import "CSignatureTopBar.h"
-#import "CSignatureDrawView.h"
-
-#import <ComPDFKit_Tools/CPDFColorUtils.h>
-
-@interface CPDFSignatureEditViewController () <UIPopoverPresentationControllerDelegate, UINavigationControllerDelegate, UIImagePickerControllerDelegate, UIColorPickerViewControllerDelegate, UITextFieldDelegate,UIGestureRecognizerDelegate, CPDFColorSelectViewDelegate, CPDFColorPickerViewDelegate, CSignatureDrawViewDelegate>
-
-@property (nonatomic, strong) CPDFColorSelectView *colorSelectView;
-
-@property (nonatomic, strong) UIButton *cacelButon;
-
-@property (nonatomic, strong) UIButton *saveButton;
-
-@property (nonatomic, strong) UISegmentedControl *segmentedControl;
-
-@property (nonatomic, strong) CSignatureDrawView *signatureDrawTextView;
-
-@property (nonatomic, strong) CSignatureDrawView *signatureDrawImageView;
-
-@property (nonatomic, strong) CPDFColorPickerView *colorPicker;
-
-@property (nonatomic, strong) UITextField *textField;
-
-@property (nonatomic, strong) CALayer *bottomBorder;
-
-@property (nonatomic, strong) UIButton *createButton;
-
-@property (nonatomic, assign) CSignatureTopBarSelectedIndex selecIndex;
-
-@property (nonatomic, strong) UIView *thicknessView;
-
-@property (nonatomic, strong) UILabel *thicknessLabel;
-
-@property (nonatomic, strong) UISlider *thicknessSlider;
-
-@property (nonatomic, strong) UIButton *clearButton;
-
-@property (nonatomic, strong) UILabel *emptyLabel;
-
-@property (nonatomic, strong) UIView *headerView;
-
-@property (nonatomic, assign) BOOL isDrawSignature;
-
-@property (nonatomic, assign) BOOL isTexrSignature;
-
-@property (nonatomic, assign) BOOL isImageSignature;
-
-@end
-
-@implementation CPDFSignatureEditViewController
-
-#pragma mark - ViewController Methods
-
-- (void)viewDidLoad {
-    [super viewDidLoad];
-    // Do any additional setup after loading the view
-    
-    self.headerView = [[UIView alloc] init];
-    self.headerView.layer.borderColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.1].CGColor;
-    self.headerView.layer.borderWidth = 1.0;
-    self.headerView.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
-    [self.view addSubview:self.headerView];
-    
-    NSArray *segmmentArray = [NSArray arrayWithObjects:NSLocalizedString(@"Draw", nil), NSLocalizedString(@"Text", nil), NSLocalizedString(@"Image", nil),nil];
-    _segmentedControl = [[UISegmentedControl alloc] initWithItems:segmmentArray];
-    _segmentedControl.selectedSegmentIndex = 0;
-    _segmentedControl.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-    [_segmentedControl addTarget:self action:@selector(segmentedControlValueChanged_singature:) forControlEvents:UIControlEventValueChanged];
-    [self.view addSubview:self.segmentedControl];
-    
-    self.emptyLabel = [[UILabel alloc] init];
-    self.emptyLabel.font = [UIFont systemFontOfSize:22];
-    self.emptyLabel.textColor = [UIColor grayColor];
-    self.emptyLabel.text = NSLocalizedString(@"Enter your signature", nil);
-    self.emptyLabel.textAlignment = NSTextAlignmentCenter;
-    [self.view addSubview:self.emptyLabel];
-    
-    self.colorSelectView = [[CPDFColorSelectView alloc] init];
-    [self.colorSelectView.colorLabel removeFromSuperview];
-    self.colorSelectView.selectedColor = [UIColor blackColor];
-    self.colorSelectView.delegate = self;
-    [self.view addSubview:self.colorSelectView];
-    
-    self.thicknessView = [[UIView alloc] init];
-    self.thicknessView.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
-    [self.view addSubview:self.thicknessView];
-    
-    self.thicknessLabel = [[UILabel alloc] init];
-    self.thicknessLabel.text = NSLocalizedString(@"Thickness", nil);
-    self.thicknessLabel.textColor = [UIColor grayColor];
-    self.thicknessLabel.font = [UIFont systemFontOfSize:12.0];
-    [self.thicknessView addSubview:self.thicknessLabel];
-    
-    self.thicknessSlider = [[UISlider alloc] init];
-    self.thicknessSlider.maximumValue = 20;
-    self.thicknessSlider.minimumValue = 1;
-    self.thicknessSlider.value = 5;
-    [self.thicknessSlider addTarget:self action:@selector(buttonItemClicked_changes:) forControlEvents:UIControlEventValueChanged];
-    [self.thicknessView addSubview:self.thicknessSlider];
-    
-    self.signatureDrawTextView = [[CSignatureDrawView alloc] init];
-    self.signatureDrawTextView.delegate = self;
-    self.signatureDrawTextView.color = [UIColor blackColor];
-    self.signatureDrawTextView.autoresizingMask = UIViewAutoresizingFlexibleHeight;
-    self.signatureDrawTextView.lineWidth = self.thicknessSlider.value;
-    [self.view addSubview:self.signatureDrawTextView];
-    
-    self.signatureDrawImageView = [[CSignatureDrawView alloc] init];
-    self.signatureDrawImageView.delegate = self;
-    self.signatureDrawImageView.color = [UIColor blackColor];
-    self.signatureDrawImageView.lineWidth = 4;
-    self.signatureDrawImageView.userInteractionEnabled = NO;
-    [self.view addSubview:self.signatureDrawImageView];
-    self.signatureDrawImageView.hidden = YES;
-    
-    self.cacelButon = [[UIButton alloc] init];
-    [self.cacelButon setTitle:NSLocalizedString(@"Cancel", nil) forState:UIControlStateNormal];
-    self.cacelButon.titleLabel.adjustsFontSizeToFitWidth = YES;
-    [self.cacelButon setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
-    [self.cacelButon addTarget:self action:@selector(buttonItemClicked_Cancel:) forControlEvents:UIControlEventTouchUpInside];
-    [self.headerView addSubview:self.cacelButon];
-    
-    self.saveButton = [[UIButton alloc] init];
-    [self.saveButton setTitle:NSLocalizedString(@"Save", nil) forState:UIControlStateNormal];
-    [self.saveButton setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
-    self.saveButton.enabled = NO;
-    [self.saveButton addTarget:self action:@selector(buttonItemClicked_Save:) forControlEvents:UIControlEventTouchUpInside];
-    [self.headerView addSubview:self.saveButton];
-    
-    self.bottomBorder = [CALayer layer];
-    self.bottomBorder.backgroundColor = [UIColor blackColor].CGColor;
-    self.textField = [[UITextField alloc] init];
-    self.textField.delegate = self;
-    self.textField.textColor = [UIColor blackColor];
-    self.textField.placeholder = NSLocalizedString(@"Enter your signature", nil);
-    self.textField.textAlignment = NSTextAlignmentCenter;
-    self.textField.font = [UIFont systemFontOfSize:30];
-    [self.textField addTarget:self action:@selector(textTextField_change:) forControlEvents:UIControlEventEditingChanged];
-    [self.view addSubview:self.textField];
-    [self.textField.layer addSublayer:self.bottomBorder];
-    self.textField.hidden = YES;
-    
-    self.createButton = [[UIButton alloc] init];
-    self.createButton.layer.cornerRadius = 25.0;
-    self.createButton.clipsToBounds = YES;
-    [self.createButton setImage:[UIImage imageNamed:@"CPDFSignatureImageAdd" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-    self.createButton.backgroundColor = [UIColor blueColor];
-    [self.createButton addTarget:self action:@selector(buttonItemClicked_create:) forControlEvents:UIControlEventTouchUpInside];
-    [self.view addSubview:self.createButton];
-    self.createButton.hidden = YES;
-    
-    self.clearButton = [[UIButton alloc] init];
-    [self.clearButton setImage:[UIImage imageNamed:@"CPDFSignatureImageClean" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-    self.clearButton.titleLabel.adjustsFontSizeToFitWidth = YES;
-    self.clearButton.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleBottomMargin;
-    self.clearButton.layer.borderColor = [UIColor grayColor].CGColor;
-    self.clearButton.layer.borderWidth = 1.0;
-    self.clearButton.layer.cornerRadius = 25.0;
-    self.clearButton.layer.masksToBounds = YES;
-    [self.clearButton setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
-    [self.clearButton addTarget:self action:@selector(buttonItemClicked_clear:) forControlEvents:UIControlEventTouchUpInside];
-    [self.view addSubview:self.clearButton];
-    
-    self.selecIndex = CSignatureTopBarDefault;
-    self.view.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
-    [self createGestureRecognizer];
-    [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
-    
-    self.isImageSignature = NO;
-    self.isDrawSignature = NO;
-    self.isImageSignature = NO;
-}
-
-- (void)viewWillLayoutSubviews {
-    [super viewWillLayoutSubviews];
-    self.headerView.frame = CGRectMake(0, 0, self.view.frame.size.width, 50);
-    self.segmentedControl.frame = CGRectMake((self.view.frame.size.width - 220)/2, 10, 220, 30);
-    self.emptyLabel.frame = CGRectMake((self.view.frame.size.width - 200)/2, (self.view.frame.size.height - 50)/2, 200, 50);
-   
-    if (@available(iOS 11.0, *)) {
-        UIInterfaceOrientation currentOrientation = [UIApplication sharedApplication].statusBarOrientation;
-        if (UIInterfaceOrientationIsPortrait(currentOrientation)) {
-            self.colorSelectView.frame = CGRectMake(self.view.safeAreaInsets.left, 50, 380, 60);
-            self.colorSelectView.colorPickerView.frame = CGRectMake(0, 0, self.colorSelectView.frame.size.width, self.colorSelectView.frame.size.height);
-            self.thicknessView.frame = CGRectMake(self.view.safeAreaInsets.left, 140, self.view.frame.size.width-self.view.safeAreaInsets.left-self.view.safeAreaInsets.right, 60);
-            self.thicknessLabel.frame = CGRectMake(20, 15, 60, 30);
-            self.thicknessSlider.frame = CGRectMake(90, 0, self.thicknessView.bounds.size.width-110, 60);
-            self.signatureDrawTextView.frame = CGRectMake(self.view.safeAreaInsets.left, 210, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, self.view.frame.size.height-self.view.safeAreaInsets.top-self.view.safeAreaInsets.bottom-150);
-        } else if (UIInterfaceOrientationIsLandscape(currentOrientation)) {
-            self.colorSelectView.frame = CGRectMake(self.view.safeAreaInsets.left, 50, 380, 60);
-            self.thicknessView.frame = CGRectMake(380, 70, self.view.frame.size.width-380-self.view.safeAreaInsets.right, 60);
-            self.thicknessLabel.frame = CGRectMake(20, 15, 60, 30);
-            self.thicknessSlider.frame = CGRectMake(90, 0, self.thicknessView.bounds.size.width-110, 60);
-            self.signatureDrawTextView.frame = CGRectMake(self.view.safeAreaInsets.left, 130, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, self.view.frame.size.height-self.view.safeAreaInsets.top-self.view.safeAreaInsets.bottom-130);
-        }
-        self.saveButton.frame = CGRectMake(self.view.frame.size.width - 60 - self.view.safeAreaInsets.right, 5, 50, 40);
-        self.cacelButon.frame = CGRectMake( self.view.safeAreaInsets.left+20, 5, 50, 40);
-        self.signatureDrawImageView.frame = CGRectMake(self.view.safeAreaInsets.left, 50, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, self.view.frame.size.height-self.view.safeAreaInsets.top-self.view.safeAreaInsets.bottom-150);
-        self.createButton.frame = CGRectMake(self.view.frame.size.width - 70 - self.view.safeAreaInsets.right, self.view.frame.size.height - 100 - self.view.safeAreaInsets.bottom, 50, 50);
-        self.clearButton.frame = CGRectMake(self.view.frame.size.width - 70 - self.view.safeAreaInsets.right, self.view.frame.size.height - 100 - self.view.safeAreaInsets.bottom, 50, 50);
-    } else {
-        UIInterfaceOrientation currentOrientation = [UIApplication sharedApplication].statusBarOrientation;
-        if (UIInterfaceOrientationIsPortrait(currentOrientation)) {
-            self.colorSelectView.frame = CGRectMake(10, 50, 380, 60);
-            self.colorSelectView.colorPickerView.frame = CGRectMake(0, 0, self.colorSelectView.frame.size.width, self.colorSelectView.frame.size.height);
-            self.thicknessView.frame = CGRectMake(10, 140, self.view.frame.size.width-20, 60);
-            self.thicknessLabel.frame = CGRectMake(20, 15, 60, 30);
-            self.thicknessSlider.frame = CGRectMake(90, 0, self.thicknessView.bounds.size.width-110, 60);
-            self.signatureDrawTextView.frame = CGRectMake(10, 210, self.view.frame.size.width-20, self.view.frame.size.height-114-150);
-        } else if (UIInterfaceOrientationIsLandscape(currentOrientation)) {
-            self.colorSelectView.frame = CGRectMake(10, 50, 380, 60);
-            self.thicknessView.frame = CGRectMake(380, 70, self.view.frame.size.width-380-10, 60);
-            self.thicknessLabel.frame = CGRectMake(20, 15, 60, 30);
-            self.thicknessSlider.frame = CGRectMake(90, 0, self.thicknessView.bounds.size.width-110, 60);
-            self.signatureDrawTextView.frame = CGRectMake(10, 130, self.view.frame.size.width-20, self.view.frame.size.height-114-130);
-        }
-        
-        self.signatureDrawImageView.frame = self.signatureDrawTextView.frame;
-        self.createButton.frame = CGRectMake(self.view.frame.size.width - 70, self.view.frame.size.height - 100, 50, 50);
-        self.clearButton.frame = CGRectMake(self.view.frame.size.width - 70, self.view.frame.size.height - 100, 50, 50);
-        self.saveButton.frame = CGRectMake(self.view.frame.size.width - 60, 5, 50, 40);
-        self.cacelButon.frame = CGRectMake(20, 5, 50, 40);
-    }
-    
-    self.textField.frame = CGRectMake((self.view.frame.size.width - 300)/2, 200, 300, 100);
-}
-
-- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
-    if (self.segmentedControl.selectedSegmentIndex == 1) {
-        [self.textField resignFirstResponder];
-    } else if (self.segmentedControl.selectedSegmentIndex == 0 || self.segmentedControl.selectedSegmentIndex == 2) {
-        [self.signatureDrawTextView signatureClear];
-    }
-}
-
-- (void)willTransitionToTraitCollection:(UITraitCollection *)newCollection withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
-    [super willTransitionToTraitCollection:newCollection withTransitionCoordinator:coordinator];
-    [self updatePreferredContentSizeWithTraitCollection:newCollection];
-}
-
-
-
-#pragma mark - Private Methods
-
-- (void)updatePreferredContentSizeWithTraitCollection:(UITraitCollection *)traitCollection {
-    if ([self.colorPicker superview]) {
-        UIDevice *currentDevice = [UIDevice currentDevice];
-        if (currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad) {
-            // This is an iPad
-            self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, 520);
-        } else {
-            // This is an iPhone or iPod touch
-            self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, 320);
-        }
-       
-    } else {
-        CGFloat width = [UIScreen mainScreen].bounds.size.width;
-        CGFloat height = [UIScreen mainScreen].bounds.size.height;
-        
-        CGFloat mWidth = fmin(width, height);
-        CGFloat mHeight = fmax(width, height);
-        
-        UIDevice *currentDevice = [UIDevice currentDevice];
-        if (currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad) {
-            // This is an iPad
-            self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact ? mWidth*0.5 : mHeight*0.6);
-        } else {
-            // This is an iPhone or iPod touch
-            self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact ? mWidth*0.9 : mHeight*0.9);
-        }
-    }
-}
-
-- (void)createGestureRecognizer {
-    [self.createButton setUserInteractionEnabled:YES];
-
-    UIPanGestureRecognizer *panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panaddBookmarkBtn:)];
-    [self.createButton addGestureRecognizer:panRecognizer];
-}
-
-- (void)panaddBookmarkBtn:(UIPanGestureRecognizer *)gestureRecognizer {
-    CGPoint point = [gestureRecognizer translationInView:self.view];
-    CGFloat newX = self.createButton.center.x + point.x;
-    CGFloat newY = self.createButton.center.y + point.y;
-    if (CGRectContainsPoint(self.view.frame, CGPointMake(newX, newY))) {
-        self.createButton.center = CGPointMake(newX, newY);
-    }
-    [gestureRecognizer setTranslation:CGPointZero inView:self.view];
-}
-
-- (UIImage *)captureScreenshotOfTextField:(UITextField *)textField {
-    textField.tintColor = [UIColor whiteColor];
-    CGRect textRect = [textField textRectForBounds:CGRectInset(textField.bounds, 0, 1)];
-    UIGraphicsBeginImageContextWithOptions(textRect.size, NO, 0.0);
-    [textField drawViewHierarchyInRect:textField.bounds afterScreenUpdates:YES];
-    UIImage *textFieldImage = UIGraphicsGetImageFromCurrentImageContext();
-    UIGraphicsEndImageContext();
-    return textFieldImage;
-}
-
-- (void)initDrawSignatureViewProperties {
-    self.colorSelectView.hidden = NO;
-    self.signatureDrawTextView.hidden = NO;
-    self.selecIndex = CSignatureTopBarDefault;
-    self.colorSelectView.hidden = NO;
-    self.clearButton.hidden = NO;
-    self.signatureDrawTextView.selectIndex = CSignatureDrawText;
-    self.emptyLabel.hidden = NO;
-    self.thicknessView.hidden = NO;
-    self.signatureDrawImageView.hidden = YES;
-    self.createButton.hidden = YES;
-    self.textField.hidden = YES;
-    [self.textField resignFirstResponder];
-    
-    if (self.isDrawSignature) {
-        [self.saveButton setTitleColor:[UIColor colorWithRed:20.0/255.0 green:96.0/255.0 blue:243.0/255.0 alpha:1.0] forState:UIControlStateNormal];
-        self.saveButton.enabled = YES;
-    } else {
-        [self.saveButton setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
-        self.saveButton.enabled = NO;
-    }
-}
-
-- (void)initTextSignatureViewProperties {
-    self.colorSelectView.hidden = NO;
-    self.signatureDrawTextView.hidden = YES;
-    self.signatureDrawImageView.hidden = YES;
-    self.textField.hidden = NO;
-    self.selecIndex = CSignatureTopBarText;
-    self.colorSelectView.hidden = NO;
-    self.createButton.hidden = YES;
-    self.thicknessView.hidden = YES;
-    self.clearButton.hidden = NO;
-    self.emptyLabel.hidden = YES;
-    [self.textField becomeFirstResponder];
-    
-    if (self.isTexrSignature) {
-        [self.saveButton setTitleColor:[UIColor colorWithRed:20.0/255.0 green:96.0/255.0 blue:243.0/255.0 alpha:1.0] forState:UIControlStateNormal];
-        self.saveButton.enabled = YES;
-    } else {
-        [self.saveButton setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
-        self.saveButton.enabled = NO;
-    }
-}
-
-- (void)initImageSignatureViewProperties {
-    [self.textField resignFirstResponder];
-    self.colorSelectView.hidden = YES;
-    self.signatureDrawTextView.hidden = YES;
-    self.signatureDrawImageView.hidden = NO;
-    self.textField.hidden = YES;
-    self.selecIndex = CSignatureTopBarImage;
-    self.createButton.hidden = NO;
-    self.colorSelectView.hidden = YES;
-    self.signatureDrawImageView.selectIndex = CSignatureDrawImage;
-    self.thicknessView.hidden = YES;
-    self.clearButton.hidden = YES;
-    self.emptyLabel.hidden = YES;
-    [self.signatureDrawImageView setNeedsDisplay];
-    
-    if (self.isImageSignature) {
-        [self.saveButton setTitleColor:[UIColor colorWithRed:20.0/255.0 green:96.0/255.0 blue:243.0/255.0 alpha:1.0] forState:UIControlStateNormal];
-        self.saveButton.enabled = YES;
-    } else {
-        [self.saveButton setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
-        self.saveButton.enabled = NO;
-    }
-}
-
-#pragma mark - Action
-
-- (void)buttonItemClicked_Save:(id)sender {
-    if (CSignatureTopBarDefault == self.selecIndex) {
-        UIImage *image = [self.signatureDrawTextView signatureImage];
-        if (self.delegate && [self.delegate respondsToSelector:@selector(signatureEditViewController:image:)]) {
-            [self.delegate signatureEditViewController:self image:image];
-        }
-    } else if (CSignatureTopBarImage == self.selecIndex) {
-        [self.signatureDrawTextView signatureClear];
-        UIImage *image = [self.signatureDrawImageView signatureImage];
-        if (self.delegate && [self.delegate respondsToSelector:@selector(signatureEditViewController:image:)]) {
-            [self.delegate signatureEditViewController:self image:image];
-        }
-    }else if (CSignatureTopBarText == self.selecIndex) {
-        UIImage *image = [self captureScreenshotOfTextField:self.textField];
-        if(self.textField.text.length == 0) {
-            UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Info" message:@"Please input Signature" preferredStyle:UIAlertControllerStyleAlert];
-            UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleCancel handler:nil];
-            [alertController addAction:cancelAction];
-            [self presentViewController:alertController animated:YES completion:nil];
-            return;
-        }
-        if (self.textField.text) {
-            if(self.delegate && [self.delegate respondsToSelector:@selector(signatureEditViewController:image:)]) {
-                [self.delegate signatureEditViewController:self image:image];
-            }
-        }
-    }
-    [self buttonItemClicked_Cancel:sender];
-}
-
-- (void)buttonItemClicked_Cancel:(id)sender {
-    [self dismissViewControllerAnimated:YES completion:nil];
-}
-
-- (void)buttonItemClicked_create:(id)sender {
-    [self createImageSignature];
-}
-
-- (void)segmentedControlValueChanged_singature:(id)sender {
-    if (self.segmentedControl.selectedSegmentIndex == 0) {
-        [self initDrawSignatureViewProperties];
-    } else if (self.segmentedControl.selectedSegmentIndex == 1) {
-        [self initTextSignatureViewProperties];
-    } else if (self.segmentedControl.selectedSegmentIndex == 2) {
-        [self initImageSignatureViewProperties];
-    }
-}
-
-- (void)buttonItemClicked_changes:(UISlider *)sender {
-    self.signatureDrawTextView.lineWidth = sender.value;
-    [self.signatureDrawTextView setNeedsDisplay];
-}
-
-- (void)buttonItemClicked_clear:(UIButton *)button {
-    if (self.segmentedControl.selectedSegmentIndex == 0) {
-        [self.signatureDrawTextView signatureClear];
-        self.emptyLabel.text = NSLocalizedString(@"Signature Here", nil);
-        self.isDrawSignature = NO;
-        [self.saveButton setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
-        self.saveButton.enabled = NO;
-    } else if (self.segmentedControl.selectedSegmentIndex == 1) {
-        self.textField.text = @"";
-        self.isTexrSignature = NO;
-        [self.saveButton setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
-        self.saveButton.enabled = NO;
-    }
-    
-}
-
-- (void)textTextField_change:(UITextField *)textField {
-    if (self.textField.text.length > 0) {
-        self.isTexrSignature = YES;
-        [self.saveButton setTitleColor:[UIColor colorWithRed:20.0/255.0 green:96.0/255.0 blue:243.0/255.0 alpha:1.0] forState:UIControlStateNormal];
-        self.saveButton.enabled = YES;
-    } else {
-        self.isTexrSignature = NO;
-        [self.saveButton setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
-        self.saveButton.enabled = NO;
-    }
-}
-
-#pragma mark - UITextFieldDelegate
-
-- (void)textFieldDidBeginEditing:(UITextField *)textField {
-    if (UIInterfaceOrientationIsPortrait([UIApplication sharedApplication].statusBarOrientation)) {
-        [UIView animateWithDuration:0.3 delay:0 options:UIViewAnimationOptionCurveEaseIn animations:^ {
-            self.clearButton.center = CGPointMake(self.clearButton.center.x, self.clearButton.center.y-300);
-        } completion:nil];
-    } else {
-        [UIView animateWithDuration:0.3 delay:0 options:UIViewAnimationOptionCurveEaseIn animations:^ {
-            self.clearButton.center = CGPointMake(self.clearButton.center.x, self.clearButton.center.y-150);
-            self.textField.center = CGPointMake(self.textField.center.x, self.textField.center.y-150);
-        } completion:nil];
-        self.colorSelectView.hidden = YES;
-    }
-}
-
-- (void)textFieldDidEndEditing:(UITextField *)textField {
-    if (UIInterfaceOrientationIsPortrait([UIApplication sharedApplication].statusBarOrientation)) {
-        [UIView animateWithDuration:0.3 delay:0 options:UIViewAnimationOptionCurveEaseIn animations:^ {
-            self.clearButton.center = CGPointMake(self.clearButton.center.x, self.clearButton.center.y+300);
-        } completion:nil];
-    } else {
-        [UIView animateWithDuration:0.3 delay:0 options:UIViewAnimationOptionCurveEaseIn animations:^ {
-            self.clearButton.center = CGPointMake(self.clearButton.center.x, self.clearButton.center.y+150);
-            self.textField.center = CGPointMake(self.textField.center.x, self.textField.center.y+150);
-        } completion:nil];
-        self.colorSelectView.hidden = NO;
-    }
-}
-
-- (BOOL)textFieldShouldReturn:(UITextField *)textField {
-    [textField resignFirstResponder];
-    return YES;
-}
-
-#pragma mark - Private Methods
-
-- (void)createImageSignature {
-    UIAlertAction *cameraAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Camera", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
-        UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
-        imagePickerController.delegate = self;
-        imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
-        [self presentViewController:imagePickerController animated:YES completion:nil];
-    }];
-    
-    UIAlertAction *photoAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Choose from Album", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
-        UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
-        imagePickerController.delegate = self;
-        imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
-        imagePickerController.allowsEditing = YES;
-        imagePickerController.modalPresentationStyle = UIModalPresentationPopover;
-        if (UIUserInterfaceIdiomPad == UI_USER_INTERFACE_IDIOM()) {
-            imagePickerController.popoverPresentationController.sourceView = self.segmentedControl;;
-            imagePickerController.popoverPresentationController.sourceRect = CGRectMake(CGRectGetMaxX(self.segmentedControl.bounds), CGRectGetMaxY(self.segmentedControl.bounds), 1, 1);
-        }
-        [self presentViewController:imagePickerController animated:YES completion:nil];
-    }];
-    
-    UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil)
-                                                           style:UIAlertActionStyleCancel
-                                                         handler:nil];
-    
-    UIAlertController *actionSheet = [UIAlertController alertControllerWithTitle:nil
-                                                                         message:nil
-                                                                  preferredStyle:UIAlertControllerStyleActionSheet];
-    
-    if (UIUserInterfaceIdiomPad == UI_USER_INTERFACE_IDIOM()) {
-        actionSheet.popoverPresentationController.sourceView = self.segmentedControl;
-        actionSheet.popoverPresentationController.sourceRect = CGRectMake(CGRectGetMaxX(self.segmentedControl.bounds), CGRectGetMaxY(self.segmentedControl.bounds), 1, 1);
-    }
-    
-    [actionSheet addAction:cameraAction];
-    [actionSheet addAction:photoAction];
-    [actionSheet addAction:cancelAction];
-    actionSheet.modalPresentationStyle = UIModalPresentationPopover;
-    [self presentViewController:actionSheet animated:YES completion:nil];
-}
-
-#pragma mark - UIImagePickerControllerDelegate
-
-- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
-    [picker dismissViewControllerAnimated:YES completion:nil];
-    UIImage *image;
-    if ([info objectForKey:UIImagePickerControllerEditedImage]) {
-        image = [info objectForKey:UIImagePickerControllerEditedImage];
-    } else if ([info objectForKey:UIImagePickerControllerOriginalImage]) {
-        image = [info objectForKey:UIImagePickerControllerOriginalImage];
-    }
-    
-    if (image) {
-        self.isImageSignature = YES;
-        [self.saveButton setTitleColor:[UIColor colorWithRed:20.0/255.0 green:96.0/255.0 blue:243.0/255.0 alpha:1.0] forState:UIControlStateNormal];
-        self.saveButton.enabled = YES;
-    }
-    
-    UIImageOrientation imageOrientation = image.imageOrientation;
-    if (imageOrientation!=UIImageOrientationUp) {
-        UIGraphicsBeginImageContext(image.size);
-        [image drawInRect:CGRectMake(0, 0, image.size.width, image.size.height)];
-        image = UIGraphicsGetImageFromCurrentImageContext();
-        UIGraphicsEndImageContext();
-    }
-    
-    NSData *imageData = UIImagePNGRepresentation(image);
-    if (imageData == nil || [imageData length] <= 0) {
-        return;
-    }
-    image = [UIImage imageWithData:imageData];
-    
-    const CGFloat colorMasking[6] = {222, 255, 222, 255, 222, 255};
-    CGImageRef imageRef = CGImageCreateWithMaskingColors(image.CGImage, colorMasking);
-    if (imageRef) {
-        image = [UIImage imageWithCGImage:imageRef];
-        CGImageRelease(imageRef);
-    }
-    
-    self.signatureDrawImageView.image = image;
-    [self.signatureDrawImageView setNeedsDisplay];
-}
-
-- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {
-    [picker dismissViewControllerAnimated:YES completion:nil];
-}
-
-#pragma mark - CPDFColorSelectViewDelegate
-
-- (void)selectColorView:(CPDFColorSelectView *)select color:(UIColor *)color {
-    NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:self.textField.text];
-    [attributedString addAttribute:NSForegroundColorAttributeName value:color range:NSMakeRange(0, attributedString.length)];
-
-    self.textField.attributedText = attributedString;
-    
-    self.signatureDrawTextView.color = color;
-    [self.signatureDrawTextView setNeedsDisplay];
-}
-
-- (void)selectColorView:(CPDFColorSelectView *)select {
-    if (@available(iOS 14.0, *)) {
-        UIColorPickerViewController *picker = [[UIColorPickerViewController alloc] init];
-        picker.delegate = self;
-        [self presentViewController:picker animated:YES completion:nil];
-    } else {
-        UIDevice *currentDevice = [UIDevice currentDevice];
-        if (currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad) {
-            // This is an iPad
-            _colorPicker = [[CPDFColorPickerView alloc] initWithFrame:CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y, self.view.frame.size.width, 520)];
-        } else {
-            // This is an iPhone or iPod touch
-            _colorPicker = [[CPDFColorPickerView alloc] initWithFrame:CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y, self.view.frame.size.width, 320)];
-        }
-        self.colorPicker.delegate = self;
-        self.colorPicker.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
-        [self.view addSubview:self.colorPicker];
-        [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
-    }
-}
-
-#pragma mark - CPDFColorPickerViewDelegate
-
-- (void)pickerView:(CPDFColorPickerView *)colorPickerView color:(UIColor *)color {
-    self.signatureDrawTextView.color = color;
-    NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:self.textField.text];
-    [attributedString addAttribute:NSForegroundColorAttributeName value:color range:NSMakeRange(0, attributedString.length)];
-
-    self.textField.attributedText = attributedString;
-    [self.signatureDrawImageView setNeedsDisplay];
-    
-    [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
-}
-
-#pragma mark - UIColorPickerViewControllerDelegate
-
-- (void)colorPickerViewControllerDidFinish:(UIColorPickerViewController *)viewController API_AVAILABLE(ios(14.0)) {
-    self.signatureDrawTextView.color = viewController.selectedColor;
-    NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:self.textField.text];
-    [attributedString addAttribute:NSForegroundColorAttributeName value:self.signatureDrawTextView.color range:NSMakeRange(0, attributedString.length)];
-
-    self.textField.attributedText = attributedString;
-    [self.signatureDrawTextView setNeedsDisplay];
-}
-
-#pragma mark - CSignatureDrawViewDelegate
-
-- (void)signatureDrawViewStart:(CSignatureDrawView *)signatureDrawView {
-    [self.saveButton setTitleColor:[UIColor colorWithRed:20.0/255.0 green:96.0/255.0 blue:243.0/255.0 alpha:1.0] forState:UIControlStateNormal];
-    self.saveButton.enabled = YES;
-    self.isDrawSignature = YES;
-    self.emptyLabel.text = @"";
-}
-
-@end

+ 0 - 35
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFSignature/CPDFSignatureViewCell.h

@@ -1,35 +0,0 @@
-//
-//  CPDFSignatureViewCell.h
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <UIKit/UIKit.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@class CPDFSignatureViewCell;
-
-@protocol CPDFSignatureViewCellDelegate <NSObject>
-
-@optional
-
-- (void)signatureViewCell:(CPDFSignatureViewCell *)signatureViewCell;
-
-@end
-
-@interface CPDFSignatureViewCell : UITableViewCell
-
-@property (nonatomic, strong) UIImageView *signatureImageView;
-
-@property (nonatomic, weak) id<CPDFSignatureViewCellDelegate> deleteDelegate;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 68
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFSignature/CPDFSignatureViewCell.m

@@ -1,68 +0,0 @@
-//
-//  CPDFSignatureViewCell.m
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import "CPDFSignatureViewCell.h"
-
-#import <ComPDFKit_Tools/CPDFColorUtils.h>
-
-@interface CPDFSignatureViewCell ()
-
-@property (nonatomic, strong) UIButton *deleteButton;
-
-@end
-
-@implementation CPDFSignatureViewCell
-
-- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
-    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
-        self.signatureImageView = [[UIImageView alloc] init];
-        [self.contentView addSubview:self.signatureImageView];
-        
-        self.deleteButton = [[UIButton alloc] init];
-        [self.deleteButton setImage:[UIImage imageNamed:@"CPDFSignatureImageDelete" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-        [self.deleteButton addTarget:self action:@selector(buttonItemClicked_delete:) forControlEvents:UIControlEventTouchUpInside];
-        [self.contentView addSubview:self.deleteButton];
-        self.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
-    }
-    return self;
-}
-
-- (void)layoutSubviews {
-    [super layoutSubviews];
-    CGFloat height = self.contentView.bounds.size.height-20;
-    CGFloat width  = height * self.signatureImageView.image.size.width / self.signatureImageView.image.size.height;
-    width = MIN(width, self.contentView.bounds.size.width - 80.0);
-    [self.signatureImageView setFrame:CGRectMake((self.bounds.size.width - width)/2.0, 10.0, width, height)];
-    self.signatureImageView.center = self.contentView.center;
-    self.deleteButton.frame = CGRectMake(self.bounds.size.width - 50, 0.0, 50, 50);
-}
-
-#pragma mark - Action
-
-- (void)buttonItemClicked_delete:(id)sender {
-    if (self.deleteDelegate && [self.deleteDelegate respondsToSelector:@selector(signatureViewCell:)]) {
-        [self.deleteDelegate signatureViewCell:self];
-    }
-}
-
-- (void)awakeFromNib {
-    [super awakeFromNib];
-    // Initialization code
-}
-
-- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
-    [super setSelected:selected animated:animated];
-
-    // Configure the view for the selected state
-}
-
-@end

+ 0 - 42
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFSignature/CPDFSignatureViewController.h

@@ -1,42 +0,0 @@
-//
-//  CPDFSignatureViewController.h
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <UIKit/UIKit.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@class CAnnotStyle;
-@class CPDFSignatureViewController;
-
-@protocol CPDFSignatureViewControllerDelegate <NSObject>
-
-@optional
-
-- (void)signatureViewControllerDismiss:(CPDFSignatureViewController *)signatureViewController;
-
-- (void)signatureViewController:(CPDFSignatureViewController *)signatureViewController image:(UIImage *)image;
-
-@end
-
-@interface CPDFSignatureViewController : UIViewController
-
-@property (nonatomic, readonly) CAnnotStyle *annotStyle;
-
-@property (nonatomic, weak) id<CPDFSignatureViewControllerDelegate> delegate;
-
-@property (nonatomic, strong) UITableView *tableView;
-
-- (instancetype)initWithStyle:(nullable CAnnotStyle *)annotStyle;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 235
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFSignature/CPDFSignatureViewController.m

@@ -1,235 +0,0 @@
-//
-//  CPDFSignatureViewController.m
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import "CPDFSignatureViewController.h"
-#import "CAnnotStyle.h"
-#import "CPDFSignatureViewCell.h"
-#import "CSignatureManager.h"
-#import "CPDFSignatureEditViewController.h"
-#import "SignatureCustomPresentationController.h"
-
-#import <ComPDFKit_Tools/CPDFColorUtils.h>
-
-@interface CPDFSignatureViewController () <UITableViewDelegate, UITableViewDataSource, CPDFSignatureViewCellDelegate,CPDFSignatureEditViewControllerDelegate>
-
-@property (nonatomic, strong) UIButton *backBtn;
-
-@property (nonatomic, strong) UILabel *titleLabel;
-
-@property (nonatomic, strong) CAnnotStyle *annotStyle;
-
-@property (nonatomic, strong) UILabel *emptyLabel;
-
-@property (nonatomic, strong) UIButton *createButton;
-
-@property (nonatomic, strong) UIView *headerView;
-
-@end
-
-@implementation CPDFSignatureViewController
-
-#pragma mark - Initializers
-
-- (instancetype)initWithStyle:(CAnnotStyle *)annotStyle {
-    if (self = [super init]) {
-        self.annotStyle = annotStyle;
-    }
-    return self;
-}
-
-#pragma mark - ViewController Methods
-
-- (void)viewDidLoad {
-    [super viewDidLoad];
-    // Do any additional setup after loading the view.
-    self.headerView = [[UIView alloc] init];
-    self.headerView.layer.borderColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.1].CGColor;
-    self.headerView.layer.borderWidth = 1.0;
-    self.headerView.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
-    [self.view addSubview:self.headerView];
-    
-    self.titleLabel = [[UILabel alloc] init];
-    self.titleLabel.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;
-    self.titleLabel.font = [UIFont systemFontOfSize:20];
-    self.titleLabel.text = NSLocalizedString(@"Signatures", nil);
-    self.titleLabel.textAlignment = NSTextAlignmentCenter;
-    self.titleLabel.adjustsFontSizeToFitWidth = YES;
-    [self.headerView addSubview:self.titleLabel];
-    
-    self.backBtn = [[UIButton alloc] init];
-    self.backBtn.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
-    [self.backBtn setImage:[UIImage imageNamed:@"CPDFAnnotationBaseImageBack" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-    [self.backBtn addTarget:self action:@selector(buttonItemClicked_back:) forControlEvents:UIControlEventTouchUpInside];
-    [self.headerView addSubview:self.backBtn];
-    
-    self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 50, self.view.frame.size.width, self.view.frame.size.height - 70) style:UITableViewStylePlain];
-    self.tableView.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
-    self.tableView.delegate = self;
-    self.tableView.dataSource = self;
-    self.tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-    self.tableView.rowHeight = 120;
-    [self.view addSubview:self.tableView];
-    
-    self.emptyLabel = [[UILabel alloc] init];
-    self.emptyLabel.text = NSLocalizedString(@"NO Signature", nil);
-    self.emptyLabel.textAlignment = NSTextAlignmentCenter;
-    [self.view addSubview:self.emptyLabel];
-    
-    self.createButton = [[UIButton alloc] init];
-    self.createButton.layer.cornerRadius = 25.0;
-    self.createButton.clipsToBounds = YES;
-    [self.createButton setImage:[UIImage imageNamed:@"CPDFSignatureImageAdd" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-    [self.createButton addTarget:self action:@selector(buttonItemClicked_create:) forControlEvents:UIControlEventTouchUpInside];
-    [self.view addSubview:self.createButton];
-    
-    self.view.backgroundColor = [CPDFColorUtils CAnnotationSampleBackgoundColor];
-    [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
-    [self createGestureRecognizer];
-}
-
-- (void)viewWillLayoutSubviews {
-    [super viewWillLayoutSubviews];
-    self.titleLabel.frame = CGRectMake((self.view.frame.size.width - 120)/2, 5, 120, 50);
-    self.headerView.frame = CGRectMake(0, 0, self.view.frame.size.width, 50);
-    
-    self.emptyLabel.frame = CGRectMake((self.view.frame.size.width - 120)/2, (self.view.frame.size.height - 50)/2, 120, 50);
-    
-    if (@available(iOS 11.0, *)) {
-        self.backBtn.frame = CGRectMake(self.view.frame.size.width - 60 - self.view.safeAreaInsets.right, 5, 50, 50);
-        self.createButton.frame = CGRectMake(self.view.frame.size.width - 70 - self.view.safeAreaInsets.right, self.view.frame.size.height - 100 - self.view.safeAreaInsets.bottom, 50, 50);
-    } else {
-        self.backBtn.frame = CGRectMake(self.view.frame.size.width - 60, 5, 50, 50);
-        self.createButton.frame = CGRectMake(self.view.frame.size.width - 70, self.view.frame.size.height - 100, 50, 50);
-    }
-}
-
-- (void)willTransitionToTraitCollection:(UITraitCollection *)newCollection withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
-    [super willTransitionToTraitCollection:newCollection withTransitionCoordinator:coordinator];
-    [self updatePreferredContentSizeWithTraitCollection:newCollection];
-}
-
-#pragma mark - Private Methods
-
-- (void)createGestureRecognizer {
-    [self.createButton setUserInteractionEnabled:YES];
-
-    UIPanGestureRecognizer *panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panaddBookmarkBtn:)];
-    [self.createButton addGestureRecognizer:panRecognizer];
-}
-
-- (void)panaddBookmarkBtn:(UIPanGestureRecognizer *)gestureRecognizer {
-    CGPoint point = [gestureRecognizer translationInView:self.view];
-    CGFloat newX = self.createButton.center.x + point.x;
-    CGFloat newY = self.createButton.center.y + point.y;
-    if (CGRectContainsPoint(self.view.frame, CGPointMake(newX, newY))) {
-        self.createButton.center = CGPointMake(newX, newY);
-    }
-    [gestureRecognizer setTranslation:CGPointZero inView:self.view];
-}
-
-- (void)updatePreferredContentSizeWithTraitCollection:(UITraitCollection *)traitCollection {
-    self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact ? 350 : 660);
-}
-
-#pragma mark - Action
-
-- (void)buttonItemClicked_back:(id)sender {
-    [self dismissViewControllerAnimated:YES completion:nil];
-    if(self.delegate && [self.delegate respondsToSelector:@selector(signatureViewControllerDismiss:)]) {
-        [self.delegate signatureViewControllerDismiss:self];
-    }
-}
-
-- (void)buttonItemClicked_create:(id)sender {
-    SignatureCustomPresentationController *presentationController NS_VALID_UNTIL_END_OF_SCOPE;
-    CPDFSignatureEditViewController *editVC = [[CPDFSignatureEditViewController alloc] init];
-    
-    editVC.delegate = self;
-    
-    presentationController = [[SignatureCustomPresentationController alloc] initWithPresentedViewController:editVC presentingViewController:self];
-    editVC.transitioningDelegate = presentationController;
-    [self presentViewController:editVC animated:YES completion:nil];
-}
-
-#pragma mark - UITableViewDataSource
-
-- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
-    if ([CSignatureManager sharedManager].signatures.count <= 0) {
-        self.emptyLabel.hidden = NO;
-        self.tableView.hidden = YES;
-    } else {
-        self.emptyLabel.hidden = YES;
-        self.tableView.hidden = NO;
-    }
-    return [CSignatureManager sharedManager].signatures.count;
-}
-
-- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
-    CPDFSignatureViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
-    if (cell == nil) {
-        cell = [[CPDFSignatureViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"cell"];
-    }
-
-    cell.signatureImageView.image = [UIImage imageWithContentsOfFile:[CSignatureManager sharedManager].signatures[indexPath.row]];
-
-    cell.deleteDelegate = self;
-    
-    return cell;
-}
-
-#pragma mark - UITableViewDelegate
-
-- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
-    if (!tableView.isEditing) {
-        [self.tableView deselectRowAtIndexPath:indexPath animated:YES];
-        [self dismissViewControllerAnimated:YES completion:^{
-            if (self.delegate && [self.delegate respondsToSelector:@selector(signatureViewController:image:)]) {
-                UIImage *image = [UIImage imageWithContentsOfFile:[CSignatureManager sharedManager].signatures[indexPath.row]];
-                [self.delegate signatureViewController:self image:image];
-            }
-        }];
-    }
-}
-
-#pragma mark - CPDFSignatureViewCellDelegate
-
-- (void)signatureViewCell:(CPDFSignatureViewCell *)signatureViewCell {
-    
-    UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil)
-                                                           style:UIAlertActionStyleCancel
-                                                         handler:nil];
-    UIAlertAction *OKAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil)
-                                                           style:UIAlertActionStyleDefault
-                                                     handler:^(UIAlertAction * _Nonnull action) {
-        NSIndexPath *indexSet = [self.tableView indexPathForCell:signatureViewCell];
-        [[CSignatureManager sharedManager] removeSignaturesAtIndexe:indexSet.row];
-        if ([CSignatureManager sharedManager].signatures.count < 1) {
-            [self setEditing:NO animated:YES];
-        }
-        [self.tableView reloadData];
-    }];
-    UIAlertController *alert = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"Warning", nil)
-                                                                   message:NSLocalizedString(@"Are you sure to delete?", nil)
-                                                            preferredStyle:UIAlertControllerStyleAlert];
-    [alert addAction:cancelAction];
-    [alert addAction:OKAction];
-    [self presentViewController:alert animated:YES completion:nil];
-}
-
-#pragma mark - CPDFSignatureEditViewControllerDelegate
-
-- (void)signatureEditViewController:(CPDFSignatureEditViewController *)signatureEditViewController image:(UIImage *)image{
-    [[CSignatureManager sharedManager] addImageSignature:image];
-    [self.tableView reloadData];
-}
-
-@end

+ 0 - 50
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFSignature/CSignatureDrawView.h

@@ -1,50 +0,0 @@
-//
-//  CSignatureDrawView.h
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <UIKit/UIKit.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@class CSignatureDrawView;
-
-@protocol CSignatureDrawViewDelegate <NSObject>
-
-@optional
-
-- (void)signatureDrawViewStart:(CSignatureDrawView *)signatureDrawView;
-
-@end
-
-typedef NS_ENUM(NSInteger, CSignatureDrawSelectedIndex) {
-    CSignatureDrawText = 0,
-    CSignatureDrawImage
-};
-
-@interface CSignatureDrawView : UIView
-
-@property (nonatomic, strong) UIColor *color;
-
-@property (nonatomic, assign) CGFloat lineWidth;
-
-@property (nullable, nonatomic, strong) UIImage *image;
-
-@property (nonatomic, weak) id<CSignatureDrawViewDelegate> delegate;
-
-@property (nonatomic, assign) CSignatureDrawSelectedIndex selectIndex;
-
-- (UIImage *)signatureImage;
-
-- (void)signatureClear;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 196
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFSignature/CSignatureDrawView.m

@@ -1,196 +0,0 @@
-//
-//  CSignatureDrawView.m
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import "CSignatureDrawView.h"
-
-static CGPoint _points[5];
-static NSInteger _index;
-
-@interface CSignatureDrawView ()
-
-@property (nonatomic, strong) UIBezierPath *bezierPath;
-
-@property (nonatomic, assign) CGRect textRect;
-
-@property (nonatomic, assign) CGContextRef context;
-
-@end
-
-@implementation CSignatureDrawView
-
-#pragma mark - Initializers
-
-- (instancetype)initWithFrame:(CGRect)frame {
-    if (self = [super initWithFrame:frame]) {
-        self.bezierPath = [[UIBezierPath alloc] init];
-        self.lineWidth = 1;
-        
-        self.backgroundColor = [UIColor clearColor];
-    }
-    return self;
-}
-
-- (void)layoutSubviews {
-    [super layoutSubviews];
-    [self setNeedsDisplayInRect:self.bounds];
-}
-
-- (void)drawRect:(CGRect)rect {
-    [super drawRect:rect];
-    
-    self.context = UIGraphicsGetCurrentContext();
-    
-    if (CSignatureDrawText == self.selectIndex) {
-        [self.color set];
-        [self.bezierPath setLineWidth:self.lineWidth];
-        [self.bezierPath setLineCapStyle:kCGLineCapRound];
-        [self.bezierPath setLineJoinStyle:kCGLineJoinRound];
-        [self.bezierPath stroke];
-    } else if (CSignatureDrawImage) {
-        if (self.image) {
-            CGRect imageFrame = [self imageFrameInRect:rect];
-            [self.image drawInRect:imageFrame];
-            if (self.delegate && [self.delegate respondsToSelector:@selector(signatureDrawViewStart:)]) {
-                [self.delegate signatureDrawViewStart:self];
-            }
-        }
-    }
-}
-
-#pragma mark - Draw Methods
-
-- (CGRect)imageFrameInRect:(CGRect)rect {
-    CGRect imageRect;
-    if (self.image.size.width < rect.size.width &&
-        self.image.size.height < rect.size.height) {
-        imageRect.origin.x = (rect.size.width-self.image.size.width)/2.0;
-        imageRect.origin.y = (rect.size.height-self.image.size.height)/2.0;
-        imageRect.size = self.image.size;
-    } else {
-        if (self.image.size.width/self.image.size.height >
-            rect.size.width/rect.size.height) {
-            imageRect.size.width = rect.size.width;
-            imageRect.size.height = rect.size.width*self.image.size.height/self.image.size.width;
-        } else {
-            imageRect.size.height = rect.size.height;
-            imageRect.size.width = rect.size.height*self.image.size.width/self.image.size.height;
-        }
-        imageRect.origin.x = (rect.size.width-imageRect.size.width)/2.0;
-        imageRect.origin.y = (rect.size.height-imageRect.size.height)/2.0;
-    }
-    return imageRect;
-}
-
-#pragma mark - Public Methods
-
-- (UIImage *)signatureImage {
-    CGRect rect = CGRectZero;
-    CGRect imageFrame = [self imageFrameInRect:self.frame];
-    if (self.image) {
-        if (self.bezierPath.empty) {
-            rect = imageFrame;
-        } else {
-            CGRect pathFrame = self.bezierPath.bounds;
-            rect.origin.x = MIN(CGRectGetMinX(imageFrame), CGRectGetMinX(pathFrame));
-            rect.origin.y = MIN(CGRectGetMinY(imageFrame), CGRectGetMinY(pathFrame));
-            rect.size.width = MAX(CGRectGetMaxX(imageFrame), CGRectGetMaxX(pathFrame))-rect.origin.x;
-            rect.size.height = MAX(CGRectGetMaxY(imageFrame), CGRectGetMaxY(pathFrame))-rect.origin.y;
-        }
-    } else {
-        if (self.bezierPath.empty) {
-            return nil;
-        } else {
-            rect = self.bezierPath.bounds;
-        }
-    }
-    
-    CGSize size = CGSizeMake(rect.size.width+self.bezierPath.lineWidth,
-                             rect.size.height+self.bezierPath.lineWidth);
-    UIGraphicsBeginImageContext(size);
-    CGContextRef context = UIGraphicsGetCurrentContext();
-    CGAffineTransform transform = CGAffineTransformMakeTranslation(-rect.origin.x+self.bezierPath.lineWidth/2.0,  -rect.origin.y+self.bezierPath.lineWidth/2.0);
-    CGContextConcatCTM(context, transform);
-    if (self.image) {
-        [self.image drawInRect:imageFrame];
-    }
-    if (!self.bezierPath.empty) {
-        CGContextSetStrokeColorWithColor(context, self.color.CGColor);
-        CGContextSetLineWidth(context, self.bezierPath.lineWidth);
-        CGContextSetLineCap(context, self.bezierPath.lineCapStyle);
-        CGContextSetLineJoin(context, self.bezierPath.lineJoinStyle);
-        CGContextAddPath(context, self.bezierPath.CGPath);
-        CGContextStrokePath(context);
-    }
-    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
-    UIGraphicsEndImageContext();
-    return image;
-}
-
-#pragma mark - Public Methods
-
-- (void)signatureClear {
-    self.image = nil;
-    [self.bezierPath removeAllPoints];
-    [self setNeedsDisplay];
-}
-
-#pragma mark - Action
-
-- (void)buttonItemClicked_clear:(UIButton *)button {
-    self.image = nil;
-    [self.bezierPath removeAllPoints];
-    [self setNeedsDisplay];
-}
-
-#pragma mark - Touch Methods
-
-- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
-    [super touchesBegan:touches withEvent:event];
-    CGPoint point = [[touches anyObject] locationInView:self];
-    _index = 0;
-    _points[0] = point;
-    
-    if (self.delegate && [self.delegate respondsToSelector:@selector(signatureDrawViewStart:)]) {
-        [self.delegate signatureDrawViewStart:self];
-    }
-}
-
-- (void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
-    [super touchesMoved:touches withEvent:event];
-    CGPoint point = [[touches anyObject] locationInView:self];
-    _index++;
-    _points[_index] = point;
-    if (_index == 4) {
-        _points[3] = CGPointMake((_points[2].x + _points[4].x)/2.0,
-                                 (_points[2].y + _points[4].y)/2.0);
-        [self.bezierPath moveToPoint:_points[0]];
-        [self.bezierPath addCurveToPoint:_points[3]
-                           controlPoint1:_points[1]
-                           controlPoint2:_points[2]];
-        _points[0] = _points[3];
-        _points[1] = _points[4];
-        _index = 1;
-        [self setNeedsDisplay];
-    }
-}
-
-- (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
-    [super touchesEnded:touches withEvent:event];
-    if (_index < 4) {
-        for (int i=0; i<_index; i++) {
-            [self.bezierPath moveToPoint:_points[i]];
-        }
-        [self setNeedsDisplay];
-    }
-}
-
-@end

+ 0 - 33
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFSignature/CSignatureManager.h

@@ -1,33 +0,0 @@
-//
-//  CSignatureManager.h
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <UIKit/UIKit.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@interface CSignatureManager : NSObject
-
-@property (nonatomic, strong) NSArray *signatures;
-
-+ (CSignatureManager *)sharedManager;
-
-- (void)addImageSignature:(UIImage *)image;
-
-- (void)addTextSignature:(NSString *)text;
-
-- (void)removeSignaturesAtIndexes:(NSIndexSet *)indexes;
-
-- (void)removeSignaturesAtIndexe:(NSInteger)row;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 114
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFSignature/CSignatureManager.m

@@ -1,114 +0,0 @@
-//
-//  CSignatureManager.m
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import "CSignatureManager.h"
-
-#define kPDFSignatureDataFileName (@"PDFKitResources/Signature/PDFSignatureData.plist")
-#define kPDFSignatureImageFolder  (@"PDFKitResources/Signature/PDFSignatureImageFolder")
-
-@implementation CSignatureManager
-
-static CSignatureManager *_sharedSignManager;
-
-+ (CSignatureManager *)sharedManager {
-    if (!_sharedSignManager)
-        _sharedSignManager = [[CSignatureManager alloc] init];
-    return _sharedSignManager;
-}
-
-- (instancetype)init {
-    if (self = [super init]) {
-        NSString *library = [NSHomeDirectory() stringByAppendingPathComponent:@"Library"];
-        NSString *filePath = [library stringByAppendingPathComponent:kPDFSignatureDataFileName];
-        NSString *folderPath = [library stringByAppendingPathComponent:kPDFSignatureImageFolder];
-        if ([[NSFileManager defaultManager] fileExistsAtPath:filePath]) {
-            NSMutableArray *signatures = [NSMutableArray array];
-            NSArray *fileNames = [[NSArray alloc] initWithContentsOfFile:filePath];
-            for (NSString *fileName in fileNames) {
-                [signatures addObject:[folderPath stringByAppendingPathComponent:fileName]];
-            }
-            _signatures = signatures;
-        } else {
-            _signatures = [[NSArray alloc] init];
-        }
-    }
-    return self;
-}
-
-- (NSString *)randomString {
-    CFUUIDRef cfuuid = CFUUIDCreate(kCFAllocatorDefault);
-    CFStringRef cfstring = CFUUIDCreateString(kCFAllocatorDefault, cfuuid);
-    NSString *cfuuidString = [NSString stringWithString:(__bridge NSString *)cfstring];
-    CFRelease(cfuuid);
-    CFRelease(cfstring);
-    return cfuuidString;
-}
-
-- (void)save {
-    NSString *library = [NSHomeDirectory() stringByAppendingPathComponent:@"Library"];
-    NSString *filePath = [library stringByAppendingPathComponent:kPDFSignatureDataFileName];
-    if ([[NSFileManager defaultManager] fileExistsAtPath:filePath]) {
-        [[NSFileManager defaultManager] removeItemAtPath:filePath error:nil];
-    }
-    NSMutableArray *fileNames = [NSMutableArray array];
-    for (NSString *filePath in self.signatures) {
-        [fileNames addObject:filePath.lastPathComponent];
-    }
-    if (fileNames.count > 0) {
-        [fileNames writeToFile:filePath atomically:YES];
-    }
-}
-
-- (void)addImageSignature:(UIImage *)image {
-    NSString *library = [NSHomeDirectory() stringByAppendingPathComponent:@"Library"];
-    NSString *folderPath = [library stringByAppendingPathComponent:kPDFSignatureImageFolder];
-    NSString *randomStr = [self randomString];
-    if (image) {
-        if (![[NSFileManager defaultManager] fileExistsAtPath:folderPath]) {
-            [[NSFileManager defaultManager] createDirectoryAtPath:folderPath withIntermediateDirectories:YES attributes:nil error:nil];
-        }
-        NSString *imageName = [randomStr stringByAppendingPathExtension:@"png"];
-        NSString *imagePath = [folderPath stringByAppendingPathComponent:imageName];
-        if ([UIImagePNGRepresentation(image) writeToFile:imagePath atomically:YES]) {
-            NSMutableArray *array = [NSMutableArray arrayWithArray:self.signatures];
-            [array insertObject:imagePath atIndex:0];
-            self.signatures = array;
-            [self save];
-        }
-    }
-}
-
-- (void)addTextSignature:(NSString *)text {
-    NSMutableArray *array = [NSMutableArray arrayWithArray:self.signatures];
-    [array insertObject:text atIndex:0];
-    self.signatures = array;
-    [self save];
-}
-
-- (void)removeSignaturesAtIndexes:(NSIndexSet *)indexes {
-    for (NSString *filePath in [self.signatures objectsAtIndexes:indexes]) {
-        [[NSFileManager defaultManager] removeItemAtPath:filePath error:nil];
-    }
-    NSMutableArray *array = [NSMutableArray arrayWithArray:self.signatures];
-    [array removeObjectsAtIndexes:indexes];
-    self.signatures = array;
-    [self save];
-}
-
-- (void)removeSignaturesAtIndexe:(NSInteger)row {
-    NSMutableArray *array = [NSMutableArray arrayWithArray:self.signatures];
-    [array removeObjectAtIndex:row];
-    self.signatures = array;
-    [self save];
-}
-
-@end

+ 0 - 16
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFSignature/CSignatureTextField.h

@@ -1,16 +0,0 @@
-//
-//  CSignatureTextField.h
-//  ComPDFKit_Tools
-//
-//  Created by kdanmobile_2 on 2023/6/7.
-//
-
-#import <UIKit/UIKit.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@interface CSignatureTextField : UITextField
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 28
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFSignature/CSignatureTextField.m

@@ -1,28 +0,0 @@
-//
-//  CSignatureTextField.m
-//  ComPDFKit_Tools
-//
-//  Created by kdanmobile_2 on 2023/6/7.
-//
-
-#import "CSignatureTextField.h"
-
-@implementation CSignatureTextField
-
-- (CGRect)editingRectForBounds:(CGRect)bounds {
-    CGRect inset = CGRectMake(bounds.origin.x+150, bounds.origin.y, bounds.size.width, bounds.size.height);
-         return inset;
-}
-
-- (CGRect)textRectForBounds:(CGRect)bounds
-{
-    CGRect inset = CGRectMake(bounds.origin.x, bounds.origin.y, bounds.size.width, bounds.size.height);
-    return inset;
-}
-
-- (CGRect)placeholderRectForBounds:(CGRect)bounds {
-    CGRect inset = CGRectMake(bounds.origin.x, bounds.origin.y, bounds.size.width, bounds.size.height);
-         return inset;
-}
-
-@end

+ 0 - 16
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFSignature/SignatureCustomPresentationController.h

@@ -1,16 +0,0 @@
-//
-//  SignatureCustomPresentationController.h
-//  ComPDFKit_Tools
-//
-//  Created by kdanmobile_2 on 2023/5/21.
-//
-
-#import <ComPDFKit_Tools/ComPDFKit_Tools.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@interface SignatureCustomPresentationController : UIPresentationController <UIViewControllerTransitioningDelegate>
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 362
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFSignature/SignatureCustomPresentationController.m

@@ -1,362 +0,0 @@
-//
-//  SignatureCustomPresentationController.m
-//  ComPDFKit_Tools
-//
-//  Created by kdanmobile_2 on 2023/5/21.
-//
-
-#import "SignatureCustomPresentationController.h"
-
-#define CORNER_RADIUS   16.f
-
-@interface SignatureCustomPresentationController () <UIViewControllerAnimatedTransitioning>
-@property (nonatomic, strong) UIView *dimmingView;
-@property (nonatomic, strong) UIView *presentationWrappingView;
-@end
-
-@implementation SignatureCustomPresentationController
-
-- (instancetype)initWithPresentedViewController:(UIViewController *)presentedViewController presentingViewController:(UIViewController *)presentingViewController
-{
-    self = [super initWithPresentedViewController:presentedViewController presentingViewController:presentingViewController];
-    
-    if (self) {
-        presentedViewController.modalPresentationStyle = UIModalPresentationCustom;
-    }
-    
-    return self;
-}
-
-- (UIView*)presentedView
-{
-    // Return the wrapping view created in -presentationTransitionWillBegin.
-    return self.presentationWrappingView;
-}
-
-- (void)presentationTransitionWillBegin
-{
-    // The default implementation of -presentedView returns
-    // self.presentedViewController.view.
-    UIView *presentedViewControllerView = [super presentedView];
-    
-    // Wrap the presented view controller's view in an intermediate hierarchy
-    // that applies a shadow and rounded corners to the top-left and top-right
-    // edges.  The final effect is built using three intermediate views.
-    //
-    // presentationWrapperView              <- shadow
-    //   |- presentationRoundedCornerView   <- rounded corners (masksToBounds)
-    //        |- presentedViewControllerWrapperView
-    //             |- presentedViewControllerView (presentedViewController.view)
-    //
-    // SEE ALSO: The note in AAPLCustomPresentationSecondViewController.m.
-    {
-        UIView *presentationWrapperView = [[UIView alloc] initWithFrame:self.frameOfPresentedViewInContainerView];
-        presentationWrapperView.layer.shadowOpacity = 0.44f;
-        presentationWrapperView.layer.shadowRadius = 13.f;
-        presentationWrapperView.layer.shadowOffset = CGSizeMake(0, -6.f);
-        self.presentationWrappingView = presentationWrapperView;
-        
-        // presentationRoundedCornerView is CORNER_RADIUS points taller than the
-        // height of the presented view controller's view.  This is because
-        // the cornerRadius is applied to all corners of the view.  Since the
-        // effect calls for only the top two corners to be rounded we size
-        // the view such that the bottom CORNER_RADIUS points lie below
-        // the bottom edge of the screen.
-        UIView *presentationRoundedCornerView = [[UIView alloc] initWithFrame:UIEdgeInsetsInsetRect(presentationWrapperView.bounds, UIEdgeInsetsMake(0, 0, -CORNER_RADIUS, 0))];
-        presentationRoundedCornerView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-        presentationRoundedCornerView.layer.cornerRadius = CORNER_RADIUS;
-        presentationRoundedCornerView.layer.masksToBounds = YES;
-        
-        // To undo the extra height added to presentationRoundedCornerView,
-        // presentedViewControllerWrapperView is inset by CORNER_RADIUS points.
-        // This also matches the size of presentedViewControllerWrapperView's
-        // bounds to the size of -frameOfPresentedViewInContainerView.
-        UIView *presentedViewControllerWrapperView = [[UIView alloc] initWithFrame:UIEdgeInsetsInsetRect(presentationRoundedCornerView.bounds, UIEdgeInsetsMake(0, 0, CORNER_RADIUS, 0))];
-        presentedViewControllerWrapperView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-        
-        // Add presentedViewControllerView -> presentedViewControllerWrapperView.
-        presentedViewControllerView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-        presentedViewControllerView.frame = presentedViewControllerWrapperView.bounds;
-        [presentedViewControllerWrapperView addSubview:presentedViewControllerView];
-        
-        // Add presentedViewControllerWrapperView -> presentationRoundedCornerView.
-        [presentationRoundedCornerView addSubview:presentedViewControllerWrapperView];
-        
-        // Add presentationRoundedCornerView -> presentationWrapperView.
-        [presentationWrapperView addSubview:presentationRoundedCornerView];
-    }
-    
-    // Add a dimming view behind presentationWrapperView.  self.presentedView
-    // is added later (by the animator) so any views added here will be
-    // appear behind the -presentedView.
-    {
-        UIView *dimmingView = [[UIView alloc] initWithFrame:self.containerView.bounds];
-        dimmingView.backgroundColor = [UIColor blackColor];
-        dimmingView.opaque = NO;
-        dimmingView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-        [dimmingView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dimmingViewTapped:)]];
-        self.dimmingView = dimmingView;
-        [self.containerView addSubview:dimmingView];
-        
-        // Get the transition coordinator for the presentation so we can
-        // fade in the dimmingView alongside the presentation animation.
-        id<UIViewControllerTransitionCoordinator> transitionCoordinator = self.presentingViewController.transitionCoordinator;
-        
-        self.dimmingView.alpha = 0.f;
-        [transitionCoordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context) {
-            self.dimmingView.alpha = 0.5f;
-        } completion:NULL];
-    }
-}
-
-- (void)presentationTransitionDidEnd:(BOOL)completed
-{
-    // The value of the 'completed' argument is the same value passed to the
-    // -completeTransition: method by the animator.  It may
-    // be NO in the case of a cancelled interactive transition.
-    if (completed == NO)
-    {
-        // The system removes the presented view controller's view from its
-        // superview and disposes of the containerView.  This implicitly
-        // removes the views created in -presentationTransitionWillBegin: from
-        // the view hierarchy.  However, we still need to relinquish our strong
-        // references to those view.
-        self.presentationWrappingView = nil;
-        self.dimmingView = nil;
-    }
-}
-
-- (void)dismissalTransitionWillBegin
-{
-    // Get the transition coordinator for the dismissal so we can
-    // fade out the dimmingView alongside the dismissal animation.
-    id<UIViewControllerTransitionCoordinator> transitionCoordinator = self.presentingViewController.transitionCoordinator;
-    
-    [transitionCoordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context) {
-        self.dimmingView.alpha = 0.f;
-    } completion:NULL];
-}
-
-- (void)dismissalTransitionDidEnd:(BOOL)completed
-{
-    // The value of the 'completed' argument is the same value passed to the
-    // -completeTransition: method by the animator.  It may
-    // be NO in the case of a cancelled interactive transition.
-    if (completed == YES)
-    {
-        // The system removes the presented view controller's view from its
-        // superview and disposes of the containerView.  This implicitly
-        // removes the views created in -presentationTransitionWillBegin: from
-        // the view hierarchy.  However, we still need to relinquish our strong
-        // references to those view.
-        self.presentationWrappingView = nil;
-        self.dimmingView = nil;
-    }
-}
-
-#pragma mark -
-#pragma mark Layout
-
-//  This method is invoked whenever the presentedViewController's
-//  preferredContentSize property changes.  It is also invoked just before the
-//  presentation transition begins (prior to -presentationTransitionWillBegin).
-//
-- (void)preferredContentSizeDidChangeForChildContentContainer:(id<UIContentContainer>)container
-{
-    [super preferredContentSizeDidChangeForChildContentContainer:container];
-    
-    if (container == self.presentedViewController)
-        [self.containerView setNeedsLayout];
-}
-
-
-//  When the presentation controller receives a
-//  -viewWillTransitionToSize:withTransitionCoordinator: message it calls this
-//  method to retrieve the new size for the presentedViewController's view.
-//  The presentation controller then sends a
-//  -viewWillTransitionToSize:withTransitionCoordinator: message to the
-//  presentedViewController with this size as the first argument.
-//
-//  Note that it is up to the presentation controller to adjust the frame
-//  of the presented view controller's view to match this promised size.
-//  We do this in -containerViewWillLayoutSubviews.
-//
-- (CGSize)sizeForChildContentContainer:(id<UIContentContainer>)container withParentContainerSize:(CGSize)parentSize
-{
-    if (container == self.presentedViewController)
-        return ((UIViewController*)container).preferredContentSize;
-    else
-        return [super sizeForChildContentContainer:container withParentContainerSize:parentSize];
-}
-
-- (CGRect)frameOfPresentedViewInContainerView
-{
-    CGRect containerViewBounds = self.containerView.bounds;
-    CGSize presentedViewContentSize = [self sizeForChildContentContainer:self.presentedViewController withParentContainerSize:containerViewBounds.size];
-    
-    // The presented view extends presentedViewContentSize.height points from
-    // the bottom edge of the screen.
-    CGRect presentedViewControllerFrame = containerViewBounds;
-    presentedViewControllerFrame.size.height = presentedViewContentSize.height;
-    presentedViewControllerFrame.origin.y = CGRectGetMaxY(containerViewBounds) - presentedViewContentSize.height;
-    return presentedViewControllerFrame;
-}
-
-//  This method is similar to the -viewWillLayoutSubviews method in
-//  UIViewController.  It allows the presentation controller to alter the
-//  layout of any custom views it manages.
-//
-- (void)containerViewWillLayoutSubviews
-{
-    [super containerViewWillLayoutSubviews];
-    
-    self.dimmingView.frame = self.containerView.bounds;
-//    self.frameOfPresentedViewInContainerView
-    CGFloat width = self.containerView.frame.size.width;
-    self.presentationWrappingView.frame =  CGRectMake((self.frameOfPresentedViewInContainerView.size.width - width)/2, self.frameOfPresentedViewInContainerView.origin.y,width, self.frameOfPresentedViewInContainerView.size.height);
-}
-
-#pragma mark -
-#pragma mark Tap Gesture Recognizer
-
-//  IBAction for the tap gesture recognizer added to the dimmingView.
-//  Dismisses the presented view controller.
-//
-- (IBAction)dimmingViewTapped:(UITapGestureRecognizer*)sender
-{
-    [self.presentingViewController dismissViewControllerAnimated:YES completion:NULL];
-}
-
-#pragma mark -
-#pragma mark UIViewControllerAnimatedTransitioning
-
-- (NSTimeInterval)transitionDuration:(id<UIViewControllerContextTransitioning>)transitionContext
-{
-    return [transitionContext isAnimated] ? 0.35 : 0;
-}
-
-//  The presentation animation is tightly integrated with the overall
-//  presentation so it makes the most sense to implement
-//  <UIViewControllerAnimatedTransitioning> in the presentation controller
-//  rather than in a separate object.
-//
-- (void)animateTransition:(id<UIViewControllerContextTransitioning>)transitionContext
-{
-    UIViewController *fromViewController = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
-    UIViewController *toViewController = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
-    
-    UIView *containerView = transitionContext.containerView;
-    
-    // For a Presentation:
-    //      fromView = The presenting view.
-    //      toView   = The presented view.
-    // For a Dismissal:
-    //      fromView = The presented view.
-    //      toView   = The presenting view.
-    UIView *toView = [transitionContext viewForKey:UITransitionContextToViewKey];
-    // If NO is returned from -shouldRemovePresentersView, the view associated
-    // with UITransitionContextFromViewKey is nil during presentation.  This
-    // intended to be a hint that your animator should NOT be manipulating the
-    // presenting view controller's view.  For a dismissal, the -presentedView
-    // is returned.
-    //
-    // Why not allow the animator manipulate the presenting view controller's
-    // view at all times?  First of all, if the presenting view controller's
-    // view is going to stay visible after the animation finishes during the
-    // whole presentation life cycle there is no need to animate it at all — it
-    // just stays where it is.  Second, if the ownership for that view
-    // controller is transferred to the presentation controller, the
-    // presentation controller will most likely not know how to layout that
-    // view controller's view when needed, for example when the orientation
-    // changes, but the original owner of the presenting view controller does.
-    UIView *fromView = [transitionContext viewForKey:UITransitionContextFromViewKey];
-    
-    BOOL isPresenting = (fromViewController == self.presentingViewController);
-    
-    // This will be the current frame of fromViewController.view.
-    CGRect __unused fromViewInitialFrame = [transitionContext initialFrameForViewController:fromViewController];
-    // For a presentation which removes the presenter's view, this will be
-    // CGRectZero.  Otherwise, the current frame of fromViewController.view.
-    CGRect fromViewFinalFrame = [transitionContext finalFrameForViewController:fromViewController];
-    // This will be CGRectZero.
-    CGRect toViewInitialFrame = [transitionContext initialFrameForViewController:toViewController];
-    // For a presentation, this will be the value returned from the
-    // presentation controller's -frameOfPresentedViewInContainerView method.
-    CGRect toViewFinalFrame = [transitionContext finalFrameForViewController:toViewController];
-    
-    // We are responsible for adding the incoming view to the containerView
-    // for the presentation (will have no effect on dismissal because the
-    // presenting view controller's view was not removed).
-    [containerView addSubview:toView];
-    
-    if (isPresenting) {
-        toViewInitialFrame.origin = CGPointMake(CGRectGetMinX(containerView.bounds), CGRectGetMaxY(containerView.bounds));
-        toViewInitialFrame.size = toViewFinalFrame.size;
-        toView.frame = toViewInitialFrame;
-    } else {
-        // Because our presentation wraps the presented view controller's view
-        // in an intermediate view hierarchy, it is more accurate to rely
-        // on the current frame of fromView than fromViewInitialFrame as the
-        // initial frame (though in this example they will be the same).
-        fromViewFinalFrame = CGRectOffset(fromView.frame, 0, CGRectGetHeight(fromView.frame));
-    }
-    
-    NSTimeInterval transitionDuration = [self transitionDuration:transitionContext];
-    
-    [UIView animateWithDuration:transitionDuration animations:^{
-        if (isPresenting)
-            toView.frame = toViewFinalFrame;
-        else
-            fromView.frame = fromViewFinalFrame;
-        
-    } completion:^(BOOL finished) {
-        // When we complete, tell the transition context
-        // passing along the BOOL that indicates whether the transition
-        // finished or not.
-        BOOL wasCancelled = [transitionContext transitionWasCancelled];
-        [transitionContext completeTransition:!wasCancelled];
-    }];
-}
-
-#pragma mark -
-#pragma mark UIViewControllerTransitioningDelegate
-
-//  If the modalPresentationStyle of the presented view controller is
-//  UIModalPresentationCustom, the system calls this method on the presented
-//  view controller's transitioningDelegate to retrieve the presentation
-//  controller that will manage the presentation.  If your implementation
-//  returns nil, an instance of UIPresentationController is used.
-//
-- (UIPresentationController*)presentationControllerForPresentedViewController:(UIViewController *)presented presentingViewController:(UIViewController *)presenting sourceViewController:(UIViewController *)source
-{
-    NSAssert(self.presentedViewController == presented, @"You didn't initialize %@ with the correct presentedViewController.  Expected %@, got %@.",
-             self, presented, self.presentedViewController);
-    
-    return self;
-}
-
-//  The system calls this method on the presented view controller's
-//  transitioningDelegate to retrieve the animator object used for animating
-//  the presentation of the incoming view controller.  Your implementation is
-//  expected to return an object that conforms to the
-//  UIViewControllerAnimatedTransitioning protocol, or nil if the default
-//  presentation animation should be used.
-//
-- (id<UIViewControllerAnimatedTransitioning>)animationControllerForPresentedController:(UIViewController *)presented presentingController:(UIViewController *)presenting sourceController:(UIViewController *)source
-{
-    return self;
-}
-
-//  The system calls this method on the presented view controller's
-//  transitioningDelegate to retrieve the animator object used for animating
-//  the dismissal of the presented view controller.  Your implementation is
-//  expected to return an object that conforms to the
-//  UIViewControllerAnimatedTransitioning protocol, or nil if the default
-//  dismissal animation should be used.
-//
-- (id<UIViewControllerAnimatedTransitioning>)animationControllerForDismissedController:(UIViewController *)dismissed
-{
-    return self;
-}
-
-@end

+ 0 - 33
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFSound/CPDFMediaManager.h

@@ -1,33 +0,0 @@
-//
-//  CPDFMediaManager.h
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <Foundation/Foundation.h>
-#import <UIKit/UIKit.h>
-
-typedef NS_ENUM(NSInteger, CPDFMediaState) {
-    CPDFMediaStateStop = 0,
-    CPDFMediaStateRedayRecord,
-    CPDFMediaStateAudioRecord,
-    CPDFMediaStateVedioPlaying
-};
-
-@interface CPDFMediaManager : NSObject
-
-+ (CPDFMediaManager*)shareManager;
-
-@property (nonatomic, assign)CPDFMediaState mediaState;
-
-@property (nonatomic, assign)NSInteger pageNum;
-
-@property (nonatomic, assign)CGPoint ptInPdf;
-
-@end

+ 0 - 26
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFSound/CPDFMediaManager.m

@@ -1,26 +0,0 @@
-//
-//  CPDFMediaManager.m
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import "CPDFMediaManager.h"
-
-@implementation CPDFMediaManager
-
-+ (CPDFMediaManager*)shareManager {
-    static CPDFMediaManager* mediaManager = nil;
-    static dispatch_once_t  predicate;
-    dispatch_once(&predicate, ^{
-        mediaManager = [[CPDFMediaManager alloc] init];
-    });
-    return mediaManager;
-}
-
-@end

+ 0 - 62
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFSound/CPDFSoundPlayBar.h

@@ -1,62 +0,0 @@
-//
-//  CPDFSoundPlayBar.h
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-
-#import <UIKit/UIKit.h>
-
-typedef NS_ENUM(NSInteger, CPDFSoundState) {
-    CPDFSoundStateRecord = 0,
-    CPDFSoundStatePlay
-};
-
-@class CPDFSoundPlayBar;
-@class CAnnotStyle;
-
-NS_ASSUME_NONNULL_BEGIN
-
-@protocol CPDFSoundPlayBarDelegate <NSObject>
-
-@optional
-
-- (void)soundPlayBarRecordFinished:(CPDFSoundPlayBar *)soundPlayBar withFile:(NSString *)filePath;
-
-- (void)soundPlayBarRecordCancel:(CPDFSoundPlayBar *)soundPlayBar;
-
-- (void)soundPlayBarPlayClose:(CPDFSoundPlayBar *)soundPlayBar;
-
-@end
-
-@interface CPDFSoundPlayBar : UIView
-
-@property (nonatomic, readonly) CAnnotStyle *annotStyle;
-
-@property (nonatomic, readonly) CPDFSoundState soundState;
-
-@property (nonatomic, weak) id<CPDFSoundPlayBarDelegate> delegate;
-
-- (instancetype)initWithStyle:(CAnnotStyle *)annotStyle;
-
-- (void)showInView:(UIView *)subView soundState:(CPDFSoundState)soundState;
-
-- (void)setURL:(NSURL *)url;
-
-- (void)startAudioRecord;
-
-- (void)stopRecord;
-
-- (void)startAudioPlay;
-
-- (void)stopAudioPlay;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 373
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFSound/CPDFSoundPlayBar.m

@@ -1,373 +0,0 @@
-//
-//  CPDFSoundPlayBar.m
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-
-#import "CPDFSoundPlayBar.h"
-
-#import "CAnnotStyle.h"
-
-#import <AVFAudio/AVFAudio.h>
-#import <AVFoundation/AVFoundation.h>
-
-#import <ComPDFKit/ComPDFKit.h>
-
-typedef NS_ENUM(NSInteger, CPDFAudioState) {
-    CPDFAudioState_Pause,
-    CPDFAudioState_Recording,
-    CPDFAudioState_Playing,
-};
-
-#define SOUND_TMP_DICT [NSTemporaryDirectory() stringByAppendingPathComponent:@"soundCache"]
-
-@interface CPDFSoundPlayBar ()<AVAudioPlayerDelegate>
-
-@property (nonatomic, strong) CAnnotStyle *annotStyle;
-
-@property (nonatomic, strong) NSTimer *voiceTimer;
-
-@property (nonatomic, strong) UIButton *playButton;
-
-@property (nonatomic, strong) UIButton *closeButton;
-
-@property (nonatomic, strong) UIButton *sureButton;
-
-@property (nonatomic, strong) UILabel *timeDisplayLabel;
-
-@property (nonatomic, strong) NSDateFormatter *formatter;
-
-@property (nonatomic, strong) AVAudioRecorder *avAudioRecorder;
-
-@property (nonatomic, strong) AVAudioPlayer *avAudioPlayer;
-
-@property (nonatomic,assign) CPDFSoundState soundState;
-
-@property (nonatomic,assign) CPDFAudioState state;
-
-@end
-
-@implementation CPDFSoundPlayBar
-
-#pragma mark - Initializers
-
-- (instancetype)initWithStyle:(CAnnotStyle *)annotStyle {
-    if (self = [super init]) {
-        self.annotStyle = annotStyle;
-        
-        [self setDateFormatter];
-
-        [self initWithView];
-    }
-    return self;
-}
-
-#pragma mark - Accessors
-
-- (void)setDateFormatter {
-    if (nil == _formatter) {
-        _formatter = [[NSDateFormatter alloc] init];
-        _formatter.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_GB"];
-        [_formatter setTimeZone:[NSTimeZone timeZoneWithName:@"GMT"]];
-        _formatter.dateFormat = @"HH:mm:ss";
-    }
-}
-
-#pragma mark - Public
-
-- (void)showInView:(UIView *)subView soundState:(CPDFSoundState)soundState  {
-    self.soundState = soundState;
-
-    if(CPDFSoundStatePlay == soundState) {
-        self.frame = CGRectMake((subView.frame.size.width - 146.0)/2, subView.frame.size.height - 120 - 10, 146.0, 40);
-        self.sureButton.hidden = YES;
-        self.closeButton.frame = CGRectMake(self.frame.size.width - 8 - 24, (self.frame.size.height - 24.0)/2, 24, 24);
-        [self.playButton setImage:[UIImage imageNamed:@"CPDFSoundImageNamePlay" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-
-    } else if (CPDFSoundStateRecord == soundState) {
-        self.frame = CGRectMake((subView.frame.size.width - 174.0)/2, subView.frame.size.height - 120 - 10, 174.0, 40);
-        self.sureButton.hidden = NO;
-        self.sureButton.frame = CGRectMake(self.frame.size.width - 8 - 24, (self.frame.size.height - 24.0)/2, 24, 24);
-        self.closeButton.frame = CGRectMake(self.frame.size.width - 8 - 24 - self.sureButton.frame.size.width - 10, (self.frame.size.height - 24.0)/2, 24, 24);
-        [self.playButton setImage:[UIImage imageNamed:@"CPDFSoundImageNamePlay" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-    }
-    self.layer.cornerRadius = 5.0;
-    self.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleTopMargin;
-    [subView addSubview:self];
-}
-
-- (void)setURL:(NSURL *)url {
-    if (self.soundState == CPDFSoundStateRecord) {
-        [self audioRecorderInitWithURL:url];
-    }else if (self.soundState == CPDFSoundStatePlay){
-        [self audioPlayerInitWithURL:url];
-    }
-    [self setDateFormatter];
-}
-
-- (void)startRecord {
-    self.state = CPDFAudioState_Recording;
-
-    AVAudioSession *audioSession = [AVAudioSession sharedInstance];
-    [audioSession setCategory :AVAudioSessionCategoryPlayAndRecord error:nil];
-    [audioSession setActive:YES error:nil];
-    if ([_avAudioRecorder prepareToRecord]) {
-        [_avAudioRecorder record];
-    }else{
-        NSLog(@"error:unprepare to record!");
-        return;
-    }
-}
-
-- (void)stopRecord {
-    self.state = CPDFAudioState_Pause;
-    [self stopTimer];
-    if (_avAudioRecorder.currentTime > 0.1) {
-        [_avAudioRecorder stop];
-        NSURL *url = _avAudioRecorder.url;
-        NSString *path = [url path];
-        
-        NSFileManager *manager = [NSFileManager defaultManager];
-        if ([manager fileExistsAtPath:path]) {
-            if ([self.delegate respondsToSelector:@selector(soundPlayBarRecordFinished:withFile:)]) {
-                [self.delegate soundPlayBarRecordFinished:self withFile:path];
-            }
-        }
-    } else {
-        [_avAudioRecorder stop];
-    }
-    
-    [self removeFromSuperview];
-}
-
-- (void)startAudioPlay {
-    self.state = CPDFAudioState_Playing;
-    NSError* err = nil;
-    [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback withOptions:AVAudioSessionCategoryOptionDuckOthers error:&err];
-    [[AVAudioSession sharedInstance] setActive:YES error:&err];
-    if (err) {
-        return;
-    }
-    
-    [self startTimer];
-    [_avAudioPlayer play];
-}
-
-- (void)stopAudioPlay{
-    self.state = CPDFAudioState_Pause;
-    if (_avAudioPlayer.playing) {
-        [_avAudioPlayer stop];
-    }
-    [self stopTimer];
-    
-    _timeDisplayLabel.text = @"00:00:00";
-    
-    [self.playButton setImage:[UIImage imageNamed:@"CPDFSoundImageNameStop" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-}
-
-#pragma mark - Private
-
-- (void)initWithView {
-    self.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.8];
-    
-    self.playButton = [UIButton buttonWithType:UIButtonTypeCustom];
-    self.playButton.frame = CGRectMake(8, 8, 24, 24);
-    [self.playButton setImage:[UIImage imageNamed:@"CPDFSoundImageNamePlay" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-    [self.playButton addTarget:self action:@selector(buttonItemClicked_Play:) forControlEvents:UIControlEventTouchUpInside];
-    [self addSubview:self.playButton];
-    
-    _timeDisplayLabel = [[UILabel alloc] init];
-    _timeDisplayLabel.backgroundColor = [UIColor clearColor];
-    _timeDisplayLabel.textColor = [UIColor whiteColor];
-    _timeDisplayLabel.font = [UIFont systemFontOfSize:13.0];
-    _timeDisplayLabel.text = @"00:00:00";
-    [_timeDisplayLabel sizeToFit];
-    _timeDisplayLabel.frame = CGRectMake(CGRectGetMaxX(self.playButton.frame)+ 10, 8, _timeDisplayLabel.frame.size.width + 20, 24.0);
-    [self addSubview:_timeDisplayLabel];
-    
-    self.sureButton = [UIButton buttonWithType:UIButtonTypeCustom];
-    self.sureButton.frame = CGRectMake(self.frame.size.width - 8 - 24, 8, 24, 24);
-    self.sureButton.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
-    [self.sureButton setImage:[UIImage imageNamed:@"CPDFSoundImageNameSure" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-    [self.sureButton addTarget:self action:@selector(buttonItemClicked_Sure:) forControlEvents:UIControlEventTouchUpInside];
-    [self addSubview:self.sureButton];
-    
-    self.closeButton = [UIButton buttonWithType:UIButtonTypeCustom];
-    self.closeButton.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleTopMargin;
-    self.closeButton.frame = CGRectMake(self.frame.size.width - 8 - 24 - self.sureButton.frame.size.width - 10, 8, 24, 24);
-    self.closeButton.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
-    [self.closeButton setImage:[UIImage imageNamed:@"CPDFSoundImageNameClose" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-    [self.closeButton addTarget:self action:@selector(buttonItemClicked_Close:) forControlEvents:UIControlEventTouchUpInside];
-    [self addSubview:self.closeButton];
-}
-
-- (void)startAudioRecord {
-    [self setURL:nil];
-
-    [self startTimer];
-    [self startRecord];
-}
-
-- (void)startTimer {
-    if (_voiceTimer) {
-        [_voiceTimer invalidate];
-        _voiceTimer = nil;
-    }
-    _voiceTimer = [NSTimer scheduledTimerWithTimeInterval:1.0/30.0 target:self selector:@selector(reflashAsTimeGoesBy) userInfo:nil repeats:YES];
-}
-
-- (void)stopTimer {
-    if (_voiceTimer) {
-        [_voiceTimer invalidate];
-        _voiceTimer = nil;
-    }
-}
-
-- (void)audioRecorderInitWithURL:(NSURL *)url {
-    NSMutableDictionary *recordSetting = [[NSMutableDictionary alloc] init];
-    [recordSetting setValue:[NSNumber numberWithInt:kAudioFormatLinearPCM] forKey:AVFormatIDKey];
-    [recordSetting setValue:[NSNumber numberWithFloat:11025] forKey:AVSampleRateKey];
-    [recordSetting setValue:[NSNumber numberWithInt:2] forKey:AVNumberOfChannelsKey];
-    [recordSetting setValue:[NSNumber numberWithInt:16] forKey:AVLinearPCMBitDepthKey];
-    [recordSetting setValue:[NSNumber numberWithInt:AVAudioQualityHigh] forKey:AVEncoderAudioQualityKey];
-    
-    if (!url) {
-        NSString *path = NULL;
-        NSFileManager *manager = [NSFileManager defaultManager];
-        BOOL isDict = NO;
-        BOOL dictOK = NO;
-        if ([manager fileExistsAtPath:SOUND_TMP_DICT isDirectory:&isDict] && isDict){
-            dictOK = YES;
-        }else{
-            if ([manager createDirectoryAtPath:SOUND_TMP_DICT withIntermediateDirectories:NO attributes:nil error:nil]) {
-                dictOK = YES;
-            }
-        }
-        
-        if (dictOK) {
-            for (NSInteger i=0; i<NSIntegerMax; i++) {
-                path = [NSString stringWithFormat:@"%@/%@_%ld.%s",SOUND_TMP_DICT,@"tmp",i,"wav"];
-                if (![manager fileExistsAtPath:path]) {
-                    break;
-                }
-            }
-        }else{
-            NSLog(@"tmp file dict error!");
-        }
-        url = [NSURL fileURLWithPath:path];
-    }
-    
-    if (_avAudioRecorder) {
-        _avAudioRecorder = nil;
-    }
-    NSError *error = nil;
-    _avAudioRecorder = [[AVAudioRecorder alloc]initWithURL:url settings:recordSetting error:&error];
-    _avAudioRecorder.meteringEnabled = YES;
-}
-
-- (void)audioPlayerInitWithURL:(NSURL *)url {
-    if (_avAudioPlayer) {
-        _avAudioPlayer = nil;
-    }
-    
-    NSError *error = nil;
-    _avAudioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:&error];
-    [_avAudioPlayer setVolume:1.0];
-    _avAudioPlayer.delegate = self;
-}
-
-#pragma mark - Action
-
-- (IBAction)buttonItemClicked_Play:(id)sender {
-    if (self.soundState == CPDFSoundStateRecord) {
-        if(CPDFAudioState_Pause == self.state) {
-            [self.playButton setImage:[UIImage imageNamed:@"CPDFSoundImageNamePlay" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-            [self startTimer];
-            [self startRecord];
-            _state = CPDFAudioState_Recording;
-        } else {
-            [self.playButton setImage:[UIImage imageNamed:@"CPDFSoundImageNameRec" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-            [self stopTimer];
-            [_avAudioRecorder pause];
-            self.state = CPDFAudioState_Pause;
-        }
-    } else if(self.soundState == CPDFSoundStatePlay) {
-        if(CPDFAudioState_Pause == self.state) {
-            [self.playButton setImage:[UIImage imageNamed:@"CPDFSoundImageNamePlay" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-            [self startTimer];
-            [_avAudioPlayer play];
-            _state = CPDFAudioState_Playing;
-        } else {
-            [self.playButton setImage:[UIImage imageNamed:@"CPDFSoundImageNameStop" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-            
-            [self stopTimer];
-            [_avAudioPlayer pause];
-            _state = CPDFAudioState_Pause;
-        }
-    }
-}
-
-- (IBAction)buttonItemClicked_Sure:(id)sender {
-    if (self.soundState == CPDFSoundStateRecord) {
-        [self stopRecord];
-    }
-}
-
-- (IBAction)buttonItemClicked_Close:(id)sender {
-    [self removeFromSuperview];
-    if (self.soundState == CPDFSoundStateRecord) {
-        [_avAudioRecorder stop];
-        if ([self.delegate respondsToSelector:@selector(soundPlayBarRecordCancel:)]) {
-            [self.delegate soundPlayBarRecordCancel:self];
-        }
-    } else if(self.soundState == CPDFSoundStatePlay) {
-        [self stopAudioPlay];
-
-        if ([self.delegate respondsToSelector:@selector(soundPlayBarPlayClose:)]) {
-            [self.delegate soundPlayBarPlayClose:self];
-        }
-    }
-}
-
-- (void)reflashAsTimeGoesBy {
-    NSTimeInterval time;
-    
-    if (self.soundState == CPDFSoundStateRecord) {
-        time = _avAudioRecorder.currentTime;
-        [_avAudioRecorder updateMeters];
-        
-        NSDate *dateToShow = [NSDate dateWithTimeIntervalSince1970:time];
-        NSString *stringToShow = [_formatter stringFromDate:dateToShow];
-        _timeDisplayLabel.text = stringToShow;
-        
-        if (time >= 3600 ) {
-            [self stopRecord];
-        }
-    }else if (self.soundState == CPDFSoundStatePlay){
-        time = _avAudioPlayer.currentTime;
-        
-        NSDate *dateToShow = [NSDate dateWithTimeIntervalSince1970:time];
-        NSString *stringToShow = [_formatter stringFromDate:dateToShow];
-        _timeDisplayLabel.text = stringToShow;
-    }
-}
-
-#pragma mark - AvaudioPlayer delegate
-
-- (void)audioPlayerDidFinishPlaying:(AVAudioPlayer *)player successfully:(BOOL)flag
-{
-    [self stopAudioPlay];
-}
-
-- (void)audioPlayerEndInterruption:(AVAudioPlayer *)player {
-    [self stopAudioPlay];
-}
-
-@end

+ 0 - 34
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFSquiggly/CPDFSquigglyViewController.h

@@ -1,34 +0,0 @@
-//
-//  CPDFSquigglyViewController.h
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <ComPDFKit_Tools/ComPDFKit_Tools.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@class CPDFSquigglyViewController;
-@class CAnnotStyle;
-
-@protocol CPDFSquigglyViewControllerDelegate <NSObject>
-
-@optional
-
-- (void)squigglyViewController:(CPDFSquigglyViewController *)squigglyViewController annotStyle:(CAnnotStyle *)annotStyle;
-
-@end
-
-@interface CPDFSquigglyViewController : CPDFAnnotationBaseViewController
-
-@property (nonatomic, strong) id<CPDFSquigglyViewControllerDelegate> delegate;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 98
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFSquiggly/CPDFSquigglyViewController.m

@@ -1,98 +0,0 @@
-//
-//  CPDFSquigglyViewController.m
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import "CPDFSquigglyViewController.h"
-#import "CPDFAnnotationBaseViewController_Header.h"
-
-@interface CPDFSquigglyViewController ()
-
-@end
-
-@implementation CPDFSquigglyViewController
-
-- (void)viewDidLoad {
-    [super viewDidLoad];
-    // Do any additional setup after loading the view.
-}
-
-- (void)commomInitTitle {
-    self.titleLabel.text = NSLocalizedString(@"Squiggly", nil);
-    self.sampleView.selecIndex = CPDFSamplesSquiggly;
-    self.colorView.selectedColor = self.annotStyle.color;
-}
-
-- (void)commomInitFromAnnotStyle {
-    self.sampleView.color = self.annotStyle.color;
-    self.sampleView.opcity = self.annotStyle.opacity;
-    
-    self.opacitySliderView.opacitySlider.value = self.annotStyle.opacity;
-    self.opacitySliderView.startLabel.text = [NSString stringWithFormat:@"%d%%", (int)((self.opacitySliderView.opacitySlider.value/1)*100)];
-    [self.sampleView setNeedsDisplay];
-}
-
-#pragma mark - CPDFColorSelectViewDelegate
-
-- (void)selectColorView:(CPDFColorSelectView *)select color:(UIColor *)color {
-    self.sampleView.color = color;
-    self.annotStyle.color = color;
-    if (self.delegate && [self.delegate respondsToSelector:@selector(squigglyViewController:annotStyle:)]) {
-        [self.delegate squigglyViewController:self annotStyle:self.annotStyle];
-    }
-    [self.sampleView setNeedsDisplay];
-}
-
-#pragma mark - CPDFColorPickerViewDelegate
-
-- (void)pickerView:(CPDFColorPickerView *)colorPickerView color:(UIColor *)color {
-    self.sampleView.color = color;
-    self.annotStyle.color = color;
-    if (self.delegate && [self.delegate respondsToSelector:@selector(squigglyViewController:annotStyle:)]) {
-        [self.delegate squigglyViewController:self annotStyle:self.annotStyle];
-    }
-    [self.sampleView setNeedsDisplay];
-    
-    CGFloat red, green, blue, alpha;
-    [color getRed:&red green:&green blue:&blue alpha:&alpha];
-    self.opacitySliderView.opacitySlider.value = alpha;
-    self.opacitySliderView.startLabel.text = [NSString stringWithFormat:@"%d%%", (int)((self.opacitySliderView.opacitySlider.value/1)*100)];
-    
-    [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
-}
-
-#pragma mark - CPDFOpacitySliderViewDelegate
-
-- (void)opacitySliderView:(CPDFOpacitySliderView *)opacitySliderView opacity:(CGFloat)opacity {
-    self.sampleView.opcity = opacity;
-    self.annotStyle.opacity = opacity;
-    if (self.delegate && [self.delegate respondsToSelector:@selector(squigglyViewController:annotStyle:)]) {
-        [self.delegate squigglyViewController:self annotStyle:self.annotStyle];
-    }
-    [self.sampleView setNeedsDisplay];
-}
-
-#pragma mark - UIColorPickerViewControllerDelegate
-
-- (void)colorPickerViewControllerDidFinish:(UIColorPickerViewController *)viewController API_AVAILABLE(ios(14.0)) {
-    self.sampleView.color = viewController.selectedColor;
-    self.annotStyle.color = self.sampleView.color;
-    if (self.delegate && [self.delegate respondsToSelector:@selector(squigglyViewController:annotStyle:)]) {
-        [self.delegate squigglyViewController:self annotStyle:self.annotStyle];
-    }
-    [self.sampleView setNeedsDisplay];
-    
-    CGFloat red, green, blue, alpha;
-    [viewController.selectedColor getRed:&red green:&green blue:&blue alpha:&alpha];
-    self.opacitySliderView.opacitySlider.value = alpha;
-    self.opacitySliderView.startLabel.text = [NSString stringWithFormat:@"%d%%", (int)((self.opacitySliderView.opacitySlider.value/1)*100)];
-}
-
-@end

+ 0 - 35
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFStamp/CCustomizeStampTableViewCell.h

@@ -1,35 +0,0 @@
-//
-//  CStampCustomizeTableViewCell.h
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <UIKit/UIKit.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@class CCustomizeStampTableViewCell;
-
-@protocol CCustomizeStampTableViewCellDelegate <NSObject>
-
-@optional
-
-- (void)customizeStampTableViewCell:(CCustomizeStampTableViewCell *)customizeStampTableViewCell;
-
-@end
-
-@interface CCustomizeStampTableViewCell : UITableViewCell
-
-@property (nonatomic, strong) UIImageView *customizeStampImageView;
-
-@property (nonatomic, weak) id<CCustomizeStampTableViewCellDelegate> deleteDelegate;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 68
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFStamp/CCustomizeStampTableViewCell.m

@@ -1,68 +0,0 @@
-//
-//  CStampCustomizeTableViewCell.m
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import "CCustomizeStampTableViewCell.h"
-
-#import <ComPDFKit_Tools/CPDFColorUtils.h>
-
-@interface CCustomizeStampTableViewCell ()
-
-@property (nonatomic, strong) UIButton *deleteButton;
-
-@end
-
-@implementation CCustomizeStampTableViewCell
-
-- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
-    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
-        self.customizeStampImageView = [[UIImageView alloc] init];
-        [self.contentView addSubview:self.customizeStampImageView];
-        
-        self.deleteButton = [[UIButton alloc] init];
-        [self.deleteButton setImage:[UIImage imageNamed:@"CPDFSignatureImageDelete" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-        [self.deleteButton addTarget:self action:@selector(buttonItemClicked_delete:) forControlEvents:UIControlEventTouchUpInside];
-        [self.contentView addSubview:self.deleteButton];
-        self.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
-    }
-    return self;
-}
-
-- (void)layoutSubviews {
-    [super layoutSubviews];
-    CGFloat height = self.contentView.bounds.size.height-10;
-    CGFloat width  = height * (self.customizeStampImageView.image.size.width / self.customizeStampImageView.image.size.height);
-    width = MIN(width, self.contentView.bounds.size.width - 80.0);
-    [self.customizeStampImageView setFrame:CGRectMake((self.bounds.size.width - width)/2.0, 5.0, width, height)];
-    self.customizeStampImageView.center = self.contentView.center;
-    self.deleteButton.frame = CGRectMake(self.bounds.size.width - 50, 0.0, 50, 50);
-}
-
-#pragma mark - Action
-
-- (void)buttonItemClicked_delete:(id)sender {
-    if (self.deleteDelegate && [self.deleteDelegate respondsToSelector:@selector(customizeStampTableViewCell:)]) {
-        [self.deleteDelegate customizeStampTableViewCell:self];
-    }
-}
-
-- (void)awakeFromNib {
-    [super awakeFromNib];
-    // Initialization code
-}
-
-- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
-    [super setSelected:selected animated:animated];
-
-    // Configure the view for the selected state
-}
-
-@end

+ 0 - 45
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFStamp/CPDFStampViewController.h

@@ -1,45 +0,0 @@
-//
-//  CPDFStampViewController.h
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <UIKit/UIKit.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-typedef NSString* const PDFAnnotationStampKey NS_STRING_ENUM;
-
-extern PDFAnnotationStampKey PDFAnnotationStampKeyType;        // NSIntger
-extern PDFAnnotationStampKey PDFAnnotationStampKeyImagePath;   // NSString
-extern PDFAnnotationStampKey PDFAnnotationStampKeyText;        // NSString
-extern PDFAnnotationStampKey PDFAnnotationStampKeyShowDate;    // BOOL
-extern PDFAnnotationStampKey PDFAnnotationStampKeyShowTime;    // BOOL
-extern PDFAnnotationStampKey PDFAnnotationStampKeyStyle;       // NSIntger
-extern PDFAnnotationStampKey PDFAnnotationStampKeyShape;       // NSIntger
-
-@class CPDFStampViewController;
-
-@protocol CPDFStampViewControllerDelegate <NSObject>
-
-@optional
-
-- (void)stampViewController:(CPDFStampViewController *)stampViewController selectedIndex:(NSInteger)selectedIndex stamp:(NSDictionary *)stamp;
-
-- (void)stampViewControllerDismiss:(CPDFStampViewController *)stampViewController;
-
-@end
-
-@interface CPDFStampViewController : UIViewController
-
-@property (nonatomic, weak) id<CPDFStampViewControllerDelegate> delegate;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 759
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFStamp/CPDFStampViewController.m

@@ -1,759 +0,0 @@
-//
-//  CPDFStampViewController.m
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import "CPDFStampViewController.h"
-#import "CStampFileManger.h"
-#import "CStampCollectionViewCell.h"
-#import "CPDFColorUtils.h"
-#import "CStampButton.h"
-#import "CStampTextViewController.h"
-#import "CStampTextViewController.h"
-#import "CCustomizeStampTableViewCell.h"
-#import "CStampPreview.h"
-
-#import <ComPDFKit/ComPDFKit.h>
-#import <ComPDFKit_Tools/AAPLCustomPresentationController.h>
-
-#define kStamp_Cell_Height 60
-
-PDFAnnotationStampKey const PDFAnnotationStampKeyType = @"PDFAnnotationStampKeyType";
-PDFAnnotationStampKey const PDFAnnotationStampKeyImagePath = @"PDFAnnotationStampKeyImagePath";
-PDFAnnotationStampKey const PDFAnnotationStampKeyText = @"PDFAnnotationStampKeyText";
-PDFAnnotationStampKey const PDFAnnotationStampKeyShowDate = @"PDFAnnotationStampKeyShowDate";
-PDFAnnotationStampKey const PDFAnnotationStampKeyShowTime = @"PDFAnnotationStampKeyShowTime";
-PDFAnnotationStampKey const PDFAnnotationStampKeyStyle = @"PDFAnnotationStampKeyStyle";
-PDFAnnotationStampKey const PDFAnnotationStampKeyShape = @"PDFAnnotationStampKeyShape";
-
-@interface CPDFStampViewController () <UICollectionViewDelegate, UICollectionViewDataSource, UIPopoverPresentationControllerDelegate, UINavigationControllerDelegate, UIImagePickerControllerDelegate, UITableViewDelegate, UITableViewDataSource, CStampTextViewControllerDelegate, CCustomizeStampTableViewCellDelegate>
-
-@property (nonatomic, strong) UICollectionView *collectView;
-
-@property (nonatomic, strong) UITableView *tableView;
-
-@property (nonatomic, strong) UISegmentedControl *segmentedControl;
-
-@property (nonatomic, strong) NSArray *standardArray;
-
-@property (nonatomic, strong) NSArray *customTextArray;
-
-@property (nonatomic, strong) NSArray *customImageArray;
-
-@property (nonatomic, strong) NSMutableDictionary *imgDicCache;
-
-@property (nonatomic, strong) UIButton *backBtn;
-
-@property (nonatomic, strong) UILabel *titleLabel;
-
-@property (nonatomic, strong) UIButton *createButton;
-
-@property (nonatomic, strong) UILabel *emptyLabel;
-
-@property (nonatomic, strong) UIView *standardView;
-
-@property (nonatomic, strong) UIView *customizeView;
-
-@property (nonatomic, strong) CStampFileManger *stampFileManager;
-
-@property (nonatomic, strong) CStampButton *textButton;
-
-@property (nonatomic, strong) CStampButton *imageButton;
-
-@property (nonatomic, strong) UIView *modelView;
-
-@property (nonatomic, strong) UIView *headerView;
-
-@end
-
-@implementation CPDFStampViewController
-
-#pragma mark - ViewController Methods
-
-- (void)viewDidLoad {
-    [super viewDidLoad];
-    // Do any additional setup after loading the view.
-    self.view.backgroundColor = [CPDFColorUtils CAnnotationSampleBackgoundColor];
-    
-    self.headerView = [[UIView alloc] init];
-    self.headerView.layer.borderColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.1].CGColor;
-    self.headerView.layer.borderWidth = 1.0;
-    self.headerView.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
-    [self.view addSubview:self.headerView];
-    
-    self.titleLabel = [[UILabel alloc] init];
-    self.titleLabel.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;
-    self.titleLabel.text = NSLocalizedString(@"Stamp", nil);
-    self.titleLabel.textAlignment = NSTextAlignmentCenter;
-    self.titleLabel.font = [UIFont systemFontOfSize:20];
-    self.titleLabel.adjustsFontSizeToFitWidth = YES;
-    [self.headerView addSubview:self.titleLabel];
-    
-    self.backBtn = [[UIButton alloc] init];
-    self.backBtn.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
-    [self.backBtn setImage:[UIImage imageNamed:@"CPDFAnnotationBaseImageBack" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-    [self.backBtn addTarget:self action:@selector(buttonItemClicked_back:) forControlEvents:UIControlEventTouchUpInside];
-    [self.headerView addSubview:self.backBtn];
-    
-    NSArray *segmmentArray = [NSArray arrayWithObjects:NSLocalizedString(@"Standard", nil), NSLocalizedString(@"Custom", nil), nil];
-    self.segmentedControl = [[UISegmentedControl alloc] initWithItems:segmmentArray];
-    self.segmentedControl.selectedSegmentIndex = 0;
-    self.segmentedControl.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-    [self.segmentedControl addTarget:self action:@selector(segmentedControlValueChanged_singature:) forControlEvents:UIControlEventValueChanged];
-    [self.view addSubview:self.segmentedControl];
-    
-    self.stampFileManager = [[CStampFileManger alloc] init];
-    [self.stampFileManager readStampDataFromFile];
-    self.customTextArray = [self.stampFileManager getTextStampData];
-    self.customImageArray = [self.stampFileManager getImageStampData];
-    
-    // StandardView
-    [self createStandardView];
-    
-    // CustomizeView
-    [self createCustomizeView];
-    
-    // Data
-    NSMutableArray *array = [NSMutableArray array];
-    for (int i=1; i<13; i++) {
-        NSString *tPicName = nil;
-        if (i<10) {
-            tPicName = [NSString stringWithFormat:@"CPDFStampImage-0%d.png",i];
-        } else {
-            tPicName = [NSString stringWithFormat:@"CPDFStampImage-%d.png",i];
-        }
-        [array addObject:tPicName];
-    }
-    [array addObjectsFromArray:@[@"CPDFStampImage-13", @"CPDFStampImage-14", @"CPDFStampImage-15", @"CPDFStampImage-16", @"CPDFStampImage-20", @"CPDFStampImage-18", @"CPDFStampImage_chick", @"CPDFStampImage_cross", @"CPDFStampImage_circle"]];
-    self.standardArray = array;
-    self.imgDicCache = [NSMutableDictionary dictionary];
-    
-    [self createGestureRecognizer];
-    [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
-}
-
-- (void)viewWillLayoutSubviews {
-    [super viewWillLayoutSubviews];
-    self.titleLabel.frame = CGRectMake((self.view.frame.size.width - 120)/2, 0, 120, 50);
-    self.segmentedControl.frame = CGRectMake(50, 55, self.view.frame.size.width-100, 30);
-    self.headerView.frame = CGRectMake(0, 0, self.view.frame.size.width, 50);
-    self.emptyLabel.frame = CGRectMake((self.view.frame.size.width - 120)/2, (self.view.frame.size.height - 50)/2, 120, 50);
-    if (@available(iOS 11.0, *)) {
-        self.backBtn.frame = CGRectMake(self.view.frame.size.width - 60 - self.view.safeAreaInsets.right, 5, 50, 50);
-        self.createButton.frame = CGRectMake(self.view.frame.size.width - 70 - self.view.safeAreaInsets.right, self.view.bounds.size.height - 200 - self.view.safeAreaInsets.bottom, 50, 50);
-        self.textButton.frame = CGRectMake(self.view.frame.size.width - 180 - self.view.safeAreaInsets.right, self.view.bounds.size.height - 320 - self.view.safeAreaInsets.bottom, 160, 40);
-        self.imageButton.frame = CGRectMake(self.view.frame.size.width - 180 - self.view.safeAreaInsets.right, self.view.bounds.size.height - 270 - self.view.safeAreaInsets.bottom, 160, 40);
-    } else {
-        self.backBtn.frame = CGRectMake(self.view.frame.size.width - 60, 5, 50, 50);
-        self.createButton.frame = CGRectMake(self.view.frame.size.width - 60, self.view.frame.size.height - 200, 50, 50);
-        self.textButton.frame = CGRectMake(self.view.frame.size.width - 180, self.view.frame.size.height - 320, 160, 40);
-        self.imageButton.frame = CGRectMake(self.view.frame.size.width - 180, self.view.frame.size.height - 270, 160, 40);
-    }
-    self.modelView.frame = CGRectMake(0, -200, self.view.bounds.size.width, self.view.bounds.size.height+200);
-}
-
-- (void)viewWillAppear:(BOOL)animated {
-    [super viewWillAppear:animated];
-    
-    [self.collectView reloadData];
-}
-
-- (void)willTransitionToTraitCollection:(UITraitCollection *)newCollection withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
-    [super willTransitionToTraitCollection:newCollection withTransitionCoordinator:coordinator];
-    [self updatePreferredContentSizeWithTraitCollection:newCollection];
-}
-
-#pragma mark - Private Methods
-
-- (void)createStandardView {
-    self.standardView = [[UIView alloc] initWithFrame:CGRectMake(0, 100, self.view.bounds.size.width, self.view.bounds.size.height-100)];
-    self.standardView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
-    [self.view addSubview:self.standardView];
-    
-    UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
-    layout.scrollDirection = UICollectionViewScrollDirectionVertical;
-    layout.minimumInteritemSpacing = 10;
-    layout.minimumLineSpacing = 10;
-    layout.itemSize = CGSizeMake(170,80);
-    layout.sectionInset = UIEdgeInsetsMake(5, 20, 5, 20);
-    
-    self.collectView = [[UICollectionView alloc] initWithFrame:self.standardView.bounds collectionViewLayout:layout];
-    self.collectView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
-    self.collectView.delegate = self;
-    self.collectView.dataSource = self;
-    self.collectView.backgroundColor = [UIColor clearColor];
-    [self.collectView registerClass:[StampCollectionHeaderView class]
-     forSupplementaryViewOfKind:UICollectionElementKindSectionHeader
-            withReuseIdentifier:@"header"];
-    [self.collectView registerClass:[StampCollectionHeaderView1 class]
-     forSupplementaryViewOfKind:UICollectionElementKindSectionHeader
-            withReuseIdentifier:@"header1"];
-    [self.collectView registerClass:[CStampCollectionViewCell class]
-     forCellWithReuseIdentifier:@"TStampViewCell"];
-    
-    if (@available(iOS 11.0, *)) {
-        _collectView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentAlways;
-    }
-    [self.standardView addSubview:self.collectView];
-}
-
-- (void)createCustomizeView {
-    self.customizeView = [[UIView alloc] initWithFrame:CGRectMake(0, 100, self.view.bounds.size.width, self.view.bounds.size.height-100)];
-    self.customizeView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
-    [self.view addSubview:self.customizeView];
-    self.customizeView.hidden = YES;
-    
-    self.tableView = [[UITableView alloc] initWithFrame:self.customizeView.bounds style:UITableViewStyleGrouped];
-    self.tableView.delegate = self;
-    self.tableView.dataSource = self;
-    self.tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-    self.tableView.backgroundColor = [UIColor clearColor];
-    self.tableView.rowHeight = 60;
-    [self.customizeView addSubview:self.tableView];
-    
-    self.emptyLabel = [[UILabel alloc] init];
-    self.emptyLabel.text = NSLocalizedString(@"NO Custom", nil);
-    self.emptyLabel.textAlignment = NSTextAlignmentCenter;
-    [self.customizeView addSubview:self.emptyLabel];
-    
-    if ((self.customImageArray.count < 1) && (self.customTextArray.count < 1)) {
-        self.tableView.hidden = YES;
-        self.emptyLabel.hidden = NO;
-    } else {
-        self.emptyLabel.hidden = YES;
-        self.tableView.hidden = NO;
-    }
-    
-    self.modelView = [[UIView alloc] init];
-    self.modelView.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.5];
-    [self.customizeView addSubview:self.modelView];
-    self.modelView.hidden = YES;
-    
-    self.createButton = [[UIButton alloc] init];
-    self.createButton.layer.cornerRadius = 25.0;
-    self.createButton.clipsToBounds = YES;
-    [self.createButton setImage:[UIImage imageNamed:@"CPDFSignatureImageAdd" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-    self.createButton.backgroundColor = [UIColor blueColor];
-    [self.createButton addTarget:self action:@selector(buttonItemClicked_create:) forControlEvents:UIControlEventTouchUpInside];
-    [self.customizeView addSubview:self.createButton];
-    
-    self.textButton = [[CStampButton alloc] init];
-    [self.textButton.stampBtn setImage:[UIImage imageNamed:@"CPDFStampImageText" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-    self.textButton.titleLabel.text = NSLocalizedString(@"Text Stamp", nil);
-    [self.textButton.stampBtn addTarget:self action:@selector(buttonItemClicked_text:) forControlEvents:UIControlEventTouchUpInside];
-    [self.customizeView addSubview:self.textButton];
-    self.textButton.hidden = YES;
-    
-    self.imageButton = [[CStampButton alloc] init];
-    [self.imageButton.stampBtn setImage:[UIImage imageNamed:@"CPDFStampImageImage" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-    self.imageButton.titleLabel.text = NSLocalizedString(@"Image Stamp", nil);
-    [self.imageButton.stampBtn addTarget:self action:@selector(buttonItemClicked_image:) forControlEvents:UIControlEventTouchUpInside];
-    [self.customizeView addSubview:self.imageButton];
-    self.imageButton.hidden = YES;
-}
-
-- (void)createGestureRecognizer {
-    [self.createButton setUserInteractionEnabled:YES];
-    [self.modelView setUserInteractionEnabled:YES];
-
-    UIPanGestureRecognizer *panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panaddBookmarkBtn:)];
-    [self.createButton addGestureRecognizer:panRecognizer];
-    
-    UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapModelView:)];
-    [self.modelView addGestureRecognizer:tapRecognizer];
-}
-
-- (void)panaddBookmarkBtn:(UIPanGestureRecognizer *)gestureRecognizer {
-    CGPoint point = [gestureRecognizer translationInView:self.view];
-    CGFloat newX = self.createButton.center.x + point.x;
-    CGFloat newY = self.createButton.center.y + point.y;
-    if (CGRectContainsPoint(self.view.frame, CGPointMake(newX, newY))) {
-        self.createButton.center = CGPointMake(newX, newY);
-    }
-    [gestureRecognizer setTranslation:CGPointZero inView:self.view];
-}
-
-- (void)tapModelView:(UIPanGestureRecognizer *)gestureRecognizer {
-    self.textButton.hidden = YES;
-    self.modelView.hidden = YES;
-    self.imageButton.hidden = YES;
-}
-
-- (void)createImageSignature {
-    UIAlertAction *cameraAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Camera", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
-        UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
-        imagePickerController.delegate = self;
-        imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
-        [self presentViewController:imagePickerController animated:YES completion:nil];
-    }];
-    
-    UIAlertAction *photoAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Choose from Album", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
-        UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
-        imagePickerController.delegate = self;
-        imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
-        imagePickerController.allowsEditing = YES;
-        imagePickerController.modalPresentationStyle = UIModalPresentationPopover;
-        if (UIUserInterfaceIdiomPad == UI_USER_INTERFACE_IDIOM()) {
-            imagePickerController.popoverPresentationController.sourceView = self.imageButton;
-            imagePickerController.popoverPresentationController.sourceRect = self.imageButton.bounds;
-        }
-        [self presentViewController:imagePickerController animated:YES completion:nil];
-    }];
-    
-    UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil)
-                                                           style:UIAlertActionStyleCancel
-                                                         handler:nil];
-    
-    UIAlertController *actionSheet = [UIAlertController alertControllerWithTitle:nil
-                                                                         message:nil
-                                                                  preferredStyle:UIAlertControllerStyleActionSheet];
-    
-    if (UIUserInterfaceIdiomPad == UI_USER_INTERFACE_IDIOM()) {
-        actionSheet.popoverPresentationController.sourceView = self.imageButton;
-        actionSheet.popoverPresentationController.sourceRect = self.imageButton.bounds;
-    }
-    
-    [actionSheet addAction:cameraAction];
-    [actionSheet addAction:photoAction];
-    [actionSheet addAction:cancelAction];
-    actionSheet.modalPresentationStyle = UIModalPresentationPopover;
-    [self presentViewController:actionSheet animated:YES completion:nil];
-}
-
-- (UIImage *)compressImage:(UIImage *)image {
-    CGFloat maxWH = kStamp_Cell_Height;
-    if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)])
-        maxWH *=[UIScreen mainScreen].scale;
-    CGFloat imageScale = 1.0;
-    if (image.size.width > maxWH || image.size.height>maxWH)
-        imageScale = MIN(maxWH / image.size.width, maxWH / image.size.height);
-    CGSize newSize = CGSizeMake(image.size.width * imageScale, image.size.height * imageScale);
-    UIGraphicsBeginImageContext(newSize);
-    [image drawInRect:CGRectMake(0, 0, newSize.width, newSize.height)];
-    UIImage* newImage = UIGraphicsGetImageFromCurrentImageContext();
-    UIGraphicsEndImageContext();
-    return newImage;
-}
-
-#pragma mark - UIImagePickerControllerDelegate
-
-- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
-    [picker dismissViewControllerAnimated:YES completion:nil];
-    UIImage *image;
-    if ([info objectForKey:UIImagePickerControllerEditedImage]) {
-        image = [info objectForKey:UIImagePickerControllerEditedImage];
-    } else if ([info objectForKey:UIImagePickerControllerOriginalImage]) {
-        image = [info objectForKey:UIImagePickerControllerOriginalImage];
-    }
-    
-    UIImageOrientation imageOrientation = image.imageOrientation;
-    if (imageOrientation!=UIImageOrientationUp) {
-        UIGraphicsBeginImageContext(image.size);
-        [image drawInRect:CGRectMake(0, 0, image.size.width, image.size.height)];
-        image = UIGraphicsGetImageFromCurrentImageContext();
-        UIGraphicsEndImageContext();
-    }
-    
-    NSData *imageData = UIImagePNGRepresentation(image);
-    if (imageData == nil || [imageData length] <= 0) {
-        return;
-    }
-    image = [UIImage imageWithData:imageData];
-    
-    const CGFloat colorMasking[6] = {222, 255, 222, 255, 222, 255};
-    CGImageRef imageRef = CGImageCreateWithMaskingColors(image.CGImage, colorMasking);
-    if (imageRef) {
-        image = [UIImage imageWithCGImage:imageRef];
-        CGImageRelease(imageRef);
-    }
-    
-    NSString *tPath = [self.stampFileManager saveStampWithImage:image];
-    if (tPath) {
-        NSMutableDictionary *tStampItem = [[NSMutableDictionary alloc] init];
-        [tStampItem setObject:tPath forKey:@"path"];
-        [self.stampFileManager insertStampItem:tStampItem type:PDFStampCustomType_Image];
-        [self.tableView reloadData];
-        if ((self.customImageArray.count < 1) && (self.customTextArray.count < 1)) {
-            self.emptyLabel.hidden = NO;
-            self.tableView.hidden = YES;
-        } else {
-            self.emptyLabel.hidden = YES;
-            self.tableView.hidden = NO;
-        }
-    }
-}
-
-- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {
-    [picker dismissViewControllerAnimated:YES completion:nil];
-}
-
-#pragma mark - Protect Methods
-
-- (void)updatePreferredContentSizeWithTraitCollection:(UITraitCollection *)traitCollection {
-    CGFloat width = [UIScreen mainScreen].bounds.size.width;
-    CGFloat height = [UIScreen mainScreen].bounds.size.height;
-    
-    CGFloat mWidth = fmin(width, height);
-    CGFloat mHeight = fmax(width, height);
-    
-    UIDevice *currentDevice = [UIDevice currentDevice];
-    if (currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad) {
-        // This is an iPad
-        self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact ? mWidth*0.5 : mHeight*0.6);
-    } else {
-        // This is an iPhone or iPod touch
-        self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact ? mWidth*0.9 : mHeight*0.9);
-    }
-}
-
-#pragma mark - Action
-
-- (void)buttonItemClicked_back:(id)sender {
-    [self dismissViewControllerAnimated:YES completion:nil];
-    
-    if (self.delegate && [self.delegate respondsToSelector:@selector(stampViewControllerDismiss:)]) {
-        [self.delegate stampViewControllerDismiss:self];
-    }
-}
-
-- (void)buttonItemClicked_create:(id)sender {
-    self.textButton.hidden = !self.textButton.hidden;
-    self.modelView.hidden = !self.modelView.hidden;
-    self.imageButton.hidden = !self.imageButton.hidden;
-}
-
-- (void)segmentedControlValueChanged_singature:(id)sender {
-    if (self.segmentedControl.selectedSegmentIndex == 0) {
-        self.standardView.hidden = NO;
-        self.customizeView.hidden = YES;
-    } else {
-        self.standardView.hidden = YES;
-        self.customizeView.hidden = NO;
-    }
-}
-
-- (void)buttonItemClicked_text:(id)sender {
-    self.textButton.hidden = YES;
-    self.modelView.hidden = YES;
-    self.imageButton.hidden = YES;
-    
-    AAPLCustomPresentationController *presentationController NS_VALID_UNTIL_END_OF_SCOPE;
-    CStampTextViewController *stampTextVC = [[CStampTextViewController alloc] init];
-    stampTextVC.delegate = self;
-    presentationController = [[AAPLCustomPresentationController alloc] initWithPresentedViewController:stampTextVC presentingViewController:self];
-    stampTextVC.transitioningDelegate = presentationController;
-    [self presentViewController:stampTextVC animated:YES completion:nil];
-}
-
-- (void)buttonItemClicked_image:(id)sender {
-    self.textButton.hidden = YES;
-    self.modelView.hidden = YES;
-    self.imageButton.hidden = YES;
-    [self createImageSignature];
-}
-
-#pragma mark - UICollectionViewDataSource
-
-- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
-    return 1;
-}
-
-- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
-    return self.standardArray.count;
-}
-
-- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
-    CStampCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"TStampViewCell" forIndexPath:indexPath];
-    cell.editing = NO;
-    cell.stampImage.image = [UIImage imageNamed:self.standardArray[indexPath.item] inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil];
-    return cell;
-}
-
-#pragma mark - UICollectionViewDelegate
-
-- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
-    [self dismissViewControllerAnimated:YES completion:^{
-        if (self.delegate && [self.delegate respondsToSelector:@selector(stampViewController:selectedIndex:stamp:)]) {
-            [self.delegate stampViewController:self selectedIndex:indexPath.row stamp:[NSDictionary dictionary]];
-        }
-    }];
-}
-
-#pragma mark - UITableViewDataSource
-
-- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
-    return 2;
-}
-
-- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
-    switch (section) {
-        case 0:
-        {
-            return self.customTextArray.count;
-        }
-            break;
-        case 1:
-        {
-            return self.customImageArray.count;
-        }
-            break;
-            
-        default:
-            return 0;
-    }
-}
-
-- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
-    if (section == 0) {
-        return NSLocalizedString(@"Text Stamp", nil);
-    } else if (section == 1) {
-        return NSLocalizedString(@"Image Stamp", nil);
-    } else {
-        return @"";
-    }
-}
-
-- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
-    CCustomizeStampTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
-    if (cell == nil) {
-        cell = [[CCustomizeStampTableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"cell"];
-    }
-    if (self.customTextArray.count>0 || self.customImageArray.count>0) {
-        if (0 == indexPath.section) {
-            NSDictionary *tDic = _customTextArray[indexPath.item];
-            NSString *tText  = [tDic objectForKey:@"text"];
-            NSInteger tStyle = [[tDic objectForKey:@"style"] integerValue];
-            NSInteger tColorStyle = [[tDic objectForKey:@"colorStyle"] integerValue];
-            BOOL tHaveDate   = [[tDic objectForKey:@"haveDate"] boolValue];
-            BOOL tHaveTime   = [[tDic objectForKey:@"haveTime"] boolValue];
-            
-            CStampPreview *tPreview = [[CStampPreview alloc] initWithFrame:CGRectMake(0, 0, 320, kStamp_Cell_Height)];
-            [tPreview setTextStampText:tText];
-            [tPreview setTextStampColorStyle:tColorStyle];
-            [tPreview setTextStampStyle:tStyle];
-            [tPreview setTextStampHaveDate:tHaveDate];
-            [tPreview setTextStampHaveTime:tHaveTime];
-            tPreview.leftMargin = 0;
-            UIImage *tImg = [tPreview renderImage];
-            cell.customizeStampImageView.image = tImg;
-        } else {
-            NSDictionary *tDic = self.customImageArray[indexPath.item];
-            UIImage *img = [self.imgDicCache objectForKey:tDic];
-            if (!img) {
-                NSString *tPath   = [tDic objectForKey:@"path"];
-                NSString *tFileName = [[NSFileManager defaultManager] displayNameAtPath:tPath];
-                NSString *tRealPath = [NSString stringWithFormat:@"%@/%@",kPDFStampDataFolder,tFileName];
-                UIImage  *tImg    = [UIImage imageWithContentsOfFile:tRealPath];
-                img = [self compressImage:tImg];
-                [self.imgDicCache setObject:img forKey:tDic];
-            }
-            cell.customizeStampImageView.image = img;
-        }
-    }
-    cell.deleteDelegate = self;
-    
-    return cell;
-}
-
-#pragma mark - UITableViewDelegate
-
-- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
-    if (indexPath.section == 0) {
-        NSDictionary *tDic = _customTextArray[indexPath.item];
-        NSString *tText  = [tDic objectForKey:@"text"];
-        NSInteger tStyle = [[tDic objectForKey:@"style"] integerValue];
-        NSInteger tColorStyle = [[tDic objectForKey:@"colorStyle"] integerValue];
-        BOOL tHaveDate   = [[tDic objectForKey:@"haveDate"] boolValue];
-        BOOL tHaveTime   = [[tDic objectForKey:@"haveTime"] boolValue];
-        NSInteger stampStype = 0;
-        NSInteger stampShape = 0;
-        
-        switch (tColorStyle) {
-            case TextStampColorTypeBlack:
-            {
-                stampStype = 0;
-                switch (tStyle) {
-                    case TextStampTypeNone:
-                    {
-                        stampShape = 3;
-                    }
-                        break;
-                    case TextStampTypeRight:
-                    {
-                        stampShape = 2;
-                    }
-                        break;
-                    case TextStampTypeLeft:
-                    {
-                        stampShape = 1;
-                    }
-                        break;
-                    case TextStampTypeCenter:
-                    {
-                        stampShape = 0;
-                    }
-                        break;
-                }
-            }
-                break;
-            case TextStampColorTypeRed:
-            {
-                stampStype = 1;
-                switch (tStyle) {
-                    case TextStampTypeNone:
-                    {
-                        stampShape = 3;
-                    }
-                        break;
-                    case TextStampTypeRight:
-                    {
-                        stampShape = 2;
-                    }
-                        break;
-                    case TextStampTypeLeft:
-                    {
-                        stampShape = 1;
-                    }
-                        break;
-                    case TextStampTypeCenter:
-                    {
-                        stampShape = 0;
-                    }
-                        break;
-                }
-            }
-                break;
-            case TextStampColorTypeGreen:
-            {
-                stampStype = 2;
-                switch (tStyle) {
-                    case TextStampTypeNone:
-                    {
-                        stampShape = 3;
-                    }
-                        break;
-                    case TextStampTypeRight:
-                    {
-                        stampShape = 2;
-                    }
-                        break;
-                    case TextStampTypeLeft:
-                    {
-                        stampShape = 1;
-                    }
-                        break;
-                    case TextStampTypeCenter:
-                    {
-                        stampShape = 0;
-                    }
-                        break;
-                }
-            }
-                break;
-            case TextStampColorTypeBlue:
-            {
-                stampStype = 3;
-                switch (tStyle) {
-                    case TextStampTypeNone:
-                    {
-                        stampShape = 3;
-                    }
-                        break;
-                    case TextStampTypeRight:
-                    {
-                        stampShape = 2;
-                    }
-                        break;
-                    case TextStampTypeLeft:
-                    {
-                        stampShape = 1;
-                    }
-                        break;
-                    case TextStampTypeCenter:
-                    {
-                        stampShape = 0;
-                    }
-                        break;
-                }
-            }
-                break;
-        }
-        
-        [self dismissViewControllerAnimated:YES completion:^{
-            if (self.delegate && [self.delegate respondsToSelector:@selector(stampViewController:selectedIndex:stamp:)]) {
-                [self.delegate stampViewController:self selectedIndex:indexPath.row stamp:@{PDFAnnotationStampKeyText : tText,
-                                                                                            PDFAnnotationStampKeyShowDate : @(tHaveDate),
-                                                                                            PDFAnnotationStampKeyShowTime : @(tHaveTime),
-                                                                                            PDFAnnotationStampKeyStyle : @(stampStype),
-                                                                                            PDFAnnotationStampKeyShape : @(stampShape)}];
-            }
-        }];
-    } else if (indexPath.section == 1) {
-        NSDictionary *tDict = self.customImageArray[indexPath.row];
-        NSString *tPath = [tDict objectForKey:@"path"];
-        NSString *tFileName = [[NSFileManager defaultManager] displayNameAtPath:tPath];
-        NSString *tRealPath = [NSString stringWithFormat:@"%@/%@",kPDFStampDataFolder,tFileName];
-        [self dismissViewControllerAnimated:YES completion:^{
-            if (self.delegate && [self.delegate respondsToSelector:@selector(stampViewController:selectedIndex:stamp:)]) {
-                [self.delegate stampViewController:self selectedIndex:indexPath.row stamp:@{PDFAnnotationStampKeyImagePath : tRealPath}];
-            }
-        }];
-    }
-}
-
-#pragma mark - CCustomizeStampTableViewCellDelegate
-
-- (void)customizeStampTableViewCell:(CCustomizeStampTableViewCell *)customizeStampTableViewCell {
-    UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil)
-                                                           style:UIAlertActionStyleCancel
-                                                         handler:nil];
-    UIAlertAction *OKAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil)
-                                                           style:UIAlertActionStyleDefault
-                                                     handler:^(UIAlertAction * _Nonnull action) {
-        NSIndexPath *select = [self.tableView indexPathForCell:customizeStampTableViewCell];
-        if (select.section == 0) {
-            [self.stampFileManager removeStampItem:select.row type:PDFStampCustomType_Text];
-        } else if (select.section == 1) {
-            [self.stampFileManager removeStampItem:select.row type:PDFStampCustomType_Image];
-        }
-        
-        [self.tableView reloadData];
-        if ((self.customImageArray.count < 1) && (self.customTextArray.count < 1)) {
-            self.emptyLabel.hidden = NO;
-            self.tableView.hidden = YES;
-        } else {
-            self.emptyLabel.hidden = YES;
-            self.tableView.hidden = NO;
-        }
-    }];
-    UIAlertController *alert = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"Warning", nil)
-                                                                   message:NSLocalizedString(@"Are you sure to delete?", nil)
-                                                            preferredStyle:UIAlertControllerStyleAlert];
-    [alert addAction:cancelAction];
-    [alert addAction:OKAction];
-    [self presentViewController:alert animated:YES completion:nil];
-}
-
-#pragma mark - CStampTextViewControllerDelegate
-
-- (void)stampTextViewController:(CStampTextViewController *)stampTextViewController dictionary:(NSDictionary *)dictionary {
-    [self.stampFileManager insertStampItem:dictionary type:PDFStampCustomType_Text];
-    [self.tableView reloadData];
-    
-    if ((self.customImageArray.count < 1) && (self.customTextArray.count < 1)) {
-        self.emptyLabel.hidden = NO;
-        self.tableView.hidden = YES;
-    } else {
-        self.emptyLabel.hidden = YES;
-        self.tableView.hidden = NO;
-    }
-}
-
-@end

+ 0 - 25
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFStamp/CStampButton.h

@@ -1,25 +0,0 @@
-//
-//  CStampButton.h
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <UIKit/UIKit.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@interface CStampButton : UIView
-
-@property (nonatomic, strong) UIButton *stampBtn;
-
-@property (nonatomic, strong) UILabel *titleLabel;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 40
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFStamp/CStampButton.m

@@ -1,40 +0,0 @@
-//
-//  CStampButton.m
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import "CStampButton.h"
-
-@implementation CStampButton
-
-- (instancetype)initWithFrame:(CGRect)frame {
-    if (self = [super initWithFrame:frame]) {
-        self.stampBtn = [[UIButton alloc] init];
-        self.stampBtn.layer.cornerRadius = 20;
-        self.stampBtn.layer.masksToBounds = YES;
-        [self addSubview:self.stampBtn];
-        
-        self.titleLabel = [[UILabel alloc] init];
-        self.titleLabel.textColor = [UIColor whiteColor];
-        self.titleLabel.backgroundColor = [UIColor clearColor];
-        [self addSubview:self.titleLabel];
-        
-        self.backgroundColor = [UIColor clearColor];
-    }
-    return self;
-}
-
-- (void)layoutSubviews {
-    [super layoutSubviews];
-    self.stampBtn.frame = CGRectMake(self.bounds.size.width - 40, 0, 40, self.bounds.size.height);
-    self.titleLabel.frame = CGRectMake(0, 0, 120, self.bounds.size.height);
-}
-
-@end

+ 0 - 58
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFStamp/CStampCollectionViewCell.h

@@ -1,58 +0,0 @@
-//
-//  CStampCollectionViewCell.h
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <UIKit/UIKit.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-#pragma mark - StampCollectionHeaderView
-
-@interface StampCollectionHeaderView : UICollectionReusableView
-
-@property (nonatomic,retain) UILabel *textLabel;
-
-@end
-
-#pragma mark - StampCollectionHeaderView1
-
-@class StampCollectionHeaderView1;
-
-@protocol StampHeaderViewDelegate <NSObject>
-
-@optional
-- (void)addTextWithHeaderView:(StampCollectionHeaderView1 *)headerView;
-
-- (void)addImageWithHeaderView:(StampCollectionHeaderView1 *)headerView;
-
-@end
-
-#pragma mark - StampCollectionHeaderView1
-
-@interface StampCollectionHeaderView1 : UICollectionReusableView
-
-@property (nonatomic,retain)UILabel *textLabel;
-
-@property (nonatomic,assign) id<StampHeaderViewDelegate> delegate;
-
-@end
-
-#pragma mark - StampCollectionViewCell
-
-@interface CStampCollectionViewCell : UICollectionViewCell
-
-@property (nonatomic, strong) UIImageView *stampImage;
-
-@property (nonatomic, assign) BOOL editing;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 143
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFStamp/CStampCollectionViewCell.m

@@ -1,143 +0,0 @@
-//
-//  CStampCollectionViewCell.m
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import "CStampCollectionViewCell.h"
-
-#pragma mark - StampCollectionViewCell
-
-@interface CStampCollectionViewCell ()
-
-@end
-
-@implementation CStampCollectionViewCell
-
-- (instancetype)initWithFrame:(CGRect)frame {
-    if (self = [super initWithFrame:frame]) {
-        self.stampImage = [[UIImageView alloc] init];
-        self.stampImage.backgroundColor = [UIColor clearColor];
-        self.stampImage.contentMode = UIViewContentModeScaleAspectFit;
-        [self.contentView addSubview:self.stampImage];
-        
-        self.contentView.layer.borderWidth = 0.5;
-        self.contentView.layer.borderColor = [UIColor lightGrayColor].CGColor;
-    }
-    return self;
-}
-
-- (void)layoutSubviews {
-    [super layoutSubviews];
-    self.stampImage.frame = CGRectMake(10, (self.contentView.bounds.size.height - 50)/2,
-                                   self.contentView.bounds.size.width - 20, 50);
-}
-
-@end
-
-#pragma mark - StampCollectionHeaderView
-
-@implementation StampCollectionHeaderView
-
-- (instancetype)initWithFrame:(CGRect)frame {
-    if (self = [super initWithFrame:frame]) {
-        self.backgroundColor = [UIColor colorWithRed:248.0/255.0 green:248.0/255.0  blue:248.0/255.0  alpha:1.0];
-
-        _textLabel = [[UILabel alloc] init];
-        _textLabel.textColor = [UIColor colorWithRed:36.0/255.0 green:36.0/255.0 blue:36.0/255.0 alpha:1.0];
-        _textLabel.font = [UIFont systemFontOfSize:14.0];
-        [self addSubview:_textLabel];
-    }
-    return self;
-}
-
-- (void)layoutSubviews {
-    [super layoutSubviews];
-    _textLabel.frame = CGRectMake(10, 0, self.bounds.size.width-20, 20);
-}
-
-@end
-
-#pragma mark - StampCollectionHeaderView1
-
-@interface StampCollectionHeaderView1()
-
-@property (nonatomic,retain) UIView * headerView;
-
-@property (nonatomic,retain) UIButton * textButton;
-
-@property (nonatomic,retain) UIButton * imageButton;
-
-@end
-
-@implementation StampCollectionHeaderView1
-
-- (instancetype)initWithFrame:(CGRect)frame {
-    if (self = [super initWithFrame:frame]) {
-        _headerView = [[UIView alloc] init];
-        _headerView.backgroundColor = [UIColor clearColor];
-        [self addSubview:_headerView];
-        
-        self.textButton = [UIButton buttonWithType:UIButtonTypeSystem];
-        [_textButton setTitle:NSLocalizedString(@"New Text Stamp", nil) forState:UIControlStateNormal];
-        [_textButton setTitleColor:[UIColor colorWithRed:36.0/255.0 green:36.0/255.0 blue:36.0/255.0 alpha:1.0] forState:UIControlStateNormal];
-        [_textButton addTarget:self action:@selector(buttonItemClicked_AddText:) forControlEvents:UIControlEventTouchUpInside];
-        _textButton.layer.borderWidth = 1;
-        _textButton.layer.cornerRadius = 5;
-        _textButton.titleLabel.font = [UIFont systemFontOfSize:16.0];
-        _textButton.titleLabel.adjustsFontSizeToFitWidth = YES;
-        _textButton.layer.borderColor = [UIColor colorWithRed:17.0/255.0 green:140.0/255.0 blue:1.0 alpha:1.0].CGColor;
-        [_headerView addSubview:_textButton];
-        
-        self.imageButton = [UIButton buttonWithType:UIButtonTypeSystem];
-        [_imageButton setTitle:NSLocalizedString(@"New Image Stamp", nil) forState:UIControlStateNormal];
-        [_imageButton setTitleColor:[UIColor colorWithRed:36.0/255.0 green:36.0/255.0 blue:36.0/255.0 alpha:1.0] forState:UIControlStateNormal];
-        _imageButton.titleLabel.font = [UIFont systemFontOfSize:16.0];
-        _imageButton.titleLabel.adjustsFontSizeToFitWidth = YES;
-        [_imageButton addTarget:self action:@selector(buttonItemClicked_AddImage:) forControlEvents:UIControlEventTouchUpInside];
-        _imageButton.layer.borderWidth = 1;
-        _imageButton.layer.cornerRadius = 5;
-        _imageButton.layer.borderColor = [UIColor colorWithRed:17.0/255.0 green:140.0/255.0 blue:1.0 alpha:1.0].CGColor;
-        [_headerView addSubview:_imageButton];
-        
-        self.backgroundColor = [UIColor colorWithRed:248.0/255.0 green:248.0/255.0  blue:248.0/255.0  alpha:1.0];
-        
-        _textLabel = [[UILabel alloc] init];
-        _textLabel.textColor = [UIColor colorWithRed:36.0/255.0 green:36.0/255.0 blue:36.0/255.0 alpha:1.0];
-        _textLabel.font = [UIFont systemFontOfSize:14.0];
-        [self addSubview:_textLabel];
-    
-    }
-    return self;
-}
-
-- (void)layoutSubviews {
-    [super layoutSubviews];
-    _headerView.frame = CGRectMake(0, 0, self.bounds.size.width, 80);
-    _textButton.frame = CGRectMake(10, CGRectGetMinY(_headerView.frame)+10, (self.bounds.size.width-40)/2, 60);
-    _imageButton.frame = CGRectMake(30 + (self.bounds.size.width-40)/2, CGRectGetMinY(_headerView.frame)+10, (self.bounds.size.width-40)/2, 60);
-    _textLabel.frame = CGRectMake(10, CGRectGetMinY(_headerView.frame)+80, self.bounds.size.width-20, 20);
-}
-
-#pragma mark - Button Event Action
-
-- (void)buttonItemClicked_AddImage:(id)sender {
-    if ([self.delegate respondsToSelector:@selector(addImageWithHeaderView:)]) {
-        [self.delegate addImageWithHeaderView:self];
-    }
-}
-
-- (void)buttonItemClicked_AddText:(id)sender {
-    if ([self.delegate respondsToSelector:@selector(addTextWithHeaderView:)]) {
-        [self.delegate addTextWithHeaderView:self];
-    }
-
-}
-
-@end

+ 0 - 37
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFStamp/CStampColorSelectView.h

@@ -1,37 +0,0 @@
-//
-//  CStampColorSelectView.h
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <UIKit/UIKit.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@class CStampColorSelectView;
-
-@protocol CStampColorSelectViewDelegate <NSObject>
-
-@optional
-
-- (void)stampColorSelectView:(CStampColorSelectView *)StampColorSelectView tag:(NSInteger)tag;
-
-@end
-
-@interface CStampColorSelectView : UIView
-
-@property (nonatomic, strong) UILabel *colorLabel;
-
-@property (nonatomic, strong) UIColor * selectedColor;
-
-@property (nonatomic, weak) id<CStampColorSelectViewDelegate> delegate;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 117
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFStamp/CStampColorSelectView.m

@@ -1,117 +0,0 @@
-//
-//  CStampColorSelectView.m
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import "CStampColorSelectView.h"
-
-#import <ComPDFKit_Tools/CPDFColorUtils.h>
-
-@interface CStampColorSelectView ()
-
-@property (nonatomic, strong) UIView *colorPickerView;
-@property (nonatomic, strong) NSMutableArray *colorArray;
-
-@end
-
-@implementation CStampColorSelectView
-
-- (instancetype)initWithFrame:(CGRect)frame {
-    if (self = [super initWithFrame:frame]) {
-        self.colorLabel = [[UILabel alloc] init];
-        self.colorLabel.text = NSLocalizedString(@"Color", nil);
-        self.colorLabel.textColor = [UIColor grayColor];
-        self.colorLabel.font = [UIFont systemFontOfSize:12.0];
-        [self addSubview:self.colorLabel];
-        
-        self.colorPickerView = [[UIView alloc] init];
-        self.colorPickerView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
-        [self addSubview:self.colorPickerView];
-    }
-    return self;
-}
-
-- (void)layoutSubviews {
-    [super layoutSubviews];
-    self.colorLabel.frame = CGRectMake(20, 0, 50, self.bounds.size.height-15);
-    self.colorPickerView.frame = CGRectMake(70, 0, self.bounds.size.width-70, self.bounds.size.height);
-    [self pickerBarInit];
-}
-
-- (void)pickerBarInit {
-    NSArray *colors = @[[UIColor blackColor],
-                        [UIColor colorWithRed:0.57 green:0.06 blue:0.02 alpha:1.0],
-                        [UIColor colorWithRed:0.25 green:0.42 blue:0.13 alpha:1.0],
-                        [UIColor colorWithRed:0.09 green:0.15 blue:0.39 alpha:1.0]];
-    NSMutableArray *array = [NSMutableArray array];
-    for (int i = 0; i < colors.count; i++) {
-        UIView *view = [[UIButton alloc] init];
-        view.tag = i;
-        view.frame = CGRectMake((self.colorPickerView.bounds.size.width - ((self.colorPickerView.bounds.size.height - 20)*4))/5 * (i+1) + (self.colorPickerView.bounds.size.height - 20) * i, 5, self.colorPickerView.bounds.size.height - 20, self.colorPickerView.bounds.size.height - 20);
-        [[view layer] setCornerRadius:(self.colorPickerView.bounds.size.height - 20)/2];
-        view.layer.masksToBounds = YES;
-        view.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleLeftMargin;
-        view.layer.borderColor = [UIColor whiteColor].CGColor;
-        view.layer.borderWidth = 1.0;
-        
-        if(self.selectedColor) {
-            CGFloat red1, green1, blue1, alpha1;
-            [self.selectedColor getRed:&red1 green:&green1 blue:&blue1 alpha:&alpha1];
-
-            CGFloat red2, green2, blue2, alpha2;
-            [colors[i] getRed:&red2 green:&green2 blue:&blue2 alpha:&alpha2];
-            
-            if (fabs(red1 - red2) < FLT_EPSILON &&
-                fabs(green1 - green2) < FLT_EPSILON &&
-                fabs(blue1 - blue2) < FLT_EPSILON) {
-                view.layer.borderColor = [UIColor colorWithRed:20.0/255.0 green:96.0/255.0 blue:243.0/255.0 alpha:1.0].CGColor;
-            } else {
-                view.layer.borderColor = [UIColor whiteColor].CGColor;
-            }
-        } else {
-            view.layer.borderColor = [UIColor whiteColor].CGColor;
-        }
-        
-        view.backgroundColor = [CPDFColorUtils CPDFViewControllerBackgroundColor];
-        [array addObject:view];
-        [self.colorPickerView addSubview:view];
-        
-        UIButton *button = [[UIButton alloc] init];
-        button.frame = CGRectInset(view.frame, 3, 3);
-        [[button layer] setCornerRadius:(self.colorPickerView.bounds.size.height - 26)/2];
-        button.layer.masksToBounds = YES;
-        button.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleLeftMargin;
-        [self.colorPickerView addSubview:button];
-        button.backgroundColor = colors[i];
-        button.tag = i;
-        [button addTarget:self action:@selector(buttonItemClicked_select:) forControlEvents:UIControlEventTouchUpInside];
-    }
-    self.colorArray = array;
-}
-
-#pragma mark - Action
-
-- (void)buttonItemClicked_select:(UIButton *)button {
-    for (int i = 0; i < self.colorArray.count; i++) {
-        ((UIView *)self.colorArray[i]).layer.borderColor = [UIColor whiteColor].CGColor;
-    }
-    
-    ((UIView *)self.colorArray[button.tag]).layer.borderColor = [UIColor blueColor].CGColor;
-    
-    if (self.delegate && [self.delegate respondsToSelector:@selector(stampColorSelectView:tag:)]) {
-        [self.delegate stampColorSelectView:self tag:button.tag];
-    }
-}
-
-- (void)setSelectedColor:(UIColor *)selectedColor {
-    _selectedColor = selectedColor;
-}
-
-@end

+ 0 - 50
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFStamp/CStampFileManger.h

@@ -1,50 +0,0 @@
-//
-//  CStampFileManger.h
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <UIKit/UIKit.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-#define kPDFStampDataFolder [NSHomeDirectory() stringByAppendingPathComponent:@"Library/PDFKitResources/Stamp"]
-#define kPDFStampTextList   [NSHomeDirectory() stringByAppendingPathComponent:@"Library/PDFKitResources/Stamp/stamp_text.plist"]
-#define kPDFStampImageList  [NSHomeDirectory() stringByAppendingPathComponent:@"Library/PDFKitResources/Stamp/stamp_image.plist"]
-
-typedef enum : NSUInteger {
-    PDFStampCustomType_Text,
-    PDFStampCustomType_Image,
-} PDFStampCustomType;
-
-@interface CStampFileManger : NSObject
-
-@property (nonatomic, strong) NSMutableArray *stampTextList;
-
-@property (nonatomic, strong) NSMutableArray *stampImageList;
-
-@property (nonatomic, strong) NSMutableArray *deleteList;
-
-- (void)readStampDataFromFile;
-
-- (NSArray *)getTextStampData;
-
-- (NSArray *)getImageStampData;
-
-- (BOOL)saveStampDataToFile:(PDFStampCustomType)stampType;
-
-- (BOOL)insertStampItem:(NSDictionary *)stampItem type:(PDFStampCustomType)stampType;
-
-- (BOOL)removeStampItem:(NSInteger)index type:(PDFStampCustomType)stampType;
-
-- (NSString *)saveStampWithImage:(UIImage *)image;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 297
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFStamp/CStampFileManger.m

@@ -1,297 +0,0 @@
-//
-//  CStampFileManger.m
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import "CStampFileManger.h"
-
-@implementation CStampFileManger
-
-#pragma mark - Init Method
-- (id)init
-{
-    self = [super init];
-    if (self) {
-        _deleteList = [[NSMutableArray alloc] init];
-    }
-    
-    return self;
-}
-
-- (NSString *)getDateTime
-{
-    NSTimeZone* timename = [NSTimeZone systemTimeZone];
-    NSDateFormatter *outputFormatter = [[NSDateFormatter alloc] init ];
-    [outputFormatter setTimeZone:timename ];
-    
-    NSString *tDate = nil;
-    
-    [outputFormatter setDateFormat:@"YYYYMMddHHmmss"];
-    tDate = [outputFormatter stringFromDate:[NSDate date]];
-    
-    return tDate;
-}
-
-#pragma mark - File Manager
-
-- (void)readStampDataFromFile {
-    [self readCustomStamp_TextStamp];
-    [self readCustomStamp_ImageStamp];
-}
-
-- (void)readCustomStamp_TextStamp {
-    NSFileManager *tManager = [NSFileManager defaultManager];
-    if (![tManager fileExistsAtPath:kPDFStampTextList])
-    {
-        _stampTextList = [[NSMutableArray alloc] init];
-    }
-    else
-    {
-        if (_stampTextList)
-        {
-            _stampTextList = nil;
-        }
-        
-        _stampTextList = [NSMutableArray arrayWithContentsOfFile:kPDFStampTextList];
-        if (_stampTextList == nil) {
-            _stampTextList = [[NSMutableArray alloc] init];
-        }
-    }
-}
-
-- (void)readCustomStamp_ImageStamp {
-    NSFileManager *tManager = [NSFileManager defaultManager];
-    if (![tManager fileExistsAtPath:kPDFStampImageList])
-    {
-        _stampImageList = [[NSMutableArray alloc] init];
-    }
-    else
-    {
-        if (_stampImageList)
-        {
-            _stampImageList = nil;
-        }
-        
-        _stampImageList = [NSMutableArray arrayWithContentsOfFile:kPDFStampImageList];
-        if (_stampImageList == nil) {
-            _stampImageList = [[NSMutableArray alloc] init];
-        }
-    }
-}
-
-- (NSArray *)getTextStampData {
-    return _stampTextList;
-}
-
-- (NSArray *)getImageStampData {
-    return _stampImageList;
-}
-
-- (NSString *)saveStampWithImage:(UIImage *)image {
-    NSFileManager *tManager = [NSFileManager defaultManager];
-    NSData *imageData = UIImagePNGRepresentation(image);
-    
-    if (imageData == nil || [imageData length] <= 0)
-        return nil;
-    
-    NSString *tName = [self getDateTime];
-    NSString *tPath = [kPDFStampDataFolder stringByAppendingFormat:@"/%@.png",tName];
-    
-    if ([imageData writeToFile:tPath atomically:NO]) {
-        return tPath;
-    }
-    else
-    {
-        NSString *tPath_dic = kPDFStampDataFolder;
-        BOOL tIsDirectory = NO;
-        while (1)
-        {
-            if ([tManager fileExistsAtPath:tPath_dic isDirectory:&tIsDirectory]) {
-                if (tIsDirectory)
-                    break;
-            }
-            else
-            {
-                [tManager createDirectoryAtPath:tPath_dic withIntermediateDirectories:NO attributes:nil error:nil];
-            }
-            tPath_dic = [tPath_dic stringByDeletingLastPathComponent];
-        }
-        if ([imageData writeToFile:tPath atomically:NO]) {
-            return tPath;
-        }
-    }
-    
-    return nil;
-}
-
-- (void)removeStampImage {
-    for (NSDictionary *tDict in _deleteList)
-    {
-        NSString *tPath = [tDict objectForKey:@"path"];
-        NSFileManager *tFileManager = [NSFileManager defaultManager];
-        [tFileManager removeItemAtPath:tPath error:nil];
-    }
-}
-
-- (BOOL)saveStampDataToFile:(PDFStampCustomType)stampType {
-    NSFileManager *tManager = [NSFileManager defaultManager];
-    
-    switch (stampType)
-    {
-        case PDFStampCustomType_Text:
-            if ([_stampTextList writeToFile:kPDFStampTextList atomically:NO])
-            {
-                return YES;
-            }
-            else
-            {
-                NSString *tPath_dic = kPDFStampTextList;
-                BOOL tIsDirectory = NO;
-                while (1)
-                {
-                    tPath_dic = [tPath_dic stringByDeletingLastPathComponent];
-                    
-                    if ([tManager fileExistsAtPath:tPath_dic isDirectory:&tIsDirectory]) {
-                        if (tIsDirectory)
-                            break;
-                    }
-                    else
-                    {
-                        [tManager createDirectoryAtPath:tPath_dic withIntermediateDirectories:NO attributes:nil error:nil];
-                    }
-                }
-                if ([_stampTextList writeToFile:kPDFStampTextList atomically:NO])
-                {
-                    return YES;
-                }
-            }
-            return NO;
-            
-        case PDFStampCustomType_Image:
-            if ([_stampImageList writeToFile:kPDFStampImageList atomically:NO])
-            {
-                return YES;
-            }
-            else
-            {
-                NSString *tPath_dic = kPDFStampImageList;
-                BOOL tIsDirectory = NO;
-                while (1)
-                {
-                    tPath_dic = [tPath_dic stringByDeletingLastPathComponent];
-                    
-                    if ([tManager fileExistsAtPath:tPath_dic isDirectory:&tIsDirectory]) {
-                        if (tIsDirectory)
-                            break;
-                    }
-                    else
-                    {
-                        [tManager createDirectoryAtPath:tPath_dic withIntermediateDirectories:NO attributes:nil error:nil];
-                    }
-                }
-                if ([_stampImageList writeToFile:kPDFStampImageList atomically:NO])
-                {
-                    return YES;
-                }
-            }
-            return NO;
-            
-        default:
-            return NO;
-    }
-}
-
-- (BOOL)insertStampItem:(NSDictionary *)stampItem type:(PDFStampCustomType)stampType {
-    switch (stampType)
-    {
-        case PDFStampCustomType_Text:
-            if (!_stampTextList) {
-                [self readCustomStamp_TextStamp];
-            }
-            
-            if (stampItem)
-            {
-                [_stampTextList insertObject:stampItem atIndex:0];
-                if ([self saveStampDataToFile:PDFStampCustomType_Text])
-                    return YES;
-                else
-                    return NO;
-            }
-            else
-                return NO;
-            
-        case PDFStampCustomType_Image:
-            if (!_stampImageList) {
-                [self readCustomStamp_ImageStamp];
-            }
-            
-            if (stampItem)
-            {
-                [_stampImageList insertObject:stampItem atIndex:0];
-                if ([self saveStampDataToFile:PDFStampCustomType_Image])
-                    return YES;
-                else
-                    return NO;
-            }
-            else
-                return NO;
-            
-        default:
-            return NO;
-    }
-}
-
-- (BOOL)removeStampItem:(NSInteger)index type:(PDFStampCustomType)stampType {
-    switch (stampType)
-    {
-        case PDFStampCustomType_Text:
-            if (!_stampTextList) {
-                [self readCustomStamp_TextStamp];
-            }
-            
-            if (index >= 0 && index <= [_stampTextList count])
-            {
-                [_stampTextList removeObjectAtIndex:index];
-                if ([self saveStampDataToFile:PDFStampCustomType_Text])
-                    return YES;
-                else
-                    return NO;
-            }
-            else
-                return NO;
-            
-        case PDFStampCustomType_Image:
-            if (!_stampImageList) {
-                [self readCustomStamp_ImageStamp];
-            }
-            
-            if (index >= 0 && index < [_stampImageList count])
-            {
-                if (!_deleteList) {
-                    _deleteList = [[NSMutableArray alloc] init];
-                }
-                NSDictionary *tDict = [_stampImageList objectAtIndex:index];
-                [_deleteList addObject:tDict];
-                
-                [_stampImageList removeObjectAtIndex:index];
-                if ([self saveStampDataToFile:PDFStampCustomType_Image])
-                    return YES;
-                else
-                    return NO;
-            }
-            else
-                return NO;
-            
-        default:
-            return NO;
-    }
-}
-
-@end

+ 0 - 60
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFStamp/CStampPreview.h

@@ -1,60 +0,0 @@
-//
-//  CStampPreview.h
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <UIKit/UIKit.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-typedef NS_ENUM(NSInteger, TextStampType) {
-    TextStampTypeCenter = 0,
-    TextStampTypeLeft,
-    TextStampTypeRight,
-    TextStampTypeNone
-};
-
-typedef NS_ENUM(NSInteger, TextStampColorType) {
-    TextStampColorTypeBlack = 0,
-    TextStampColorTypeRed,
-    TextStampColorTypeGreen,
-    TextStampColorTypeBlue
-};
-
-
-@interface CStampPreview : UIView {
-    double color[3];
-}
-
-@property (nonatomic, assign) NSInteger textStampStyle;
-
-@property (nonatomic, assign) NSInteger textStampColorStyle;
-
-@property (nonatomic, assign) BOOL textStampHaveDate;
-
-@property (nonatomic, assign) BOOL textStampHaveTime;
-
-@property (nonatomic, strong) NSString *textStampText;
-
-@property (nonatomic, strong) NSString *dateTime;
-
-@property (nonatomic, assign) CGRect stampBounds;
-
-@property (nonatomic, assign) float scale;
-
-@property (nonatomic, assign) CGFloat leftMargin;
-
-@property (nonatomic, strong) UIColor *color;
-
-- (UIImage *)renderImage;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 489
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFStamp/CStampPreview.m

@@ -1,489 +0,0 @@
-//
-//  CStampPreview.m
-//  ComPDFKit_Tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import "CStampPreview.h"
-
-#import <ComPDFKit_Tools/CPDFColorUtils.h>
-
-static float c01, c02, c03, c11, c12, c13;
-
-#define kStampPreview_OnlyText_Size     48.0
-#define kStampPreview_Text_Size         30.0
-#define kStampPreview_Date_Size         20.0
-
-@implementation CStampPreview
-
-@synthesize textStampText = _textStampText;
-@synthesize textStampStyle = _textStampStyle;
-@synthesize textStampColorStyle = _textStampColorStyle;
-@synthesize textStampHaveDate = _textStampHaveDate;
-@synthesize textStampHaveTime = _textStampHaveTime;
-@synthesize leftMargin = _leftMargin;
-
-- (instancetype)initWithFrame:(CGRect)frame {
-    self = [super initWithFrame:frame];
-    if (self)
-    {
-        _scale = ([[UIScreen mainScreen] scale] == 2.0) ? 2.0f : 1.0f;
-    }
-    return self;
-}
-
-- (void)setTextStampColorStyle:(NSInteger)TextStampColorStyle {
-    _textStampColorStyle = TextStampColorStyle;
-    if (TextStampColorTypeRed == _textStampColorStyle) {
-        color[0] = 0.57;
-        color[1] = 0.06;
-        color[2] = 0.02;
-    } else if (TextStampColorTypeGreen == _textStampColorStyle) {
-        color[0] = 0.25;
-        color[1] = 0.42;
-        color[2] = 0.13;
-    } else if (TextStampColorTypeBlue == _textStampColorStyle) {
-        color[0] = 0.09;
-        color[1] = 0.15;
-        color[2] = 0.39;
-    } else if (TextStampColorTypeBlack == _textStampColorStyle) {
-        color[0] = 0;
-        color[1] = 0;
-        color[2] = 0;
-    }
-}
-
-- (NSString *)getDateTime {
-    NSTimeZone* timename = [NSTimeZone systemTimeZone];
-    NSDateFormatter *outputFormatter = [[NSDateFormatter alloc] init ];
-    [outputFormatter setTimeZone:timename ];
-    
-    NSString *tDate = nil;
-    if (_textStampHaveDate && !_textStampHaveTime)
-    {
-        [outputFormatter setDateFormat:@"yyyy/MM/dd"];
-        tDate = [outputFormatter stringFromDate:[NSDate date]];
-    }
-    else if (_textStampHaveTime && !_textStampHaveDate)
-    {
-        [outputFormatter setDateFormat:@"HH:mm:ss"];
-        tDate = [outputFormatter stringFromDate:[NSDate date]];
-    }
-    else if (_textStampHaveDate && _textStampHaveTime)
-    {
-        [outputFormatter setDateFormat:@"yyyy/MM/dd HH:mm"];
-        tDate = [outputFormatter stringFromDate:[NSDate date]];
-    }
-    
-    return tDate;
-}
-
-// Draw the fill effect
-static void MyShaderProcedure(void *info, const CGFloat *in, CGFloat *out) {
-    CGFloat v;
-    size_t k, components;
-    
-    components = (size_t)info;
-    
-    v = *in;
-    for (k = 0; k < components -1; k++)
-    {
-        if (0 == k) {
-            *out++ = c01 + v * (c11-c01);
-        }
-        else if (1 == k)
-        {
-            *out++ = c02 + v * (c12-c02);
-        }
-        else if (2 == k) {
-            *out++ = c03 + v * (c13-c03);
-        }
-    }
-    *out++ = 0.85;
-}
-
-// Calculate Rect based on text
-- (void)fitStampRect {
-    UIFont *tTextFont = nil;
-    UIFont *tTimeFont = nil;
-    NSString *drawText = nil;
-    NSString *dateText = nil;
-    
-    if (self.textStampText.length < 1 && !self.dateTime) {
-        drawText = @"StampText";
-        tTextFont = [UIFont fontWithName:@"Helvetica" size:kStampPreview_OnlyText_Size];
-    } else if (self.textStampText.length > 0 && self.dateTime.length > 0) {
-        tTextFont = [UIFont fontWithName:@"Helvetica" size:kStampPreview_Text_Size];
-        tTimeFont = [UIFont fontWithName:@"Helvetica" size:kStampPreview_Date_Size];
-        drawText = self.textStampText;
-        dateText = self.dateTime;
-    } else {
-        if (self.dateTime) {
-            drawText = self.dateTime;
-        } else {
-            drawText = self.textStampText;
-        }
-        tTextFont = [UIFont fontWithName:@"Helvetica" size:kStampPreview_OnlyText_Size];
-    }
-    
-    CGSize tTextSize = [drawText sizeWithAttributes:@{ NSFontAttributeName : tTextFont }];
-    CGSize tTimeSize = CGSizeZero;
-    if (tTimeFont) {
-        tTimeSize = [dateText sizeWithAttributes:@{ NSFontAttributeName : tTimeFont }];
-    }
-    
-    int w = tTextSize.width > tTimeSize.width ? tTextSize.width : tTimeSize.width;
-    int count = 0;
-    for (int i = 0; i < drawText.length; ++i) {
-        NSRange range = NSMakeRange(i,1);
-        NSString *aStr = [drawText substringWithRange:range];
-        if ([aStr isEqualToString:@" "]) {
-            ++count;
-        }
-    }
-    if (tTextSize.width < tTimeSize.width) {
-        w += 15;
-    } else {
-        w += 13 + 5 * count;
-    }
-    
-    int h = tTextSize.height + 5;
-    if (dateText) {
-        h = tTextSize.height + tTimeSize.height + 8.011;
-    }
-    
-    if (_textStampStyle == TextStampTypeLeft) {
-        
-        w = w + h * 0.618033;
-        
-    } else if (_textStampStyle == TextStampTypeRight) {
-        
-        w = w + h * 0.618033;
-    }
-    float x = 0.0;
-    float y = 0.0;
-    
-    _scale = 1.0;
-    CGFloat maxW = 300 - _leftMargin;
-    if (w > maxW ) {
-        _scale = maxW/w;
-        h = h*_scale;
-        x = self.frame.size.width/2.0  - maxW/2.0;
-        y = self.frame.size.height/2.0 - h/2.0;
-        _stampBounds = CGRectMake(x + _leftMargin, y, maxW, h);
-    } else {
-        x = self.frame.size.width/2.0  - w/2.0;
-        y = self.frame.size.height/2.0 - h/2.0;
-        _stampBounds = CGRectMake(x + _leftMargin, y, w, h);
-    }
-}
-
-// Only override drawRect: if you perform custom drawing.
-// An empty implementation adversely affects performance during animation.
-- (void)drawRect:(CGRect)rect {
-    self.dateTime = [self getDateTime];
-    [self fitStampRect];
-
-    CGContextRef context = UIGraphicsGetCurrentContext();
-    CGContextSetFillColorWithColor(context, [CPDFColorUtils CAnnotationSampleDrawBackgoundColor].CGColor);
-    CGContextFillRect(context, self.bounds);
-    // Draw border background
-    if (TextStampTypeNone != _textStampStyle) {
-        [self drawBounder:context];
-    }
-    
-    // Draws custom text
-    [self drawText:context];
-}
-
-- (void)drawBounder:(CGContextRef)context {
-    if (!context) {
-        return;
-    }
-    
-    CGContextSaveGState(context);
-    
-    const CGFunctionCallbacks callbacks = {
-        .version = 0, .evaluate = &MyShaderProcedure, .releaseInfo = NULL
-    };
-    
-    c01 = c02 = c03 = c11 = c12 = c13 = 1.0;
-    if (color[0] > color[1] && color[0] > color[2]) {
-        
-        c01 = 1.0;
-        c02 = 0.78;
-        c03 = 0.78;
-        
-        c11 = 0.98;
-        c12 = 0.92;
-        c13 = 0.91;
-    }
-    else if (color[1] > color[0] && color[1] > color[2]) {
-        
-        c01 = 0.81;
-        c02 = 0.88;
-        c03 = 0.78;
-        
-        c11 = 0.95;
-        c12 = 0.95;
-        c13 = 0.95;
-    }
-    else if (color[2] > color[0] && color[2] > color[1])
-    {
-        c01 = 0.79;
-        c02 = 0.81;
-        c03 = 0.89;
-        
-        c11 = 0.90;
-        c12 = 0.95;
-        c13 = 1.0;
-    }
-
-    size_t components = 1 + CGColorSpaceGetNumberOfComponents(CGColorSpaceCreateDeviceRGB());
-    CGFunctionRef funcRef = CGFunctionCreate((void *) components,
-                                             1,
-                                             (CGFloat[]){0.0f, 1.0f},
-                                             4,
-                                             //(CGFloat[]){0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f},
-                                             (CGFloat[]){c01, c11, c02, c12, c03, c13, 0.0f, 1.0f},
-                                             &callbacks);
-    
-    CGColorSpaceRef colorSpaceRef = CGColorSpaceCreateDeviceRGB();
-    
-    CGShadingRef shadingRef = CGShadingCreateAxial(colorSpaceRef,
-                                                   CGPointMake(_stampBounds.origin.x+_stampBounds.size.width*0.75, _stampBounds.origin.y+_stampBounds.size.width*0.25),
-                                                   CGPointMake(_stampBounds.origin.x+_stampBounds.size.width*0.25, _stampBounds.origin.y+_stampBounds.size.width*0.75),
-                                                   funcRef, true, true);
-    
-    CGColorSpaceRelease(colorSpaceRef);
-    
-    CGFunctionRelease(funcRef);
-    
-    if (_textStampStyle == TextStampTypeCenter) {
-        [self drawNormalRect:context];
-    } else if (_textStampStyle == TextStampTypeLeft) {
-        [self drawLeftBounder:context];
-    } else if (_textStampStyle == TextStampTypeRight) {
-        [self drawRightBounder:context];
-    }
-    CGContextClip (context);
-    
-    CGContextSaveGState(context);
-    CGContextDrawShading(context, shadingRef);
-    CGContextRestoreGState(context);
-    
-    CGShadingRelease(shadingRef);
-    
-    if (_textStampStyle == TextStampTypeCenter) {
-        [self drawNormalRect:context];
-    } else if (_textStampStyle == TextStampTypeLeft) {
-        [self drawLeftBounder:context];
-    } else if (_textStampStyle == TextStampTypeRight) {
-        [self drawRightBounder:context];
-    }
-    CGContextStrokePath(context);
-}
-
-- (void)drawNormalRect:(CGContextRef)context {
-    float tmpHeight = 11.0 * _stampBounds.size.height/50;
-    float tmpWidth = 3.0 * _stampBounds.size.height/50;
-    float hw1 = 5.54492 * _stampBounds.size.height/50;
-    float hw2 = 4.40039 * _stampBounds.size.height/50;
-    
-    CGContextBeginPath (context);
-    
-    CGContextMoveToPoint(context, _stampBounds.origin.x+tmpWidth, _stampBounds.origin.y+_stampBounds.size.height-tmpHeight);
-    
-    CGContextAddCurveToPoint(context, _stampBounds.origin.x+tmpWidth, _stampBounds.origin.y+_stampBounds.size.height-tmpHeight+hw2, _stampBounds.origin.x+tmpHeight-hw1, _stampBounds.origin.y+_stampBounds.size.height-tmpWidth, _stampBounds.origin.x+tmpHeight, _stampBounds.origin.y+_stampBounds.size.height-tmpWidth);
-    
-    CGContextAddLineToPoint(context, _stampBounds.origin.x+_stampBounds.size.width-tmpHeight, _stampBounds.origin.y+_stampBounds.size.height-tmpWidth);
-    
-    CGContextAddCurveToPoint(context, _stampBounds.origin.x+_stampBounds.size.width-tmpHeight+hw1, _stampBounds.origin.y+_stampBounds.size.height-tmpWidth, _stampBounds.origin.x+_stampBounds.size.width-tmpWidth, _stampBounds.origin.y+_stampBounds.size.height-tmpHeight+hw2, _stampBounds.origin.x+_stampBounds.size.width-tmpWidth, _stampBounds.origin.y+_stampBounds.size.height-tmpHeight);
-    
-    CGContextAddLineToPoint(context, _stampBounds.origin.x+_stampBounds.size.width-tmpWidth, _stampBounds.origin.y+tmpHeight);
-    
-    CGContextAddCurveToPoint(context, _stampBounds.origin.x+_stampBounds.size.width-tmpWidth, _stampBounds.origin.y+tmpHeight-hw2, _stampBounds.origin.x+_stampBounds.size.width-tmpHeight+hw1, _stampBounds.origin.y+tmpWidth, _stampBounds.origin.x+_stampBounds.size.width-tmpHeight, _stampBounds.origin.y+tmpWidth);
-    
-    CGContextAddLineToPoint(context,_stampBounds.origin.x+tmpHeight, _stampBounds.origin.y+tmpWidth);
-    
-    CGContextAddCurveToPoint(context, _stampBounds.origin.x+tmpHeight-hw1, _stampBounds.origin.y+tmpWidth, _stampBounds.origin.x+tmpWidth, _stampBounds.origin.y+tmpHeight-hw2, _stampBounds.origin.x+tmpWidth, _stampBounds.origin.y+tmpHeight);
-    
-    CGContextAddLineToPoint(context,_stampBounds.origin.x+tmpWidth, _stampBounds.origin.y+_stampBounds.size.height-tmpHeight);
-    
-    CGContextClosePath (context);
-}
-
-- (void)drawLeftBounder:(CGContextRef)context {
-    float tmpHeight = 11.0 * _stampBounds.size.height/50;
-    float tmpWidth = 3.0 * _stampBounds.size.height/50;
-    float hw1 = 5.54492 * _stampBounds.size.height/50;
-    float hw2 = 4.40039 * _stampBounds.size.height/50;
-    
-    float x0 = _stampBounds.origin.x + _stampBounds.size.height * 0.618033;
-    float y0 = _stampBounds.origin.y;
-    
-    float x1 = _stampBounds.origin.x + _stampBounds.size.width;
-    float y1 = _stampBounds.origin.y + _stampBounds.size.height;
-    
-    float xp = _stampBounds.origin.x;
-    float yp = _stampBounds.origin.y + _stampBounds.size.height / 2.0;
-    
-    CGContextBeginPath (context);
-    
-    CGContextMoveToPoint(context, x0 + tmpHeight, y1 - tmpWidth);
-    CGContextAddLineToPoint(context, x1-tmpHeight, y1-tmpWidth);
-    CGContextAddCurveToPoint(context, x1-tmpHeight+hw1, y1-tmpWidth, x1-tmpWidth, y1-tmpHeight+hw2, x1-tmpWidth, y1-tmpHeight);
-    CGContextAddLineToPoint(context, x1-tmpWidth, y0+tmpHeight);
-    CGContextAddCurveToPoint(context, x1-tmpWidth, y0+tmpHeight-hw2, x1-tmpHeight+hw1, y0+tmpWidth, x1-tmpHeight, y0+tmpWidth);
-    
-    CGContextAddLineToPoint(context, x0+tmpHeight, y0+tmpWidth);
-    CGContextAddLineToPoint(context, xp+tmpHeight, yp);
-    CGContextAddLineToPoint(context, x0+tmpHeight, y1-tmpWidth);
-    
-    CGContextClosePath (context);
-}
-
-- (void)drawRightBounder:(CGContextRef)context {
-    float tmpHeight = 11.0 * _stampBounds.size.height/50;
-    float tmpWidth = 3.0 * _stampBounds.size.height/50;
-    float hw1 = 5.54492 * _stampBounds.size.height/50;
-    float hw2 = 4.40039 * _stampBounds.size.height/50;
-    
-    float x0 = _stampBounds.origin.x;
-    float y0 = _stampBounds.origin.y;
-    
-    float x1 = _stampBounds.origin.x + _stampBounds.size.width - _stampBounds.size.height * 0.618033;
-    float y1 = _stampBounds.origin.y + _stampBounds.size.height;
-    
-    float xp = _stampBounds.origin.x + _stampBounds.size.width;
-    float yp = _stampBounds.origin.y + _stampBounds.size.height / 2.0;
-    
-    CGContextBeginPath (context);
-    
-    CGContextMoveToPoint(context, x0 + tmpWidth, y1 - tmpHeight);
-    CGContextAddCurveToPoint(context, x0+tmpWidth, y1-tmpHeight+hw2, x0+tmpHeight-hw1, y1-tmpWidth, x0+tmpHeight, y1-tmpWidth);
-    CGContextAddLineToPoint(context, x1-tmpHeight, y1-tmpWidth);
-    CGContextAddLineToPoint(context, xp-tmpHeight, yp);
-    CGContextAddLineToPoint(context, x1-tmpHeight, y0+tmpWidth);
-    CGContextAddLineToPoint(context, x0+tmpHeight, y0+tmpWidth);
-    CGContextAddCurveToPoint(context, x0+tmpHeight-hw1, y0+tmpWidth, x0+tmpWidth, y0+tmpHeight-hw2, x0+tmpWidth, y0+tmpHeight);
-    CGContextAddLineToPoint(context, x0+tmpWidth, y1-tmpHeight);
-    
-    CGContextClosePath (context);
-}
-
-- (void)drawText:(CGContextRef)context {
-    if (!context) {
-        return;
-    }
-    
-    CGContextSetTextMatrix(context, CGAffineTransformMakeScale(1.0, -1.0));
-    
-    NSString *drawText = nil;
-    NSString *dateText = nil;
-    
-    if (self.textStampText.length < 1 && !self.dateTime) {
-        drawText = @"StampText";
-    } else if (self.textStampText.length > 0 && self.dateTime.length > 0) {
-        drawText = self.textStampText;
-        dateText = self.dateTime;
-    } else {
-        if (self.dateTime) {
-            drawText = self.dateTime;
-        } else {
-            drawText = self.textStampText;
-        }
-    }
-    
-    if (!dateText) {
-        float fontsize = kStampPreview_OnlyText_Size*_scale;
-        UIFont* font = [UIFont fontWithName:@"Helvetica" size:fontsize];
-        CGRect rt = CGRectInset(_stampBounds, 0, 0);
-        rt.origin.x += 8.093 * _scale;
-        
-        if (_textStampStyle == TextStampTypeLeft) {
-            rt.origin.x += rt.size.height * 0.618033;
-        }
-        
-        UIGraphicsPushContext(context);
-        
-        [[UIColor colorWithRed:color[0] green:color[1] blue:color[2] alpha:1] set];
-        [drawText drawInRect:rt withFont:font lineBreakMode:NSLineBreakByWordWrapping alignment:NSTextAlignmentLeft];
-        UIGraphicsPopContext();
-        
-    } else {
-        float tFontSize = kStampPreview_Text_Size*_scale;
-        UIFont *tFont = [UIFont fontWithName:@"Helvetica" size:tFontSize];
-        
-        CGRect tTextRT = CGRectInset(_stampBounds, 0, 0);
-        tTextRT.origin.x += 8.093 * _scale;
-        
-        if (_textStampStyle == TextStampTypeLeft) {
-            tTextRT.origin.x += tTextRT.size.height * 0.618033;
-        }
-        
-        UIGraphicsPushContext(context);
-        [[UIColor colorWithRed:color[0] green:color[1] blue:color[2] alpha:1] set];
-        if (drawText.length > 0) {
-            [drawText drawInRect:tTextRT withFont:tFont lineBreakMode:NSLineBreakByWordWrapping alignment:NSTextAlignmentLeft];
-            
-            CGRect tDateRT = CGRectInset(_stampBounds, 0, 0);
-            tDateRT.origin.x += 8.093 * _scale;
-            if (_textStampStyle == TextStampTypeLeft) {
-                tDateRT.origin.x += tDateRT.size.height * 0.618033;
-            }
-            tDateRT.origin.y = tDateRT.origin.y + tFontSize + 6.103*_scale;
-            
-            tFontSize = kStampPreview_Date_Size*_scale;
-            tFont = [UIFont fontWithName:@"Helvetica" size:tFontSize];
-            
-            [[UIColor colorWithRed:color[0] green:color[1] blue:color[2] alpha:1] set];
-            [dateText drawInRect:tDateRT withFont:tFont lineBreakMode:NSLineBreakByWordWrapping alignment:NSTextAlignmentLeft];
-        } else {
-            float fontsize = kStampPreview_Date_Size*_scale;
-            UIFont* font = [UIFont fontWithName:@"Helvetica" size:fontsize];
-            
-            CGRect rt = CGRectInset(_stampBounds, 0, 0);
-            rt.origin.x += 8.093 * _scale;
-            
-            if (_textStampStyle == TextStampTypeLeft) {
-                rt.origin.x += rt.size.height * 0.618033;
-            }
-            
-            [[UIColor colorWithRed:color[0] green:color[1] blue:color[2] alpha:1] set];
-            [dateText drawInRect:rt withFont:font lineBreakMode:NSLineBreakByWordWrapping alignment:NSTextAlignmentLeft];
-        }
-        
-        UIGraphicsPopContext();
-    }
-}
-
-- (UIImage *)renderImage
-{
-    UIImage *image = [self renderImageFromView:self];
-    return image;
-}
-
-/* Convert UIView to UIImage */
-- (UIImage *)renderImageFromView:(UIView *)view
-{
-    UIGraphicsBeginImageContextWithOptions(view.bounds.size, NO, 1.0);
-    
-    CGContextRef context=UIGraphicsGetCurrentContext();
-    CGContextTranslateCTM(context, 1.0, 1.0);
-    
-    [view.layer renderInContext:context];
-    
-    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
-    UIGraphicsEndImageContext();
-    
-    return image;
-}
-
-@end

+ 0 - 0
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationProperties/PDFStamp/CStampShapView.h


Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels