소스 검색

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

chenyu 1 년 전
부모
커밋
d28fbf721d
24개의 변경된 파일741개의 추가작업 그리고 148개의 파일을 삭제
  1. 0 7
      Annotation-Ctrl-Demo/Annotation-Ctrl-Demo.xcodeproj/xcshareddata/xcschemes/Annotation-Ctrl-Demo.xcscheme
  2. 5 1
      Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/CPDFViewController.m
  3. 8 0
      compdfkit-tools/compdfkit-tools.xcodeproj/project.pbxproj
  4. 14 4
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFLink/CPDFLinkViewController.m
  5. 82 22
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFShape/CPDFShapeArrowViewController.m
  6. 64 37
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFShape/CPDFShapeCircleViewController.m
  7. 18 7
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CPDFSignatureEditViewController.m
  8. 3 3
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CPDFSignatureViewController.m
  9. 16 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/SignatureCustomPresentationController.h
  10. 362 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/SignatureCustomPresentationController.m
  11. 2 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CPDFStampViewController.h
  12. 89 19
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CPDFStampViewController.m
  13. 4 2
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampTextViewController.m
  14. 4 4
      compdfkit-tools/compdfkit-tools/Common/Model/AnnotationUserDefaults.plist
  15. 1 1
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/CPDFAnnotationBar.h
  16. 19 14
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/CPDFAnnotationBar.m
  17. 5 3
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFArrowStyleCell.m
  18. 2 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFArrowStyleView.h
  19. 10 2
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFArrowStyleView.m
  20. 2 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFColorSelectView.h
  21. 0 2
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFColorSelectView.m
  22. 2 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFDrawArrowView.h
  23. 27 18
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFDrawArrowView.m
  24. 2 2
      compdfkit-tools/compdfkit-tools/Common/Views/PDFView/PDFListView/CPDFListView+Annotation.m

+ 0 - 7
Annotation-Ctrl-Demo/Annotation-Ctrl-Demo.xcodeproj/xcshareddata/xcschemes/Annotation-Ctrl-Demo.xcscheme

@@ -57,13 +57,6 @@
             ReferencedContainer = "container:Annotation-Ctrl-Demo.xcodeproj">
          </BuildableReference>
       </BuildableProductRunnable>
-      <AdditionalOptions>
-         <AdditionalOption
-            key = "NSZombieEnabled"
-            value = "YES"
-            isEnabled = "YES">
-         </AdditionalOption>
-      </AdditionalOptions>
    </LaunchAction>
    <ProfileAction
       buildConfiguration = "Release"

+ 5 - 1
Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/CPDFViewController.m

@@ -147,7 +147,11 @@
         height += self.view.safeAreaInsets.bottom;
 
     if(CToolModelAnnotation == self.pdfListView.toolModel) {
-        self.annotationBar.frame = CGRectMake(0, self.view.frame.size.height - height, self.view.frame.size.width, height);
+        if (@available(iOS 11.0, *)) {
+            self.annotationBar.frame = CGRectMake(self.view.safeAreaInsets.left, self.view.frame.size.height - height, self.view.frame.size.width- self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, height);
+        } else {
+            self.annotationBar.frame = CGRectMake(0, self.view.frame.size.height - height, self.view.frame.size.width, height);
+        }
     } else {
         self.annotationBar.frame = CGRectMake(0, self.view.bounds.size.height, self.view.frame.size.width, height);
     }

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

@@ -44,6 +44,8 @@
 		4FECFF6A2A15FBC7008DE530 /* CPDFEditTextSampleView.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FECFF682A15FBC7008DE530 /* CPDFEditTextSampleView.h */; };
 		4FECFF6B2A15FBC7008DE530 /* CPDFEditTextSampleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4FECFF692A15FBC7008DE530 /* CPDFEditTextSampleView.m */; };
 		4FF3E1D12A064A8200C14F91 /* CPDFListView+Edit.m in Sources */ = {isa = PBXBuildFile; fileRef = 4FF3E1CF2A064A8100C14F91 /* CPDFListView+Edit.m */; };
+		C90C6B932A1A0F7300BBE685 /* SignatureCustomPresentationController.h in Headers */ = {isa = PBXBuildFile; fileRef = C90C6B912A1A0F7300BBE685 /* SignatureCustomPresentationController.h */; };
+		C90C6B942A1A0F7300BBE685 /* SignatureCustomPresentationController.m in Sources */ = {isa = PBXBuildFile; fileRef = C90C6B922A1A0F7300BBE685 /* SignatureCustomPresentationController.m */; };
 		C918CE8129F621E200D43974 /* CPDFColorPickerView.h in Headers */ = {isa = PBXBuildFile; fileRef = C918CE7F29F621E200D43974 /* CPDFColorPickerView.h */; };
 		C918CE8229F621E200D43974 /* CPDFColorPickerView.m in Sources */ = {isa = PBXBuildFile; fileRef = C918CE8029F621E200D43974 /* CPDFColorPickerView.m */; };
 		C918CE8429F62D6F00D43974 /* Image.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C918CE8329F62D6F00D43974 /* Image.xcassets */; };
@@ -286,6 +288,8 @@
 		4FECFF692A15FBC7008DE530 /* CPDFEditTextSampleView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFEditTextSampleView.m; sourceTree = "<group>"; };
 		4FF3E1CF2A064A8100C14F91 /* CPDFListView+Edit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "CPDFListView+Edit.m"; sourceTree = "<group>"; };
 		4FF3E1D02A064A8100C14F91 /* CPDFListView+Edit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CPDFListView+Edit.h"; sourceTree = "<group>"; };
+		C90C6B912A1A0F7300BBE685 /* SignatureCustomPresentationController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SignatureCustomPresentationController.h; sourceTree = "<group>"; };
+		C90C6B922A1A0F7300BBE685 /* SignatureCustomPresentationController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SignatureCustomPresentationController.m; sourceTree = "<group>"; };
 		C918CE7F29F621E200D43974 /* CPDFColorPickerView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFColorPickerView.h; sourceTree = "<group>"; };
 		C918CE8029F621E200D43974 /* CPDFColorPickerView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFColorPickerView.m; sourceTree = "<group>"; };
 		C918CE8329F62D6F00D43974 /* Image.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Image.xcassets; sourceTree = "<group>"; };
@@ -691,6 +695,8 @@
 				C91BE7E12A048F1A0038F2BC /* CSignatureManager.m */,
 				C91BE7EC2A04AED50038F2BC /* CSignatureDrawView.h */,
 				C91BE7ED2A04AED50038F2BC /* CSignatureDrawView.m */,
+				C90C6B912A1A0F7300BBE685 /* SignatureCustomPresentationController.h */,
+				C90C6B922A1A0F7300BBE685 /* SignatureCustomPresentationController.m */,
 				C91BE7DE2A03CF080038F2BC /* Image.xcassets */,
 			);
 			path = PDFSignature;
