Ver código fonte

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

chenyu 1 ano atrás
pai
commit
256e4b09ea
48 arquivos alterados com 314 adições e 193 exclusões
  1. 4 2
      Annotation-Ctrl-Demo/Annotation-Ctrl-Demo.xcodeproj/project.pbxproj
  2. 4 2
      Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/CPDFViewController.m
  3. 4 2
      ComPDFKit/ComPDFKit.xcodeproj/project.pbxproj
  4. 7 6
      ComPDFKit/ComPDFKit/CPDFViewController.m
  5. 4 2
      Edit-Ctrl-Demo/Edit-Ctrl-Demo.xcodeproj/project.pbxproj
  6. 4 2
      Form-Ctrl-Demo/Form-Ctrl-Demo.xcodeproj/project.pbxproj
  7. 4 2
      PageEdit-Ctrl-Demo/PageEdit-Ctrl-Demo.xcodeproj/project.pbxproj
  8. 1 0
      PageEdit-Ctrl-Demo/PageEdit-Ctrl-Demo/CPDFViewController.m
  9. 6 6
      compdfkit-demo.xcworkspace/contents.xcworkspacedata
  10. 4 2
      compdfkit-tools/compdfkit-tools.xcodeproj/project.pbxproj
  11. 28 6
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFBase/CPDFAnnotationBaseViewController.m
  12. 7 7
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/CPDFFreeTextViewController.m
  13. 1 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFHighlight/CPDFHighlightViewController.m
  14. 16 2
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFInk/CPDFInkViewController.m
  15. 19 29
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFShape/CPDFShapeArrowViewController.m
  16. 41 13
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFShape/CPDFShapeCircleViewController.m
  17. 37 17
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CPDFSignatureEditViewController.m
  18. 1 1
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CPDFSignatureViewController.m
  19. 2 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSquiggly/CPDFSquigglyViewController.m
  20. 4 4
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CPDFStampViewController.m
  21. 2 2
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampFileManger.m
  22. 1 1
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampPreview.m
  23. 3 2
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampTextViewController.m
  24. 2 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStrikeout/CPDFStrikeoutViewController.m
  25. 2 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFUnderline/CPDFUnderlineViewController.m
  26. 6 6
      compdfkit-tools/compdfkit-tools/Common/Controls/BOTA/CPDFBOTAViewController.m
  27. 1 0
      compdfkit-tools/compdfkit-tools/Common/Controls/PDFViewController/CPDFViewBaseController.m
  28. 5 8
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/CPDFAnnotationBar.m
  29. 1 1
      compdfkit-tools/compdfkit-tools/Common/Views/PDFPopMenu/CPDFPopMenuView.m
  30. 7 9
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFColorPickerView.m
  31. 1 1
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFThicknessSliderView.m
  32. 3 3
      compdfkit-tools/compdfkit-tools/Common/Views/PDFView/PDFListView/CPDFListView+UndoManager.m
  33. 10 3
      compdfkit-tools/compdfkit-tools/Common/Views/PDFView/PDFListView/CPDFListView.m
  34. 2 0
      compdfkit-tools/compdfkit-tools/PageEdit/Control/CPDFPDFInsertViewController.h
  35. 6 3
      compdfkit-tools/compdfkit-tools/PageEdit/Control/CPDFPDFInsertViewController.m
  36. 11 7
      compdfkit-tools/compdfkit-tools/PageEdit/Control/CPDFPageEditViewController.m
  37. 2 0
      compdfkit-tools/compdfkit-tools/PageEdit/Control/CPDFPageInsertViewController.h
  38. 17 3
      compdfkit-tools/compdfkit-tools/PageEdit/Control/CPDFPageInsertViewController.m
  39. 5 3
      compdfkit-tools/compdfkit-tools/PageEdit/Views/CPageEditToolBar.m
  40. 5 5
      compdfkit-tools/compdfkit-tools/Viewer/PDFBookmark/CPDFBookmarkViewController.m
  41. 1 1
      compdfkit-tools/compdfkit-tools/Viewer/PDFMore/CPDFMoreListViewController.m
  42. 2 2
      compdfkit-tools/compdfkit-tools/Viewer/PDFMore/PDFDisplaySetting/CPDFDisplayViewController.m
  43. 6 6
      compdfkit-tools/compdfkit-tools/Viewer/PDFMore/PDFInfo/CPDFInfoViewController.m
  44. 1 1
      compdfkit-tools/compdfkit-tools/Viewer/PDFOutlie/CPDFOutlineViewController.m
  45. 4 6
      compdfkit-tools/compdfkit-tools/Viewer/PDFSearch/CPDFSearchResultsViewController.m
  46. 1 1
      compdfkit-tools/compdfkit-tools/Viewer/PDFSearch/CSearchToolbar.m
  47. 5 12
      compdfkit-tools/compdfkit-tools/Viewer/PDFThumbnail/CPDFThumbnailViewController.m
  48. 4 2
      viewer-ctrl-demo/viewer-ctrl-demo.xcodeproj/project.pbxproj

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

@@ -3,7 +3,7 @@
 	archiveVersion = 1;
 	classes = {
 	};
-	objectVersion = 56;
+	objectVersion = 55;
 	objects = {
 
 /* Begin PBXBuildFile section */
@@ -185,7 +185,7 @@
 				};
 			};
 			buildConfigurationList = C9AF184729F267DD00EC4979 /* Build configuration list for PBXProject "Annotation-Ctrl-Demo" */;
