Browse Source

PDFAnnotation(iOS) - 注释项目的框架搭建

yangliuhua 1 year ago
parent
commit
d9a4e7000a
76 changed files with 1879 additions and 0 deletions
  1. 452 0
      Annotation-Ctrl-Demo/Annotation-Ctrl-Demo.xcodeproj/project.pbxproj
  2. 7 0
      Annotation-Ctrl-Demo/Annotation-Ctrl-Demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  3. 8 0
      Annotation-Ctrl-Demo/Annotation-Ctrl-Demo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
  4. 14 0
      Annotation-Ctrl-Demo/Annotation-Ctrl-Demo.xcodeproj/xcuserdata/kdanmobile_2.xcuserdatad/xcschemes/xcschememanagement.plist
  5. 24 0
      Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/AppDelegate.h
  6. 108 0
      Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/AppDelegate.m
  7. 11 0
      Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/Assets.xcassets/AccentColor.colorset/Contents.json
  8. 14 0
      Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/Assets.xcassets/AppIcon.appiconset/Contents.json
  9. BIN
      Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/Assets.xcassets/AppIcon.appiconset/icon-1024.png
  10. 6 0
      Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/Assets.xcassets/Contents.json
  11. 25 0
      Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/Base.lproj/LaunchScreen.storyboard
  12. 30 0
      Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/Base.lproj/Main.storyboard
  13. 27 0
      Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/CPDFViewController.h
  14. 271 0
      Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/CPDFViewController.m
  15. 23 0
      Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/Info.plist
  16. 20 0
      Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/SceneDelegate.h
  17. 63 0
      Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/SceneDelegate.m
  18. 18 0
      Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/main.m
  19. 3 0
      compdfkit-demo.xcworkspace/contents.xcworkspacedata
  20. 28 0
      compdfkit-tools/compdfkit-tools.xcodeproj/project.pbxproj
  21. 56 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/CPDFAnnotationBar.h
  22. 186 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/CPDFAnnotationBar.m
  23. 20 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/CPDFAnnotationBarButton.h
  24. 45 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/CPDFAnnotationBarButton.m
  25. 22 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageFreeText.imageset/Contents.json
  26. BIN
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageFreeText.imageset/btn_typewrite.png
  27. BIN
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageFreeText.imageset/btn_typewrite@2x.png
  28. 22 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageFreehand.imageset/Contents.json
  29. BIN
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageFreehand.imageset/btn_freehand1.png
  30. BIN
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageFreehand.imageset/btn_freehand1@2x.png
  31. 22 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageHighLight.imageset/Contents.json
  32. BIN
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageHighLight.imageset/btn_t1.png
  33. BIN
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageHighLight.imageset/btn_t1@2x.png
  34. 22 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageImage.imageset/Contents.json
  35. BIN
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageImage.imageset/btn_photo01.png
  36. BIN
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageImage.imageset/btn_photo01@2x.png
  37. 22 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageLink.imageset/Contents.json
  38. BIN
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageLink.imageset/btn_link_01.png
  39. BIN
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageLink.imageset/btn_link_01@2x.png
  40. 22 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageNote.imageset/Contents.json
  41. BIN
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageNote.imageset/btn_note01.png
  42. BIN
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageNote.imageset/btn_note01@2x.png
  43. 21 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageProperties.imageset/Contents.json
  44. 1 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageProperties.imageset/iconmonstr-pencil-text-filled.svg
  45. 20 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageRedo.imageset/Contents.json
  46. 22 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageShapeArrow.imageset/Contents.json
  47. BIN
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageShapeArrow.imageset/shape3.png
  48. BIN
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageShapeArrow.imageset/shape3@2x.png
  49. 22 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageShapeCircle.imageset/Contents.json
  50. BIN
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageShapeCircle.imageset/shape4.png
  51. BIN
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageShapeCircle.imageset/shape4@2x.png
  52. 22 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageShapeLine.imageset/Contents.json
  53. BIN
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageShapeLine.imageset/shape1.png
  54. BIN
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageShapeLine.imageset/shape1@2x.png
  55. 22 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageShapeRectangle.imageset/Contents.json
  56. BIN
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageShapeRectangle.imageset/shape2.png
  57. BIN
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageShapeRectangle.imageset/shape2@2x.png
  58. 22 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageSignature.imageset/Contents.json
  59. BIN
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageSignature.imageset/btn_sign1.png
  60. BIN
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageSignature.imageset/btn_sign1@2x.png
  61. 21 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageSound.imageset/Contents.json
  62. 1 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageSound.imageset/iconmonstr-sound-thin.svg
  63. 22 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageSquiggly.imageset/Contents.json
  64. BIN
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageSquiggly.imageset/squiggly.png
  65. BIN
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageSquiggly.imageset/squiggly@2x.png
  66. 22 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageStamp.imageset/Contents.json
  67. BIN
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageStamp.imageset/btn_stamp_01.png
  68. BIN
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageStamp.imageset/btn_stamp_01@2x.png
  69. 22 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageStrikeout.imageset/Contents.json
  70. BIN
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageStrikeout.imageset/strikeout.png
  71. BIN
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageStrikeout.imageset/strikeout@2x.png
  72. 22 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageUnderline.imageset/Contents.json
  73. BIN
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageUnderline.imageset/underline.png
  74. BIN
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageUnderline.imageset/underline@2x.png
  75. 20 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageUndo.imageset/Contents.json
  76. 6 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/Contents.json

+ 452 - 0
Annotation-Ctrl-Demo/Annotation-Ctrl-Demo.xcodeproj/project.pbxproj

