Browse Source

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

chenyu 1 year ago
parent
commit
bab6628d73

+ 12 - 19
Annotation-Ctrl-Demo/Annotation-Ctrl-Demo.xcodeproj/xcshareddata/xcschemes/Annotation-Ctrl-Demo.xcscheme

@@ -14,10 +14,10 @@
             buildForAnalyzing = "YES">
             <BuildableReference
                BuildableIdentifier = "primary"
-               BlueprintIdentifier = "C9AF184B29F267DD00EC4979"
-               BuildableName = "Annotation-Ctrl-Demo.app"
-               BlueprintName = "Annotation-Ctrl-Demo"
-               ReferencedContainer = "container:Annotation-Ctrl-Demo.xcodeproj">
+               BlueprintIdentifier = "4F6B6C362A173F6D0030C94E"
+               BuildableName = "ComPDFKit.app"
+               BlueprintName = "ComPDFKit"
+               ReferencedContainer = "container:ComPDFKit.xcodeproj">
             </BuildableReference>
          </BuildActionEntry>
       </BuildActionEntries>
@@ -27,13 +27,6 @@
       selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
       selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
       shouldUseLaunchSchemeArgsEnv = "YES">
-      <AdditionalOptions>
-         <AdditionalOption
-            key = "NSZombieEnabled"
-            value = "YES"
-            isEnabled = "YES">
-         </AdditionalOption>
-      </AdditionalOptions>
       <Testables>
       </Testables>
    </TestAction>
@@ -51,10 +44,10 @@
          runnableDebuggingMode = "0">
          <BuildableReference
             BuildableIdentifier = "primary"
-            BlueprintIdentifier = "C9AF184B29F267DD00EC4979"
-            BuildableName = "Annotation-Ctrl-Demo.app"
-            BlueprintName = "Annotation-Ctrl-Demo"
-            ReferencedContainer = "container:Annotation-Ctrl-Demo.xcodeproj">
+            BlueprintIdentifier = "4F6B6C362A173F6D0030C94E"
+            BuildableName = "ComPDFKit.app"
+            BlueprintName = "ComPDFKit"
+            ReferencedContainer = "container:ComPDFKit.xcodeproj">
          </BuildableReference>
       </BuildableProductRunnable>
    </LaunchAction>
@@ -68,10 +61,10 @@
          runnableDebuggingMode = "0">
          <BuildableReference
             BuildableIdentifier = "primary"
-            BlueprintIdentifier = "C9AF184B29F267DD00EC4979"
-            BuildableName = "Annotation-Ctrl-Demo.app"
-            BlueprintName = "Annotation-Ctrl-Demo"
-            ReferencedContainer = "container:Annotation-Ctrl-Demo.xcodeproj">
+            BlueprintIdentifier = "4F6B6C362A173F6D0030C94E"
+            BuildableName = "ComPDFKit.app"
+            BlueprintName = "ComPDFKit"
+            ReferencedContainer = "container:ComPDFKit.xcodeproj">
          </BuildableReference>
       </BuildableProductRunnable>
    </ProfileAction>

+ 2 - 8
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,CPDFPageEditViewControllerDelegate>
+@interface CPDFViewController () <CPDFSoundPlayBarDelegate,CPDFAnnotationBarDelegate,CPDFToolsViewControllerDelegate,CPDFNoteOpenViewControllerDelegate,CPDFBOTAViewControllerDelegate,CPDFEditToolBarDelegate,CPDFFormBarDelegate,CPDFListViewDelegate,CPDFPageEditViewControllerDelegate,CPDFSignatureViewControllerDelegate>
 
 @property(nonatomic, strong) CPDFAnnotationBar *annotationBar;
 
