Kaynağa Gözat

PDFTools(iOS) - 高保真修改

yangliuhua 1 yıl önce
ebeveyn
işleme
6b7ac2dab4
42 değiştirilmiş dosya ile 1196 ekleme ve 172 silme
  1. 1 1
      compdfkit-tools/compdfkit-tools.xcodeproj/project.pbxproj
  2. 0 1
      compdfkit-tools/compdfkit-tools/Annotation/PDFAnnotationManage/CAnnotationManage.m
  3. 35 10
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFBase/CPDFAnnotationBaseViewController.m
  4. 2 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFBase/CPDFAnnotationBaseViewController_Header.h
  5. 95 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFBase/Image.xcassets/CPDFAnnotationBaseImageBack.imageset/Close Button.pdf
  6. 2 11
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFBase/Image.xcassets/CPDFAnnotationBaseImageBack.imageset/Contents.json
  7. 0 1
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFBase/Image.xcassets/CPDFAnnotationBaseImageBack.imageset/iconmonstr-x-mark-lined.svg
  8. 2 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFHighlight/CPDFHighlightViewController.m
  9. 3 1
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFNote/CPDFNoteOpenViewController.m
  10. 37 10
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFNote/CPDFNoteViewController.m
  11. 10 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFNote/Image.xcassets/CPDFNoteContentImageNameDelete.imageset/Contents.json
  12. 111 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFNote/Image.xcassets/CPDFNoteContentImageNameDelete.imageset/Union.pdf
  13. 10 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFNote/Image.xcassets/CPDFNoteContentImageNameSave.imageset/Contents.json
  14. 105 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFNote/Image.xcassets/CPDFNoteContentImageNameSave.imageset/Union.pdf
  15. 2 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSquiggly/CPDFSquigglyViewController.m
  16. 1 3
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CPDFStampViewController.h
  17. 143 7
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CPDFStampViewController.m
  18. 20 1
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampColorSelectView.h
  19. 75 7
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampColorSelectView.m
  20. 10 20
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampFileManger.m
  21. 13 1
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampPreview.h
  22. 57 11
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampPreview.m
  23. 12 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampTextViewController.h
  24. 57 31
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampTextViewController.m
  25. 2 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStrikeout/CPDFStrikeoutViewController.m
  26. 2 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFUnderline/CPDFUnderlineViewController.m
  27. 8 0
      compdfkit-tools/compdfkit-tools/Common/Utils/CPDFColorUtils.h
  28. 32 0
      compdfkit-tools/compdfkit-tools/Common/Utils/CPDFColorUtils.m
  29. 38 0
      compdfkit-tools/compdfkit-tools/Common/Utils/UtilsColor.xcassets/CAnnotationPropertyViewControllerBackgoundColor.colorset/Contents.json
  30. 38 0
      compdfkit-tools/compdfkit-tools/Common/Utils/UtilsColor.xcassets/CAnnotationSampleBackgoundColor.colorset/Contents.json
  31. 38 0
      compdfkit-tools/compdfkit-tools/Common/Utils/UtilsColor.xcassets/CAnnotationSampleDrawBackgoundColor.colorset/Contents.json
  32. 38 0
      compdfkit-tools/compdfkit-tools/Common/Utils/UtilsColor.xcassets/CNoteOpenBackgooundColor.colorset/Contents.json
  33. 126 3
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/CPDFAnnotationBar.m
  34. 1 1
      compdfkit-tools/compdfkit-tools/Common/Views/PDFPopMenu/CPDFPopMenuView.m
  35. 10 6
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFAnnotationSampleView.m
  36. 4 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFColorPickerView.m
  37. 44 37
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFColorSelectView.m
  38. 7 5
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFOpacitySliderView.m
  39. 0 2
      compdfkit-tools/compdfkit-tools/Common/Views/PDFView/PDFListView/CPDFListView+Annotation.h
  40. 2 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFView/PDFListView/CPDFListView.h
  41. 2 2
      compdfkit-tools/compdfkit-tools/Common/Views/PDFView/PDFListView/CPDFListView.m
  42. 1 0
      compdfkit-tools/compdfkit-tools/compdfkit_tools.h

+ 1 - 1
compdfkit-tools/compdfkit-tools.xcodeproj/project.pbxproj

@@ -115,7 +115,7 @@
 		C9AF189C29F4DBF800EC4979 /* CPDFOpacitySliderView.m in Sources */ = {isa = PBXBuildFile; fileRef = C9AF189A29F4DBF800EC4979 /* CPDFOpacitySliderView.m */; };
 		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 */; };
+		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 */; };
 		C9B9EC5A29F54E9600C6A5D2 /* CAnnotStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = C9B9EC5829F54E9600C6A5D2 /* CAnnotStyle.m */; };

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

@@ -13,7 +13,6 @@
 #import "CAnnotationManage.h"
 #import "CPDFListView.h"
 #import "CAnnotStyle.h"
-#import "CPDFNoteOpenViewController.h"
 
 #import <ComPDFKit/ComPDFKit.h>
 

+ 35 - 10
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFBase/CPDFAnnotationBaseViewController.m

@@ -13,7 +13,9 @@
 #import "CPDFAnnotationBaseViewController.h"
 #import "CPDFAnnotationBaseViewController_Header.h"
 
-@interface CPDFAnnotationBaseViewController () <CPDFColorSelectViewDelegate, CPDFColorPickerViewDelegate, CPDFOpacitySliderViewDelegate>
+#import <compdfkit_tools/CPDFColorUtils.h>
+
+@interface CPDFAnnotationBaseViewController () <UIColorPickerViewControllerDelegate, CPDFColorSelectViewDelegate, CPDFColorPickerViewDelegate, CPDFOpacitySliderViewDelegate>
 
 @end
 
@@ -35,6 +37,7 @@
     // Do any additional setup after loading the view.
     self.titleLabel = [[UILabel alloc] init];
     self.titleLabel.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;
+    self.titleLabel.textAlignment = NSTextAlignmentCenter;
     self.titleLabel.font = [UIFont systemFontOfSize:20];
     self.titleLabel.adjustsFontSizeToFitWidth = YES;
     [self.view addSubview:self.titleLabel];
@@ -49,12 +52,18 @@
     [self.backBtn addTarget:self action:@selector(buttonItemClicked_back:) forControlEvents:UIControlEventTouchUpInside];
     [self.view addSubview:self.backBtn];
     
+    self.sampleBackgoundView = [[UIView alloc] init];
+    self.sampleBackgoundView.layer.borderColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.1].CGColor;
+    self.sampleBackgoundView.layer.borderWidth = 1.0;
+    self.sampleBackgoundView.backgroundColor = [CPDFColorUtils CAnnotationSampleBackgoundColor];
+    [self.scrcollView addSubview:self.sampleBackgoundView];
+    
     self.sampleView = [[CPDFAnnotationSampleView alloc] init];
     self.sampleView.backgroundColor = [UIColor whiteColor];
-    self.sampleView.layer.borderColor = [UIColor purpleColor].CGColor;
+    self.sampleView.layer.borderColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.1].CGColor;
     self.sampleView.layer.borderWidth = 1.0;
     self.sampleView.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;
-    [self.scrcollView addSubview:self.sampleView];
+    [self.sampleBackgoundView addSubview:self.sampleView];
     
     self.colorView = [[CPDFColorSelectView alloc] init];
     self.colorView.delegate = self;
@@ -66,7 +75,7 @@
     self.opacitySliderView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
     [self.scrcollView addSubview:self.opacitySliderView];
     
-    self.view.backgroundColor = [UIColor whiteColor];
+    self.view.backgroundColor = [CPDFColorUtils CPDFViewControllerBackgroundColor];
     [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
 }
 
@@ -75,7 +84,8 @@
     self.titleLabel.frame = CGRectMake((self.view.frame.size.width - 120)/2, 5, 120, 50);
     self.scrcollView.frame = CGRectMake(0, 50, self.view.frame.size.width, 330);
     self.scrcollView.contentSize = CGSizeMake(self.view.frame.size.width, 420);