@@ -0,0 +1,452 @@
+// !$*UTF8*$!
+{
+	archiveVersion = 1;
+	classes = {
+	};
+	objectVersion = 56;
+	objects = {
+
+/* Begin PBXBuildFile section */
+		C9AF185129F267DD00EC4979 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C9AF185029F267DD00EC4979 /* AppDelegate.m */; };
+		C9AF185429F267DD00EC4979 /* SceneDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C9AF185329F267DD00EC4979 /* SceneDelegate.m */; };
+		C9AF185729F267DD00EC4979 /* CPDFViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C9AF185629F267DD00EC4979 /* CPDFViewController.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 */; };
+		C9AF187429F26AD200EC4979 /* SDKLicense.xml in Resources */ = {isa = PBXBuildFile; fileRef = C9AF187129F26AD200EC4979 /* SDKLicense.xml */; };
+		C9AF187529F26AD200EC4979 /* XPDXMLElement.m in Sources */ = {isa = PBXBuildFile; fileRef = C9AF187229F26AD200EC4979 /* XPDXMLElement.m */; };
+		C9AF187629F26AD200EC4979 /* XMLParseManager.m in Sources */ = {isa = PBXBuildFile; fileRef = C9AF187329F26AD200EC4979 /* XMLParseManager.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 */; };
+		C9AF187E29F26ADF00EC4979 /* 1126 一鍵移轉 Migrating files with one tap.pdf in Resources */ = {isa = PBXBuildFile; fileRef = C9AF187A29F26ADF00EC4979 /* 1126 一鍵移轉 Migrating files with one tap.pdf */; };
+		C9AF187F29F26ADF00EC4979 /* Quick Start Guide.pdf in Resources */ = {isa = PBXBuildFile; fileRef = C9AF187B29F26ADF00EC4979 /* Quick Start Guide.pdf */; };
+		C9AF188229F26B4D00EC4979 /* compdfkit_tools.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C9AF188129F26B4D00EC4979 /* compdfkit_tools.framework */; };
+		C9AF188329F26B4D00EC4979 /* compdfkit_tools.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C9AF188129F26B4D00EC4979 /* compdfkit_tools.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
+		C9AF188629F26B5800EC4979 /* ComPDFKit.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = C9AF188529F26B5800EC4979 /* ComPDFKit.xcframework */; };
+		C9AF188729F26B5800EC4979 /* ComPDFKit.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C9AF188529F26B5800EC4979 /* ComPDFKit.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
+/* End PBXBuildFile section */
+
+/* Begin PBXCopyFilesBuildPhase section */
+		C9AF188429F26B4D00EC4979 /* Embed Frameworks */ = {
+			isa = PBXCopyFilesBuildPhase;
+			buildActionMask = 2147483647;
+			dstPath = "";
+			dstSubfolderSpec = 10;
+			files = (
+				C9AF188329F26B4D00EC4979 /* compdfkit_tools.framework in Embed Frameworks */,
+				C9AF188729F26B5800EC4979 /* ComPDFKit.xcframework in Embed Frameworks */,
+			);
+			name = "Embed Frameworks";
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXCopyFilesBuildPhase section */
+
+/* Begin PBXFileReference section */
+		C9AF184C29F267DD00EC4979 /* Annotation-Ctrl-Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Annotation-Ctrl-Demo.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>"; };
+		C9AF185529F267DD00EC4979 /* CPDFViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFViewController.h; sourceTree = "<group>"; };
+		C9AF185629F267DD00EC4979 /* CPDFViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFViewController.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>"; };
+		C9AF186F29F26AD200EC4979 /* XPDXMLElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPDXMLElement.h; sourceTree = "<group>"; };
+		C9AF187029F26AD200EC4979 /* XMLParseManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLParseManager.h; sourceTree = "<group>"; };
+		C9AF187129F26AD200EC4979 /* SDKLicense.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = SDKLicense.xml; sourceTree = "<group>"; };
+		C9AF187229F26AD200EC4979 /* XPDXMLElement.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XPDXMLElement.m; sourceTree = "<group>"; };
+		C9AF187329F26AD200EC4979 /* XMLParseManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XMLParseManager.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>"; };
+		C9AF187A29F26ADF00EC4979 /* 1126 一鍵移轉 Migrating files with one tap.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = "1126 一鍵移轉 Migrating files with one tap.pdf"; sourceTree = "<group>"; };
+		C9AF187B29F26ADF00EC4979 /* Quick Start Guide.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = "Quick Start Guide.pdf"; sourceTree = "<group>"; };
+		C9AF188129F26B4D00EC4979 /* compdfkit_tools.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = compdfkit_tools.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+		C9AF188529F26B5800EC4979 /* ComPDFKit.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = ComPDFKit.xcframework; path = "/Users/kdanmobile_2/项目/demo-sdk/compdfkit-tools/../Lib/ComPDFKit.xcframework"; sourceTree = "<absolute>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+		C9AF184929F267DD00EC4979 /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				C9AF188229F26B4D00EC4979 /* compdfkit_tools.framework in Frameworks */,
+				C9AF188629F26B5800EC4979 /* ComPDFKit.xcframework in Frameworks */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+		C9AF184329F267DD00EC4979 = {
+			isa = PBXGroup;
+			children = (
+				C9AF187729F26ADF00EC4979 /* TestFile */,
+				C9AF186E29F26AD200EC4979 /* SDKLicense */,
+				C9AF184E29F267DD00EC4979 /* Annotation-Ctrl-Demo */,
+				C9AF184D29F267DD00EC4979 /* Products */,
+				C9AF188029F26B4D00EC4979 /* Frameworks */,
+			);
+			sourceTree = "<group>";
+		};
+		C9AF184D29F267DD00EC4979 /* Products */ = {
+			isa = PBXGroup;
+			children = (
+				C9AF184C29F267DD00EC4979 /* Annotation-Ctrl-Demo.app */,
+			);
+			name = Products;
+			sourceTree = "<group>";
+		};
+		C9AF184E29F267DD00EC4979 /* Annotation-Ctrl-Demo */ = {
+			isa = PBXGroup;
+			children = (
+				C9AF184F29F267DD00EC4979 /* AppDelegate.h */,
+				C9AF185029F267DD00EC4979 /* AppDelegate.m */,
+				C9AF185229F267DD00EC4979 /* SceneDelegate.h */,
+				C9AF185329F267DD00EC4979 /* SceneDelegate.m */,
+				C9AF185529F267DD00EC4979 /* CPDFViewController.h */,
+				C9AF185629F267DD00EC4979 /* CPDFViewController.m */,
+				C9AF185829F267DD00EC4979 /* Main.storyboard */,
+				C9AF185B29F267E000EC4979 /* Assets.xcassets */,
+				C9AF185D29F267E000EC4979 /* LaunchScreen.storyboard */,
+				C9AF186029F267E000EC4979 /* Info.plist */,
+				C9AF186129F267E000EC4979 /* main.m */,
+			);
+			path = "Annotation-Ctrl-Demo";
+			sourceTree = "<group>";
+		};
+		C9AF186E29F26AD200EC4979 /* SDKLicense */ = {
+			isa = PBXGroup;
+			children = (
+				C9AF187129F26AD200EC4979 /* SDKLicense.xml */,
+				C9AF187029F26AD200EC4979 /* XMLParseManager.h */,
+				C9AF187329F26AD200EC4979 /* XMLParseManager.m */,
+				C9AF186F29F26AD200EC4979 /* XPDXMLElement.h */,
+				C9AF187229F26AD200EC4979 /* XPDXMLElement.m */,
+			);
+			name = SDKLicense;
+			path = ../SDKLicense;
+			sourceTree = "<group>";
+		};
+		C9AF187729F26ADF00EC4979 /* TestFile */ = {
+			isa = PBXGroup;
+			children = (
+				C9AF187829F26ADF00EC4979 /* Form_Widgets_Test.pdf */,
+				C9AF187929F26ADF00EC4979 /* PDF32000_2008.pdf */,
+				C9AF187A29F26ADF00EC4979 /* 1126 一鍵移轉 Migrating files with one tap.pdf */,
+				C9AF187B29F26ADF00EC4979 /* Quick Start Guide.pdf */,
+			);
+			name = TestFile;
+			path = ../TestFile;
+			sourceTree = "<group>";
+		};
+		C9AF188029F26B4D00EC4979 /* Frameworks */ = {
+			isa = PBXGroup;
+			children = (
+				C9AF188529F26B5800EC4979 /* ComPDFKit.xcframework */,
+				C9AF188129F26B4D00EC4979 /* compdfkit_tools.framework */,
+			);
+			name = Frameworks;
+			sourceTree = "<group>";
+		};
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+		C9AF184B29F267DD00EC4979 /* Annotation-Ctrl-Demo */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = C9AF186529F267E000EC4979 /* Build configuration list for PBXNativeTarget "Annotation-Ctrl-Demo" */;
+			buildPhases = (
+				C9AF184829F267DD00EC4979 /* Sources */,
+				C9AF184929F267DD00EC4979 /* Frameworks */,
+				C9AF184A29F267DD00EC4979 /* Resources */,
+				C9AF188429F26B4D00EC4979 /* Embed Frameworks */,
+			);
+			buildRules = (
+			);
+			dependencies = (
+			);
+			name = "Annotation-Ctrl-Demo";
+			productName = "Annotation-Ctrl-Demo";
+			productReference = C9AF184C29F267DD00EC4979 /* Annotation-Ctrl-Demo.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 "Annotation-Ctrl-Demo" */;
+			compatibilityVersion = "Xcode 14.0";
+			developmentRegion = en;
+			hasScannedForEncodings = 0;
+			knownRegions = (
+				en,
+				Base,
+			);
+			mainGroup = C9AF184329F267DD00EC4979;
+			productRefGroup = C9AF184D29F267DD00EC4979 /* Products */;
+			projectDirPath = "";
+			projectRoot = "";
+			targets = (
+				C9AF184B29F267DD00EC4979 /* Annotation-Ctrl-Demo */,
+			);
+		};
+/* 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 */,
+				C9AF185C29F267E000EC4979 /* Assets.xcassets in Resources */,
+				C9AF187429F26AD200EC4979 /* SDKLicense.xml in Resources */,
+				C9AF185A29F267DD00EC4979 /* Main.storyboard in Resources */,
+				C9AF187E29F26ADF00EC4979 /* 1126 一鍵移轉 Migrating files with one tap.pdf in Resources */,
+				C9AF187F29F26ADF00EC4979 /* Quick Start Guide.pdf in Resources */,
+				C9AF187D29F26ADF00EC4979 /* PDF32000_2008.pdf in Resources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+		C9AF184829F267DD00EC4979 /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				C9AF187529F26AD200EC4979 /* XPDXMLElement.m in Sources */,
+				C9AF185729F267DD00EC4979 /* CPDFViewController.m in Sources */,
+				C9AF185129F267DD00EC4979 /* AppDelegate.m in Sources */,
+				C9AF187629F26AD200EC4979 /* XMLParseManager.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;
+				CODE_SIGN_STYLE = Automatic;
+				CURRENT_PROJECT_VERSION = 1;
+				DEVELOPMENT_TEAM = Q43DRF894U;
+				GENERATE_INFOPLIST_FILE = YES;
+				INFOPLIST_FILE = "Annotation-Ctrl-Demo/Info.plist";
+				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.demo.annotation;
+				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;
+				CODE_SIGN_STYLE = Automatic;
+				CURRENT_PROJECT_VERSION = 1;
+				DEVELOPMENT_TEAM = Q43DRF894U;
+				GENERATE_INFOPLIST_FILE = YES;
+				INFOPLIST_FILE = "Annotation-Ctrl-Demo/Info.plist";
+				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.demo.annotation;
+				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 "Annotation-Ctrl-Demo" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				C9AF186329F267E000EC4979 /* Debug */,
+				C9AF186429F267E000EC4979 /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+		C9AF186529F267E000EC4979 /* Build configuration list for PBXNativeTarget "Annotation-Ctrl-Demo" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				C9AF186629F267E000EC4979 /* Debug */,
+				C9AF186729F267E000EC4979 /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+/* End XCConfigurationList section */
+	};
+	rootObject = C9AF184429F267DD00EC4979 /* Project object */;
+}

