Bladeren bron

PDFTools(iOS)-高保真修改(stamp)

yangliuhua 1 jaar geleden
bovenliggende
commit
c0066fc059
47 gewijzigde bestanden met toevoegingen van 1953 en 167 verwijderingen
  1. 5 12
      Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/Assets.xcassets/CPDFThunbnailImageEnter.imageset/Contents.json
  2. BIN
      Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/Assets.xcassets/CPDFThunbnailImageEnter.imageset/btn_bota4.png
  3. BIN
      Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/Assets.xcassets/CPDFThunbnailImageEnter.imageset/btn_bota4@2x.png
  4. 105 0
      Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/Assets.xcassets/CPDFThunbnailImageEnter.imageset/thumbnail.pdf
  5. 186 5
      Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/CPDFViewController.m
  6. 0 1
      Edit-Ctrl-Demo/Edit-Ctrl-Demo/CPDFViewController.m
  7. 0 8
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFBase/CPDFAnnotationBaseViewController.m
  8. 33 7
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/CPDFFreeTextViewController.m
  9. 10 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/Image.xcassets/CPDFFreeTextImageBold.imageset/Contents.json
  10. 105 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/Image.xcassets/CPDFFreeTextImageBold.imageset/Property 1=nor.pdf
  11. 22 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/Image.xcassets/CPDFFreeTextImageBoldHighLinght.imageset/Contents.json
  12. 105 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/Image.xcassets/CPDFFreeTextImageBoldHighLinght.imageset/Property 1=sel 1.pdf
  13. 105 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/Image.xcassets/CPDFFreeTextImageBoldHighLinght.imageset/Property 1=sel.pdf
  14. 22 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/Image.xcassets/CPDFFreeTextImageItailcHighLight.imageset/Contents.json
  15. 79 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/Image.xcassets/CPDFFreeTextImageItailcHighLight.imageset/Property 1=sel (1).pdf
  16. 79 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/Image.xcassets/CPDFFreeTextImageItailcHighLight.imageset/Property 1=sel.pdf
  17. 10 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/Image.xcassets/CPDFFreeTextImageUnderline.imageset/Contents.json
  18. 79 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/Image.xcassets/CPDFFreeTextImageUnderline.imageset/Property 1=nol.pdf
  19. 130 12
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CPDFSignatureEditViewController.m
  20. 1 16
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CSignatureDrawView.m
  21. 1 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CPDFStampViewController.m
  22. 27 21
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampColorSelectView.m
  23. 17 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampShapView.m
  24. 66 25
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampTextViewController.m
  25. 9 8
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImageImage.imageset/Contents.json
  26. 87 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImageImage.imageset/image.pdf
  27. 9 8
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImageText.imageset/Contents.json
  28. 83 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImageText.imageset/ic_subtoolbar_mytools_text.pdf
  29. 10 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampTextImageCenter.imageset/Contents.json
  30. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampTextImageCenter.imageset/ic_subtoolbar_mytools_rec.png
  31. 10 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampTextImageLeft.imageset/Contents.json
  32. 154 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampTextImageLeft.imageset/Property 2=right.pdf
  33. 10 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampTextImageNone.imageset/Contents.json
  34. 71 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampTextImageNone.imageset/ic_subtoolbar_mytools_line.pdf
  35. 11 1
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampTextImageRight.imageset/Contents.json
  36. 154 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampTextImageRight.imageset/Property 2=left 1.pdf
  37. 19 35
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampTextImageRight.imageset/With Label (2).pdf
  38. 1 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/CPDFAnnotationBar.h
  39. 22 3
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/CPDFAnnotationBar.m
  40. 1 1
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageNote.imageset/Contents.json
  41. 0 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageNote.imageset/ic_subtoolbar_mytools_note.pdf
  42. 12 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImagePencilDraw.imageset/Contents.json
  43. 99 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImagePencilDraw.imageset/pencil.pdf
  44. 2 2
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFColorSelectView.m
  45. 1 1
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFFontStyleTableView.m
  46. 1 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFView/PDFListView/CPDFListView.h
  47. 0 1
      viewer-ctrl-demo/viewer-ctrl-demo/CPDFViewController.m

+ 5 - 12
Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/Assets.xcassets/CPDFThunbnailImageEnter.imageset/Contents.json

@@ -1,22 +1,15 @@
 {
   "images" : [
     {
-      "filename" : "btn_bota4.png",
-      "idiom" : "universal",
-      "scale" : "1x"
-    },
-    {
-      "filename" : "btn_bota4@2x.png",
-      "idiom" : "universal",
-      "scale" : "2x"
-    },
-    {
-      "idiom" : "universal",
-      "scale" : "3x"
+      "filename" : "thumbnail.pdf",
+      "idiom" : "universal"
     }
   ],
   "info" : {
     "author" : "xcode",
     "version" : 1
+  },
+  "properties" : {
+    "template-rendering-intent" : "original"
   }
 }

BIN
Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/Assets.xcassets/CPDFThunbnailImageEnter.imageset/btn_bota4.png


BIN
Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/Assets.xcassets/CPDFThunbnailImageEnter.imageset/btn_bota4@2x.png


+ 105 - 0
Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/Assets.xcassets/CPDFThunbnailImageEnter.imageset/thumbnail.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 1.250000 1.000000 cm
+0.262745 0.278431 0.301961 scn
+0.750000 17.750000 m
+0.000000 17.750000 l
+0.000000 17.000000 l
+0.000000 3.000000 l
+0.000000 2.250000 l
+0.750000 2.250000 l
+3.750000 2.250000 l
+3.750000 1.500000 l
+3.750000 0.000000 l
+5.250000 0.000000 l
+16.250000 0.000000 l
+17.750000 0.000000 l
+17.750000 1.500000 l
+17.750000 12.500000 l
+17.750000 14.000000 l
+16.250000 14.000000 l
+15.500000 14.000000 l
+15.500000 17.000000 l
+15.500000 17.750000 l
+14.750000 17.750000 l
+0.750000 17.750000 l
+h
+14.000000 14.000000 m
+14.000000 16.250000 l
+1.500000 16.250000 l
+1.500000 3.750000 l
+3.750000 3.750000 l
+3.750000 12.500000 l
+3.750000 14.000000 l
+5.250000 14.000000 l
+14.000000 14.000000 l
+h
+5.250000 2.250000 m
+5.250000 1.500000 l
+16.250000 1.500000 l
+16.250000 12.500000 l
+5.250000 12.500000 l
+5.250000 3.750000 l
+5.250000 2.250000 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  907
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 20.000000 20.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
+0000000997 00000 n
+0000001019 00000 n
+0000001192 00000 n
+0000001266 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+1325
+%%EOF

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

@@ -17,7 +17,8 @@
 #import <ComPDFKit/ComPDFKit.h>
 #import <compdfkit_tools/compdfkit_tools.h>
 
-@interface CPDFViewController () <UISearchBarDelegate,CPDFViewDelegate,CPDFListViewDelegate, CPDFMoreListViewDelegate,CSearchToolbarDelegate, CPDFDisplayViewDelegate,CPDFBOTAViewControllerDelegate,CPDFSearchResultsDelegate,CPDFThumbnailViewControllerDelegate,CPDFAnnotationBarDelegate,CPDFNoteOpenViewControllerDelegate,CPDFSoundPlayBarDelegate>
+@interface CPDFViewController () <UISearchBarDelegate,UIDocumentPickerDelegate,CPDFViewDelegate,CPDFListViewDelegate, CPDFMoreListViewDelegate,CSearchToolbarDelegate, CPDFDisplayViewDelegate,CPDFBOTAViewControllerDelegate,CPDFSearchResultsDelegate,CPDFThumbnailViewControllerDelegate,CPDFAnnotationBarDelegate,CPDFNoteOpenViewControllerDelegate,CPDFPopMenuViewDelegate,CPDFPopMenuDelegate, CPDFSoundPlayBarDelegate>
+
 
 @property(nonatomic, strong) NSString *filePath;
 
@@ -37,6 +38,10 @@
 
 @property(nonatomic, strong) CAnnotationManage *annotationManage;
 
+@property(nonatomic, strong)  CPDFPopMenu *popMenu;
+
+@property(nonatomic, assign)  BOOL popMenuClosed;
+
 @end
 
 @implementation CPDFViewController
@@ -107,6 +112,15 @@
 - (void)viewWillLayoutSubviews {
     [super viewWillLayoutSubviews];
     
+    if(!self.popMenuClosed) {
+        if (@available(iOS 11.0, *)) {
+            [self.popMenu showMenuInRect:CGRectMake(self.view.frame.size.width - self.view.safeAreaInsets.right - 250, CGRectGetMaxY(self.navigationController.navigationBar.frame), 250, 200)];
+        } else {
+            // Fallback on earlier versions
+            [self.popMenu showMenuInRect:CGRectMake(self.view.frame.size.width - 250, CGRectGetMaxY(self.navigationController.navigationBar.frame), 250, 200)];
+        }
+    }
+    
     CGFloat tPosY = 0;
     CGFloat bottomY = 0;
     CGFloat height = 44.0;
@@ -182,6 +196,7 @@
     [self.searchToolbar showInView:self.navigationController.navigationBar];
     self.title = nil;
     self.navigationItem.rightBarButtonItem = nil;
+    self.navigationItem.leftBarButtonItem = nil;
 }
 
 - (void)navigationRightItemBota{
@@ -198,9 +213,18 @@
 }
 
 - (void)navigationRightItemMore {
-    CPDFMoreListViewController * moreListVc = [[CPDFMoreListViewController alloc] init];
-    moreListVc.delegate = self;
-    [self.navigationController pushViewController:moreListVc animated:YES];
+    CPDFPopMenuView * menuView = [[CPDFPopMenuView alloc] initWithFrame:CGRectMake(0, 0, 200, 200)];
+    menuView.delegate = self;
+    self.popMenu = [CPDFPopMenu popMenuWithContentView:menuView];
+    self.popMenu.dimCoverLayer = YES;
+    self.popMenu.delegate = self;
+    
+    if (@available(iOS 11.0, *)) {
+        [self.popMenu showMenuInRect:CGRectMake(self.view.frame.size.width - self.view.safeAreaInsets.right - 250, CGRectGetMaxY(self.navigationController.navigationBar.frame), 250, 200)];
+    } else {
+        // Fallback on earlier versions
+        [self.popMenu showMenuInRect:CGRectMake(self.view.frame.size.width - 250, CGRectGetMaxY(self.navigationController.navigationBar.frame), 250, 200)];
+    }
 }
 
 - (void)buttonItemClicked_thumbnail:(id)sender {
@@ -209,6 +233,13 @@
     [self.navigationController pushViewController:thumbnailViewController animated:NO];
 }
 