@@ -1205,6 +1211,7 @@
 				F32DA17429ED904300E19ECA /* CPDFInfoViewController.h in Headers */,
 				C918CE9629F8BA6200D43974 /* CPDFNoteViewController.h in Headers */,
 				C9AF189229F4D0F300EC4979 /* CPDFAnnotationSampleView.h in Headers */,
+				C90C6B932A1A0F7300BBE685 /* SignatureCustomPresentationController.h in Headers */,
 				C918CEE329FBA41A00D43974 /* CPDFDrawArrowView.h in Headers */,
 				4F06AB5429F6792E007797E4 /* CPDFTextProperty.h in Headers */,
 				F382636B29EFD0D9003F1DFD /* CPDFSlider.h in Headers */,
@@ -1440,6 +1447,7 @@
 				F32DA19229ED908800E19ECA /* CPDFMoreListViewController.m in Sources */,
 				C918CECA29FA140C00D43974 /* CPDFInkViewController.m in Sources */,
 				F382636929EFD0D9003F1DFD /* CPDFPageIndicatorView.m in Sources */,
+				C90C6B942A1A0F7300BBE685 /* SignatureCustomPresentationController.m in Sources */,
 				4FECFF6B2A15FBC7008DE530 /* CPDFEditTextSampleView.m in Sources */,
 				C91BE7DD2A039E900038F2BC /* CPDFSignatureEditViewController.m in Sources */,
 				C9FBA21D2A0E2FB6003FABEC /* CStampButton.m in Sources */,

+ 14 - 4
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFLink/CPDFLinkViewController.m

@@ -36,6 +36,8 @@
 
 @property (nonatomic, assign) CPDFLinkType linkType;
 
+@property (nonatomic, strong) UIView *headerView;
+
 @end
 
 @implementation CPDFLinkViewController
@@ -52,7 +54,13 @@
 - (void)viewDidLoad {
     [super viewDidLoad];
     
-    self.view.backgroundColor = [CPDFColorUtils CPDFViewControllerBackgroundColor];
+    self.view.backgroundColor = [CPDFColorUtils CAnnotationSampleBackgoundColor];
+    
+    self.headerView = [[UIView alloc] init];
+    self.headerView.layer.borderColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.1].CGColor;
+    self.headerView.layer.borderWidth = 1.0;
+    self.headerView.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
+    [self.view addSubview:self.headerView];
 
     [self initWithView];
     