+ 7 - 0
Annotation-Ctrl-Demo/Annotation-Ctrl-Demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+   version = "1.0">
+   <FileRef
+      location = "self:">
+   </FileRef>
+</Workspace>

+ 8 - 0
Annotation-Ctrl-Demo/Annotation-Ctrl-Demo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist

@@ -0,0 +1,8 @@
+<?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>IDEDidComputeMac32BitWarning</key>
+	<true/>
+</dict>
+</plist>

+ 14 - 0
Annotation-Ctrl-Demo/Annotation-Ctrl-Demo.xcodeproj/xcuserdata/kdanmobile_2.xcuserdatad/xcschemes/xcschememanagement.plist

@@ -0,0 +1,14 @@
+<?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>SchemeUserState</key>
+	<dict>
+		<key>Annotation-Ctrl-Demo.xcscheme_^#shared#^_</key>
+		<dict>
+			<key>orderHint</key>
+			<integer>2</integer>
+		</dict>
+	</dict>
+</dict>
+</plist>

+ 24 - 0
Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/AppDelegate.h

@@ -0,0 +1,24 @@
+//
+//  AppDelegate.h
+//  Annotation-Ctrl-Demo
+//
+//  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
+

+ 108 - 0
Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/AppDelegate.m

@@ -0,0 +1,108 @@
+//
+//  AppDelegate.m
+//  Annotation-Ctrl-Demo
+//
+//  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 "XMLParseManager.h"
+
+static AppDelegate *appDelegate = NULL;
+
+@interface AppDelegate ()
+
+@property (nonatomic, strong) UIWindow *window;
+
+@property (nonatomic, strong) XMLParseManager *manager;
+
+@end
+
+
+@implementation AppDelegate
+
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
+    // Override point for customization after application launch.
+    NSString *path = [[NSBundle mainBundle]pathForResource:@"SDKLicense" ofType:@"xml"];
+    NSURL *url = [NSURL fileURLWithPath:path];
+    _manager = [[XMLParseManager alloc]init];
+    [_manager parseXMLWithURL:url completion:^(BOOL SUC, XPDXMLElement *data,NSError *error) {
+        if (SUC) {
+            NSDictionary * attribute = data.attribute;
+            NSString * key = attribute[@"key"];
+            NSString * secret = attribute[@"secret"];
+            [CPDFKit setLicenseKey:key secret:secret];
+            
+            if (@available(iOS 13.0, *)) {
+                
+            } else {
+                UIWindow *windows = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
+                [self configWindow:windows];
+
+            }
+            
+        }else{
+            NSLog(@"error = %@",error);
+        }
+    }];
+
+    return YES;
+}
+
+- (void)configWindow:(UIWindow *)window {
+    self.window = window;
+    self.window.backgroundColor = [UIColor whiteColor];
+    
+    NSString *tBundleFilePath = [[NSBundle mainBundle] pathForResource:@"PDF32000_2008" ofType:@"pdf"];
+    
+    NSString *docsFolder = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES).firstObject;
+    NSString * filePath = [docsFolder stringByAppendingPathComponent:tBundleFilePath.lastPathComponent];
+    
+    [[NSFileManager defaultManager] copyItemAtPath:tBundleFilePath toPath:filePath error:nil];
+    
+    CPDFViewController *pdfViewController = [[CPDFViewController alloc] initWithFilePath:filePath];
+    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

+ 11 - 0
Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/Assets.xcassets/AccentColor.colorset/Contents.json