+- (void)menuItemClick_CopyAction:(id)sender {
+    if (self.pdfListView.currentSelection.string)
+        [[UIPasteboard generalPasteboard] setString:self.pdfListView.currentSelection.string];
+    
+    [self.pdfListView clearSelection];
+}
+
 #pragma mark - CPDFViewDelegate
 
 - (void)PDFViewDocumentDidLoaded:(CPDFView *)pdfView {
@@ -419,7 +450,11 @@
     
     CPDFSearchResultsViewController* searchResultController = [[CPDFSearchResultsViewController alloc] initWithResultArray:results keyword:searchToolbar.searchKeyString document:self.pdfListView.document];
     searchResultController.delegate = self;
-    [self.navigationController pushViewController:searchResultController animated:YES];
+    
+    AAPLCustomPresentationController *presentationController NS_VALID_UNTIL_END_OF_SCOPE;
+    presentationController = [[AAPLCustomPresentationController alloc] initWithPresentedViewController:searchResultController presentingViewController:self];
+    searchResultController.transitioningDelegate = presentationController;
+    [self presentViewController:searchResultController animated:YES completion:nil];
 }
 
 - (void)searchToolbarOnExitSearch:(CSearchToolbar *)searchToolbar {
@@ -428,6 +463,9 @@
         UIBarButtonItem *rightItem = [[UIBarButtonItem alloc] initWithCustomView:self.rightView];
         self.navigationItem.rightBarButtonItem = rightItem;
         self.title = self.navigationTitle;
+        
+        UIBarButtonItem *leftItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"CPDFThunbnailImageEnter" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] style:UIBarButtonItemStylePlain target:self action:@selector(buttonItemClicked_thumbnail:)];
+        self.navigationItem.leftBarButtonItem = leftItem;
     }
 }
 
@@ -479,6 +517,7 @@
         noteOpenVC.annotation.contents = content?:@"";
     }
 }
+
 #pragma mark - CPDFSoundPlayBarDelegate
 
 - (void)soundPlayBarRecordFinished:(CPDFSoundPlayBar *)soundPlayBar withFile:(NSString *)filePath {
@@ -503,4 +542,146 @@
     self.pdfListView.annotationMode = CPDFViewAnnotationModeNone;
 }
 
+#pragma mark - CPDFPopMenuDelegate
+
+- (void)MenuDidClosedIn:(CPDFPopMenu *)menu isClosed:(BOOL)isClosed {
+    self.popMenuClosed = isClosed;
+}
+
+#pragma mark - CPDFMenuViewdelegate
+
+- (void)menuDidClickAtView:(CPDFPopMenuView *)view clickType:(CPDFPopMenuViewType)viewType {
+    switch (viewType) {
+        case CPDFPopMenuViewTypeSetting:
+            //display controller
+        {
+            [self.popMenu hideMenu];
+            CPDFDisplayViewController *displayVc = [[CPDFDisplayViewController alloc] initWithPDFView:self.pdfListView];
+            displayVc.delegate = self;
+            
+            
+            AAPLCustomPresentationController *presentationController NS_VALID_UNTIL_END_OF_SCOPE;
+            presentationController = [[AAPLCustomPresentationController alloc] initWithPresentedViewController:displayVc presentingViewController:self];
+            displayVc.transitioningDelegate = presentationController;
+            [self presentViewController:displayVc animated:YES completion:nil];
+        }
+            
+            break;
+            
+        case CPDFPopMenuViewTypeInfo:
+        {
+            [self.popMenu hideMenu];
+            CPDFInfoViewController * infoVc = [[CPDFInfoViewController alloc] initWithPDFView:self.pdfListView];
+            
+            AAPLCustomPresentationController *presentationController NS_VALID_UNTIL_END_OF_SCOPE;
+            presentationController = [[AAPLCustomPresentationController alloc] initWithPresentedViewController:infoVc presentingViewController:self];
+            infoVc.transitioningDelegate = presentationController;
+            [self presentViewController:infoVc animated:YES completion:nil];
+            
+        }
+         
+            break;
+            
+        case CPDFPopMenuViewTypeShare:
+        {
+            [self.popMenu hideMenu];
+            if (self.pdfListView.isEdited) {
+                dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+                    [self.pdfListView commitEditing];
+                    dispatch_async(dispatch_get_main_queue(), ^{
+                        [self.pdfListView endOfEditing];
+                        [self shareAction];
+                    });
+                });
+            } else {
+                [self.pdfListView endOfEditing];
+                [self shareAction];
+            }
+            
+        }
+            break;
+            
+        case CPDFPopMenuViewTypeAddFile:
+        {
+            [self.popMenu hideMenu];
+            NSArray *documentTypes = @[@"com.adobe.pdf"];
+            UIDocumentPickerViewController *documentPickerViewController = [[UIDocumentPickerViewController alloc] initWithDocumentTypes:documentTypes inMode:UIDocumentPickerModeOpen];
+                    documentPickerViewController.delegate = self;
+            [self presentViewController:documentPickerViewController animated:YES completion:nil];
+        }
+            
+        default:
+            break;
+    }
+}
+
+- (void)shareAction {
+    UIActivityViewController *activityVC = [[UIActivityViewController alloc]initWithActivityItems:@[self.pdfListView.document.documentURL] applicationActivities:nil];
+        activityVC.definesPresentationContext = YES;
+        [self presentViewController:activityVC animated:YES completion:nil];
+        activityVC.completionWithItemsHandler = ^(UIActivityType  _Nullable activityType, BOOL completed, NSArray * _Nullable returnedItems, NSError * _Nullable activityError) {
+
+            if (completed) {
+                NSLog(@"Success!");
+            } else {
+                NSLog(@"Failed Or Canceled!");
+            }
+        };
+}
+
+#pragma mark - UIDocument Picker
+
+- (void)documentPicker:(UIDocumentPickerViewController *)controller didPickDocumentsAtURLs:(NSArray<NSURL *> *)urls{
+    
+    __weak typeof(self) weakSelf = self;
+    //获取授权
+    BOOL fileUrlAuthozied = [urls.firstObject startAccessingSecurityScopedResource];
+    if(fileUrlAuthozied){
+        //通过文件协调工具来得到新的文件地址,以此得到文件保护功能
+        NSFileCoordinator *fileCoordinator = [[NSFileCoordinator alloc] init];
+        NSError *error;
+        //读取文件
+        [fileCoordinator coordinateReadingItemAtURL:urls.firstObject options:0 error:&error byAccessor:^(NSURL *newURL) {
+            
+            NSFileManager * fileManager = [NSFileManager defaultManager];
+            NSString * appDir = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
+            NSString *fileName = [newURL lastPathComponent];
+            NSString * filePath = [appDir stringByAppendingPathComponent:fileName];
+            
+            if(![fileManager fileExistsAtPath:filePath]) {
+                BOOL filePresent = [weakSelf copyMissingFile:newURL.path toPath:appDir];
+                NSString * savedPath = [NSString stringWithFormat:@"%@/%@",appDir,fileName];
+                
+                [weakSelf reloadDocumentWithFilePath:savedPath completion:^(BOOL result) {
+                    [weakSelf.pdfListView reloadInputViews];
+                }];
+                
+            }
+            NSError *error = nil;
+            if (error) {
+                //
+            } else {
+               
+            }
+            
+            [self dismissViewControllerAnimated:YES completion:NULL];
+            
+        }];
+        [urls.firstObject stopAccessingSecurityScopedResource];
+        
+    }else{
+        //Error handling
+        NSLog(@"Faild");
+    }
+}
+
+- (BOOL)copyMissingFile:(NSString*)sourcePath toPath:(NSString*)toPath {
+    BOOL retVal = YES;
+    NSString * finalLocation = [toPath stringByAppendingPathComponent:[sourcePath lastPathComponent]];
+    if(![[NSFileManager defaultManager]  fileExistsAtPath:finalLocation]) {
+        retVal = [[NSFileManager defaultManager] copyItemAtPath:sourcePath toPath:finalLocation error:NULL];
+    }
+    return retVal;
+}
+
 @end

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