@@ -147,6 +155,8 @@
 
 - (void)viewWillLayoutSubviews {
     [super viewWillLayoutSubviews];
+    self.titleLabel.frame = CGRectMake(0, 17.5, self.view.frame.size.width, 25.0);
+    self.headerView.frame = CGRectMake(0, 0, self.view.frame.size.width, 50);
     
     if (@available(iOS 11.0, *)) {
         self.backBtn.frame = CGRectMake(self.view.frame.size.width - 60 - self.view.safeAreaInsets.right, 5, 50, 50);
@@ -182,13 +192,13 @@
 #pragma mark - Private
 
 - (void)initWithView {
-    _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 17.5, self.view.frame.size.width, 25.0)];
+    _titleLabel = [[UILabel alloc] init];
     _titleLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth;
     _titleLabel.text = NSLocalizedString(@"Link to", nil);
     _titleLabel.textAlignment = NSTextAlignmentCenter;
     _titleLabel.font = [UIFont systemFontOfSize:20];
     _titleLabel.adjustsFontSizeToFitWidth = YES;
-    [self.view addSubview:_titleLabel];
+    [self.headerView addSubview:_titleLabel];
     
     _scrcollView = [[UIScrollView alloc] init];
     _scrcollView.frame = CGRectMake(0, 50, self.view.frame.size.width, self.view.frame.size.height);
@@ -205,7 +215,7 @@
     self.backBtn.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
     [self.backBtn setImage:[UIImage imageNamed:@"CPDFAnnotationBaseImageBack" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
     [self.backBtn addTarget:self action:@selector(buttonItemClicked_back:) forControlEvents:UIControlEventTouchUpInside];
-    [self.view addSubview:self.backBtn];
+    [self.headerView addSubview:self.backBtn];
     
     CGFloat offstY = 10;
     _segmentedControl = [[UISegmentedControl alloc] initWithItems:@[NSLocalizedString(@"URL", nil), NSLocalizedString(@"Page",nil),NSLocalizedString(@"Email",nil)]];

+ 82 - 22
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFShape/CPDFShapeArrowViewController.m

@@ -14,6 +14,7 @@
 #import "CPDFShareCircleViewController_Header.h"
 #import "CPDFArrowStyleView.h"
 #import "CShapeSelectView.h"
+#import "CPDFDrawArrowView.h"
 
 #import <compdfkit_tools/CPDFColorUtils.h>
 
@@ -29,7 +30,11 @@
 
 @property (nonatomic, strong) CPDFArrowStyleView *startArrowStyleView;
 
-@property (nonatomic ,strong) CPDFArrowStyleView *endArrowStyleView;
+@property (nonatomic, strong) CPDFArrowStyleView *endArrowStyleView;
+
+@property (nonatomic, strong) CPDFDrawArrowView *startDrawView;
+
+@property (nonatomic, strong) CPDFDrawArrowView *endDrawView;
 
 @property (nonatomic, strong) NSMutableArray *dashPattern;
 
@@ -53,7 +58,7 @@
     self.arrowLabel.textColor = [UIColor grayColor];
     self.arrowLabel.font = [UIFont systemFontOfSize:12.0];
     [self.scrcollView addSubview:self.arrowLabel];
-    
+
     self.arrowBtn = [[UIButton alloc] init];
     [self.arrowBtn setImage:[UIImage imageNamed:@"CPDFShapeArrowImageStart" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
     self.arrowBtn.layer.borderWidth = 1.0;
@@ -62,6 +67,10 @@
     [self.arrowBtn addTarget:self action:@selector(buttonItemClicked_start:) forControlEvents:UIControlEventTouchUpInside];
     [self.scrcollView addSubview:self.arrowBtn];
     
+    self.startDrawView = [[CPDFDrawArrowView alloc] init];
+    self.startDrawView.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
+    [self.arrowBtn addSubview:self.startDrawView];
+    
     self.trialLabel = [[UILabel alloc] init];
     self.trialLabel.text = NSLocalizedString(@"Tail Line Style", nil);
     self.trialLabel.textColor = [UIColor grayColor];
@@ -77,6 +86,12 @@
     self.trialBtn.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
     [self.scrcollView addSubview:self.trialBtn];
     
+    self.endDrawView = [[CPDFDrawArrowView alloc]init];
+    self.endDrawView.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
+    [self.trialBtn addSubview:self.endDrawView];
+    
+    self.fillColorSelectView.hidden = YES;
+    
     self.view.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
 }
 
@@ -86,25 +101,47 @@
     self.scrcollView.contentSize = CGSizeMake(self.view.frame.size.width, 500);
     
     if (@available(iOS 11.0, *)) {
-        self.opacitySliderView.frame = CGRectMake(self.view.safeAreaInsets.left, 180, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 90);
-        self.thicknessView.frame = CGRectMake(self.view.safeAreaInsets.left, 270, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 90);
+        CGFloat offsetY = 0;
         self.colorView.frame = CGRectMake(self.view.safeAreaInsets.left, 0,self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 90);
-        self.fillColorSelectView.frame = CGRectMake(self.view.safeAreaInsets.left, 90,self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 90);
-        self.dottedView.frame = CGRectMake(self.view.safeAreaInsets.left, 360, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 90);
-        self.arrowLabel.frame = CGRectMake(self.view.safeAreaInsets.left+20, 450, 100, 45);
-        self.arrowBtn.frame = CGRectMake(self.view.frame.size.width - 100 - self.view.safeAreaInsets.right, 457.5, 80, 30);
-        self.trialLabel.frame = CGRectMake(self.view.safeAreaInsets.left+20, 495, 100, 45);
-        self.trialBtn.frame = CGRectMake(self.view.frame.size.width - 100- self.view.safeAreaInsets.right, 502.5, 80, 30);
+        offsetY+= self.colorView.frame.size.height;
+        self.opacitySliderView.frame = CGRectMake(self.view.safeAreaInsets.left, offsetY, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 90);
+        offsetY+= self.opacitySliderView.frame.size.height;
+
+        self.thicknessView.frame = CGRectMake(self.view.safeAreaInsets.left, offsetY, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 90);
+        offsetY+= self.thicknessView.frame.size.height;
+
+        self.dottedView.frame = CGRectMake(self.view.safeAreaInsets.left, offsetY, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 90);
+        offsetY+= self.dottedView.frame.size.height;
+
+        self.arrowLabel.frame = CGRectMake(self.view.safeAreaInsets.left+20, offsetY, 100, 45);
+        self.arrowBtn.frame = CGRectMake(self.view.frame.size.width - 100 - self.view.safeAreaInsets.right, offsetY + 7.5, 80, 30);
+        offsetY+= self.arrowLabel.frame.size.height;
+        self.startDrawView.frame = CGRectMake(0, 0, 40, 30);
+        
+        self.trialLabel.frame = CGRectMake(self.view.safeAreaInsets.left+20, offsetY, 100, 45);
+        self.trialBtn.frame = CGRectMake(self.view.frame.size.width - 100- self.view.safeAreaInsets.right, offsetY + 7.5, 80, 30);
+        self.endDrawView.frame = CGRectMake(0, 0, 40, 30);
     } else {
-        self.opacitySliderView.frame = CGRectMake(10, 180, self.view.frame.size.width - 20, 90);
-        self.thicknessView.frame = CGRectMake(10, 270, self.view.frame.size.width - 20, 90);
-        self.dottedView.frame = CGRectMake(10, 360, self.view.frame.size.width - 20, 90);
-        self.fillColorSelectView.frame = CGRectMake(10, 210,self.view.frame.size.width - 20, 90);
-        self.colorView.frame = CGRectMake(10, 0,self.view.frame.size.width, 90);
-        self.arrowLabel.frame = CGRectMake(15, 450, 60, 45);
-        self.arrowBtn.frame = CGRectMake(self.view.frame.size.width - 75, 457.5, 60, 45);
-        self.trialLabel.frame = CGRectMake(15, 495, 60, 45);
-        self.trialBtn.frame = CGRectMake(self.view.frame.size.width - 75, 502.5, 60, 45);
+        CGFloat offsetY = 0;
+        self.colorView.frame = CGRectMake(0, 0,self.view.frame.size.width, 90);
+        offsetY+= self.colorView.frame.size.height;
+        self.opacitySliderView.frame = CGRectMake(0, offsetY, self.view.frame.size.width - 0, 90);
+        offsetY+= self.opacitySliderView.frame.size.height;
+
+        self.thicknessView.frame = CGRectMake(0, offsetY, self.view.frame.size.width, 90);
+        offsetY+= self.thicknessView.frame.size.height;
+
+        self.dottedView.frame = CGRectMake(0, offsetY, self.view.frame.size.width, 90);
+        offsetY+= self.dottedView.frame.size.height;
+
+        self.arrowLabel.frame = CGRectMake(20, offsetY, 100, 45);
+        self.arrowBtn.frame = CGRectMake(self.view.frame.size.width - 100, offsetY + 7.5, 80, 30);
+        offsetY+= self.arrowLabel.frame.size.height;
+        self.startDrawView.frame = CGRectMake(0, 0, 40, 30);
+        
+        self.trialLabel.frame = CGRectMake(20, offsetY, 100, 45);
+        self.trialBtn.frame = CGRectMake(self.view.frame.size.width - 100, offsetY + 7.5, 80, 30);
+        self.endDrawView.frame = CGRectMake(0, 0, 40, 30);
     }
 }
 
@@ -126,28 +163,41 @@
     self.sampleView.startArrowStyleIndex = (NSInteger)self.annotStyle.startLineStyle;
     self.sampleView.endArrowStyleIndex = (NSInteger)self.annotStyle.endLineStyle;
     [self.sampleView setNeedsDisplay];
+
+    self.startDrawView.selectIndex = (NSInteger)self.annotStyle.startLineStyle;
+    [self.startDrawView setNeedsDisplay];
+    self.endDrawView.selectIndex = (NSInteger)self.annotStyle.endLineStyle;
+    [self.endDrawView setNeedsDisplay];
 }
+    
 
 - (void)updatePreferredContentSizeWithTraitCollection:(UITraitCollection *)traitCollection {
-    self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact ? 350 : 750);
+    if([self.startArrowStyleView superview] || [self.endArrowStyleView superview]) {
+        self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, 120);
+    } else {
+        self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact ? 350 : 660);
+
+    }
 }
 
 #pragma mark - Action
 
 - (void)buttonItemClicked_start:(id)sender {
-    self.startArrowStyleView = [[CPDFArrowStyleView alloc] initWirhTitle:@"Arrow Style"];
+    self.startArrowStyleView = [[CPDFArrowStyleView alloc] initWirhTitle:NSLocalizedString(@"Arrow Style",nil)];
     self.startArrowStyleView.frame = self.view.frame;
     self.startArrowStyleView.delegate = self;
     self.startArrowStyleView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
     [self.view addSubview:self.startArrowStyleView];
+    [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
 }
 
 - (void)buttonItemClicked_trial:(id)sender {
-    self.endArrowStyleView = [[CPDFArrowStyleView alloc] initWirhTitle:@"Arrowtail style"];
+    self.endArrowStyleView = [[CPDFArrowStyleView alloc] initWirhTitle:NSLocalizedString(@"Arrowtail style",nil)];
     self.endArrowStyleView.frame = self.view.frame;
     self.endArrowStyleView.delegate = self;
     self.endArrowStyleView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
     [self.view addSubview:self.endArrowStyleView];
+    [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
 }
 
 #pragma mark - CPDFArrowStyleViewDelegate
@@ -160,6 +210,9 @@
             [self.lineDelegate arrowViewController:self annotStyle:self.annotStyle];
         }
         [self.sampleView setNeedsDisplay];
+        
+        self.startDrawView.selectIndex = selectIndex;
+        [self.startDrawView setNeedsDisplay];
     } else if (arrowStyleView == self.endArrowStyleView) {
         self.sampleView.endArrowStyleIndex = selectIndex;
         self.annotStyle.endLineStyle = selectIndex;
@@ -167,9 +220,16 @@
             [self.lineDelegate arrowViewController:self annotStyle:self.annotStyle];
         }
         [self.sampleView setNeedsDisplay];