@@ -0,0 +1,11 @@
+{
+  "colors" : [
+    {
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 14 - 0
Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/Assets.xcassets/AppIcon.appiconset/Contents.json

@@ -0,0 +1,14 @@
+{
+  "images" : [
+    {
+      "filename" : "icon-1024.png",
+      "idiom" : "universal",
+      "platform" : "ios",
+      "size" : "1024x1024"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/Assets.xcassets/AppIcon.appiconset/icon-1024.png


+ 6 - 0
Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/Assets.xcassets/Contents.json

@@ -0,0 +1,6 @@
+{
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 25 - 0
Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/Base.lproj/LaunchScreen.storyboard

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
+    <dependencies>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <scenes>
+        <!--View Controller-->
+        <scene sceneID="EHf-IW-A2E">
+            <objects>
+                <viewController id="01J-lp-oVM" sceneMemberID="viewController">
+                    <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
+                        <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
+                        <viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
+                    </view>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="53" y="375"/>
+        </scene>
+    </scenes>
+</document>

+ 30 - 0
Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/Base.lproj/Main.storyboard

@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
+    <dependencies>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="System colors in document resources" minToolsVersion="11.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <scenes>
+        <!--View Controller-->
+        <scene sceneID="tne-QT-ifu">
+            <objects>
+                <viewController id="BYZ-38-t0r" customClass="ViewController" sceneMemberID="viewController">
+                    <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
+                        <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
+                        <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                    </view>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
+            </objects>
+        </scene>
+    </scenes>
+    <resources>
+        <systemColor name="systemBackgroundColor">
+            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
+    </resources>
+</document>

+ 27 - 0
Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/CPDFViewController.h

@@ -0,0 +1,27 @@
+//
+//  ViewController.h
+//  Annotation-Ctrl-Demo
+//
+//  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 CPDFViewController : UIViewController
+
+@property(nonatomic, readonly) NSString *filePath;
+
+- (instancetype)initWithFilePath:(NSString *)filePath;
+
+- (void)reloadDocumentWithFilePath:(NSString *)filePath completion:(void (^)(BOOL result))completion;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 271 - 0
Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/CPDFViewController.m

@@ -0,0 +1,271 @@
+//
+//  ViewController.m
+//  Annotation-Ctrl-Demo
+//
+//  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>
+
+@interface CPDFViewController () <UISearchBarDelegate,CPDFViewDelegate,CPDFListViewDelegate, CPDFMoreListViewDelegate, CSearchToolbarDelegate, CPDFDisplayViewDelegate, CPDFBOTAViewControllerDelegate,CPDFSearchResultsDelegate,CPDFThumbnailViewControllerDelegate>
+
+@property(nonatomic, strong) NSString *filePath;
+
+@property(nonatomic, strong) CPDFListView *pdfListView;
+
+@property(nonatomic, strong) CNavigationRightView *rightView;
+
+@property(nonatomic, strong) CSearchToolbar *searchToolbar;
+
+@property(nonatomic, strong) CActivityIndicatorView *loadingView;
+
+@property(nonatomic, strong) NSString *navigationTitle;
+
+@end
+
+@implementation CPDFViewController
+
+#pragma mark - Initializers
+
+- (instancetype)initWithFilePath:(NSString *)filePath {
+    if(self = [super init]) {
+        _filePath = filePath;
+    }
+    return self;
+}
+
+#pragma mark ViewController Methods
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view.
+    
+    self.view.backgroundColor = [CPDFColorUtils CPDFViewControllerBackgroundColor];
+    
+    self.pdfListView = [[CPDFListView alloc] initWithFrame:self.view.bounds];
+    self.pdfListView.performDelegate = self;
+    self.pdfListView.delegate = self;
+    self.pdfListView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
+    [self.view addSubview:self.pdfListView];
+    
+    UIBarButtonItem *leftItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"CPDFThunbnailImageEnter" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] style:UIBarButtonItemStylePlain target:self action:@selector(buttonItemClicked_thumbnail:)];
+    self.navigationItem.leftBarButtonItem = leftItem;
+    
+    __block typeof(self) blockSelf = self;
+    
+    self.rightView = [[CNavigationRightView alloc] initWithDefaultItemsClickBack:^(NSUInteger tag) {
+        switch (tag) {
+            case CNavigationRightTypeSearch:
+                [blockSelf navigationRightItemSearch];
+                break;
+            case CNavigationRightTypeBota:
+                [blockSelf navigationRightItemBota];
+                break;
+            default:
+            case CNavigationRightTypeMore:
+                [blockSelf navigationRightItemMore];
+                break;
+        }
+        
+    }];
+    
+    self.searchToolbar = [[CSearchToolbar alloc] initWithPDFView:self.pdfListView];
+    self.searchToolbar.delegate = self;
+    
+    [self reloadDocumentWithFilePath:self.filePath completion:^(BOOL result) {
+        
+    }];
+}
+
+- (void)viewWillLayoutSubviews {
+    [super viewWillLayoutSubviews];
+    
+    if (@available(iOS 11.0, *)) {
+        self.pdfListView.frame = CGRectMake(self.view.safeAreaInsets.left, self.view.safeAreaInsets.top, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, self.view.frame.size.height - self.view.safeAreaInsets.bottom- self.view.safeAreaInsets.top);
+    } else {
+        self.pdfListView.frame = self.view.bounds;
+    }
+}
+
+#pragma mark - Public method
+
+- (void)reloadDocumentWithFilePath:(NSString *)filePath completion:(void (^)(BOOL result))completion {
+    
+    self.title = [[filePath lastPathComponent] stringByDeletingPathExtension];
+    _navigationTitle = self.title;
+    [self.navigationController.view setUserInteractionEnabled:NO];
+    
+    if (![self.loadingView superview]) {
+        [self.view addSubview:self.loadingView];
+    }
+    [self.loadingView startAnimating];
+    
+    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+        NSURL *url = [NSURL fileURLWithPath:filePath];
+        CPDFDocument *document = [[CPDFDocument alloc] initWithURL:url];
+        dispatch_async(dispatch_get_main_queue(), ^{
+            [self.navigationController.view setUserInteractionEnabled:YES];
+            [self.loadingView stopAnimating];
+            [self.loadingView removeFromSuperview];
+            
+            if (document.error && document.error.code != CPDFDocumentPasswordError) {
+                UIAlertAction *okAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+                    [self.navigationController popViewControllerAnimated:YES];
+                }];
+                UIAlertController *alert = [UIAlertController alertControllerWithTitle:@""
+                                                                               message:NSLocalizedString(@"Sorry PDF Reader Can't open this pdf file!", nil)
+                                                                        preferredStyle:UIAlertControllerStyleAlert];
+                [alert addAction:okAction];
+                if (completion) {
+                    completion(NO);
+                }
+            } else {
+                self.pdfListView.document = document;
+                if (completion) {
+                    completion(YES);
+                }
+            }
+        });
+    });
+}
+
+#pragma mark - Action
+
+- (void)navigationRightItemSearch {
+    [self.searchToolbar showInView:self.navigationController.navigationBar];
+    self.title = nil;
+    self.navigationItem.rightBarButtonItem = nil;
+}
+
+- (void)navigationRightItemBota {
+    CPDFBOTAViewController *botaViewController = [[CPDFBOTAViewController alloc] initWithPDFView:self.pdfListView];
+    botaViewController.delegate = self;
+    [self.navigationController pushViewController:botaViewController animated:NO];
+}
+
+- (void)navigationRightItemMore {
+    CPDFMoreListViewController * moreListVc = [[CPDFMoreListViewController alloc] init];
+    moreListVc.delegate = self;
+    [self.navigationController pushViewController:moreListVc animated:YES];
+}
+
+- (void)buttonItemClicked_thumbnail:(id)sender {
+    CPDFThumbnailViewController *thumbnailViewController = [[CPDFThumbnailViewController alloc] initWithPDFView:self.pdfListView];
+    thumbnailViewController.delegate = self;
+    [self.navigationController pushViewController:thumbnailViewController animated:NO];
+}
+
+- (void)menuItemClick_CopyAction:(id)sender {
+    if (self.pdfListView.currentSelection.string)
+        [[UIPasteboard generalPasteboard] setString:self.pdfListView.currentSelection.string];
+    
+    [self.pdfListView clearSelection];
+}
+
+#pragma mark - CPDFViewDelegate
+
+- (void)PDFViewDocumentDidLoaded:(CPDFView *)pdfView {
+    UIBarButtonItem* rightItem = [[UIBarButtonItem alloc] initWithCustomView:self.rightView];
+    self.navigationItem.rightBarButtonItem = rightItem;
+}
+
+- (void)PDFViewCurrentPageDidChanged:(CPDFView *)pdfView {
+}
+
+#pragma mark - CPDFListViewDelegate
+
+- (NSArray<UIMenuItem *> *)PDFListView:(CPDFListView *)pdfListView customizeMenuForPage:(CPDFPage *)page forPagePoint:(CGPoint)pagePoint {
+    if (pdfListView.currentSelection) {
+        UIMenuItem *copyItem = [[UIMenuItem alloc] initWithTitle:NSLocalizedString(@"Copy", nil)
+                                                          action:@selector(menuItemClick_CopyAction:)];
+        return @[copyItem];
+    }
+    return nil;
+}
+
+#pragma mark - CPDFMorelistViewDelegate
+
+- (void)PDFMoreListViewController:(CPDFMoreListViewController *)moreVC didSelectRow:(CPDFMoreListViewType)row {
+    if(CPDFMoreListViewTypeInfo == row){
+        //File Info
+        CPDFInfoViewController * infoVc = [[CPDFInfoViewController alloc] initWithPDFView:self.pdfListView];
+        [self.navigationController pushViewController:infoVc animated:YES];
+    } else {
+        CPDFDisplayViewController *displayVc = [[CPDFDisplayViewController alloc] initWithPDFView:self.pdfListView];
+        displayVc.delegate = self;
+        [self.navigationController pushViewController:displayVc animated:NO];
+    }
+}
+
+#pragma mark - CSearchToolbarDelegate
+
+- (void)searchToolbar:(CSearchToolbar *)searchToolbar onSearchQueryResults:(NSArray *)results {
+    if ([results count] < 1) {
+        UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil)
+                                                               style:UIAlertActionStyleCancel
+                                                             handler:nil];
+        UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil
+                                                                       message:NSLocalizedString(@"your have‘t search result", nil)
+                                                                preferredStyle:UIAlertControllerStyleAlert];
+        [alert addAction:cancelAction];
+        [self presentViewController:alert animated:YES completion:nil];
+        return;
+    }
+    [self searchToolbarOnExitSearch:searchToolbar];
+    
+    CPDFSearchResultsViewController* searchResultController = [[CPDFSearchResultsViewController alloc] initWithResultArray:results keyword:searchToolbar.searchKeyString document:self.pdfListView.document];
+    searchResultController.delegate = self;
+    [self.navigationController pushViewController:searchResultController animated:YES];
+}
+
+- (void)searchToolbarOnExitSearch:(CSearchToolbar *)searchToolbar {
+    if([searchToolbar superview]) {
+        [searchToolbar removeFromSuperview];
+        UIBarButtonItem *rightItem = [[UIBarButtonItem alloc] initWithCustomView:self.rightView];
+        self.navigationItem.rightBarButtonItem = rightItem;
+        self.title = self.navigationTitle;
+    }
+}
+
+#pragma mark - CPDFDisplayViewDelegate
+
+- (void)displayViewControllerDismiss:(CPDFDisplayViewController *)displayViewController {
+    [self.navigationController popToRootViewControllerAnimated:YES];
+}
+
+#pragma mark - CPDFBOTAViewControllerDelegate
+
+- (void)botaViewControllerDismiss:(CPDFBOTAViewController *)botaViewController {
+    [self.navigationController popViewControllerAnimated:YES];
+}
+
+#pragma mark - CPDFSearchResultsDelegate
+
+- (void)searchResultsView:(CPDFSearchResultsViewController *)resultVC forSelection:(CPDFSelection *)selection indexPath:(NSIndexPath *)indexPath {
+    [self.navigationController popViewControllerAnimated:YES];
+    
+    NSInteger pageIndex = [self.pdfListView.document indexForPage:selection.page];
+    [self.pdfListView goToPageIndex:pageIndex animated:NO];
+    [self.pdfListView setHighlightedSelection:selection animated:YES];
+}
+
+-(void)searchResultsViewControllerDismiss:(CPDFSearchResultsViewController *)searchResultsViewController {
+    [self.navigationController popViewControllerAnimated:YES];
+}
+
+#pragma mark - CPDFThumbnailViewControllerDelegate
+
+- (void)thumbnailViewController:(CPDFThumbnailViewController *)thumbnailViewController pageIndex:(NSInteger)pageIndex {
+    [self.pdfListView goToPageIndex:pageIndex animated:NO];
+    [self.navigationController popViewControllerAnimated:YES];
+}
+
+@end

