Browse Source

Merge branch 'compdfkit_demo_ios' of git.kdan.cc:others/kmpdfkit_demo into compdfkit_demo_ios

chenyu 1 year ago
parent
commit
bff6b81fad
29 changed files with 1596 additions and 81 deletions
  1. 20 20
      Annotation-Ctrl-Demo/Annotation-Ctrl-Demo.xcodeproj/project.pbxproj
  2. 2 14
      Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/CPDFViewController.m
  3. 83 3
      compdfkit-tools/compdfkit-tools.xcodeproj/project.pbxproj
  4. 14 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFAnnotationManage/CAnnotationManage.h
  5. 30 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFAnnotationManage/CAnnotationManage.m
  6. 5 1
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFBase/CPDFAnnotationBaseViewController.h
  7. 21 3
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFBase/CPDFAnnotationBaseViewController.m
  8. 4 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFBase/CPDFAnnotationBaseViewController_Header.h
  9. 21 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFHighlight/CPDFHighlightViewController.h
  10. 31 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFHighlight/CPDFHighlightViewController.m
  11. 32 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFNote/CPDFNoteOpenViewController.h
  12. 122 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFNote/CPDFNoteOpenViewController.m
  13. 27 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFNote/CPDFNoteViewController.h
  14. 106 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFNote/CPDFNoteViewController.m
  15. 16 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStrikeout/CPDFStrikeoutViewController.h
  16. 26 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStrikeout/CPDFStrikeoutViewController.m
  17. 21 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFUnderline/CPDFUnderlineViewController.h
  18. 31 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFUnderline/CPDFUnderlineViewController.m
  19. 2 2
      compdfkit-tools/compdfkit-tools/Common/Model/CAnnotStyle.h
  20. 9 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/CPDFAnnotationBar.h
  21. 141 11
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/CPDFAnnotationBar.m
  22. 13 11
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFAnnotationSampleView.h
  23. 20 1
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFAnnotationSampleView.m
  24. 5 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFColorPickerView.m
  25. 1 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFColorSelectView.h
  26. 6 3
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFColorSelectView.m
  27. 5 1
      compdfkit-tools/compdfkit-tools/Common/Views/PDFView/PDFListView/CPDFListView.h
  28. 775 11
      compdfkit-tools/compdfkit-tools/Common/Views/PDFView/PDFListView/CPDFListView.m
  29. 7 0
      compdfkit-tools/compdfkit-tools/compdfkit_tools.h

+ 20 - 20
Annotation-Ctrl-Demo/Annotation-Ctrl-Demo.xcodeproj/project.pbxproj

@@ -8,6 +8,9 @@
 
 /* Begin PBXBuildFile section */
 		4F06AB5D29F6852C007797E4 /* CPDFViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F06AB5C29F6852C007797E4 /* CPDFViewController.m */; };
+		C918CEB229F903CF00D43974 /* compdfkit_tools.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C918CEB129F903CF00D43974 /* compdfkit_tools.framework */; };
+		C918CEB329F903CF00D43974 /* compdfkit_tools.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C918CEB129F903CF00D43974 /* compdfkit_tools.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
+		C918CEBC29F904E400D43974 /* ComPDFKit.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = C918CEBB29F904E400D43974 /* ComPDFKit.xcframework */; };
 		C9AF185129F267DD00EC4979 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C9AF185029F267DD00EC4979 /* AppDelegate.m */; };
 		C9AF185429F267DD00EC4979 /* SceneDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C9AF185329F267DD00EC4979 /* SceneDelegate.m */; };
 		C9AF185A29F267DD00EC4979 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C9AF185829F267DD00EC4979 /* Main.storyboard */; };
@@ -20,10 +23,6 @@
 		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 */; };
 		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 */
@@ -33,8 +32,7 @@
 			dstPath = "";
 			dstSubfolderSpec = 10;
 			files = (
-				C9AF188329F26B4D00EC4979 /* compdfkit_tools.framework in Embed Frameworks */,
-				C9AF188729F26B5800EC4979 /* ComPDFKit.xcframework in Embed Frameworks */,
+				C918CEB329F903CF00D43974 /* compdfkit_tools.framework in Embed Frameworks */,
 			);
 			name = "Embed Frameworks";
 			runOnlyForDeploymentPostprocessing = 0;
@@ -44,6 +42,8 @@
 /* Begin PBXFileReference section */
 		4F06AB5B29F6852C007797E4 /* CPDFViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPDFViewController.h; sourceTree = "<group>"; };
 		4F06AB5C29F6852C007797E4 /* CPDFViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPDFViewController.m; sourceTree = "<group>"; };
+		C918CEB129F903CF00D43974 /* compdfkit_tools.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = compdfkit_tools.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+		C918CEBB29F904E400D43974 /* ComPDFKit.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = ComPDFKit.xcframework; path = ../Lib/ComPDFKit.xcframework; sourceTree = "<group>"; };
 		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>"; };
@@ -62,8 +62,6 @@
 		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>"; };
 		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 */
@@ -71,14 +69,23 @@
 			isa = PBXFrameworksBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				C9AF188229F26B4D00EC4979 /* compdfkit_tools.framework in Frameworks */,
-				C9AF188629F26B5800EC4979 /* ComPDFKit.xcframework in Frameworks */,
+				C918CEB229F903CF00D43974 /* compdfkit_tools.framework in Frameworks */,
+				C918CEBC29F904E400D43974 /* ComPDFKit.xcframework in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 /* End PBXFrameworksBuildPhase section */
 
 /* Begin PBXGroup section */
+		C918CEB029F903CF00D43974 /* Frameworks */ = {
+			isa = PBXGroup;
+			children = (
+				C918CEBB29F904E400D43974 /* ComPDFKit.xcframework */,
+				C918CEB129F903CF00D43974 /* compdfkit_tools.framework */,
+			);
+			name = Frameworks;
+			sourceTree = "<group>";
+		};
 		C9AF184329F267DD00EC4979 = {
 			isa = PBXGroup;
 			children = (
@@ -86,7 +93,7 @@
 				C9AF186E29F26AD200EC4979 /* SDKLicense */,
 				C9AF184E29F267DD00EC4979 /* Annotation-Ctrl-Demo */,
 				C9AF184D29F267DD00EC4979 /* Products */,
-				C9AF188029F26B4D00EC4979 /* Frameworks */,
+				C918CEB029F903CF00D43974 /* Frameworks */,
 			);
 			sourceTree = "<group>";
 		};
@@ -140,15 +147,6 @@
 			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 */
@@ -370,6 +368,7 @@
 			buildSettings = {
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
+				CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = 1;
 				DEVELOPMENT_TEAM = Q43DRF894U;
@@ -398,6 +397,7 @@
 			buildSettings = {
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
+				CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = 1;
 				DEVELOPMENT_TEAM = Q43DRF894U;

+ 2 - 14
Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/CPDFViewController.m

@@ -31,8 +31,6 @@
 
 @property(nonatomic, strong) CPDFAnnotationBar *annotatiomBar;
 
-@property(nonatomic, strong) CPDFAnnotationBaseViewController *baseVC;
-
 @end
 
 @implementation CPDFViewController
@@ -81,9 +79,10 @@
     self.searchToolbar = [[CSearchToolbar alloc] initWithPDFView:self.pdfListView];
     self.searchToolbar.delegate = self;
     
-    self.annotatiomBar = [[CPDFAnnotationBar alloc] init];
+    self.annotatiomBar = [[CPDFAnnotationBar alloc] initPDFView:self.pdfListView];
     self.annotatiomBar.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
     self.annotatiomBar.delegate = self;
+    [self.annotatiomBar setParentVC:self];
     [self.view addSubview:self.annotatiomBar];
     
     [self reloadDocumentWithFilePath:self.filePath completion:^(BOOL result) {
@@ -279,15 +278,4 @@
     [self.navigationController popViewControllerAnimated:YES];
 }
 
-#pragma mark - CPDFAnnotationBarDelegate
-
-- (void)clickAnnotationBar:(CPDFAnnotationBar *)annotationBar forIndex:(NSInteger)index forSelected:(BOOL)isSelected forAnnotationBarButton:(UIButton *)buttom {
-    _baseVC = [[CPDFAnnotationBaseViewController alloc] init];
-    AAPLCustomPresentationController *presentationController NS_VALID_UNTIL_END_OF_SCOPE;
-   
-    presentationController = [[AAPLCustomPresentationController alloc] initWithPresentedViewController:self.baseVC presentingViewController:self];
-    self.baseVC.transitioningDelegate = presentationController;
-    [self presentViewController:self.baseVC animated:YES completion:nil];
-}
-
 @end

+ 83 - 3
compdfkit-tools/compdfkit-tools.xcodeproj/project.pbxproj

@@ -29,6 +29,18 @@
 		C918CE8429F62D6F00D43974 /* Image.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C918CE8329F62D6F00D43974 /* Image.xcassets */; };
 		C918CE9229F7C3FB00D43974 /* CAnnotationManage.h in Headers */ = {isa = PBXBuildFile; fileRef = C918CE9029F7C3FA00D43974 /* CAnnotationManage.h */; };
 		C918CE9329F7C3FB00D43974 /* CAnnotationManage.m in Sources */ = {isa = PBXBuildFile; fileRef = C918CE9129F7C3FA00D43974 /* CAnnotationManage.m */; };
+		C918CE9629F8BA6200D43974 /* CPDFNoteViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = C918CE9429F8BA6200D43974 /* CPDFNoteViewController.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		C918CE9729F8BA6200D43974 /* CPDFNoteViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C918CE9529F8BA6200D43974 /* CPDFNoteViewController.m */; };
+		C918CE9B29F8EE7200D43974 /* CPDFHighlightViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = C918CE9929F8EE7200D43974 /* CPDFHighlightViewController.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		C918CE9C29F8EE7200D43974 /* CPDFHighlightViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C918CE9A29F8EE7200D43974 /* CPDFHighlightViewController.m */; };
+		C918CEA029F8F74000D43974 /* CPDFStrikeoutViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = C918CE9E29F8F74000D43974 /* CPDFStrikeoutViewController.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		C918CEA129F8F74000D43974 /* CPDFStrikeoutViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C918CE9F29F8F74000D43974 /* CPDFStrikeoutViewController.m */; };
+		C918CEA529F8FC1800D43974 /* CPDFUnderlineViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = C918CEA329F8FC1800D43974 /* CPDFUnderlineViewController.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		C918CEA629F8FC1800D43974 /* CPDFUnderlineViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C918CEA429F8FC1800D43974 /* CPDFUnderlineViewController.m */; };
+		C918CEAD29F9024600D43974 /* ComPDFKit.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = F313657129E4367A00EE6BBB /* ComPDFKit.xcframework */; };
+		C918CEAE29F9024600D43974 /* ComPDFKit.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = F313657129E4367A00EE6BBB /* ComPDFKit.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
+		C918CEBF29F9078A00D43974 /* CPDFNoteOpenViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = C918CEBD29F9078A00D43974 /* CPDFNoteOpenViewController.h */; };
+		C918CEC029F9078A00D43974 /* CPDFNoteOpenViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C918CEBE29F9078A00D43974 /* CPDFNoteOpenViewController.m */; };
 		C9AF182629EE8AB600EC4979 /* UtilsColor.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C9AF182529EE8AB600EC4979 /* UtilsColor.xcassets */; };
 		C9AF182C29EFB1FC00EC4979 /* CPDFBookmarkViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = C9AF182A29EFB1FC00EC4979 /* CPDFBookmarkViewCell.h */; };
 		C9AF182D29EFB1FC00EC4979 /* CPDFBookmarkViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = C9AF182B29EFB1FC00EC4979 /* CPDFBookmarkViewCell.m */; };
@@ -48,12 +60,11 @@
 		C9AF189829F4DA6A00EC4979 /* CPDFColorSelectView.m in Sources */ = {isa = PBXBuildFile; fileRef = C9AF189629F4DA6A00EC4979 /* CPDFColorSelectView.m */; };
 		C9AF189B29F4DBF800EC4979 /* CPDFOpacitySliderView.h in Headers */ = {isa = PBXBuildFile; fileRef = C9AF189929F4DBF800EC4979 /* CPDFOpacitySliderView.h */; };
 		C9AF189C29F4DBF800EC4979 /* CPDFOpacitySliderView.m in Sources */ = {isa = PBXBuildFile; fileRef = C9AF189A29F4DBF800EC4979 /* CPDFOpacitySliderView.m */; };