-			compatibilityVersion = "Xcode 14.0";
+			compatibilityVersion = "Xcode 13.0";
 			developmentRegion = en;
 			hasScannedForEncodings = 0;
 			knownRegions = (
@@ -374,6 +374,7 @@
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = 1;
 				DEVELOPMENT_TEAM = Q43DRF894U;
+				ENABLE_BITCODE = NO;
 				"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
 				GENERATE_INFOPLIST_FILE = YES;
 				INFOPLIST_FILE = "Annotation-Ctrl-Demo/Info.plist";
@@ -407,6 +408,7 @@
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = 1;
 				DEVELOPMENT_TEAM = Q43DRF894U;
+				ENABLE_BITCODE = NO;
 				"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
 				GENERATE_INFOPLIST_FILE = YES;
 				INFOPLIST_FILE = "Annotation-Ctrl-Demo/Info.plist";

+ 4 - 2
Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/CPDFViewController.m

@@ -39,7 +39,7 @@
 
     [self enterAnnotationMode];
     
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(PDFPageDidRemoveAnnotationNotification:) name:@"CPDFPageDidRemoveAnnotationNotification" object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(PDFPageDidRemoveAnnotationNotification:) name:CPDFPageDidRemoveAnnotationNotification object:nil];
 }
 
 - (void)initAnnotationBar {
@@ -504,7 +504,9 @@
 #pragma mark - Notification
 
 - (void)PDFPageDidRemoveAnnotationNotification:(NSNotification *)notification {
-    if ([self.pdfListView.activeAnnotations.firstObject isKindOfClass:[CPDFSoundAnnotation class]]) {
+    CPDFAnnotation *annotation = [notification object];
+
+    if ([annotation isKindOfClass:[CPDFSoundAnnotation class]]) {
         if ([self.soundPlayBar isDescendantOfView:self.view]) {
             [self.soundPlayBar removeFromSuperview];
         }

+ 4 - 2
ComPDFKit/ComPDFKit.xcodeproj/project.pbxproj

@@ -3,7 +3,7 @@
 	archiveVersion = 1;
 	classes = {
 	};
-	objectVersion = 56;
+	objectVersion = 55;
 	objects = {
 
 /* Begin PBXBuildFile section */
@@ -194,7 +194,7 @@
 				};
 			};
 			buildConfigurationList = 4F6B6C322A173F6D0030C94E /* Build configuration list for PBXProject "ComPDFKit" */;
-			compatibilityVersion = "Xcode 14.0";
+			compatibilityVersion = "Xcode 13.0";
 			developmentRegion = en;
 			hasScannedForEncodings = 0;
 			knownRegions = (
@@ -382,6 +382,7 @@
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = 1;
 				DEVELOPMENT_TEAM = Q43DRF894U;
+				ENABLE_BITCODE = NO;
 				"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
 				GENERATE_INFOPLIST_FILE = YES;
 				INFOPLIST_FILE = ComPDFKit/Info.plist;
@@ -413,6 +414,7 @@
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = 1;
 				DEVELOPMENT_TEAM = 4GGQPGRTSV;
+				ENABLE_BITCODE = NO;
 				"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
 				GENERATE_INFOPLIST_FILE = YES;
 				INFOPLIST_FILE = ComPDFKit/Info.plist;

+ 7 - 6
ComPDFKit/ComPDFKit/CPDFViewController.m

@@ -17,7 +17,7 @@
 #import <AVFAudio/AVFAudio.h>
 #import <AVFoundation/AVFoundation.h>
 
-@interface CPDFViewController () <CPDFSoundPlayBarDelegate,CPDFAnnotationBarDelegate,CPDFToolsViewControllerDelegate,CPDFNoteOpenViewControllerDelegate,CPDFBOTAViewControllerDelegate,CPDFEditToolBarDelegate,CPDFFormBarDelegate,CPDFListViewDelegate,CPDFSignatureViewControllerDelegate>
+@interface CPDFViewController () <CPDFSoundPlayBarDelegate,CPDFAnnotationBarDelegate,CPDFToolsViewControllerDelegate,CPDFNoteOpenViewControllerDelegate,CPDFBOTAViewControllerDelegate,CPDFEditToolBarDelegate,CPDFFormBarDelegate,CPDFListViewDelegate,CPDFSignatureViewControllerDelegate,CPDFPageEditViewControllerDelegate>
 
 @property(nonatomic, strong) CPDFAnnotationBar *annotationBar;
 
@@ -56,7 +56,7 @@
 
     [self enterViewerMode];
     
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(PDFPageDidRemoveAnnotationNotification:) name:@"CPDFPageDidRemoveAnnotationNotification" object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(PDFPageDidRemoveAnnotationNotification:) name:CPDFPageDidRemoveAnnotationNotification object:nil];
 }
 
 - (void)initAnnotationBar {
@@ -203,9 +203,8 @@
     frame.origin.y = self.view.bounds.size.height-frame.size.height;
     self.toolBar.frame = frame;
     
-    CGRect rectStatus = [[UIApplication sharedApplication] statusBarFrame];
-    tPosY = self.navigationController.navigationBar.frame.size.height + rectStatus.size.height;
-    tBottomY = self.toolBar.frame.size.height;
+    tPosY = 0;
+    tBottomY = 0;
     
     if (@available(iOS 11.0, *)) {
         self.pdfListView.frame = CGRectMake(self.view.safeAreaInsets.left, tPosY, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, self.view.frame.size.height - tBottomY - tPosY);
@@ -724,7 +723,9 @@
 #pragma mark - Notification
 
 - (void)PDFPageDidRemoveAnnotationNotification:(NSNotification *)notification {
-    if ([self.pdfListView.activeAnnotations.firstObject isKindOfClass:[CPDFSoundAnnotation class]]) {
+    CPDFAnnotation *annotation = [notification object];
+
+    if ([annotation isKindOfClass:[CPDFSoundAnnotation class]]) {
         if ([self.soundPlayBar isDescendantOfView:self.view]) {
             [self.soundPlayBar removeFromSuperview];
         }

+ 4 - 2
Edit-Ctrl-Demo/Edit-Ctrl-Demo.xcodeproj/project.pbxproj

@@ -3,7 +3,7 @@
 	archiveVersion = 1;
 	classes = {
 	};
-	objectVersion = 56;
+	objectVersion = 55;
 	objects = {
 
 /* Begin PBXBuildFile section */
@@ -197,7 +197,7 @@
 				};
 			};
 			buildConfigurationList = 4F17C05C29F4FBFD00445550 /* Build configuration list for PBXProject "Edit-Ctrl-Demo" */;
-			compatibilityVersion = "Xcode 14.0";
+			compatibilityVersion = "Xcode 13.0";
 			developmentRegion = en;
 			hasScannedForEncodings = 0;
 			knownRegions = (
@@ -385,6 +385,7 @@
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = 1;
 				DEVELOPMENT_TEAM = Q43DRF894U;
+				ENABLE_BITCODE = NO;
 				"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
 				GENERATE_INFOPLIST_FILE = YES;
 				INFOPLIST_FILE = "Edit-Ctrl-Demo/Info.plist";
@@ -416,6 +417,7 @@
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = 1;
 				DEVELOPMENT_TEAM = Q43DRF894U;
+				ENABLE_BITCODE = NO;
 				"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
 				GENERATE_INFOPLIST_FILE = YES;
 				INFOPLIST_FILE = "Edit-Ctrl-Demo/Info.plist";

+ 4 - 2
Form-Ctrl-Demo/Form-Ctrl-Demo.xcodeproj/project.pbxproj

@@ -3,7 +3,7 @@
 	archiveVersion = 1;
 	classes = {
 	};
-	objectVersion = 56;
+	objectVersion = 55;
 	objects = {
 
 /* Begin PBXBuildFile section */
@@ -194,7 +194,7 @@
 				};
 			};
 			buildConfigurationList = 4F11514E2A1D989700EC433D /* Build configuration list for PBXProject "Form-Ctrl-Demo" */;
-			compatibilityVersion = "Xcode 14.0";
+			compatibilityVersion = "Xcode 13.0";
 			developmentRegion = en;
 			hasScannedForEncodings = 0;
 			knownRegions = (
@@ -382,6 +382,7 @@
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = 1;
 				DEVELOPMENT_TEAM = 4GGQPGRTSV;
+				ENABLE_BITCODE = NO;
 				"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
 				GENERATE_INFOPLIST_FILE = YES;
 				INFOPLIST_FILE = "Form-Ctrl-Demo/Info.plist";
@@ -410,6 +411,7 @@
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = 1;
 				DEVELOPMENT_TEAM = 4GGQPGRTSV;
+				ENABLE_BITCODE = NO;
 				"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
 				GENERATE_INFOPLIST_FILE = YES;
 				INFOPLIST_FILE = "Form-Ctrl-Demo/Info.plist";

+ 4 - 2
PageEdit-Ctrl-Demo/PageEdit-Ctrl-Demo.xcodeproj/project.pbxproj

@@ -3,7 +3,7 @@
 	archiveVersion = 1;
 	classes = {
 	};
-	objectVersion = 56;
+	objectVersion = 55;
 	objects = {
 
 /* Begin PBXBuildFile section */
@@ -185,7 +185,7 @@
 				};
 			};
 			buildConfigurationList = C9C6EEE72A20487900E1DD81 /* Build configuration list for PBXProject "PageEdit-Ctrl-Demo" */;
-			compatibilityVersion = "Xcode 14.0";
+			compatibilityVersion = "Xcode 13.0";
 			developmentRegion = en;
 			hasScannedForEncodings = 0;
 			knownRegions = (
@@ -373,6 +373,7 @@
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = 1;
 				DEVELOPMENT_TEAM = Q43DRF894U;
+				ENABLE_BITCODE = NO;
 				"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
 				GENERATE_INFOPLIST_FILE = YES;
 				INFOPLIST_FILE = "PageEdit-Ctrl-Demo/Info.plist";
@@ -402,6 +403,7 @@
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = 1;
 				DEVELOPMENT_TEAM = Q43DRF894U;
+				ENABLE_BITCODE = NO;
 				"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
 				GENERATE_INFOPLIST_FILE = YES;
 				INFOPLIST_FILE = "PageEdit-Ctrl-Demo/Info.plist";

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

@@ -61,6 +61,7 @@
     pageEditViewcontroller.pageEditDelegate = self;
     pageEditViewcontroller.modalPresentationStyle = UIModalPresentationFullScreen;
     [self.navigationController presentViewController:pageEditViewcontroller animated:YES completion:nil];
+//    [self.navigationController pushViewController:pageEditViewcontroller animated:NO];
 }
 
 - (void)titleButtonClickd:(id)sender {

+ 6 - 6
compdfkit-demo.xcworkspace/contents.xcworkspacedata

@@ -2,24 +2,24 @@
 <Workspace
    version = "1.0">
    <FileRef
-      location = "group:PageEdit-Ctrl-Demo/PageEdit-Ctrl-Demo.xcodeproj">
+      location = "group:ComPDFKit-Tools/ComPDFKit-Tools.xcodeproj">
    </FileRef>
    <FileRef
       location = "group:ComPDFKit/ComPDFKit.xcodeproj">
    </FileRef>
    <FileRef
-      location = "group:Form-Ctrl-Demo/Form-Ctrl-Demo.xcodeproj">
+      location = "group:PageEdit-Ctrl-Demo/PageEdit-Ctrl-Demo.xcodeproj">
    </FileRef>
    <FileRef
-      location = "group:Edit-Ctrl-Demo/Edit-Ctrl-Demo.xcodeproj">
+      location = "group:Form-Ctrl-Demo/Form-Ctrl-Demo.xcodeproj">
    </FileRef>
    <FileRef
-      location = "group:Annotation-Ctrl-Demo/Annotation-Ctrl-Demo.xcodeproj">
+      location = "group:Edit-Ctrl-Demo/Edit-Ctrl-Demo.xcodeproj">
    </FileRef>
    <FileRef
-      location = "group:viewer-ctrl-demo/viewer-ctrl-demo.xcodeproj">
+      location = "group:Viewer-Ctrl-Demo/../Annotation-Ctrl-Demo/Annotation-Ctrl-Demo.xcodeproj">
    </FileRef>
    <FileRef
-      location = "group:compdfkit-tools/compdfkit-tools.xcodeproj">
+      location = "group:Viewer-Ctrl-Demo/Viewer-Ctrl-Demo.xcodeproj">
    </FileRef>
 </Workspace>

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

@@ -3,7 +3,7 @@
 	archiveVersion = 1;
 	classes = {
 	};
-	objectVersion = 56;
+	objectVersion = 55;
 	objects = {
 
 /* Begin PBXBuildFile section */
@@ -1687,7 +1687,7 @@
 				};
 			};
 			buildConfigurationList = F335EE4129E430C800ACC72A /* Build configuration list for PBXProject "compdfkit-tools" */;
-			compatibilityVersion = "Xcode 14.0";
+			compatibilityVersion = "Xcode 13.0";
 			developmentRegion = en;
 			hasScannedForEncodings = 0;
 			knownRegions = (
@@ -2018,6 +2018,7 @@
 				DYLIB_COMPATIBILITY_VERSION = 1;
 				DYLIB_CURRENT_VERSION = 1;
 				DYLIB_INSTALL_NAME_BASE = "@rpath";
+				ENABLE_BITCODE = NO;
 				"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
 				FRAMEWORK_SEARCH_PATHS = "";
 				GENERATE_INFOPLIST_FILE = YES;
@@ -2051,6 +2052,7 @@
 				DYLIB_COMPATIBILITY_VERSION = 1;
 				DYLIB_CURRENT_VERSION = 1;
 				DYLIB_INSTALL_NAME_BASE = "@rpath";
+				ENABLE_BITCODE = NO;
 				"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
 				FRAMEWORK_SEARCH_PATHS = "";
 				GENERATE_INFOPLIST_FILE = YES;

+ 28 - 6
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFBase/CPDFAnnotationBaseViewController.m

@@ -100,9 +100,8 @@
         self.opacitySliderView.frame = CGRectMake(self.view.safeAreaInsets.left, 90, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 90);
         self.backBtn.frame = CGRectMake(self.view.frame.size.width - 60 - self.view.safeAreaInsets.right, 5, 50, 50);
     } else {
-        self.colorPicker.frame = self.view.frame;
-        self.colorView.frame = CGRectMake(0, 0, self.view.frame.size.width, ((self.view.frame.size.height)/9)*2);
-        self.opacitySliderView.frame = CGRectMake(0, 90, self.view.frame.size.width, ((self.view.frame.size.height)/9)*2);
+        self.colorView.frame = CGRectMake(0, 0, self.view.frame.size.width, 90);
+        self.opacitySliderView.frame = CGRectMake(0, 90, self.view.frame.size.width, 90);
         self.backBtn.frame = CGRectMake(self.view.frame.size.width - 60, 5, 50, 50);
     }
 }
@@ -136,7 +135,19 @@
 }
 
 - (void)updatePreferredContentSizeWithTraitCollection:(UITraitCollection *)traitCollection {
-    self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact ? 350 : 420);
+    if ([self.colorPicker superview]) {
+        UIDevice *currentDevice = [UIDevice currentDevice];
+        if (currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad) {
+            // This is an iPad
+            self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, 520);
+        } else {
+            // This is an iPhone or iPod touch
+            self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, 320);
+        }
+       
+    } else {
+        self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact ? 350 : 420);
+    }
 }
 
 #pragma mark - Action