+ 23 - 0
Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/Info.plist

@@ -0,0 +1,23 @@
+<?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>

+ 20 - 0
Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/SceneDelegate.h

@@ -0,0 +1,20 @@
+//
+//  SceneDelegate.h
+//  Annotation-Ctrl-Demo
+//
+//  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
+

+ 63 - 0
Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/SceneDelegate.m

@@ -0,0 +1,63 @@
+//
+//  SceneDelegate.m
+//  Annotation-Ctrl-Demo
+//
+//  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

+ 18 - 0
Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/main.m

@@ -0,0 +1,18 @@
+//
+//  main.m
+//  Annotation-Ctrl-Demo
+//
+//  Created by kdanmobile_2 on 2023/4/21.
+//
+
+#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);
+}

+ 3 - 0
compdfkit-demo.xcworkspace/contents.xcworkspacedata

@@ -1,6 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Workspace
    version = "1.0">
+   <FileRef
+      location = "group:Annotation-Ctrl-Demo/Annotation-Ctrl-Demo.xcodeproj">
+   </FileRef>
    <FileRef
       location = "group:viewer-ctrl-demo/viewer-ctrl-demo.xcodeproj">
    </FileRef>

+ 28 - 0
compdfkit-tools/compdfkit-tools.xcodeproj/project.pbxproj

@@ -13,6 +13,11 @@
 		C9AF183029EFB23C00EC4979 /* CPDFBookmarkViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = C9AF182E29EFB23C00EC4979 /* CPDFBookmarkViewController.h */; };
 		C9AF183129EFB23C00EC4979 /* CPDFBookmarkViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C9AF182F29EFB23C00EC4979 /* CPDFBookmarkViewController.m */; };
 		C9AF183329EFC63300EC4979 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C9AF183229EFC63300EC4979 /* Images.xcassets */; };