@@ -223,7 +223,6 @@
 
 - (void)reloadDocumentWithFilePath:(NSString *)filePath completion:(void (^)(BOOL result))completion {
     
-    
     [self.navigationController.view setUserInteractionEnabled:NO];
     
     if (![self.loadingView superview]) {

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

@@ -171,12 +171,4 @@
     [self.sampleView setNeedsDisplay];
 }
 
-#pragma mark - UIColorPickerViewControllerDelegate
-
-- (void)colorPickerViewControllerDidFinish:(UIColorPickerViewController *)viewController API_AVAILABLE(ios(14.0)) {
-    self.sampleView.fillColor = viewController.selectedColor;
-    self.annotStyle.color = self.sampleView.fillColor;
-    [self.sampleView setNeedsDisplay];
-}
-
 @end

+ 33 - 7
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/CPDFFreeTextViewController.m

@@ -14,11 +14,10 @@
 #import "CPDFAnnotationBaseViewController_Header.h"
 #import "CPDFThicknessSliderView.h"
 #import "CPDFFontStyleTableView.h"
-#import "CPDFEditFontNameSelectView.h"
 
 #import <compdfkit_tools/CPDFColorUtils.h>
 
-@interface CPDFFreeTextViewController () <CPDFThicknessSliderViewDelegate, CPDFFontStyleTableViewDelegate, CPDFEditFontNameSelectViewDelegate>
+@interface CPDFFreeTextViewController () <UIColorPickerViewControllerDelegate, CPDFThicknessSliderViewDelegate, CPDFFontStyleTableViewDelegate, CPDFColorPickerViewDelegate>
 
 @property (nonatomic, strong) UIButton *boldBtn;
 
@@ -40,7 +39,7 @@
 
 @property (nonatomic, assign) NSString *baseName;
 
-@property (nonatomic, strong) CPDFEditFontNameSelectView *fontStyleTableView;
+@property (nonatomic, strong) CPDFFontStyleTableView *fontStyleTableView;
 
 @property (nonatomic, strong) UIView * dropMenuView;
 
@@ -92,11 +91,13 @@
     
     self.boldBtn = [[UIButton alloc] init];
     [self.boldBtn setImage:[UIImage imageNamed:@"CPDFFreeTextImageBold" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
+    [self.boldBtn setImage:[UIImage imageNamed:@"CPDFFreeTextImageBoldHighLinght" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateSelected];
     [self.boldBtn addTarget:self action:@selector(buttonItemClicked_Bold:) forControlEvents:UIControlEventTouchUpInside];
     [self.scrcollView addSubview:self.boldBtn];
     
     self.italicBtn = [[UIButton alloc] init];
     [self.italicBtn setImage:[UIImage imageNamed:@"CPDFFreeTextImageUnderline" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
+    [self.italicBtn setImage:[UIImage imageNamed:@"CPDFFreeTextImageItailcHighLight" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateSelected];
     [self.italicBtn addTarget:self action:@selector(buttonItemClicked_Italic:) forControlEvents:UIControlEventTouchUpInside];
     [self.scrcollView addSubview:self.italicBtn];
     
@@ -289,9 +290,8 @@
 }
 
 - (void)buttonItemClicked_FontStyle:(id)sender {
-    self.fontStyleTableView = [[CPDFEditFontNameSelectView alloc] initWithFrame:self.view.bounds];
+    self.fontStyleTableView = [[CPDFFontStyleTableView alloc] initWithFrame:self.view.bounds];
     self.fontStyleTableView.delegate = self;
-    self.fontStyleTableView.fontNameArr = [NSMutableArray arrayWithArray:[self.pdfListView getFontList]];
     self.fontStyleTableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
     self.fontStyleTableView.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
     [self.view addSubview:self.fontStyleTableView];
@@ -350,6 +350,7 @@
     self.sampleView.fontName = fontName;
     self.baseName = fontName;
     self.annotStyle.fontName = [self constructionFontname:self.baseName isBold:self.isBold isItalic:self.isItalic];
+    self.fontNameSelectLabel.text = fontName;
     if (self.delegate && [self.delegate respondsToSelector:@selector(freeTextViewController:annotStyle:)]) {
         [self.delegate freeTextViewController:self annotStyle:self.annotStyle];
     }
@@ -360,18 +361,43 @@
 
 - (void)selectColorView:(CPDFColorSelectView *)select color:(UIColor *)color {
     self.sampleView.fillColor = color;
-    self.annotStyle.color = color;
+    self.annotStyle.fontColor = color;
     if (self.delegate && [self.delegate respondsToSelector:@selector(freeTextViewController:annotStyle:)]) {
         [self.delegate freeTextViewController:self annotStyle:self.annotStyle];
     }
     [self.sampleView setNeedsDisplay];
 }
 
+- (void)selectColorView:(CPDFColorSelectView *)select {
+    if (@available(iOS 14.0, *)) {
+        UIColorPickerViewController *picker = [[UIColorPickerViewController alloc] init];
+        picker.delegate = self;
+        [self presentViewController:picker animated:YES completion:nil];
+    } else {
+        self.colorPicker = [[CPDFColorPickerView alloc] initWithFrame:self.view.frame];
+        self.colorPicker.delegate = self;
+        self.colorPicker.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
+        self.colorPicker.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
+        [self.view addSubview:self.colorPicker];
+    }
+}
+
 #pragma mark - CPDFColorPickerViewDelegate
 
 - (void)pickerView:(CPDFColorPickerView *)colorPickerView color:(UIColor *)color {
     self.sampleView.fillColor = color;
-    self.annotStyle.color = color;
+    self.annotStyle.fontColor = color;
+    if (self.delegate && [self.delegate respondsToSelector:@selector(freeTextViewController:annotStyle:)]) {
+        [self.delegate freeTextViewController:self annotStyle:self.annotStyle];
+    }
+    [self.sampleView setNeedsDisplay];
+}
+
+#pragma mark - UIColorPickerViewControllerDelegate
+
+- (void)colorPickerViewControllerDidFinish:(UIColorPickerViewController *)viewController API_AVAILABLE(ios(14.0)) {
+    self.sampleView.fillColor = viewController.selectedColor;
+    self.annotStyle.fontColor = self.sampleView.fillColor;
     if (self.delegate && [self.delegate respondsToSelector:@selector(freeTextViewController:annotStyle:)]) {
         [self.delegate freeTextViewController:self annotStyle:self.annotStyle];
     }

+ 10 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/Image.xcassets/CPDFFreeTextImageBold.imageset/Contents.json

@@ -3,6 +3,16 @@
     {
       "filename" : "bold_nor.pdf",
       "idiom" : "universal"
+    },
+    {
+      "appearances" : [
+        {
+          "appearance" : "luminosity",
+          "value" : "dark"
+        }
+      ],
+      "filename" : "Property 1=nor.pdf",
+      "idiom" : "universal"
     }
   ],
   "info" : {

+ 105 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/Image.xcassets/CPDFFreeTextImageBold.imageset/Property 1=nor.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 5.523926 4.166626 cm
+1.000000 1.000000 1.000000 scn
+7.293215 6.049939 m
+7.396729 6.090428 7.493869 6.135427 7.584636 6.184937 c
+8.067492 6.450778 8.412002 6.795288 8.618164 7.218465 c
+8.824327 7.641643 8.927409 8.094659 8.927409 8.577515 c
+8.927409 9.130900 8.821615 9.611044 8.610026 10.017944 c
+8.398438 10.430271 8.089193 10.772068 7.682292 11.043335 c
+7.280817 11.314602 6.792535 11.515340 6.217448 11.645549 c
+5.642362 11.781182 4.988607 11.848999 4.256185 11.848999 c
+0.000000 11.848999 l
+0.000000 0.000041 l
+4.720052 0.000041 l
+5.696615 0.000041 6.515842 0.130249 7.177735 0.390666 c
+7.839627 0.651083 8.336046 1.041708 8.666992 1.562541 c
+9.003364 2.083374 9.171550 2.731704 9.171550 3.507528 c
+9.171550 3.963257 9.071181 4.399998 8.870443 4.817749 c
+8.669705 5.235501 8.336046 5.571872 7.869466 5.826864 c
+7.699786 5.920687 7.507702 5.995045 7.293215 6.049939 c
+h
+2.856446 5.037476 m
+2.856446 2.197307 l
+4.720052 2.197307 l
+5.110677 2.197307 5.422635 2.256985 5.655925 2.376343 c
+5.894640 2.501125 6.065538 2.663886 6.168620 2.864624 c
+6.277127 3.070787 6.331380 3.298652 6.331380 3.548218 c
+6.331380 3.852037 6.279840 4.115167 6.176758 4.337606 c
+6.079102 4.560045 5.921767 4.730943 5.704753 4.850301 c
+5.487739 4.975084 5.197483 5.037476 4.833984 5.037476 c
+2.856446 5.037476 l
+h
+4.239909 6.909221 m
+4.684787 6.909221 5.040148 6.958049 5.305990 7.055705 c
+5.571832 7.158786 5.764432 7.307983 5.883790 7.503296 c
+6.008573 7.698608 6.070964 7.942749 6.070964 8.235718 c
+6.070964 8.572089 6.008573 8.843357 5.883790 9.049520 c
+5.759006 9.255683 5.560981 9.404881 5.289714 9.497111 c
+5.023872 9.594768 4.679362 9.643596 4.256185 9.643596 c
+2.856446 9.643596 l
+2.856446 6.909221 l
+4.239909 6.909221 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  1783
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 20.000000 20.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
+0000001873 00000 n
+0000001896 00000 n
+0000002069 00000 n
+0000002143 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+2202
+%%EOF

+ 22 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/Image.xcassets/CPDFFreeTextImageBoldHighLinght.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "Property 1=sel.pdf",
+      "idiom" : "universal"
+    },
+    {
+      "appearances" : [
+        {
+          "appearance" : "luminosity",
+          "value" : "dark"
+        }
+      ],
+      "filename" : "Property 1=sel 1.pdf",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 105 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/Image.xcassets/CPDFFreeTextImageBoldHighLinght.imageset/Property 1=sel 1.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 5.523926 4.166626 cm
+0.391667 0.598991 1.000000 scn
+7.293215 6.049939 m
+7.396729 6.090428 7.493869 6.135427 7.584636 6.184937 c
+8.067492 6.450778 8.412002 6.795288 8.618164 7.218465 c
+8.824327 7.641643 8.927409 8.094659 8.927409 8.577515 c
+8.927409 9.130900 8.821615 9.611044 8.610026 10.017944 c
+8.398438 10.430271 8.089193 10.772068 7.682292 11.043335 c
+7.280817 11.314602 6.792535 11.515340 6.217448 11.645549 c
+5.642362 11.781182 4.988607 11.848999 4.256185 11.848999 c
+0.000000 11.848999 l
+0.000000 0.000041 l
+4.720052 0.000041 l
+5.696615 0.000041 6.515842 0.130249 7.177735 0.390666 c
+7.839627 0.651083 8.336046 1.041708 8.666992 1.562541 c
+9.003364 2.083374 9.171550 2.731704 9.171550 3.507528 c
+9.171550 3.963257 9.071181 4.399998 8.870443 4.817749 c
+8.669705 5.235501 8.336046 5.571872 7.869466 5.826864 c
+7.699786 5.920687 7.507702 5.995045 7.293215 6.049939 c
+h
+2.856446 5.037476 m
+2.856446 2.197307 l
+4.720052 2.197307 l
+5.110677 2.197307 5.422635 2.256985 5.655925 2.376343 c
+5.894640 2.501125 6.065538 2.663886 6.168620 2.864624 c
+6.277127 3.070787 6.331380 3.298652 6.331380 3.548218 c
+6.331380 3.852037 6.279840 4.115167 6.176758 4.337606 c
+6.079102 4.560045 5.921767 4.730943 5.704753 4.850301 c
+5.487739 4.975084 5.197483 5.037476 4.833984 5.037476 c
+2.856446 5.037476 l
+h
+4.239909 6.909221 m
+4.684787 6.909221 5.040148 6.958049 5.305990 7.055705 c
+5.571832 7.158786 5.764432 7.307983 5.883790 7.503296 c
+6.008573 7.698608 6.070964 7.942749 6.070964 8.235718 c
+6.070964 8.572089 6.008573 8.843357 5.883790 9.049520 c
+5.759006 9.255683 5.560981 9.404881 5.289714 9.497111 c
+5.023872 9.594768 4.679362 9.643596 4.256185 9.643596 c
+2.856446 9.643596 l
+2.856446 6.909221 l
+4.239909 6.909221 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  1783
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 20.000000 20.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
+0000001873 00000 n
+0000001896 00000 n
+0000002069 00000 n
+0000002143 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+2202
+%%EOF

+ 105 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/Image.xcassets/CPDFFreeTextImageBoldHighLinght.imageset/Property 1=sel.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 5.524170 4.166668 cm
+0.078431 0.376471 0.952941 scn
+7.293214 6.049897 m
+7.396728 6.090386 7.493868 6.135386 7.584635 6.184895 c
+8.067491 6.450737 8.412001 6.795246 8.618163 7.218423 c
+8.824327 7.641601 8.927408 8.094617 8.927408 8.577473 c
+8.927408 9.130858 8.821613 9.611002 8.610025 10.017902 c
+8.398437 10.430229 8.089192 10.772026 7.682291 11.043293 c
+7.280816 11.314560 6.792534 11.515298 6.217447 11.645507 c
+5.642361 11.781140 4.988606 11.848957 4.256185 11.848957 c
+0.000000 11.848957 l
+0.000000 -0.000001 l
+4.720052 -0.000001 l
+5.696614 -0.000001 6.515841 0.130207 7.177734 0.390624 c
+7.839626 0.651041 8.336045 1.041666 8.666991 1.562499 c
+9.003363 2.083332 9.171549 2.731662 9.171549 3.507486 c
+9.171549 3.963215 9.071180 4.399956 8.870441 4.817707 c
+8.669703 5.235459 8.336045 5.571830 7.869465 5.826822 c
+7.699784 5.920645 7.507701 5.995003 7.293214 6.049897 c
+h
+2.856445 5.037434 m
+2.856445 2.197265 l
+4.720052 2.197265 l
+5.110677 2.197265 5.422634 2.256943 5.655924 2.376301 c
+5.894639 2.501083 6.065538 2.663844 6.168619 2.864582 c
+6.277126 3.070745 6.331379 3.298610 6.331379 3.548176 c
+6.331379 3.851995 6.279839 4.115125 6.176757 4.337564 c
+6.079101 4.560003 5.921766 4.730901 5.704752 4.850259 c
+5.487738 4.975042 5.197482 5.037434 4.833984 5.037434 c
+2.856445 5.037434 l
+h
+4.239908 6.909179 m
+4.684787 6.909179 5.040147 6.958007 5.305989 7.055663 c
+5.571831 7.158744 5.764431 7.307941 5.883789 7.503254 c
+6.008572 7.698566 6.070963 7.942707 6.070963 8.235676 c
+6.070963 8.572047 6.008572 8.843315 5.883789 9.049479 c
+5.759006 9.255641 5.560980 9.404839 5.289713 9.497069 c
+5.023871 9.594726 4.679361 9.643554 4.256185 9.643554 c
+2.856445 9.643554 l
+2.856445 6.909179 l
+4.239908 6.909179 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  1786
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 20.000000 20.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
+0000001876 00000 n
+0000001899 00000 n
+0000002072 00000 n
+0000002146 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+2205
+%%EOF

+ 22 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/Image.xcassets/CPDFFreeTextImageItailcHighLight.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "Property 1=sel (1).pdf",
+      "idiom" : "universal"
+    },
+    {
+      "appearances" : [
+        {
+          "appearance" : "luminosity",
+          "value" : "dark"
+        }
+      ],
+      "filename" : "Property 1=sel.pdf",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 79 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/Image.xcassets/CPDFFreeTextImageItailcHighLight.imageset/Property 1=sel (1).pdf

@@ -0,0 +1,79 @@
+%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 5.416748 4.166668 cm
+0.078431 0.376471 0.952941 scn
+9.166585 9.166666 m
+6.944363 9.166666 l
+4.722141 2.500000 l
+6.666585 2.500000 l
+6.666585 0.000000 l
+-0.000082 0.000000 l
+-0.000082 2.500000 l
+2.222141 2.500000 l
+4.444363 9.166666 l
+2.499918 9.166666 l
+2.499918 11.666666 l
+9.166585 11.666666 l
+9.166585 9.166666 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  392
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 20.000000 20.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
+0000000482 00000 n
+0000000504 00000 n
+0000000677 00000 n
+0000000751 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+810
+%%EOF

+ 79 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/Image.xcassets/CPDFFreeTextImageItailcHighLight.imageset/Property 1=sel.pdf

@@ -0,0 +1,79 @@
+%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 5.416504 4.166748 cm
+0.391667 0.598991 1.000000 scn
+9.166667 9.166626 m
+6.944445 9.166626 l
+4.722223 2.499959 l
+6.666667 2.499959 l
+6.666667 -0.000041 l
+0.000000 -0.000041 l
+0.000000 2.499959 l
+2.222223 2.499959 l
+4.444445 9.166626 l
+2.500000 9.166626 l
+2.500000 11.666626 l
+9.166667 11.666626 l
+9.166667 9.166626 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  392
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 20.000000 20.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
+0000000482 00000 n
+0000000504 00000 n
+0000000677 00000 n
+0000000751 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+810
+%%EOF

+ 10 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/Image.xcassets/CPDFFreeTextImageUnderline.imageset/Contents.json

@@ -3,6 +3,16 @@
     {
       "filename" : "Item.pdf",
       "idiom" : "universal"
+    },
+    {
+      "appearances" : [
+        {
+          "appearance" : "luminosity",
+          "value" : "dark"
+        }
+      ],
+      "filename" : "Property 1=nol.pdf",
+      "idiom" : "universal"
     }
   ],
   "info" : {

+ 79 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/Image.xcassets/CPDFFreeTextImageUnderline.imageset/Property 1=nol.pdf

@@ -0,0 +1,79 @@
+%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 5.416504 4.166748 cm
+1.000000 1.000000 1.000000 scn
+9.166667 9.166626 m
+6.944445 9.166626 l
+4.722223 2.499959 l
+6.666667 2.499959 l
+6.666667 -0.000041 l
+0.000000 -0.000041 l
+0.000000 2.499959 l
+2.222223 2.499959 l
+4.444445 9.166626 l
+2.500000 9.166626 l
+2.500000 11.666626 l
+9.166667 11.666626 l
+9.166667 9.166626 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  392
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 20.000000 20.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
+0000000482 00000 n
+0000000504 00000 n
+0000000677 00000 n
+0000000751 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+810
+%%EOF

+ 130 - 12
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CPDFSignatureEditViewController.m

@@ -18,7 +18,7 @@
 
 #import <compdfkit_tools/CPDFColorUtils.h>
 
-@interface CPDFSignatureEditViewController () <UIPopoverPresentationControllerDelegate, UINavigationControllerDelegate, UIImagePickerControllerDelegate, CPDFColorSelectViewDelegate, CPDFColorPickerViewDelegate>
+@interface CPDFSignatureEditViewController () <UIPopoverPresentationControllerDelegate, UINavigationControllerDelegate, UIImagePickerControllerDelegate, UIColorPickerViewControllerDelegate, UITextFieldDelegate, CPDFColorSelectViewDelegate, CPDFColorPickerViewDelegate>
 
 @property (nonatomic, strong) CPDFColorSelectView *colorSelectView;
 
@@ -42,6 +42,14 @@
 
 @property (nonatomic, assign) CSignatureTopBarSelectedIndex selecIndex;
 
+@property (nonatomic, strong) UIView *thicknessView;
+
+@property (nonatomic, strong) UILabel *thicknessLabel;
+
+@property (nonatomic, strong) UISlider *thicknessSlider;
+
+@property (nonatomic, strong) UIButton *clearButton;
+
 @end
 
 @implementation CPDFSignatureEditViewController
@@ -71,12 +79,30 @@
     self.signatureDrawImageView.lineWidth = 4;
     [self.view addSubview:self.signatureDrawImageView];
     self.signatureDrawImageView.hidden = YES;
-    
-    self.colorSelectView = [[CPDFColorSelectView alloc] initWithFrame:CGRectMake(0, 550, self.view.frame.size.width, 90)];
+
+    self.colorSelectView = [[CPDFColorSelectView alloc] init];
+    [self.colorSelectView.colorLabel removeFromSuperview];
     self.colorSelectView.delegate = self;
-    self.colorSelectView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
     [self.view addSubview:self.colorSelectView];
     
+    self.thicknessView = [[UIView alloc] init];
+    self.thicknessView.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
+    [self.view addSubview:self.thicknessView];
+    
+    self.thicknessLabel = [[UILabel alloc] init];
+    self.thicknessLabel.text = NSLocalizedString(@"Thicness", nil);
+    self.thicknessLabel.textColor = [UIColor grayColor];
+    self.thicknessLabel.font = [UIFont systemFontOfSize:12.0];
+    [self.thicknessView addSubview:self.thicknessLabel];
+    
+    self.thicknessSlider = [[UISlider alloc] init];
+    self.thicknessSlider.autoresizingMask = UIViewAutoresizingFlexibleWidth;
+    self.thicknessSlider.value = 5;
+    self.thicknessSlider.maximumValue = 20;
+    self.thicknessSlider.minimumValue = 1;
+    [self.thicknessSlider addTarget:self action:@selector(buttonItemClicked_changes:) forControlEvents:UIControlEventValueChanged];
+    [self.thicknessView addSubview:self.thicknessSlider];
+    
     self.cacelButon = [[UIButton alloc] init];
     [self.cacelButon setTitle:NSLocalizedString(@"Cancel", nil) forState:UIControlStateNormal];
     [self.cacelButon setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
@@ -94,6 +120,8 @@
     self.bottomBorder = [CALayer layer];
     self.bottomBorder.backgroundColor = [UIColor blackColor].CGColor;
     self.textField = [[UITextField alloc] init];
+    self.textField.delegate = self;
+    self.textField.placeholder = NSLocalizedString(@"Signature Here", nil);
     self.textField.textAlignment = NSTextAlignmentCenter;
     self.textField.font = [UIFont systemFontOfSize:30];
     [self.view addSubview:self.textField];
@@ -109,6 +137,17 @@
     [self.view addSubview:self.createButton];
     self.createButton.hidden = YES;
     
+    self.clearButton = [[UIButton alloc] init];
+    [self.clearButton setImage:[UIImage imageNamed:@"CPDFSignatureImageClean" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
+    self.clearButton.titleLabel.adjustsFontSizeToFitWidth = YES;
+    self.clearButton.layer.borderColor = [UIColor purpleColor].CGColor;
+    self.clearButton.layer.borderWidth = 1.0;
+    self.clearButton.layer.cornerRadius = 25.0;
+    self.clearButton.layer.masksToBounds = YES;
+    [self.clearButton setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
+    [self.clearButton addTarget:self action:@selector(buttonItemClicked_clear:) forControlEvents:UIControlEventTouchUpInside];
+    [self.view addSubview:self.clearButton];
+    
     self.selecIndex = CSignatureTopBarDefault;
     self.view.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
     [self createGestureRecognizer];
@@ -117,20 +156,36 @@
 - (void)viewWillLayoutSubviews {
     [super viewWillLayoutSubviews];
     self.colorPicker.frame = CGRectMake(0, self.view.frame.size.height/2, self.view.frame.size.width, self.view.frame.size.height/2);
+   
     if (@available(iOS 11.0, *)) {
-        self.colorSelectView.frame = CGRectMake(0, self.view.safeAreaInsets.top, self.view.frame.size.width, 90);
-        self.signatureDrawTextView.frame = CGRectMake(self.view.safeAreaInsets.left, self.view.safeAreaInsets.top + 90, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, self.view.frame.size.height/2);
+        if (UIInterfaceOrientationIsPortrait([UIApplication sharedApplication].statusBarOrientation)) {
+            self.colorSelectView.frame = CGRectMake(self.view.safeAreaInsets.left, self.view.safeAreaInsets.top, self.view.frame.size.width-self.view.safeAreaInsets.left-self.view.safeAreaInsets.right, 60);
+            self.thicknessView.frame = CGRectMake(self.view.safeAreaInsets.left, self.view.safeAreaInsets.top+60, 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, self.view.safeAreaInsets.top + 120, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, self.view.frame.size.height/2);
+            
+        } else {
+            self.colorSelectView.frame = CGRectMake(self.view.safeAreaInsets.left, self.view.safeAreaInsets.top-15, 380, 60);
+            self.thicknessView.frame = CGRectMake(self.view.safeAreaInsets.left+380, self.view.safeAreaInsets.top, self.view.frame.size.width-self.view.safeAreaInsets.left-self.view.safeAreaInsets.right-380, 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, self.view.safeAreaInsets.top + 60, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, self.view.frame.size.height/2);
+        }
+        
         self.signatureDrawImageView.frame = self.signatureDrawTextView.frame;
         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.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);
+        self.clearButton.frame = CGRectMake(self.view.frame.size.width - 70, self.view.frame.size.height - 100, 50, 50);
     }
     
     self.textField.frame = CGRectMake((self.view.frame.size.width - 300)/2, 200, 300, 100);
-    self.bottomBorder.frame = CGRectMake(0, self.textField.frame.size.height - 1, self.textField.frame.size.width, 1.0);
 }
 
 - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
@@ -216,6 +271,7 @@
         self.selecIndex = CSignatureTopBarText;
         self.colorSelectView.hidden = NO;
         self.createButton.hidden = YES;
+        self.thicknessView.hidden = YES;
     } else if (self.segmentedControl.selectedSegmentIndex == 2) {
         self.colorSelectView.hidden = YES;
         self.signatureDrawTextView.hidden = YES;
@@ -225,10 +281,55 @@
         self.createButton.hidden = NO;
         self.colorSelectView.hidden = YES;
         self.signatureDrawImageView.selectIndex = CSignatureDrawImage;
+        self.thicknessView.hidden = YES;
         [self.signatureDrawImageView setNeedsDisplay];
     }
 }
 
+- (void)buttonItemClicked_changes:(UISlider *)sender {
+    self.signatureDrawTextView.lineWidth = sender.value;
+    [self.signatureDrawTextView setNeedsDisplay];
+}
+
+- (void)buttonItemClicked_clear:(UIButton *)button {
+    if (self.segmentedControl.selectedSegmentIndex == 0) {
+        [self.signatureDrawTextView signatureClear];
+    }
+}
+
+#pragma mark - UITextFieldDelegate
+
+- (void)textFieldDidBeginEditing:(UITextField *)textField {
+    if (UIInterfaceOrientationIsPortrait([UIApplication sharedApplication].statusBarOrientation)) {
+        [UIView animateWithDuration:0.3 delay:0 options:UIViewAnimationOptionCurveEaseIn animations:^ {
+            self.clearButton.center = CGPointMake(self.clearButton.center.x, self.clearButton.center.y-300);
+        } completion:nil];
+    } else {
+        [UIView animateWithDuration:0.3 delay:0 options:UIViewAnimationOptionCurveEaseIn animations:^ {
+            self.clearButton.center = CGPointMake(self.clearButton.center.x, self.clearButton.center.y-200);
+            self.textField.center = CGPointMake(self.textField.center.x, self.textField.center.y-100);
+        } completion:nil];
+    }
+}
+
+- (void)textFieldDidEndEditing:(UITextField *)textField {
+    if (UIInterfaceOrientationIsPortrait([UIApplication sharedApplication].statusBarOrientation)) {
+        [UIView animateWithDuration:0.3 delay:0 options:UIViewAnimationOptionCurveEaseIn animations:^ {
+            self.clearButton.center = CGPointMake(self.clearButton.center.x, self.clearButton.center.y+300);
+        } completion:nil];
+    } else {
+        [UIView animateWithDuration:0.3 delay:0 options:UIViewAnimationOptionCurveEaseIn animations:^ {
+            self.clearButton.center = CGPointMake(self.clearButton.center.x, self.clearButton.center.y+200);
+            self.textField.center = CGPointMake(self.textField.center.x, self.textField.center.y+100);
+        } completion:nil];
+    }
+}
+
+- (BOOL)textFieldShouldReturn:(UITextField *)textField {
+    [textField resignFirstResponder];
+    return YES;
+}
+
 #pragma mark - Private Methods
 
 - (void)createImageSignature {
@@ -303,14 +404,21 @@
 - (void)selectColorView:(CPDFColorSelectView *)select color:(UIColor *)color {
     self.textField.textColor = color;
     self.signatureDrawTextView.color = color;
+    [self.signatureDrawTextView setNeedsDisplay];
 }
 
 - (void)selectColorView:(CPDFColorSelectView *)select {
-    _colorPicker = [[CPDFColorPickerView alloc] initWithFrame:self.view.frame];
-    _colorPicker.delegate = self;
-    _colorPicker.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 {
+        self.colorPicker = [[CPDFColorPickerView alloc] initWithFrame:self.view.frame];
+        self.colorPicker.delegate = self;
+        self.colorPicker.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
+        self.colorPicker.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
+        [self.view addSubview:self.colorPicker];
+    }
 }
 
 #pragma mark - CPDFColorPickerViewDelegate
@@ -318,6 +426,16 @@
 - (void)pickerView:(CPDFColorPickerView *)colorPickerView color:(UIColor *)color {
     self.signatureDrawTextView.color = color;
     self.textField.textColor = color;
+    [self.signatureDrawImageView setNeedsDisplay];
 }
 
+#pragma mark - UIColorPickerViewControllerDelegate
+
+- (void)colorPickerViewControllerDidFinish:(UIColorPickerViewController *)viewController API_AVAILABLE(ios(14.0)) {
+    self.signatureDrawTextView.color = viewController.selectedColor;
+    self.textField.textColor = self.signatureDrawTextView.color;
+    [self.signatureDrawTextView setNeedsDisplay];
+}
+
+
 @end

+ 1 - 16
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CSignatureDrawView.m

@@ -19,8 +19,6 @@ static NSInteger _index;
 
 @property (nonatomic, strong) UIBezierPath *bezierPath;
 
-@property (nonatomic, strong) UIButton *clearButton;
-
 @end
 
 @implementation CSignatureDrawView
@@ -30,18 +28,7 @@ static NSInteger _index;
 - (instancetype)initWithFrame:(CGRect)frame {
     if (self = [super initWithFrame:frame]) {
         self.bezierPath = [[UIBezierPath alloc] init];
-        self.lineWidth = 5;
-        
-        self.clearButton = [[UIButton alloc] init];
-        [self.clearButton setImage:[UIImage imageNamed:@"CPDFSignatureImageClean" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-        self.clearButton.titleLabel.adjustsFontSizeToFitWidth = YES;
-        self.clearButton.layer.borderColor = [UIColor purpleColor].CGColor;
-        self.clearButton.layer.borderWidth = 1.0;
-        self.clearButton.layer.cornerRadius = 20.0;
-        self.clearButton.layer.masksToBounds = YES;
-        [self.clearButton setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
-        [self.clearButton addTarget:self action:@selector(buttonItemClicked_clear:) forControlEvents:UIControlEventTouchUpInside];
-        [self addSubview:self.clearButton];
+        self.lineWidth = 1;
         
         self.backgroundColor = [UIColor whiteColor];
     }
@@ -51,7 +38,6 @@ static NSInteger _index;
 - (void)layoutSubviews {
     [super layoutSubviews];
     [self setNeedsDisplayInRect:self.bounds];
-    self.clearButton.frame = CGRectMake(self.frame.size.width - 80, self.frame.size.height - 60, 40, 40);
 }
 
 - (void)drawRect:(CGRect)rect {
@@ -68,7 +54,6 @@ static NSInteger _index;
             CGRect imageFrame = [self imageFrameInRect:rect];
             [self.image drawInRect:imageFrame];
         }
-        self.clearButton.hidden = YES;
     }
         
 }

+ 1 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CPDFStampViewController.m

@@ -81,6 +81,7 @@ PDFAnnotationStampKey const PDFAnnotationStampKeyShape = @"PDFAnnotationStampKey
     self.titleLabel = [[UILabel alloc] init];
     self.titleLabel.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;
     self.titleLabel.text = NSLocalizedString(@"Stamp", nil);
+    self.titleLabel.textAlignment = NSTextAlignmentCenter;
     self.titleLabel.font = [UIFont systemFontOfSize:20];
     self.titleLabel.adjustsFontSizeToFitWidth = YES;
     [self.view addSubview:self.titleLabel];

+ 27 - 21
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampColorSelectView.m

@@ -12,14 +12,12 @@
 
 #import "CStampColorSelectView.h"
 
+#import <compdfkit_tools/CPDFColorUtils.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
 
@@ -34,19 +32,6 @@
         [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];
     }
@@ -55,7 +40,7 @@
 
 - (void)layoutSubviews {
     [super layoutSubviews];
-    self.colorLabel.frame = CGRectMake(20, 0, 50, self.bounds.size.height);
+    self.colorLabel.frame = CGRectMake(20, 0, 50, self.bounds.size.height-15);
     self.colorPickerView.frame = CGRectMake(70, 0, self.bounds.size.width-70, self.bounds.size.height);
     [self pickerBarInit];
 }
@@ -65,21 +50,42 @@
                         [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]];
+    NSMutableArray *array = [NSMutableArray array];
     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];
+        UIView *view = [[UIButton alloc] init];
+        view.tag = i;
+        view.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);
+        [[view layer] setCornerRadius:(self.colorPickerView.bounds.size.height - 20)/2];
+        view.layer.masksToBounds = YES;
+        view.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleLeftMargin;
+        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];
+        button.frame = CGRectInset(view.frame, 3, 3);
+        [[button layer] setCornerRadius:(self.colorPickerView.bounds.size.height - 26)/2];
         button.layer.masksToBounds = YES;
         button.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleLeftMargin;
+        [self.colorPickerView addSubview:button];
         button.backgroundColor = colors[i];
         button.tag = i;
         [button addTarget:self action:@selector(buttonItemClicked_select:) forControlEvents:UIControlEventTouchUpInside];
     }
+    self.colorArray = array;
 }
 
 #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;
+    
     if (self.delegate && [self.delegate respondsToSelector:@selector(stampColorSelectView:tag:)]) {
         [self.delegate stampColorSelectView:self tag:button.tag];
     }

+ 17 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampShapView.m

@@ -12,6 +12,8 @@
 
 #import "CStampShapView.h"
 
+#import <compdfkit_tools/CPDFColorUtils.h>
+
 @interface CStampShapView ()
 
 @property (nonatomic, strong) UILabel *titleLabel;
@@ -26,6 +28,8 @@
 
 @property (nonatomic, strong) UIView *shapeView;
 
+@property (nonatomic, strong) NSMutableArray *buttonArray;
+
 @end
 
 @implementation CStampShapView
@@ -43,30 +47,38 @@
         
         self.shapeView = [[UIView alloc] initWithFrame:CGRectMake(0, 30, self.bounds.size.width, 60)];
         [self addSubview:self.shapeView];
+        
+        self.buttonArray = [NSMutableArray array];
     
         self.centerButton = [[UIButton alloc] init];
         [self.centerButton setImage:[UIImage imageNamed:@"CPDFStampTextImageCenter" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
         [self.centerButton addTarget:self action:@selector(buttonItemClicked_select:) forControlEvents:UIControlEventTouchUpInside];
         self.centerButton.tag = 0;
         [self.shapeView addSubview:self.centerButton];
+        [self.buttonArray addObject:self.centerButton];
+        
+        self.centerButton.backgroundColor = [CPDFColorUtils CAnnotationBarSelectBackgroundColor];
         
         self.leftButton = [[UIButton alloc] init];
         [self.leftButton setImage:[UIImage imageNamed:@"CPDFStampTextImageLeft" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
         [self.leftButton addTarget:self action:@selector(buttonItemClicked_select:) forControlEvents:UIControlEventTouchUpInside];
         self.leftButton.tag = 1;
         [self.shapeView addSubview:self.leftButton];
+        [self.buttonArray addObject:self.leftButton];
         
         self.rightButton = [[UIButton alloc] init];
         [self.rightButton setImage:[UIImage imageNamed:@"CPDFStampTextImageRight" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
         [self.rightButton addTarget:self action:@selector(buttonItemClicked_select:) forControlEvents:UIControlEventTouchUpInside];
         self.rightButton.tag = 2;
         [self.shapeView addSubview:self.rightButton];
+        [self.buttonArray addObject:self.rightButton];
         
         self.noneButton = [[UIButton alloc] init];
         [self.noneButton setImage:[UIImage imageNamed:@"CPDFStampTextImageNone" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
         [self.noneButton addTarget:self action:@selector(buttonItemClicked_select:) forControlEvents:UIControlEventTouchUpInside];
         self.noneButton.tag = 3;
         [self.shapeView addSubview:self.noneButton];
+        [self.buttonArray addObject:self.noneButton];
     }
     return self;
 }
@@ -84,6 +96,11 @@
 #pragma mark - Action
 
 - (void)buttonItemClicked_select:(UIButton *)button {
+    for (int j = 0; j < self.buttonArray.count; j++) {
+        ((UIButton *)self.buttonArray[j]).backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
+    }
+    ((UIButton *)self.buttonArray[button.tag]).backgroundColor = [CPDFColorUtils CAnnotationBarSelectBackgroundColor];
+    
     if (self.delegate && [self.delegate respondsToSelector:@selector(stampShapView:tag:)]) {
         [self.delegate stampShapView:self tag:button.tag];
     }

+ 66 - 25
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampTextViewController.m

@@ -17,7 +17,9 @@
 #import "CStampColorSelectView.h"
 #import "CPDFColorPickerView.h"
 
-@interface CStampTextViewController () <CStampColorSelectViewDelegate, CStampShapViewDelegate>
+#import <compdfkit_tools/CPDFColorUtils.h>
+
+@interface CStampTextViewController () <UITextFieldDelegate, CStampColorSelectViewDelegate, CStampShapViewDelegate>
 
 @property (nonatomic, strong) CStampPreview *preView;
 
@@ -45,6 +47,8 @@
 
 @property (nonatomic, assign) NSInteger textStampStyle;
 
+@property (nonatomic, strong) UIScrollView *scrcollView;
+
 @end
 
 @implementation CStampTextViewController
@@ -55,6 +59,7 @@
     self.titleLabel = [[UILabel alloc] init];
     self.titleLabel.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;
     self.titleLabel.text = NSLocalizedString(@"Create Stamp", nil);
+    self.titleLabel.textAlignment = NSTextAlignmentCenter;
     self.titleLabel.font = [UIFont systemFontOfSize:20];
     self.titleLabel.adjustsFontSizeToFitWidth = YES;
     [self.view addSubview:self.titleLabel];
@@ -66,6 +71,11 @@
     [self.doneBtn addTarget:self action:@selector(buttonItemClicked_done:) forControlEvents:UIControlEventTouchUpInside];
     [self.view addSubview:self.doneBtn];
     
+    self.scrcollView = [[UIScrollView alloc] init];
+    self.scrcollView.scrollEnabled = YES;
+    self.scrcollView.backgroundColor = [CPDFColorUtils CAnnotationSampleBackgoundColor];
+    [self.view addSubview:self.scrcollView];
+    
     self.cancelBtn = [[UIButton alloc] init];
     self.cancelBtn.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
     self.cancelBtn.titleLabel.adjustsFontSizeToFitWidth = YES;
@@ -80,76 +90,84 @@
     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;
-    [self.view addSubview:self.preView];
+    [self.scrcollView addSubview:self.preView];
     
     self.stampTextField = [[UITextField alloc] init];
     self.stampTextField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
     self.stampTextField.returnKeyType = UIReturnKeyDone;
     self.stampTextField.clearButtonMode = YES;
-    self.stampTextField.borderStyle = UITextBorderStyleLine;
+    self.stampTextField.layer.borderColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.1].CGColor;
+    self.stampTextField.layer.borderWidth = 1.0;
+    self.stampTextField.delegate = self;
+    self.stampTextField.borderStyle = UITextBorderStyleNone;
     [self.stampTextField addTarget:self action:@selector(textFieldEditChange:) forControlEvents:UIControlEventEditingChanged];
     self.stampTextField.placeholder = NSLocalizedString(@"Example Text", nil);
-    [self.view addSubview:self.stampTextField];
+    [self.scrcollView addSubview:self.stampTextField];
     
     self.colorView = [[CStampColorSelectView alloc] init];
     self.colorView.delegate = self;
     self.colorView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
-    [self.view addSubview:self.colorView];
+    [self.scrcollView addSubview:self.colorView];
     
     self.stampShapeViw = [[CStampShapView alloc] init];
     self.stampShapeViw.delegate = self;
     self.stampShapeViw.autoresizingMask = UIViewAutoresizingFlexibleWidth;
-    [self.view addSubview:self.stampShapeViw];
+    [self.scrcollView addSubview:self.stampShapeViw];
     
     self.dateLabel = [[UILabel alloc] init];
     self.dateLabel.text = NSLocalizedString(@"Date", nil);
+    self.dateLabel.textColor = [UIColor grayColor];
     self.dateLabel.font = [UIFont systemFontOfSize:12.0];
-    [self.view addSubview:self.dateLabel];
+    [self.scrcollView addSubview:self.dateLabel];
     
     self.haveDateSwitch = [[UISwitch alloc] init];
     [self.haveDateSwitch setOn:NO animated:NO];
     self.haveDateSwitch.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
     [self.haveDateSwitch addTarget:self action:@selector(switchChange_date:) forControlEvents:UIControlEventValueChanged];
-    [self.view addSubview:self.haveDateSwitch];
+    [self.scrcollView addSubview:self.haveDateSwitch];
     
     self.timeLabel = [[UILabel alloc] init];
     self.timeLabel.text = NSLocalizedString(@"Time", nil);
+    self.timeLabel.textColor = [UIColor grayColor];
     self.timeLabel.font = [UIFont systemFontOfSize:12.0];
     self.timeLabel.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;
-    [self.view addSubview:self.timeLabel];
+    [self.scrcollView addSubview:self.timeLabel];
     
     self.haveTimeSwitch = [[UISwitch alloc] init];
     [self.haveTimeSwitch setOn:NO animated:NO];
     self.haveTimeSwitch.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
     [self.haveDateSwitch addTarget:self action:@selector(switchChange_time:) forControlEvents:UIControlEventValueChanged];
-    [self.view addSubview:self.haveTimeSwitch];
+    [self.scrcollView addSubview:self.haveTimeSwitch];
     
-    self.view.backgroundColor = [UIColor whiteColor];
+    self.view.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
     [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
 }
 
 - (void)viewWillLayoutSubviews {
     [super viewWillLayoutSubviews];
     self.titleLabel.frame = CGRectMake((self.view.frame.size.width - 120)/2, 5, 120, 50);
-    self.preView.frame  = CGRectMake((self.view.frame.size.width - 350)/2, 60, 350, 120);
-    self.stampTextField.frame = CGRectMake((self.view.frame.size.width - 350)/2, 190, 350, 30);
+    
+    self.scrcollView.frame = CGRectMake(0, 50, self.view.frame.size.width, 560);
+    self.scrcollView.contentSize = CGSizeMake(self.view.frame.size.width, 700);
+    self.preView.frame  = CGRectMake((self.view.frame.size.width - 350)/2, 15, 350, 120);
+    self.stampTextField.frame = CGRectMake((self.view.frame.size.width - 350)/2, 150, 350, 30);
     
     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, 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);
+        self.stampShapeViw.frame = CGRectMake(self.view.safeAreaInsets.left, 180,self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 90);
+        self.colorView.frame = CGRectMake(self.view.safeAreaInsets.left, 270,self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 60);
+        self.dateLabel.frame = CGRectMake(self.view.safeAreaInsets.left+20, 330, 80, 50);
+        self.haveDateSwitch.frame = CGRectMake(self.view.frame.size.width - 80- self.view.safeAreaInsets.right, 330, 60, 50);
+        self.timeLabel.frame = CGRectMake(self.view.safeAreaInsets.left+20, 380, 100, 45);
+        self.haveTimeSwitch.frame = CGRectMake(self.view.frame.size.width - 80- self.view.safeAreaInsets.right, 380, 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);
-        self.dateLabel.frame = CGRectMake(15, 430, 80, 50);
-        self.haveDateSwitch.frame = CGRectMake(self.view.frame.size.width - 75, 430, 60, 50);
-        self.timeLabel.frame = CGRectMake(15, 480, 100, 45);
-        self.haveTimeSwitch.frame = CGRectMake(self.view.frame.size.width - 75, 480, 60, 50);
+        self.colorView.frame = CGRectMake(0, 270, self.view.frame.size.width, ((self.view.frame.size.height)/9)*2);
+        self.stampShapeViw.frame = CGRectMake(0, 180, self.view.frame.size.width, ((self.view.frame.size.height)/9)*2);
+        self.dateLabel.frame = CGRectMake(20, 330, 80, 50);
+        self.haveDateSwitch.frame = CGRectMake(self.view.frame.size.width - 80, 330, 60, 50);
+        self.timeLabel.frame = CGRectMake(20, 380, 100, 45);
+        self.haveTimeSwitch.frame = CGRectMake(self.view.frame.size.width - 80, 380, 60, 50);
     }
 }
 
@@ -212,6 +230,29 @@
     [self.preView setNeedsDisplay];
 }
 
+#pragma mark - UITextFieldDelegate
+
+- (void)textFieldDidBeginEditing:(UITextField *)textField {
+    if (UIInterfaceOrientationIsPortrait([UIApplication sharedApplication].statusBarOrientation)) {
+        self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, 800);
+    } else {
+
+    }
+}
+
+- (void)textFieldDidEndEditing:(UITextField *)textField {
+    if (UIInterfaceOrientationIsPortrait([UIApplication sharedApplication].statusBarOrientation)) {
+        self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, 560);
+    } else {
+
+    }
+}
+
+- (BOOL)textFieldShouldReturn:(UITextField *)textField {
+    [textField resignFirstResponder];
+    return YES;
+}
+
 #pragma mark - CStampShapViewDelegate
 
 - (void)stampShapView:(CStampShapView *)stampShapView tag:(NSInteger)tag {

+ 9 - 8
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImageImage.imageset/Contents.json

@@ -2,16 +2,17 @@
   "images" : [
     {
       "filename" : "Group (1).pdf",
-      "idiom" : "universal",
-      "scale" : "1x"
+      "idiom" : "universal"
     },
     {
-      "idiom" : "universal",
-      "scale" : "2x"
-    },
-    {
-      "idiom" : "universal",
-      "scale" : "3x"
+      "appearances" : [
+        {
+          "appearance" : "luminosity",
+          "value" : "dark"
+        }
+      ],
+      "filename" : "image.pdf",
+      "idiom" : "universal"
     }
   ],
   "info" : {

+ 87 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImageImage.imageset/image.pdf

@@ -0,0 +1,87 @@
+%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 1.000000 2.599976 cm
+1.000000 1.000000 1.000000 scn
+0.000000 10.800049 m
+14.000000 10.800049 l
+14.000000 0.000049 l
+0.000000 0.000049 l
+0.000000 10.800049 l
+h
+12.800000 9.600055 m
+1.200000 9.600055 l
+1.200000 2.832473 l
+3.635965 5.400055 l
+7.051426 2.600055 l
+8.897479 4.545850 l
+12.715345 1.200054 l
+12.800000 1.200054 l
+12.800000 9.600055 l
+h
+10.600000 6.200055 m
+11.262742 6.200055 11.800001 6.737313 11.800001 7.400055 c
+11.800001 8.062797 11.262742 8.600055 10.600000 8.600055 c
+9.937259 8.600055 9.400001 8.062797 9.400001 7.400055 c
+9.400001 6.737313 9.937259 6.200055 10.600000 6.200055 c
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  673
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 16.000000 16.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
+0000000763 00000 n
+0000000785 00000 n
+0000000958 00000 n
+0000001032 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+1091
+%%EOF

+ 9 - 8
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImageText.imageset/Contents.json

@@ -2,16 +2,17 @@
   "images" : [
     {
       "filename" : "Group.pdf",
-      "idiom" : "universal",
-      "scale" : "1x"
+      "idiom" : "universal"
     },
     {
-      "idiom" : "universal",
-      "scale" : "2x"
-    },
-    {
-      "idiom" : "universal",
-      "scale" : "3x"
+      "appearances" : [
+        {
+          "appearance" : "luminosity",
+          "value" : "dark"
+        }
+      ],
+      "filename" : "ic_subtoolbar_mytools_text.pdf",
+      "idiom" : "universal"
     }
   ],
   "info" : {

+ 83 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImageText.imageset/ic_subtoolbar_mytools_text.pdf

@@ -0,0 +1,83 @@
+%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 3.250000 2.250000 cm
+1.000000 1.000000 1.000000 scn
+13.500000 15.000000 m
+13.500000 11.750000 l
+12.000000 11.750000 l
+12.000000 13.500000 l
+7.500000 13.500000 l
+7.500000 1.500000 l
+9.083658 1.500000 l
+9.083658 0.000000 l
+4.416992 0.000000 l
+4.416992 1.500000 l
+6.000000 1.500000 l
+6.000000 13.500000 l
+1.500000 13.500000 l
+1.500000 11.750000 l
+0.000000 11.750000 l
+0.000000 15.000000 l
+13.500000 15.000000 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  484
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 20.000000 20.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
+0000000574 00000 n
+0000000596 00000 n
+0000000769 00000 n
+0000000843 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+902
+%%EOF

+ 10 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampTextImageCenter.imageset/Contents.json

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

BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampTextImageCenter.imageset/ic_subtoolbar_mytools_rec.png


+ 10 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampTextImageLeft.imageset/Contents.json

@@ -3,6 +3,16 @@
     {
       "filename" : "With Label (1).pdf",
       "idiom" : "universal"
+    },
+    {
+      "appearances" : [
+        {
+          "appearance" : "luminosity",
+          "value" : "dark"
+        }
+      ],
+      "filename" : "Property 2=right.pdf",
+      "idiom" : "universal"
     }
   ],
   "info" : {

+ 154 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampTextImageLeft.imageset/Property 2=right.pdf

@@ -0,0 +1,154 @@
+%PDF-1.7
+
+1 0 obj
+  << >>
+endobj
+
+2 0 obj
+  << /Length 3 0 R >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+6.200154 15.640184 m
+6.390148 15.868177 6.671595 16.000000 6.968375 16.000000 c
+17.500000 16.000000 l
+18.052284 16.000000 18.500000 15.552284 18.500000 15.000000 c
+18.500000 5.000000 l
+18.500000 4.447715 18.052284 4.000000 17.500000 4.000000 c
+6.968375 4.000000 l
+6.671596 4.000000 6.390148 4.131823 6.200154 4.359816 c
+2.033487 9.359816 l
+1.724448 9.730661 1.724449 10.269339 2.033487 10.640184 c
+6.200154 15.640184 l
+h
+W*
+n
+q
+1.000000 0.000000 -0.000000 1.000000 1.500000 4.000000 cm
+1.000000 1.000000 1.000000 scn
+0.533487 6.640184 m
+-0.618845 7.600461 l
+0.533487 6.640184 l
+h
+4.700154 0.359816 m
+3.547822 -0.600461 l
+3.547822 -0.600461 l
+4.700154 0.359816 l
+h
+4.700154 11.640184 m
+3.547822 12.600462 l
+4.700154 11.640184 l
+h
+5.468375 10.500000 m
+16.000000 10.500000 l
+16.000000 13.500000 l
+5.468375 13.500000 l
+5.468375 10.500000 l
+h
+15.500000 11.000000 m
+15.500000 1.000000 l
+18.500000 1.000000 l
+18.500000 11.000000 l
+15.500000 11.000000 l
+h
+16.000000 1.500000 m
+5.468375 1.500000 l
+5.468375 -1.500000 l
+16.000000 -1.500000 l
+16.000000 1.500000 l
+h
+5.852486 1.320092 m
+1.685819 6.320093 l
+-0.618845 4.399539 l
+3.547822 -0.600461 l
+5.852486 1.320092 l
+h
+1.685819 5.679908 m
+5.852486 10.679909 l
+3.547822 12.600462 l
+-0.618845 7.600461 l
+1.685819 5.679908 l
+h
+1.685819 6.320093 m
+1.840338 6.134669 1.840337 5.865330 1.685819 5.679908 c
+-0.618845 7.600461 l
+-1.391440 6.673347 -1.391442 5.326655 -0.618845 4.399539 c
+1.685819 6.320093 l
+h
+5.468375 1.500000 m
+5.616765 1.500000 5.757488 1.434089 5.852486 1.320092 c
+3.547822 -0.600461 l
+4.022807 -1.170443 4.726426 -1.500000 5.468375 -1.500000 c
+5.468375 1.500000 l
+h
+15.500000 1.000000 m
+15.500000 1.276143 15.723858 1.500000 16.000000 1.500000 c
+16.000000 -1.500000 l
+17.380711 -1.500000 18.500000 -0.380713 18.500000 1.000000 c
+15.500000 1.000000 l
+h
+16.000000 10.500000 m
+15.723857 10.500000 15.500000 10.723858 15.500000 11.000000 c
+18.500000 11.000000 l
+18.500000 12.380712 17.380713 13.500000 16.000000 13.500000 c
+16.000000 10.500000 l
+h
+5.468375 13.500000 m
+4.726426 13.500000 4.022807 13.170444 3.547822 12.600462 c
+5.852486 10.679909 l
+5.757488 10.565911 5.616764 10.500000 5.468375 10.500000 c
+5.468375 13.500000 l
+h
+f
+n
+Q
+Q
+
+endstream
+endobj
+
+3 0 obj
+  2219
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 20.000000 20.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
+0000002309 00000 n
+0000002332 00000 n
+0000002505 00000 n
+0000002579 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+2638
+%%EOF

+ 10 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampTextImageNone.imageset/Contents.json

@@ -3,6 +3,16 @@
     {
       "filename" : "With Label (3).pdf",
       "idiom" : "universal"
+    },
+    {
+      "appearances" : [
+        {
+          "appearance" : "luminosity",
+          "value" : "dark"
+        }
+      ],
+      "filename" : "ic_subtoolbar_mytools_line.pdf",
+      "idiom" : "universal"
     }
   ],
   "info" : {

+ 71 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampTextImageNone.imageset/ic_subtoolbar_mytools_line.pdf

@@ -0,0 +1,71 @@
+%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 2.469727 1.469604 cm
+1.000000 1.000000 1.000000 scn
+14.000000 15.060669 m
+15.060660 14.000009 l
+1.060660 0.000009 l
+0.000000 1.060669 l
+14.000000 15.060669 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  234
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 20.000000 20.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
+0000000324 00000 n
+0000000346 00000 n
+0000000519 00000 n
+0000000593 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+652
+%%EOF

+ 11 - 1
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampTextImageRight.imageset/Contents.json

@@ -1,7 +1,17 @@
 {
   "images" : [
     {
-      "filename" : "With Label (2).pdf",
+      "filename" : "Property 2=left.pdf",
+      "idiom" : "universal"
+    },
+    {
+      "appearances" : [
+        {
+          "appearance" : "luminosity",
+          "value" : "dark"
+        }
+      ],
+      "filename" : "Property 2=left 1.pdf",
       "idiom" : "universal"
     }
   ],

+ 154 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampTextImageRight.imageset/Property 2=left 1.pdf

@@ -0,0 +1,154 @@
+%PDF-1.7
+
+1 0 obj
+  << >>
+endobj
+
+2 0 obj
+  << /Length 3 0 R >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+13.799846 15.640184 m
+13.609852 15.868177 13.328405 16.000000 13.031626 16.000000 c
+2.500000 16.000000 l
+1.947716 16.000000 1.500000 15.552284 1.500000 15.000000 c
+1.500000 5.000000 l
+1.500000 4.447715 1.947716 4.000000 2.500000 4.000000 c
+13.031625 4.000000 l
+13.328404 4.000000 13.609852 4.131823 13.799847 4.359816 c
+17.966513 9.359816 l
+18.275551 9.730661 18.275551 10.269339 17.966513 10.640184 c
+13.799846 15.640184 l
+h
+W*
+n
+q
+-1.000000 -0.000000 -0.000000 1.000000 18.500000 4.000000 cm
+1.000000 1.000000 1.000000 scn
+0.533487 6.640184 m
+-0.618845 7.600461 l
+0.533487 6.640184 l
+h
+4.700154 0.359816 m
+3.547822 -0.600461 l
+3.547822 -0.600461 l
+4.700154 0.359816 l
+h
+4.700154 11.640184 m
+3.547822 12.600462 l
+4.700154 11.640184 l
+h
+5.468375 10.500000 m
+16.000000 10.500000 l
+16.000000 13.500000 l
+5.468375 13.500000 l
+5.468375 10.500000 l
+h
+15.500000 11.000000 m
+15.500000 1.000000 l
+18.500000 1.000000 l
+18.500000 11.000000 l
+15.500000 11.000000 l
+h
+16.000000 1.500000 m
+5.468375 1.500000 l
+5.468375 -1.500000 l
+16.000000 -1.500000 l
+16.000000 1.500000 l
+h
+5.852486 1.320092 m
+1.685819 6.320093 l
+-0.618845 4.399539 l
+3.547822 -0.600461 l
+5.852486 1.320092 l
+h
+1.685819 5.679908 m
+5.852486 10.679909 l
+3.547822 12.600462 l
+-0.618845 7.600461 l
+1.685819 5.679908 l
+h
+1.685819 6.320093 m
+1.840338 6.134669 1.840337 5.865330 1.685819 5.679908 c
+-0.618845 7.600461 l
+-1.391440 6.673347 -1.391442 5.326655 -0.618845 4.399539 c
+1.685819 6.320093 l
+h
+5.468375 1.500000 m
+5.616765 1.500000 5.757488 1.434089 5.852486 1.320092 c
+3.547822 -0.600461 l
+4.022807 -1.170443 4.726426 -1.500000 5.468375 -1.500000 c
+5.468375 1.500000 l
+h
+15.500000 1.000000 m
+15.500000 1.276143 15.723858 1.500000 16.000000 1.500000 c
+16.000000 -1.500000 l
+17.380711 -1.500000 18.500000 -0.380713 18.500000 1.000000 c
+15.500000 1.000000 l
+h
+16.000000 10.500000 m
+15.723857 10.500000 15.500000 10.723858 15.500000 11.000000 c
+18.500000 11.000000 l
+18.500000 12.380712 17.380713 13.500000 16.000000 13.500000 c
+16.000000 10.500000 l
+h
+5.468375 13.500000 m
+4.726426 13.500000 4.022807 13.170444 3.547822 12.600462 c
+5.852486 10.679909 l
+5.757488 10.565911 5.616764 10.500000 5.468375 10.500000 c
+5.468375 13.500000 l
+h
+f
+n
+Q
+Q
+
+endstream
+endobj
+
+3 0 obj
+  2227
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 20.000000 20.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
+0000002317 00000 n
+0000002340 00000 n
+0000002513 00000 n
+0000002587 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+2646
+%%EOF

+ 19 - 35
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampTextImageRight.imageset/With Label (2).pdf

@@ -10,38 +10,22 @@ stream
 /DeviceRGB CS
 /DeviceRGB cs
 q
-1.000000 0.000000 -0.000000 1.000000 5.000000 5.000000 cm
-0.866667 0.912108 1.000000 scn
-0.000000 26.000000 m
-0.000000 28.209139 1.790861 30.000000 4.000000 30.000000 c
-26.000000 30.000000 l
-28.209139 30.000000 30.000000 28.209139 30.000000 26.000000 c
-30.000000 4.000000 l
-30.000000 1.790861 28.209139 0.000000 26.000000 0.000000 c
-4.000000 0.000000 l
-1.790861 0.000000 0.000000 1.790861 0.000000 4.000000 c
-0.000000 26.000000 l
-h
-f
-n
-Q
-q
-23.799847 25.640184 m
-23.609852 25.868177 23.328405 26.000000 23.031626 26.000000 c
-12.500000 26.000000 l
-11.947716 26.000000 11.500000 25.552284 11.500000 25.000000 c
-11.500000 15.000000 l
-11.500000 14.447716 11.947716 14.000000 12.500000 14.000000 c
-23.031624 14.000000 l
-23.328403 14.000000 23.609852 14.131823 23.799847 14.359816 c
-27.966513 19.359816 l
-28.275551 19.730661 28.275551 20.269339 27.966513 20.640184 c
-23.799847 25.640184 l
+13.799846 15.640184 m
+13.609852 15.868177 13.328405 16.000000 13.031626 16.000000 c
+2.500000 16.000000 l
+1.947716 16.000000 1.500000 15.552284 1.500000 15.000000 c
+1.500000 5.000000 l
+1.500000 4.447715 1.947716 4.000000 2.500000 4.000000 c
+13.031625 4.000000 l
+13.328404 4.000000 13.609852 4.131823 13.799847 4.359816 c
+17.966513 9.359816 l
+18.275551 9.730661 18.275551 10.269339 17.966513 10.640184 c
+13.799846 15.640184 l
 h
 W*
 n
 q
--1.000000 -0.000000 -0.000000 1.000000 28.500000 14.000000 cm
+-1.000000 -0.000000 -0.000000 1.000000 18.500000 4.000000 cm
 0.262745 0.278431 0.301961 scn
 0.533487 6.640184 m
 -0.618845 7.600461 l
@@ -125,13 +109,13 @@ endstream
 endobj
 
 3 0 obj
-  2686
+  2227
 endobj
 
 4 0 obj
   << /Annots []
      /Type /Page
-     /MediaBox [ 0.000000 0.000000 40.000000 40.000000 ]
+     /MediaBox [ 0.000000 0.000000 20.000000 20.000000 ]
      /Resources 1 0 R
      /Contents 2 0 R
      /Parent 5 0 R
@@ -156,15 +140,15 @@ xref
 0000000000 65535 f
 0000000010 00000 n
 0000000034 00000 n
-0000002776 00000 n
-0000002799 00000 n
-0000002972 00000 n
-0000003046 00000 n
+0000002317 00000 n
+0000002340 00000 n
+0000002513 00000 n
+0000002587 00000 n
 trailer
 << /ID [ (some) (id) ]
    /Root 6 0 R
    /Size 7
 >>
 startxref
-3105
+2646
 %%EOF

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

@@ -25,6 +25,7 @@ typedef NS_ENUM(NSInteger, CPDFToolbarSelectedIndex) {
     CPDFToolbarShapeArrow,
     CPDFToolbarShapeLine,
     CPDFToolbarFreehand,
+    CPDFToolbarPencilDrawing,
     CPDFToolbarFreeText,
     CPDFToolbarSignature,
     CPDFToolbarStamp,

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

@@ -133,8 +133,8 @@
     
     CGFloat offsetX = 10.0;
     CGFloat buttonOffset = 15;
-    CGFloat buttonSize = 30;
-    CGFloat topOffset = (44 - buttonSize)/2;
+    CGFloat buttonSize = 44;
+    CGFloat topOffset = (46 - buttonSize)/2;
 
     NSArray *images = @[@"CPDFAnnotationBarImageNote",
                         @"CPDFAnnotationBarImageHighLight",
@@ -142,6 +142,7 @@
                         @"CPDFAnnotationBarImageStrikeout",
                         @"CPDFAnnotationBarImageSquiggly",
                         @"CPDFAnnotationBarImageFreehand",
+                        @"CPDFAnnotationBarImagePencilDraw",
                         @"CPDFAnnotationBarImageShapeCircle",
                         @"CPDFAnnotationBarImageShapeRectangle",
                         @"CPDFAnnotationBarImageShapeArrow",
@@ -159,6 +160,7 @@
                        @(CPDFViewAnnotationModeStrikeout),
                        @(CPDFViewAnnotationModeSquiggly),
                        @(CPDFViewAnnotationModeInk),
+                       @(CPDFViewAnnotationModePencilDrawing),
                        @(CPDFViewAnnotationModeCircle),
                        @(CPDFViewAnnotationModeSquare),
                        @(CPDFViewAnnotationModeArrow),
@@ -206,7 +208,7 @@
     }
     [self.scrollView bringSubviewToFront:self.propertiesBar];
     
-    _propertiesBar = [[UIView alloc] initWithFrame:CGRectMake(self.bounds.size.width - 104, 0, 104, 44)];
+    _propertiesBar = [[UIView alloc] initWithFrame:CGRectMake(self.bounds.size.width - 150, 0, 140, 44)];
     _propertiesBar.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
     [self addSubview:self.propertiesBar];
     
@@ -416,6 +418,8 @@
 
 - (void)createPropertyViewController {
     if (CPDFViewAnnotationModeInk == self.selectedIndex) {
+        [CPDFKitConfig  sharedInstance].enableFreehandPencilKit = 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.delegate = self;
@@ -447,6 +451,14 @@
         [self createImageAnnotaion];
     } else if (CPDFViewAnnotationModeLink == self.selectedIndex) {
         self.propertiesBtn.enabled = NO;
+    } else if (CPDFViewAnnotationModeSound == self.selectedIndex) {
+  
+    } else if (CPDFViewAnnotationModePencilDrawing == self.selectedIndex) {
+        if (@available(iOS 13.0, *)) {
+            [CPDFKitConfig  sharedInstance].enableFreehandPencilKit = YES;
+        } else {
+            [CPDFKitConfig  sharedInstance].enableFreehandPencilKit = NO;
+        }
     }
 }
 
@@ -536,12 +548,19 @@
     CPDFSignatureAnnotation *annotation = [[CPDFSignatureAnnotation alloc] initWithDocument:self.annotManage.pdfListView.document];
     [annotation setImage:image];
     [self.annotManage.pdfListView addAnnotation:annotation];
+    
+    self.pdfListView.annotationMode = CPDFViewAnnotationModeNone;
+    self.annotManage.pdfListView.annotationMode = CPDFViewAnnotationModeNone;
+    [self reloadData];
 }
 
 #pragma mark - CPDFSignatureEditViewControllerDelegate
 
 - (void)signatureEditViewController:(CPDFSignatureEditViewController *)signatureEditViewController image:(UIImage *)image{
     [[CSignatureManager sharedManager] addImageSignature:image];
+    self.pdfListView.annotationMode = CPDFViewAnnotationModeNone;
+    self.annotManage.pdfListView.annotationMode = CPDFViewAnnotationModeNone;
+    [self reloadData];
     [self.signatureVC.tableView reloadData];
 }
 

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

@@ -1,7 +1,7 @@
 {
   "images" : [
     {
-      "filename" : "note.pdf",
+      "filename" : "ic_subtoolbar_mytools_note.pdf",
       "idiom" : "universal"
     }
   ],

compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageNote.imageset/note.pdf → compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageNote.imageset/ic_subtoolbar_mytools_note.pdf


+ 12 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImagePencilDraw.imageset/Contents.json

@@ -0,0 +1,12 @@
+{
+  "images" : [
+    {
+      "filename" : "pencil.pdf",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 99 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImagePencilDraw.imageset/pencil.pdf

@@ -0,0 +1,99 @@
+%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 1.250000 1.250000 cm
+0.262745 0.278431 0.301961 scn
+8.750000 16.000000 m
+4.745935 16.000000 1.500000 12.754065 1.500000 8.750000 c
+1.500000 6.455398 2.565989 4.409769 4.229763 3.081322 c
+4.986542 7.243610 l
+5.016206 7.406761 5.068908 7.564867 5.143067 7.713185 c
+7.184752 11.796556 l
+7.829670 13.086392 9.670331 13.086390 10.315248 11.796556 c
+12.356933 7.713185 l
+12.431091 7.564868 12.483793 7.406763 12.513458 7.243610 c
+13.270238 3.081322 l
+14.934011 4.409769 16.000000 6.455398 16.000000 8.750000 c
+16.000000 12.754065 12.754065 16.000000 8.750000 16.000000 c
+h
+8.750000 1.500000 m
+7.620227 1.500000 6.550811 1.758416 5.597635 2.219365 c
+6.462348 6.975283 l
+6.463864 6.983624 6.465802 6.991874 6.468152 7.000000 c
+11.031848 6.999999 l
+11.034198 6.991874 11.036136 6.983624 11.037653 6.975284 c
+11.902365 2.219365 l
+10.949189 1.758416 9.879772 1.500000 8.750000 1.500000 c
+h
+10.286475 8.499999 m
+8.973607 11.125735 l
+8.881475 11.309999 8.618525 11.309998 8.526394 11.125736 c
+7.213525 8.500000 l
+10.286475 8.499999 l
+h
+0.000000 8.750000 m
+0.000000 13.582492 3.917508 17.500000 8.750000 17.500000 c
+13.582492 17.500000 17.500000 13.582492 17.500000 8.750000 c
+17.500000 3.917508 13.582492 0.000000 8.750000 0.000000 c
+3.917508 0.000000 0.000000 3.917508 0.000000 8.750000 c
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  1353
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 20.000000 20.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
+0000001443 00000 n
+0000001466 00000 n
+0000001639 00000 n
+0000001713 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+1772
+%%EOF

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

@@ -50,7 +50,7 @@
         self.colorLabel.font = [UIFont systemFontOfSize:12.0];
         [self addSubview:self.colorLabel];
         
-        self.colorArray = [NSMutableArray array];;
+        self.colorArray = [NSMutableArray array];
         
         self.colorPickerView = [[UIView alloc] initWithFrame:CGRectMake(0, 30, self.bounds.size.width, 60)];
         self.colorPickerView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
@@ -99,7 +99,7 @@
 - (void)layoutSubviews {
     [super layoutSubviews];
     self.colorLabel.frame = CGRectMake(20, 0, 50, self.bounds.size.height/3);
-    self.colorPickerView.frame = CGRectMake(8, self.bounds.size.height/3, self.bounds.size.width-16, (self.bounds.size.height/3)*2);
+    self.colorPickerView.frame = CGRectMake(8, self.bounds.size.height/3, self.bounds.size.width-16, 60);
     [self pickerBarInit];
 }
 

+ 1 - 1
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFFontStyleTableView.m

@@ -31,7 +31,7 @@
 - (NSArray *)dataArray {
     if (!_dataArray) {
         NSMutableArray *dataArray = [NSMutableArray array];
-        NSArray *fontNameArray = [[NSArray alloc] initWithObjects:@"Helvetica",@"Arial",@"Arial Rounded MT Bold",@"Courier",nil];
+        NSArray *fontNameArray = [[NSArray alloc] initWithObjects:@"Helvetica",@"Courier",@"Times-Roman",nil];
         
         for (int i = 0; i < fontNameArray.count; i++) {
             [dataArray addObject:fontNameArray[i]];

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

@@ -33,6 +33,7 @@ typedef NS_ENUM(NSInteger, CPDFViewAnnotationMode) {
     CPDFViewAnnotationModeArrow,
     CPDFViewAnnotationModeLine,
     CPDFViewAnnotationModeInk,
+    CPDFViewAnnotationModePencilDrawing, // API_AVAILABLE(ios(13.0))
     CPDFViewAnnotationModeFreeText,
     CPDFViewAnnotationModeSignature,
     CPDFViewAnnotationModeStamp,

+ 0 - 1
viewer-ctrl-demo/viewer-ctrl-demo/CPDFViewController.m

@@ -102,7 +102,6 @@
         }
     }
     
-    
     CGFloat tPosY = 0;
     CGFloat bottomY = 0;
     CGFloat height = 0;