@@ -153,11 +164,20 @@
         picker.delegate = self;
         [self presentViewController:picker animated:YES completion:nil];
     } else {
-        _colorPicker = [[CPDFColorPickerView alloc] initWithFrame:self.view.frame];
+        UIDevice *currentDevice = [UIDevice currentDevice];
+        if (currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad) {
+            // This is an iPad
+            _colorPicker = [[CPDFColorPickerView alloc] initWithFrame:CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y, self.view.frame.size.width, 520)];
+        } else {
+            // This is an iPhone or iPod touch
+            _colorPicker = [[CPDFColorPickerView alloc] initWithFrame:CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y, self.view.frame.size.width, 320)];
+        }
+       
         _colorPicker.delegate = self;
         _colorView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-        _colorPicker.backgroundColor = [UIColor whiteColor];
+        _colorPicker.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
         [self.view addSubview:self.colorPicker];
+        [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
     }
 }
 
@@ -176,6 +196,8 @@
     [color getRed:&red green:&green blue:&blue alpha:&alpha];
     self.opacitySliderView.opacitySlider.value = alpha;
     self.opacitySliderView.startLabel.text = [NSString stringWithFormat:@"%d%%", (int)((self.opacitySliderView.opacitySlider.value/1)*100)];
+    
+    [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
 }
 
 #pragma mark - CPDFOpacitySliderViewDelegate

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

@@ -161,17 +161,17 @@
     } else {
         self.backBtn.frame = CGRectMake(self.view.frame.size.width - 60, 5, 50, 50);
         self.boldBtn.frame = CGRectMake(self.view.frame.size.width - 80, 195, 30, 30);
-        self.italicBtn.frame = CGRectMake(self.view.frame.size.width - 40, 195, 30, 30);
-        self.alignmentLabel.frame = CGRectMake(10, 225, 120, 45);
-        self.leftBtn.frame = CGRectMake(self.view.frame.size.width - 120, 240, 30, 30);
+        self.italicBtn.frame = CGRectMake(self.view.frame.size.width - 50, 195, 30, 30);
+        self.alignmentLabel.frame = CGRectMake(20, 225, 120, 45);
+        self.leftBtn.frame = CGRectMake(self.view.frame.size.width - 110, 240, 30, 30);
         self.centerBtn.frame = CGRectMake(self.view.frame.size.width - 80, 240, 30, 30);
-        self.rightBtn.frame = CGRectMake(self.view.frame.size.width - 40, 240, 30, 30);
-        self.fontsizeSliderView.frame = CGRectMake(10, 280, self.view.frame.size.width - 20, 90);
+        self.rightBtn.frame = CGRectMake(self.view.frame.size.width - 50, 240, 30, 30);
+        self.fontsizeSliderView.frame = CGRectMake(0, 280, self.view.frame.size.width, 90);
         
         self.fontNameLabel.frame = CGRectMake(20, 195, 30, 30);
         self.dropMenuView.frame = CGRectMake(60, 195, self.view.frame.size.width - 140, 30);
         self.dropDownIcon.frame = CGRectMake(self.dropMenuView.bounds.size.width - 24 - 5, 3, 24, 24);
-        self.fontNameSelectLabel.frame = CGRectMake(10, 0, self.dropMenuView.bounds.size.width - 40, 29);
+        self.fontNameSelectLabel.frame = CGRectMake(10, 0, self.dropMenuView.bounds.size.width-40, 29);
         self.fontSelectBtn.frame = self.dropMenuView.bounds;
         self.splitView.frame = CGRectMake(0, 29, self.dropMenuView.bounds.size.width, 1);
     }
@@ -180,7 +180,7 @@
 #pragma mark - Protect Mehtods
 
 - (void)commomInitTitle {
-    self.titleLabel.text = NSLocalizedString(@"Text Box", nil);
+    self.titleLabel.text = NSLocalizedString(@"FreeText", nil);
     self.colorView.colorLabel.text = NSLocalizedString(@"Font Color", nil);
     self.colorView.selectedColor = self.annotStyle.fontColor;
     

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

@@ -64,6 +64,7 @@
     [color getRed:&red green:&green blue:&blue alpha:&alpha];
     self.opacitySliderView.opacitySlider.value = alpha;
     self.opacitySliderView.startLabel.text = [NSString stringWithFormat:@"%d%%", (int)((self.opacitySliderView.opacitySlider.value/1)*100)];
+    [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
 }
 
 #pragma mark - CPDFOpacitySliderViewDelegate

+ 16 - 2
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFInk/CPDFInkViewController.m

@@ -42,7 +42,8 @@
     if (@available(iOS 11.0, *)) {
         self.thicknessView.frame = CGRectMake(self.view.safeAreaInsets.left, 180, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 90);
     } else {
-        self.thicknessView.frame = CGRectMake(10, 300, self.view.frame.size.width - 20, 90);
+        self.colorView.frame = CGRectMake(0, 0, self.view.frame.size.width, 90);
+        self.thicknessView.frame = CGRectMake(0, 180, self.view.frame.size.width, 90);
     }
 }
 
@@ -75,7 +76,18 @@
 }
 
 - (void)updatePreferredContentSizeWithTraitCollection:(UITraitCollection *)traitCollection {
-    self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact ? 350 : 520);
+    if ([self.colorPicker superview]) {
+        UIDevice *currentDevice = [UIDevice currentDevice];
+        if (currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad) {
+            // This is an iPad
+            self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, 520);
+        } else {
+            // This is an iPhone or iPod touch
+            self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, 320);
+        }
+    } else {
+        self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact ? 350 : 520);
+    }
 }
 
 #pragma mark - Action
@@ -124,6 +136,8 @@
     [color getRed:&red green:&green blue:&blue alpha:&alpha];
     self.opacitySliderView.opacitySlider.value = alpha;
     self.opacitySliderView.startLabel.text = [NSString stringWithFormat:@"%d%%", (int)((self.opacitySliderView.opacitySlider.value/1)*100)];
+    
+    [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
 }
 
 #pragma mark - CPDFOpacitySliderViewDelegate

+ 19 - 29
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFShape/CPDFShapeArrowViewController.m

@@ -174,6 +174,15 @@
 - (void)updatePreferredContentSizeWithTraitCollection:(UITraitCollection *)traitCollection {
     if([self.startArrowStyleView superview] || [self.endArrowStyleView superview]) {
         self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, 120);
+    } else if ([self.colorPicker superview]) {
+        UIDevice *currentDevice = [UIDevice currentDevice];
+        if (currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad) {
+            // This is an iPad
+            self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, 520);
+        } else {
+            // This is an iPhone or iPod touch
+            self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, 320);
+        }
     } else {
         self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact ? 350 : 660);
 
@@ -273,23 +282,18 @@
             self.picker.delegate = self;
             [self presentViewController:self.picker animated:YES completion:nil];
         } else {
-            self.colorPicker = [[CPDFColorPickerView alloc] initWithFrame:self.view.frame];
+            UIDevice *currentDevice = [UIDevice currentDevice];
+            if (currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad) {
+                // This is an iPad
+                self.colorPicker = [[CPDFColorPickerView alloc] initWithFrame:CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y, self.view.frame.size.width, 520)];
+            } else {
+                // This is an iPhone or iPod touch
+                self.colorPicker = [[CPDFColorPickerView alloc] initWithFrame:CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y, self.view.frame.size.width, 320)];
+            }
             self.colorPicker.delegate = self;
-            self.colorPicker.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
             self.colorPicker.backgroundColor = [UIColor whiteColor];
             [self.view addSubview:self.colorPicker];
-        }
-    } else if (select == self.fillColorSelectView) {
-        if (@available(iOS 14.0, *)) {
-            self.fillPicker = [[UIColorPickerViewController alloc] init];
-            self.fillPicker.delegate = self;
-            [self presentViewController:self.fillPicker animated:YES completion:nil];
-        } else {
-            self.fillColorPicker = [[CPDFColorPickerView alloc] initWithFrame:self.view.frame];
-            self.fillColorPicker.delegate = self;
-            self.fillColorPicker.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-            self.fillColorPicker.backgroundColor = [UIColor whiteColor];
-            [self.view addSubview:self.fillColorPicker];
+            [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
         }
     }
 }
@@ -322,19 +326,13 @@
         if (self.lineDelegate && [self.lineDelegate respondsToSelector:@selector(arrowViewController:annotStyle:)]) {
             [self.lineDelegate arrowViewController:self annotStyle:self.annotStyle];
         }
-    } else if (colorPickerView == self.fillColorPicker) {
-        self.sampleView.interiorColor = color;
-        self.annotStyle.interiorColor = color;
-        [self.sampleView setNeedsDisplay];
-        if (self.lineDelegate && [self.lineDelegate respondsToSelector:@selector(arrowViewController:annotStyle:)]) {
-            [self.lineDelegate arrowViewController:self annotStyle:self.annotStyle];
-        }
     }
     
     CGFloat red, green, blue, alpha;
     [color getRed:&red green:&green blue:&blue alpha:&alpha];
     self.opacitySliderView.opacitySlider.value = alpha;
     self.opacitySliderView.startLabel.text = [NSString stringWithFormat:@"%d%%", (int)((self.opacitySliderView.opacitySlider.value/1)*100)];
+    [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
 }
 
 #pragma mark - UIColorPickerViewControllerDelegate
@@ -347,15 +345,7 @@
             [self.lineDelegate arrowViewController:self annotStyle:self.annotStyle];
         }
         [self.sampleView setNeedsDisplay];
-    } else if (viewController == self.fillPicker) {
-        self.sampleView.interiorColor = viewController.selectedColor;
-        self.annotStyle.interiorColor = viewController.selectedColor;
-        [self.sampleView setNeedsDisplay];
-        if (self.lineDelegate && [self.lineDelegate respondsToSelector:@selector(arrowViewController:annotStyle:)]) {
-            [self.lineDelegate arrowViewController:self annotStyle:self.annotStyle];
-        }
     }
-    
     CGFloat red, green, blue, alpha;
     [viewController.selectedColor getRed:&red green:&green blue:&blue alpha:&alpha];
     self.opacitySliderView.opacitySlider.value = alpha;

+ 41 - 13
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFShape/CPDFShapeCircleViewController.m