+		C9AF183B29F2198700EC4979 /* CPDFAnnotationBar.h in Headers */ = {isa = PBXBuildFile; fileRef = C9AF183929F2198700EC4979 /* CPDFAnnotationBar.h */; };
+		C9AF183C29F2198700EC4979 /* CPDFAnnotationBar.m in Sources */ = {isa = PBXBuildFile; fileRef = C9AF183A29F2198700EC4979 /* CPDFAnnotationBar.m */; };
+		C9AF183E29F223A700EC4979 /* Image.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C9AF183D29F223A700EC4979 /* Image.xcassets */; };
+		C9AF184129F22BBD00EC4979 /* CPDFAnnotationBarButton.h in Headers */ = {isa = PBXBuildFile; fileRef = C9AF183F29F22BBD00EC4979 /* CPDFAnnotationBarButton.h */; };
+		C9AF184229F22BBD00EC4979 /* CPDFAnnotationBarButton.m in Sources */ = {isa = PBXBuildFile; fileRef = C9AF184029F22BBD00EC4979 /* CPDFAnnotationBarButton.m */; };
 		C9B0CE1829E6486700524B7F /* ComPDFKit.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = F313657129E4367A00EE6BBB /* ComPDFKit.xcframework */; };
 		F32DA16229ED904300E19ECA /* CPDFOutlineModel.h in Headers */ = {isa = PBXBuildFile; fileRef = F32DA12229ED904300E19ECA /* CPDFOutlineModel.h */; };
 		F32DA16329ED904300E19ECA /* Image.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F32DA12329ED904300E19ECA /* Image.xcassets */; };
