Browse Source

PDFView(iOS) - 文案修改

yangliuhua 1 year ago
parent
commit
c86542d7ce
21 changed files with 341 additions and 16 deletions
  1. 12 0
      compdfkit-tools/compdfkit-tools.xcodeproj/project.pbxproj
  2. 0 1
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFBase/CPDFAnnotationBaseViewController.m
  3. 1 1
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CPDFSignatureViewCell.m
  4. 6 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CPDFSignatureViewController.h
  5. 101 1
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CPDFSignatureViewController.m
  6. 29 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CSignatureManager.h
  7. 99 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CSignatureManager.m
  8. 22 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/Image.xcassets/CPDFSignatureImageAdd.imageset/Contents.json
  9. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/Image.xcassets/CPDFSignatureImageAdd.imageset/signature_icon_add.png
  10. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/Image.xcassets/CPDFSignatureImageAdd.imageset/signature_icon_add@2x.png
  11. 23 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/Image.xcassets/CPDFSignatureImageEmpty.imageset/Contents.json
  12. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/Image.xcassets/CPDFSignatureImageEmpty.imageset/signature_img_empty.png
  13. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/Image.xcassets/CPDFSignatureImageEmpty.imageset/signature_img_empty@2x.png
  14. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/Image.xcassets/CPDFSignatureImageEmpty.imageset/signature_img_empty@3x.png
  15. 6 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/Image.xcassets/Contents.json
  16. 10 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/CPDFAnnotationBar.m
  17. 4 4
      compdfkit-tools/compdfkit-tools/Common/Views/PDFView/PDFListView/CPDFListView.m
  18. 23 4
      compdfkit-tools/compdfkit-tools/Viewer/PDFBookmark/CPDFBookmarkViewController.m
  19. 1 1
      compdfkit-tools/compdfkit-tools/Viewer/PDFMore/CPDFMoreListViewController.m
  20. 3 3
      compdfkit-tools/compdfkit-tools/Viewer/PDFMore/PDFInfo/CPDFInfoViewController.m
  21. 1 1
      compdfkit-tools/compdfkit-tools/Viewer/PDFSearch/CSearchToolbar.m

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

@@ -75,6 +75,9 @@
 		C91BE7D92A039D2A0038F2BC /* CPDFSignatureViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = C91BE7D72A039D2A0038F2BC /* CPDFSignatureViewCell.m */; };
 		C91BE7DC2A039E900038F2BC /* CPDFSignatureEditViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = C91BE7DA2A039E900038F2BC /* CPDFSignatureEditViewController.h */; };
 		C91BE7DD2A039E900038F2BC /* CPDFSignatureEditViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C91BE7DB2A039E900038F2BC /* CPDFSignatureEditViewController.m */; };
+		C91BE7DF2A03CF080038F2BC /* Image.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C91BE7DE2A03CF080038F2BC /* Image.xcassets */; };
+		C91BE7E22A048F1A0038F2BC /* CSignatureManager.h in Headers */ = {isa = PBXBuildFile; fileRef = C91BE7E02A048F1A0038F2BC /* CSignatureManager.h */; };
+		C91BE7E32A048F1A0038F2BC /* CSignatureManager.m in Sources */ = {isa = PBXBuildFile; fileRef = C91BE7E12A048F1A0038F2BC /* CSignatureManager.m */; };
 		C9AF182629EE8AB600EC4979 /* UtilsColor.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C9AF182529EE8AB600EC4979 /* UtilsColor.xcassets */; };
 		C9AF182C29EFB1FC00EC4979 /* CPDFBookmarkViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = C9AF182A29EFB1FC00EC4979 /* CPDFBookmarkViewCell.h */; };
 		C9AF182D29EFB1FC00EC4979 /* CPDFBookmarkViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = C9AF182B29EFB1FC00EC4979 /* CPDFBookmarkViewCell.m */; };