-		C9B0CE1829E6486700524B7F /* ComPDFKit.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = F313657129E4367A00EE6BBB /* ComPDFKit.xcframework */; };
 		C9B9EC4A29F4DC8900C6A5D2 /* CPDFThicknessSliderView.h in Headers */ = {isa = PBXBuildFile; fileRef = C9B9EC4829F4DC8900C6A5D2 /* CPDFThicknessSliderView.h */; };
 		C9B9EC4B29F4DC8900C6A5D2 /* CPDFThicknessSliderView.m in Sources */ = {isa = PBXBuildFile; fileRef = C9B9EC4929F4DC8900C6A5D2 /* CPDFThicknessSliderView.m */; };
 		C9B9EC4E29F52DBF00C6A5D2 /* AAPLCustomPresentationController.h in Headers */ = {isa = PBXBuildFile; fileRef = C9B9EC4D29F52DBF00C6A5D2 /* AAPLCustomPresentationController.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		C9B9EC5029F52DCC00C6A5D2 /* AAPLCustomPresentationController.m in Sources */ = {isa = PBXBuildFile; fileRef = C9B9EC4F29F52DCC00C6A5D2 /* AAPLCustomPresentationController.m */; };
-		C9B9EC5929F54E9600C6A5D2 /* CAnnotStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = C9B9EC5729F54E9600C6A5D2 /* CAnnotStyle.h */; };
+		C9B9EC5929F54E9600C6A5D2 /* CAnnotStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = C9B9EC5729F54E9600C6A5D2 /* CAnnotStyle.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		C9B9EC5A29F54E9600C6A5D2 /* CAnnotStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = C9B9EC5829F54E9600C6A5D2 /* CAnnotStyle.m */; };
 		F32DA16229ED904300E19ECA /* CPDFOutlineModel.h in Headers */ = {isa = PBXBuildFile; fileRef = F32DA12229ED904300E19ECA /* CPDFOutlineModel.h */; };
 		F32DA16329ED904300E19ECA /* Image.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F32DA12329ED904300E19ECA /* Image.xcassets */; };
@@ -108,6 +119,20 @@
 		F3E8495929E69712007BE967 /* DisplayImage.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F3E8495829E69712007BE967 /* DisplayImage.xcassets */; };
 /* End PBXBuildFile section */
 
