Browse Source

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

# Conflicts:
#	Edit-Ctrl-Demo/Edit-Ctrl-Demo/CPDFViewController.m
#	compdfkit-tools/compdfkit-tools.xcodeproj/project.pbxproj
#	compdfkit-tools/compdfkit-tools/compdfkit_tools.h
chenyu 1 year ago
parent
commit
bdf6f25c4b
37 changed files with 1042 additions and 26 deletions
  1. 0 4
      Annotation-Ctrl-Demo/Annotation-Ctrl-Demo.xcodeproj/project.pbxproj
  2. 1 1
      Annotation-Ctrl-Demo/Annotation-Ctrl-Demo.xcodeproj/xcuserdata/kdanmobile_2.xcuserdatad/xcschemes/xcschememanagement.plist
  3. 19 1
      Edit-Ctrl-Demo/Edit-Ctrl-Demo/CPDFViewController.m
  4. 0 3
      compdfkit-demo.xcworkspace/contents.xcworkspacedata
  5. 130 4
      compdfkit-tools/compdfkit-tools.xcodeproj/project.pbxproj
  6. 1 1
      compdfkit-tools/compdfkit-tools.xcodeproj/xcuserdata/kdanmobile_2.xcuserdatad/xcschemes/xcschememanagement.plist
  7. 23 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFBase/CPDFAnnotationBaseViewController.h
  8. 72 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFBase/CPDFAnnotationBaseViewController.m
  9. 25 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFBase/CPDFAnnotationBaseViewController_Header.h
  10. 9 4
      compdfkit-tools/compdfkit-tools/Common/Controls/BOTA/CPDFBOTAViewController.m
  11. 21 0
      compdfkit-tools/compdfkit-tools/Common/Controls/CustomColor/CPDFCustomColorViewController.h
  12. 25 0
      compdfkit-tools/compdfkit-tools/Common/Controls/CustomColor/CPDFCustomColorViewController.m
  13. 16 0
      compdfkit-tools/compdfkit-tools/Common/Model/CAnnotStyle.h
  14. 12 0
      compdfkit-tools/compdfkit-tools/Common/Model/CAnnotStyle.m
  15. 16 0
      compdfkit-tools/compdfkit-tools/Common/Utils/AAPLCustomPresentationController.h
  16. 366 0
      compdfkit-tools/compdfkit-tools/Common/Utils/AAPLCustomPresentationController.m
  17. 1 1
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/CPDFAnnotationBar.h
  18. 16 3
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/CPDFAnnotationBar.m
  19. 2 1
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageProperties.imageset/Contents.json
  20. 0 1
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageProperties.imageset/iconmonstr-pencil-text-filled.svg
  21. BIN
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageProperties.imageset/text_search2.png
  22. BIN
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageProperties.imageset/text_search2@2x.png
  23. 2 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageRedo.imageset/Contents.json
  24. BIN
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageRedo.imageset/btn_nextpage.png
  25. BIN
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageRedo.imageset/btn_nextpage@2x.png
  26. 2 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageUndo.imageset/Contents.json
  27. BIN
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageUndo.imageset/btn_frontpage.png
  28. BIN
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageUndo.imageset/btn_frontpage@2x.png
  29. 42 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFAnnotationSampleView.h
  30. 39 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFAnnotationSampleView.m
  31. 25 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFColorPickerView.h
  32. 58 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFColorPickerView.m
  33. 29 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFOpacitySliderView.h
  34. 47 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFOpacitySliderView.m
  35. 16 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFThicknessSliderView.h
  36. 20 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFThicknessSliderView.m
  37. 7 2
      compdfkit-tools/compdfkit-tools/compdfkit_tools.h

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

@@ -19,7 +19,6 @@
 		C9AF187629F26AD200EC4979 /* XMLParseManager.m in Sources */ = {isa = PBXBuildFile; fileRef = C9AF187329F26AD200EC4979 /* XMLParseManager.m */; };
 		C9AF187C29F26ADF00EC4979 /* Form_Widgets_Test.pdf in Resources */ = {isa = PBXBuildFile; fileRef = C9AF187829F26ADF00EC4979 /* Form_Widgets_Test.pdf */; };
 		C9AF187D29F26ADF00EC4979 /* PDF32000_2008.pdf in Resources */ = {isa = PBXBuildFile; fileRef = C9AF187929F26ADF00EC4979 /* PDF32000_2008.pdf */; };
-		C9AF187E29F26ADF00EC4979 /* 1126 一鍵移轉 Migrating files with one tap.pdf in Resources */ = {isa = PBXBuildFile; fileRef = C9AF187A29F26ADF00EC4979 /* 1126 一鍵移轉 Migrating files with one tap.pdf */; };
 		C9AF187F29F26ADF00EC4979 /* Quick Start Guide.pdf in Resources */ = {isa = PBXBuildFile; fileRef = C9AF187B29F26ADF00EC4979 /* Quick Start Guide.pdf */; };
 		C9AF188229F26B4D00EC4979 /* compdfkit_tools.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C9AF188129F26B4D00EC4979 /* compdfkit_tools.framework */; };
 		C9AF188329F26B4D00EC4979 /* compdfkit_tools.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C9AF188129F26B4D00EC4979 /* compdfkit_tools.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
@@ -62,7 +61,6 @@
 		C9AF187329F26AD200EC4979 /* XMLParseManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XMLParseManager.m; sourceTree = "<group>"; };
 		C9AF187829F26ADF00EC4979 /* Form_Widgets_Test.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = Form_Widgets_Test.pdf; sourceTree = "<group>"; };
 		C9AF187929F26ADF00EC4979 /* PDF32000_2008.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = PDF32000_2008.pdf; sourceTree = "<group>"; };
-		C9AF187A29F26ADF00EC4979 /* 1126 一鍵移轉 Migrating files with one tap.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = "1126 一鍵移轉 Migrating files with one tap.pdf"; sourceTree = "<group>"; };
 		C9AF187B29F26ADF00EC4979 /* Quick Start Guide.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = "Quick Start Guide.pdf"; sourceTree = "<group>"; };
 		C9AF188129F26B4D00EC4979 /* compdfkit_tools.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = compdfkit_tools.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 		C9AF188529F26B5800EC4979 /* ComPDFKit.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = ComPDFKit.xcframework; path = "/Users/kdanmobile_2/项目/demo-sdk/compdfkit-tools/../Lib/ComPDFKit.xcframework"; sourceTree = "<absolute>"; };
@@ -136,7 +134,6 @@
 			children = (
 				C9AF187829F26ADF00EC4979 /* Form_Widgets_Test.pdf */,
 				C9AF187929F26ADF00EC4979 /* PDF32000_2008.pdf */,