-    self.sampleView.frame  = CGRectMake((self.view.frame.size.width - 300)/2, ((self.view.frame.size.height)/9)*0, 300, 120);
+    self.sampleBackgoundView.frame = CGRectMake(0, 0, self.view.bounds.size.width, 120);
+    self.sampleView.frame  = CGRectMake((self.view.frame.size.width - 300)/2, 15, 300, self.sampleBackgoundView.bounds.size.height - 30);
     
     if (@available(iOS 11.0, *)) {
         self.colorPicker.frame = CGRectMake(self.view.safeAreaInsets.left, 0, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, self.view.frame.size.height);
@@ -113,6 +123,7 @@
     self.sampleView.fillColor = self.annotStyle.color;
     self.sampleView.opcity = self.annotStyle.opacity;
     self.opacitySliderView.opacitySlider.value = self.annotStyle.opacity;
+    self.opacitySliderView.startLabel.text = [NSString stringWithFormat:@"%d%%", (int)((self.opacitySliderView.opacitySlider.value/1)*100)];
 }
 
 - (void)updatePreferredContentSizeWithTraitCollection:(UITraitCollection *)traitCollection {
@@ -128,11 +139,17 @@
 #pragma mark - CPDFColorSelectViewDelegate
 
 - (void)selectColorView:(CPDFColorSelectView *)select {
-    _colorPicker = [[CPDFColorPickerView alloc] initWithFrame:self.view.frame];
-    _colorPicker.delegate = self;
-    _colorView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-    _colorPicker.backgroundColor = [UIColor whiteColor];
-    [self.view addSubview:self.colorPicker];
+    if (@available(iOS 14.0, *)) {
+        UIColorPickerViewController *picker = [[UIColorPickerViewController alloc] init];
+        picker.delegate = self;
+        [self presentViewController:picker animated:YES completion:nil];
+    } else {
+        _colorPicker = [[CPDFColorPickerView alloc] initWithFrame:self.view.frame];
+        _colorPicker.delegate = self;
+        _colorView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
+        _colorPicker.backgroundColor = [UIColor whiteColor];
+        [self.view addSubview:self.colorPicker];
+    }
 }
 
 - (void)selectColorView:(CPDFColorSelectView *)select color:(UIColor *)color {
@@ -154,4 +171,12 @@
     [self.sampleView setNeedsDisplay];
 }
 
+#pragma mark - UIColorPickerViewControllerDelegate
+
+- (void)colorPickerViewControllerDidFinish:(UIColorPickerViewController *)viewController {
+    self.sampleView.fillColor = viewController.selectedColor;
+    self.annotStyle.color = viewController.selectedColor;
+    [self.sampleView setNeedsDisplay];
+}
+
 @end

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

@@ -32,6 +32,8 @@
 
 @property (nonatomic, strong) CAnnotStyle *annotStyle;
 
+@property (nonatomic, strong) UIView *sampleBackgoundView;
+
 - (void)commomInitTitle;
 
 - (void)commomInitFromAnnotStyle;

+ 95 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFBase/Image.xcassets/CPDFAnnotationBaseImageBack.imageset/Close Button.pdf

@@ -0,0 +1,95 @@
+%PDF-1.7
+
+1 0 obj
+  << >>
+endobj
+
+2 0 obj
+  << /Length 3 0 R >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+1.000000 0.000000 -0.000000 1.000000 0.000000 0.000000 cm
+0.949020 0.952941 0.960784 scn
+15.000000 0.000000 m
+23.284271 0.000000 30.000000 6.715729 30.000000 15.000000 c
+30.000000 23.284271 23.284271 30.000000 15.000000 30.000000 c
+6.715729 30.000000 0.000000 23.284271 0.000000 15.000000 c
+0.000000 6.715729 6.715729 0.000000 15.000000 0.000000 c
+h
+f*
+n
+Q
+q
+0.707107 -0.707107 0.707107 0.707107 -1.020103 9.979958 cm
+0.600000 0.600000 0.600000 scn
+7.955774 22.655762 m
+7.287587 22.655762 6.745914 22.114000 6.745914 21.445702 c
+6.745914 15.801641 l
+1.209859 15.801641 l
+0.541672 15.801641 -0.000000 15.259879 0.000000 14.591582 c
+0.000000 13.923285 0.541673 13.381522 1.209860 13.381522 c
+6.745914 13.381522 l
+6.745914 7.737459 l
+6.745914 7.069161 7.287587 6.527399 7.955774 6.527399 c
+8.623961 6.527399 9.165634 7.069161 9.165634 7.737459 c
+9.165634 13.381521 l
+14.701677 13.381521 l
+15.369864 13.381521 15.911537 13.923283 15.911537 14.591580 c
+15.911537 15.259877 15.369864 15.801640 14.701677 15.801640 c
+9.165634 15.801640 l
+9.165634 21.445702 l
+9.165634 22.114000 8.623961 22.655762 7.955774 22.655762 c
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  1150
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 30.000000 30.000000 ]
+     /Resources 1 0 R
+     /Contents 2 0 R
+     /Parent 5 0 R
+  >>
+endobj
+
+5 0 obj
+  << /Kids [ 4 0 R ]
+     /Count 1
+     /Type /Pages
+  >>
+endobj
+
+6 0 obj
+  << /Pages 5 0 R
+     /Type /Catalog
+  >>
+endobj
+
+xref
+0 7
+0000000000 65535 f
+0000000010 00000 n
+0000000034 00000 n
+0000001240 00000 n
+0000001263 00000 n
+0000001436 00000 n
+0000001510 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+1569
+%%EOF

+ 2 - 11
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFBase/Image.xcassets/CPDFAnnotationBaseImageBack.imageset/Contents.json

@@ -1,17 +1,8 @@
 {
   "images" : [
     {
-      "filename" : "iconmonstr-x-mark-lined.svg",
-      "idiom" : "universal",
-      "scale" : "1x"
-    },
-    {
-      "idiom" : "universal",
-      "scale" : "2x"
-    },
-    {
-      "idiom" : "universal",
-      "scale" : "3x"
+      "filename" : "Close Button.pdf",
+      "idiom" : "universal"
     }
   ],
   "info" : {

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 1
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFBase/Image.xcassets/CPDFAnnotationBaseImageBack.imageset/iconmonstr-x-mark-lined.svg


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

@@ -32,7 +32,9 @@
 - (void)commomInitFromAnnotStyle {
     self.sampleView.fillColor = self.annotStyle.color;
     self.sampleView.opcity = self.annotStyle.opacity;
+    
     self.opacitySliderView.opacitySlider.value = self.annotStyle.opacity;
+    self.opacitySliderView.startLabel.text = [NSString stringWithFormat:@"%d%%", (int)((self.opacitySliderView.opacitySlider.value/1)*100)];
     [self.sampleView setNeedsDisplay];
 }
 

+ 3 - 1
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFNote/CPDFNoteOpenViewController.m

@@ -11,7 +11,9 @@
 //
 
 #import "CPDFNoteOpenViewController.h"
+
 #import <ComPDFKit/ComPDFKit.h>
+#import <compdfkit_tools/CPDFColorUtils.h>
 
 #pragma mark - UIPopBackgroundView
 
@@ -109,7 +111,7 @@
 - (void)viewDidLoad {
     [super viewDidLoad];
     // Do any additional setup after loading the view.
-    [self.view setBackgroundColor:[UIColor colorWithRed:255.0/255.0 green:244.0/255.0 blue:213.0/255.0 alpha:1.0]];
+    self.view.backgroundColor = [CPDFColorUtils CNoteOpenBackgooundColor];
     
     _noteTextView = [[UITextView alloc] initWithFrame:CGRectMake(0, 10, self.view.bounds.size.width, self.view.bounds.size.height-45)];
     _noteTextView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;

+ 37 - 10
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFNote/CPDFNoteViewController.m

@@ -16,10 +16,15 @@
 #import "CPDFColorPickerView.h"
 #import "CAnnotStyle.h"
 
-@interface CPDFNoteViewController () <CPDFColorSelectViewDelegate, CPDFColorPickerViewDelegate>
+#import <compdfkit_tools/CPDFColorUtils.h>
+
+
+@interface CPDFNoteViewController () <UIColorPickerViewControllerDelegate, CPDFColorSelectViewDelegate, CPDFColorPickerViewDelegate>
 
 @property (nonatomic, strong) CPDFAnnotationSampleView *sampleView;
 
+@property (nonatomic, strong) UIView *sampleBackgoundView;
+
 @property (nonatomic, strong) CPDFColorSelectView *colorView;
 
 @property (nonatomic, strong) CPDFColorPickerView *colorPicker;
@@ -51,6 +56,7 @@
     self.titleLabel = [[UILabel alloc] init];
     self.titleLabel.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleHeight;
     self.titleLabel.text = NSLocalizedString(@"Note", nil);
+    self.titleLabel.textAlignment = NSTextAlignmentCenter;
     self.titleLabel.font = [UIFont systemFontOfSize:20];
     self.titleLabel.adjustsFontSizeToFitWidth = YES;
     [self.view addSubview:self.titleLabel];
@@ -61,20 +67,26 @@
     [self.backBtn addTarget:self action:@selector(buttonItemClicked_back:) forControlEvents:UIControlEventTouchUpInside];
     [self.view addSubview:self.backBtn];
     
+    self.sampleBackgoundView = [[UIView alloc] init];
+    self.sampleBackgoundView.layer.borderColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.1].CGColor;
+    self.sampleBackgoundView.layer.borderWidth = 1.0;
+    self.sampleBackgoundView.backgroundColor = [CPDFColorUtils CAnnotationSampleBackgoundColor];
+    [self.view addSubview:self.sampleBackgoundView];
+    
     self.sampleView = [[CPDFAnnotationSampleView alloc] init];
     self.sampleView.backgroundColor = [UIColor whiteColor];
-    self.sampleView.layer.borderColor = [UIColor purpleColor].CGColor;
+    self.sampleView.layer.borderColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.1].CGColor;
     self.sampleView.layer.borderWidth = 1.0;
     self.sampleView.opcity = 1.0;
     self.sampleView.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleHeight;
-    [self.view addSubview:self.sampleView];
+    [self.sampleBackgoundView addSubview:self.sampleView];
     
     self.colorView = [[CPDFColorSelectView alloc] init];
     self.colorView.delegate = self;
     self.colorView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
     [self.view addSubview:self.colorView];
     
-    self.view.backgroundColor = [UIColor whiteColor];
+    self.view.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
     [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
 }
 
@@ -82,7 +94,8 @@
     [super viewWillLayoutSubviews];
     self.titleLabel.frame = CGRectMake((self.view.frame.size.width - 120)/2, 5, 120, ((self.view.frame.size.height)/7));
     self.backBtn.frame = CGRectMake(self.view.frame.size.width - 60, 5, 50, ((self.view.frame.size.height)/7));
-    self.sampleView.frame  = CGRectMake((self.view.frame.size.width - 300)/2, ((self.view.frame.size.height)/7), 300, ((self.view.frame.size.height)/7)*3);
+    self.sampleBackgoundView.frame = CGRectMake(0, ((self.view.frame.size.height)/7), self.view.bounds.size.width, ((self.view.frame.size.height)/7)*3);
+    self.sampleView.frame  = CGRectMake((self.view.frame.size.width - 300)/2, 15, 300, self.sampleBackgoundView.bounds.size.height - 30);
     self.colorView.frame = CGRectMake(0, ((self.view.frame.size.height)/7)*4, self.view.frame.size.width, ((self.view.frame.size.height)/7)*2);
     if (@available(iOS 11.0, *)) {
         self.colorPicker.frame = CGRectMake(self.view.safeAreaInsets.left, 0, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, self.view.frame.size.height);
@@ -122,11 +135,17 @@
 #pragma mark - CPDFColorSelectViewDelegate
 
 - (void)selectColorView:(CPDFColorSelectView *)select {
-    _colorPicker = [[CPDFColorPickerView alloc] initWithFrame:self.view.frame];
-    _colorPicker.delegate = self;
-    _colorView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-    _colorPicker.backgroundColor = [UIColor whiteColor];
-    [self.view addSubview:self.colorPicker];
+    if (@available(iOS 14.0, *)) {
+        UIColorPickerViewController *picker = [[UIColorPickerViewController alloc] init];
+        picker.delegate = self;
+        [self presentViewController:picker animated:YES completion:nil];
+    } else {
+        _colorPicker = [[CPDFColorPickerView alloc] initWithFrame:self.view.frame];
+        _colorPicker.delegate = self;
+        _colorView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
+        _colorPicker.backgroundColor = [UIColor whiteColor];
+        [self.view addSubview:self.colorPicker];
+    }
 }
 
 - (void)selectColorView:(CPDFColorSelectView *)select color:(UIColor *)color {
@@ -151,4 +170,12 @@
     }
 }
 
+#pragma mark - UIColorPickerViewControllerDelegate
+
+- (void)colorPickerViewControllerDidFinish:(UIColorPickerViewController *)viewController {
+    self.sampleView.fillColor = viewController.selectedColor;
+    self.annotStyle.color = viewController.selectedColor;
+    [self.sampleView setNeedsDisplay];
+}
+
 @end

+ 10 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFNote/Image.xcassets/CPDFNoteContentImageNameDelete.imageset/Contents.json

@@ -3,6 +3,16 @@
     {
       "filename" : "delete.pdf",
       "idiom" : "universal"
+    },
+    {
+      "appearances" : [
+        {
+          "appearance" : "luminosity",
+          "value" : "dark"
+        }
+      ],
+      "filename" : "Union.pdf",
+      "idiom" : "universal"
     }
   ],
   "info" : {

+ 111 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFNote/Image.xcassets/CPDFNoteContentImageNameDelete.imageset/Union.pdf

@@ -0,0 +1,111 @@
+%PDF-1.7
+
+1 0 obj
+  << >>
+endobj
+
+2 0 obj
+  << /Length 3 0 R >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+1.000000 0.000000 -0.000000 1.000000 0.000000 0.000000 cm
+1.000000 1.000000 1.000000 scn
+4.285714 14.089233 m
+3.535714 14.089233 l
+3.535714 13.339233 l
+3.535714 10.874948 l
+0.000000 10.874948 l
+0.000000 9.374948 l
+2.464286 9.374948 l
+2.464286 0.749948 l
+2.464286 -0.000052 l
+3.214286 -0.000052 l
+11.785714 -0.000052 l
+12.535714 -0.000052 l
+12.535714 0.749948 l
+12.535714 9.374947 l
+15.000001 9.374947 l
+15.000001 10.874947 l
+11.464285 10.874947 l
+11.464285 13.339233 l
+11.464285 14.089233 l
+10.714285 14.089233 l
+4.285714 14.089233 l
+h
+3.964286 1.499948 m
+3.964286 9.374947 l
+11.035714 9.374947 l
+11.035714 1.499948 l
+3.964286 1.499948 l
+h
+9.964285 10.874947 m
+9.964285 12.589233 l
+5.035714 12.589233 l
+5.035714 10.874947 l
+9.964285 10.874947 l
+h
+5.410714 3.160662 m
+5.410714 7.446376 l
+6.910714 7.446376 l
+6.910714 3.160662 l
+5.410714 3.160662 l
+h
+8.089285 3.160662 m
+8.089285 7.446376 l
+9.589285 7.446376 l
+9.589285 3.160662 l
+8.089285 3.160662 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  988
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 15.000000 14.089233 ]
+     /Resources 1 0 R
+     /Contents 2 0 R
+     /Parent 5 0 R
+  >>
+endobj
+
+5 0 obj
+  << /Kids [ 4 0 R ]
+     /Count 1
+     /Type /Pages
+  >>
+endobj
+
+6 0 obj
+  << /Pages 5 0 R
+     /Type /Catalog
+  >>
+endobj
+
+xref
+0 7
+0000000000 65535 f
+0000000010 00000 n
+0000000034 00000 n
+0000001078 00000 n
+0000001100 00000 n
+0000001273 00000 n
+0000001347 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+1406
+%%EOF