+/* Begin PBXCopyFilesBuildPhase section */
+		C918CEAF29F9024600D43974 /* Embed Frameworks */ = {
+			isa = PBXCopyFilesBuildPhase;
+			buildActionMask = 2147483647;
+			dstPath = "";
+			dstSubfolderSpec = 10;
+			files = (
+				C918CEAE29F9024600D43974 /* ComPDFKit.xcframework in Embed Frameworks */,
+			);
+			name = "Embed Frameworks";
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXCopyFilesBuildPhase section */
+
 /* Begin PBXFileReference section */
 		4F06AB4829F6792E007797E4 /* CPDFTextProperty.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPDFTextProperty.m; sourceTree = "<group>"; };
 		4F06AB4929F6792E007797E4 /* CPDFEditToolBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPDFEditToolBar.m; sourceTree = "<group>"; };
@@ -131,6 +156,16 @@
 		C918CE8329F62D6F00D43974 /* Image.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Image.xcassets; sourceTree = "<group>"; };
 		C918CE9029F7C3FA00D43974 /* CAnnotationManage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CAnnotationManage.h; sourceTree = "<group>"; };
 		C918CE9129F7C3FA00D43974 /* CAnnotationManage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CAnnotationManage.m; sourceTree = "<group>"; };
+		C918CE9429F8BA6200D43974 /* CPDFNoteViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFNoteViewController.h; sourceTree = "<group>"; };
+		C918CE9529F8BA6200D43974 /* CPDFNoteViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFNoteViewController.m; sourceTree = "<group>"; };
+		C918CE9929F8EE7200D43974 /* CPDFHighlightViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFHighlightViewController.h; sourceTree = "<group>"; };
+		C918CE9A29F8EE7200D43974 /* CPDFHighlightViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFHighlightViewController.m; sourceTree = "<group>"; };
+		C918CE9E29F8F74000D43974 /* CPDFStrikeoutViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFStrikeoutViewController.h; sourceTree = "<group>"; };
+		C918CE9F29F8F74000D43974 /* CPDFStrikeoutViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFStrikeoutViewController.m; sourceTree = "<group>"; };
+		C918CEA329F8FC1800D43974 /* CPDFUnderlineViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFUnderlineViewController.h; sourceTree = "<group>"; };
+		C918CEA429F8FC1800D43974 /* CPDFUnderlineViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFUnderlineViewController.m; sourceTree = "<group>"; };
+		C918CEBD29F9078A00D43974 /* CPDFNoteOpenViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFNoteOpenViewController.h; sourceTree = "<group>"; };
+		C918CEBE29F9078A00D43974 /* CPDFNoteOpenViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFNoteOpenViewController.m; sourceTree = "<group>"; };
 		C9AF182529EE8AB600EC4979 /* UtilsColor.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = UtilsColor.xcassets; sourceTree = "<group>"; };
 		C9AF182A29EFB1FC00EC4979 /* CPDFBookmarkViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFBookmarkViewCell.h; sourceTree = "<group>"; };
 		C9AF182B29EFB1FC00EC4979 /* CPDFBookmarkViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFBookmarkViewCell.m; sourceTree = "<group>"; };
@@ -218,7 +253,7 @@
 			isa = PBXFrameworksBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				C9B0CE1829E6486700524B7F /* ComPDFKit.xcframework in Frameworks */,
+				C918CEAD29F9024600D43974 /* ComPDFKit.xcframework in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -284,6 +319,10 @@
 		C918CE8E29F7C3C300D43974 /* PDFNote */ = {
 			isa = PBXGroup;
 			children = (
+				C918CE9429F8BA6200D43974 /* CPDFNoteViewController.h */,
+				C918CE9529F8BA6200D43974 /* CPDFNoteViewController.m */,
+				C918CEBD29F9078A00D43974 /* CPDFNoteOpenViewController.h */,
+				C918CEBE29F9078A00D43974 /* CPDFNoteOpenViewController.m */,
 			);
 			path = PDFNote;
 			sourceTree = "<group>";
@@ -297,6 +336,33 @@
 			path = PDFAnnotationManage;
 			sourceTree = "<group>";
 		};
+		C918CE9829F8EDA900D43974 /* PDFHighlight */ = {
+			isa = PBXGroup;
+			children = (
+				C918CE9929F8EE7200D43974 /* CPDFHighlightViewController.h */,
+				C918CE9A29F8EE7200D43974 /* CPDFHighlightViewController.m */,
+			);
+			path = PDFHighlight;
+			sourceTree = "<group>";
+		};
+		C918CE9D29F8F6B600D43974 /* PDFStrikeout */ = {
+			isa = PBXGroup;
+			children = (
+				C918CE9E29F8F74000D43974 /* CPDFStrikeoutViewController.h */,
+				C918CE9F29F8F74000D43974 /* CPDFStrikeoutViewController.m */,
+			);
+			path = PDFStrikeout;
+			sourceTree = "<group>";
+		};
+		C918CEA229F8FBA200D43974 /* PDFUnderline */ = {
+			isa = PBXGroup;
+			children = (
+				C918CEA329F8FC1800D43974 /* CPDFUnderlineViewController.h */,
+				C918CEA429F8FC1800D43974 /* CPDFUnderlineViewController.m */,
+			);
+			path = PDFUnderline;
+			sourceTree = "<group>";
+		};
 		C949FEE029EE70D000C30A8D /* Utils */ = {
 			isa = PBXGroup;
 			children = (
@@ -353,6 +419,9 @@
 		C9AF188A29F4C7C900EC4979 /* PDFProperties */ = {
 			isa = PBXGroup;
 			children = (
+				C918CEA229F8FBA200D43974 /* PDFUnderline */,
+				C918CE9D29F8F6B600D43974 /* PDFStrikeout */,
+				C918CE9829F8EDA900D43974 /* PDFHighlight */,
 				C918CE8E29F7C3C300D43974 /* PDFNote */,
 				C9AF188B29F4C83900EC4979 /* PDFBase */,
 			);
@@ -661,6 +730,8 @@
 			buildActionMask = 2147483647;
 			files = (
 				4F06AB5629F6792E007797E4 /* CPDFEditContextMenu.h in Headers */,
+				C918CEBF29F9078A00D43974 /* CPDFNoteOpenViewController.h in Headers */,
+				C918CE9B29F8EE7200D43974 /* CPDFHighlightViewController.h in Headers */,
 				F32DA18129ED904300E19ECA /* CNavigationRightView.h in Headers */,
 				C918CE8129F621E200D43974 /* CPDFColorPickerView.h in Headers */,
 				F32DA16A29ED904300E19ECA /* CPDFSearchViewCell.h in Headers */,
@@ -672,9 +743,11 @@
 				F32DA17529ED904300E19ECA /* CPDFInfoTableCell.h in Headers */,
 				F32DA18029ED904300E19ECA /* CNavigationController.h in Headers */,
 				F32DA17429ED904300E19ECA /* CPDFInfoViewController.h in Headers */,
+				C918CE9629F8BA6200D43974 /* CPDFNoteViewController.h in Headers */,
 				C9AF189229F4D0F300EC4979 /* CPDFAnnotationSampleView.h in Headers */,
 				4F06AB5429F6792E007797E4 /* CPDFTextProperty.h in Headers */,
 				F382636B29EFD0D9003F1DFD /* CPDFSlider.h in Headers */,
+				C918CEA529F8FC1800D43974 /* CPDFUnderlineViewController.h in Headers */,
 				C9AF184129F22BBD00EC4979 /* CPDFAnnotationBarButton.h in Headers */,
 				F32DA16F29ED904300E19ECA /* CSearchToolbar.h in Headers */,
 				F3877E1629E6764E00037D92 /* CPDFDisplayViewController.h in Headers */,
@@ -691,6 +764,7 @@
 				4F1131AF29F8EEA800950564 /* CPDFEditViewController.h in Headers */,
 				F32DA16529ED904300E19ECA /* CPDFOutlineViewController.h in Headers */,
 				4F06AB5729F6792E007797E4 /* CPDFImageProperty.h in Headers */,
+				C918CEA029F8F74000D43974 /* CPDFStrikeoutViewController.h in Headers */,
 				F38F60C629EFF0C2008098F8 /* CPDFColorUtils.h in Headers */,
 				C9AF189B29F4DBF800EC4979 /* CPDFOpacitySliderView.h in Headers */,
 				C918CE9229F7C3FB00D43974 /* CAnnotationManage.h in Headers */,
@@ -717,6 +791,7 @@
 				F335EE4329E430C800ACC72A /* Sources */,
 				F335EE4429E430C800ACC72A /* Frameworks */,
 				F335EE4529E430C800ACC72A /* Resources */,
+				C918CEAF29F9024600D43974 /* Embed Frameworks */,
 			);
 			buildRules = (
 			);
@@ -790,6 +865,8 @@
 			files = (
 				F32DA17B29ED904300E19ECA /* CPDFDisplayViewController.m in Sources */,
 				C918CE9329F7C3FB00D43974 /* CAnnotationManage.m in Sources */,
+				C918CEC029F9078A00D43974 /* CPDFNoteOpenViewController.m in Sources */,
+				C918CE9729F8BA6200D43974 /* CPDFNoteViewController.m in Sources */,
 				C9B9EC5029F52DCC00C6A5D2 /* AAPLCustomPresentationController.m in Sources */,
 				4F1131BB29F911A800950564 /* CPDFTextPropertyCell.m in Sources */,
 				F32DA17F29ED904300E19ECA /* CNavigationController.m in Sources */,
@@ -798,6 +875,7 @@
 				F32DA17329ED904300E19ECA /* CPDFThumbnailViewController.m in Sources */,
 				C9B9EC4B29F4DC8900C6A5D2 /* CPDFThicknessSliderView.m in Sources */,
 				C9B9EC5A29F54E9600C6A5D2 /* CAnnotStyle.m in Sources */,
+				C918CEA629F8FC1800D43974 /* CPDFUnderlineViewController.m in Sources */,
 				F32DA16929ED904300E19ECA /* CPDFSearchResultsViewController.m in Sources */,
 				F32DA16D29ED904300E19ECA /* CPDFSearchViewCell.m in Sources */,
 				F32DA16429ED904300E19ECA /* CPDFOutlineViewCell.m in Sources */,
@@ -807,6 +885,7 @@
 				C9AF189329F4D0F300EC4979 /* CPDFAnnotationSampleView.m in Sources */,
 				F32DA16629ED904300E19ECA /* CPDFOutlineModel.m in Sources */,
 				F32DA16729ED904300E19ECA /* CPDFOutlineViewController.m in Sources */,
+				C918CEA129F8F74000D43974 /* CPDFStrikeoutViewController.m in Sources */,
 				4F06AB5229F6792E007797E4 /* CPDFEditContextMenu.m in Sources */,
 				F38F60C729EFF0C2008098F8 /* CPDFColorUtils.m in Sources */,
 				C9AF183C29F2198700EC4979 /* CPDFAnnotationBar.m in Sources */,
@@ -826,6 +905,7 @@
 				C9AF183129EFB23C00EC4979 /* CPDFBookmarkViewController.m in Sources */,
 				C918CE8229F621E200D43974 /* CPDFColorPickerView.m in Sources */,
 				F32DA17629ED904300E19ECA /* CPDFInfoViewController.m in Sources */,
+				C918CE9C29F8EE7200D43974 /* CPDFHighlightViewController.m in Sources */,
 				C9AF189829F4DA6A00EC4979 /* CPDFColorSelectView.m in Sources */,
 				C9AF182D29EFB1FC00EC4979 /* CPDFBookmarkViewCell.m in Sources */,
 				C9AF188F29F4C8A900EC4979 /* CPDFAnnotationBaseViewController.m in Sources */,

+ 14 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFAnnotationManage/CAnnotationManage.h

@@ -14,8 +14,22 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
+@class CPDFListView;
+@class CAnnotStyle;
+@class CPDFAnnotation;
+
 @interface CAnnotationManage : NSObject
 
+@property (nonatomic, readonly) CPDFListView *pdfListView;
+
+@property (nonatomic, readonly) CPDFAnnotation *annotation;
+
+@property (nonatomic, strong) CAnnotStyle *annotStyle;
+
+- (instancetype)initWithPDFView:(CPDFListView *)pdfListView annotation:(CPDFAnnotation *)annotation;
+
+- (CAnnotStyle *)getAnnotStyle;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 30 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFAnnotationManage/CAnnotationManage.m

@@ -11,7 +11,37 @@
 //
 
 #import "CAnnotationManage.h"
+#import "CPDFListView.h"
+#import "CAnnotStyle.h"
+
+#import <ComPDFKit/ComPDFKit.h>
+
+@interface CAnnotationManage ()
+
+@property (nonatomic, strong) CPDFListView *pdfListView;
+
+@property (nonatomic, strong) CPDFAnnotation *annotation;
+
+@end
 
 @implementation CAnnotationManage
 
+- (instancetype)initWithPDFView:(CPDFListView *)pdfListView annotation:(CPDFAnnotation *)annotation {
+    if (self = [super init]) {
+        self.pdfListView = pdfListView;
+        self.annotation = annotation;
+        self.annotStyle = [[CAnnotStyle alloc] init];
+    }
+    return self;
+}
+
+- (CAnnotStyle *)getAnnotStyle {
+    if ([self.annotation isKindOfClass:[CPDFTextAnnotation class]]) {
+        self.annotStyle.bounds = [self.pdfListView convertRect:self.annotation.bounds toPage:self.annotation.page];
+        self.annotStyle.contents = self.annotation.contents;
+        self.annotStyle.color = [UIColor redColor];
+    }
+    return self.annotStyle;
+}
+
 @end

+ 5 - 1
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFBase/CPDFAnnotationBaseViewController.h

@@ -14,9 +14,13 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
+@class CAnnotStyle;
+
 @interface CPDFAnnotationBaseViewController : UIViewController
 
-@property (nonatomic, strong) UILabel *titleLabel;
+@property (nonatomic, readonly) CAnnotStyle *annotStyle;
+
+- (instancetype)initWithStyle:(CAnnotStyle *)annotStyle;
 
 @end
 

+ 21 - 3
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFBase/CPDFAnnotationBaseViewController.m

@@ -15,12 +15,20 @@
 
 @interface CPDFAnnotationBaseViewController () <CPDFColorSelectViewDelegate>
 
+@property (nonatomic, strong) CAnnotStyle *annotStyle;
+
 @end
 
 @implementation CPDFAnnotationBaseViewController
 
 #pragma mark - Initializers
 
+- (instancetype)initWithStyle:(CAnnotStyle *)annotStyle {
+    if (self = [super init]) {
+        self.annotStyle = annotStyle;
+    }
+    return self;
+}
 
 #pragma mark - ViewController Methods
 
@@ -29,13 +37,14 @@
     // Do any additional setup after loading the view.
     self.titleLabel = [[UILabel alloc] init];
     self.titleLabel.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;
-    self.titleLabel.text = NSLocalizedString(@"Note", nil);
     self.titleLabel.font = [UIFont systemFontOfSize:20];
     self.titleLabel.adjustsFontSizeToFitWidth = YES;
     [self.view addSubview:self.titleLabel];
     
     self.sampleView = [[CPDFAnnotationSampleView alloc] init];
-    self.sampleView.backgroundColor = [UIColor grayColor];
+    self.sampleView.backgroundColor = [UIColor whiteColor];
+    self.sampleView.layer.borderColor = [UIColor purpleColor].CGColor;
+    self.sampleView.layer.borderWidth = 1.0;
     self.sampleView.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;
     [self.view addSubview:self.sampleView];
     
@@ -50,12 +59,13 @@
     
     self.view.backgroundColor = [UIColor whiteColor];
     [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
+    
+    [self commomInitTitle];
 }
 
 - (void)viewWillLayoutSubviews {
     self.titleLabel.frame = CGRectMake((self.view.frame.size.width - 120)/2, 5, 120, 50);
     self.sampleView.frame  = CGRectMake((self.view.frame.size.width - 300)/2, 60, 300, 120);
-//    self.colorView.frame = CGRectMake(0, 190, self.view.frame.size.width, 90);
     self.opacitySliderView.frame = CGRectMake(0, 280, self.view.frame.size.width, 90);
     self.colorPicker.frame = self.view.frame;
 }
@@ -70,6 +80,14 @@
     self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact ? 270 : 420);
 }
 
+#pragma mark - Protect Methods
+
+- (void)commomInitTitle {
+    self.titleLabel.text = NSLocalizedString(@"Note", nil);
+}
+
+#pragma mark - CPDFColorSelectViewDelegate
+
 - (void)colorSelect:(CPDFColorSelectView *)select {
     _colorPicker = [[CPDFColorPickerView alloc] initWithFrame:self.view.frame];
     _colorView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;

+ 4 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFBase/CPDFAnnotationBaseViewController_Header.h

@@ -23,6 +23,10 @@
 
 @property (nonatomic, strong) CPDFColorPickerView *colorPicker;
 
+@property (nonatomic, strong) UILabel *titleLabel;
+
+- (void)commomInitTitle;
+
 @end
 
 #endif /* CPDFAnnotationBaseViewController_Header_h */

+ 21 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFHighlight/CPDFHighlightViewController.h

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

+ 31 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFHighlight/CPDFHighlightViewController.m

@@ -0,0 +1,31 @@
+//
+//  CPDFHighlightViewController.m
+//  compdfkit-tools
+//
+//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
+//
+//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
+//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
+//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
+//  This notice may not be removed from this file.
+//
+
+#import "CPDFHighlightViewController.h"
+#import "CPDFAnnotationBaseViewController_Header.h"
+
+@interface CPDFHighlightViewController ()
+
+@end
+
+@implementation CPDFHighlightViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view.
+}
+
+- (void)commomInitTitle {
+    self.titleLabel.text = NSLocalizedString(@"Highlight", nil);
+}
+
+@end

+ 32 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFNote/CPDFNoteOpenViewController.h

@@ -0,0 +1,32 @@
+//
+//  CPDFNoteOpenViewController.h
+//  compdfkit-tools
+//
+//  Created by kdanmobile_2 on 2023/4/26.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@class CPDFNoteOpenViewController;
+
+@protocol CPDFNoteOpenViewControllerDelegate <NSObject>
+
+@optional
+
+- (void)getNoteOpenViewController:(CPDFNoteOpenViewController *)noteOpenVC content:(NSString *)content isDelete:(BOOL)isDelete;
+
+@end
+
+@interface CPDFNoteOpenViewController : UIViewController
+
+@property (nonatomic, weak) id<CPDFNoteOpenViewControllerDelegate> delegate;
+
+- (void)setContent:(NSString *)content;
+
+- (void)showViewController:(UIViewController *)viewController inRect:(CGRect)rect;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 122 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFNote/CPDFNoteOpenViewController.m

@@ -0,0 +1,122 @@
+//
+//  CPDFNoteOpenViewController.m
+//  compdfkit-tools
+//
+//  Created by kdanmobile_2 on 2023/4/26.
+//
+
+#import "CPDFNoteOpenViewController.h"
+
+@interface CPDFNoteOpenViewController () <UIPopoverPresentationControllerDelegate>
+
+@property (nonatomic, strong) UITextView *noteTextView;
+
+@property (nonatomic, strong) NSString *textViewContent;
+
+@end
+
+@implementation CPDFNoteOpenViewController
+
+#pragma mark - UIViewController Methods
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view.
+    [self.view setBackgroundColor:[UIColor colorWithRed:253.0/255.0 green:246.0/255.0 blue:214.0/255.0 alpha:1.0]];
+    
+    _noteTextView = [[UITextView alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height-35)];
+    _noteTextView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
+    [_noteTextView setBackgroundColor:[UIColor clearColor]];
+    [_noteTextView setFont:[UIFont systemFontOfSize:14]];
+    [_noteTextView setTextAlignment:NSTextAlignmentLeft];
+    [_noteTextView setTextColor:[UIColor blackColor]];
+    [self.view addSubview:_noteTextView];
+    _noteTextView.text = self.textViewContent;
+    
+    UIButton *deleteButton = [UIButton buttonWithType:UIButtonTypeSystem];
+    [deleteButton setTitle:NSLocalizedString(@"Delete", nil) forState:UIControlStateNormal];
+    [deleteButton sizeToFit];
+    CGRect frame = deleteButton.frame;
+    frame.origin.x = 10;
+    frame.origin.y = self.view.bounds.size.height-deleteButton.bounds.size.height-10;
+    deleteButton.frame = frame;
+    deleteButton.autoresizingMask = UIViewAutoresizingFlexibleTopMargin;
+    [deleteButton addTarget:self action:@selector(buttonItemClicked_Delete:) forControlEvents:UIControlEventTouchUpInside];
+    [self.view addSubview:deleteButton];
+    
+    UIButton *saveButton = [UIButton buttonWithType:UIButtonTypeSystem];
+    [saveButton setTitle:NSLocalizedString(@"Save", nil) forState:UIControlStateNormal];
+    [saveButton sizeToFit];
+    frame = saveButton.frame;
+    frame.origin.x = self.view.bounds.size.width-saveButton.bounds.size.width-10;
+    frame.origin.y = self.view.bounds.size.height-saveButton.bounds.size.height-10;
+    saveButton.frame = frame;
+    saveButton.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleTopMargin;
+    [saveButton addTarget:self action:@selector(buttonItemClicked_Save:) forControlEvents:UIControlEventTouchUpInside];
+    [self.view addSubview:saveButton];
+}
+
+- (void)viewDidAppear:(BOOL)animation {
+    [super viewDidAppear:animation];
+    
+    [_noteTextView becomeFirstResponder];
+}
+
+- (void)viewWillDisappear:(BOOL)animation {
+    [super viewWillDisappear:animation];
+    
+    if ([_noteTextView isFirstResponder]) {
+        [_noteTextView resignFirstResponder];
+    }
+}
+
+#pragma mark - Public Methods
+
+- (void)setContent:(NSString *)content {
+    if (!content) {
+        self.textViewContent = @"";
+    } else {
+        self.textViewContent = content;
+    }
+}
+
+- (void)showViewController:(UIViewController *)viewController inRect:(CGRect)rect {
+    self.preferredContentSize = CGSizeMake(300, 240);
+    self.modalPresentationStyle = UIModalPresentationPopover;
+    UIPopoverPresentationController *popVC = self.popoverPresentationController;
+    popVC.delegate = self;
+    popVC.sourceRect = rect;
+    popVC.sourceView = viewController.view;
+    [viewController presentViewController:self animated:YES completion:nil];
+}
+
+#pragma mark - Button Event Action
+- (void)buttonItemClicked_Delete:(id)sender {
+    [self dismissViewControllerAnimated:YES completion:^{
+        if (self.delegate && [self.delegate respondsToSelector:@selector(getNoteOpenViewController:content:isDelete:)]) {
+            [self.delegate getNoteOpenViewController:self content:@"" isDelete:YES];
+        }
+    }];
+}
+
+- (void)buttonItemClicked_Save:(id)sender {
+    [self dismissViewControllerAnimated:YES completion:^{
+        if (self.delegate && [self.delegate respondsToSelector:@selector(getNoteOpenViewController:content:isDelete:)]) {
+            [self.delegate getNoteOpenViewController:self content:self.noteTextView.text isDelete:NO];
+        }
+    }];
+}
+
+#pragma mark - UIPopoverPresentationControllerDelegate
+
+- (UIModalPresentationStyle)adaptivePresentationStyleForPresentationController:(UIPresentationController *)controller traitCollection:(UITraitCollection *)traitCollection {
+    return UIModalPresentationNone;
+}
+
+- (void)popoverPresentationControllerDidDismissPopover:(UIPopoverPresentationController *)popoverPresentationController {
+    if (self.delegate && [self.delegate respondsToSelector:@selector(getNoteOpenViewController:content:isDelete:)]) {
+        [self.delegate getNoteOpenViewController:self content:self.noteTextView.text isDelete:NO];
+    }
+}
+
+@end

+ 27 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFNote/CPDFNoteViewController.h

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

+ 106 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFNote/CPDFNoteViewController.m

@@ -0,0 +1,106 @@
+//
+//  CPDFNoteViewController.m
+//  compdfkit-tools
+//
+//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
+//
+//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
+//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
+//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
+//  This notice may not be removed from this file.
+//
+
+#import "CPDFNoteViewController.h"
+#import "CPDFAnnotationSampleView.h"
+#import "CPDFColorSelectView.h"
+#import "CPDFColorPickerView.h"
+#import "CAnnotStyle.h"
+
+@interface CPDFNoteViewController () <CPDFColorSelectViewDelegate>
+
+@property (nonatomic, strong) CPDFAnnotationSampleView *sampleView;
+
+@property (nonatomic, strong) CPDFColorSelectView *colorView;
+
+@property (nonatomic, strong) CPDFColorPickerView *colorPicker;
+
+@property (nonatomic, strong) UILabel *titleLabel;
+
+@property (nonatomic, strong) CAnnotStyle *annotStyle;
+
+@end
+
+@implementation CPDFNoteViewController
+
+#pragma mark - Initializers
+
+- (instancetype)initWithStyle:(CAnnotStyle *)annotStyle {
+    if (self = [super init]) {
+        self.annotStyle = annotStyle;
+    }
+    return self;
+}
+
+#pragma mark - ViewController Methods
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view.
+    self.titleLabel = [[UILabel alloc] init];
+    self.titleLabel.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;
+    self.titleLabel.text = NSLocalizedString(@"Note", nil);
+    self.titleLabel.font = [UIFont systemFontOfSize:20];
+    self.titleLabel.adjustsFontSizeToFitWidth = YES;
+    [self.view addSubview:self.titleLabel];
+    
+    self.sampleView = [[CPDFAnnotationSampleView alloc] init];
+    self.sampleView.backgroundColor = [UIColor whiteColor];
+    self.sampleView.layer.borderColor = [UIColor purpleColor].CGColor;
+    self.sampleView.layer.borderWidth = 1.0;
+    self.sampleView.fillColor = [UIColor redColor];
+    self.sampleView.selecIndex = 0;
+    self.sampleView.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;
+    [self.view addSubview:self.sampleView];
+    
+    self.colorView = [[CPDFColorSelectView alloc] initWithFrame:CGRectMake(0, 190, self.view.frame.size.width, 90)];
+    self.colorView.delegate = self;
+    self.colorView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
+    [self.view addSubview:self.colorView];
+    
+    self.view.backgroundColor = [UIColor whiteColor];
+    [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
+}
+
+- (void)viewWillLayoutSubviews {
+    self.titleLabel.frame = CGRectMake((self.view.frame.size.width - 120)/2, 5, 120, 50);
+    self.sampleView.frame  = CGRectMake((self.view.frame.size.width - 300)/2, 60, 300, 120);
+    self.colorPicker.frame = self.view.frame;
+}
+
+- (void)willTransitionToTraitCollection:(UITraitCollection *)newCollection withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
+    [super willTransitionToTraitCollection:newCollection withTransitionCoordinator:coordinator];
+    [self updatePreferredContentSizeWithTraitCollection:newCollection];
+}
+
+#pragma mark - Protect Methods
+
+- (void)updatePreferredContentSizeWithTraitCollection:(UITraitCollection *)traitCollection
+{
+    self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact ? 270 : 320);
+}
+
+#pragma mark - CPDFColorSelectViewDelegate
+
+- (void)colorSelect:(CPDFColorSelectView *)select {
+    _colorPicker = [[CPDFColorPickerView alloc] initWithFrame:self.view.frame];
+    _colorView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
+    _colorPicker.backgroundColor = [UIColor whiteColor];
+    [self.view addSubview:self.colorPicker];
+}
+
+- (void)getColor:(UIColor *)color {
+    self.sampleView.fillColor = color;
+    [self.sampleView setNeedsDisplay];
+}
+
+@end