+        
+        self.endDrawView.selectIndex = selectIndex;
+        [self.endDrawView setNeedsDisplay];
     }
 }
 
+- (void)arrowStyleRemoveView:(CPDFArrowStyleView *)arrowStyleView {
+    [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
+}
+
 #pragma mark - CPDFOpacitySliderViewDelegate
 
 - (void)opacitySliderView:(CPDFOpacitySliderView *)opacitySliderView opacity:(CGFloat)opacity {

+ 64 - 37
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFShape/CPDFShapeCircleViewController.m

@@ -99,7 +99,7 @@
     self.sampleView.opcity = self.annotStyle.opacity;
     self.sampleView.thickness = self.annotStyle.lineWidth;
     self.sampleView.dotted = self.dottedView.thicknessSlider.value;
-    self.sampleView.fillShapeColor = self.annotStyle.interiorColor;
+    self.sampleView.fillShapeColor = self.annotStyle.interiorColor?:[UIColor clearColor];
     [self.sampleView setNeedsDisplay];
 }
 
@@ -144,11 +144,66 @@
     self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact ? 350 : 660);
 }
 
+- (void)updateBordColor:(UIColor *)color {
+    if(color) {
+        CGFloat red, green, blue, alpha;
+        [color getRed:&red green:&green blue:&blue alpha:&alpha];
+        
+        self.sampleView.fillColor = [UIColor colorWithRed:red green:green blue:blue alpha:1.0];
+        self.sampleView.opcity = alpha;
+
+        self.annotStyle.color = self.sampleView.fillColor;
+        self.annotStyle.opacity = self.sampleView.opcity;
+        self.annotStyle.interiorOpacity = self.sampleView.opcity;
+    } else {
+        self.sampleView.fillColor = color;
+        self.sampleView.opcity = 0;
+
+        self.annotStyle.color = color;
+    }
+    [self.sampleView setNeedsDisplay];
+    
+    if (self.delegate && [self.delegate respondsToSelector:@selector(circleViewController:annotStyle:)]) {
+        [self.delegate circleViewController:self annotStyle:self.annotStyle];
+    }
+    self.opacitySliderView.opacitySlider.value = self.annotStyle.opacity;
+    self.opacitySliderView.startLabel.text = [NSString stringWithFormat:@"%d%%", (int)((self.opacitySliderView.opacitySlider.value/1)*100)];;
+}
+
+- (void)updateFillColor:(UIColor *)color {
+    if(color) {
+        CGFloat red, green, blue, alpha;
+        [color getRed:&red green:&green blue:&blue alpha:&alpha];
+        
+        self.sampleView.fillShapeColor = [UIColor colorWithRed:red green:green blue:blue alpha:1.0];
+        self.sampleView.opcity = alpha;
+
+        self.annotStyle.interiorColor = self.sampleView.fillShapeColor;
+        self.annotStyle.opacity = self.sampleView.opcity;
+        self.annotStyle.interiorOpacity = self.sampleView.opcity;
+    } else {
+        self.sampleView.fillShapeColor = color;
+        self.sampleView.opcity = 0;
+
+        self.annotStyle.color = color;
+    }
+    [self.sampleView setNeedsDisplay];
+    if (self.delegate && [self.delegate respondsToSelector:@selector(circleViewController:annotStyle:)]) {
+        [self.delegate circleViewController:self annotStyle:self.annotStyle];
+    }
+    self.opacitySliderView.opacitySlider.value = self.annotStyle.opacity;
+    self.opacitySliderView.startLabel.text = [NSString stringWithFormat:@"%d%%", (int)((self.opacitySliderView.opacitySlider.value/1)*100)];;
+
+}
+
 #pragma mark - CPDFOpacitySliderViewDelegate
 
 - (void)opacitySliderView:(CPDFOpacitySliderView *)opacitySliderView opacity:(CGFloat)opacity {
     self.sampleView.opcity = opacity;
+
     self.annotStyle.opacity = opacity;
+    self.annotStyle.interiorOpacity = opacity;
+
     if (self.delegate && [self.delegate respondsToSelector:@selector(circleViewController:annotStyle:)]) {
         [self.delegate circleViewController:self annotStyle:self.annotStyle];
     }
@@ -208,19 +263,9 @@
 
 - (void)selectColorView:(CPDFColorSelectView *)select color:(UIColor *)color {
     if (select == self.colorView) {
-        self.sampleView.fillColor = color;
-        self.annotStyle.color = color;
-        [self.sampleView setNeedsDisplay];
-        if (self.delegate && [self.delegate respondsToSelector:@selector(circleViewController:annotStyle:)]) {
-            [self.delegate circleViewController:self annotStyle:self.annotStyle];
-        }
+        [self updateBordColor:color];
     } else if (select == self.fillColorSelectView) {
-        self.sampleView.fillShapeColor = color;
-        self.annotStyle.interiorColor = color;
-        [self.sampleView setNeedsDisplay];
-        if (self.delegate && [self.delegate respondsToSelector:@selector(circleViewController:annotStyle:)]) {
-            [self.delegate circleViewController:self annotStyle:self.annotStyle];
-        }
+        [self updateFillColor:color];
     }
 }
 
@@ -228,39 +273,21 @@
 
 - (void)pickerView:(CPDFColorPickerView *)colorPickerView color:(UIColor *)color {
     if (colorPickerView == self.colorPicker) {
-        self.sampleView.fillColor = color;
-        self.annotStyle.color = color;
-        [self.sampleView setNeedsDisplay];
-        if (self.delegate && [self.delegate respondsToSelector:@selector(circleViewController:annotStyle:)]) {
-            [self.delegate circleViewController:self annotStyle:self.annotStyle];
-        }
+        [self updateBordColor:color];
     } else if (colorPickerView == self.fillColorPicker) {
-        self.sampleView.fillShapeColor = color;
-        self.annotStyle.interiorColor = color;
-        [self.sampleView setNeedsDisplay];
-        if (self.delegate && [self.delegate respondsToSelector:@selector(circleViewController:annotStyle:)]) {
-            [self.delegate circleViewController:self annotStyle:self.annotStyle];
-        }
+        [self updateFillColor:color];
     }
 }
 
 #pragma mark - UIColorPickerViewControllerDelegate
 
 - (void)colorPickerViewControllerDidFinish:(UIColorPickerViewController *)viewController API_AVAILABLE(ios(14.0)) {
+    UIColor *color = viewController.selectedColor;
+
     if (viewController == self.picker) {
-        self.sampleView.fillColor = viewController.selectedColor;
-        self.annotStyle.color = self.sampleView.fillColor;
-        if (self.delegate && [self.delegate respondsToSelector:@selector(circleViewController:annotStyle:)]) {
-            [self.delegate circleViewController:self annotStyle:self.annotStyle];
-        }
-        [self.sampleView setNeedsDisplay];
+        [self updateBordColor:color];
     } else if (viewController == self.fillPicker) {
-        self.sampleView.fillShapeColor = viewController.selectedColor;
-        self.annotStyle.interiorColor = viewController.selectedColor;
-        [self.sampleView setNeedsDisplay];
-        if (self.delegate && [self.delegate respondsToSelector:@selector(circleViewController:annotStyle:)]) {
-            [self.delegate circleViewController:self annotStyle:self.annotStyle];
-        }
+        [self updateFillColor:color];
     }
 }
 

+ 18 - 7
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CPDFSignatureEditViewController.m

@@ -173,26 +173,37 @@
 
 - (void)viewWillLayoutSubviews {
     [super viewWillLayoutSubviews];
-    self.headerView.frame = CGRectMake(0, 0, self.view.frame.size.width, 150);
+    self.headerView.frame = CGRectMake(0, 0, self.view.frame.size.width, 50);
     self.colorPicker.frame = CGRectMake(0, self.view.frame.size.height/2, self.view.frame.size.width, self.view.frame.size.height/2);
     self.segmentedControl.frame = CGRectMake((self.view.frame.size.width - 220)/2, 10, 220, 30);
     self.emptyLabel.frame = CGRectMake((self.view.frame.size.width - 200)/2, (self.view.frame.size.height - 50)/2, 200, 50);
    
     if (@available(iOS 11.0, *)) {
+        UIInterfaceOrientation currentOrientation = [UIApplication sharedApplication].statusBarOrientation;
+        if (UIInterfaceOrientationIsPortrait(currentOrientation)) {
+            self.colorSelectView.frame = CGRectMake(self.view.safeAreaInsets.left, 50, 380, 60);
+            self.colorSelectView.colorPickerView.frame = CGRectMake(0, 0, self.colorSelectView.frame.size.width, self.colorSelectView.frame.size.height);
+            self.thicknessView.frame = CGRectMake(self.view.safeAreaInsets.left, 140, self.view.frame.size.width-self.view.safeAreaInsets.left-self.view.safeAreaInsets.right, 60);
+            self.thicknessLabel.frame = CGRectMake(20, 15, 60, 30);
+            self.thicknessSlider.frame = CGRectMake(90, 0, self.thicknessView.bounds.size.width-110, 60);
+            self.signatureDrawTextView.frame = CGRectMake(self.view.safeAreaInsets.left, 210, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, self.view.frame.size.height-self.view.safeAreaInsets.top-self.view.safeAreaInsets.bottom-150);
+        } else if (UIInterfaceOrientationIsLandscape(currentOrientation)) {
+            self.colorSelectView.frame = CGRectMake(self.view.safeAreaInsets.left, 50, 380, 60);
+            self.thicknessView.frame = CGRectMake(380, 70, self.view.frame.size.width-380-self.view.safeAreaInsets.right, 60);
+            self.thicknessLabel.frame = CGRectMake(20, 15, 60, 30);
+            self.thicknessSlider.frame = CGRectMake(90, 0, self.thicknessView.bounds.size.width-110, 60);
+            self.signatureDrawTextView.frame = CGRectMake(self.view.safeAreaInsets.left, 130, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, self.view.frame.size.height-self.view.safeAreaInsets.top-self.view.safeAreaInsets.bottom-130);
+        }
         self.saveButton.frame = CGRectMake(self.view.frame.size.width - 60 - self.view.safeAreaInsets.right, 5, 50, 40);
         self.cacelButon.frame = CGRectMake( self.view.safeAreaInsets.left+20, 5, 50, 40);
-        self.colorSelectView.frame = CGRectMake(self.view.safeAreaInsets.left, 50, self.view.frame.size.width-self.view.safeAreaInsets.left-self.view.safeAreaInsets.right, 60);
-        self.thicknessView.frame = CGRectMake(self.view.safeAreaInsets.left, 140, self.view.frame.size.width-self.view.safeAreaInsets.left-self.view.safeAreaInsets.right, 60);
-        self.thicknessLabel.frame = CGRectMake(20, 15, 60, 30);
-        self.thicknessSlider.frame = CGRectMake(90, 0, self.thicknessView.bounds.size.width-110, 60);
-        self.signatureDrawTextView.frame = CGRectMake(self.view.safeAreaInsets.left, 210, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, self.view.frame.size.height-self.view.safeAreaInsets.top-self.view.safeAreaInsets.bottom-150);
-        
         self.signatureDrawImageView.frame = CGRectMake(self.view.safeAreaInsets.left, 50, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, self.view.frame.size.height-self.view.safeAreaInsets.top-self.view.safeAreaInsets.bottom-150);
         self.createButton.frame = CGRectMake(self.view.frame.size.width - 70 - self.view.safeAreaInsets.right, self.view.frame.size.height - 100 - self.view.safeAreaInsets.bottom, 50, 50);
         self.clearButton.frame = CGRectMake(self.view.frame.size.width - 70 - self.view.safeAreaInsets.right, self.view.frame.size.height - 100 - self.view.safeAreaInsets.bottom, 50, 50);
     } else {
         self.colorSelectView.frame = CGRectMake(0, 64, self.view.frame.size.width, 90);
         self.thicknessView.frame = CGRectMake(20, self.view.safeAreaInsets.top, self.view.frame.size.width-40, 90);
+        self.thicknessLabel.frame = CGRectMake(20, 15, 60, 30);
+        self.thicknessSlider.frame = CGRectMake(90, 0, self.thicknessView.bounds.size.width-110, 60);
         self.signatureDrawTextView.frame = CGRectMake(0, 190, self.view.frame.size.width, self.view.frame.size.height/2);
         self.signatureDrawImageView.frame = self.signatureDrawTextView.frame;
         self.createButton.frame = CGRectMake(self.view.frame.size.width - 70, self.view.frame.size.height - 100, 50, 50);

+ 3 - 3
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CPDFSignatureViewController.m

@@ -15,9 +15,9 @@
 #import "CPDFSignatureViewCell.h"
 #import "CSignatureManager.h"
 #import "CPDFSignatureEditViewController.h"
+#import "SignatureCustomPresentationController.h"
 
 #import <compdfkit_tools/CPDFColorUtils.h>
-#import <compdfkit_tools/AAPLCustomPresentationController.h>
 
 @interface CPDFSignatureViewController () <UITableViewDelegate, UITableViewDataSource, CPDFSignatureViewCellDelegate,CPDFSignatureEditViewControllerDelegate>
 
@@ -148,12 +148,12 @@
 }
 
 - (void)buttonItemClicked_create:(id)sender {
-    AAPLCustomPresentationController *presentationController NS_VALID_UNTIL_END_OF_SCOPE;
+    SignatureCustomPresentationController *presentationController NS_VALID_UNTIL_END_OF_SCOPE;
     CPDFSignatureEditViewController *editVC = [[CPDFSignatureEditViewController alloc] init];
     
     editVC.delegate = self;
     
-    presentationController = [[AAPLCustomPresentationController alloc] initWithPresentedViewController:editVC presentingViewController:self];
+    presentationController = [[SignatureCustomPresentationController alloc] initWithPresentedViewController:editVC presentingViewController:self];
     editVC.transitioningDelegate = presentationController;
     [self presentViewController:editVC animated:YES completion:nil];
 }

+ 16 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/SignatureCustomPresentationController.h

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

+ 362 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/SignatureCustomPresentationController.m

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

+ 2 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CPDFStampViewController.h

@@ -32,6 +32,8 @@ extern PDFAnnotationStampKey PDFAnnotationStampKeyShape;       // NSIntger
 
 - (void)stampViewController:(CPDFStampViewController *)stampViewController selectedIndex:(NSInteger)selectedIndex stamp:(NSDictionary *)stamp;
 
+- (void)stampViewControllerDismiss:(CPDFStampViewController *)stampViewController;
+
 @end
 
 @interface CPDFStampViewController : UIViewController

+ 89 - 19
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CPDFStampViewController.m

@@ -366,6 +366,10 @@ PDFAnnotationStampKey const PDFAnnotationStampKeyShape = @"PDFAnnotationStampKey
 
 - (void)buttonItemClicked_back:(id)sender {
     [self dismissViewControllerAnimated:YES completion:nil];
+    
+    if (self.delegate && [self.delegate respondsToSelector:@selector(stampViewControllerDismiss:)]) {
+        [self.delegate stampViewControllerDismiss:self];
+    }
 }
 
 - (void)buttonItemClicked_create:(id)sender {
@@ -523,43 +527,109 @@ PDFAnnotationStampKey const PDFAnnotationStampKeyShape = @"PDFAnnotationStampKey
         switch (tColorStyle) {
             case TextStampColorTypeBlack:
             {
-                stampShape = 0;
                 stampStype = 0;
+                switch (tStyle) {
+                    case TextStampTypeNone:
+                    {
+                        stampShape = 3;
+                    }
+                        break;
+                    case TextStampTypeRight:
+                    {
+                        stampShape = 2;
+                    }
+                        break;
+                    case TextStampTypeLeft:
+                    {
+                        stampShape = 1;
+                    }
+                        break;
+                    case TextStampTypeCenter:
+                    {
+                        stampShape = 0;
+                    }
+                        break;
+                }
             }
                 break;
             case TextStampColorTypeRed:
             {
                 stampStype = 1;
-                if (TextStampTypeRight== tStyle) {
-                    stampShape = 2;
-                } else if (TextStampTypeLeft == tStyle) {
-                    stampShape = 1;
-                } else {
-                    stampShape = 0;
+                switch (tStyle) {
+                    case TextStampTypeNone:
+                    {
+                        stampShape = 3;
+                    }
+                        break;
+                    case TextStampTypeRight:
+                    {
+                        stampShape = 2;
+                    }
+                        break;
+                    case TextStampTypeLeft:
+                    {
+                        stampShape = 1;
+                    }
+                        break;
+                    case TextStampTypeCenter:
+                    {
+                        stampShape = 0;
+                    }
+                        break;
                 }
             }
                 break;
             case TextStampColorTypeGreen:
             {
                 stampStype = 2;
-                if (TextStampTypeRight== tStyle) {
-                    stampShape = 2;
-                } else if (TextStampTypeLeft == tStyle) {
-                    stampShape = 1;
-                } else {
-                    stampShape = 0;
+                switch (tStyle) {
+                    case TextStampTypeNone:
+                    {
+                        stampShape = 3;
+                    }
+                        break;
+                    case TextStampTypeRight:
+                    {
+                        stampShape = 2;
+                    }
+                        break;
+                    case TextStampTypeLeft:
+                    {
+                        stampShape = 1;
+                    }
+                        break;
+                    case TextStampTypeCenter:
+                    {
+                        stampShape = 0;
+                    }
+                        break;
                 }
             }
                 break;
             case TextStampColorTypeBlue:
             {
                 stampStype = 3;
-                if (TextStampTypeRight== tStyle) {
-                    stampShape = 2;
-                } else if (TextStampTypeLeft == tStyle) {
-                    stampShape = 1;
-                } else {
-                    stampShape = 0;
+                switch (tStyle) {
+                    case TextStampTypeNone:
+                    {
+                        stampShape = 3;
+                    }
+                        break;
+                    case TextStampTypeRight:
+                    {
+                        stampShape = 2;
+                    }
+                        break;
+                    case TextStampTypeLeft:
+                    {
+                        stampShape = 1;
+                    }
+                        break;
+                    case TextStampTypeCenter:
+                    {
+                        stampShape = 0;
+                    }
+                        break;
                 }
             }
                 break;

+ 4 - 2
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampTextViewController.m

@@ -94,6 +94,10 @@
     
     self.stampTextField = [[UITextField alloc] init];
     self.stampTextField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
+    self.stampTextField.leftView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 8, 0)];
+    self.stampTextField.leftViewMode = UITextFieldViewModeAlways;
+    self.stampTextField.rightView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 8, 0)];
+    self.stampTextField.rightViewMode = UITextFieldViewModeAlways;
     self.stampTextField.returnKeyType = UIReturnKeyDone;
     self.stampTextField.clearButtonMode = YES;
     self.stampTextField.layer.borderColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.1].CGColor;
@@ -282,7 +286,6 @@
         {
             self.preView.textStampStyle = TextStampTypeNone;
             self.textStampStyle = TextStampTypeNone;
-            self.textStampStyle = TextStampColorTypeBlack;
             [self.preView setNeedsDisplay];
         }
             break;
@@ -297,7 +300,6 @@
         {
             self.preView.textStampColorStyle = TextStampColorTypeBlack;
             self.textStampColorStyle = TextStampColorTypeBlack;
-            self.textStampStyle = TextStampTypeNone;
             [self.preView setNeedsDisplay];
         }
             break;

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 4 - 4
compdfkit-tools/compdfkit-tools/Common/Model/AnnotationUserDefaults.plist


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

@@ -70,7 +70,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 - (void)buttonItemClicked_open:(UIButton *)button;
 
-- (void)openSignatureAnnotation:(CPDFSignatureAnnotation *)signatureAnnotation;
+- (void)openSignatureAnnotation:(CPDFSignatureWidgetAnnotation *)signatureAnnotation;
 
 - (void)addStampAnnotationWithPage:(CPDFPage *)page point:(CGPoint)point;
 

+ 19 - 14
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/CPDFAnnotationBar.m

@@ -101,6 +101,12 @@
 - (void)layoutSubviews {
     [super layoutSubviews];
     self.scrollView.frame = CGRectMake(0, 0, self.frame.size.width-self.propertiesBar.frame.size.width, self.frame.size.height);
+    
+    if (@available(iOS 11.0, *)) {
+        self.topToolBar.frame = CGRectMake(self.pdfListView.frame.size.width-30-self.topToolBar.frame.size.width, self.window.safeAreaInsets.top, self.topToolBar.frame.size.width, 50);
+    } else {
+        self.topToolBar.frame = CGRectMake(self.pdfListView.frame.size.width-30-self.topToolBar.frame.size.width, 64, self.topToolBar.frame.size.width, 50);
+    }
 }
 
 #pragma mark - Public Methods
@@ -131,7 +137,7 @@
     }
 }
 