@@ -235,6 +238,9 @@
 		C91BE7D72A039D2A0038F2BC /* CPDFSignatureViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFSignatureViewCell.m; sourceTree = "<group>"; };
 		C91BE7DA2A039E900038F2BC /* CPDFSignatureEditViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFSignatureEditViewController.h; sourceTree = "<group>"; };
 		C91BE7DB2A039E900038F2BC /* CPDFSignatureEditViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFSignatureEditViewController.m; sourceTree = "<group>"; };
+		C91BE7DE2A03CF080038F2BC /* Image.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Image.xcassets; sourceTree = "<group>"; };
+		C91BE7E02A048F1A0038F2BC /* CSignatureManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CSignatureManager.h; sourceTree = "<group>"; };
+		C91BE7E12A048F1A0038F2BC /* CSignatureManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CSignatureManager.m; sourceTree = "<group>"; };
 		C9AF182529EE8AB600EC4979 /* UtilsColor.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = UtilsColor.xcassets; sourceTree = "<group>"; };
 		C9AF182A29EFB1FC00EC4979 /* CPDFBookmarkViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFBookmarkViewCell.h; sourceTree = "<group>"; };
 		C9AF182B29EFB1FC00EC4979 /* CPDFBookmarkViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFBookmarkViewCell.m; sourceTree = "<group>"; };
@@ -487,6 +493,9 @@
 				C91BE7D72A039D2A0038F2BC /* CPDFSignatureViewCell.m */,
 				C91BE7DA2A039E900038F2BC /* CPDFSignatureEditViewController.h */,
 				C91BE7DB2A039E900038F2BC /* CPDFSignatureEditViewController.m */,
+				C91BE7E02A048F1A0038F2BC /* CSignatureManager.h */,
+				C91BE7E12A048F1A0038F2BC /* CSignatureManager.m */,
+				C91BE7DE2A03CF080038F2BC /* Image.xcassets */,
 			);
 			path = PDFSignature;
 			sourceTree = "<group>";
@@ -898,6 +907,7 @@
 				4F6C796A29FBD532008C9501 /* CPDFEditFontNameSelectView.h in Headers */,
 				C91BE7CD2A037A490038F2BC /* CPDFInkTopToolBar.h in Headers */,
 				C918CEA529F8FC1800D43974 /* CPDFUnderlineViewController.h in Headers */,
+				C91BE7E22A048F1A0038F2BC /* CSignatureManager.h in Headers */,
 				C91BE7D82A039D2A0038F2BC /* CPDFSignatureViewCell.h in Headers */,
 				C918CECE29FA43B800D43974 /* CPDFShapeCircleViewController.h in Headers */,
 				C9AF184129F22BBD00EC4979 /* CPDFAnnotationBarButton.h in Headers */,
@@ -1016,6 +1026,7 @@
 				C918CED829FB5ADF00D43974 /* Image.xcassets in Resources */,
 				F382636C29EFD0D9003F1DFD /* CPDFSliderImage.xcassets in Resources */,
 				4F1131B629F90E7200950564 /* CPDFImagePropertyCell.xib in Resources */,
+				C91BE7DF2A03CF080038F2BC /* Image.xcassets in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -1062,6 +1073,7 @@
 				4F06AB5129F6792E007797E4 /* CPDFEditToolBar.m in Sources */,
 				4F1131B529F90E7200950564 /* CPDFImagePropertyCell.m in Sources */,
 				C918CECF29FA43B800D43974 /* CPDFShapeCircleViewController.m in Sources */,
+				C91BE7E32A048F1A0038F2BC /* CSignatureManager.m in Sources */,
 				F32DA17A29ED904300E19ECA /* CPDFDisplayTableViewCell.m in Sources */,
 				F32DA17D29ED904300E19ECA /* CPDFBOTAViewController.m in Sources */,
 				F32DA19229ED908800E19ECA /* CPDFMoreListViewController.m in Sources */,

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

@@ -66,7 +66,6 @@
     
     self.view.backgroundColor = [UIColor whiteColor];
     [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
-    
     [self commomInitTitle];
 }
 

+ 1 - 1
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CPDFSignatureViewCell.m