+ 16 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStrikeout/CPDFStrikeoutViewController.h

@@ -0,0 +1,16 @@
+//
+//  CPDFStrikeoutViewController.h
+//  compdfkit-tools
+//
+//  Created by kdanmobile_2 on 2023/4/26.
+//
+
+#import <compdfkit_tools/compdfkit_tools.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface CPDFStrikeoutViewController : CPDFAnnotationBaseViewController
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 26 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStrikeout/CPDFStrikeoutViewController.m

@@ -0,0 +1,26 @@
+//
+//  CPDFStrikeoutViewController.m
+//  compdfkit-tools
+//
+//  Created by kdanmobile_2 on 2023/4/26.
+//
+
+#import "CPDFStrikeoutViewController.h"
+#import "CPDFAnnotationBaseViewController_Header.h"
+
+@interface CPDFStrikeoutViewController ()
+
+@end
+
+@implementation CPDFStrikeoutViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view.
+}
+
+- (void)commomInitTitle {
+    self.titleLabel.text = NSLocalizedString(@"Strikeout", nil);
+}
+
+@end

+ 21 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFUnderline/CPDFUnderlineViewController.h

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

+ 31 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFUnderline/CPDFUnderlineViewController.m

@@ -0,0 +1,31 @@
+//
+//  CPDFUnderlineViewController.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 "CPDFUnderlineViewController.h"
+#import "CPDFAnnotationBaseViewController_Header.h"
+
+@interface CPDFUnderlineViewController ()
+
+@end
+
+@implementation CPDFUnderlineViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view.
+}
+
+- (void)commomInitTitle {
+    self.titleLabel.text = NSLocalizedString(@"Underline", nil);
+}
+
+@end

+ 2 - 2
compdfkit-tools/compdfkit-tools/Common/Model/CAnnotStyle.h

@@ -23,11 +23,11 @@ NS_ASSUME_NONNULL_BEGIN
 
 @property (nonatomic, strong) NSString *type;
 
-@property (nonatomic, assign) CGRect *bounds;
+@property (nonatomic, assign) CGRect bounds;
 
 @property (nonatomic, strong) NSString *contents;
 
-@property (nonatomic, assign) CGFloat *borderWidth;
+@property (nonatomic, assign) CGFloat borderWidth;
 
 @property (nonatomic, strong) CPDFPage *page;
 

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

@@ -34,6 +34,7 @@ typedef NS_ENUM(NSInteger, CPDFToolbarSelectedIndex) {
 NS_ASSUME_NONNULL_BEGIN
 
 @class CPDFAnnotationBar;
+@class CPDFListView;
 
 @protocol CPDFAnnotationBarDelegate <NSObject>
 
@@ -41,6 +42,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 - (void)clickAnnotationBar:(CPDFAnnotationBar *)annotationBar forIndex:(NSInteger)index forSelected:(BOOL)isSelected forAnnotationBarButton:(UIButton *)buttom;
 
+- (void)pushAnnotView:(id)annViewController;
+
 @end
 
 @interface CPDFAnnotationBar : UIView
@@ -49,8 +52,14 @@ NS_ASSUME_NONNULL_BEGIN
 
 @property (nonatomic, weak) id<CPDFAnnotationBarDelegate> delegate;
 
+@property (nonatomic, strong) UIViewController *parentVC;
+
+@property (nonatomic, readonly) CPDFListView *pdfListView;
+
 - (void)reloadData;
 
+- (instancetype)initPDFView:(CPDFListView *)pdfListView;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 141 - 11
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/CPDFAnnotationBar.m

@@ -12,10 +12,17 @@
 
 #import "CPDFAnnotationBar.h"
 #import "CPDFAnnotationBarButton.h"
+#import "CPDFNoteViewController.h"
+#import "CPDFHighlightViewController.h"
+#import "CPDFStrikeoutViewController.h"
+#import "CAnnotStyle.h"
+#import "CPDFListView.h"
+#import "CAnnotationManage.h"
+#import "CPDFNoteOpenViewController.h"
 
 #import <ComPDFKit/ComPDFKit.h>
 
-@interface CPDFAnnotationBar ()
+@interface CPDFAnnotationBar () <CPDFListViewDelegate, CPDFNoteOpenViewControllerDelegate>
 
 @property (nonatomic, strong) UIScrollView *scrollView;
 
@@ -31,26 +38,33 @@
 
 @property (nonatomic, strong) UIButton *redoBtn;
 
+@property (nonatomic, strong) CPDFListView *pdfListView;
+
+@property (nonatomic, strong) CAnnotationManage *annotManage;
+
 @end
 
 @implementation CPDFAnnotationBar
 
 #pragma mark - Initializers
 
-- (instancetype)initWithFrame:(CGRect)frame {
-    if (self = [super initWithFrame:frame]) {
+- (instancetype)initPDFView:(CPDFListView *)pdfListView {
+    if (self = [super init]) {
         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)];
+        UIView *line = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.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.pdfListView = pdfListView;
+        self.pdfListView.performDelegate = self;
 
         [self initSubview];
     }
@@ -162,26 +176,119 @@
 #pragma mark - Action
 
 - (void)buttonItemClicked_Switch:(UIButton *)button {
+    self.propertiesBtn.userInteractionEnabled = YES;
+    self.propertiesBtn.tag = button.tag;
     if (self.selectedIndex >= 0 && self.selectedIndex < self.annotationBtns.count) {
         UIButton *selectButton = [self.annotationBtns objectAtIndex:self.selectedIndex];
         selectButton.backgroundColor = [UIColor clearColor];
     }
+    
     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 && [self.delegate respondsToSelector:@selector(clickAnnotationBar:forIndex:forSelected:forAnnotationBarButton:)]) {
-            [self.delegate clickAnnotationBar:self forIndex:self.selectedIndex forSelected:YES forAnnotationBarButton:button];
-        }
     } else {
-        if (self.delegate && [self.delegate respondsToSelector:@selector(clickAnnotationBar:forIndex:forSelected:forAnnotationBarButton:)]) {
-            [self.delegate clickAnnotationBar:self forIndex:self.selectedIndex forSelected:YES forAnnotationBarButton:button];
-        }
         self.selectedIndex = -1;
     }
+    
+    switch (self.selectedIndex) {
+        case CPDFToolbarNote:
+        {
+            self.pdfListView.annotationMode = CPDFViewAnnotationModeNote;
+        }
+            break;
+        case CPDFToolbarHighlight:
+        {
+            self.pdfListView.annotationMode = CPDFViewAnnotationModeHighlight;
+        }
+            break;
+        case CPDFToolbarUnderline:
+        {
+            self.pdfListView.annotationMode = CPDFViewAnnotationModeUnderline;
+        }
+            break;
+        case CPDFToolbarStrikeout:
+        {
+            self.pdfListView.annotationMode = CPDFViewAnnotationModeStrikeout;
+        }
+            break;
+        case CPDFToolbarSquiggly:
+        {
+            self.pdfListView.annotationMode = CPDFViewAnnotationModeSquiggly;
+        }
+            break;
+        case CPDFToolbarFreehand:
+        {
+            
+        }
+            break;
+        case CPDFToolbarShapeCircle:
+        {
+            self.pdfListView.annotationMode = CPDFViewAnnotationModeCircle;
+        }
+            break;
+        case CPDFToolbarShapeRectangle:
+        {
+            self.pdfListView.annotationMode = CPDFViewAnnotationModeSquare;
+        }
+            break;
+        case CPDFToolbarShapeArrow:
+        {
+            self.pdfListView.annotationMode = CPDFViewAnnotationModeArrow;
+        }
+            break;
+            
+        default:
+        {
+            self.pdfListView.annotationMode = CPDFViewAnnotationModeNone;
+        }
+            break;
+    }
 }
 
 - (void)buttonItemClicked_open:(UIButton *)button {
-    
+    switch (button.tag) {
+        case 0:
+        {
+            CAnnotStyle *annotStytle = [[CAnnotStyle alloc] init];
+            CPDFNoteViewController *noteVC = [[CPDFNoteViewController alloc] initWithStyle:annotStytle];
+            AAPLCustomPresentationController *presentationController NS_VALID_UNTIL_END_OF_SCOPE;
+
+            presentationController = [[AAPLCustomPresentationController alloc] initWithPresentedViewController:noteVC presentingViewController:self.parentVC];
+            noteVC.transitioningDelegate = presentationController;
+            [self.parentVC presentViewController:noteVC animated:YES completion:nil];
+        }
+            break;
+        case 1:
+        {
+            CAnnotStyle *annotStyle = [[CAnnotStyle alloc] init];
+            CPDFHighlightViewController *highlightVC = [[CPDFHighlightViewController alloc] initWithStyle:annotStyle];
+            AAPLCustomPresentationController *presentationController NS_VALID_UNTIL_END_OF_SCOPE;
+
+            presentationController = [[AAPLCustomPresentationController alloc] initWithPresentedViewController:highlightVC presentingViewController:self.parentVC];
+            highlightVC.transitioningDelegate = presentationController;
+            [self.parentVC presentViewController:highlightVC animated:YES completion:nil];
+            
+        }
+            break;
+        case 2:
+        {
+            
+        }
+            break;
+        case 3:
+        {
+            CAnnotStyle *annotStyle = [[CAnnotStyle alloc] init];
+            CPDFStrikeoutViewController *strikeoutVC = [[CPDFStrikeoutViewController alloc] initWithStyle:annotStyle];
+            AAPLCustomPresentationController *presentationController NS_VALID_UNTIL_END_OF_SCOPE;
+
+            presentationController = [[AAPLCustomPresentationController alloc] initWithPresentedViewController:strikeoutVC presentingViewController:self.parentVC];
+            strikeoutVC.transitioningDelegate = presentationController;
+            [self.parentVC presentViewController:strikeoutVC animated:YES completion:nil];
+        }
+            break;
+        default:
+            break;
+    }
 }
 
 - (void)buttonItemClicked_undo:(UIButton *)button {
@@ -192,4 +299,27 @@
     
 }
 