@@ -65,7 +65,6 @@
     self.scrcollView.contentSize = CGSizeMake(self.view.frame.size.width, 550);
     
     if (@available(iOS 11.0, *)) {
-        self.colorPicker.frame = CGRectMake(self.view.safeAreaInsets.left, 0, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, self.view.frame.size.height);
         self.colorView.frame = CGRectMake(self.view.safeAreaInsets.left, 0,self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 90);
         self.fillColorSelectView.frame = CGRectMake(self.view.safeAreaInsets.left, 90, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 90);
         self.opacitySliderView.frame = CGRectMake(self.view.safeAreaInsets.left, 180, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 90);
@@ -73,12 +72,11 @@
         self.dottedView.frame = CGRectMake(self.view.safeAreaInsets.left, 360, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 90);
         self.backBtn.frame = CGRectMake(self.view.frame.size.width - 60 - self.view.safeAreaInsets.right, 5, 50, 50);
     } else {
-        self.colorPicker.frame = self.view.frame;
-        self.colorView.frame = CGRectMake(0, 120, self.view.frame.size.width, 90);
-        self.opacitySliderView.frame = CGRectMake(0, 300, self.view.frame.size.width, 90);
-        self.fillColorSelectView.frame = CGRectMake(0, 210, self.view.frame.size.width, 90);
-        self.thicknessView.frame = CGRectMake(0, 390, self.view.frame.size.width, 90);
-        self.dottedView.frame = CGRectMake(0, 470, self.view.frame.size.width, 90);
+        self.colorView.frame = CGRectMake(0, 0, self.view.frame.size.width, 90);
+        self.opacitySliderView.frame = CGRectMake(0, 180, self.view.frame.size.width, 90);
+        self.fillColorSelectView.frame = CGRectMake(0, 90, self.view.frame.size.width, 90);
+        self.thicknessView.frame = CGRectMake(0, 270, self.view.frame.size.width, 90);
+        self.dottedView.frame = CGRectMake(0, 360, self.view.frame.size.width, 90);
         self.backBtn.frame = CGRectMake(self.view.frame.size.width - 60, 5, 50, 50);
     }
     
@@ -116,7 +114,7 @@
             break;
         case CPDFViewAnnotationModeSquare:
         {
-            self.titleLabel.text = NSLocalizedString(@"Rectangle", nil);
+            self.titleLabel.text = NSLocalizedString(@"Square", nil);
         }
             break;
         case CPDFViewAnnotationModeArrow:
@@ -143,7 +141,19 @@
 }
 
 - (void)updatePreferredContentSizeWithTraitCollection:(UITraitCollection *)traitCollection {
-    self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact ? 350 : 660);
+    if ([self.colorPicker superview] || [self.fillColorPicker superview]) {
+        UIDevice *currentDevice = [UIDevice currentDevice];
+        if (currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad) {
+            // This is an iPad
+            self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, 520);
+        } else {
+            // This is an iPhone or iPod touch
+            self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, 320);
+        }
+       
+    } else {
+        self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact ? 350 : 660);
+    }
 }
 
 - (void)updateBordColor:(UIColor *)color {
@@ -242,11 +252,19 @@
             self.picker.delegate = self;
             [self presentViewController:self.picker animated:YES completion:nil];
         } else {
-            self.colorPicker = [[CPDFColorPickerView alloc] initWithFrame:self.view.frame];
+            UIDevice *currentDevice = [UIDevice currentDevice];
+            if (currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad) {
+                // This is an iPad
+                self.colorPicker = [[CPDFColorPickerView alloc] initWithFrame:CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y, self.view.frame.size.width, 520)];
+            } else {
+                // This is an iPhone or iPod touch
+                self.colorPicker = [[CPDFColorPickerView alloc] initWithFrame:CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y, self.view.frame.size.width, 320)];
+            }
             self.colorPicker.delegate = self;
-            self.colorPicker.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
             self.colorPicker.backgroundColor = [UIColor whiteColor];
             [self.view addSubview:self.colorPicker];
+            
+            [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
         }
     } else if (select == self.fillColorSelectView) {
         if (@available(iOS 14.0, *)) {
@@ -254,11 +272,19 @@
             self.fillPicker.delegate = self;
             [self presentViewController:self.fillPicker animated:YES completion:nil];
         } else {
-            self.fillColorPicker = [[CPDFColorPickerView alloc] initWithFrame:self.view.frame];
+            UIDevice *currentDevice = [UIDevice currentDevice];
+            if (currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad) {
+                // This is an iPad
+                self.fillColorPicker = [[CPDFColorPickerView alloc] initWithFrame:CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y, self.view.frame.size.width, 520)];
+            } else {
+                // This is an iPhone or iPod touch
+                self.fillColorPicker = [[CPDFColorPickerView alloc] initWithFrame:CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y, self.view.frame.size.width, 320)];
+            }
             self.fillColorPicker.delegate = self;
-            self.fillColorPicker.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
             self.fillColorPicker.backgroundColor = [UIColor whiteColor];
             [self.view addSubview:self.fillColorPicker];
+            
+            [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
         }
     }
 }
@@ -284,6 +310,8 @@
     [color getRed:&red green:&green blue:&blue alpha:&alpha];
     self.opacitySliderView.opacitySlider.value = alpha;
     self.opacitySliderView.startLabel.text = [NSString stringWithFormat:@"%d%%", (int)((self.opacitySliderView.opacitySlider.value/1)*100)];
+    
+    [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
 }
 
 #pragma mark - UIColorPickerViewControllerDelegate

+ 37 - 17
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CPDFSignatureEditViewController.m

@@ -84,7 +84,7 @@
     [self.view addSubview:self.segmentedControl];
     
     self.emptyLabel = [[UILabel alloc] init];
-    self.emptyLabel.font = [UIFont systemFontOfSize:23];
+    self.emptyLabel.font = [UIFont systemFontOfSize:22];
     self.emptyLabel.textColor = [UIColor grayColor];
     self.emptyLabel.text = NSLocalizedString(@"Enter your signature", nil);
     self.emptyLabel.textAlignment = NSTextAlignmentCenter;
@@ -115,7 +115,7 @@
     [self.view addSubview:self.thicknessView];
     
     self.thicknessLabel = [[UILabel alloc] init];
-    self.thicknessLabel.text = NSLocalizedString(@"Thicness", nil);
+    self.thicknessLabel.text = NSLocalizedString(@"Thickness", nil);
     self.thicknessLabel.textColor = [UIColor grayColor];
     self.thicknessLabel.font = [UIFont systemFontOfSize:12.0];
     [self.thicknessView addSubview:self.thicknessLabel];
@@ -188,7 +188,6 @@
 - (void)viewWillLayoutSubviews {
     [super viewWillLayoutSubviews];
     self.headerView.frame = CGRectMake(0, 0, self.view.frame.size.width, 50);
-    self.colorPicker.frame = CGRectMake(0, self.view.frame.size.height/2, self.view.frame.size.width, self.view.frame.size.height/2);
     self.segmentedControl.frame = CGRectMake((self.view.frame.size.width - 220)/2, 10, 220, 30);
     self.emptyLabel.frame = CGRectMake((self.view.frame.size.width - 200)/2, (self.view.frame.size.height - 50)/2, 200, 50);
    
@@ -254,19 +253,31 @@
 #pragma mark - Private Methods
 
 - (void)updatePreferredContentSizeWithTraitCollection:(UITraitCollection *)traitCollection {
-    CGFloat width = [UIScreen mainScreen].bounds.size.width;
-    CGFloat height = [UIScreen mainScreen].bounds.size.height;
-    
-    CGFloat mWidth = fmin(width, height);
-    CGFloat mHeight = fmax(width, height);
-    
-    UIDevice *currentDevice = [UIDevice currentDevice];
-    if (currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad) {
-        // This is an iPad
-        self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact ? mWidth*0.5 : mHeight*0.6);
+    if ([self.colorPicker superview]) {
+        UIDevice *currentDevice = [UIDevice currentDevice];
+        if (currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad) {
+            // This is an iPad
+            self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, 520);
+        } else {
+            // This is an iPhone or iPod touch
+            self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, 320);
+        }
+       
     } else {
-        // This is an iPhone or iPod touch
-        self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact ? mWidth*0.9 : mHeight*0.9);
+        CGFloat width = [UIScreen mainScreen].bounds.size.width;
+        CGFloat height = [UIScreen mainScreen].bounds.size.height;
+        
+        CGFloat mWidth = fmin(width, height);
+        CGFloat mHeight = fmax(width, height);
+        
+        UIDevice *currentDevice = [UIDevice currentDevice];
+        if (currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad) {
+            // This is an iPad
+            self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact ? mWidth*0.5 : mHeight*0.6);
+        } else {
+            // This is an iPhone or iPod touch
+            self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact ? mWidth*0.9 : mHeight*0.9);
+        }
     }
 }
 
@@ -580,11 +591,18 @@
         picker.delegate = self;
         [self presentViewController:picker animated:YES completion:nil];
     } else {
-        self.colorPicker = [[CPDFColorPickerView alloc] initWithFrame:self.view.frame];
+        UIDevice *currentDevice = [UIDevice currentDevice];
+        if (currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad) {
+            // This is an iPad
+            _colorPicker = [[CPDFColorPickerView alloc] initWithFrame:CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y, self.view.frame.size.width, 520)];
+        } else {
+            // This is an iPhone or iPod touch
+            _colorPicker = [[CPDFColorPickerView alloc] initWithFrame:CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y, self.view.frame.size.width, 320)];
+        }
         self.colorPicker.delegate = self;
-        self.colorPicker.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
         self.colorPicker.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
         [self.view addSubview:self.colorPicker];
+        [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
     }
 }
 
@@ -594,6 +612,8 @@
     self.signatureDrawTextView.color = color;
     self.textField.textColor = color;
     [self.signatureDrawImageView setNeedsDisplay];
+    
+    [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
 }
 
 #pragma mark - UIColorPickerViewControllerDelegate

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

@@ -60,7 +60,7 @@
     self.titleLabel = [[UILabel alloc] init];
     self.titleLabel.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;
     self.titleLabel.font = [UIFont systemFontOfSize:20];
-    self.titleLabel.text = NSLocalizedString(@"Signature", nil);
+    self.titleLabel.text = NSLocalizedString(@"Signatures", nil);
     self.titleLabel.textAlignment = NSTextAlignmentCenter;
     self.titleLabel.adjustsFontSizeToFitWidth = YES;
     [self.headerView addSubview:self.titleLabel];

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

@@ -64,6 +64,8 @@
     [color getRed:&red green:&green blue:&blue alpha:&alpha];
     self.opacitySliderView.opacitySlider.value = alpha;
     self.opacitySliderView.startLabel.text = [NSString stringWithFormat:@"%d%%", (int)((self.opacitySliderView.opacitySlider.value/1)*100)];
+    
+    [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
 }
 
 #pragma mark - CPDFOpacitySliderViewDelegate

+ 4 - 4
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CPDFStampViewController.m