@@ -74,6 +79,11 @@
 		C9AF182E29EFB23C00EC4979 /* CPDFBookmarkViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFBookmarkViewController.h; sourceTree = "<group>"; };
 		C9AF182F29EFB23C00EC4979 /* CPDFBookmarkViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFBookmarkViewController.m; sourceTree = "<group>"; };
 		C9AF183229EFC63300EC4979 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
+		C9AF183929F2198700EC4979 /* CPDFAnnotationBar.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFAnnotationBar.h; sourceTree = "<group>"; };
+		C9AF183A29F2198700EC4979 /* CPDFAnnotationBar.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFAnnotationBar.m; sourceTree = "<group>"; };
+		C9AF183D29F223A700EC4979 /* Image.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Image.xcassets; sourceTree = "<group>"; };
+		C9AF183F29F22BBD00EC4979 /* CPDFAnnotationBarButton.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFAnnotationBarButton.h; sourceTree = "<group>"; };
+		C9AF184029F22BBD00EC4979 /* CPDFAnnotationBarButton.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFAnnotationBarButton.m; sourceTree = "<group>"; };
 		F313657129E4367A00EE6BBB /* ComPDFKit.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = ComPDFKit.xcframework; path = ../Lib/ComPDFKit.xcframework; sourceTree = "<group>"; };
 		F32DA12229ED904300E19ECA /* CPDFOutlineModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPDFOutlineModel.h; sourceTree = "<group>"; };
 		F32DA12329ED904300E19ECA /* Image.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Image.xcassets; sourceTree = "<group>"; };
@@ -164,6 +174,18 @@
 			path = PDFBookmark;
 			sourceTree = "<group>";
 		};
+		C9AF183829F2180A00EC4979 /* PDFAnnotationBar */ = {
+			isa = PBXGroup;
+			children = (
+				C9AF183929F2198700EC4979 /* CPDFAnnotationBar.h */,
+				C9AF183A29F2198700EC4979 /* CPDFAnnotationBar.m */,
+				C9AF183F29F22BBD00EC4979 /* CPDFAnnotationBarButton.h */,
+				C9AF184029F22BBD00EC4979 /* CPDFAnnotationBarButton.m */,
+				C9AF183D29F223A700EC4979 /* Image.xcassets */,
+			);
+			path = PDFAnnotationBar;
+			sourceTree = "<group>";
+		};
 		F313657029E4367A00EE6BBB /* Frameworks */ = {
 			isa = PBXGroup;
 			children = (
@@ -325,6 +347,7 @@
 		F32DA14E29ED904300E19ECA /* Views */ = {
 			isa = PBXGroup;
 			children = (
+				C9AF183829F2180A00EC4979 /* PDFAnnotationBar */,
 				F32DA14F29ED904300E19ECA /* PDFNavigationRightView */,
 				F32DA15329ED904300E19ECA /* PDFActivityIndicatorView */,
 				F32DA15629ED904300E19ECA /* PDFView */,
@@ -449,10 +472,12 @@
 				F32DA18029ED904300E19ECA /* CNavigationController.h in Headers */,
 				F32DA17429ED904300E19ECA /* CPDFInfoViewController.h in Headers */,
 				F382636B29EFD0D9003F1DFD /* CPDFSlider.h in Headers */,
+				C9AF184129F22BBD00EC4979 /* CPDFAnnotationBarButton.h in Headers */,
 				F32DA16F29ED904300E19ECA /* CSearchToolbar.h in Headers */,
 				F3877E1629E6764E00037D92 /* CPDFDisplayViewController.h in Headers */,
 				F32DA19129ED908800E19ECA /* CPDFMoreListViewController.h in Headers */,
 				F32DA17029ED904300E19ECA /* CPDFThumbnailViewCell.h in Headers */,
+				C9AF183B29F2198700EC4979 /* CPDFAnnotationBar.h in Headers */,
 				F32DA17929ED904300E19ECA /* CPDFDisplayViewController.h in Headers */,
 				C9AF183029EFB23C00EC4979 /* CPDFBookmarkViewController.h in Headers */,
 				F32DA16C29ED904300E19ECA /* CPDFSearchResultsViewController.h in Headers */,
@@ -532,6 +557,7 @@
 				F32DA17C29ED904300E19ECA /* DisplayImage.xcassets in Resources */,
 				F32DA16329ED904300E19ECA /* Image.xcassets in Resources */,
 				F32DA18229ED904300E19ECA /* NavigationRightImage.xcassets in Resources */,
+				C9AF183E29F223A700EC4979 /* Image.xcassets in Resources */,
 				C9AF182629EE8AB600EC4979 /* UtilsColor.xcassets in Resources */,
 				F382636C29EFD0D9003F1DFD /* CPDFSliderImage.xcassets in Resources */,
 			);
@@ -547,6 +573,7 @@
 				F32DA17B29ED904300E19ECA /* CPDFDisplayViewController.m in Sources */,
 				F32DA17F29ED904300E19ECA /* CNavigationController.m in Sources */,
 				F382636D29EFD0D9003F1DFD /* CPDFListView.m in Sources */,
+				C9AF184229F22BBD00EC4979 /* CPDFAnnotationBarButton.m in Sources */,
 				F32DA17329ED904300E19ECA /* CPDFThumbnailViewController.m in Sources */,
 				F32DA16929ED904300E19ECA /* CPDFSearchResultsViewController.m in Sources */,
 				F32DA16D29ED904300E19ECA /* CPDFSearchViewCell.m in Sources */,
@@ -555,6 +582,7 @@
 				F32DA16629ED904300E19ECA /* CPDFOutlineModel.m in Sources */,
 				F32DA16729ED904300E19ECA /* CPDFOutlineViewController.m in Sources */,
 				F38F60C729EFF0C2008098F8 /* CPDFColorUtils.m in Sources */,
+				C9AF183C29F2198700EC4979 /* CPDFAnnotationBar.m in Sources */,
 				F32DA17A29ED904300E19ECA /* CPDFDisplayTableViewCell.m in Sources */,
 				F32DA17D29ED904300E19ECA /* CPDFBOTAViewController.m in Sources */,
 				F32DA19229ED908800E19ECA /* CPDFMoreListViewController.m in Sources */,

+ 56 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/CPDFAnnotationBar.h

@@ -0,0 +1,56 @@
+//
+//  CPDFAnnotationBar.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, PDFToolbarSelectedIndex) {
+    CPDFToolbarNote = 0,
+    CPDFToolbarHighlight,
+    CPDFToolbarUnderline,
+    CPDFToolbarStrikeout,
+    CPDFToolbarSquiggly,
+    CPDFToolbarFreehand,
+    CPDFToolbarShapeCircle,
+    CPDFToolbarShapeRectangle,
+    CPDFToolbarShapeArrow,
+    CPDFToolbarShapeLine,
+    CPDFToolbarFreeText,
+    CPDFToolbarSignature,
+    CPDFToolbarStamp,
+    CPDFToolbarImage,
+    CPDFToolbarLink,
+    CPDFToolbarLSound,
+};
+
+NS_ASSUME_NONNULL_BEGIN
+
+@class CPDFAnnotationBar;
+
+@protocol CPDFAnnotationBarDelegate <NSObject>
+
+@optional
+
+- (void)clickAnnotationBar:(CPDFAnnotationBar *)annotationBar forIndex:(NSInteger)index forSelected:(BOOL)isSelected forAnnotationBarButton:(UIButton *)buttom;
+
+@end
+
+@interface CPDFAnnotationBar : UIView
+
+@property (nonatomic, assign) NSInteger shapeStyle;
+
+@property (nonatomic, weak) id<CPDFAnnotationBarDelegate> delegate;
+
+- (void)reloadData;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 186 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/CPDFAnnotationBar.m

@@ -0,0 +1,186 @@
+//
+//  CPDFAnnotationBar.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 "CPDFAnnotationBar.h"
+#import "CPDFAnnotationBarButton.h"
+
+#import <ComPDFKit/ComPDFKit.h>
+
+@interface CPDFAnnotationBar ()
+
+@property (nonatomic, strong) UIScrollView *scrollView;
+
+@property (nonatomic, strong) NSArray *annotationBtns;
+
+@property (nonatomic, assign) NSInteger selectedIndex;
+
+@property (nonatomic, strong) UIView *propertiesBar;
+
+@property (nonatomic, strong) UIButton *propertiesBtn;
+
+@property (nonatomic, strong) UIButton *undoBtn;
+
+@property (nonatomic, strong) UIButton *redoBtn;
+
+@end
+
+@implementation CPDFAnnotationBar
+
+#pragma mark - Initializers
+
+- (instancetype)initWithFrame:(CGRect)frame {
+    if (self = [super initWithFrame:frame]) {
+        UIBlurEffect *blur = [UIBlurEffect effectWithStyle:UIBlurEffectStyleExtraLight];
+        UIVisualEffectView *effectView = [[UIVisualEffectView alloc] initWithEffect:blur];
+        effectView.frame = self.bounds;
+        effectView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
+        [self addSubview:effectView];
+        
+        UIView *line = [[UIView alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, 1)];
+        line.backgroundColor = [UIColor colorWithRed:210.0/255.0 green:210.0/255.0 blue:210.0/255.0 alpha:1.0];
+        line.autoresizingMask = UIViewAutoresizingFlexibleWidth;
+        [self addSubview:line];
+        
+        self.selectedIndex = -1;
+
+        [self initSubview];
+    }
+    return self;
+}
+
+- (void)layoutSubviews {
+    [super layoutSubviews];
+    self.scrollView.frame = self.bounds;
+}
+
+#pragma mark - Public Methods
+
+- (void)reloadData {
+    if (self.selectedIndex >=0 &&
+        self.selectedIndex < self.annotationBtns.count) {
+        UIButton *selectedButton = [self.annotationBtns objectAtIndex:self.selectedIndex];
+        selectedButton.backgroundColor = [UIColor clearColor];
+    }
+    self.selectedIndex = -1;
+}
+
+#pragma mark - Private Methods
+
+- (void)initSubview {
+    _propertiesBar = [[UIView alloc] initWithFrame:CGRectMake(self.bounds.size.width - 180, 0, 180, 44)];
+    _propertiesBar.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
+    [self addSubview:self.propertiesBar];
+    
+    _propertiesBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 1, 60, 43)];
+    [_propertiesBtn setImage:[UIImage imageNamed:@"" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
+    _propertiesBtn.userInteractionEnabled = NO;
+    [_propertiesBtn addTarget:self action:@selector(buttonItemClicked_open:) forControlEvents:UIControlEventTouchUpInside];
+    [self.propertiesBar addSubview:self.propertiesBtn];
+    
+    _undoBtn = [[UIButton alloc] initWithFrame:CGRectMake(60, 1, 60, 43)];
+    [_undoBtn setImage:[UIImage imageNamed:@"" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
+    [_undoBtn addTarget:self action:@selector(buttonItemClicked_undo:) forControlEvents:UIControlEventTouchUpInside];
+    [self.propertiesBar addSubview:self.undoBtn];
+    
+    _redoBtn = [[UIButton alloc] initWithFrame:CGRectMake(120, 1, 60, 43)];
+    [_redoBtn setImage:[UIImage imageNamed:@"" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
+    [_redoBtn addTarget:self action:@selector(buttonItemClicked_redo:) forControlEvents:UIControlEventTouchUpInside];
+    [self.propertiesBar addSubview:self.redoBtn];
+    
+    _scrollView = [[UIScrollView alloc] initWithFrame:self.bounds];
+    _scrollView.showsVerticalScrollIndicator = NO;
+    _scrollView.showsHorizontalScrollIndicator = NO;
+    [self addSubview:_scrollView];
+    
+    CGFloat offsetX = 0.0;
+    NSArray *images = @[@"CPDFAnnotationBarImageNote",
+                        @"CPDFAnnotationBarImageHighLight",
+                        @"CPDFAnnotationBarImageUnderline",
+                        @"CPDFAnnotationBarImageStrikeout",
+                        @"CPDFAnnotationBarImageSquiggly",
+                        @"CPDFAnnotationBarImageFreehand",
+                        @"CPDFAnnotationBarImageShapeCircle",
+                        @"CPDFAnnotationBarImageShapeRectangle",
+                        @"CPDFAnnotationBarImageShapeArrow",
+                        @"CPDFAnnotationBarImageShapeLine",
+                        @"CPDFAnnotationBarImageFreeText",
+                        @"CPDFAnnotationBarImageSignature",
+                        @"CPDFAnnotationBarImageStamp",
+                        @"CPDFAnnotationBarImageImage",
+                        @"CPDFAnnotationBarImageLink",
+                        @"CPDFAnnotationBarImageSound"];
+    
+    NSMutableArray *annotationBtns = [NSMutableArray array];
+    for (int i = 0; i < images.count; i++) {
+        CPDFAnnotationBarButton *button = [CPDFAnnotationBarButton buttonWithType:UIButtonTypeCustom];
+        button.frame = CGRectMake(offsetX, 1, 58, 43);
+        [button setImage:[UIImage imageNamed:images[i] inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
+        button.tag = i;
+        button.type = i;
+        if (i == 1) {
+            button.lineColor = CPDFKitShareConfig.highlightAnnotationColor;
+        } else if (i == 2) {
+            button.lineColor = CPDFKitShareConfig.underlineAnnotationColor;
+        } else if (i == 3) {
+            button.lineColor = CPDFKitShareConfig.strikeoutAnnotationColor;
+        } else if (i == 4) {
+            button.lineColor = CPDFKitShareConfig.squigglyAnnotationColor;
+        } else if (i == 5) {
+            button.type = 4;
+            button.lineColor = CPDFKitShareConfig.freehandAnnotationColor;
+        }
+        [button addTarget:self action:@selector(buttonItemClicked_Switch:) forControlEvents:UIControlEventTouchUpInside];
+        [_scrollView addSubview:button];
+        [annotationBtns addObject:button];
+        
+        if (UIUserInterfaceIdiomPhone == UI_USER_INTERFACE_IDIOM()) {
+            offsetX += button.bounds.size.width;
+        } else {
+            offsetX += button.bounds.size.height;
+        }
+    }
+    self.annotationBtns = annotationBtns;
+}
+
+#pragma mark - Action
+
+- (void)buttonItemClicked_Switch:(UIButton *)button {
+    if (self.selectedIndex >= 0 && self.selectedIndex < self.annotationBtns.count) {
+        UIButton *selectButton = [self.annotationBtns objectAtIndex:self.selectedIndex];
+    }
+    if (button.tag != self.selectedIndex) {
+        button.backgroundColor = [UIColor colorWithRed:178.0/255.0 green:239.0/255.0 blue:253.0/255.0 alpha:1.0];
+        self.selectedIndex = button.tag;
+        if ([self.delegate respondsToSelector:@selector(clickAnnotationBar:forIndex:forSelected:forAnnotationBarButton:)]) {
+            [self.delegate clickAnnotationBar:self forIndex:self.selectedIndex forSelected:YES forAnnotationBarButton:button];
+        }
+    } else {
+        if ([self.delegate respondsToSelector:@selector(clickAnnotationBar:forIndex:forSelected:forAnnotationBarButton:)]) {
+            [self.delegate clickAnnotationBar:self forIndex:self.selectedIndex forSelected:YES forAnnotationBarButton:button];
+        }
+        self.selectedIndex = -1;
+    }
+}
+
+- (void)buttonItemClicked_open:(UIButton *)button {
+    
+}
+
+- (void)buttonItemClicked_undo:(UIButton *)button {
+    
+}
+
+- (void)buttonItemClicked_redo:(UIButton *)button {
+    
+}
+
+@end

+ 20 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/CPDFAnnotationBarButton.h

@@ -0,0 +1,20 @@
+//
+//  CPDFAnnotationBarButton.h
+//  compdfkit-tools
+//
+//  Created by kdanmobile_2 on 2023/4/21.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface CPDFAnnotationBarButton : UIButton
+
+@property (nonatomic, assign) NSInteger type;
+
+@property (nonatomic, strong) UIColor *lineColor;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 45 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/CPDFAnnotationBarButton.m

@@ -0,0 +1,45 @@
+//
+//  CPDFAnnotationBarButton.m
+//  compdfkit-tools
+//
+//  Created by kdanmobile_2 on 2023/4/21.
+//
+
+#import "CPDFAnnotationBarButton.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.type == 1) {
+        CGContextMoveToPoint(ctx, CGRectGetMinX(imageFrame)-2, CGRectGetMidY(imageFrame));
+        CGContextSetLineWidth(ctx, CGRectGetHeight(imageFrame));
+        CGContextAddLineToPoint(ctx, CGRectGetMaxX(imageFrame)+2, CGRectGetMidY(imageFrame));
+    }else if (self.type == 2) {
+        CGContextMoveToPoint(ctx, CGRectGetMinX(imageFrame), CGRectGetMaxY(imageFrame));
+        CGContextSetLineWidth(ctx, 2.0);
+        CGContextAddLineToPoint(ctx, CGRectGetMaxX(imageFrame), CGRectGetMaxY(imageFrame));
+    } else if (self.type == 3) {
+        CGContextMoveToPoint(ctx, CGRectGetMinX(imageFrame), CGRectGetMidY(imageFrame));
+        CGContextSetLineWidth(ctx, 2.0);
+        CGContextAddLineToPoint(ctx, CGRectGetMaxX(imageFrame), CGRectGetMidY(imageFrame));
+    } else if (self.type == 4) {
+        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

+ 22 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageFreeText.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "btn_typewrite.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "btn_typewrite@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageFreeText.imageset/btn_typewrite.png


BIN
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageFreeText.imageset/btn_typewrite@2x.png


+ 22 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageFreehand.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "btn_freehand1.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "btn_freehand1@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageFreehand.imageset/btn_freehand1.png


BIN
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageFreehand.imageset/btn_freehand1@2x.png


+ 22 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageHighLight.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "btn_t1.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "btn_t1@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageHighLight.imageset/btn_t1.png


BIN
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageHighLight.imageset/btn_t1@2x.png


+ 22 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageImage.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "btn_photo01.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "btn_photo01@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageImage.imageset/btn_photo01.png


BIN
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageImage.imageset/btn_photo01@2x.png


+ 22 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageLink.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "btn_link_01.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "btn_link_01@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageLink.imageset/btn_link_01.png


BIN
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageLink.imageset/btn_link_01@2x.png


+ 22 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageNote.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "btn_note01.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "btn_note01@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageNote.imageset/btn_note01.png


BIN
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageNote.imageset/btn_note01@2x.png


+ 21 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageProperties.imageset/Contents.json

@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "filename" : "iconmonstr-pencil-text-filled.svg",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

File diff suppressed because it is too large
+ 1 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageProperties.imageset/iconmonstr-pencil-text-filled.svg


+ 20 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageRedo.imageset/Contents.json

@@ -0,0 +1,20 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 22 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageShapeArrow.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "shape3.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "shape3@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageShapeArrow.imageset/shape3.png


BIN
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageShapeArrow.imageset/shape3@2x.png


+ 22 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageShapeCircle.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "shape4.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "shape4@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageShapeCircle.imageset/shape4.png


BIN
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageShapeCircle.imageset/shape4@2x.png


+ 22 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageShapeLine.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "shape1.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "shape1@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageShapeLine.imageset/shape1.png


BIN
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageShapeLine.imageset/shape1@2x.png


+ 22 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageShapeRectangle.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "shape2.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "shape2@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageShapeRectangle.imageset/shape2.png


BIN
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageShapeRectangle.imageset/shape2@2x.png


+ 22 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageSignature.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "btn_sign1.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "btn_sign1@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageSignature.imageset/btn_sign1.png


BIN
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageSignature.imageset/btn_sign1@2x.png


+ 21 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageSound.imageset/Contents.json

@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "filename" : "iconmonstr-sound-thin.svg",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

File diff suppressed because it is too large
+ 1 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageSound.imageset/iconmonstr-sound-thin.svg


+ 22 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageSquiggly.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "squiggly.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "squiggly@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageSquiggly.imageset/squiggly.png


BIN
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageSquiggly.imageset/squiggly@2x.png


+ 22 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageStamp.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "btn_stamp_01.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "btn_stamp_01@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageStamp.imageset/btn_stamp_01.png


BIN
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageStamp.imageset/btn_stamp_01@2x.png


+ 22 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageStrikeout.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "strikeout.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "strikeout@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageStrikeout.imageset/strikeout.png


BIN
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageStrikeout.imageset/strikeout@2x.png


+ 22 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageUnderline.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "underline.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "underline@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageUnderline.imageset/underline.png


BIN
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageUnderline.imageset/underline@2x.png


+ 20 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageUndo.imageset/Contents.json

@@ -0,0 +1,20 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 6 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/Contents.json

@@ -0,0 +1,6 @@
+{
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}