+ 10 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFNote/Image.xcassets/CPDFNoteContentImageNameSave.imageset/Contents.json

@@ -3,6 +3,16 @@
     {
       "filename" : "save.pdf",
       "idiom" : "universal"
+    },
+    {
+      "appearances" : [
+        {
+          "appearance" : "luminosity",
+          "value" : "dark"
+        }
+      ],
+      "filename" : "Union.pdf",
+      "idiom" : "universal"
     }
   ],
   "info" : {

+ 105 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFNote/Image.xcassets/CPDFNoteContentImageNameSave.imageset/Union.pdf

@@ -0,0 +1,105 @@
+%PDF-1.7
+
+1 0 obj
+  << >>
+endobj
+
+2 0 obj
+  << /Length 3 0 R >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+1.000000 0.000000 -0.000000 1.000000 0.000000 0.000000 cm
+1.000000 1.000000 1.000000 scn
+1.500000 1.500000 m
+2.750000 1.500000 l
+2.750000 5.000000 l
+2.750000 5.750000 l
+3.500000 5.750000 l
+10.500000 5.750000 l
+11.250000 5.750000 l
+11.250000 5.000000 l
+11.250000 1.500000 l
+12.500000 1.500000 l
+12.500000 9.338987 l
+9.042643 12.500000 l
+1.500000 12.500000 l
+1.500000 1.500000 l
+h
+9.750000 1.500000 m
+4.250000 1.500000 l
+4.250000 4.250000 l
+9.750000 4.250000 l
+9.750000 1.500000 l
+h
+9.625000 14.000000 m
+14.000000 10.000000 l
+14.000000 1.500000 l
+14.000000 0.000000 l
+12.500000 0.000000 l
+1.500000 0.000000 l
+0.000000 0.000000 l
+0.000000 1.500000 l
+0.000000 12.500000 l
+0.000000 14.000000 l
+1.500000 14.000000 l
+9.625000 14.000000 l
+h
+3.916748 8.833374 m
+4.607104 8.833374 5.166748 9.393019 5.166748 10.083374 c
+5.166748 10.773730 4.607104 11.333374 3.916748 11.333374 c
+3.226392 11.333374 2.666748 10.773730 2.666748 10.083374 c
+2.666748 9.393019 3.226392 8.833374 3.916748 8.833374 c
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  1023
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 14.000000 14.000000 ]
+     /Resources 1 0 R
+     /Contents 2 0 R
+     /Parent 5 0 R
+  >>
+endobj
+
+5 0 obj
+  << /Kids [ 4 0 R ]
+     /Count 1
+     /Type /Pages
+  >>
+endobj
+
+6 0 obj
+  << /Pages 5 0 R
+     /Type /Catalog
+  >>
+endobj
+
+xref
+0 7
+0000000000 65535 f
+0000000010 00000 n
+0000000034 00000 n
+0000001113 00000 n
+0000001136 00000 n
+0000001309 00000 n
+0000001383 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+1442
+%%EOF

+ 2 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSquiggly/CPDFSquigglyViewController.m

@@ -32,7 +32,9 @@
 - (void)commomInitFromAnnotStyle {
     self.sampleView.fillColor = self.annotStyle.color;
     self.sampleView.opcity = self.annotStyle.opacity;
+    
     self.opacitySliderView.opacitySlider.value = self.annotStyle.opacity;
+    self.opacitySliderView.startLabel.text = [NSString stringWithFormat:@"%d%%", (int)((self.opacitySliderView.opacitySlider.value/1)*100)];
     [self.sampleView setNeedsDisplay];
 }
 

+ 1 - 3
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CPDFStampViewController.h

@@ -30,9 +30,7 @@ extern PDFAnnotationStampKey PDFAnnotationStampKeyShape;       // NSIntger
 
 @optional
 
-- (void)stampViewController:(CPDFStampViewController *)stampViewController selectedInde:(NSInteger)selectedIndex stamp:(NSDictionary *)stamp;
-
-- (void)stampViewController:(CPDFStampViewController *)stampViewController;
+- (void)stampViewController:(CPDFStampViewController *)stampViewController selectedIndex:(NSInteger)selectedIndex stamp:(NSDictionary *)stamp;
 
 @end
 

+ 143 - 7
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CPDFStampViewController.m

@@ -16,11 +16,12 @@
 #import "CPDFColorUtils.h"
 #import "CStampButton.h"
 #import "CStampTextViewController.h"
-#import "AAPLCustomPresentationController.h"
 #import "CStampTextViewController.h"
 #import "CCustomizeStampTableViewCell.h"
+#import "CStampPreview.h"
 
 #import <ComPDFKit/ComPDFKit.h>
+#import <compdfkit_tools/AAPLCustomPresentationController.h>
 
 #define kStamp_Cell_Height 60
 
@@ -32,7 +33,7 @@ PDFAnnotationStampKey const PDFAnnotationStampKeyShowTime = @"PDFAnnotationStamp
 PDFAnnotationStampKey const PDFAnnotationStampKeyStyle = @"PDFAnnotationStampKeyStyle";
 PDFAnnotationStampKey const PDFAnnotationStampKeyShape = @"PDFAnnotationStampKeyShape";
 
-@interface CPDFStampViewController () <UICollectionViewDelegate, UICollectionViewDataSource, UIPopoverPresentationControllerDelegate, UINavigationControllerDelegate, UIImagePickerControllerDelegate, UITableViewDelegate, UITableViewDataSource>
+@interface CPDFStampViewController () <UICollectionViewDelegate, UICollectionViewDataSource, UIPopoverPresentationControllerDelegate, UINavigationControllerDelegate, UIImagePickerControllerDelegate, UITableViewDelegate, UITableViewDataSource, CStampTextViewControllerDelegate, CCustomizeStampTableViewCellDelegate>
 
 @property (nonatomic, strong) UICollectionView *collectView;
 
@@ -337,6 +338,7 @@ PDFAnnotationStampKey const PDFAnnotationStampKeyShape = @"PDFAnnotationStampKey
         NSMutableDictionary *tStampItem = [[NSMutableDictionary alloc] init];
         [tStampItem setObject:tPath forKey:@"path"];
         [self.stampFileManager insertStampItem:tStampItem type:PDFStampCustomType_Image];
+        [self.tableView reloadData];
     }
 }
 
@@ -379,13 +381,10 @@ PDFAnnotationStampKey const PDFAnnotationStampKeyShape = @"PDFAnnotationStampKey
     
     AAPLCustomPresentationController *presentationController NS_VALID_UNTIL_END_OF_SCOPE;
     CStampTextViewController *stampTextVC = [[CStampTextViewController alloc] init];
+    stampTextVC.delegate = self;
     presentationController = [[AAPLCustomPresentationController alloc] initWithPresentedViewController:stampTextVC presentingViewController:self];
     stampTextVC.transitioningDelegate = presentationController;
     [self presentViewController:stampTextVC animated:YES completion:nil];