@@ -151,10 +151,10 @@ PDFAnnotationStampKey const PDFAnnotationStampKeyShape = @"PDFAnnotationStampKey
         self.textButton.frame = CGRectMake(self.view.frame.size.width - 180 - self.view.safeAreaInsets.right, self.view.bounds.size.height - 320 - self.view.safeAreaInsets.bottom, 160, 40);
         self.imageButton.frame = CGRectMake(self.view.frame.size.width - 180 - self.view.safeAreaInsets.right, self.view.bounds.size.height - 270 - self.view.safeAreaInsets.bottom, 160, 40);
     } else {
-        self.backBtn.frame = CGRectMake(self.view.frame.size.width - 100, 5, 50, 50);
-        self.createButton.frame = CGRectMake(self.view.frame.size.width - 70, self.view.frame.size.height - 100, 50, 50);
-        self.textButton.frame = CGRectMake(self.view.frame.size.width - 70, self.view.frame.size.height - 220, 160, 40);
-        self.imageButton.frame = CGRectMake(self.view.frame.size.width - 70, self.view.frame.size.height - 170, 160, 40);
+        self.backBtn.frame = CGRectMake(self.view.frame.size.width - 60, 5, 50, 50);
+        self.createButton.frame = CGRectMake(self.view.frame.size.width - 60, self.view.frame.size.height - 200, 50, 50);
+        self.textButton.frame = CGRectMake(self.view.frame.size.width - 180, self.view.frame.size.height - 320, 160, 40);
+        self.imageButton.frame = CGRectMake(self.view.frame.size.width - 180, self.view.frame.size.height - 270, 160, 40);
     }
     self.modelView.frame = CGRectMake(0, -200, self.view.bounds.size.width, self.view.bounds.size.height+200);
 }

+ 2 - 2
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampFileManger.m

@@ -218,7 +218,7 @@
             
             if (stampItem)
             {
-                [_stampTextList addObject:stampItem];
+                [_stampTextList insertObject:stampItem atIndex:0];
                 if ([self saveStampDataToFile:PDFStampCustomType_Text])
                     return YES;
                 else
@@ -234,7 +234,7 @@
             
             if (stampItem)
             {
-                [_stampImageList addObject:stampItem];
+                [_stampImageList insertObject:stampItem atIndex:0];
                 if ([self saveStampDataToFile:PDFStampCustomType_Image])
                     return YES;
                 else

+ 1 - 1
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampPreview.m

@@ -78,7 +78,7 @@ static float c01, c02, c03, c11, c12, c13;
     else if (_textStampHaveDate && _textStampHaveTime)
     {
         [outputFormatter setDateFormat:@"yyyy/MM/dd HH:mm"];
-        tDate = [tDate stringByAppendingString:[outputFormatter stringFromDate:[NSDate date]]];
+        tDate = [outputFormatter stringFromDate:[NSDate date]];
     }
     
     return tDate;

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

@@ -167,8 +167,9 @@
         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, 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.doneBtn.frame = CGRectMake(self.view.frame.size.width - 60, 5, 50, 50);
+        self.colorView.frame = CGRectMake(0, 270, self.view.frame.size.width, 60);
+        self.stampShapeViw.frame = CGRectMake(0, 180, self.view.frame.size.width, 90);
         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);

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

@@ -59,6 +59,8 @@
     [color getRed:&red green:&green blue:&blue alpha:&alpha];
     self.opacitySliderView.opacitySlider.value = alpha;
     self.opacitySliderView.startLabel.text = [NSString stringWithFormat:@"%d%%", (int)((self.opacitySliderView.opacitySlider.value/1)*100)];
+    
+    [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
 }
 
 #pragma mark - CPDFOpacitySliderViewDelegate

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

@@ -65,6 +65,8 @@
     [color getRed:&red green:&green blue:&blue alpha:&alpha];
     self.opacitySliderView.opacitySlider.value = alpha;
     self.opacitySliderView.startLabel.text = [NSString stringWithFormat:@"%d%%", (int)((self.opacitySliderView.opacitySlider.value/1)*100)];
+    
+    [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
 }
 
 #pragma mark - CPDFOpacitySliderViewDelegate

+ 6 - 6
compdfkit-tools/compdfkit-tools/Common/Controls/BOTA/CPDFBOTAViewController.m

@@ -68,21 +68,21 @@
     NSMutableArray *segmmentTitleArray = [NSMutableArray array];
     for (NSNumber *num in self.segmmentArray) {
         if(CPDFBOTATypeStateOutline == num.integerValue) {
-            [segmmentTitleArray addObject:NSLocalizedString(@"Outline", nil)];
+            [segmmentTitleArray addObject:NSLocalizedString(@"Outlines", nil)];
             self.outlineViewController = [[CPDFOutlineViewController alloc] initWithPDFView:self.pdfView];
             self.outlineViewController.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleTopMargin;
             self.outlineViewController.delegate = self;
             [self addChildViewController:self.outlineViewController];
 
         } else if(CPDFBOTATypeStateBookmark == num.integerValue) {
-            [segmmentTitleArray addObject:NSLocalizedString(@"Bookmark", nil)];
+            [segmmentTitleArray addObject:NSLocalizedString(@"Bookmarks", nil)];
             _bookmarkViewController = [[CPDFBookmarkViewController alloc] initWithPDFView:self.pdfView];
             _bookmarkViewController.delegate = self;
             _bookmarkViewController.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleTopMargin;
             [self addChildViewController:_bookmarkViewController];
 
         } else if(CPDFBOTATypeStateAnnotation == num.integerValue) {
-            [segmmentTitleArray addObject:NSLocalizedString(@"Annotation", nil)];
+            [segmmentTitleArray addObject:NSLocalizedString(@"Annotations", nil)];
             _annotationViewController = [[CPDFAnnotationViewController alloc] initWithPDFView:self.pdfView];
             _annotationViewController.delegate = self;
             _annotationViewController.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleTopMargin;
@@ -136,11 +136,11 @@
         _annotationViewController.view.frame = CGRectMake(0, self.view.safeAreaInsets.top + 80, self.view.bounds.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, self.view.bounds.size.height - self.view.safeAreaInsets.top - self.view.safeAreaInsets.bottom - 80);
 
     } else {
-        self.outlineViewController.view.frame = CGRectMake(0, 64 + 44, self.view.bounds.size.width - 64 - 30, self.view.bounds.size.height - 64 - 44 - 30);
+        self.outlineViewController.view.frame = CGRectMake(0, 64 + 44, self.view.bounds.size.width, self.view.bounds.size.height - 64 - 44 - 30);
         
-        _bookmarkViewController.view.frame = CGRectMake(0, 64 + 44, self.view.bounds.size.width - 64 - 30, self.view.bounds.size.height - 64 - 30 - 44);
+        _bookmarkViewController.view.frame = CGRectMake(0, 64 + 44, self.view.bounds.size.width, self.view.bounds.size.height - 64 - 30 - 44);
         
-        _annotationViewController.view.frame = CGRectMake(0, 64 + 44, self.view.bounds.size.width - 64 - 30, self.view.bounds.size.height - 64 - 30 - 44);
+        _annotationViewController.view.frame = CGRectMake(0, 64 + 44, self.view.bounds.size.width, self.view.bounds.size.height - 64 - 30 - 44);
 
     }
 }

+ 1 - 0
compdfkit-tools/compdfkit-tools/Common/Controls/PDFViewController/CPDFViewBaseController.m

@@ -473,6 +473,7 @@
             
         case CPDFPopMenuViewTypeAddFile: {
             [self enterPDFAddFile];
+            break;
         }
 
         case CPDFPopMenuViewTypePageEdit: {

+ 5 - 8
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/CPDFAnnotationBar.m

@@ -983,18 +983,15 @@
                     NSDateFormatter *outputFormatter = [[NSDateFormatter alloc] init];
                     [outputFormatter setTimeZone:timename];
                     if (stampShowDate && !stampShowTime){
-                        detailText = [NSDateFormatter localizedStringFromDate:[NSDate date]
-                                                                    dateStyle:NSDateFormatterShortStyle
-                                                                    timeStyle:NSDateFormatterNoStyle];
+                        [outputFormatter setDateFormat:@"yyyy/MM/dd"];
+                        detailText = [outputFormatter stringFromDate:[NSDate date]];
+
                     } else if (stampShowTime && !stampShowDate) {
                         [outputFormatter setDateFormat:@"HH:mm:ss"];
                         detailText = [outputFormatter stringFromDate:[NSDate date]];
                     } else if (stampShowDate && stampShowTime) {
-                        [outputFormatter setDateFormat:@" HH:mm"];
-                        detailText = [NSDateFormatter localizedStringFromDate:[NSDate date]
-                                                                    dateStyle:NSDateFormatterShortStyle
-                                                                    timeStyle:NSDateFormatterNoStyle];
-                        detailText = [detailText stringByAppendingString:[outputFormatter stringFromDate:[NSDate date]]];
+                        [outputFormatter setDateFormat:@"yyyy/MM/dd HH:mm"];
+                        detailText = [outputFormatter stringFromDate:[NSDate date]];
                     }
                     
                     CPDFStampAnnotation *annotation = [[CPDFStampAnnotation alloc] initWithDocument:self.annotManage.pdfListView.document text:stampText detailText:detailText style:stampStyle shape:stampShape];

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

@@ -35,7 +35,7 @@
 }
 
 - (void)setUp {
-    self.menuItemTitleArr = [@[NSLocalizedString(@"View Settings", nil), NSLocalizedString(@"Document Info", nil), NSLocalizedString(@"Share", nil), NSLocalizedString(@"Open...", nil), NSLocalizedString(@"Page Edit", nil)] mutableCopy];
+    self.menuItemTitleArr = [@[NSLocalizedString(@"View Setting", nil), NSLocalizedString(@"Document Info", nil), NSLocalizedString(@"Share", nil), NSLocalizedString(@"Open...", nil), NSLocalizedString(@"Page Edit", nil)] mutableCopy];
     self.menuItemIconArr = [@[@"CNavigationImageNamePreview", @"CNavigationImageNameInformation", @"CNavigationImageNameShare", @"CNavigationImageNameNewFile", @"CNavigationImageNamePageEditTool"] mutableCopy];
     
     self.tableView = [[UITableView alloc] init];

+ 7 - 9
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFColorPickerView.m

@@ -41,21 +41,19 @@
 
 - (instancetype)initWithFrame:(CGRect)frame {
     if (self == [super initWithFrame:frame]) {
-        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake((self.frame.size.width - 120)/2, 0, 120, (self.bounds.size.height - 40)/6)];
+        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake((self.frame.size.width - 120)/2, 0, 120, 50)];
         _titleLabel.text = NSLocalizedString(@"Custom Color", nil);
         _titleLabel.adjustsFontSizeToFitWidth = YES;
-        _titleLabel.autoresizingMask  = UIViewAutoresizingFlexibleHeight;
         [self addSubview:self.titleLabel];
         
-        _backBtn = [[UIButton alloc] initWithFrame:CGRectMake(10, 0, 40, (self.bounds.size.height - 40)/6)];
-        _backBtn.autoresizingMask = UIViewAutoresizingFlexibleHeight;
-        [_backBtn setImage:[UIImage imageNamed:@"CPDFAnnotationBarImageUndo" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-        [_backBtn sizeToFit];
+        _backBtn = [[UIButton alloc] initWithFrame:CGRectMake(10, 0, 50, 50)];
+        _backBtn.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
+        [_backBtn setImage:[UIImage imageNamed:@"CPFFormBack" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
         [_backBtn addTarget:self action:@selector(buttonItemClicked_back:) forControlEvents:UIControlEventTouchUpInside];
         [self addSubview:self.backBtn];
         
-        _selectedLabel = [[UILabel alloc] initWithFrame:CGRectMake(15, (self.bounds.size.height - 40)/6, self.bounds.size.width - 30, (self.bounds.size.height - 40)/6 * 3)];
-        _selectedLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleTopMargin;
+        _selectedLabel = [[UILabel alloc] initWithFrame:CGRectMake(15, 50, self.bounds.size.width - 30, (self.bounds.size.height - 40)/6 * 3)];
+        _selectedLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
         _selectedLabel.userInteractionEnabled = YES;
         _gradientLayers = [CAGradientLayer layer];
         _gradientLayers.startPoint = CGPointMake(0.0f, 0.5f);
@@ -94,7 +92,7 @@
         
         [self reloadData];
         
-        self.backgroundColor = [CPDFColorUtils CPDFViewControllerBackgroundColor];
+        self.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
     }
     return self;
 }

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

@@ -46,7 +46,7 @@
         self.startLabel.textAlignment = NSTextAlignmentCenter;
         self.startLabel.layer.borderColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.1].CGColor;
         self.startLabel.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;
-        self.startLabel.textColor = [CPDFColorUtils CFormFontColor];
+        self.startLabel.textColor = [CPDFColorUtils CPageEditToolbarFontColor];;
         [self addSubview:self.startLabel];
         
         self.thick = 1;

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

@@ -23,9 +23,9 @@ static NSString *CPDFAnnotationPropertiesObservationContext = @"CPDFAnnotationPr
 - (void)registerAsObserver {
     self.undoPDFManager = [[NSUndoManager alloc]init];
     
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(PDFPageDidLoadAnnotationNotification:) name:@"CPDFPageDidLoadAnnotationNotification" object:nil];
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(PDFPageDidAddAnnotationNotification:) name:@"CPDFPageDidAddAnnotationNotification" object:nil];
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(PDFPageDidRemoveAnnotationNotification:) name:@"CPDFPageDidRemoveAnnotationNotification" object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(PDFPageDidLoadAnnotationNotification:) name:CPDFPageDidLoadAnnotationNotification object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(PDFPageDidAddAnnotationNotification:) name:CPDFPageDidAddAnnotationNotification object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(PDFPageDidRemoveAnnotationNotification:) name:CPDFPageDidRemoveAnnotationNotification object:nil];
     
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(redoChangeNotification:)
                                                  name:NSUndoManagerDidUndoChangeNotification object:[self undoPDFManager]];

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