@@ -25,7 +25,7 @@
 - (void)layoutSubviews {
     [super layoutSubviews];
     CGFloat height = self.contentView.bounds.size.height;
-    CGFloat width  = height *  self.signatureImageView.image.size.width / self.signatureImageView.image.size.height;
+    CGFloat width  = height * self.signatureImageView.image.size.width / self.signatureImageView.image.size.height;
     width = MIN(width, self.contentView.bounds.size.width - 80.0);
     [self.signatureImageView setFrame:CGRectMake((self.bounds.size.width - width)/2.0, 0.0, width, height)];
     self.signatureImageView.center = self.contentView.center;

+ 6 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CPDFSignatureViewController.h

@@ -14,8 +14,14 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
+@class CAnnotStyle;
+
 @interface CPDFSignatureViewController : UIViewController
 
+@property (nonatomic, readonly) CAnnotStyle *annotStyle;
+
+- (instancetype)initWithStyle:(CAnnotStyle *)annotStyle;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 101 - 1
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CPDFSignatureViewController.m

@@ -11,16 +11,116 @@
 //
 
 #import "CPDFSignatureViewController.h"
+#import "CAnnotStyle.h"
+#import "CPDFSignatureViewCell.h"
 
-@interface CPDFSignatureViewController ()
+@interface CPDFSignatureViewController () <UITableViewDelegate, UITableViewDataSource>
+
+@property (nonatomic, strong) UIButton *backBtn;
+
+@property (nonatomic, strong) UILabel *titleLabel;
+
+@property (nonatomic, strong) CAnnotStyle *annotStyle;
+
+@property (nonatomic, strong) UITableView *tableView;
+
+@property (nonatomic, strong) UIImageView *emptyImageView;
+
+@property (nonatomic, strong) UIButton *createButton;
 
 @end
 
 @implementation CPDFSignatureViewController
 
+#pragma mark - Initializers
+
+- (instancetype)initWithStyle:(CAnnotStyle *)annotStyle {
+    if (self = [super init]) {
+        self.annotStyle = annotStyle;
+    }
+    return self;
+}
+
+#pragma mark - ViewController Methods
+
 - (void)viewDidLoad {
     [super viewDidLoad];
     // Do any additional setup after loading the view.
+    self.titleLabel = [[UILabel alloc] init];
+    self.titleLabel.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;
+    self.titleLabel.font = [UIFont systemFontOfSize:20];
+    self.titleLabel.text = NSLocalizedString(@"Signature", nil);
+    self.titleLabel.adjustsFontSizeToFitWidth = YES;
+    [self.view addSubview:self.titleLabel];
+    
+    self.backBtn = [[UIButton alloc] init];
+    self.backBtn.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
+    [self.backBtn setImage:[UIImage imageNamed:@"CPDFAnnotationBaseImageBack" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
+    [self.backBtn addTarget:self action:@selector(buttonItemClicked_back:) forControlEvents:UIControlEventTouchUpInside];
+    [self.view addSubview:self.backBtn];
+    
+    self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 50, self.view.frame.size.width, self.view.frame.size.height - 120) style:UITableViewStylePlain];
+    self.tableView.delegate = self;
+    self.tableView.dataSource = self;
+    self.tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
+    self.tableView.rowHeight = 120;
+    [self.view addSubview:self.tableView];
+    
+    self.emptyImageView = [[UIImageView alloc] init];
+    self.emptyImageView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
+    self.emptyImageView.image = [UIImage imageNamed:@"CPDFAnnotationBaseImageBack" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil];
+    [self.view addSubview:self.emptyImageView];
+    
+    self.createButton = [[UIButton alloc] init];
+    self.createButton.layer.cornerRadius = 10.0;
+    self.createButton.clipsToBounds = YES;
+    [self.createButton setImage:[UIImage imageNamed:@"CPDFSignatureImageAdd" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
+    [self.createButton setTitle:NSLocalizedString(@"Add Signature", nil) forState:UIControlStateNormal];
+    [self.createButton setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
+    [self.view addSubview:self.createButton];
+    
+    self.view.backgroundColor = [UIColor whiteColor];
+    [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];;
+}
+
+- (void)viewWillLayoutSubviews {
+    [super viewWillLayoutSubviews];
+    self.titleLabel.frame = CGRectMake((self.view.frame.size.width - 120)/2, 5, 120, 50);
+    self.backBtn.frame = CGRectMake(self.view.frame.size.width - 60, 5, 50, 50);
+    self.createButton.frame = CGRectMake((self.view.frame.size.width - 120)/2, self.view.frame.size.height - 70, 120, 50);;
+    self.emptyImageView.frame = self.tableView.frame;
+}
+
+- (void)willTransitionToTraitCollection:(UITraitCollection *)newCollection withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
+    [super willTransitionToTraitCollection:newCollection withTransitionCoordinator:coordinator];
+    [self updatePreferredContentSizeWithTraitCollection:newCollection];
+}
+
+#pragma mark - Protect Methods
+
+- (void)updatePreferredContentSizeWithTraitCollection:(UITraitCollection *)traitCollection {
+    self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact ? 270 : 420);
+}
+
+#pragma mark - Action
+
+- (void)buttonItemClicked_back:(id)sender {
+    [self dismissViewControllerAnimated:YES completion:nil];
+}
+
+#pragma mark - UITableViewDataSource
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
+    return 5;
+}
+
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
+    CPDFSignatureViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
+    if (cell == nil) {
+        cell = [[CPDFSignatureViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"cell"];
+    }
+    
+    return cell;
 }
 
 @end

+ 29 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CSignatureManager.h

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

+ 99 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CSignatureManager.m

@@ -0,0 +1,99 @@
+//
+//  CSignatureManager.m
+//  compdfkit-tools
+//
+//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
+//
+//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
+//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
+//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
+//  This notice may not be removed from this file.
+//
+
+#import "CSignatureManager.h"
+
+#define kPDFSignatureDataFileName (@"PDFKitResources/Signature/PDFSignatureData.plist")
+#define kPDFSignatureImageFolder  (@"PDFKitResources/Signature/PDFSignatureImageFolder")
+
+@implementation CSignatureManager
+
+static CSignatureManager *_sharedSignManager;
+
++ (CSignatureManager *)sharedManager {
+    if (!_sharedSignManager)
+        _sharedSignManager = [[CSignatureManager alloc] init];
+    return _sharedSignManager;
+}
+
+- (instancetype)init {
+    if (self = [super init]) {
+        NSString *library = [NSHomeDirectory() stringByAppendingPathComponent:@"Library"];
+        NSString *filePath = [library stringByAppendingPathComponent:kPDFSignatureDataFileName];
+        NSString *folderPath = [library stringByAppendingPathComponent:kPDFSignatureImageFolder];
+        if ([[NSFileManager defaultManager] fileExistsAtPath:filePath]) {
+            NSMutableArray *signatures = [NSMutableArray array];
+            NSArray *fileNames = [[NSArray alloc] initWithContentsOfFile:filePath];
+            for (NSString *fileName in fileNames) {
+                [signatures addObject:[folderPath stringByAppendingPathComponent:fileName]];
+            }
+        } else {
+            _signatures = [[NSArray alloc] init];
+        }
+    }
+    return self;
+}
+
+- (NSString *)randomString {
+    CFUUIDRef cfuuid = CFUUIDCreate(kCFAllocatorDefault);
+    CFStringRef cfstring = CFUUIDCreateString(kCFAllocatorDefault, cfuuid);
+    NSString *cfuuidString = [NSString stringWithString:(__bridge NSString *)cfstring];
+    CFRelease(cfuuid);
+    CFRelease(cfstring);
+    return cfuuidString;
+}
+
+- (void)save {
+    NSString *library = [NSHomeDirectory() stringByAppendingPathComponent:@"Library"];
+    NSString *filePath = [library stringByAppendingPathComponent:kPDFSignatureDataFileName];
+    if ([[NSFileManager defaultManager] fileExistsAtPath:filePath]) {
+        [[NSFileManager defaultManager] removeItemAtPath:filePath error:nil];
+    }
+    NSMutableArray *fileNames = [NSMutableArray array];
+    for (NSString *filePath in self.signatures) {
+        [fileNames addObject:filePath.lastPathComponent];
+    }
+    if (fileNames.count > 0) {
+        [fileNames writeToFile:filePath atomically:YES];
+    }
+}
+
+- (void)addSignature:(UIImage *)image {
+    NSString *library = [NSHomeDirectory() stringByAppendingPathComponent:@"Library"];
+    NSString *folderPath = [library stringByAppendingPathComponent:kPDFSignatureImageFolder];
+    NSString *randomStr = [self randomString];
+    if (image) {
+        if (![[NSFileManager defaultManager] fileExistsAtPath:folderPath]) {
+            [[NSFileManager defaultManager] createDirectoryAtPath:folderPath withIntermediateDirectories:YES attributes:nil error:nil];
+        }
+        NSString *imageName = [randomStr stringByAppendingPathExtension:@"png"];
+        NSString *imagePath = [folderPath stringByAppendingPathComponent:imageName];
+        if ([UIImagePNGRepresentation(image) writeToFile:imagePath atomically:YES]) {
+            NSMutableArray *array = [NSMutableArray arrayWithArray:self.signatures];
+            [array addObject:imagePath];
+            self.signatures = array;
+            [self save];
+        }
+    }
+}
+
+- (void)removeSignaturesAtIndexes:(NSIndexSet *)indexes {
+    for (NSString *filePath in [self.signatures objectsAtIndexes:indexes]) {
+        [[NSFileManager defaultManager] removeItemAtPath:filePath error:nil];
+    }
+    NSMutableArray *array = [NSMutableArray arrayWithArray:self.signatures];
+    [array removeObjectsAtIndexes:indexes];
+    self.signatures = array;
+    [self save];
+}
+
+@end

+ 22 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/Image.xcassets/CPDFSignatureImageAdd.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "signature_icon_add.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "signature_icon_add@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/Image.xcassets/CPDFSignatureImageAdd.imageset/signature_icon_add.png


BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/Image.xcassets/CPDFSignatureImageAdd.imageset/signature_icon_add@2x.png


+ 23 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/Image.xcassets/CPDFSignatureImageEmpty.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "filename" : "signature_img_empty.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "signature_img_empty@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "signature_img_empty@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/Image.xcassets/CPDFSignatureImageEmpty.imageset/signature_img_empty.png


BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/Image.xcassets/CPDFSignatureImageEmpty.imageset/signature_img_empty@2x.png


BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/Image.xcassets/CPDFSignatureImageEmpty.imageset/signature_img_empty@3x.png


+ 6 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/Image.xcassets/Contents.json

@@ -0,0 +1,6 @@
+{
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 10 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/CPDFAnnotationBar.m

@@ -20,6 +20,7 @@
 #import "CPDFShapeCircleViewController.h"
 #import "CPDFShapeArrowViewController.h"
 #import "CPDFFreeTextViewController.h"
+#import "CPDFSignatureViewController.h"
 #import "CPDFInkTopToolBar.h"
 #import "CAnnotStyle.h"
 #import "CPDFListView.h"
@@ -362,6 +363,15 @@
             freeTextVC.transitioningDelegate = presentationController;
             [self.parentVC presentViewController:freeTextVC animated:YES completion:nil];
         }
+            break;
+        case CPDFToolbarSignature:
+        {
+            CPDFSignatureViewController *signatureVC = [[CPDFSignatureViewController alloc] initWithStyle:annotStytle];
+            presentationController = [[AAPLCustomPresentationController alloc] initWithPresentedViewController:signatureVC presentingViewController:self.parentVC];
+            signatureVC.transitioningDelegate = presentationController;
+            [self.parentVC presentViewController:signatureVC animated:YES completion:nil];
+        }
+            break;
         default:
             break;
     }

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