-				C9AF187A29F26ADF00EC4979 /* 1126 一鍵移轉 Migrating files with one tap.pdf */,
 				C9AF187B29F26ADF00EC4979 /* Quick Start Guide.pdf */,
 			);
 			name = TestFile;
@@ -215,7 +212,6 @@
 				C9AF185C29F267E000EC4979 /* Assets.xcassets in Resources */,
 				C9AF187429F26AD200EC4979 /* SDKLicense.xml in Resources */,
 				C9AF185A29F267DD00EC4979 /* Main.storyboard in Resources */,
-				C9AF187E29F26ADF00EC4979 /* 1126 一鍵移轉 Migrating files with one tap.pdf in Resources */,
 				C9AF187F29F26ADF00EC4979 /* Quick Start Guide.pdf in Resources */,
 				C9AF187D29F26ADF00EC4979 /* PDF32000_2008.pdf in Resources */,
 			);

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

@@ -7,7 +7,7 @@
 		<key>Annotation-Ctrl-Demo.xcscheme_^#shared#^_</key>
 		<dict>
 			<key>orderHint</key>
-			<integer>2</integer>
+			<integer>1</integer>
 		</dict>
 	</dict>
 </dict>

+ 19 - 1
Edit-Ctrl-Demo/Edit-Ctrl-Demo/CPDFViewController.m

@@ -15,7 +15,7 @@
 #import <ComPDFKit/ComPDFKit.h>
 #import <compdfkit_tools/compdfkit_tools.h>
 
-@interface CPDFViewController ()<UISearchBarDelegate,CPDFViewDelegate,CPDFListViewDelegate, CPDFMoreListViewDelegate, CSearchToolbarDelegate, CPDFDisplayViewDelegate, CPDFBOTAViewControllerDelegate,CPDFSearchResultsDelegate, CPDFThumbnailViewControllerDelegate>
+@interface CPDFViewController () <UISearchBarDelegate,CPDFViewDelegate,CPDFListViewDelegate, CPDFMoreListViewDelegate,CSearchToolbarDelegate, CPDFDisplayViewDelegate,CPDFBOTAViewControllerDelegate,CPDFSearchResultsDelegate,CPDFThumbnailViewControllerDelegate,CPDFAnnotationBarDelegate>
 
 @property(nonatomic, strong) NSString *filePath;
 
@@ -29,6 +29,10 @@
  
 @property(nonatomic, strong) NSString *navigationTitle;
 
+@property(nonatomic, strong) CPDFAnnotationBar *annotatiomBar;
+
+@property(nonatomic, strong) CPDFAnnotationBaseViewController *baseVC;
+
 @end
 
 @implementation CPDFViewController
@@ -69,8 +73,11 @@
     
     if (@available(iOS 11.0, *)) {
         self.pdfListView.frame = CGRectMake(self.view.safeAreaInsets.left, self.view.safeAreaInsets.top, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, self.view.frame.size.height - self.view.safeAreaInsets.bottom- self.view.safeAreaInsets.top);
+        
+        self.annotatiomBar.frame = CGRectMake(0, self.view.frame.size.height - self.view.safeAreaInsets.bottom - 44, self.view.frame.size.width, 44);
     } else {
         self.pdfListView.frame = self.view.bounds;
+        self.annotatiomBar.frame = CGRectMake(0, self.view.frame.size.height  - 64, self.view.frame.size.width, 44);
     }
 }
 
@@ -230,4 +237,15 @@
     [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

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

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

+ 130 - 4
compdfkit-tools/compdfkit-tools.xcodeproj/project.pbxproj

@@ -21,12 +21,28 @@
 		C9AF183029EFB23C00EC4979 /* CPDFBookmarkViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = C9AF182E29EFB23C00EC4979 /* CPDFBookmarkViewController.h */; };
 		C9AF183129EFB23C00EC4979 /* CPDFBookmarkViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C9AF182F29EFB23C00EC4979 /* CPDFBookmarkViewController.m */; };
 		C9AF183329EFC63300EC4979 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C9AF183229EFC63300EC4979 /* Images.xcassets */; };
-		C9AF183B29F2198700EC4979 /* CPDFAnnotationBar.h in Headers */ = {isa = PBXBuildFile; fileRef = C9AF183929F2198700EC4979 /* CPDFAnnotationBar.h */; };
+		C9AF183B29F2198700EC4979 /* CPDFAnnotationBar.h in Headers */ = {isa = PBXBuildFile; fileRef = C9AF183929F2198700EC4979 /* CPDFAnnotationBar.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		C9AF183C29F2198700EC4979 /* CPDFAnnotationBar.m in Sources */ = {isa = PBXBuildFile; fileRef = C9AF183A29F2198700EC4979 /* CPDFAnnotationBar.m */; };
 		C9AF183E29F223A700EC4979 /* Image.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C9AF183D29F223A700EC4979 /* Image.xcassets */; };
 		C9AF184129F22BBD00EC4979 /* CPDFAnnotationBarButton.h in Headers */ = {isa = PBXBuildFile; fileRef = C9AF183F29F22BBD00EC4979 /* CPDFAnnotationBarButton.h */; };
 		C9AF184229F22BBD00EC4979 /* CPDFAnnotationBarButton.m in Sources */ = {isa = PBXBuildFile; fileRef = C9AF184029F22BBD00EC4979 /* CPDFAnnotationBarButton.m */; };