-- (void)openSignatureAnnotation:(CPDFSignatureAnnotation *)signatureAnnotation {
+- (void)openSignatureAnnotation:(CPDFSignatureWidgetAnnotation *)signatureAnnotation {
     self.signatureAnnotation = signatureAnnotation;
     CAnnotStyle *annotStytle = self.annotManage.annotStyle;
     AAPLCustomPresentationController *presentationController NS_VALID_UNTIL_END_OF_SCOPE;
@@ -243,24 +249,21 @@
         if(i != types.count -1)
             offsetX += button.bounds.size.width + buttonOffset;
         else
-          offsetX += button.bounds.size.width;
+          offsetX += button.bounds.size.width + 10;
 
     }
     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);
-    }
+    _scrollView.contentSize = CGSizeMake(offsetX, _scrollView.bounds.size.height);
     [self.scrollView bringSubviewToFront:self.propertiesBar];
     
-    _propertiesBar = [[UIView alloc] initWithFrame:CGRectMake(self.bounds.size.width - 150, 0, 140, 44)];
+    CGFloat offset = 10;
+
+    CGFloat prWidth = buttonSize * 3 + offset;
+    _propertiesBar = [[UIView alloc] initWithFrame:CGRectMake(self.bounds.size.width - prWidth, 0, prWidth, 44)];
     _propertiesBar.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
     [self addSubview:self.propertiesBar];
     