-    
-    if (self.delegate && [self.delegate respondsToSelector:@selector(stampViewController:)]) {
-        [self.delegate stampViewController:self];
-    }
 }
 
 - (void)buttonItemClicked_image:(id)sender {
@@ -412,6 +411,16 @@ PDFAnnotationStampKey const PDFAnnotationStampKeyShape = @"PDFAnnotationStampKey
     return cell;
 }
 
+#pragma mark - UICollectionViewDelegate
+
+- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
+    [self dismissViewControllerAnimated:YES completion:^{
+        if (self.delegate && [self.delegate respondsToSelector:@selector(stampViewController:selectedIndex:stamp:)]) {
+            [self.delegate stampViewController:self selectedIndex:indexPath.row stamp:[NSDictionary dictionary]];
+        }
+    }];
+}
+
 #pragma mark - UITableViewDataSource
 
 - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
@@ -436,6 +445,16 @@ PDFAnnotationStampKey const PDFAnnotationStampKeyShape = @"PDFAnnotationStampKey
     }
 }
 
+- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
+    if (section == 0) {
+        return NSLocalizedString(@"Text Stamp", nil);
+    } else if (section == 1) {
+        return NSLocalizedString(@"Image Stamp", nil);
+    } else {
+        return @"";
+    }
+}
+
 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
     CCustomizeStampTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
     if (cell == nil) {
@@ -443,7 +462,22 @@ PDFAnnotationStampKey const PDFAnnotationStampKeyShape = @"PDFAnnotationStampKey
     }
     if (self.customTextArray.count>0 || self.customImageArray.count>0) {
         if (0 == indexPath.section) {
-            cell.customizeStampImageView.image = self.customTextArray[indexPath.row];
+            NSDictionary *tDic = _customTextArray[indexPath.item];
+            NSString *tText  = [tDic objectForKey:@"text"];
+            NSInteger tStyle = [[tDic objectForKey:@"style"] integerValue];
+            NSInteger tColorStyle = [[tDic objectForKey:@"colorStyle"] integerValue];
+            BOOL tHaveDate   = [[tDic objectForKey:@"haveDate"] boolValue];
+            BOOL tHaveTime   = [[tDic objectForKey:@"haveTime"] boolValue];
+            
+            CStampPreview *tPreview = [[CStampPreview alloc] initWithFrame:CGRectMake(0, 0, 320, kStamp_Cell_Height)];
+            [tPreview setTextStampText:tText];
+            [tPreview setTextStampColorStyle:tColorStyle];
+            [tPreview setTextStampStyle:tStyle];
+            [tPreview setTextStampHaveDate:tHaveDate];
+            [tPreview setTextStampHaveTime:tHaveTime];
+            tPreview.leftMargin = 0;
+            UIImage *tImg = [tPreview renderImage];
+            cell.customizeStampImageView.image = tImg;
         } else {
             NSDictionary *tDic = self.customImageArray[indexPath.item];
             UIImage *img = [self.imgDicCache objectForKey:tDic];
@@ -458,8 +492,110 @@ PDFAnnotationStampKey const PDFAnnotationStampKeyShape = @"PDFAnnotationStampKey
             cell.customizeStampImageView.image = img;
         }
     }
+    cell.deleteDelegate = self;
     
     return cell;
 }
 
+#pragma mark - UITableViewDelegate
+
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
+    if (indexPath.section == 0) {
+        NSDictionary *tDic = _customTextArray[indexPath.item];
+        NSString *tText  = [tDic objectForKey:@"text"];
+        NSInteger tStyle = [[tDic objectForKey:@"style"] integerValue];
+        NSInteger tColorStyle = [[tDic objectForKey:@"colorStyle"] integerValue];
+        BOOL tHaveDate   = [[tDic objectForKey:@"haveDate"] boolValue];
+        BOOL tHaveTime   = [[tDic objectForKey:@"haveTime"] boolValue];
+        NSInteger stampStype = 0;
+        NSInteger stampShape = 0;
+        
+        switch (tColorStyle) {
+            case TextStampColorTypeBlack:
+            {
+                stampShape = 0;
+                stampStype = 0;
+            }
+                break;
+            case TextStampColorTypeRed:
+            {
+                stampStype = 1;
+                if (TextStampTypeRight== tStyle) {
+                    stampShape = 2;
+                } else if (TextStampTypeLeft == tStyle) {
+                    stampShape = 1;
+                } else {
+                    stampShape = 0;
+                }
+            }
+                break;
+            case TextStampColorTypeGreen:
+            {
+                stampStype = 2;
+                if (TextStampTypeRight== tStyle) {
+                    stampShape = 2;
+                } else if (TextStampTypeLeft == tStyle) {
+                    stampShape = 1;
+                } else {
+                    stampShape = 0;
+                }
+            }
+                break;
+            case TextStampColorTypeBlue:
+            {
+                stampStype = 3;
+                if (TextStampTypeRight== tStyle) {
+                    stampShape = 2;
+                } else if (TextStampTypeLeft == tStyle) {
+                    stampShape = 1;
+                } else {
+                    stampShape = 0;
+                }
+            }
+                break;
+        }
+        
+        [self dismissViewControllerAnimated:YES completion:^{
+            if (self.delegate && [self.delegate respondsToSelector:@selector(stampViewController:selectedIndex:stamp:)]) {
+                [self.delegate stampViewController:self selectedIndex:indexPath.row stamp:@{PDFAnnotationStampKeyText : tText,
+                                                                                            PDFAnnotationStampKeyShowDate : @(tHaveDate),
+                                                                                            PDFAnnotationStampKeyShowTime : @(tHaveTime),
+                                                                                            PDFAnnotationStampKeyStyle : @(stampStype),
+                                                                                            PDFAnnotationStampKeyShape : @(stampShape)}];
+            }
+        }];
+    } else if (indexPath.section == 1) {
+        NSDictionary *tDict = self.customImageArray[indexPath.row];
+        NSString *tPath = [tDict objectForKey:@"path"];
+        NSString *tFileName = [[NSFileManager defaultManager] displayNameAtPath:tPath];
+        NSString *tRealPath = [NSString stringWithFormat:@"%@/%@",kPDFStampDataFolder,tFileName];
+        [self dismissViewControllerAnimated:YES completion:^{
+            if (self.delegate && [self.delegate respondsToSelector:@selector(stampViewController:selectedIndex:stamp:)]) {
+                [self.delegate stampViewController:self selectedIndex:indexPath.row stamp:@{PDFAnnotationStampKeyImagePath : tRealPath}];
+            }
+        }];
+    }
+}
+
+#pragma mark - CCustomizeStampTableViewCellDelegate
+
+- (void)customizeStampTableViewCell:(CCustomizeStampTableViewCell *)customizeStampTableViewCell {
+    NSIndexPath *select = [self.tableView indexPathForCell:customizeStampTableViewCell];
+
+    if (select.section == 0) {
+        [self.stampFileManager removeStampItem:select.row type:PDFStampCustomType_Text];
+    } else if (select.section == 1) {
+        [self.stampFileManager removeStampItem:select.row type:PDFStampCustomType_Image];
+    }
+    
+    [self.tableView reloadData];
+}
+
+#pragma mark - CStampTextViewControllerDelegate
+
+- (void)stampTextViewController:(CStampTextViewController *)stampTextViewController dictionary:(NSDictionary *)dictionary {
+    [self.stampFileManager insertStampItem:dictionary type:PDFStampCustomType_Text];
+    [self.tableView reloadData];
+}
+
 @end

+ 20 - 1
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampColorSelectView.h

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

+ 75 - 7
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampColorSelectView.m

@@ -2,19 +2,87 @@
 //  CStampColorSelectView.m
 //  compdfkit-tools
 //
-//  Created by kdanmobile_2 on 2023/5/15.
+//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
+//
+//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
+//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
+//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
+//  This notice may not be removed from this file.
 //
 
 #import "CStampColorSelectView.h"
 
+@interface CStampColorSelectView ()
+
+@property (nonatomic, strong) UIView *colorPickerView;
+@property (nonatomic, strong) NSMutableArray *colorArray;
+@property (nonatomic, strong) UIButton *button1;
+@property (nonatomic, strong) UIButton *button2;
+@property (nonatomic, strong) UIButton *button3;
+@property (nonatomic, strong) UIButton *button4;
+
+@end
+
 @implementation CStampColorSelectView
 
-/*
-// Only override drawRect: if you perform custom drawing.
-// An empty implementation adversely affects performance during animation.
-- (void)drawRect:(CGRect)rect {
-    // Drawing code
+- (instancetype)initWithFrame:(CGRect)frame {
+    if (self = [super initWithFrame:frame]) {
+        self.colorLabel = [[UILabel alloc] init];
+        self.colorLabel.text = NSLocalizedString(@"Color", nil);
+        self.colorLabel.textColor = [UIColor grayColor];
+        self.colorLabel.font = [UIFont systemFontOfSize:12.0];
+        [self addSubview:self.colorLabel];
+        
+        self.colorPickerView = [[UIView alloc] init];
+        self.colorArray = [NSMutableArray array];
+        self.button1 = [[UIButton alloc] init];
+        [self.colorPickerView addSubview:self.button1];
+        [self.colorArray addObject:self.button1];
+        self.button2 = [[UIButton alloc] init];
+        [self.colorPickerView addSubview:self.button2];
+        [self.colorArray addObject:self.button2];
+        self.button3 = [[UIButton alloc] init];
+        [self.colorPickerView addSubview:self.button3];
+        [self.colorArray addObject:self.button3];
+        self.button4 = [[UIButton alloc] init];
+        [self.colorPickerView addSubview:self.button4];
+        [self.colorArray addObject:self.button4];
+        self.colorPickerView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
+        [self addSubview:self.colorPickerView];
+    }
+    return self;
+}
+
+- (void)layoutSubviews {
+    [super layoutSubviews];
+    self.colorLabel.frame = CGRectMake(20, 0, 50, self.bounds.size.height);
+    self.colorPickerView.frame = CGRectMake(70, 0, self.bounds.size.width-70, self.bounds.size.height);
+    [self pickerBarInit];
+}
+
+- (void)pickerBarInit {
+    NSArray *colors = @[[UIColor blackColor],
+                        [UIColor colorWithRed:0.57 green:0.06 blue:0.02 alpha:1.0],
+                        [UIColor colorWithRed:0.25 green:0.42 blue:0.13 alpha:1.0],
+                        [UIColor colorWithRed:0.09 green:0.15 blue:0.39 alpha:1.0]];
+    for (int i = 0; i < colors.count; i++) {
+        UIButton *button = (UIButton *)self.colorArray[i];
+        button.frame = CGRectMake((self.colorPickerView.bounds.size.width - ((self.colorPickerView.bounds.size.height - 20)*4))/5 * (i+1) + (self.colorPickerView.bounds.size.height - 20) * i, 5, self.colorPickerView.bounds.size.height - 20, self.colorPickerView.bounds.size.height - 20);
+        [[button layer] setCornerRadius:(self.colorPickerView.bounds.size.height - 20)/2];
+        button.layer.masksToBounds = YES;
+        button.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleLeftMargin;
+        button.backgroundColor = colors[i];
+        button.tag = i;
+        [button addTarget:self action:@selector(buttonItemClicked_select:) forControlEvents:UIControlEventTouchUpInside];
+    }
+}
+
+#pragma mark - Action
+
+- (void)buttonItemClicked_select:(UIButton *)button {
+    if (self.delegate && [self.delegate respondsToSelector:@selector(stampColorSelectView:tag:)]) {
+        [self.delegate stampColorSelectView:self tag:button.tag];
+    }
 }
-*/
 
 @end