+		C9AF188E29F4C8A900EC4979 /* CPDFAnnotationBaseViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = C9AF188C29F4C8A900EC4979 /* CPDFAnnotationBaseViewController.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		C9AF188F29F4C8A900EC4979 /* CPDFAnnotationBaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C9AF188D29F4C8A900EC4979 /* CPDFAnnotationBaseViewController.m */; };
+		C9AF189229F4D0F300EC4979 /* CPDFAnnotationSampleView.h in Headers */ = {isa = PBXBuildFile; fileRef = C9AF189029F4D0F300EC4979 /* CPDFAnnotationSampleView.h */; };
+		C9AF189329F4D0F300EC4979 /* CPDFAnnotationSampleView.m in Sources */ = {isa = PBXBuildFile; fileRef = C9AF189129F4D0F300EC4979 /* CPDFAnnotationSampleView.m */; };
+		C9AF189729F4DA6A00EC4979 /* CPDFColorPickerView.h in Headers */ = {isa = PBXBuildFile; fileRef = C9AF189529F4DA6A00EC4979 /* CPDFColorPickerView.h */; };
+		C9AF189829F4DA6A00EC4979 /* CPDFColorPickerView.m in Sources */ = {isa = PBXBuildFile; fileRef = C9AF189629F4DA6A00EC4979 /* CPDFColorPickerView.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 */; };
+		C9B9EC5429F544DD00C6A5D2 /* CPDFCustomColorViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = C9B9EC5229F544DD00C6A5D2 /* CPDFCustomColorViewController.h */; };
+		C9B9EC5529F544DD00C6A5D2 /* CPDFCustomColorViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C9B9EC5329F544DD00C6A5D2 /* CPDFCustomColorViewController.m */; };
+		C9B9EC5929F54E9600C6A5D2 /* CAnnotStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = C9B9EC5729F54E9600C6A5D2 /* CAnnotStyle.h */; };
+		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 */; };
 		F32DA16429ED904300E19ECA /* CPDFOutlineViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F32DA12429ED904300E19ECA /* CPDFOutlineViewCell.m */; };
@@ -100,6 +116,23 @@
 		C9AF183D29F223A700EC4979 /* Image.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Image.xcassets; sourceTree = "<group>"; };
 		C9AF183F29F22BBD00EC4979 /* CPDFAnnotationBarButton.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFAnnotationBarButton.h; sourceTree = "<group>"; };
 		C9AF184029F22BBD00EC4979 /* CPDFAnnotationBarButton.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFAnnotationBarButton.m; sourceTree = "<group>"; };
+		C9AF188C29F4C8A900EC4979 /* CPDFAnnotationBaseViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFAnnotationBaseViewController.h; sourceTree = "<group>"; };
+		C9AF188D29F4C8A900EC4979 /* CPDFAnnotationBaseViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFAnnotationBaseViewController.m; sourceTree = "<group>"; };
+		C9AF189029F4D0F300EC4979 /* CPDFAnnotationSampleView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFAnnotationSampleView.h; sourceTree = "<group>"; };
+		C9AF189129F4D0F300EC4979 /* CPDFAnnotationSampleView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFAnnotationSampleView.m; sourceTree = "<group>"; };
+		C9AF189529F4DA6A00EC4979 /* CPDFColorPickerView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFColorPickerView.h; sourceTree = "<group>"; };
+		C9AF189629F4DA6A00EC4979 /* CPDFColorPickerView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFColorPickerView.m; sourceTree = "<group>"; };
+		C9AF189929F4DBF800EC4979 /* CPDFOpacitySliderView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFOpacitySliderView.h; sourceTree = "<group>"; };
+		C9AF189A29F4DBF800EC4979 /* CPDFOpacitySliderView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFOpacitySliderView.m; sourceTree = "<group>"; };
+		C9B9EC4829F4DC8900C6A5D2 /* CPDFThicknessSliderView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFThicknessSliderView.h; sourceTree = "<group>"; };
+		C9B9EC4929F4DC8900C6A5D2 /* CPDFThicknessSliderView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFThicknessSliderView.m; sourceTree = "<group>"; };
+		C9B9EC4C29F5038100C6A5D2 /* CPDFAnnotationBaseViewController_Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFAnnotationBaseViewController_Header.h; sourceTree = "<group>"; };
+		C9B9EC4D29F52DBF00C6A5D2 /* AAPLCustomPresentationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AAPLCustomPresentationController.h; sourceTree = "<group>"; };
+		C9B9EC4F29F52DCC00C6A5D2 /* AAPLCustomPresentationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AAPLCustomPresentationController.m; sourceTree = "<group>"; };
+		C9B9EC5229F544DD00C6A5D2 /* CPDFCustomColorViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFCustomColorViewController.h; sourceTree = "<group>"; };
+		C9B9EC5329F544DD00C6A5D2 /* CPDFCustomColorViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFCustomColorViewController.m; sourceTree = "<group>"; };
+		C9B9EC5729F54E9600C6A5D2 /* CAnnotStyle.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CAnnotStyle.h; sourceTree = "<group>"; };
+		C9B9EC5829F54E9600C6A5D2 /* CAnnotStyle.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CAnnotStyle.m; sourceTree = "<group>"; };
 		F313657129E4367A00EE6BBB /* ComPDFKit.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = ComPDFKit.xcframework; path = ../Lib/ComPDFKit.xcframework; sourceTree = "<group>"; };
 		F32DA12229ED904300E19ECA /* CPDFOutlineModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPDFOutlineModel.h; sourceTree = "<group>"; };
 		F32DA12329ED904300E19ECA /* Image.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Image.xcassets; sourceTree = "<group>"; };
@@ -187,6 +220,8 @@
 			isa = PBXGroup;
 			children = (
 				C9AF182529EE8AB600EC4979 /* UtilsColor.xcassets */,
+				C9B9EC4D29F52DBF00C6A5D2 /* AAPLCustomPresentationController.h */,
+				C9B9EC4F29F52DCC00C6A5D2 /* AAPLCustomPresentationController.m */,
 				F38F60C429EFF0C1008098F8 /* CPDFColorUtils.h */,
 				F38F60C529EFF0C1008098F8 /* CPDFColorUtils.m */,
 			);