+#pragma mark - CPDFListViewDelegate
+
+- (void)PDFViewPerformOpenNote:(CPDFListView *)pdfView forAnnotation:(CPDFAnnotation *)annotation {
+    CGRect rect = [pdfView convertRect:annotation.bounds fromPage:annotation.page];
+    CPDFNoteOpenViewController *noteOpenVC = [[CPDFNoteOpenViewController alloc] init];
+    noteOpenVC.delegate = self;
+    [noteOpenVC setContent:annotation.contents];
+    [noteOpenVC showViewController:self.parentVC inRect:rect];
+    
+    self.annotManage = [[CAnnotationManage alloc] initWithPDFView:pdfView annotation:annotation];
+}
+
+#pragma mark - CPDFNoteOpenViewControllerDelegate
+
+- (void)getNoteOpenViewController:(CPDFNoteOpenViewController *)noteOpenVC content:(NSString *)content isDelete:(BOOL)isDelete {
+    if (isDelete) {
+        [self.annotManage.annotation.page removeAnnotation:self.annotManage.annotation];
+        [self.pdfListView setNeedsDisplayForPage:self.annotManage.annotation.page];
+    } else {
+        self.annotManage.annotation.contents = content;
+    }
+}
+
 @end

+ 13 - 11
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFAnnotationSampleView.h

@@ -18,17 +18,17 @@ typedef NS_ENUM(NSInteger, CPDFSamplesSelectedIndex) {
     CPDFSamplesUnderline,
     CPDFSamplesStrikeout,
     CPDFSamplesSquiggly,
-    CPDFToolbarFreehand,
-    CPDFToolbarShapeCircle,
-    CPDFToolbarShapeRectangle,
-    CPDFToolbarShapeArrow,
-    CPDFToolbarShapeLine,
-    CPDFToolbarFreeText,
-    CPDFToolbarSignature,
-    CPDFToolbarStamp,
-    CPDFToolbarImage,
-    CPDFToolbarLink,
-    CPDFToolbarLSound,
+    CPDFSamplesFreehand,
+    CPDFSamplesShapeCircle,
+    CPDFSamplesShapeRectangle,
+    CPDFSamplesShapeArrow,
+    CPDFSamplesShapeLine,
+    CPDFSamplesFreeText,
+    CPDFSamplesSignature,
+    CPDFSamplesStamp,
+    CPDFSamplesImage,
+    CPDFSamplesLink,
+    CPDFSamplesSound,
 };
 
 NS_ASSUME_NONNULL_BEGIN
@@ -37,6 +37,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 @property (nonatomic, assign) CPDFSamplesSelectedIndex selecIndex;
 
+@property (nonatomic, strong) UIColor *fillColor;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 20 - 1
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFAnnotationSampleView.m

@@ -12,6 +12,12 @@
 
 #import "CPDFAnnotationSampleView.h"
 
+@interface CPDFAnnotationSampleView ()
+
+@property (nonatomic, assign) CGRect centerRect;
+
+@end
+
 @implementation CPDFAnnotationSampleView
 
 #pragma mark - Initializers
@@ -26,6 +32,7 @@
 - (void)drawRect:(CGRect)rect {
     [super drawRect:rect];
     CGContextRef context = UIGraphicsGetCurrentContext();
+    self.centerRect = CGRectInset(rect, 130, 40);
     
     [self drawSamples:context];
 }
@@ -33,7 +40,19 @@
 #pragma mark - Private Methods
 
 - (void)drawSamples:(CGContextRef)context {
-    
+    switch (self.selecIndex) {
+        case CPDFSamplesNote:
+        {
+            CGContextSetFillColorWithColor(context, self.fillColor.CGColor);
+            CGContextFillRect(context, self.centerRect);
+            UIImage *image = [UIImage imageNamed:@"CPDFAnnotationBarImageNote" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil];
+            [image drawInRect:self.centerRect];
+        }
+            break;
+            
+        default:
+            break;
+    }
 }
 
 @end

+ 5 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFColorPickerView.m