@@ -389,13 +389,13 @@ typedef NS_ENUM(NSInteger, CPDFAnnotationDraggingType) {
     
     __weak typeof(self) weakSelf = self;
     _pageIndicatorView.touchCallBack = ^{
-        UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil message:NSLocalizedString(@"Go to page", nil) preferredStyle:UIAlertControllerStyleAlert];
+        UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil message:NSLocalizedString(@"Enter a page number", nil) preferredStyle:UIAlertControllerStyleAlert];
         
         [alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
             
         }]];
         
-        [alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"Done", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+        [alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
             
             UITextField *pageTextField = alertController.textFields.firstObject;
             NSInteger pageIndex = [pageTextField.text integerValue] - 1;
@@ -412,8 +412,8 @@ typedef NS_ENUM(NSInteger, CPDFAnnotationDraggingType) {
         }]];
         
         [alertController addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {
-            
-            textField.placeholder = NSLocalizedString(@"Enter a page number", nil);
+            NSString *str = [NSString stringWithFormat:@"Page(1/%lu)", weakSelf.document.pageCount];
+            textField.placeholder = NSLocalizedString(str, nil);
             textField.keyboardType = UIKeyboardTypeNumberPad;
             
         }];

+ 23 - 4
compdfkit-tools/compdfkit-tools/Viewer/PDFBookmark/CPDFBookmarkViewController.m