@@ -217,6 +252,73 @@
 			path = PDFAnnotationBar;
 			sourceTree = "<group>";
 		};
+		C9AF188829F4C65500EC4979 /* Annotation */ = {
+			isa = PBXGroup;
+			children = (
+				C9AF188A29F4C7C900EC4979 /* PDFProperties */,
+				C9AF188929F4C68200EC4979 /* PDFAnnotationList */,
+			);
+			path = Annotation;
+			sourceTree = "<group>";
+		};
+		C9AF188929F4C68200EC4979 /* PDFAnnotationList */ = {
+			isa = PBXGroup;
+			children = (
+			);
+			path = PDFAnnotationList;
+			sourceTree = "<group>";
+		};
+		C9AF188A29F4C7C900EC4979 /* PDFProperties */ = {
+			isa = PBXGroup;
+			children = (
+				C9AF188B29F4C83900EC4979 /* PDFBase */,
+			);
+			path = PDFProperties;
+			sourceTree = "<group>";
+		};
+		C9AF188B29F4C83900EC4979 /* PDFBase */ = {
+			isa = PBXGroup;
+			children = (
+				C9AF188C29F4C8A900EC4979 /* CPDFAnnotationBaseViewController.h */,
+				C9AF188D29F4C8A900EC4979 /* CPDFAnnotationBaseViewController.m */,
+				C9B9EC4C29F5038100C6A5D2 /* CPDFAnnotationBaseViewController_Header.h */,
+			);
+			path = PDFBase;
+			sourceTree = "<group>";
+		};
+		C9AF189429F4D92C00EC4979 /* PDFProperties */ = {
+			isa = PBXGroup;
+			children = (
+				C9AF189029F4D0F300EC4979 /* CPDFAnnotationSampleView.h */,
+				C9AF189129F4D0F300EC4979 /* CPDFAnnotationSampleView.m */,
+				C9AF189529F4DA6A00EC4979 /* CPDFColorPickerView.h */,
+				C9AF189629F4DA6A00EC4979 /* CPDFColorPickerView.m */,
+				C9AF189929F4DBF800EC4979 /* CPDFOpacitySliderView.h */,
+				C9AF189A29F4DBF800EC4979 /* CPDFOpacitySliderView.m */,
+				C9B9EC4829F4DC8900C6A5D2 /* CPDFThicknessSliderView.h */,
+				C9B9EC4929F4DC8900C6A5D2 /* CPDFThicknessSliderView.m */,
+			);
+			path = PDFProperties;
+			sourceTree = "<group>";
+		};
+		C9B9EC5129F5448D00C6A5D2 /* CustomColor */ = {
+			isa = PBXGroup;
+			children = (
+				C9B9EC5229F544DD00C6A5D2 /* CPDFCustomColorViewController.h */,
+				C9B9EC5329F544DD00C6A5D2 /* CPDFCustomColorViewController.m */,
+			);
+			path = CustomColor;
+			sourceTree = "<group>";
+		};
+		C9B9EC5629F54E6700C6A5D2 /* Model */ = {
+			isa = PBXGroup;
+			children = (
+				C9B9EC5729F54E9600C6A5D2 /* CAnnotStyle.h */,
+				C9B9EC5829F54E9600C6A5D2 /* CAnnotStyle.m */,
+			);
+			path = Model;
+			sourceTree = "<group>";
+		};
 		F313657029E4367A00EE6BBB /* Frameworks */ = {
 			isa = PBXGroup;
 			children = (
@@ -315,6 +417,11 @@
 			children = (
 			);
 			path = Annotation;
+		F32DA14229ED904300E19ECA /* Edit */ = {
+			isa = PBXGroup;
+			children = (
+			);
+			path = Edit;
 			sourceTree = "<group>";
 		};
 		F32DA14429ED904300E19ECA /* PageEdit */ = {
@@ -334,6 +441,7 @@
 		F32DA14629ED904300E19ECA /* Common */ = {
 			isa = PBXGroup;
 			children = (
+				C9B9EC5629F54E6700C6A5D2 /* Model */,
 				C949FEE029EE70D000C30A8D /* Utils */,
 				F32DA14729ED904300E19ECA /* Controls */,
 				F32DA14E29ED904300E19ECA /* Views */,
@@ -344,6 +452,7 @@
 		F32DA14729ED904300E19ECA /* Controls */ = {
 			isa = PBXGroup;
 			children = (
+				C9B9EC5129F5448D00C6A5D2 /* CustomColor */,
 				F32DA14829ED904300E19ECA /* BOTA */,
 				F32DA14B29ED904300E19ECA /* PDFNavigationController */,
 			);
@@ -371,6 +480,7 @@
 		F32DA14E29ED904300E19ECA /* Views */ = {
 			isa = PBXGroup;
 			children = (
+				C9AF189429F4D92C00EC4979 /* PDFProperties */,
 				C9AF183829F2180A00EC4979 /* PDFAnnotationBar */,
 				F32DA14F29ED904300E19ECA /* PDFNavigationRightView */,
 				F32DA15329ED904300E19ECA /* PDFActivityIndicatorView */,
@@ -431,7 +541,7 @@
 		F335EE4929E430C800ACC72A /* compdfkit-tools */ = {
 			isa = PBXGroup;
 			children = (
-				F32DA14329ED904300E19ECA /* Annotation */,
+				C9AF188829F4C65500EC4979 /* Annotation */,
 				F32DA14629ED904300E19ECA /* Common */,
 				4F17C0BB29F5168900445550 /* Edit */,
 				F32DA14529ED904300E19ECA /* Form */,
@@ -498,6 +608,7 @@
 				4F17C0C629F517B500445550 /* CPDFEditContextMenu.h in Headers */,
 				F32DA18029ED904300E19ECA /* CNavigationController.h in Headers */,
 				F32DA17429ED904300E19ECA /* CPDFInfoViewController.h in Headers */,
+				C9AF189229F4D0F300EC4979 /* CPDFAnnotationSampleView.h in Headers */,
 				F382636B29EFD0D9003F1DFD /* CPDFSlider.h in Headers */,
 				C9AF184129F22BBD00EC4979 /* CPDFAnnotationBarButton.h in Headers */,
 				4F17C0BE29F5179000445550 /* CPDFTextProperty.h in Headers */,
@@ -505,17 +616,24 @@
 				F3877E1629E6764E00037D92 /* CPDFDisplayViewController.h in Headers */,
 				F32DA19129ED908800E19ECA /* CPDFMoreListViewController.h in Headers */,
 				F32DA17029ED904300E19ECA /* CPDFThumbnailViewCell.h in Headers */,
+				C9AF189729F4DA6A00EC4979 /* CPDFColorPickerView.h in Headers */,
 				C9AF183B29F2198700EC4979 /* CPDFAnnotationBar.h in Headers */,
 				F32DA17929ED904300E19ECA /* CPDFDisplayViewController.h in Headers */,
 				C9AF183029EFB23C00EC4979 /* CPDFBookmarkViewController.h in Headers */,
 				F32DA16C29ED904300E19ECA /* CPDFSearchResultsViewController.h in Headers */,
 				F382636829EFD0D9003F1DFD /* CPDFPageIndicatorView.h in Headers */,
+				C9B9EC4A29F4DC8900C6A5D2 /* CPDFThicknessSliderView.h in Headers */,
 				C9AF182C29EFB1FC00EC4979 /* CPDFBookmarkViewCell.h in Headers */,
 				F32DA16529ED904300E19ECA /* CPDFOutlineViewController.h in Headers */,
 				F38F60C629EFF0C2008098F8 /* CPDFColorUtils.h in Headers */,
+				C9AF189B29F4DBF800EC4979 /* CPDFOpacitySliderView.h in Headers */,
 				F32DA17829ED904300E19ECA /* CPDFDisplayTableViewCell.h in Headers */,
+				C9B9EC4E29F52DBF00C6A5D2 /* AAPLCustomPresentationController.h in Headers */,
 				F32DA17129ED904300E19ECA /* CPDFThumbnailViewController.h in Headers */,
+				C9B9EC5929F54E9600C6A5D2 /* CAnnotStyle.h in Headers */,
 				F32DA16229ED904300E19ECA /* CPDFOutlineModel.h in Headers */,
+				C9B9EC5429F544DD00C6A5D2 /* CPDFCustomColorViewController.h in Headers */,
+				C9AF188E29F4C8A900EC4979 /* CPDFAnnotationBaseViewController.h in Headers */,
 				F335EE4B29E430C800ACC72A /* compdfkit_tools.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
@@ -599,18 +717,24 @@
 			buildActionMask = 2147483647;
 			files = (
 				F32DA17B29ED904300E19ECA /* CPDFDisplayViewController.m in Sources */,
+				C9B9EC5029F52DCC00C6A5D2 /* AAPLCustomPresentationController.m in Sources */,
 				F32DA17F29ED904300E19ECA /* CNavigationController.m in Sources */,
 				F382636D29EFD0D9003F1DFD /* CPDFListView.m in Sources */,
 				C9AF184229F22BBD00EC4979 /* CPDFAnnotationBarButton.m in Sources */,
 				F32DA17329ED904300E19ECA /* CPDFThumbnailViewController.m in Sources */,
+				C9B9EC4B29F4DC8900C6A5D2 /* CPDFThicknessSliderView.m in Sources */,
+				C9B9EC5A29F54E9600C6A5D2 /* CAnnotStyle.m in Sources */,
 				F32DA16929ED904300E19ECA /* CPDFSearchResultsViewController.m in Sources */,
 				4F17C0BF29F5179000445550 /* CPDFTextProperty.m in Sources */,
 				F32DA16D29ED904300E19ECA /* CPDFSearchViewCell.m in Sources */,
 				F32DA16429ED904300E19ECA /* CPDFOutlineViewCell.m in Sources */,
 				F382636A29EFD0D9003F1DFD /* CPDFSlider.m in Sources */,
+				C9AF189C29F4DBF800EC4979 /* CPDFOpacitySliderView.m in Sources */,
+				C9AF189329F4D0F300EC4979 /* CPDFAnnotationSampleView.m in Sources */,
 				F32DA16629ED904300E19ECA /* CPDFOutlineModel.m in Sources */,
 				F32DA16729ED904300E19ECA /* CPDFOutlineViewController.m in Sources */,
 				F38F60C729EFF0C2008098F8 /* CPDFColorUtils.m in Sources */,
+				C9B9EC5529F544DD00C6A5D2 /* CPDFCustomColorViewController.m in Sources */,
 				C9AF183C29F2198700EC4979 /* CPDFAnnotationBar.m in Sources */,
 				F32DA17A29ED904300E19ECA /* CPDFDisplayTableViewCell.m in Sources */,
 				F32DA17D29ED904300E19ECA /* CPDFBOTAViewController.m in Sources */,
@@ -626,7 +750,9 @@
 				4F17C0C329F517A200445550 /* CPDFImageProperty.m in Sources */,
 				C9AF183129EFB23C00EC4979 /* CPDFBookmarkViewController.m in Sources */,
 				F32DA17629ED904300E19ECA /* CPDFInfoViewController.m in Sources */,
+				C9AF189829F4DA6A00EC4979 /* CPDFColorPickerView.m in Sources */,
 				C9AF182D29EFB1FC00EC4979 /* CPDFBookmarkViewCell.m in Sources */,
+				C9AF188F29F4C8A900EC4979 /* CPDFAnnotationBaseViewController.m in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -766,7 +892,7 @@
 				HEADER_SEARCH_PATHS = "";
 				INFOPLIST_KEY_NSHumanReadableCopyright = "";
 				INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
-				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 10.0;
 				LD_RUNPATH_SEARCH_PATHS = (
 					"$(inherited)",
 					"@executable_path/Frameworks",
@@ -799,7 +925,7 @@
 				HEADER_SEARCH_PATHS = "";
 				INFOPLIST_KEY_NSHumanReadableCopyright = "";
 				INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
-				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 10.0;
 				LD_RUNPATH_SEARCH_PATHS = (
 					"$(inherited)",
 					"@executable_path/Frameworks",

+ 1 - 1
compdfkit-tools/compdfkit-tools.xcodeproj/xcuserdata/kdanmobile_2.xcuserdatad/xcschemes/xcschememanagement.plist

@@ -7,7 +7,7 @@
 		<key>compdfkit-tools.xcscheme_^#shared#^_</key>
 		<dict>
 			<key>orderHint</key>
-			<integer>1</integer>
+			<integer>2</integer>
 		</dict>
 	</dict>
 </dict>

+ 23 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFBase/CPDFAnnotationBaseViewController.h

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

+ 72 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFBase/CPDFAnnotationBaseViewController.m

@@ -0,0 +1,72 @@
+//
+//  CPDFAnnotationBaseViewController.m
+//  compdfkit-tools
+//
+//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
+//
+//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
+//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
+//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
+//  This notice may not be removed from this file.
+//
+
+#import "CPDFAnnotationBaseViewController.h"
+#import "CPDFAnnotationBaseViewController_Header.h"
+
+@interface CPDFAnnotationBaseViewController ()
+
+@end
+
+@implementation CPDFAnnotationBaseViewController
+
+#pragma mark - Initializers
+
+
+#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 grayColor];
+    self.sampleView.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;
+    [self.view addSubview:self.sampleView];
+    
+    self.colorView = [[CPDFColorPickerView alloc] initWithFrame:CGRectMake(0, 190, self.view.frame.size.width, 90)];
+    self.colorView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
+    [self.view addSubview:self.colorView];
+    
+    self.opacitySliderView = [[CPDFOpacitySliderView alloc] init];
+    self.opacitySliderView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
+    [self.view addSubview:self.opacitySliderView];
+    
+    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.colorView.frame = CGRectMake(0, 190, self.view.frame.size.width, 90);
+    self.opacitySliderView.frame = CGRectMake(0, 280, self.view.frame.size.width, 90);
+}
+
+- (void)willTransitionToTraitCollection:(UITraitCollection *)newCollection withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
+{
+    [super willTransitionToTraitCollection:newCollection withTransitionCoordinator:coordinator];
+    [self updatePreferredContentSizeWithTraitCollection:newCollection];
+}
+
+- (void)updatePreferredContentSizeWithTraitCollection:(UITraitCollection *)traitCollection
+{
+    self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact ? 270 : 420);
+}
+
+@end

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

@@ -0,0 +1,25 @@
+//
+//  CPDFAnnotationBaseViewController_Header.h
+//  compdfkit-tools
+//
+//  Created by kdanmobile_2 on 2023/4/23.
+//
+
+#ifndef CPDFAnnotationBaseViewController_Header_h
+#define CPDFAnnotationBaseViewController_Header_h
+
+#import "CPDFAnnotationSampleView.h"
+#import "CPDFColorPickerView.h"
+#import "CPDFOpacitySliderView.h"
+
+@interface CPDFAnnotationBaseViewController ()
+
+@property (nonatomic, strong) CPDFAnnotationSampleView *sampleView;
+
+@property (nonatomic, strong) CPDFColorPickerView *colorView;
+
+@property (nonatomic, strong) CPDFOpacitySliderView *opacitySliderView;
+
+@end
+
+#endif /* CPDFAnnotationBaseViewController_Header_h */

+ 9 - 4
compdfkit-tools/compdfkit-tools/Common/Controls/BOTA/CPDFBOTAViewController.m

@@ -82,10 +82,15 @@
 
 - (void)viewWillLayoutSubviews {
     _segmentedControl.frame = CGRectMake(self.view.frame.size.width / 4, 0 , self.view.frame.size.width / 2, 30);
-    
-    self.outlineViewController.view.frame = CGRectMake(0, self.view.safeAreaInsets.top, self.view.bounds.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, self.view.bounds.size.height - self.view.safeAreaInsets.top - self.view.safeAreaInsets.bottom);
-    
-    _bookmarkViewController.view.frame = CGRectMake(0, self.view.safeAreaInsets.top, self.view.bounds.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, self.view.bounds.size.height - self.view.safeAreaInsets.top - self.view.safeAreaInsets.bottom);
+    if (@available(iOS 11.0, *)) {
+        self.outlineViewController.view.frame = CGRectMake(0, self.view.safeAreaInsets.top, self.view.bounds.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, self.view.bounds.size.height - self.view.safeAreaInsets.top - self.view.safeAreaInsets.bottom);
+        
+        _bookmarkViewController.view.frame = CGRectMake(0, self.view.safeAreaInsets.top, self.view.bounds.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, self.view.bounds.size.height - self.view.safeAreaInsets.top - self.view.safeAreaInsets.bottom);
+    } else {
+        self.outlineViewController.view.frame = CGRectMake(0, 64, self.view.bounds.size.width - 64 - 30, self.view.bounds.size.height - 64 - 30);
+        
+        _bookmarkViewController.view.frame = CGRectMake(0, 64, self.view.bounds.size.width - 64 - 30, self.view.bounds.size.height - 64 - 30);
+    }
 }
 
 #pragma mark - Action

+ 21 - 0
compdfkit-tools/compdfkit-tools/Common/Controls/CustomColor/CPDFCustomColorViewController.h

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

+ 25 - 0
compdfkit-tools/compdfkit-tools/Common/Controls/CustomColor/CPDFCustomColorViewController.m

@@ -0,0 +1,25 @@
+//
+//  CPDFCustomColorViewController.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 "CPDFCustomColorViewController.h"
+
+@interface CPDFCustomColorViewController ()
+
+@end
+
+@implementation CPDFCustomColorViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+}
+
+@end

+ 16 - 0
compdfkit-tools/compdfkit-tools/Common/Model/CAnnotStyle.h

@@ -0,0 +1,16 @@
+//
+//  CAnnotStyle.h
+//  compdfkit-tools
+//
+//  Created by kdanmobile_2 on 2023/4/23.
+//
+
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface CAnnotStyle : NSObject
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 12 - 0
compdfkit-tools/compdfkit-tools/Common/Model/CAnnotStyle.m

@@ -0,0 +1,12 @@
+//
+//  CAnnotStyle.m
+//  compdfkit-tools
+//
+//  Created by kdanmobile_2 on 2023/4/23.
+//
+
+#import "CAnnotStyle.h"
+
+@implementation CAnnotStyle
+
+@end

+ 16 - 0
compdfkit-tools/compdfkit-tools/Common/Utils/AAPLCustomPresentationController.h

@@ -0,0 +1,16 @@
+//
+//  CPDFBOTAViewController.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;
+
+@interface AAPLCustomPresentationController : UIPresentationController <UIViewControllerTransitioningDelegate>
+@end

+ 366 - 0
compdfkit-tools/compdfkit-tools/Common/Utils/AAPLCustomPresentationController.m

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

+ 1 - 1
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/CPDFAnnotationBar.h

@@ -12,7 +12,7 @@
 
 #import <UIKit/UIKit.h>
 
-typedef NS_ENUM(NSInteger, PDFToolbarSelectedIndex) {
+typedef NS_ENUM(NSInteger, CPDFToolbarSelectedIndex) {
     CPDFToolbarNote = 0,
     CPDFToolbarHighlight,
     CPDFToolbarUnderline,

+ 16 - 3
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/CPDFAnnotationBar.m

@@ -78,21 +78,22 @@
 - (void)initSubview {
     _propertiesBar = [[UIView alloc] initWithFrame:CGRectMake(self.bounds.size.width - 180, 0, 180, 44)];
     _propertiesBar.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
+    _propertiesBar.backgroundColor = [UIColor grayColor];
     [self addSubview:self.propertiesBar];
     
     _propertiesBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 1, 60, 43)];
-    [_propertiesBtn setImage:[UIImage imageNamed:@"" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
+    [_propertiesBtn setImage:[UIImage imageNamed:@"CPDFAnnotationBarImageProperties" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
     _propertiesBtn.userInteractionEnabled = NO;
     [_propertiesBtn addTarget:self action:@selector(buttonItemClicked_open:) forControlEvents:UIControlEventTouchUpInside];
     [self.propertiesBar addSubview:self.propertiesBtn];
     
     _undoBtn = [[UIButton alloc] initWithFrame:CGRectMake(60, 1, 60, 43)];
-    [_undoBtn setImage:[UIImage imageNamed:@"" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
+    [_undoBtn setImage:[UIImage imageNamed:@"CPDFAnnotationBarImageUndo" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
     [_undoBtn addTarget:self action:@selector(buttonItemClicked_undo:) forControlEvents:UIControlEventTouchUpInside];
     [self.propertiesBar addSubview:self.undoBtn];
     
     _redoBtn = [[UIButton alloc] initWithFrame:CGRectMake(120, 1, 60, 43)];
-    [_redoBtn setImage:[UIImage imageNamed:@"" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
+    [_redoBtn setImage:[UIImage imageNamed:@"CPDFAnnotationBarImageRedo" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
     [_redoBtn addTarget:self action:@selector(buttonItemClicked_redo:) forControlEvents:UIControlEventTouchUpInside];
     [self.propertiesBar addSubview:self.redoBtn];
     
@@ -149,6 +150,13 @@
         }
     }
     self.annotationBtns = annotationBtns;
+    
+    if (UIUserInterfaceIdiomPhone == UI_USER_INTERFACE_IDIOM()) {
+        _scrollView.contentSize = CGSizeMake(offsetX, _scrollView.bounds.size.height);
+    } else {
+        _scrollView.contentSize = CGSizeMake(_scrollView.bounds.size.width, offsetX);
+    }
+    [self.scrollView bringSubviewToFront:self.propertiesBar];
 }
 
 #pragma mark - Action
@@ -156,6 +164,7 @@
 - (void)buttonItemClicked_Switch:(UIButton *)button {
     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];
@@ -183,4 +192,8 @@
     
 }
 
+#pragma mark - UIScrollViewDelegate
+
+
+
 @end

+ 2 - 1
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageProperties.imageset/Contents.json

@@ -1,11 +1,12 @@
 {
   "images" : [
     {
-      "filename" : "iconmonstr-pencil-text-filled.svg",
+      "filename" : "text_search2.png",
       "idiom" : "universal",
       "scale" : "1x"
     },
     {
+      "filename" : "text_search2@2x.png",
       "idiom" : "universal",
       "scale" : "2x"
     },

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


BIN
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageProperties.imageset/text_search2.png


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


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

@@ -1,10 +1,12 @@
 {
   "images" : [
     {
+      "filename" : "btn_nextpage.png",
       "idiom" : "universal",
       "scale" : "1x"
     },
     {
+      "filename" : "btn_nextpage@2x.png",
       "idiom" : "universal",
       "scale" : "2x"
     },

BIN
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageRedo.imageset/btn_nextpage.png


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


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

@@ -1,10 +1,12 @@
 {
   "images" : [
     {
+      "filename" : "btn_frontpage.png",
       "idiom" : "universal",
       "scale" : "1x"
     },
     {
+      "filename" : "btn_frontpage@2x.png",
       "idiom" : "universal",
       "scale" : "2x"
     },

BIN
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageUndo.imageset/btn_frontpage.png


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


+ 42 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFAnnotationSampleView.h

@@ -0,0 +1,42 @@
+//
+//  CPDFAnnotationSampleView.h
+//  compdfkit-tools
+//
+//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
+//
+//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
+//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
+//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
+//  This notice may not be removed from this file.
+//
+
+#import <UIKit/UIKit.h>
+
+typedef NS_ENUM(NSInteger, CPDFSamplesSelectedIndex) {
+    CPDFSamplesNote = 0,
+    CPDFSamplesHighlight,
+    CPDFSamplesUnderline,
+    CPDFSamplesStrikeout,
+    CPDFSamplesSquiggly,
+    CPDFToolbarFreehand,
+    CPDFToolbarShapeCircle,
+    CPDFToolbarShapeRectangle,
+    CPDFToolbarShapeArrow,
+    CPDFToolbarShapeLine,
+    CPDFToolbarFreeText,
+    CPDFToolbarSignature,
+    CPDFToolbarStamp,
+    CPDFToolbarImage,
+    CPDFToolbarLink,
+    CPDFToolbarLSound,
+};
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface CPDFAnnotationSampleView : UIView
+
+@property (nonatomic, assign) CPDFSamplesSelectedIndex selecIndex;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 39 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFAnnotationSampleView.m

@@ -0,0 +1,39 @@
+//
+//  CPDFAnnotationSampleView.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 "CPDFAnnotationSampleView.h"
+
+@implementation CPDFAnnotationSampleView
+
+#pragma mark - Initializers
+
+- (instancetype)initWithFrame:(CGRect)frame {
+    if (self = [super initWithFrame:frame]) {
+        
+    }
+    return self;
+}
+
+- (void)drawRect:(CGRect)rect {
+    [super drawRect:rect];
+    CGContextRef context = UIGraphicsGetCurrentContext();
+    
+    [self drawSamples:context];
+}
+
+#pragma mark - Private Methods
+
+- (void)drawSamples:(CGContextRef)context {
+    
+}
+
+@end

+ 25 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFColorPickerView.h

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

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

@@ -0,0 +1,58 @@
+//
+//  CPDFColorPickerView.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 "CPDFColorPickerView.h"
+
+@implementation CPDFColorPickerView
+
+#pragma mark - Initializers
+
+- (instancetype)initWithFrame:(CGRect)frame {
+    if (self = [super initWithFrame:frame]) {
+        self.colorLabel = [[UILabel alloc] initWithFrame:CGRectMake(5, 0, 50, 30)];
+        self.colorLabel.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;
+        self.colorLabel.text = NSLocalizedString(@"Color:", nil);
+        self.colorLabel.adjustsFontSizeToFitWidth = YES;
+        [self addSubview:self.colorLabel];
+        
+        self.colorPickerView = [[UIView alloc] initWithFrame:CGRectMake(0, 30, self.bounds.size.width, 60)];
+        [self pickerBarInit];
+        self.colorPickerView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
+        [self addSubview:self.colorPickerView];
+        
+    }
+    return self;
+}
+
+- (void)pickerBarInit {
+    for (int i = 0; i < 6; i++) {
+        UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake((self.bounds.size.width - 300)/7 * (i+1) + 50 * i, 5, 50, 50)];
+        [[button layer] setCornerRadius:25];
+        button.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleLeftMargin;
+        button.backgroundColor = [UIColor purpleColor];
+        [button addTarget:self action:@selector(buttonItemClicked_select:) forControlEvents:UIControlEventTouchUpInside];
+        [self.colorPickerView addSubview:button];
+    }
+}
+
+#pragma mark - Action
+
+- (void)buttonItemClicked_select:(UIButton *)button {
+    switch (button.tag) {
+        case 1:
+            NSLog(@"");
+        default:
+            NSLog(@" ");
+    }
+}
+
+@end

+ 29 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFOpacitySliderView.h

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

+ 47 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFOpacitySliderView.m

@@ -0,0 +1,47 @@
+//
+//  CPDFOpacitySliderView.m
+//  compdfkit-tools
+//
+//  Created by kdanmobile_2 on 2023/4/23.
+//
+
+#import "CPDFOpacitySliderView.h"
+
+@implementation CPDFOpacitySliderView
+
+#pragma mark - Initializers
+
+- (instancetype)initWithFrame:(CGRect)frame {
+    if (self = [super initWithFrame:frame]) {
+        self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(5, 0, 50, 30)];
+        self.titleLabel.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;
+        self.titleLabel.text = NSLocalizedString(@"Opacity:", nil);
+        self.titleLabel.adjustsFontSizeToFitWidth = YES;
+        [self addSubview:self.titleLabel];
+        
+        self.opacitySlider = [[UISlider alloc] initWithFrame:CGRectMake(5, 30, self.frame.size.width - 10, 30)];
+        self.opacitySlider.autoresizingMask = UIViewAutoresizingFlexibleWidth;
+        self.opacitySlider.value = 0;
+        [self.opacitySlider addTarget:self action:@selector(buttonItemClicked_changes:) forControlEvents:UIControlEventValueChanged];
+        [self addSubview:self.opacitySlider];
+        
+        self.startLabel = [[UILabel alloc] initWithFrame:CGRectMake(5, 60, 30, 20)];
+        self.startLabel.text = NSLocalizedString(@"0", nil);
+        self.startLabel.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;
+        [self addSubview:self.startLabel];
+        
+        self.endLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.bounds.size.width - 35, 60, 30, 20)];
+        self.endLabel.text = NSLocalizedString(@"1", nil);
+        self.endLabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
+        [self addSubview:self.endLabel];
+    }
+    return self;
+}
+
+#pragma mark - Action
+
+- (void)buttonItemClicked_changes:(id)sender {
+    
+}
+
+@end

+ 16 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFThicknessSliderView.h

@@ -0,0 +1,16 @@
+//
+//  CPDFThicknessSliderView.h
+//  compdfkit-tools
+//
+//  Created by kdanmobile_2 on 2023/4/23.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface CPDFThicknessSliderView : UIView
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 20 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFThicknessSliderView.m

@@ -0,0 +1,20 @@
+//
+//  CPDFThicknessSliderView.m
+//  compdfkit-tools
+//
+//  Created by kdanmobile_2 on 2023/4/23.
+//
+
+#import "CPDFThicknessSliderView.h"
+
+@implementation CPDFThicknessSliderView
+
+/*
+// Only override drawRect: if you perform custom drawing.
+// An empty implementation adversely affects performance during animation.
+- (void)drawRect:(CGRect)rect {
+    // Drawing code
+}
+*/
+
+@end

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

@@ -42,11 +42,16 @@
 // ListView
 #import <compdfkit_tools/CPDFListView.h>
 
-//PDFInfo
+// PDFInfo
 #import <compdfkit_tools/CPDFInfoViewController.h>
 
-//More
+// More
 #import <compdfkit_tools/CPDFMoreListViewController.h>
 
 //Edit
 #import <compdfkit_tools/CPDFEditToolBar.h>
+// Annotation
+#import <compdfkit_tools/CPDFAnnotationBar.h>
+#import <compdfkit_tools/CPDFAnnotationBaseViewController.h>
+#import <compdfkit_tools/AAPLCustomPresentationController.h>
+