-    CGFloat offset = 10;
-
     UIView *lineView = [[UIView alloc]initWithFrame:CGRectMake(offset, 12, 1, 20)];
     if (@available(iOS 13.0, *))
         lineView.backgroundColor = [UIColor labelColor];
@@ -481,15 +484,13 @@
 
         self.propertiesBtn.enabled = NO;
         if (@available(iOS 11.0, *)) {
-            self.topToolBar = [[CPDFInkTopToolBar alloc] initWithFrame:CGRectMake(50, self.window.safeAreaInsets.top, self.pdfListView.frame.size.width-100, 50)];
+            self.topToolBar = [[CPDFInkTopToolBar alloc] initWithFrame:CGRectMake(self.pdfListView.frame.size.width-30- 300, self.window.safeAreaInsets.top, 300, 50)];
             self.topToolBar.delegate = self;
             
-            self.topToolBar.autoresizingMask = UIViewAutoresizingFlexibleWidth;
             [self.pdfListView addSubview:self.topToolBar];
         } else {
-            self.topToolBar = [[CPDFInkTopToolBar alloc] initWithFrame:CGRectMake(50, 64, self.pdfListView.frame.size.width-100, 50)];
+            self.topToolBar = [[CPDFInkTopToolBar alloc] initWithFrame:CGRectMake(self.pdfListView.frame.size.width-30-300, 64, 300, 50)];
             self.topToolBar.delegate = self;
-            self.topToolBar.autoresizingMask = UIViewAutoresizingFlexibleWidth;
             [self.pdfListView addSubview:self.topToolBar];
         }
     } else if (CPDFViewAnnotationModeSignature == self.selectedIndex) {
@@ -990,4 +991,8 @@
     
 }
 