@@ -59,7 +59,11 @@
     _noDataLabel.autoresizingMask = UIViewAutoresizingFlexibleTopMargin|UIViewAutoresizingFlexibleBottomMargin|UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleRightMargin;
     [self.view addSubview:self.noDataLabel];
     
-    _addBookmarkBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.view.frame.size.width - self.view.safeAreaInsets.right - 50, self.view.frame.size.height - self.view.safeAreaInsets.bottom - 50, 50, 50)];
+    if (@available(iOS 11.0, *)) {
+        _addBookmarkBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.view.frame.size.width - self.view.safeAreaInsets.right - 50, self.view.frame.size.height - self.view.safeAreaInsets.bottom - 50, 50, 50)];
+    } else {
+        _addBookmarkBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.view.frame.size.width - 10 - 50, self.view.frame.size.height - 50 - 50, 50, 50)];
+    }
     _addBookmarkBtn.layer.cornerRadius = 25;
     _addBookmarkBtn.layer.masksToBounds = YES;
     _addBookmarkBtn.layer.borderWidth = 1.0;
@@ -113,8 +117,21 @@
 
 - (void)buttonItemClicked_add:(id)sender {
     if (![self.pdfView.document bookmarkForPageIndex:self.pdfView.currentPageIndex]) {
-        [self.pdfView.document addBookmark:[NSString stringWithFormat:@"my page %lu", self.pdfView.currentPageIndex+1] forPageIndex:self.pdfView.currentPageIndex];
-        [self reloadData];
+        UIAlertController *alert = [UIAlertController alertControllerWithTitle:@" " message:nil preferredStyle:UIAlertControllerStyleAlert];
+        [alert addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {
+            textField.placeholder = NSLocalizedString(@"Bookmark Title", nil);
+        }];
+            
+        UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil) style:UIAlertActionStyleCancel handler:nil];
+        
+        UIAlertAction *addAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Add", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+            [self.pdfView.document addBookmark:alert.textFields.firstObject.text forPageIndex:self.pdfView.currentPageIndex];
+            [self reloadData];
+        }];
+        
+        [alert addAction:cancelAction];
+        [alert addAction:addAction];
+        [self presentViewController:alert animated:YES completion:nil];
     } else {
         UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil)
                                                                style:UIAlertActionStyleCancel