@@ -362,14 +362,8 @@
 #pragma mark - Action
 
 - (void)navigationRightItemBota{
-    CPDFBOTAViewController *botaViewController = nil;
+    CPDFBOTAViewController *botaViewController = [[CPDFBOTAViewController alloc] initCustomizeWithPDFView:self.pdfListView navArrays:@[@(CPDFBOTATypeStateOutline),@(CPDFBOTATypeStateBookmark),@(CPDFBOTATypeStateAnnotation)]];
 
-    if(CToolModelAnnotation == self.pdfListView.toolModel) {
-        botaViewController = [[CPDFBOTAViewController alloc] initCustomizeWithPDFView:self.pdfListView navArrays:@[@(CPDFBOTATypeStateOutline),@(CPDFBOTATypeStateBookmark),@(CPDFBOTATypeStateAnnotation)]];
-
-    } else {
-        botaViewController = [[CPDFBOTAViewController alloc] initCustomizeWithPDFView:self.pdfListView navArrays:@[@(CPDFBOTATypeStateOutline),@(CPDFBOTATypeStateBookmark)]];
-    }
     botaViewController.delegate = self;
     
     AAPLCustomPresentationController *presentationController NS_VALID_UNTIL_END_OF_SCOPE;

+ 78 - 0
PageEdit-Ctrl-Demo/PageEdit-Ctrl-Demo.xcodeproj/xcshareddata/xcschemes/PageEdit-Ctrl-Demo.xcscheme

@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+   LastUpgradeVersion = "1420"
+   version = "1.3">
+   <BuildAction
+      parallelizeBuildables = "YES"
+      buildImplicitDependencies = "YES">
+      <BuildActionEntries>
+         <BuildActionEntry
+            buildForTesting = "YES"
+            buildForRunning = "YES"
+            buildForProfiling = "YES"
+            buildForArchiving = "YES"
+            buildForAnalyzing = "YES">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "C9C6EEEB2A20487900E1DD81"
+               BuildableName = "PageEdit-Ctrl-Demo.app"
+               BlueprintName = "PageEdit-Ctrl-Demo"
+               ReferencedContainer = "container:PageEdit-Ctrl-Demo.xcodeproj">
+            </BuildableReference>
+         </BuildActionEntry>
+      </BuildActionEntries>
+   </BuildAction>
+   <TestAction
+      buildConfiguration = "Debug"
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      shouldUseLaunchSchemeArgsEnv = "YES">
+      <Testables>
+      </Testables>
+   </TestAction>
+   <LaunchAction
+      buildConfiguration = "Debug"
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      launchStyle = "0"
+      useCustomWorkingDirectory = "NO"
+      ignoresPersistentStateOnLaunch = "NO"
+      debugDocumentVersioning = "YES"
+      debugServiceExtension = "internal"
+      allowLocationSimulation = "YES">
+      <BuildableProductRunnable
+         runnableDebuggingMode = "0">
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "C9C6EEEB2A20487900E1DD81"
+            BuildableName = "PageEdit-Ctrl-Demo.app"
+            BlueprintName = "PageEdit-Ctrl-Demo"
+            ReferencedContainer = "container:PageEdit-Ctrl-Demo.xcodeproj">
+         </BuildableReference>
+      </BuildableProductRunnable>
+   </LaunchAction>
+   <ProfileAction
+      buildConfiguration = "Release"
+      shouldUseLaunchSchemeArgsEnv = "YES"
+      savedToolIdentifier = ""
+      useCustomWorkingDirectory = "NO"
+      debugDocumentVersioning = "YES">
+      <BuildableProductRunnable
+         runnableDebuggingMode = "0">
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "C9C6EEEB2A20487900E1DD81"
+            BuildableName = "PageEdit-Ctrl-Demo.app"
+            BlueprintName = "PageEdit-Ctrl-Demo"
+            ReferencedContainer = "container:PageEdit-Ctrl-Demo.xcodeproj">
+         </BuildableReference>
+      </BuildableProductRunnable>
+   </ProfileAction>
+   <AnalyzeAction
+      buildConfiguration = "Debug">
+   </AnalyzeAction>
+   <ArchiveAction
+      buildConfiguration = "Release"
+      revealArchiveInOrganizer = "YES">
+   </ArchiveAction>
+</Scheme>

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

@@ -98,7 +98,7 @@
         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.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, ((self.view.frame.size.height)/9));
+        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);

+ 2 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/CPDFFreeTextViewController.m

@@ -143,6 +143,7 @@
     self.scrcollView.contentSize = CGSizeMake(self.view.frame.size.width, 470);
     
     if (@available(iOS 11.0, *)) {
+        self.backBtn.frame = CGRectMake(self.view.frame.size.width - 60 - self.view.safeAreaInsets.right, 5, 50, 50);
         self.fontNameLabel.frame = CGRectMake(self.view.safeAreaInsets.left+20, 195, 30, 30);
         self.dropMenuView.frame = CGRectMake(self.view.safeAreaInsets.left+60, 195, self.view.frame.size.width - 150 - self.view.safeAreaInsets.right-self.view.safeAreaInsets.left, 30);
         self.dropDownIcon.frame = CGRectMake(self.dropMenuView.bounds.size.width - 24 - 5, 3, 24, 24);
@@ -158,6 +159,7 @@
         self.rightBtn.frame = CGRectMake(self.view.frame.size.width - 50, 240, 30, 30);
         self.fontsizeSliderView.frame = CGRectMake(self.view.safeAreaInsets.left, 280, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 90);
     } 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);

+ 9 - 7
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFInk/CPDFDrawPencilKitFuncView.m

@@ -52,13 +52,15 @@
                                   self.frame.size.height/2.0 + 22);
 
     } else {
-        if (self.window.safeAreaInsets.bottom > 0) {
-            self.center = CGPointMake(self.superview.frame.size.width - self.frame.size.width/2.0 - 40,
-                                      self.frame.size.height/2.0 + 42);
-            
-        } else{
-            self.center = CGPointMake(self.superview.frame.size.width - self.frame.size.width/2.0 - 30,
-                                      self.frame.size.height/2.0 + 22);
+        if (@available(iOS 11.0, *)) {
+            if (self.window.safeAreaInsets.bottom > 0) {
+                self.center = CGPointMake(self.superview.frame.size.width - self.frame.size.width/2.0 - 40,
+                                          self.frame.size.height/2.0 + 42);
+                
+            } else{
+                self.center = CGPointMake(self.superview.frame.size.width - self.frame.size.width/2.0 - 30,
+                                          self.frame.size.height/2.0 + 22);
+            }
         }
     }
 }

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

@@ -98,14 +98,15 @@
 - (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.headerView.frame = CGRectMake(0, 0, self.view.frame.size.width, 50);
     
     self.emptyLabel.frame = CGRectMake((self.view.frame.size.width - 120)/2, (self.view.frame.size.height - 50)/2, 120, 50);
     
     if (@available(iOS 11.0, *)) {
+        self.backBtn.frame = CGRectMake(self.view.frame.size.width - 60 - self.view.safeAreaInsets.right, 5, 50, 50);
         self.createButton.frame = CGRectMake(self.view.frame.size.width - 70 - self.view.safeAreaInsets.right, self.view.frame.size.height - 100 - self.view.safeAreaInsets.bottom, 50, 50);
     } else {
+        self.backBtn.frame = CGRectMake(self.view.frame.size.width - 60, 5, 50, 50);
         self.createButton.frame = CGRectMake(self.view.frame.size.width - 70, self.view.frame.size.height - 100, 50, 50);
     }
 }