+ 10 - 20
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampFileManger.m

@@ -41,14 +41,12 @@
 
 #pragma mark - File Manager
 
-- (void)readStampDataFromFile
-{
+- (void)readStampDataFromFile {
     [self readCustomStamp_TextStamp];
     [self readCustomStamp_ImageStamp];
 }
 
-- (void)readCustomStamp_TextStamp
-{
+- (void)readCustomStamp_TextStamp {
     NSFileManager *tManager = [NSFileManager defaultManager];
     if (![tManager fileExistsAtPath:kPDFStampTextList])
     {
@@ -68,8 +66,7 @@
     }
 }
 
-- (void)readCustomStamp_ImageStamp
-{
+- (void)readCustomStamp_ImageStamp {
     NSFileManager *tManager = [NSFileManager defaultManager];
     if (![tManager fileExistsAtPath:kPDFStampImageList])
     {
@@ -89,18 +86,15 @@
     }
 }
 
-- (NSArray *)getTextStampData
-{
+- (NSArray *)getTextStampData {
     return _stampTextList;
 }
 
-- (NSArray *)getImageStampData
-{
+- (NSArray *)getImageStampData {
     return _stampImageList;
 }
 
-- (NSString *)saveStampWithImage:(UIImage *)image
-{
+- (NSString *)saveStampWithImage:(UIImage *)image {
     NSFileManager *tManager = [NSFileManager defaultManager];
     NSData *imageData = UIImagePNGRepresentation(image);
     
@@ -137,8 +131,7 @@
     return nil;
 }
 
-- (void)removeStampImage
-{
+- (void)removeStampImage {
     for (NSDictionary *tDict in _deleteList)
     {
         NSString *tPath = [tDict objectForKey:@"path"];
@@ -147,8 +140,7 @@
     }
 }
 
-- (BOOL)saveStampDataToFile:(PDFStampCustomType)stampType
-{
+- (BOOL)saveStampDataToFile:(PDFStampCustomType)stampType {
     NSFileManager *tManager = [NSFileManager defaultManager];
     
     switch (stampType)
@@ -216,8 +208,7 @@
     }
 }
 
-- (BOOL)insertStampItem:(NSDictionary *)stampItem type:(PDFStampCustomType)stampType
-{
+- (BOOL)insertStampItem:(NSDictionary *)stampItem type:(PDFStampCustomType)stampType {
     switch (stampType)
     {
         case PDFStampCustomType_Text:
@@ -257,8 +248,7 @@
     }
 }
 
-- (BOOL)removeStampItem:(NSInteger)index type:(PDFStampCustomType)stampType
-{
+- (BOOL)removeStampItem:(NSInteger)index type:(PDFStampCustomType)stampType {
     switch (stampType)
     {
         case PDFStampCustomType_Text:

+ 13 - 1
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampPreview.h

@@ -21,10 +21,22 @@ typedef NS_ENUM(NSInteger, TextStampType) {
     TextStampTypeNone
 };
 
-@interface CStampPreview : UIView
+typedef NS_ENUM(NSInteger, TextStampColorType) {
+    TextStampColorTypeBlack = 0,
+    TextStampColorTypeRed,
+    TextStampColorTypeGreen,
+    TextStampColorTypeBlue
+};
+
+
+@interface CStampPreview : UIView {
+    double color[3];
+}
 
 @property (nonatomic, assign) NSInteger textStampStyle;
 
+@property (nonatomic, assign) NSInteger textStampColorStyle;
+
 @property (nonatomic, assign) BOOL textStampHaveDate;
 
 @property (nonatomic, assign) BOOL textStampHaveTime;

+ 57 - 11
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampPreview.m

@@ -22,6 +22,7 @@ static float c01, c02, c03, c11, c12, c13;
 
 @synthesize textStampText = _textStampText;
 @synthesize textStampStyle = _textStampStyle;
+@synthesize textStampColorStyle = _textStampColorStyle;
 @synthesize textStampHaveDate = _textStampHaveDate;
 @synthesize textStampHaveTime = _textStampHaveTime;
 @synthesize leftMargin = _leftMargin;
@@ -36,6 +37,27 @@ static float c01, c02, c03, c11, c12, c13;
     return self;
 }
 
+- (void)setTextStampColorStyle:(NSInteger)TextStampColorStyle {
+    _textStampColorStyle = TextStampColorStyle;
+    if (TextStampColorTypeRed == _textStampColorStyle) {
+        color[0] = 0.57;
+        color[1] = 0.06;
+        color[2] = 0.02;
+    } else if (TextStampColorTypeGreen == _textStampColorStyle) {
+        color[0] = 0.25;
+        color[1] = 0.42;
+        color[2] = 0.13;
+    } else if (TextStampColorTypeBlue == _textStampColorStyle) {
+        color[0] = 0.09;
+        color[1] = 0.15;
+        color[2] = 0.39;
+    } else if (TextStampColorTypeBlack == _textStampColorStyle) {
+        color[0] = 0;
+        color[1] = 0;
+        color[2] = 0;
+    }
+}
+
 - (NSString *)getDateTime {
     NSTimeZone* timename = [NSTimeZone systemTimeZone];
     NSDateFormatter *outputFormatter = [[NSDateFormatter alloc] init ];
@@ -193,13 +215,37 @@ static void MyShaderProcedure(void *info, const CGFloat *in, CGFloat *out) {
         .version = 0, .evaluate = &MyShaderProcedure, .releaseInfo = NULL
     };
     
-    c01 = 0.81;
-    c02 = 0.88;
-    c03 = 0.78;
-    
-    c11 = 0.95;
-    c12 = 0.95;
-    c13 = 0.95;
+    c01 = c02 = c03 = c11 = c12 = c13 = 1.0;
+    if (color[0] > color[1] && color[0] > color[2]) {
+        
+        c01 = 1.0;
+        c02 = 0.78;
+        c03 = 0.78;
+        
+        c11 = 0.98;
+        c12 = 0.92;
+        c13 = 0.91;
+    }
+    else if (color[1] > color[0] && color[1] > color[2]) {
+        
+        c01 = 0.81;
+        c02 = 0.88;
+        c03 = 0.78;
+        
+        c11 = 0.95;
+        c12 = 0.95;
+        c13 = 0.95;
+    }
+    else if (color[2] > color[0] && color[2] > color[1])
+    {
+        c01 = 0.79;
+        c02 = 0.81;
+        c03 = 0.89;
+        
+        c11 = 0.90;
+        c12 = 0.95;
+        c13 = 1.0;
+    }
 
     size_t components = 1 + CGColorSpaceGetNumberOfComponents(CGColorSpaceCreateDeviceRGB());
     CGFunctionRef funcRef = CGFunctionCreate((void *) components,
@@ -369,7 +415,7 @@ static void MyShaderProcedure(void *info, const CGFloat *in, CGFloat *out) {
         
         UIGraphicsPushContext(context);
         
-        [self.color set];
+        [[UIColor colorWithRed:color[0] green:color[1] blue:color[2] alpha:1] set];
         [drawText drawInRect:rt withFont:font lineBreakMode:NSLineBreakByWordWrapping alignment:NSTextAlignmentLeft];
         UIGraphicsPopContext();
         
@@ -385,7 +431,7 @@ static void MyShaderProcedure(void *info, const CGFloat *in, CGFloat *out) {
         }
         
         UIGraphicsPushContext(context);
-        [self.color set];
+        [[UIColor colorWithRed:color[0] green:color[1] blue:color[2] alpha:1] set];
         if (drawText.length > 0) {
             [drawText drawInRect:tTextRT withFont:tFont lineBreakMode:NSLineBreakByWordWrapping alignment:NSTextAlignmentLeft];
             
@@ -399,7 +445,7 @@ static void MyShaderProcedure(void *info, const CGFloat *in, CGFloat *out) {
             tFontSize = kStampPreview_Date_Size;
             tFont = [UIFont fontWithName:@"Helvetica" size:tFontSize];
             
-            [[UIColor purpleColor] set];
+            [[UIColor colorWithRed:color[0] green:color[1] blue:color[2] alpha:1] set];
             [dateText drawInRect:tDateRT withFont:tFont lineBreakMode:NSLineBreakByWordWrapping alignment:NSTextAlignmentLeft];
         } else {
             float fontsize = kStampPreview_Date_Size*_scale;
@@ -412,7 +458,7 @@ static void MyShaderProcedure(void *info, const CGFloat *in, CGFloat *out) {
                 rt.origin.x += rt.size.height * 0.618033;
             }
             
-            [self.color set];
+            [[UIColor colorWithRed:color[0] green:color[1] blue:color[2] alpha:1] set];
             [dateText drawInRect:rt withFont:font lineBreakMode:NSLineBreakByWordWrapping alignment:NSTextAlignmentLeft];
         }
         

+ 12 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampTextViewController.h

@@ -14,8 +14,20 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
+@class CStampTextViewController;
+
+@protocol CStampTextViewControllerDelegate <NSObject>
+
+@optional
+
+- (void)stampTextViewController:(CStampTextViewController *)stampTextViewController dictionary:(NSDictionary *)dictionary;
+
+@end
+
 @interface CStampTextViewController : UIViewController
 
+@property (nonatomic, weak) id<CStampTextViewControllerDelegate> delegate;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 57 - 31
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampTextViewController.m

@@ -14,9 +14,10 @@
 #import "CStampPreview.h"
 #import "CStampShapView.h"
 #import "CPDFColorSelectView.h"
+#import "CStampColorSelectView.h"
 #import "CPDFColorPickerView.h"
 
-@interface CStampTextViewController () <CPDFColorSelectViewDelegate, CStampShapViewDelegate, CPDFColorPickerViewDelegate>
+@interface CStampTextViewController () <CStampColorSelectViewDelegate, CStampShapViewDelegate>
 
 @property (nonatomic, strong) CStampPreview *preView;
 
@@ -36,11 +37,11 @@
 
 @property (nonatomic, strong) UILabel *timeLabel;
 
-@property (nonatomic, strong) CPDFColorSelectView *colorView;
+@property (nonatomic, strong) CStampColorSelectView *colorView;
 
 @property (nonatomic, strong) CStampShapView *stampShapeViw;
 
-@property (nonatomic, strong) CPDFColorPickerView *colorPicker;
+@property (nonatomic, assign) NSInteger textStampColorStyle;
 
 @property (nonatomic, assign) NSInteger textStampStyle;
 
@@ -75,7 +76,7 @@
     
     self.preView = [[CStampPreview alloc] init];
     self.preView.backgroundColor = [UIColor whiteColor];
-    self.preView.color = [UIColor greenColor];
+    self.preView.color = [UIColor blackColor];
     self.preView.layer.borderColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.1].CGColor;
     self.preView.layer.borderWidth = 1.0;
     self.preView.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;
@@ -90,7 +91,7 @@
     self.stampTextField.placeholder = NSLocalizedString(@"Example Text", nil);
     [self.view addSubview:self.stampTextField];
     
-    self.colorView = [[CPDFColorSelectView alloc] init];
+    self.colorView = [[CStampColorSelectView alloc] init];
     self.colorView.delegate = self;
     self.colorView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
     [self.view addSubview:self.colorView];
@@ -136,12 +137,12 @@
     if (@available(iOS 11.0, *)) {
         self.doneBtn.frame = CGRectMake(self.view.frame.size.width - 60 - self.view.safeAreaInsets.right, 5, 50, 50);
         self.cancelBtn.frame = CGRectMake(self.view.safeAreaInsets.left + 10, 5, 50, 50);
-        self.stampShapeViw.frame = CGRectMake(self.view.safeAreaInsets.left, 240,self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 90);
-        self.colorView.frame = CGRectMake(self.view.safeAreaInsets.left, 340,self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 90);
-        self.dateLabel.frame = CGRectMake(self.view.safeAreaInsets.left+15, 430, 80, 50);
-        self.haveDateSwitch.frame = CGRectMake(self.view.frame.size.width - 75- self.view.safeAreaInsets.right, 430, 60, 50);
-        self.timeLabel.frame = CGRectMake(self.view.safeAreaInsets.left+15, 480, 100, 45);
-        self.haveTimeSwitch.frame = CGRectMake(self.view.frame.size.width - 75- self.view.safeAreaInsets.right, 480, 60, 50);
+        self.stampShapeViw.frame = CGRectMake(self.view.safeAreaInsets.left, 230,self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 90);
+        self.colorView.frame = CGRectMake(self.view.safeAreaInsets.left, 320,self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 60);
+        self.dateLabel.frame = CGRectMake(self.view.safeAreaInsets.left+15, 380, 80, 50);
+        self.haveDateSwitch.frame = CGRectMake(self.view.frame.size.width - 75- self.view.safeAreaInsets.right, 380, 60, 50);
+        self.timeLabel.frame = CGRectMake(self.view.safeAreaInsets.left+15, 430, 100, 45);
+        self.haveTimeSwitch.frame = CGRectMake(self.view.frame.size.width - 75- self.view.safeAreaInsets.right, 430, 60, 50);
     } else {
         self.colorView.frame = CGRectMake(0, 340, self.view.frame.size.width, ((self.view.frame.size.height)/9)*2);
         self.stampShapeViw.frame = CGRectMake(0, 240, self.view.frame.size.width, ((self.view.frame.size.height)/9)*2);
@@ -166,22 +167,26 @@
 #pragma mark - Action
 
 - (void)buttonItemClicked_done:(id)sender {
-    if (![self.stampTextField.text isEqualToString:@""] || [self.haveDateSwitch isOn] || [self.haveTimeSwitch isOn])
-    {
+    if (![self.stampTextField.text isEqualToString:@""] || [self.haveDateSwitch isOn] || [self.haveTimeSwitch isOn]) {
         NSMutableDictionary *tStampItem = [[NSMutableDictionary alloc] init];
         
         if (self.stampTextField.text.length > 0) {
             [tStampItem setObject:self.stampTextField.text forKey:@"text"];
+            [tStampItem setObject:[NSNumber numberWithInteger:self.textStampColorStyle] forKey:@"colorStyle"];
             [tStampItem setObject:[NSNumber numberWithInteger:self.textStampStyle] forKey:@"style"];
             [tStampItem setObject:[NSNumber numberWithBool:[self.haveDateSwitch isOn]] forKey:@"haveDate"];
             [tStampItem setObject:[NSNumber numberWithBool:[self.haveTimeSwitch isOn]] forKey:@"haveTime"];
         } else {
             [tStampItem setObject:self.preView.dateTime forKey:@"text"];
+            [tStampItem setObject:[NSNumber numberWithInteger:self.textStampColorStyle] forKey:@"colorStyle"];
             [tStampItem setObject:[NSNumber numberWithInteger:self.textStampStyle] forKey:@"style"];
             [tStampItem setObject:[NSNumber numberWithBool:NO] forKey:@"haveDate"];
             [tStampItem setObject:[NSNumber numberWithBool:NO] forKey:@"haveTime"];
         }
         
+        if (self.delegate && [self.delegate respondsToSelector:@selector(stampTextViewController:dictionary:)]) {
+            [self.delegate stampTextViewController:self dictionary:tStampItem];
+        }
     }
     [self dismissViewControllerAnimated:YES completion:nil];
 }
@@ -236,6 +241,7 @@
         {
             self.preView.textStampStyle = TextStampTypeNone;
             self.textStampStyle = TextStampTypeNone;
+            self.textStampStyle = TextStampColorTypeBlack;
             [self.preView setNeedsDisplay];
         }
             break;
@@ -244,24 +250,44 @@
 
 #pragma mark - CPDFColorSelectViewDelegate
 
-- (void)selectColorView:(CPDFColorSelectView *)select {
-    _colorPicker = [[CPDFColorPickerView alloc] initWithFrame:self.view.frame];
-    _colorPicker.delegate = self;
-    _colorView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-    _colorPicker.backgroundColor = [UIColor whiteColor];
-    [self.view addSubview:self.colorPicker];
-}
-
-- (void)selectColorView:(CPDFColorSelectView *)select color:(UIColor *)color {
-    self.preView.color = color;
-    [self.preView setNeedsDisplay];
-}
-
-#pragma mark - CPDFColorPickerViewDelegate
-
-- (void)pickerView:(CPDFColorPickerView *)colorPickerView color:(UIColor *)color {
-    self.preView.color = color;
-    [self.preView setNeedsDisplay];
+- (void)stampColorSelectView:(CStampColorSelectView *)StampColorSelectView tag:(NSInteger)tag {
+    switch (tag) {
+        case 0:
+        {
+            self.preView.textStampColorStyle = TextStampColorTypeBlack;
+            self.textStampColorStyle = TextStampColorTypeBlack;
+            self.textStampStyle = TextStampTypeNone;
+            [self.preView setNeedsDisplay];
+        }
+            break;
+        case 1:
+        {
+            self.preView.textStampColorStyle = TextStampColorTypeRed;
+            self.textStampColorStyle = TextStampColorTypeRed;
+            [self.preView setNeedsDisplay];
+        }
+            
+            break;
+        case 2:
+        {
+            self.preView.textStampColorStyle = TextStampColorTypeGreen;
+            self.textStampColorStyle = TextStampColorTypeGreen;
+            [self.preView setNeedsDisplay];
+        }
+            
+            break;
+        case 3:
+        {
+            self.preView.textStampColorStyle = TextStampColorTypeBlue;
+            self.textStampColorStyle = TextStampColorTypeBlue;
+            [self.preView setNeedsDisplay];
+        }
+            
+            break;
+            
+        default:
+            break;
+    }
 }
 
 @end

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

@@ -27,6 +27,8 @@
 - (void)commomInitFromAnnotStyle {
     self.sampleView.fillColor = self.annotStyle.color;
     self.sampleView.opcity = self.annotStyle.opacity;
+    
+    self.opacitySliderView.opacitySlider.value = self.annotStyle.opacity;
     self.opacitySliderView.opacitySlider.value = self.annotStyle.opacity;
     [self.sampleView setNeedsDisplay];
 }

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

@@ -32,7 +32,9 @@
 - (void)commomInitFromAnnotStyle {
     self.sampleView.fillColor = self.annotStyle.color;
     self.sampleView.opcity = self.annotStyle.opacity;
+    
     self.opacitySliderView.opacitySlider.value = self.annotStyle.opacity;
+    self.opacitySliderView.startLabel.text = [NSString stringWithFormat:@"%d%%", (int)((self.opacitySliderView.opacitySlider.value/1)*100)];
     [self.sampleView setNeedsDisplay];
 }
 

+ 8 - 0
compdfkit-tools/compdfkit-tools/Common/Utils/CPDFColorUtils.h

@@ -20,6 +20,14 @@ NS_ASSUME_NONNULL_BEGIN
 
 + (UIColor *)CAnnotationBarSelectBackgroundColor;
 
++ (UIColor *)CAnnotationSampleBackgoundColor;
+
++ (UIColor *)CAnnotationSampleDrawBackgoundColor;
+
++ (UIColor *)CAnnotationPropertyViewControllerBackgoundColor;
+
++ (UIColor *)CNoteOpenBackgooundColor;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 32 - 0
compdfkit-tools/compdfkit-tools/Common/Utils/CPDFColorUtils.m

@@ -30,4 +30,36 @@
     }
 }
 
++ (UIColor *)CAnnotationSampleBackgoundColor {
+    if (@available(iOS 13.0, *)) {
+        return [UIColor colorNamed:@"CAnnotationSampleBackgoundColor" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil];
+    } else {
+        return [UIColor colorWithRed:250.0/255.0 green:252.0/255.0  blue:1.0 alpha:1.0];
+    }
+}
+
++ (UIColor *)CAnnotationSampleDrawBackgoundColor {
+    if (@available(iOS 13.0, *)) {
+        return [UIColor colorNamed:@"CAnnotationSampleDrawBackgoundColor" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil];
+    } else {
+        return [UIColor colorWithRed:250.0/255.0 green:252.0/255.0  blue:1.0 alpha:1.0];
+    }
+}
+
++ (UIColor *)CAnnotationPropertyViewControllerBackgoundColor {
+    if (@available(iOS 13.0, *)) {
+        return [UIColor colorNamed:@"CAnnotationPropertyViewControllerBackgoundColor" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil];
+    } else {
+        return [UIColor colorWithRed:250.0/255.0 green:252.0/255.0  blue:1.0 alpha:1.0];
+    }
+}
+
++ (UIColor *)CNoteOpenBackgooundColor {
+    if (@available(iOS 13.0, *)) {
+        return [UIColor colorNamed:@"CNoteOpenBackgooundColor" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil];
+    } else {
+        return [UIColor colorWithRed:255.0/255.0 green:244.0/255.0  blue:213.0/255.0 alpha:1.0];
+    }
+}
+
 @end

+ 38 - 0
compdfkit-tools/compdfkit-tools/Common/Utils/UtilsColor.xcassets/CAnnotationPropertyViewControllerBackgoundColor.colorset/Contents.json

@@ -0,0 +1,38 @@
+{
+  "colors" : [
+    {
+      "color" : {
+        "color-space" : "srgb",
+        "components" : {
+          "alpha" : "1.000",
+          "blue" : "255",
+          "green" : "255",
+          "red" : "255"
+        }
+      },
+      "idiom" : "universal"
+    },
+    {
+      "appearances" : [
+        {
+          "appearance" : "luminosity",
+          "value" : "dark"
+        }
+      ],
+      "color" : {
+        "color-space" : "srgb",
+        "components" : {
+          "alpha" : "1.000",
+          "blue" : "71",
+          "green" : "67",
+          "red" : "65"
+        }
+      },
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 38 - 0
compdfkit-tools/compdfkit-tools/Common/Utils/UtilsColor.xcassets/CAnnotationSampleBackgoundColor.colorset/Contents.json

@@ -0,0 +1,38 @@
+{
+  "colors" : [
+    {
+      "color" : {
+        "color-space" : "srgb",
+        "components" : {
+          "alpha" : "1.000",
+          "blue" : "255",
+          "green" : "252",
+          "red" : "250"
+        }
+      },
+      "idiom" : "universal"
+    },
+    {
+      "appearances" : [
+        {
+          "appearance" : "luminosity",
+          "value" : "dark"
+        }
+      ],
+      "color" : {
+        "color-space" : "srgb",
+        "components" : {
+          "alpha" : "1.000",
+          "blue" : "0",
+          "green" : "0",
+          "red" : "0"
+        }
+      },
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 38 - 0
compdfkit-tools/compdfkit-tools/Common/Utils/UtilsColor.xcassets/CAnnotationSampleDrawBackgoundColor.colorset/Contents.json

@@ -0,0 +1,38 @@
+{
+  "colors" : [
+    {
+      "color" : {
+        "color-space" : "srgb",
+        "components" : {
+          "alpha" : "1.000",
+          "blue" : "255",
+          "green" : "255",
+          "red" : "255"
+        }
+      },
+      "idiom" : "universal"
+    },
+    {
+      "appearances" : [
+        {
+          "appearance" : "luminosity",
+          "value" : "dark"
+        }
+      ],
+      "color" : {
+        "color-space" : "srgb",
+        "components" : {
+          "alpha" : "1.000",
+          "blue" : "115",
+          "green" : "104",
+          "red" : "96"
+        }
+      },
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 38 - 0
compdfkit-tools/compdfkit-tools/Common/Utils/UtilsColor.xcassets/CNoteOpenBackgooundColor.colorset/Contents.json

@@ -0,0 +1,38 @@
+{
+  "colors" : [
+    {
+      "color" : {
+        "color-space" : "srgb",
+        "components" : {
+          "alpha" : "1.000",
+          "blue" : "213",
+          "green" : "243",
+          "red" : "255"
+        }
+      },
+      "idiom" : "universal"
+    },
+    {
+      "appearances" : [
+        {
+          "appearance" : "luminosity",
+          "value" : "dark"
+        }
+      ],
+      "color" : {
+        "color-space" : "srgb",
+        "components" : {
+          "alpha" : "1.000",
+          "blue" : "71",
+          "green" : "67",
+          "red" : "65"
+        }
+      },
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

Dosya farkı çok büyük olduğundan ihmal edildi
+ 126 - 3
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/CPDFAnnotationBar.m


+ 1 - 1
compdfkit-tools/compdfkit-tools/Common/Views/PDFPopMenu/CPDFPopMenuView.m

@@ -36,7 +36,7 @@
 
 - (void)setUp {
     
-    self.menuItemTitleArr = [[NSMutableArray alloc] initWithObjects:NSLocalizedString(@"Preview Settings", nil),NSLocalizedString(@"Information", nil),NSLocalizedString(@"Share", nil),NSLocalizedString(@"Open New File", nil),nil];
+    self.menuItemTitleArr = [[NSMutableArray alloc] initWithObjects:NSLocalizedString(@"Reader Settings", nil),NSLocalizedString(@"Document Info", nil),NSLocalizedString(@"Share", nil),NSLocalizedString(@"Select Document", nil),nil];
     self.menuItemIconArr = [[NSMutableArray alloc] initWithObjects:@"CNavigationImageNamePreview",@"CNavigationImageNameInformation",@"CNavigationImageNameShare",@"CNavigationImageNameNewFile",nil];
     
     self.tableView = [[UITableView alloc] init];

+ 10 - 6
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFAnnotationSampleView.m

@@ -12,6 +12,8 @@
 
 #import "CPDFAnnotationSampleView.h"
 
+#import <compdfkit_tools/CPDFColorUtils.h>
+
 #define PI 3.14159265358979323846
 
 @interface CPDFAnnotationSampleView ()
@@ -30,7 +32,6 @@
 
 - (instancetype)initWithFrame:(CGRect)frame {
     if (self = [super initWithFrame:frame]) {
-        
     }
     return self;
 }
@@ -46,7 +47,10 @@
     self.centerRect = CGRectInset(rect, 130, (self.bounds.size.height/8)*3);
     self.arrowRect = CGRectInset(rect, 100, 20);
     
-    self.textRect = CGRectInset(rect, self.bounds.size.width/3, self.bounds.size.height/3);
+    self.textRect = CGRectInset(rect, self.bounds.size.width/3+3, self.bounds.size.height/3);
+    
+    CGContextSetFillColorWithColor(context, [CPDFColorUtils CAnnotationSampleDrawBackgoundColor].CGColor);
+    CGContextFillRect(context, self.bounds);
     
     [self drawSamples:context rect:self.centerRect];
 }
@@ -113,7 +117,7 @@
         {
             NSString *sampleStr = @"Sample";
             CGContextSetFillColorWithColor(context, self.fillColor.CGColor);
-            UIFont *font = [UIFont systemFontOfSize:30];
+            UIFont *font = [UIFont systemFontOfSize:28];
             NSDictionary *dic = @{NSFontAttributeName:font, NSForegroundColorAttributeName:[UIColor blackColor]};
             CGContextFillRect(context, self.textRect);
             [sampleStr drawInRect:self.textRect withAttributes:dic];
@@ -126,7 +130,7 @@
             CGRect strikeoutRect = CGRectInset(self.textRect, 0, (self.textRect.size.height/7)*3);
             CGRect underLineRect = CGRectOffset(strikeoutRect, 0, (self.textRect.size.height/7)*3);
             CGContextFillRect(context, underLineRect);
-            UIFont *font = [UIFont systemFontOfSize:30];
+            UIFont *font = [UIFont systemFontOfSize:28];
             NSDictionary *dic = @{NSFontAttributeName:font, NSForegroundColorAttributeName:[UIColor blackColor]};
             [sampleStr drawInRect:self.textRect withAttributes:dic];
         }
@@ -137,7 +141,7 @@
             CGContextSetFillColorWithColor(context, self.fillColor.CGColor);
             CGRect strikeoutRect = CGRectInset(self.textRect, 0, (self.textRect.size.height/7)*3);
             CGContextFillRect(context, strikeoutRect);
-            UIFont *font = [UIFont systemFontOfSize:30];
+            UIFont *font = [UIFont systemFontOfSize:28];
             NSDictionary *dic = @{NSFontAttributeName:font, NSForegroundColorAttributeName:[UIColor blackColor]};
             [sampleStr drawInRect:self.textRect withAttributes:dic];
         }
@@ -170,7 +174,7 @@
             
             CGContextStrokePath(context);
             
-            UIFont *font = [UIFont systemFontOfSize:30];
+            UIFont *font = [UIFont systemFontOfSize:28];
             NSDictionary *dic = @{NSFontAttributeName:font, NSForegroundColorAttributeName:[UIColor blackColor]};
             [sampleStr drawInRect:self.textRect withAttributes:dic];
         }

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

@@ -7,6 +7,8 @@
 
 #import "CPDFColorPickerView.h"
 
+#import <compdfkit_tools/CPDFColorUtils.h>
+
 @interface CPDFColorPickerView ()
 
 @property (nonatomic, strong) UILabel *selectedLabel;
@@ -91,6 +93,8 @@
         _brightness = 1;
         
         [self reloadData];
+        
+        self.backgroundColor = [CPDFColorUtils CPDFViewControllerBackgroundColor];
     }
     return self;
 }

+ 44 - 37
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFColorSelectView.m

@@ -12,18 +12,29 @@
 
 #import "CPDFColorSelectView.h"
 
+#import <compdfkit_tools/CPDFColorUtils.h>
+
 @interface  CPDFColorSelectView ()
 
 @property (nonatomic, strong) UIView *colorPickerView;
+
 @property (nonatomic, strong) NSMutableArray *colorArray;
-@property (nonatomic, strong) UIButton *button1;
-@property (nonatomic, strong) UIButton *button2;
-@property (nonatomic, strong) UIButton *button3;
-@property (nonatomic, strong) UIButton *button4;
-@property (nonatomic, strong) UIButton *button5;
-@property (nonatomic, strong) UIButton *button6;
-@property (nonatomic, strong) UIButton *button7;
-@property (nonatomic, strong) UIButton *button8;
+
+@property (nonatomic, strong) UIView *view1;
+
+@property (nonatomic, strong) UIView *view2;
+
+@property (nonatomic, strong) UIView *view3;
+
+@property (nonatomic, strong) UIView *view4;
+
+@property (nonatomic, strong) UIView *view5;
+
+@property (nonatomic, strong) UIView *view6;
+
+@property (nonatomic, strong) UIView *view7;
+
+@property (nonatomic, strong) UIView *view8;
 
 @end
 
@@ -39,32 +50,9 @@
         self.colorLabel.font = [UIFont systemFontOfSize:12.0];
         [self addSubview:self.colorLabel];
         
+        self.colorArray = [NSMutableArray array];;
+        
         self.colorPickerView = [[UIView alloc] initWithFrame:CGRectMake(0, 30, self.bounds.size.width, 60)];
-        self.colorArray = [NSMutableArray array];
-        self.button1 = [[UIButton alloc] init];
-        [self.colorPickerView addSubview:self.button1];
-        [self.colorArray addObject:self.button1];
-        self.button2 = [[UIButton alloc] init];
-        [self.colorPickerView addSubview:self.button2];
-        [self.colorArray addObject:self.button2];
-        self.button3 = [[UIButton alloc] init];
-        [self.colorPickerView addSubview:self.button3];
-        [self.colorArray addObject:self.button3];
-        self.button4 = [[UIButton alloc] init];
-        [self.colorPickerView addSubview:self.button4];
-        [self.colorArray addObject:self.button4];
-        self.button5 = [[UIButton alloc] init];
-        [self.colorPickerView addSubview:self.button5];
-        [self.colorArray addObject:self.button5];
-        self.button6 = [[UIButton alloc] init];
-        [self.colorPickerView addSubview:self.button6];
-        [self.colorArray addObject:self.button6];
-        self.button7 = [[UIButton alloc] init];
-        [self.colorPickerView addSubview:self.button7];
-        [self.colorArray addObject:self.button7];
-        self.button8 = [[UIButton alloc] init];
-        [self.colorPickerView addSubview:self.button8];
-        [self.colorArray addObject:self.button8];
         self.colorPickerView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
         [self addSubview:self.colorPickerView];
     }
@@ -80,10 +68,22 @@
                         [UIColor colorWithRed:255.0/255.0 green:140.0/255.0 blue:103.0/255.0 alpha:1.0],
                         [UIColor colorWithRed:223.0/255.0 green:190.0/255.0 blue:94.0/255.0 alpha:1.0],
                         [UIColor clearColor]];
+    NSMutableArray *array = [NSMutableArray array];
     for (int i = 0; i < colors.count; i++) {
-        UIButton *button = (UIButton *)self.colorArray[i];
-        button.frame = CGRectMake((self.bounds.size.width - ((self.colorPickerView.bounds.size.height - 20)*8))/9 * (i+1) + (self.colorPickerView.bounds.size.height - 20) * i, 5, self.colorPickerView.bounds.size.height - 20, self.colorPickerView.bounds.size.height - 20);
-        [[button layer] setCornerRadius:(self.colorPickerView.bounds.size.height - 20)/2];
+        UIView *view = [[UIButton alloc] init];
+        view.tag = i;
+        view.frame = CGRectMake((self.bounds.size.width - 16 - ((self.colorPickerView.bounds.size.height - 26)*8))/9 * (i+1) + (self.colorPickerView.bounds.size.height - 26) * i, 5, self.colorPickerView.bounds.size.height - 26, self.colorPickerView.bounds.size.height - 26);
+        [[view layer] setCornerRadius:(self.colorPickerView.bounds.size.height - 26)/2];
+        view.layer.borderColor = [UIColor whiteColor].CGColor;
+        view.layer.borderWidth = 1.0;
+        view.backgroundColor = [CPDFColorUtils CPDFViewControllerBackgroundColor];
+        [array addObject:view];
+        [self.colorPickerView addSubview:view];
+        
+        UIButton *button = [[UIButton alloc] init];
+        [self.colorPickerView addSubview:button];
+        button.frame = CGRectInset(view.frame, 3, 3);
+        [[button layer] setCornerRadius:(self.colorPickerView.bounds.size.height - 32)/2];
         button.layer.masksToBounds = YES;
         button.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleLeftMargin;
         button.backgroundColor = colors[i];
@@ -93,18 +93,25 @@
             [button setBackgroundImage:[UIImage imageNamed:@"CPDFColorSelectViewImageColor" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
         }        
     }
+    self.colorArray = array;
 }
 
 - (void)layoutSubviews {
     [super layoutSubviews];
     self.colorLabel.frame = CGRectMake(20, 0, 50, self.bounds.size.height/3);
-    self.colorPickerView.frame = CGRectMake(0, self.bounds.size.height/3, self.bounds.size.width, (self.bounds.size.height/3)*2);
+    self.colorPickerView.frame = CGRectMake(8, self.bounds.size.height/3, self.bounds.size.width-16, (self.bounds.size.height/3)*2);
     [self pickerBarInit];
 }
 
 #pragma mark - Action
 
 - (void)buttonItemClicked_select:(UIButton *)button {
+    
+    for (int i = 0; i < self.colorArray.count; i++) {
+        ((UIView *)self.colorArray[i]).layer.borderColor = [UIColor whiteColor].CGColor;
+    }
+    
+    ((UIView *)self.colorArray[button.tag]).layer.borderColor = [UIColor blueColor].CGColor;
     switch (button.tag) {
         case 0 ... 6:
         {

+ 7 - 5
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFOpacitySliderView.m

@@ -12,6 +12,8 @@
 
 #import "CPDFOpacitySliderView.h"
 
+#import <compdfkit_tools/CPDFColorUtils.h>
+
 @implementation CPDFOpacitySliderView
 
 #pragma mark - Initializers
@@ -34,22 +36,22 @@
         [self addSubview:self.opacitySlider];
         
         self.startLabel = [[UILabel alloc] init];
-        self.startLabel.text = NSLocalizedString(@"100%", nil);
         self.startLabel.layer.borderWidth = 1.0;
         self.startLabel.textAlignment = NSTextAlignmentCenter;
         self.startLabel.layer.borderColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.1].CGColor;
         self.startLabel.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;
         [self addSubview:self.startLabel];
+        
+        self.backgroundColor = [CPDFColorUtils CPDFViewControllerBackgroundColor];
     }
     return self;
 }
 
 - (void)layoutSubviews {
     [super layoutSubviews];
-
-    self.titleLabel.frame = CGRectMake(10, 0, self.frame.size.width, self.frame.size.height/2);
-    self.opacitySlider.frame = CGRectMake(10, self.frame.size.height/2, self.frame.size.width - 110, self.frame.size.height/2);
-    self.startLabel.frame = CGRectMake(self.frame.size.width - 90, self.frame.size.height/2 + 10, 80, self.frame.size.height/2 - 15);
+    self.titleLabel.frame = CGRectMake(20, 0, self.frame.size.width, self.frame.size.height/2);
+    self.opacitySlider.frame = CGRectMake(20, self.frame.size.height/2, self.frame.size.width - 130, self.frame.size.height/2);
+    self.startLabel.frame = CGRectMake(self.frame.size.width - 100, self.frame.size.height/2 + 10, 80, self.frame.size.height/2 - 15);
 }
 
 #pragma mark - Action

+ 0 - 2
compdfkit-tools/compdfkit-tools/Common/Views/PDFView/PDFListView/CPDFListView+Annotation.h

@@ -30,8 +30,6 @@ NS_ASSUME_NONNULL_BEGIN
 
 - (void)updateScrollEnabled;
 
-- (void)addAnnotation:(CPDFAnnotation *)annotation forPage:(CPDFPage *)page;
-
 @end
 
 NS_ASSUME_NONNULL_END

+ 2 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFView/PDFListView/CPDFListView.h

@@ -110,6 +110,8 @@ extern NSNotificationName const CPDFListViewAnnotationsOperationChangeNotificati
 
 - (void)updateActiveAnnotations:(NSArray <CPDFAnnotation *> *)activeAnnotations;
 
+- (void)addAnnotation:(CPDFAnnotation *)annotation forPage:(CPDFPage *)page;
+
 @end
 
 NS_ASSUME_NONNULL_END

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

@@ -234,13 +234,13 @@ NSNotificationName const CPDFListViewAnnotationsOperationChangeNotification = @"
     __weak typeof(self) weakSelf = self;
     _pageIndicatorView.touchCallBack = ^{
         NSString *str = [NSString stringWithFormat:@" Please enter the page numberPage(1/%lu)", weakSelf.document.pageCount];
-        UIAlertController *alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"Go To page", nil) message:nil preferredStyle:UIAlertControllerStyleAlert];
+        UIAlertController *alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"Enter a page number", nil) message:nil preferredStyle:UIAlertControllerStyleAlert];
         
         [alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
             
         }]];
         
-        [alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"go", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+        [alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
             
             UITextField *pageTextField = alertController.textFields.firstObject;
             NSInteger pageIndex = [pageTextField.text integerValue] - 1;

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

@@ -63,6 +63,7 @@
 #import <compdfkit_tools/CPDFInkTopToolBar.h>
 #import <compdfkit_tools/CAnnotationManage.h>
 #import <compdfkit_tools/CPDFNoteOpenViewController.h>
+#import <compdfkit_tools/AAPLCustomPresentationController.h>
 //Edit
 #import <compdfkit_tools/CPDFEditToolBar.h>
 #import <compdfkit_tools/CPDFEditViewController.h>