@@ -168,7 +185,9 @@
     
     UITableViewRowAction *editAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:@"edit" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {
         UIAlertController *alert = [UIAlertController alertControllerWithTitle:@" " message:nil preferredStyle:UIAlertControllerStyleAlert];
-        [alert addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {}];
+        [alert addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {
+            textField.placeholder = NSLocalizedString(@"Bookmark Title", nil);
+        }];
             
         UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil) style:UIAlertActionStyleCancel handler:nil];
         

+ 1 - 1
compdfkit-tools/compdfkit-tools/Viewer/PDFMore/CPDFMoreListViewController.m

@@ -54,7 +54,7 @@
 
 - (NSArray *)itemArr{
     if(!_itemArr){
-        _itemArr = [[NSArray alloc]initWithObjects:NSLocalizedString(@"File Info",nil), NSLocalizedString(@"Preview Setting",nil),nil];
+        _itemArr = [[NSArray alloc]initWithObjects:NSLocalizedString(@"Document Info",nil), NSLocalizedString(@"Reader Settings",nil),nil];
     }
     return _itemArr;
 }

+ 3 - 3
compdfkit-tools/compdfkit-tools/Viewer/PDFMore/PDFInfo/CPDFInfoViewController.m

@@ -145,9 +145,9 @@
     if (documentAttributes[CPDFDocumentCreatorAttribute]) {
         [mArray addObject:[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Creator:",kDocumentInfoTitle nil),kDocumentInfoTitle, documentAttributes[CPDFDocumentCreatorAttribute], kDocumentInfoValue, nil]];
     }
-    if (documentAttributes[CPDFDocumentProducerAttribute]) {
-        [mArray addObject:[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Producer:",kDocumentInfoTitle nil),kDocumentInfoTitle, documentAttributes[CPDFDocumentProducerAttribute], kDocumentInfoValue, nil]];
-    }
+//    if (documentAttributes[CPDFDocumentProducerAttribute]) {
+//        [mArray addObject:[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Producer:",kDocumentInfoTitle nil),kDocumentInfoTitle, documentAttributes[CPDFDocumentProducerAttribute], kDocumentInfoValue, nil]];
+//    }
     
     if (documentAttributes[CPDFDocumentCreationDateAttribute]){
         NSMutableString* mSting = [NSMutableString string];

+ 1 - 1
compdfkit-tools/compdfkit-tools/Viewer/PDFSearch/CSearchToolbar.m

@@ -199,7 +199,7 @@
     [self addSubview:self.previousItem];
     [self addSubview:self.doneItem];
     
-    [_doneItem setTitle:NSLocalizedString(@"Done", nil) forState:UIControlStateNormal];
+    [_doneItem setTitle:NSLocalizedString(@"Complete", nil) forState:UIControlStateNormal];
     [_doneItem setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
     _doneItem.titleLabel.adjustsFontSizeToFitWidth = YES;
     _searchBar.placeholder = NSLocalizedString(@"Search Text", nil);