@@ -309,8 +309,7 @@ NSNotificationName const CPDFListViewAnnotationsOperationChangeNotification = @"
     
     __weak typeof(self) weakSelf = self;
     _pageIndicatorView.touchCallBack = ^{
-        NSString *str = [NSString stringWithFormat:@" Please enter the page numberPage(1/%lu)", weakSelf.document.pageCount];
-        UIAlertController *alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"Enter a page number", nil) message:nil preferredStyle:UIAlertControllerStyleAlert];
+        UIAlertController *alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"Enter a Page Number", nil) message:nil preferredStyle:UIAlertControllerStyleAlert];
         weakSelf.alert = alertController;
         
         [alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
@@ -334,7 +333,7 @@ NSNotificationName const CPDFListViewAnnotationsOperationChangeNotification = @"
         }]];
         
         [alertController addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {
-            NSString *str = [NSString stringWithFormat:@"Page(1/%lu)", weakSelf.document.pageCount];
+            NSString *str = [NSString stringWithFormat:@"Page(1~%lu)", weakSelf.document.pageCount];
             textField.placeholder = NSLocalizedString(str, nil);
             textField.keyboardType = UIKeyboardTypeNumberPad;
             textField.clearButtonMode = UITextFieldViewModeWhileEditing;
@@ -383,6 +382,14 @@ NSNotificationName const CPDFListViewAnnotationsOperationChangeNotification = @"
             [self.performDelegate PDFListViewChangeatioActiveAnnotations:self forActiveAnnotations:self.activeAnnotations];
         }
     } else if (!activeAnnotations && self.activeAnnotations.count > 0) {
+        for (CPDFAnnotation *annotation in self.activeAnnotations) {
+            if ([annotation isKindOfClass:[CPDFLinkAnnotation class]]) {
+                CPDFLinkAnnotation *link = (CPDFLinkAnnotation *)annotation;
+                if (!(link.destination || (link.URL && link.URL.length >0)))
+                    [link.page removeAnnotation:link];
+            }
+        }
+        
         [self.activeAnnotations removeAllObjects];
         
         dispatch_async(dispatch_get_main_queue(), ^{

+ 2 - 0
compdfkit-tools/compdfkit-tools/PageEdit/Control/CPDFPDFInsertViewController.h

@@ -40,6 +40,8 @@ typedef NS_ENUM(NSInteger, CPDFPDFInsertType) {
 
 @property (nonatomic, assign) NSInteger currentPageIndex;
 
+@property (nonatomic, assign) NSInteger currentPageCout;
+
 @end
 
 NS_ASSUME_NONNULL_END

Diferenças do arquivo suprimidas por serem muito extensas
+ 6 - 3
compdfkit-tools/compdfkit-tools/PageEdit/Control/CPDFPDFInsertViewController.m


+ 11 - 7
compdfkit-tools/compdfkit-tools/PageEdit/Control/CPDFPageEditViewController.m

@@ -56,9 +56,12 @@
     self.headerView.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
     [self.view addSubview:self.headerView];
     
+//    [self.titleLabel removeFromSuperview];
     self.titleLabel.text =  NSLocalizedString(@"Page Edit", nil);
+    self.titleLabel.frame = CGRectMake((self.view.frame.size.width - 120)/2, 65, 120, 50);
     self.titleLabel.textAlignment = NSTextAlignmentCenter;
     [self.backBtn setImage:[UIImage imageNamed:@"CPDFPageEitImageBack" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
+    self.navigationItem.titleView = self.titleLabel;
     
     [self.headerView addSubview:self.titleLabel];
     [self.headerView addSubview:self.backBtn];
@@ -98,6 +101,7 @@
 }
 
 - (void)viewWillLayoutSubviews {
+//    [super viewWillLayoutSubviews];
     CGFloat height = 50.0;
     if (@available(iOS 11.0, *))
         height += self.view.safeAreaInsets.bottom;
@@ -116,17 +120,17 @@
         self.doneBtn.frame = CGRectMake(self.view.frame.size.width - self.view.safeAreaInsets.right - 70, self.view.safeAreaInsets.top, 50, 50);
         self.selectAllBtn.frame = CGRectMake(self.view.frame.size.width - self.view.safeAreaInsets.right - 130, self.view.safeAreaInsets.top, 50, 50);
     } else {
-        self.headerView.frame = CGRectMake(0, 0, self.view.frame.size.width, 120);
-        self.titleLabel.frame = CGRectMake((self.view.frame.size.width - 120)/2, 65, 120, 50);
+        self.headerView.frame = CGRectMake(0, 5, self.view.frame.size.width, 50);
+        self.titleLabel.frame = CGRectMake((self.view.frame.size.width - 120)/2, 5, 120, 50);
         if (self.isEdit) {
             self.collectionView.frame = CGRectMake(0, 50, self.view.frame.size.width, self.view.frame.size.height - 110);
         } else {
-            self.collectionView.frame = CGRectMake(0, 50, self.view.frame.size.width, self.view.frame.size.height - 60);
+            self.collectionView.frame = CGRectMake(0, 50, self.view.frame.size.width, self.view.frame.size.height - 50);
         }
-        self.backBtn.frame = CGRectMake(self.view.frame.size.width - 60, 65, 50, 50);
-        self.editBtn.frame = CGRectMake(self.view.frame.size.width - 70, 65, 50, 50);
-        self.doneBtn.frame = CGRectMake(self.view.frame.size.width - 70, 65, 50, 50);
-        self.selectAllBtn.frame = CGRectMake(self.view.frame.size.width - 120, 65, 50, 50);
+        self.backBtn.frame = CGRectMake(20, 5, 50, 50);
+        self.editBtn.frame = CGRectMake(self.view.frame.size.width - 70, 5, 50, 50);
+        self.doneBtn.frame = CGRectMake(self.view.frame.size.width - 70, 0, 50, 50);
+        self.selectAllBtn.frame = CGRectMake(self.view.frame.size.width - 120, 0, 50, 50);
     }
 }
 

+ 2 - 0
compdfkit-tools/compdfkit-tools/PageEdit/Control/CPDFPageInsertViewController.h

@@ -37,6 +37,8 @@ typedef NS_ENUM(NSInteger, CPDFPageInsertType) {
 
 @property (nonatomic, assign) NSInteger currentPageIndex;
 
+@property (nonatomic, assign) NSInteger currentPageCout;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 17 - 3
compdfkit-tools/compdfkit-tools/PageEdit/Control/CPDFPageInsertViewController.m

@@ -49,7 +49,7 @@
 
 - (NSArray *)dataArray {
     if (!_dataArray) {
-        NSArray *dataArray = @[NSLocalizedString(@"Page Size", nil), NSLocalizedString(@"Page Direction", nil), NSLocalizedString(@"Page Location", nil),NSLocalizedString(@"Home page", nil), NSLocalizedString(@"Last page", nil), NSLocalizedString(@"Insert before specifiled page", nil), NSLocalizedString(@"Please enter a page", nil), NSLocalizedString(@"Insert after specifiled page", nil)];
+        NSArray *dataArray = @[NSLocalizedString(@"Page Size", nil), NSLocalizedString(@"Page Direction", nil), NSLocalizedString(@"Isert TO", nil),NSLocalizedString(@"First Page", nil), NSLocalizedString(@"Last Page", nil), NSLocalizedString(@"Insert Before Specifiled Page", nil), NSLocalizedString(@"Please Enter a Page", nil), NSLocalizedString(@"Insert After Specifiled Page", nil)];
         _dataArray = dataArray;
     }
     return _dataArray;
@@ -144,11 +144,21 @@
 
 #pragma mark - Private Methods
 
+- (void)popoverWarning {
+    UIAlertAction *OKAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil)
+                                                           style:UIAlertActionStyleDefault
+                                                     handler:^(UIAlertAction *action) {
+    }];
+    UIAlertController *alert = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"Warning", nil)
+                                                                   message:NSLocalizedString(@"The page range is invalid or out of range. Please enter the valid page.", nil)
+                                                            preferredStyle:UIAlertControllerStyleAlert];
+    [alert addAction:OKAction];
+    [self presentViewController:alert animated:YES completion:nil];
+}
+
 - (void)setPageSizeRefresh {
     NSArray *szieArray = @[@"A3 (297 X 420mm)", @"A4 (210 X 297mm)", @"A5 (148 X 210mm)"];
     if (self.isSelect) {
-        NSIndexPath* path = [NSIndexPath indexPathForRow:0 inSection:0];
-        CInsertBlankPageCell *cell = [self.tableView cellForRowAtIndexPath:path];
         NSInteger index = [szieArray indexOfObject:self.pageType];
         
         switch (index) {
@@ -494,6 +504,10 @@
 }
 
 - (void)insertBlankPageCell:(CInsertBlankPageCell *)insertBlankPageCell pageIndex:(NSInteger)pageIndex {
+    if (pageIndex > self.currentPageCout) {
+        [self popoverWarning];
+    }
+    
     self.pageModel.pageIndex = pageIndex-1;
     if (self.pageInsertType == CPDFPageInsertTypeBefore) {
         self.pageModel.pageIndex = self.pageModel.pageIndex-1;

+ 5 - 3
compdfkit-tools/compdfkit-tools/PageEdit/Views/CPageEditToolBar.m

@@ -128,9 +128,10 @@
 }
 
 - (void)insertPage {
-    UIAlertAction *insertBlankPageAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Insert a blank page", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
+    UIAlertAction *insertBlankPageAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Blank Page", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
         CPDFPageInsertViewController *pageInsertVC = [[CPDFPageInsertViewController alloc] init];
         pageInsertVC.currentPageIndex = self.currentPageIndex;
+        pageInsertVC.currentPageCout = self.pdfView.document.pageCount;
         pageInsertVC.delegate = self;
         
         UIViewController *tRootViewControl = [UIApplication sharedApplication].keyWindow.rootViewController;
@@ -139,7 +140,7 @@
         }
         [tRootViewControl presentViewController:pageInsertVC animated:YES completion:nil];
     }];
-    UIAlertAction *insertPdfPageAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Insert a PDF page", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
+    UIAlertAction *insertPdfPageAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"From PDF", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
         [self enterPDFAddFile];
     }];
     UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil) style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