@@ -45,6 +45,7 @@
         _backBtn = [[UIButton alloc] initWithFrame:CGRectMake(10, 0, 40, (self.bounds.size.height - 40)/6)];
         _backBtn.autoresizingMask = UIViewAutoresizingFlexibleHeight;
         [_backBtn setImage:[UIImage imageNamed:@"CPDFAnnotationBarImageUndo" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
+        [_backBtn addTarget:self action:@selector(buttonItemClicked_back:) forControlEvents:UIControlEventTouchUpInside];
         [self addSubview:self.backBtn];
         
         _selectedLabel = [[UILabel alloc] initWithFrame:CGRectMake(15, (self.bounds.size.height - 40)/6, self.bounds.size.width - 30, (self.bounds.size.height - 40)/6 * 3)];
@@ -155,4 +156,8 @@
     [self reloadData];
 }
 
+- (void)buttonItemClicked_back:(id)sender {
+    [self removeFromSuperview];
+}
+
 @end

+ 1 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFColorSelectView.h

@@ -21,6 +21,7 @@ NS_ASSUME_NONNULL_BEGIN
 @optional
 
 - (void)colorSelect:(CPDFColorSelectView *)select;
+- (void)getColor:(UIColor *)color;
 
 @end
 

+ 6 - 3
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFColorSelectView.m

@@ -65,8 +65,12 @@
 
 - (void)buttonItemClicked_select:(UIButton *)button {
     switch (button.tag) {
-        case 0:
-            NSLog(@"");
+        case 1 ... 4:
+        {
+            if (self.delegate && [self.delegate respondsToSelector:@selector(getColor:)]) {
+                [self.delegate getColor:button.backgroundColor];
+            }
+        }
             break;
         case 5:{
             if ([self.delegate respondsToSelector:@selector(colorSelect:)]) {
@@ -76,7 +80,6 @@
         }
 
         default:
-            NSLog(@" ");
             break;
     }
 }

+ 5 - 1
compdfkit-tools/compdfkit-tools/Common/Views/PDFView/PDFListView/CPDFListView.h

@@ -46,8 +46,12 @@ typedef NS_ENUM(NSInteger, CPDFViewAnnotationMode) {
 
 @protocol CPDFListViewDelegate <NSObject>
 
+@optional
+
 - (NSArray<UIMenuItem *> *)PDFListView:(CPDFListView *)pdfListView customizeMenuForPage:(CPDFPage *)page forPagePoint:(CGPoint)pagePoint;
 
+- (void)PDFViewPerformOpenNote:(CPDFListView *)pdfView forAnnotation:(CPDFAnnotation *)annotation;
+
 @end
 
 #pragma mark - CPDFListView
@@ -60,7 +64,7 @@ typedef NS_ENUM(NSInteger, CPDFViewAnnotationMode) {
 
 @property (nonatomic, assign) CPDFViewAnnotationMode annotationMode;
 
-@property (nonatomic, strong) CPDFAnnotation *activeAnnotation;
+@property (nullable, nonatomic, strong) CPDFAnnotation *activeAnnotation;
 
 @property (nonatomic, strong) CPDFAnnotation *addAnnotation;
 

+ 775 - 11
compdfkit-tools/compdfkit-tools/Common/Views/PDFView/PDFListView/CPDFListView.m

@@ -16,15 +16,15 @@
 #import "CPDFSlider.h"
 #import "CPDFPageIndicatorView.h"
 
-typedef NS_ENUM(NSInteger, PDFAnnotationDraggingType) {
-    PDFAnnotationDraggingNone = 0,
-    PDFAnnotationDraggingCenter,
-    PDFAnnotationDraggingTopLeft,
-    PDFAnnotationDraggingTopRight,
-    PDFAnnotationDraggingBottomLeft,
-    PDFAnnotationDraggingBottomRight,
-    PDFAnnotationDraggingStart,
-    PDFAnnotationDraggingEnd
+typedef NS_ENUM(NSInteger, CPDFAnnotationDraggingType) {
+    CPDFAnnotationDraggingNone = 0,
+    CPDFAnnotationDraggingCenter,
+    CPDFAnnotationDraggingTopLeft,
+    CPDFAnnotationDraggingTopRight,
+    CPDFAnnotationDraggingBottomLeft,
+    CPDFAnnotationDraggingBottomRight,
+    CPDFAnnotationDraggingStart,
+    CPDFAnnotationDraggingEnd
 };
 
 @interface  CPDFListView()
@@ -33,7 +33,7 @@ typedef NS_ENUM(NSInteger, PDFAnnotationDraggingType) {
 
 @property (nonatomic, strong) CPDFPageIndicatorView * pageIndicatorView;
 
-@property (nonatomic, assign) PDFAnnotationDraggingType draggingType;
+@property (nonatomic, assign) CPDFAnnotationDraggingType draggingType;
 
 @property (nonatomic, assign) CGPoint draggingPoint;
 
@@ -81,6 +81,74 @@ typedef NS_ENUM(NSInteger, PDFAnnotationDraggingType) {
     return self;
 }
 
+- (void)setAnnotationMode:(CPDFViewAnnotationMode)annotationMode {
+    _annotationMode = annotationMode;
+    
+    if (CPDFViewAnnotationModeHighlight == annotationMode ||
+        CPDFViewAnnotationModeUnderline == annotationMode ||
+        CPDFViewAnnotationModeStrikeout == annotationMode ||
+        CPDFViewAnnotationModeSquiggly == annotationMode) {
+        self.textSelectionMode = YES;
+    } else {
+        self.textSelectionMode = NO;
+    }
+    
+    if (CPDFViewAnnotationModeLink == annotationMode) {
+        self.scrollEnabled = NO;
+        [self endDrawing];
+    } else if (CPDFViewAnnotationModeInk == annotationMode) {
+        self.scrollEnabled = NO;
+        [self beginDrawing];
+    } else {
+        if (self.activeAnnotation) {
+            self.scrollEnabled = NO;
+        } else {
+            self.scrollEnabled = YES;
+        }
+        [self endDrawing];
+        [self becomeFirstResponder];
+    }
+    
+    if (CPDFViewAnnotationModeNone != annotationMode) {
+        CPDFPage *page = self.activeAnnotation.page;
+        self.activeAnnotation = nil;
+        [self setNeedsDisplayForPage:page];
+    }
+}
+
+- (void)updateScrollEnabled {
+    if (self.activeAnnotation) {
+        self.scrollEnabled = NO;
+    } else {
+        if (CPDFViewAnnotationModeLink == self.annotationMode) {
+            self.scrollEnabled = NO;
+        } else {
+            self.scrollEnabled = YES;
+        }
+    }
+}
+
+- (NSString *)annotationUserName {
+    NSString *annotationUserName = CPDFKitShareConfig.annotationAuthor;
+    if (!annotationUserName || [annotationUserName length] <= 0) {
+        annotationUserName = [[UIDevice currentDevice] name];
+    }
+    return annotationUserName ? : @"";
+}
+
+- (UIImage *)compressImage:(UIImage *)image size:(CGSize)size {
+    CGFloat imageScale = 1.0;
+    if (image.size.width > size.width || image.size.height > size.height) {
+        imageScale = MIN(size.width / image.size.width, size.height / image.size.height);
+    }
+    CGSize newSize = CGSizeMake(image.size.width * imageScale, image.size.height * imageScale);
+    UIGraphicsBeginImageContext(newSize);
+    [image drawInRect:CGRectMake(0, 0, newSize.width, newSize.height)];
+    UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
+    UIGraphicsEndImageContext();
+    return newImage;
+}
+
 #pragma mark - Touch
 
 - (void)touchBeganAtPoint:(CGPoint)point forPage:(CPDFPage *)page {
@@ -92,6 +160,45 @@ typedef NS_ENUM(NSInteger, PDFAnnotationDraggingType) {
         
     } else {
     }
+    
+    if (self.textSelectionMode) {
+
+    } else {
+        self.addLinkPoint = point;
+        self.addLinkRect = CGRectZero;
+        
+        self.draggingType = CPDFAnnotationDraggingNone;
+        if (!self.activeAnnotation || self.activeAnnotation.page != page) {
+            return;
+        }
+        CGRect topLeftRect = CGRectInset(self.topLeftRect, -5, -5);
+        CGRect bottomLeftRect = CGRectInset(self.bottomLeftRect, -5, -5);
+        CGRect topRightRect = CGRectInset(self.topRightRect, -5, -5);
+        CGRect bottomRightRect = CGRectInset(self.bottomRightRect, -5, -5);
+        CGRect startPointRect = CGRectInset(self.startPointRect, -5, -5);
+        CGRect endPointRect = CGRectInset(self.endPointRect, -5, -5);
+        if (CGRectContainsPoint(topLeftRect, point)) {
+            self.draggingType = CPDFAnnotationDraggingBottomLeft;
+        } else if (CGRectContainsPoint(topRightRect, point)) {
+            self.draggingType = CPDFAnnotationDraggingTopRight;
+        } else if (CGRectContainsPoint(bottomRightRect, point)) {
+            self.draggingType = CPDFAnnotationDraggingBottomRight;
+        } else if (CGRectContainsPoint(startPointRect, point)) {
+            self.draggingType = CPDFAnnotationDraggingStart;
+        } else if (CGRectContainsPoint(endPointRect, point)) {
+            self.draggingType = CPDFAnnotationDraggingEnd;
+        } else if ([page annotation:self.activeAnnotation atPoint:point]) {
+            self.draggingType = CPDFAnnotationDraggingCenter;
+        }
+        self.draggingPoint = point;
+        
+        if (CPDFAnnotationDraggingCenter == self.draggingType) {
+            if ([self.activeAnnotation isKindOfClass:[CPDFFreeTextAnnotation class]] ||
+                [self.activeAnnotation isKindOfClass:[CPDFSignatureAnnotation class]]) {
+//                [self addMagnifierAtPoint:point forPage:page];
+            }
+        }
+    }
 }
 
 - (void)touchMovedAtPoint:(CGPoint)point forPage:(CPDFPage *)page {
@@ -103,6 +210,39 @@ typedef NS_ENUM(NSInteger, PDFAnnotationDraggingType) {
         
     } else {
     }
+    
+    if (self.textSelectionMode) {
+        
+    } else if (CPDFAnnotationDraggingNone != self.draggingType) {
+        [self moveAnnotation:self.activeAnnotation fromPoint:self.draggingPoint toPoint:point forType:self.draggingType];
+        [self setNeedsDisplayForPage:page];
+        self.draggingPoint = point;
+        
+        if (CPDFAnnotationDraggingCenter == self.draggingType) {
+            if ([self.activeAnnotation isKindOfClass:[CPDFFreeTextAnnotation class]] ||
+                [self.activeAnnotation isKindOfClass:[CPDFSignatureAnnotation class]]) {
+//                [self addMagnifierAtPoint:point forPage:page];
+            }
+        }
+    } else if (CPDFViewAnnotationModeLink == self.annotationMode) {
+        CGRect rect = CGRectZero;
+        if (point.x > self.addLinkPoint.x) {
+            rect.origin.x = self.addLinkPoint.x;
+            rect.size.width = point.x-self.addLinkPoint.x;
+        } else {
+            rect.origin.x = point.x;
+            rect.size.width = self.addLinkPoint.x-point.x;
+        }
+        if (point.y > self.addLinkPoint.y) {
+            rect.origin.y = self.addLinkPoint.y;
+            rect.size.height = point.y-self.addLinkPoint.y;
+        } else {
+            rect.origin.y = point.y;
+            rect.size.height = self.addLinkPoint.y-point.y;
+        }
+        self.addLinkRect = rect;
+        [self setNeedsDisplayForPage:page];
+    }
 }
 
 - (void)touchEndedAtPoint:(CGPoint)point forPage:(CPDFPage *)page {
@@ -114,6 +254,109 @@ typedef NS_ENUM(NSInteger, PDFAnnotationDraggingType) {
         
     } else {
     }
+    if (self.textSelectionMode) {
+        if (self.currentSelection) {
+            [self addAnnotation:self.annotationMode atPoint:point forPage:page];
+        } else {
+            CPDFAnnotation *annotation = [page annotationAtPoint:point];
+            if ([annotation isKindOfClass:[CPDFMarkupAnnotation class]]) {
+//                [self showMenuForAnnotation:annotation];
+            }
+        }
+    } else if (CPDFAnnotationDraggingNone == self.draggingType) {
+        if (self.activeAnnotation) {
+            CPDFPage *previousPage = self.activeAnnotation.page;
+            self.activeAnnotation = nil;
+            [self setNeedsDisplayForPage:previousPage];
+            [self updateScrollEnabled];
+        } else {
+            if (CPDFViewAnnotationModeNone == self.annotationMode) {
+                CPDFAnnotation *annotation = [page annotationAtPoint:point];
+                if ([annotation isKindOfClass:[CPDFTextAnnotation class]]) {
+                    if ([self.performDelegate respondsToSelector:@selector(PDFViewPerformOpenNote:forAnnotation:)]) {
+                        [self.performDelegate PDFViewPerformOpenNote:self forAnnotation:annotation];
+                    }
+                } else if ([annotation isKindOfClass:[CPDFMarkupAnnotation class]]) {
+//                    if (CGRectContainsPoint(annotation.bounds, point)) {
+//                        [self showMenuForAnnotation:annotation];
+//                    } else {
+//                        if ([self.performDelegate respondsToSelector:@selector(PDFViewPerformPopup:forAnnotation:)]) {
+//                            [self.performDelegate PDFViewPerformPopup:self forAnnotation:(CPDFMarkupAnnotation *)annotation];
+//                        }
+//                    }
+                } else if ([annotation isKindOfClass:[CPDFLinkAnnotation class]]) {
+                    [super touchEndedAtPoint:point forPage:page];
+                } else if ([annotation isKindOfClass:[CPDFMovieAnnotation class]]) {
+                    [super touchEndedAtPoint:point forPage:page];
+                } else if ([annotation isKindOfClass:[CPDFWidgetAnnotation class]]) {
+                    if ([annotation isKindOfClass:[CPDFSignatureWidgetAnnotation class]]) {
+//                        if ([(CPDFSignatureWidgetAnnotation *)annotation isSigned]) {
+//                            [self showMenuForAnnotation:annotation];
+//                        } else {
+//                            if ([self.performDelegate respondsToSelector:@selector(PDFViewPerformSignatureWidget:forAnnotation:)]) {
+//                                [self.performDelegate PDFViewPerformSignatureWidget:self forAnnotation:(CPDFSignatureWidgetAnnotation *)annotation];
+//                            }
+//                        }
+                    } else {
+                        [super touchEndedAtPoint:point forPage:page];
+                    }
+                } else {
+                    self.activeAnnotation = annotation;
+                    [self setNeedsDisplayForPage:page];
+                    [self updateScrollEnabled];
+                    
+//                    [self showMenuForAnnotation:annotation];
+//
+//                    if (!self.activeAnnotation) {
+//                        if ([self.performDelegate respondsToSelector:@selector(PDFViewPerformTouchEnded:)]) {
+//                            [self.performDelegate PDFViewPerformTouchEnded:self];
+//                        }
+//                    }
+                }
+            } else if (CPDFViewAnnotationModeLink == self.annotationMode) {
+//                if (CGRectIsEmpty(self.addLinkRect)) {
+//                    CPDFAnnotation *annotation = [page annotationAtPoint:point];
+//                    if ([annotation isKindOfClass:[CPDFLinkAnnotation class]]) {
+//                        self.activeAnnotation = annotation;
+//                        [self setNeedsDisplayForPage:page];
+//                        [self updateScrollEnabled];
+//
+//                        [self showMenuForAnnotation:annotation];
+//                    }
+//                } else {
+//                    [self addAnnotationLinkAtPoint:point forPage:page];
+//                }
+            } else if (CPDFViewAnnotationModeFreeText == self.annotationMode) {
+//                [self addAnnotationFreeTextAtPoint:point forPage:page];
+            } else if (CPDFViewAnnotationModeStamp == self.annotationMode) {
+//                [self addAnnotationAtPoint:point forPage:page];
+//                if ([self.performDelegate respondsToSelector:@selector(PDFViewPerformTouchEnded:)]) {
+//                    [self.performDelegate PDFViewPerformTouchEnded:self];
+//                }
+            } else if (CPDFViewAnnotationModeImage == self.annotationMode) {
+//                [self addAnnotationAtPoint:point forPage:page];
+//                if ([self.performDelegate respondsToSelector:@selector(PDFViewPerformTouchEnded:)]) {
+//                    [self.performDelegate PDFViewPerformTouchEnded:self];
+//                }
+            } else {
+                [self addAnnotation:self.annotationMode atPoint:point forPage:page];
+            }
+        }
+    } else {
+        if (CPDFAnnotationDraggingCenter != self.draggingType) {
+            if ([self.activeAnnotation isKindOfClass:[CPDFFreeTextAnnotation class]] ||
+                [self.activeAnnotation isKindOfClass:[CPDFStampAnnotation class]] ||
+                [self.activeAnnotation isKindOfClass:[CPDFSignatureAnnotation class]]) {
+                [self.activeAnnotation updateAppearanceStream];
+                [self setNeedsDisplayForPage:page];
+            }
+        }
+        
+        self.draggingType = CPDFAnnotationDraggingNone;
+        
+//        [self showMenuForAnnotation:self.activeAnnotation];
+    }
+//    [self removeMagnifier];
 }
 
 - (void)touchCancelledAtPoint:(CGPoint)point forPage:(CPDFPage *)page {
@@ -125,6 +368,8 @@ typedef NS_ENUM(NSInteger, PDFAnnotationDraggingType) {
         
     } else {
     }
+    
+    self.draggingType = CPDFAnnotationDraggingNone;
 }
 
 - (NSArray<UIMenuItem *> *)menuItemsAtPoint:(CGPoint)point forPage:(CPDFPage *)page {
@@ -175,7 +420,7 @@ typedef NS_ENUM(NSInteger, PDFAnnotationDraggingType) {
             
         }];
         
-        UIViewController *tRootViewControl = self.window.rootViewController;
+        UIViewController *tRootViewControl = [UIApplication sharedApplication].keyWindow.rootViewController;
         if ([tRootViewControl presentedViewController]) {
             tRootViewControl = [tRootViewControl presentedViewController];
         }
@@ -216,4 +461,523 @@ typedef NS_ENUM(NSInteger, PDFAnnotationDraggingType) {
     }
 }
 
+#pragma mark - Rendering
+
+- (void)drawPage:(CPDFPage *)page toContext:(CGContextRef)context {
+    if (CPDFViewAnnotationModeLink == self.annotationMode) {
+        CGContextSetLineWidth(context, 1.0);
+        CGContextSetStrokeColorWithColor(context, [UIColor colorWithRed:255.0/255.f green:255.0/255.f blue:255.0/255.f alpha:0.8].CGColor);
+        CGContextSetFillColorWithColor(context, [UIColor colorWithRed:100.0/255.f green:149.0/255.f blue:237.0/255.f alpha:0.4].CGColor);
+        CGContextAddRect(context, self.addLinkRect);
+        CGContextDrawPath(context, kCGPathFillStroke);
+    }
+    
+    if (self.activeAnnotation.page != page) {
+        return;
+    }
+    CGSize dragDotSize = CGSizeMake(30, 30);
+    CGContextSetStrokeColorWithColor(context, [UIColor colorWithRed:72.0/255.0 green:183.0/255.0 blue:247.0/255.0 alpha:1.0].CGColor);
+    if ([self.activeAnnotation isKindOfClass:[CPDFLineAnnotation class]]) {
+        CPDFLineAnnotation *line = (CPDFLineAnnotation *)self.activeAnnotation;
+        CGPoint startPoint = line.startPoint;
+        CGPoint endPoint   = line.endPoint;
+        
+        CGPoint tStartPoint = startPoint;
+        CGPoint tEndPoint   = endPoint;
+        
+        float final = 40;
+        if (fabs(tStartPoint.x - tEndPoint.x) < 0.00001) {
+            if (tStartPoint.y > tEndPoint.y) {
+                tStartPoint.y += final;
+                tEndPoint.y -= final;
+            } else {
+                tStartPoint.y -= final;
+                tEndPoint.y += final;
+            }
+        } else if (fabs(tStartPoint.y - tEndPoint.y) < 0.00001) {
+            if (tStartPoint.x > tEndPoint.x) {
+                tStartPoint.x += final;
+                tEndPoint.x -= final;
+            } else {
+                tStartPoint.x -= final;
+                tEndPoint.x += final;
+            }
+        } else {
+            double k = (tEndPoint.y - tStartPoint.y)/(tEndPoint.x - tStartPoint.x);
+            double atank = atan(k);
+            if (endPoint.x > startPoint.x) {
+                tEndPoint.x += cos(atank) * final;
+                tEndPoint.y += sin(atank) * final;
+                tStartPoint.x -= cos(atank) * final;
+                tStartPoint.y -= sin(atank) * final;
+            } else {
+                tEndPoint.x -= cos(atank) * final;
+                tEndPoint.y -= sin(atank) * final;
+                tStartPoint.x += cos(atank) * final;
+                tStartPoint.y += sin(atank) * final;
+            }
+        }
+        
+        CGContextSetLineWidth(context, 1.0);
+        CGFloat dashArray[] = {3,3};
+        CGContextSetLineDash(context, 0, dashArray, 2);
+        CGContextMoveToPoint(context, tStartPoint.x, tStartPoint.y);
+        CGContextAddLineToPoint(context, startPoint.x, startPoint.y);
+        CGContextStrokePath(context);
+        CGContextMoveToPoint(context, tEndPoint.x, tEndPoint.y);
+        CGContextAddLineToPoint(context, endPoint.x, endPoint.y);
+        CGContextStrokePath(context);
+        
+        CGRect startPointRect = CGRectMake(tStartPoint.x - dragDotSize.width/2.0,
+                                           tStartPoint.y - dragDotSize.height/2.0,
+                                           dragDotSize.width, dragDotSize.height);
+        CGRect endPointRect = CGRectMake(tEndPoint.x - dragDotSize.width/2.0,
+                                         tEndPoint.y - dragDotSize.height/2.0,
+                                         dragDotSize.width, dragDotSize.height);
+        
+        UIImage *image = [UIImage imageNamed:@"annotation_drag_dot.png" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil];
+        CGImageRef dragDotImage = image.CGImage;
+        
+        CGContextDrawImage(context, startPointRect, dragDotImage);
+        CGContextDrawImage(context, endPointRect, dragDotImage);
+        
+        self.startPointRect = startPointRect;
+        self.endPointRect = endPointRect;
+    } else if ([self.activeAnnotation isKindOfClass:[CPDFFreeTextAnnotation class]]) {
+        CGRect rect = CGRectInset(self.activeAnnotation.bounds, -dragDotSize.width/2.0, -dragDotSize.height/2.0);
+        CGContextSetLineWidth(context, 1.0);
+        CGFloat lengths[] = {6, 6};
+        CGContextSetLineDash(context, 0, lengths, 2);
+        CGContextStrokeRect(context, rect);
+        CGContextStrokePath(context);
+        
+        CGAffineTransform transform = [page transform];
+        if (CPDFKitShareConfig.enableAnnotationNoRotate) {
+            rect = CGRectApplyAffineTransform(rect, transform);
+        }
+        CGRect leftCenterRect = CGRectMake(CGRectGetMinX(rect)-dragDotSize.width/2.0,
+                                           CGRectGetMidY(rect)-dragDotSize.height/2.0,
+                                           dragDotSize.width, dragDotSize.height);
+        CGRect rightCenterRect = CGRectMake(CGRectGetMaxX(rect)-dragDotSize.width/2.0,
+                                            CGRectGetMidY(rect)-dragDotSize.height/2.0,
+                                            dragDotSize.width, dragDotSize.height);
+        if (CPDFKitShareConfig.enableAnnotationNoRotate) {
+            leftCenterRect = CGRectApplyAffineTransform(leftCenterRect, CGAffineTransformInvert(transform));
+            rightCenterRect = CGRectApplyAffineTransform(rightCenterRect, CGAffineTransformInvert(transform));
+        }
+        
+        UIImage *image = [UIImage imageNamed:@"annotation_drag_dot.png" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil];
+        CGImageRef dragDotImage = image.CGImage;
+        
+        CGContextDrawImage(context, leftCenterRect, dragDotImage);
+        CGContextDrawImage(context, rightCenterRect, dragDotImage);
+        
+        self.startPointRect = leftCenterRect;
+        self.endPointRect = rightCenterRect;
+    } else {
+        CGRect rect = CGRectInset(self.activeAnnotation.bounds, -dragDotSize.width/2.0, -dragDotSize.height/2.0);
+        CGContextSetLineWidth(context, 1.0);
+        CGFloat lengths[] = {6, 6};
+        CGContextSetLineDash(context, 0, lengths, 2);
+        CGContextStrokeRect(context, rect);
+        CGContextStrokePath(context);
+        
+        if ([self.activeAnnotation isKindOfClass:[CPDFSoundAnnotation class]] ||
+            [self.activeAnnotation isKindOfClass:[CPDFMovieAnnotation class]]) {
+            return;
+        }
+        
+        CGRect topLeftRect = CGRectMake(CGRectGetMinX(rect)-dragDotSize.width/2.0,
+                                        CGRectGetMaxY(rect)-dragDotSize.height/2.0,
+                                        dragDotSize.width, dragDotSize.height);
+        CGRect bottomLeftRect = CGRectMake(CGRectGetMinX(rect)-dragDotSize.width/2.0,
+                                           CGRectGetMinY(rect)-dragDotSize.height/2.0,
+                                           dragDotSize.width, dragDotSize.height);
+        CGRect topRightRect = CGRectMake(CGRectGetMaxX(rect)-dragDotSize.width/2.0,
+                                         CGRectGetMaxY(rect)-dragDotSize.height/2.0,
+                                         dragDotSize.width, dragDotSize.height);
+        CGRect bottomRightRect = CGRectMake(CGRectGetMaxX(rect)-dragDotSize.width/2.0,
+                                            CGRectGetMinY(rect)-dragDotSize.height/2.0,
+                                            dragDotSize.width, dragDotSize.height);
+        
+        UIImage *image = [UIImage imageNamed:@"annotation_drag_dot.png" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil];
+        CGImageRef dragDotImage = image.CGImage;
+        
+        CGContextDrawImage(context, topLeftRect, dragDotImage);
+        CGContextDrawImage(context, bottomLeftRect, dragDotImage);
+        CGContextDrawImage(context, topRightRect, dragDotImage);
+        CGContextDrawImage(context, bottomRightRect, dragDotImage);
+        
+        self.topLeftRect = topLeftRect;
+        self.bottomLeftRect = bottomLeftRect;
+        self.topRightRect = topRightRect;
+        self.bottomRightRect = bottomRightRect;
+    }
+}
+
+#pragma mark - Annotation
+
+- (void)moveAnnotation:(CPDFAnnotation *)annotation fromPoint:(CGPoint)fromPoint toPoint:(CGPoint)toPoint forType:(CPDFAnnotationDraggingType)draggingType {
+    CGRect bounds = annotation.bounds;
+    CGPoint offsetPoint =  CGPointMake(toPoint.x - fromPoint.x, toPoint.y - fromPoint.y);
+    CGFloat scale = bounds.size.height/bounds.size.width;
+    if ([annotation isKindOfClass:[CPDFLineAnnotation class]]) {
+        CPDFLineAnnotation *line = (CPDFLineAnnotation *)annotation;
+        CGPoint startPoint = line.startPoint;
+        CGPoint endPoint   = line.endPoint;
+        switch (draggingType) {
+            case CPDFAnnotationDraggingCenter:
+            {
+                startPoint.x += offsetPoint.x;
+                startPoint.y += offsetPoint.y;
+                endPoint.x += offsetPoint.x;
+                endPoint.y += offsetPoint.y;
+            }
+                break;
+            case CPDFAnnotationDraggingStart:
+            {
+                startPoint.x += offsetPoint.x;
+                startPoint.y += offsetPoint.y;
+            }
+                break;
+            case CPDFAnnotationDraggingEnd:
+            {
+                endPoint.x += offsetPoint.x;
+                endPoint.y += offsetPoint.y;
+            }
+                break;
+            default:
+            break;
+        }
+        line.startPoint = startPoint;
+        line.endPoint = endPoint;
+        bounds = line.bounds;
+    } else if ([annotation isKindOfClass:[CPDFFreeTextAnnotation class]]) {
+        CGAffineTransform transform = [annotation.page transform];
+        if (CPDFKitShareConfig.enableAnnotationNoRotate) {
+            bounds = CGRectApplyAffineTransform(bounds, transform);
+            toPoint = CGPointApplyAffineTransform(toPoint, transform);
+            fromPoint = CGPointApplyAffineTransform(fromPoint, transform);
+            offsetPoint =  CGPointMake(toPoint.x - fromPoint.x, toPoint.y - fromPoint.y);
+        }
+        CPDFFreeTextAnnotation *freeText = (CPDFFreeTextAnnotation *)annotation;
+        NSDictionary *attributes = @{NSFontAttributeName : freeText.font};
+        switch (draggingType) {
+            case CPDFAnnotationDraggingCenter:
+            {
+                bounds.origin.x += offsetPoint.x;
+                bounds.origin.y += offsetPoint.y;
+            }
+                break;
+            case CPDFAnnotationDraggingStart:
+            {
+                CGFloat x = CGRectGetMaxX(bounds);
+                bounds.size.width -= offsetPoint.x;
+                bounds.size.width = MAX(bounds.size.width, 5.0);
+                bounds.origin.x = x - bounds.size.width;
+                
+                CGRect rect = [freeText.contents boundingRectWithSize:CGSizeMake(bounds.size.width, CGFLOAT_MAX)
+                                                              options:NSStringDrawingUsesLineFragmentOrigin
+                                                           attributes:attributes
+                                                              context:nil];
+                bounds.origin.y = CGRectGetMaxY(bounds) - rect.size.height;
+                bounds.size.height = rect.size.height;
+            }
+                break;
+            case CPDFAnnotationDraggingEnd:
+            {
+                bounds.size.width += offsetPoint.x;
+                bounds.size.width = MAX(bounds.size.width, 5.0);
+                
+                CGRect rect = [freeText.contents boundingRectWithSize:CGSizeMake(bounds.size.width, CGFLOAT_MAX)
+                                                              options:NSStringDrawingUsesLineFragmentOrigin
+                                                           attributes:attributes
+                                                              context:nil];
+                bounds.origin.y = CGRectGetMaxY(bounds) - rect.size.height;
+                bounds.size.height = rect.size.height;
+            }
+                break;
+            default:
+            break;
+        }
+        if (CPDFKitShareConfig.enableAnnotationNoRotate) {
+            bounds = CGRectApplyAffineTransform(bounds, CGAffineTransformInvert(transform));
+        }
+    } else {
+        switch (draggingType) {
+            case CPDFAnnotationDraggingCenter:
+            {
+                bounds.origin.x += offsetPoint.x;
+                bounds.origin.y += offsetPoint.y;
+            }
+                break;
+            case CPDFAnnotationDraggingTopLeft:
+            {
+                CGFloat x = CGRectGetMaxX(bounds);
+                bounds.size.width -= offsetPoint.x;
+                bounds.size.height += offsetPoint.y;
+                
+                if ([annotation isKindOfClass:[CPDFStampAnnotation class]] ||
+                    [annotation isKindOfClass:[CPDFSignatureAnnotation class]] ||
+                    [annotation isKindOfClass:[CPDFInkAnnotation class]]) {
+                    bounds.size.height = bounds.size.width*scale;
+                    bounds.size.width = MAX(bounds.size.width, 5.0);
+                    bounds.size.height = MAX(bounds.size.height, 5.0*scale);
+                } else {
+                    bounds.size.width = MAX(bounds.size.width, 5.0);
+                    bounds.size.height = MAX(bounds.size.height, 5.0);
+                }
+                
+                bounds.origin.x = x - bounds.size.width;
+            }
+                break;
+            case CPDFAnnotationDraggingBottomLeft:
+            {
+                CGFloat x = CGRectGetMaxX(bounds);
+                CGFloat y = CGRectGetMaxY(bounds);
+                bounds.size.width -= offsetPoint.x;
+                bounds.size.height -= offsetPoint.y;
+                
+                if ([annotation isKindOfClass:[CPDFStampAnnotation class]] ||
+                    [annotation isKindOfClass:[CPDFSignatureAnnotation class]] ||
+                    [annotation isKindOfClass:[CPDFInkAnnotation class]]) {
+                    bounds.size.height = bounds.size.width*scale;
+                    bounds.size.width = MAX(bounds.size.width, 5.0);
+                    bounds.size.height = MAX(bounds.size.height, 5.0*scale);
+                } else {
+                    bounds.size.width = MAX(bounds.size.width, 5.0);
+                    bounds.size.height = MAX(bounds.size.height, 5.0);
+                }
+                
+                bounds.origin.x = x - bounds.size.width;
+                bounds.origin.y = y - bounds.size.height;
+            }
+                break;
+            case CPDFAnnotationDraggingTopRight:
+            {
+                bounds.size.width += offsetPoint.x;
+                bounds.size.height += offsetPoint.y;
+                
+                if ([annotation isKindOfClass:[CPDFStampAnnotation class]] ||
+                    [annotation isKindOfClass:[CPDFSignatureAnnotation class]] ||
+                    [annotation isKindOfClass:[CPDFInkAnnotation class]]) {
+                    bounds.size.height = bounds.size.width*scale;
+                    bounds.size.width = MAX(bounds.size.width, 5.0);
+                    bounds.size.height = MAX(bounds.size.height, 5.0*scale);
+                } else {
+                    bounds.size.width = MAX(bounds.size.width, 5.0);
+                    bounds.size.height = MAX(bounds.size.height, 5.0);
+                }
+            }
+                break;
+            case CPDFAnnotationDraggingBottomRight:
+            {
+                CGFloat y = CGRectGetMaxY(bounds);
+                bounds.size.width += offsetPoint.x;
+                bounds.size.height -= offsetPoint.y;
+                
+                if ([annotation isKindOfClass:[CPDFStampAnnotation class]] ||
+                    [annotation isKindOfClass:[CPDFSignatureAnnotation class]] ||
+                    [annotation isKindOfClass:[CPDFInkAnnotation class]]) {
+                    bounds.size.height = bounds.size.width*scale;
+                    bounds.size.width = MAX(bounds.size.width, 5.0);
+                    bounds.size.height = MAX(bounds.size.height, 5.0*scale);
+                } else {
+                    bounds.size.width = MAX(bounds.size.width, 5.0);
+                    bounds.size.height = MAX(bounds.size.height, 5.0);
+                }
+                
+                bounds.origin.y = y - bounds.size.height;
+            }
+                break;
+            default:
+                break;
+        }
+        
+        if (CGRectGetMinX(bounds) < 0) {
+            bounds.origin.x = 0;
+        }
+        if (CGRectGetMaxX(bounds) > CGRectGetWidth(annotation.page.bounds)) {
+            bounds.origin.x = CGRectGetWidth(annotation.page.bounds) - CGRectGetWidth(bounds);
+        }
+        if (CGRectGetMinY(bounds) < 0) {
+            bounds.origin.y = 0;
+        }
+        if (CGRectGetMaxY(bounds) > CGRectGetHeight(annotation.page.bounds)) {
+            bounds.origin.y = CGRectGetHeight(annotation.page.bounds) - CGRectGetHeight(bounds);
+        }
+    }
+    annotation.bounds = bounds;
+}
+
+
+- (void)addAnnotation:(CPDFViewAnnotationMode)mode atPoint:(CGPoint)point forPage:(CPDFPage *)page {
+    CPDFAnnotation *annotation = nil;
+    switch (mode) {
+        case CPDFViewAnnotationModeNote:
+        {
+            CGFloat width = 57.0/1.5;
+            annotation = [[CPDFTextAnnotation alloc] initWithDocument:self.document];
+            annotation.bounds = CGRectMake(point.x-width/2.0, point.y-width/2.0, width, width);
+        }
+            break;
+        case CPDFViewAnnotationModeHighlight:
+        {
+            if (!self.currentSelection) {
+                return;
+            }
+            NSMutableArray *quadrilateralPoints = [NSMutableArray array];
+            annotation = [[CPDFMarkupAnnotation alloc] initWithDocument:self.document markupType:CPDFMarkupTypeHighlight];
+            for (CPDFSelection *selection in self.currentSelection.selectionsByLine) {
+                CGRect bounds = selection.bounds;
+                [quadrilateralPoints addObject:[NSValue valueWithCGPoint:CGPointMake(CGRectGetMinX(bounds), CGRectGetMaxY(bounds))]];
+                [quadrilateralPoints addObject:[NSValue valueWithCGPoint:CGPointMake(CGRectGetMaxX(bounds), CGRectGetMaxY(bounds))]];
+                [quadrilateralPoints addObject:[NSValue valueWithCGPoint:CGPointMake(CGRectGetMinX(bounds), CGRectGetMinY(bounds))]];
+                [quadrilateralPoints addObject:[NSValue valueWithCGPoint:CGPointMake(CGRectGetMaxX(bounds), CGRectGetMinY(bounds))]];
+            }
+            [(CPDFMarkupAnnotation *)annotation setQuadrilateralPoints:quadrilateralPoints];
+            [(CPDFMarkupAnnotation *)annotation setMarkupText:self.currentSelection.string];
+            [self clearSelection];
+        }
+            break;
+        case CPDFViewAnnotationModeUnderline:
+        {
+            if (!self.currentSelection) {
+                return;
+            }
+            NSMutableArray *quadrilateralPoints = [NSMutableArray array];
+            annotation = [[CPDFMarkupAnnotation alloc] initWithDocument:self.document markupType:CPDFMarkupTypeUnderline];
+            for (CPDFSelection *selection in self.currentSelection.selectionsByLine) {
+                CGRect bounds = selection.bounds;
+                [quadrilateralPoints addObject:[NSValue valueWithCGPoint:CGPointMake(CGRectGetMinX(bounds), CGRectGetMaxY(bounds))]];
+                [quadrilateralPoints addObject:[NSValue valueWithCGPoint:CGPointMake(CGRectGetMaxX(bounds), CGRectGetMaxY(bounds))]];
+                [quadrilateralPoints addObject:[NSValue valueWithCGPoint:CGPointMake(CGRectGetMinX(bounds), CGRectGetMinY(bounds))]];
+                [quadrilateralPoints addObject:[NSValue valueWithCGPoint:CGPointMake(CGRectGetMaxX(bounds), CGRectGetMinY(bounds))]];
+            }
+            [(CPDFMarkupAnnotation *)annotation setQuadrilateralPoints:quadrilateralPoints];
+            [(CPDFMarkupAnnotation *)annotation setMarkupText:self.currentSelection.string];
+            [self clearSelection];
+        }
+            break;
+        case CPDFViewAnnotationModeStrikeout:
+        {
+            if (!self.currentSelection) {
+                return;
+            }
+            NSMutableArray *quadrilateralPoints = [NSMutableArray array];
+            annotation = [[CPDFMarkupAnnotation alloc] initWithDocument:self.document markupType:CPDFMarkupTypeStrikeOut];
+            for (CPDFSelection *selection in self.currentSelection.selectionsByLine) {
+                CGRect bounds = selection.bounds;
+                [quadrilateralPoints addObject:[NSValue valueWithCGPoint:CGPointMake(CGRectGetMinX(bounds), CGRectGetMaxY(bounds))]];
+                [quadrilateralPoints addObject:[NSValue valueWithCGPoint:CGPointMake(CGRectGetMaxX(bounds), CGRectGetMaxY(bounds))]];
+                [quadrilateralPoints addObject:[NSValue valueWithCGPoint:CGPointMake(CGRectGetMinX(bounds), CGRectGetMinY(bounds))]];
+                [quadrilateralPoints addObject:[NSValue valueWithCGPoint:CGPointMake(CGRectGetMaxX(bounds), CGRectGetMinY(bounds))]];
+            }
+            [(CPDFMarkupAnnotation *)annotation setQuadrilateralPoints:quadrilateralPoints];
+            [(CPDFMarkupAnnotation *)annotation setMarkupText:self.currentSelection.string];
+            [self clearSelection];
+        }
+            break;
+        case CPDFViewAnnotationModeSquiggly:
+        {
+            if (!self.currentSelection) {
+                return;
+            }
+            NSMutableArray *quadrilateralPoints = [NSMutableArray array];
+            annotation = [[CPDFMarkupAnnotation alloc] initWithDocument:self.document markupType:CPDFMarkupTypeSquiggly];
+            for (CPDFSelection *selection in self.currentSelection.selectionsByLine) {
+                CGRect bounds = selection.bounds;
+                [quadrilateralPoints addObject:[NSValue valueWithCGPoint:CGPointMake(CGRectGetMinX(bounds), CGRectGetMaxY(bounds))]];
+                [quadrilateralPoints addObject:[NSValue valueWithCGPoint:CGPointMake(CGRectGetMaxX(bounds), CGRectGetMaxY(bounds))]];
+                [quadrilateralPoints addObject:[NSValue valueWithCGPoint:CGPointMake(CGRectGetMinX(bounds), CGRectGetMinY(bounds))]];
+                [quadrilateralPoints addObject:[NSValue valueWithCGPoint:CGPointMake(CGRectGetMaxX(bounds), CGRectGetMinY(bounds))]];
+            }
+            [(CPDFMarkupAnnotation *)annotation setQuadrilateralPoints:quadrilateralPoints];
+            [(CPDFMarkupAnnotation *)annotation setMarkupText:self.currentSelection.string];
+            [self clearSelection];
+        }
+            break;
+        case CPDFViewAnnotationModeCircle:
+        {
+            annotation = [[CPDFCircleAnnotation alloc] initWithDocument:self.document];
+            annotation.bounds = CGRectMake(point.x-50, point.y-50, 100, 100);
+        }
+            break;
+        case CPDFViewAnnotationModeSquare:
+        {
+            annotation = [[CPDFSquareAnnotation alloc] initWithDocument:self.document];
+            annotation.bounds = CGRectMake(point.x-50, point.y-50, 100, 100);
+        }
+            break;
+        case CPDFViewAnnotationModeArrow:
+        {
+            annotation = [[CPDFLineAnnotation alloc] initWithDocument:self.document];
+            [(CPDFLineAnnotation *)annotation setStartPoint:CGPointMake(point.x-50, point.y)];
+            [(CPDFLineAnnotation *)annotation setEndPoint:CGPointMake(point.x+50, point.y)];
+            [(CPDFLineAnnotation *)annotation setEndLineStyle:CPDFLineStyleClosedArrow];
+        }
+            break;
+        case CPDFViewAnnotationModeLine:
+        {
+            annotation = [[CPDFLineAnnotation alloc] initWithDocument:self.document];
+            [(CPDFLineAnnotation *)annotation setStartPoint:CGPointMake(point.x-50, point.y)];
+            [(CPDFLineAnnotation *)annotation setEndPoint:CGPointMake(point.x+50, point.y)];
+        }
+            break;
+        default:
+            break;
+    }
+    
+    if (!annotation) {
+        return;
+    }
+    [annotation setModificationDate:[NSDate date]];
+    [annotation setUserName:[self annotationUserName]];
+    [page addAnnotation:annotation];
+    
+    if ([annotation isKindOfClass:[CPDFTextAnnotation class]]) {
+        [self setNeedsDisplayForPage:page];
+//        if ([self.performDelegate respondsToSelector:@selector(PDFViewPerformOpenNote:forAnnotation:)]) {
+//            [self.performDelegate PDFViewPerformOpenNote:self forAnnotation:annotation];
+//        }
+    } else if ([annotation isKindOfClass:[CPDFMarkupAnnotation class]]) {
+        [self setNeedsDisplayForPage:page];
+    } else {
+        self.activeAnnotation = annotation;
+        [self setNeedsDisplayForPage:page];
+        [self updateScrollEnabled];
+        
+//        [self showMenuForAnnotation:annotation];
+    }
+}
+
+- (void)addAnnotation:(CPDFAnnotation *)annotation forPage:(CPDFPage *)page {
+    if (!annotation || !page) {
+        return;
+    }
+    [annotation setModificationDate:[NSDate date]];
+    [annotation setUserName:[self annotationUserName]];
+    [page addAnnotation:annotation];
+    
+    self.activeAnnotation = annotation;
+    [self setNeedsDisplayForPage:page];
+    [self updateScrollEnabled];
+    
+//    [self showMenuForAnnotation:annotation];
+}
+
+- (void)addAnnotation:(CPDFAnnotation *)annotation {
+    CPDFPage *page = [self.document pageAtIndex:self.currentPageIndex];
+    CGPoint center = [self convertPoint:self.center toPage:page];
+    if (CGPointEqualToPoint(center, CGPointZero)) {
+        return;
+    }
+    CGRect bounds = annotation.bounds;
+    bounds.origin.x = center.x-bounds.size.width/2.0;
+    bounds.origin.y = center.y-bounds.size.height/2.0;
+    bounds.origin.y = MIN(MAX(0, bounds.origin.y), page.bounds.size.height-bounds.size.height);
+    annotation.bounds = bounds;
+    [self addAnnotation:annotation forPage:page];
+}
+
 @end

+ 7 - 0
compdfkit-tools/compdfkit-tools/compdfkit_tools.h

@@ -51,6 +51,10 @@
 // Annotation
 #import <compdfkit_tools/CPDFAnnotationBar.h>
 #import <compdfkit_tools/CPDFAnnotationBaseViewController.h>
+#import <compdfkit_tools/CPDFNoteViewController.h>
+#import <compdfkit_tools/CPDFHighlightViewController.h>
+#import <compdfkit_tools/CPDFUnderlineViewController.h>
+#import <compdfkit_tools/CPDFStrikeoutViewController.h>
 #import <compdfkit_tools/AAPLCustomPresentationController.h>
 
 //Edit
@@ -58,3 +62,6 @@
 #import <compdfkit_tools/CPDFEditViewController.h>
 
 
+// Model
+#import <compdfkit_tools/CAnnotStyle.h>
+