+- (void)stampViewControllerDismiss:(CPDFStampViewController *)stampViewController {
+    self.pdfListView.annotationMode = CPDFViewAnnotationModeNone;
+}
+
 @end

+ 5 - 3
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFArrowStyleCell.m

@@ -12,6 +12,7 @@
 
 #import "CPDFArrowStyleCell.h"
 #import "CPDFDrawArrowView.h"
+#import "CPDFColorUtils.h"
 
 @implementation CPDFArrowStyleCell
 
@@ -19,9 +20,10 @@
 
 - (instancetype)initWithFrame:(CGRect)frame {
     if (self = [super initWithFrame:frame]) {
-        self.contextView = [[CPDFDrawArrowView alloc] initWithFrame:self.contentView.bounds];
-        self.contextView.backgroundColor = [UIColor whiteColor];
-        [self.contentView addSubview:self.contextView];
+        self.contextView = [[CPDFDrawArrowView alloc] initWithFrame:CGRectMake(1, 1, self.bounds.size.width - 2, self.bounds.size.height - 2)];
+        self.contextView.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
+        self.contentView.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
+        [self addSubview:self.contextView];
     }
     return self;
 }

+ 2 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFArrowStyleView.h

@@ -22,6 +22,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 - (void)arrowStyleView:(CPDFArrowStyleView *)arrowStyleView selectIndex:(NSInteger)selectIndex;
 
+- (void)arrowStyleRemoveView:(CPDFArrowStyleView *)arrowStyleView;
+
 @end
 
 @interface CPDFArrowStyleView : UIView

+ 10 - 2
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFArrowStyleView.m

@@ -46,11 +46,11 @@
         [self.headerView addSubview:self.backBtn];
         
         self.titleLabel = [[UILabel alloc] init];
-        self.titleLabel.text = NSLocalizedString(title, nil);
+        self.titleLabel.text = title;
         [self.headerView addSubview:self.titleLabel];
         
         UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
-        layout.itemSize = CGSizeMake(110, 50);
+        layout.itemSize = CGSizeMake((self.frame.size.width - 5.0* 7)/6, 30);
         layout.sectionInset = UIEdgeInsetsMake(5, 5, 5, 5);
         layout.minimumInteritemSpacing = 5;
         layout.minimumLineSpacing = 5;
@@ -78,10 +78,17 @@
 
 - (void)buttonItemClicked_back:(id)sender {
     [self removeFromSuperview];
+    if (self.delegate && [self.delegate respondsToSelector:@selector(arrowStyleRemoveView:)]) {
+        [self.delegate arrowStyleRemoveView:self];
+    }
 }
 
 #pragma mark - UICollectionViewDataSource
 
+- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
+    return CGSizeMake((self.frame.size.width - 5.0* 7)/6, 30);
+}
+
 - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
     return 6;
 }
@@ -90,6 +97,7 @@
     CPDFArrowStyleCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath];
     cell.contextView.selectIndex = indexPath.item;
     [cell.contentView setNeedsDisplay];
+    cell.backgroundColor = [UIColor clearColor];
     return cell;
 }
 

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

@@ -34,6 +34,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 @property (nonatomic, strong) UILabel *colorLabel;
 
+@property (nonatomic, strong) UIScrollView *colorPickerView;
+
 
 @end
 

+ 0 - 2
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFColorSelectView.m

@@ -16,8 +16,6 @@
 
 @interface  CPDFColorSelectView ()
 
-@property (nonatomic, strong) UIScrollView *colorPickerView;
-
 @property (nonatomic, strong) NSMutableArray *colorArray;
 
 @property (nonatomic, strong) NSMutableArray *buttonArray;

+ 2 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFDrawArrowView.h

@@ -27,6 +27,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 @property (nonatomic, assign) NSInteger selectIndex;
 
+- (UIImage *)shotShareImage;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 27 - 18
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFDrawArrowView.m

@@ -21,8 +21,8 @@
 - (void)drawRect:(CGRect)rect {
     [super drawRect:rect];
     CGContextRef context = UIGraphicsGetCurrentContext();
-    CGPoint start = CGPointMake(CGRectGetMinX(rect)+20, CGRectGetMidY(rect));
-    CGPoint end = CGPointMake(CGRectGetMaxX(rect)-20, CGRectGetMidY(rect));
+    CGPoint start = CGPointMake(CGRectGetMinX(rect)+10, CGRectGetMidY(rect));
+    CGPoint end = CGPointMake(CGRectGetMaxX(rect)-10, CGRectGetMidY(rect));
     [self drawArrow:context startPoint:start endPoint:end];
 }
 
@@ -52,13 +52,13 @@
             break;
         case CPDFDrawTriangle:
         {
-            CGContextMoveToPoint(context, start.x, start.y);
-            CGContextAddLineToPoint(context, end.x, end.y);
+            CGContextMoveToPoint(context, start.x-5, start.y);
+            CGContextAddLineToPoint(context, end.x-5, end.y);
             CGContextStrokePath(context);
             
-            CGContextMoveToPoint(context, end.x, end.y-5);
-            CGContextAddLineToPoint(context, end.x+5, end.y);
-            CGContextAddLineToPoint(context, end.x, end.y+5);
+            CGContextMoveToPoint(context, end.x-5, end.y-5);
+            CGContextAddLineToPoint(context, end.x, end.y);
+            CGContextAddLineToPoint(context, end.x-5, end.y+5);
             CGContextClosePath(context);
             CGContextStrokePath(context);
         }
@@ -66,13 +66,13 @@
         case CPDFDrawSquare:
         {
             CGContextMoveToPoint(context, start.x, start.y);
-            CGContextAddLineToPoint(context, end.x, end.y);
+            CGContextAddLineToPoint(context, end.x-10, end.y);
             CGContextStrokePath(context);
             
-            CGContextMoveToPoint(context, end.x, end.y-5);
+            CGContextMoveToPoint(context, end.x-10, end.y-5);
+            CGContextAddLineToPoint(context, end.x-10, end.y+5);
             CGContextAddLineToPoint(context, end.x, end.y+5);
-            CGContextAddLineToPoint(context, end.x+10, end.y+5);
-            CGContextAddLineToPoint(context, end.x+10, end.y-5);
+            CGContextAddLineToPoint(context, end.x, end.y-5);
             CGContextClosePath(context);
             CGContextStrokePath(context);
         }
@@ -80,23 +80,23 @@
         case CPDFDrawCircle:
         {
             CGContextMoveToPoint(context, start.x, start.y);
-            CGContextAddLineToPoint(context, end.x, end.y);
+            CGContextAddLineToPoint(context, end.x-10, end.y);
             CGContextStrokePath(context);
             
-            CGContextAddArc(context, end.x+2.7, end.y, 5, 0, 2*3.14159265358979323846, 0);
+            CGContextAddArc(context, end.x-7, end.y, 5, 0, 2*M_PI, 0);
             CGContextDrawPath(context, kCGPathStroke);
         }
             break;
         case CPDFDrawDiamond:
         {
             CGContextMoveToPoint(context, start.x, start.y);
-            CGContextAddLineToPoint(context, end.x, end.y);
+            CGContextAddLineToPoint(context, end.x-10, end.y);
             CGContextStrokePath(context);
             
-            CGContextMoveToPoint(context, end.x, end.y);
-            CGContextAddLineToPoint(context, end.x+5, end.y+5);
-            CGContextAddLineToPoint(context, end.x+10, end.y);
-            CGContextAddLineToPoint(context, end.x+5, end.y-5);
+            CGContextMoveToPoint(context, end.x-10, end.y);
+            CGContextAddLineToPoint(context, end.x-5, end.y+5);
+            CGContextAddLineToPoint(context, end.x, end.y);
+            CGContextAddLineToPoint(context, end.x-5, end.y-5);
             CGContextClosePath(context);
             CGContextStrokePath(context);
         }
@@ -106,4 +106,13 @@
     }
 }
 
+- (UIImage *)shotShareImage {
+    UIGraphicsBeginImageContext(CGSizeMake(self.layer.bounds.size.width, self.layer.bounds.size.height));
+    CGContextRef context = UIGraphicsGetCurrentContext();
+    [self.layer renderInContext:context];
+    UIImage* tImage = UIGraphicsGetImageFromCurrentImageContext();
+    UIGraphicsEndImageContext();
+    return tImage;
+}
+
 @end

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

@@ -1084,7 +1084,7 @@
             circleAnnotation.color = annotStyle.color;
             circleAnnotation.opacity = annotStyle.opacity;
             circleAnnotation.border = [[CPDFBorder alloc]initWithStyle:annotStyle.style lineWidth:annotStyle.lineWidth dashPattern:annotStyle.dashPattern];
-            circleAnnotation.interiorOpacity = annotStyle.opacity;
+            circleAnnotation.interiorOpacity = annotStyle.interiorOpacity;
             circleAnnotation.interiorColor = annotStyle.interiorColor;
         }
             break;
@@ -1095,7 +1095,7 @@
             squareAnnotation.color = annotStyle.color;
             squareAnnotation.opacity = annotStyle.opacity;
             squareAnnotation.border = [[CPDFBorder alloc]initWithStyle:annotStyle.style lineWidth:annotStyle.lineWidth dashPattern:annotStyle.dashPattern];
-            squareAnnotation.interiorOpacity = annotStyle.opacity;
+            squareAnnotation.interiorOpacity = annotStyle.interiorOpacity;
             squareAnnotation.interiorColor = annotStyle.interiorColor;
         }
             break;