@@ -189,6 +190,7 @@
         CPDFPDFInsertViewController *pdfInsertVC = [[CPDFPDFInsertViewController alloc] initWithDocument:self.insertDocument];
         pdfInsertVC.delegate = self;
         pdfInsertVC.currentPageIndex =  self.currentPageIndex;
+        pdfInsertVC.currentPageCout = self.pdfView.document.pageCount;
         
         UIViewController *tRootViewControl = [UIApplication sharedApplication].keyWindow.rootViewController;
         if ([tRootViewControl presentedViewController]) {
@@ -209,7 +211,7 @@
         [self reloadData];
     }];
     UIAlertController *alert = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"Warning", nil)
-                                                                   message:NSLocalizedString(@"Sorry,you did not select the page", nil)
+                                                                   message:NSLocalizedString(@"Can not delete all pages. Please keep at least one page.", nil)
                                                             preferredStyle:UIAlertControllerStyleAlert];
     [alert addAction:OKAction];
     UIViewController *tRootViewControl = [UIApplication sharedApplication].keyWindow.rootViewController;

+ 5 - 5
compdfkit-tools/compdfkit-tools/Viewer/PDFBookmark/CPDFBookmarkViewController.m

@@ -54,7 +54,7 @@
     
     _noDataLabel = [[UILabel alloc] init];
     _noDataLabel.textColor = [UIColor grayColor];
-    _noDataLabel.text = NSLocalizedString(@"No bookmark", nil);
+    _noDataLabel.text = NSLocalizedString(@"No Bookmarks", nil);
     [_noDataLabel sizeToFit];
     _noDataLabel.center = CGPointMake(self.view.bounds.size.width/2.0, self.view.bounds.size.height/2.0);
     _noDataLabel.autoresizingMask = UIViewAutoresizingFlexibleTopMargin|UIViewAutoresizingFlexibleBottomMargin|UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleRightMargin;
@@ -114,7 +114,7 @@
 
 - (void)buttonItemClicked_add:(id)sender {
     if (![self.pdfView.document bookmarkForPageIndex:self.pdfView.currentPageIndex]) {
-        UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Add Bookmark" message:nil preferredStyle:UIAlertControllerStyleAlert];
+        UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Add Bookmarks" message:nil preferredStyle:UIAlertControllerStyleAlert];
         [alert addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {
             textField.placeholder = NSLocalizedString(@"Bookmark Title", nil);
         }];
@@ -136,7 +136,7 @@
                                                                style:UIAlertActionStyleCancel
                                                              handler:nil];
         UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil
-                                                                       message:NSLocalizedString(@"You've bookmarked about this", nil)
+                                                                       message:NSLocalizedString(@"Do you want to remove old mark?", nil)
                                                                 preferredStyle:UIAlertControllerStyleAlert];
         [alert addAction:cancelAction];
     
@@ -162,7 +162,7 @@
     }
     
     CPDFBookmark *bookmark = self.bookmarks[indexPath.row];
-    cell.pageIndexLabel.text = [NSString stringWithFormat:@"page %ld", bookmark.pageIndex+1];
+    cell.pageIndexLabel.text = [NSString stringWithFormat:@"Page %ld", bookmark.pageIndex+1];
     cell.titleLabel.text = bookmark.label;
     
     return cell;
@@ -190,7 +190,7 @@
             
         UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil) style:UIAlertActionStyleCancel handler:nil];
         
-        UIAlertAction *addAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Add", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+        UIAlertAction *addAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Create", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
             CPDFBookmarkViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
             cell.titleLabel.text = alert.textFields.firstObject.text;
             self.pdfView.document.bookmarks[indexPath.row].label = alert.textFields.firstObject.text;

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

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

+ 2 - 2
compdfkit-tools/compdfkit-tools/Viewer/PDFMore/PDFDisplaySetting/CPDFDisplayViewController.m

