Переглянути джерело

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

chenyu 1 рік тому
батько
коміт
71f67c5368

+ 3 - 3
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationBar/CPDFAnnotationToolBar.m

@@ -119,7 +119,7 @@
             for (NSInteger i = 0; i< self.annotationBtns.count; i++) {
                 CPDFAnnotationBarButton *button = [self.annotationBtns objectAtIndex:i];
                 if(button.tag == self.selectedIndex) {
-                    button.backgroundColor = [CPDFColorUtils CAnnotationBarNoSelectBackgroundColor];
+                    button.backgroundColor = [UIColor clearColor];
                     self.selectedIndex = 0;
                     break;
                 }
@@ -132,7 +132,7 @@
                 button.backgroundColor = [CPDFColorUtils CAnnotationBarSelectBackgroundColor];
                 self.selectedIndex = button.tag;
             } else {
-                button.backgroundColor = [CPDFColorUtils CAnnotationBarNoSelectBackgroundColor];
+                button.backgroundColor = [UIColor clearColor];
             }
         }
     }
@@ -348,7 +348,7 @@
         }
         self.pdfListView.annotationMode = CPDFViewAnnotationModeNone;
         self.selectedIndex = 0;
-        button.backgroundColor = [CPDFColorUtils CAnnotationBarNoSelectBackgroundColor];
+        button.backgroundColor = [UIColor clearColor];
         isSelect = NO;
     }
     

+ 6 - 2
ComPDFKit_Tools/ComPDFKit_Tools/Common/Controls/BOTA/CPDFBOTAViewController.m

@@ -214,8 +214,12 @@
 
 - (void)annotationViewController:(CPDFAnnotationViewController *)annotationViewController jumptoPage:(NSInteger)pageIndex selectAnnot:(CPDFAnnotation *)annot {
     [self.pdfView goToPageIndex:pageIndex animated:NO];
-    CGSize visibleRect = self.pdfView.documentView.visibleSize;
-    [self.pdfView goToRect:CGRectMake(annot.bounds.origin.x, annot.bounds.origin.y+visibleRect.height/2, annot.bounds.size.width, annot.bounds.size.height) onPage:[self.pdfView.document pageAtIndex:pageIndex] animated:YES];
+    if (@available(iOS 12.0, *)) {
+        CGSize visibleRect = self.pdfView.documentView.visibleSize;
+        [self.pdfView goToRect:CGRectMake(annot.bounds.origin.x, annot.bounds.origin.y+visibleRect.height/2, annot.bounds.size.width, annot.bounds.size.height) onPage:[self.pdfView.document pageAtIndex:pageIndex] animated:YES];
+    } else {
+        [self.pdfView goToRect:CGRectMake(annot.bounds.origin.x, annot.bounds.origin.y+100, annot.bounds.size.width, annot.bounds.size.height) onPage:[self.pdfView.document pageAtIndex:pageIndex] animated:YES];
+    }
 
     if([self.delegate respondsToSelector:@selector(botaViewControllerDismiss:)]) {
         [self.delegate botaViewControllerDismiss:self];

+ 4 - 2
ComPDFKit_Tools/ComPDFKit_Tools/DocsEditor/PDFPageEdit/Control/CPDFPageEditViewController.m

@@ -561,8 +561,9 @@
     for (NSIndexPath *indexPath in [self.collectionView indexPathsForSelectedItems]) {
         [indexSet addIndex:indexPath.item];
     }
-    [self.collectionView deleteItemsAtIndexPaths:[self.collectionView indexPathsForSelectedItems]];
+    
     [self.pdfView.document removePageAtIndexSet:indexSet];
+    [self.collectionView deleteItemsAtIndexPaths:[self.collectionView indexPathsForSelectedItems]];
     [self.pageEditToolBar reloadData];
     
     [self updateTitle];
@@ -580,8 +581,9 @@
     for (NSIndexPath *indexPath in [self.collectionView indexPathsForSelectedItems]) {
         [deleteIndexSet addIndex:indexPath.item];
     }
-    [self.collectionView deleteItemsAtIndexPaths:[self.collectionView indexPathsForSelectedItems]];
+    
     [self.pdfView.document removePageAtIndexSet:deleteIndexSet];
+    [self.collectionView deleteItemsAtIndexPaths:[self.collectionView indexPathsForSelectedItems]];
     
     [self.pdfView.document importPages:indexSet fromDocument:document atIndex:min];
     [self.collectionView reloadData];

+ 0 - 4
ContentEditor/ContentEditor/CPDFViewController.m

@@ -291,10 +291,6 @@
         
         [self presentViewController:self.baseVC animated:YES completion:nil];
     }
-    
-    if (self.menuPoint.y < self.pdfListView.documentView.visibleSize.height/2) {
-        [self.pdfListView goToRect:CGRectMake(self.menuPoint.x, self.pdfListView.documentView.visibleSize.height/2-50, 1, 1) onPage:[self.pdfListView.document pageAtIndex:self.pdfListView.currentPageIndex] animated:YES];
-    }
 }
 
 #pragma mark - CPDFSignatureViewControllerDelegate

+ 4 - 0
PDFViewer/PDFViewer.xcodeproj/project.pbxproj

@@ -55,6 +55,7 @@
 		4F6B6C8B2A174EB70030C94E /* CPDFViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPDFViewController.h; sourceTree = "<group>"; };
 		C94A25632A4990610042F875 /* ComPDFKit.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = ComPDFKit.xcframework; path = ../Lib/ComPDFKit.xcframework; sourceTree = "<group>"; };
 		C94A25662A49906C0042F875 /* ComPDFKit_Tools.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = ComPDFKit_Tools.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+		C94A25752A4AE8800042F875 /* PDFViewer.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = PDFViewer.entitlements; sourceTree = "<group>"; };
 		F384DB0F2A48204500798045 /* developer_guide_ios.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = developer_guide_ios.pdf; sourceTree = "<group>"; };
 		F384DB662A49309B00798045 /* license_key_ios.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = license_key_ios.xml; path = ../license_key_ios.xml; sourceTree = "<group>"; };
 		F384DB762A49362400798045 /* XMLReader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XMLReader.m; sourceTree = "<group>"; };
@@ -99,6 +100,7 @@
 		4F6B6C392A173F6D0030C94E /* PDFViewer */ = {
 			isa = PBXGroup;
 			children = (
+				C94A25752A4AE8800042F875 /* PDFViewer.entitlements */,
 				4F6B6C3A2A173F6D0030C94E /* AppDelegate.h */,
 				4F6B6C3B2A173F6D0030C94E /* AppDelegate.m */,
 				4F6B6C3D2A173F6D0030C94E /* SceneDelegate.h */,
@@ -364,6 +366,7 @@
 			buildSettings = {
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
+				CODE_SIGN_ENTITLEMENTS = PDFViewer/PDFViewer.entitlements;
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = 1;
 				DEVELOPMENT_TEAM = Q43DRF894U;
@@ -403,6 +406,7 @@
 			buildSettings = {
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
+				CODE_SIGN_ENTITLEMENTS = PDFViewer/PDFViewer.entitlements;
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = 1;
 				DEVELOPMENT_TEAM = Q43DRF894U;