@@ -82,7 +82,7 @@ typedef NS_ENUM(NSUInteger, CDisplayPDFType) {
                 self.image = [UIImage imageNamed:@"CDisplayImageNameCropMode"
                                         inBundle:[NSBundle bundleForClass:self.class]
                    compatibleWithTraitCollection:nil];
-                self.titilName = NSLocalizedString(@"Crop Mode", nil);
+                self.titilName = NSLocalizedString(@"Crop", nil);
                 break;
             case CDisplayPDFTypeVerticalScrolling:
                 self.image = [UIImage imageNamed:@"CDisplayImageNameVerticalScrolling"
@@ -182,7 +182,7 @@ typedef NS_ENUM(NSUInteger, CDisplayPDFType) {
     [self.view addSubview:self.doneBtn];
     
     self.titleLabel = [[UILabel alloc] init];
-    self.titleLabel.text =  NSLocalizedString(@"Preview Settings", nil);
+    self.titleLabel.text =  NSLocalizedString(@"Preview Setting", nil);
     self.titleLabel.font = [UIFont boldSystemFontOfSize:17];
     self.titleLabel.adjustsFontSizeToFitWidth = YES;
     self.titleLabel.textAlignment = NSTextAlignmentCenter;

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

@@ -233,18 +233,18 @@
     // 3.execute
     mArray = [NSMutableArray array];
     
-    [mArray addObject:[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Allow Printing:",kDocumentInfoTitle nil),kDocumentInfoTitle, (self.pdfView.document.allowsPrinting ? NSLocalizedString(@"YES", nil) : NSLocalizedString(@"NO", nil)), kDocumentInfoValue, nil]];
+    [mArray addObject:[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Printing:",kDocumentInfoTitle nil),kDocumentInfoTitle, (self.pdfView.document.allowsPrinting ? NSLocalizedString(@"Allowed", nil) : NSLocalizedString(@"Not Allowed", nil)), kDocumentInfoValue, nil]];
     
-    [mArray addObject:[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Allow Copying:",kDocumentInfoTitle nil),kDocumentInfoTitle, (self.pdfView.document.allowsCopying ? NSLocalizedString(@"YES", nil) : NSLocalizedString(@"NO", nil)), kDocumentInfoValue, nil]];
+    [mArray addObject:[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Content Copying:",kDocumentInfoTitle nil),kDocumentInfoTitle, (self.pdfView.document.allowsCopying ? NSLocalizedString(@"Allowed", nil) : NSLocalizedString(@"Not Allowed", nil)), kDocumentInfoValue, nil]];
     
-    [mArray addObject:[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Allow Document Change:",kDocumentInfoTitle nil),kDocumentInfoTitle, (self.pdfView.document.allowsDocumentChanges ? NSLocalizedString(@"YES", nil) : NSLocalizedString(@"NO", nil)), kDocumentInfoValue, nil]];
+    [mArray addObject:[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Document Change:",kDocumentInfoTitle nil),kDocumentInfoTitle, (self.pdfView.document.allowsDocumentChanges ? NSLocalizedString(@"Allowed", nil) : NSLocalizedString(@"Not Allowed", nil)), kDocumentInfoValue, nil]];
     
-    [mArray addObject:[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Allow Document Assembly:",kDocumentInfoTitle nil),kDocumentInfoTitle, (self.pdfView.document.allowsDocumentAssembly ? NSLocalizedString(@"YES", nil) : NSLocalizedString(@"NO", nil)), kDocumentInfoValue, nil]];
+    [mArray addObject:[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Document Assembly:",kDocumentInfoTitle nil),kDocumentInfoTitle, (self.pdfView.document.allowsDocumentAssembly ? NSLocalizedString(@"Allowed", nil) : NSLocalizedString(@"Not Allowed", nil)), kDocumentInfoValue, nil]];
     
-    [mArray addObject:[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Allow Document Commenting:",kDocumentInfoTitle nil),kDocumentInfoTitle, ((self.pdfView.document.allowsCommenting == YES) ? NSLocalizedString(@"YES", nil) : NSLocalizedString(@"NO", nil)), kDocumentInfoValue, nil]];
+    [mArray addObject:[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Commenting:",kDocumentInfoTitle nil),kDocumentInfoTitle, ((self.pdfView.document.allowsCommenting == YES) ? NSLocalizedString(@"Allowed", nil) : NSLocalizedString(@"Not Allowed", nil)), kDocumentInfoValue, nil]];
     
     
-    [mArray addObject:[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Allow Document Form Field Entry:",kDocumentInfoTitle nil),kDocumentInfoTitle, ((self.pdfView.document.allowsFormFieldEntry == YES) ? NSLocalizedString(@"YES", nil) : NSLocalizedString(@"NO", nil)), kDocumentInfoValue, nil]];
+    [mArray addObject:[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Filling of Form Field:",kDocumentInfoTitle nil),kDocumentInfoTitle, ((self.pdfView.document.allowsFormFieldEntry == YES) ? NSLocalizedString(@"Allowed", nil) : NSLocalizedString(@"Not Allowed", nil)), kDocumentInfoValue, nil]];
 
     [tableArray addObject:mArray];
     

+ 1 - 1
compdfkit-tools/compdfkit-tools/Viewer/PDFOutlie/CPDFOutlineViewController.m

@@ -85,7 +85,7 @@
     
     self.noDataLabel = [[UILabel alloc] init];
     self.noDataLabel.textColor = [UIColor grayColor];
-    self.noDataLabel.text = NSLocalizedString(@"No outlines", nil);
+    self.noDataLabel.text = NSLocalizedString(@"No Outlines", nil);
     [self.noDataLabel sizeToFit];
     self.noDataLabel.center = CGPointMake(self.view.bounds.size.width/2.0, self.view.bounds.size.height/2.0);
     self.noDataLabel.autoresizingMask = UIViewAutoresizingFlexibleTopMargin|UIViewAutoresizingFlexibleBottomMargin|UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleRightMargin;

+ 4 - 6
compdfkit-tools/compdfkit-tools/Viewer/PDFSearch/CPDFSearchResultsViewController.m

@@ -93,7 +93,7 @@
     self.titleLabel = [[UILabel alloc] init];
     self.titleLabel.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;
   
-    self.titleLabel.text =  NSLocalizedString(@"Search Results", nil);
+    self.titleLabel.text =  NSLocalizedString(@"Results", nil);
     self.titleLabel.font = [UIFont systemFontOfSize:20];
     self.titleLabel.adjustsFontSizeToFitWidth = YES;
     [self.view addSubview:self.titleLabel];
@@ -139,17 +139,16 @@
         self.tableView.frame = CGRectMake(self.view.safeAreaInsets.left, self.view.safeAreaInsets.top +28 + 50, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, self.view.frame.size.height - self.view.safeAreaInsets.bottom- self.view.safeAreaInsets.top - 50);
         self.searchResultView.frame = CGRectMake(self.view.safeAreaInsets.left, self.view.safeAreaInsets.top + 50, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 28);
         self.searchResultLabel.frame = CGRectMake(70, 4, 200, 20);
-        self.searchResultLabel.text = [NSString stringWithFormat:@"%zd results found",self.resultArray.count];
+        self.searchResultLabel.text = [NSString stringWithFormat:@"%zd Results",self.resultArray.count];
         self.pageLabel.frame = CGRectMake(self.view.frame.size.width - 50, 4, 40, 20);
     } else {
         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.searchResultView.frame = CGRectMake(10, 64, self.view.frame.size.width-20, 28);
         self.searchResultLabel.frame = CGRectMake(20, 4, 200, 20);
-        self.searchResultLabel.text = [NSString stringWithFormat:@"%zd results found",self.resultArray.count];
+        self.searchResultLabel.text = [NSString stringWithFormat:@"%zd Results",self.resultArray.count];
         self.pageLabel.frame = CGRectMake(self.view.frame.size.width - 50, 4, 40, 20);
-//        self.view.bounds
-        self.tableView.frame = CGRectMake(self.view.bounds.origin.x, self.view.bounds.origin.y + 50 + 28, self.view.bounds.size.width, self.view.bounds.size.height - 50 - 28);
+        self.tableView.frame = CGRectMake(self.view.bounds.origin.x, self.view.bounds.origin.y + 50 + 36, self.view.bounds.size.width, self.view.bounds.size.height - 50 - 36);
       
     }
 }
@@ -261,7 +260,6 @@
     NSArray *array = [self.resultArray objectAtIndex:section];
     CPDFSelection *selection = array.firstObject;
     NSInteger pageIndex = [self.document indexForPage:selection.page];
-    NSString *pageStr = [NSString stringWithFormat:NSLocalizedString(@"Page %ld",nil), (long)(pageIndex+1)];
     NSString *countStr = [NSString stringWithFormat:NSLocalizedString(@"%ld",nil), (long)(pageIndex+1)];
     
     UITableViewHeaderFooterView *view = [[UITableViewHeaderFooterView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 30)];

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

@@ -213,7 +213,7 @@
     
     [_doneItem setImage:[UIImage imageNamed:@"CPDFSearchImageClose" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
     _doneItem.titleLabel.adjustsFontSizeToFitWidth = YES;
-    _searchBar.placeholder = NSLocalizedString(@"Search Text", nil);
+    _searchBar.placeholder = NSLocalizedString(@"Search", nil);
     UITextField *searchField = [_searchBar valueForKey:@"searchField"];
     searchField.adjustsFontSizeToFitWidth = YES;
     [_previousItem setImage:[UIImage imageNamed:@"CPDFSearchImagePrevious" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];

+ 5 - 12
compdfkit-tools/compdfkit-tools/Viewer/PDFThumbnail/CPDFThumbnailViewController.m

@@ -12,11 +12,11 @@
 
 #import "CPDFThumbnailViewController.h"
 #import "CPDFThumbnailViewCell.h"
-
-#import <ComPDFKit/ComPDFKit.h>
 #import "UIViewController+LeftItem.h"
 #import "CPDFColorUtils.h"
 
+#import <ComPDFKit/ComPDFKit.h>
+
 @interface CPDFThumbnailViewController () <UICollectionViewDelegate,UICollectionViewDataSource>
 
 @property (nonatomic, strong) UICollectionView *collectionView;
@@ -52,7 +52,7 @@
     layout.minimumInteritemSpacing = 5;
     layout.minimumLineSpacing = 5;
     
-    self.collectionView = [[UICollectionView alloc] initWithFrame:self.view.bounds collectionViewLayout:layout];
+    self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
     [self.collectionView registerClass:[CPDFThumbnailViewCell class] forCellWithReuseIdentifier:@"thumnailCell"];
     self.collectionView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
     self.collectionView.delegate = self;
@@ -72,9 +72,10 @@
     self.titleLabel = [[UILabel alloc] init];
     self.titleLabel.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;
   
-    self.titleLabel.text =  NSLocalizedString(@"Thumbnail", nil);
+    self.titleLabel.text =  NSLocalizedString(@"Thumbnails", nil);
     self.titleLabel.font = [UIFont systemFontOfSize:20];
     self.titleLabel.adjustsFontSizeToFitWidth = YES;
+    self.titleLabel.textAlignment = NSTextAlignmentCenter;
     self.titleLabel.textColor = [CPDFColorUtils CAnyReverseBackgooundColor];
     [self.view addSubview:self.titleLabel];
     
@@ -84,7 +85,6 @@
     [self.backBtn addTarget:self action:@selector(buttonItemClicked_back:) forControlEvents:UIControlEventTouchUpInside];
     [self.view addSubview:self.backBtn];
     self.view.backgroundColor = [CPDFColorUtils CPDFViewControllerBackgroundColor];
-    
 }
 
 - (void)buttonItemClicked_back:(UIButton *)button {
@@ -112,9 +112,7 @@
 - (void)viewWillLayoutSubviews {
     
     if (@available(iOS 11.0, *)) {
-        
         self.titleLabel.frame = CGRectMake((self.view.frame.size.width - 120)/2, 5, 120, 50);
-        
         self.collectionView.frame = CGRectMake(self.view.safeAreaInsets.left, self.view.safeAreaInsets.top + 50, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, self.view.frame.size.height - 50 - self.view.safeAreaInsets.top);
         self.backBtn.frame = CGRectMake(self.view.frame.size.width - 60, 5, 50, 50);
         
@@ -123,13 +121,8 @@
         self.collectionView.frame = CGRectMake(0, 50, self.view.frame.size.width, self.view.frame.size.height - 50);
         self.backBtn.frame = CGRectMake(self.view.frame.size.width - 60, 5, 50, 50);
     }
-    
-
 }
 
-
-
-
 - (void)viewWillAppear:(BOOL)animated {
     [super viewWillAppear:animated];
     

+ 4 - 2
viewer-ctrl-demo/viewer-ctrl-demo.xcodeproj/project.pbxproj

@@ -3,7 +3,7 @@
 	archiveVersion = 1;
 	classes = {
 	};
-	objectVersion = 56;
+	objectVersion = 55;
 	objects = {
 
 /* Begin PBXBuildFile section */
@@ -184,7 +184,7 @@
 				};
 			};
 			buildConfigurationList = C9413B0329E420C700F2CBF6 /* Build configuration list for PBXProject "viewer-ctrl-demo" */;
-			compatibilityVersion = "Xcode 14.0";
+			compatibilityVersion = "Xcode 13.0";
 			developmentRegion = en;
 			hasScannedForEncodings = 0;
 			knownRegions = (
@@ -365,6 +365,7 @@
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = 1;
 				DEVELOPMENT_TEAM = Q43DRF894U;
+				ENABLE_BITCODE = NO;
 				"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
 				GENERATE_INFOPLIST_FILE = YES;
 				HEADER_SEARCH_PATHS = "";
@@ -396,6 +397,7 @@
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = 1;
 				DEVELOPMENT_TEAM = Q43DRF894U;
+				ENABLE_BITCODE = NO;
 				"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
 				GENERATE_INFOPLIST_FILE = YES;
 				HEADER_SEARCH_PATHS = "";