Bläddra i källkod

代码优化(iOS) - 优化部分代码问题

dinglingui 1 år sedan
förälder
incheckning
9cf4909dd8
32 ändrade filer med 647 tillägg och 608 borttagningar
  1. 23 29
      Annotations/Annotations.xcodeproj/project.pbxproj
  2. 30 24
      Annotations/Annotations/AppDelegate.m
  3. 3 3
      Annotations/Annotations/CPDFViewController.m
  4. 16 16
      ComPDFKit_Tools/ComPDFKit_Tools.xcodeproj/project.pbxproj
  5. 4 4
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationBar/CPDFAnnotationBar.h
  6. 4 4
      ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationBar/CPDFAnnotationBar.m
  7. 2 2
      ComPDFKit_Tools/ComPDFKit_Tools/ComPDFKit_Tools.h
  8. 4 4
      ComPDFKit_Tools/ComPDFKit_Tools/Forms/PDFFormBar/CPDFFormBar.h
  9. 4 4
      ComPDFKit_Tools/ComPDFKit_Tools/Forms/PDFFormBar/CPDFFormBar.m
  10. 23 29
      ContentEditor/ContentEditor.xcodeproj/project.pbxproj
  11. 31 25
      ContentEditor/ContentEditor/AppDelegate.m
  12. 23 29
      DocsEditor/DocsEditor.xcodeproj/project.pbxproj
  13. 31 25
      DocsEditor/DocsEditor/AppDelegate.m
  14. 23 29
      Forms/Forms.xcodeproj/project.pbxproj
  15. 30 24
      Forms/Forms/AppDelegate.m
  16. 3 3
      Forms/Forms/CPDFViewController.m
  17. 23 29
      PDFViewer/PDFViewer.xcodeproj/project.pbxproj
  18. 78 0
      PDFViewer/PDFViewer.xcodeproj/xcshareddata/xcschemes/PDFViewer.xcscheme
  19. 31 25
      PDFViewer/PDFViewer/AppDelegate.m
  20. 5 5
      PDFViewer/PDFViewer/CPDFViewController.m
  21. 0 4
      SDKLicense/SDKLicense.xml
  22. 0 25
      SDKLicense/XMLParseManager.h
  23. 0 103
      SDKLicense/XMLParseManager.m
  24. 0 32
      SDKLicense/XPDXMLElement.h
  25. 0 84
      SDKLicense/XPDXMLElement.m
  26. BIN
      TestFile/Quick Start Guide.pdf
  27. BIN
      TestFile/developer_guide_ios.pdf
  28. 18 24
      Viewer/Viewer.xcodeproj/project.pbxproj
  29. 29 23
      Viewer/Viewer/AppDelegate.m
  30. 25 0
      XMLParse/XMLReader.h
  31. 176 0
      XMLParse/XMLReader.m
  32. 8 0
      license_key_ios.xml

+ 23 - 29
Annotations/Annotations.xcodeproj/project.pbxproj

@@ -14,14 +14,13 @@
 		C9AF185C29F267E000EC4979 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C9AF185B29F267E000EC4979 /* Assets.xcassets */; };
 		C9AF185F29F267E000EC4979 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C9AF185D29F267E000EC4979 /* LaunchScreen.storyboard */; };
 		C9AF186229F267E000EC4979 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = C9AF186129F267E000EC4979 /* main.m */; };
-		C9AF187429F26AD200EC4979 /* SDKLicense.xml in Resources */ = {isa = PBXBuildFile; fileRef = C9AF187129F26AD200EC4979 /* SDKLicense.xml */; };
-		C9AF187529F26AD200EC4979 /* XPDXMLElement.m in Sources */ = {isa = PBXBuildFile; fileRef = C9AF187229F26AD200EC4979 /* XPDXMLElement.m */; };
-		C9AF187629F26AD200EC4979 /* XMLParseManager.m in Sources */ = {isa = PBXBuildFile; fileRef = C9AF187329F26AD200EC4979 /* XMLParseManager.m */; };
 		C9AF187C29F26ADF00EC4979 /* Form_Widgets_Test.pdf in Resources */ = {isa = PBXBuildFile; fileRef = C9AF187829F26ADF00EC4979 /* Form_Widgets_Test.pdf */; };
 		C9AF187D29F26ADF00EC4979 /* PDF32000_2008.pdf in Resources */ = {isa = PBXBuildFile; fileRef = C9AF187929F26ADF00EC4979 /* PDF32000_2008.pdf */; };
-		C9AF187F29F26ADF00EC4979 /* Quick Start Guide.pdf in Resources */ = {isa = PBXBuildFile; fileRef = C9AF187B29F26ADF00EC4979 /* Quick Start Guide.pdf */; };
 		F32776912A04A6D900C5F0A6 /* ComPDFKit.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = C918CEBB29F904E400D43974 /* ComPDFKit.xcframework */; };
 		F32776922A04A6D900C5F0A6 /* ComPDFKit.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C918CEBB29F904E400D43974 /* ComPDFKit.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
+		F384DB182A48208100798045 /* developer_guide_ios.pdf in Resources */ = {isa = PBXBuildFile; fileRef = F384DB172A48208100798045 /* developer_guide_ios.pdf */; };
+		F384DB6F2A4930F800798045 /* license_key_ios.xml in Resources */ = {isa = PBXBuildFile; fileRef = F384DB6E2A4930F800798045 /* license_key_ios.xml */; };
+		F384DB872A49369400798045 /* XMLReader.m in Sources */ = {isa = PBXBuildFile; fileRef = F384DB852A49369400798045 /* XMLReader.m */; };
 		F3C0CC582A4321B700007C0A /* ComPDFKit_Tools.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F3C0CC572A4321B700007C0A /* ComPDFKit_Tools.framework */; };
 		F3C0CC592A4321B700007C0A /* ComPDFKit_Tools.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = F3C0CC572A4321B700007C0A /* ComPDFKit_Tools.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 /* End PBXBuildFile section */
@@ -56,14 +55,12 @@
 		C9AF185E29F267E000EC4979 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
 		C9AF186029F267E000EC4979 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
 		C9AF186129F267E000EC4979 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
-		C9AF186F29F26AD200EC4979 /* XPDXMLElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPDXMLElement.h; sourceTree = "<group>"; };
-		C9AF187029F26AD200EC4979 /* XMLParseManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLParseManager.h; sourceTree = "<group>"; };
-		C9AF187129F26AD200EC4979 /* SDKLicense.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = SDKLicense.xml; sourceTree = "<group>"; };
-		C9AF187229F26AD200EC4979 /* XPDXMLElement.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XPDXMLElement.m; sourceTree = "<group>"; };
-		C9AF187329F26AD200EC4979 /* XMLParseManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XMLParseManager.m; sourceTree = "<group>"; };
 		C9AF187829F26ADF00EC4979 /* Form_Widgets_Test.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = Form_Widgets_Test.pdf; sourceTree = "<group>"; };
 		C9AF187929F26ADF00EC4979 /* PDF32000_2008.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = PDF32000_2008.pdf; sourceTree = "<group>"; };
-		C9AF187B29F26ADF00EC4979 /* Quick Start Guide.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = "Quick Start Guide.pdf"; sourceTree = "<group>"; };
+		F384DB172A48208100798045 /* developer_guide_ios.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = developer_guide_ios.pdf; sourceTree = "<group>"; };
+		F384DB6E2A4930F800798045 /* license_key_ios.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = license_key_ios.xml; path = ../license_key_ios.xml; sourceTree = "<group>"; };
+		F384DB852A49369400798045 /* XMLReader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XMLReader.m; sourceTree = "<group>"; };
+		F384DB862A49369400798045 /* XMLReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLReader.h; sourceTree = "<group>"; };
 		F3C0CC572A4321B700007C0A /* ComPDFKit_Tools.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = ComPDFKit_Tools.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 /* End PBXFileReference section */
 
@@ -93,8 +90,9 @@
 		C9AF184329F267DD00EC4979 = {
 			isa = PBXGroup;
 			children = (
+				F384DB6E2A4930F800798045 /* license_key_ios.xml */,
+				F384DB5C2A48238500798045 /* XMLParse */,
 				C9AF187729F26ADF00EC4979 /* TestFile */,
-				C9AF186E29F26AD200EC4979 /* SDKLicense */,
 				C9AF184E29F267DD00EC4979 /* Annotations */,
 				C9AF184D29F267DD00EC4979 /* Products */,
 				C918CEB029F903CF00D43974 /* Frameworks */,
@@ -127,30 +125,27 @@
 			path = Annotations;
 			sourceTree = "<group>";
 		};
-		C9AF186E29F26AD200EC4979 /* SDKLicense */ = {
-			isa = PBXGroup;
-			children = (
-				C9AF187129F26AD200EC4979 /* SDKLicense.xml */,
-				C9AF187029F26AD200EC4979 /* XMLParseManager.h */,
-				C9AF187329F26AD200EC4979 /* XMLParseManager.m */,
-				C9AF186F29F26AD200EC4979 /* XPDXMLElement.h */,
-				C9AF187229F26AD200EC4979 /* XPDXMLElement.m */,
-			);
-			name = SDKLicense;
-			path = ../SDKLicense;
-			sourceTree = "<group>";
-		};
 		C9AF187729F26ADF00EC4979 /* TestFile */ = {
 			isa = PBXGroup;
 			children = (
+				F384DB172A48208100798045 /* developer_guide_ios.pdf */,
 				C9AF187829F26ADF00EC4979 /* Form_Widgets_Test.pdf */,
 				C9AF187929F26ADF00EC4979 /* PDF32000_2008.pdf */,
-				C9AF187B29F26ADF00EC4979 /* Quick Start Guide.pdf */,
 			);
 			name = TestFile;
 			path = ../TestFile;
 			sourceTree = "<group>";
 		};
+		F384DB5C2A48238500798045 /* XMLParse */ = {
+			isa = PBXGroup;
+			children = (
+				F384DB862A49369400798045 /* XMLReader.h */,
+				F384DB852A49369400798045 /* XMLReader.m */,
+			);
+			name = XMLParse;
+			path = ../XMLParse;
+			sourceTree = "<group>";
+		};
 /* End PBXGroup section */
 
 /* Begin PBXNativeTarget section */
@@ -211,10 +206,10 @@
 			files = (
 				C9AF187C29F26ADF00EC4979 /* Form_Widgets_Test.pdf in Resources */,
 				C9AF185F29F267E000EC4979 /* LaunchScreen.storyboard in Resources */,
+				F384DB182A48208100798045 /* developer_guide_ios.pdf in Resources */,
+				F384DB6F2A4930F800798045 /* license_key_ios.xml in Resources */,
 				C9AF185C29F267E000EC4979 /* Assets.xcassets in Resources */,
-				C9AF187429F26AD200EC4979 /* SDKLicense.xml in Resources */,
 				C9AF185A29F267DD00EC4979 /* Main.storyboard in Resources */,
-				C9AF187F29F26ADF00EC4979 /* Quick Start Guide.pdf in Resources */,
 				C9AF187D29F26ADF00EC4979 /* PDF32000_2008.pdf in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
@@ -226,10 +221,9 @@
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				C9AF187529F26AD200EC4979 /* XPDXMLElement.m in Sources */,
 				4F06AB5D29F6852C007797E4 /* CPDFViewController.m in Sources */,
 				C9AF185129F267DD00EC4979 /* AppDelegate.m in Sources */,
-				C9AF187629F26AD200EC4979 /* XMLParseManager.m in Sources */,
+				F384DB872A49369400798045 /* XMLReader.m in Sources */,
 				C9AF186229F267E000EC4979 /* main.m in Sources */,
 				C9AF185429F267DD00EC4979 /* SceneDelegate.m in Sources */,
 			);

+ 30 - 24
Annotations/Annotations/AppDelegate.m

@@ -16,7 +16,7 @@
 #import <ComPDFKit_Tools/ComPDFKit_Tools.h>
 
 #import "CPDFViewController.h"
-#import "XMLParseManager.h"
+#import "XMLReader.h"
 
 static AppDelegate *appDelegate = NULL;
 
@@ -24,8 +24,6 @@ static AppDelegate *appDelegate = NULL;
 
 @property (nonatomic, strong) UIWindow *window;
 
-@property (nonatomic, strong) XMLParseManager *manager;
-
 @end
 
 
@@ -33,30 +31,38 @@ static AppDelegate *appDelegate = NULL;
 
 
 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
-    // Override point for customization after application launch.
-    NSString *path = [[NSBundle mainBundle]pathForResource:@"SDKLicense" ofType:@"xml"];
-    NSURL *url = [NSURL fileURLWithPath:path];
-    _manager = [[XMLParseManager alloc]init];
-    [_manager parseXMLWithURL:url completion:^(BOOL SUC, XPDXMLElement *data,NSError *error) {
-        if (SUC) {
-            NSDictionary * attribute = data.attribute;
-            NSString * key = attribute[@"key"];
-            NSString * secret = attribute[@"secret"];
-            [CPDFKit setLicenseKey:key secret:secret];
-            
-            if (@available(iOS 13.0, *)) {
-                
-            } else {
-                UIWindow *windows = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
-                [self configWindow:windows];
-
-            }
+    
+    NSString *xmlFileString = [[NSBundle mainBundle] pathForResource:@"license_key_ios" ofType:@"xml"];
+    NSData *xmlData = [NSData dataWithContentsOfFile:xmlFileString];
+    NSError *error = nil;
+    
+    NSDictionary *result = [XMLReader dictionaryForXMLData:xmlData error:&error];
+    if (error)
+        NSLog(@"License key can not be empty.");
+    
+    if([result isKindOfClass:[NSDictionary class]]) {
+        NSDictionary *license = [result objectForKey:@"license"];
+        if([license isKindOfClass:[NSDictionary class]]) {
+            NSDictionary * keysDic = license[@"key"];
+            NSDictionary * secretDic = license[@"secret"];
             
-        }else{
-            NSLog(@"error = %@",error);
+            NSString * key = keysDic[@"text"];
+            NSString * secret = secretDic[@"text"];
+            [CPDFKit setLicenseKey:key secret:secret];
+        }  else {
+            NSLog(@"License key can not be empty.");
         }
-    }];
+    } else {
+        NSLog(@"License key can not be empty.");
+    }
+    
+    if (@available(iOS 13.0, *)) {
+        
+    } else {
+        UIWindow *windows = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
+        [self configWindow:windows];
 
+    }
     return YES;
 }
 

+ 3 - 3
Annotations/Annotations/CPDFViewController.m

@@ -19,7 +19,7 @@
 
 @interface CPDFViewController () <CPDFSoundPlayBarDelegate,CPDFAnnotationBarDelegate,CPDFToolsViewControllerDelegate,CPDFNoteOpenViewControllerDelegate,CPDFBOTAViewControllerDelegate,CPDFKeyboardToolbarDelegate>
 
-@property(nonatomic, strong) CPDFAnnotationBar *annotationBar;
+@property(nonatomic, strong) CPDFAnnotationToolBar *annotationBar;
 
 @property(nonatomic, strong) CPDFSoundPlayBar *soundPlayBar;
 
@@ -45,7 +45,7 @@
 - (void)initAnnotationBar {
     self.annotationManage = [[CAnnotationManage alloc] initWithPDFView:self.pdfListView];
         
-    self.annotationBar = [[CPDFAnnotationBar alloc] initAnnotationManage:self.annotationManage];
+    self.annotationBar = [[CPDFAnnotationToolBar alloc] initAnnotationManage:self.annotationManage];
     
     CGFloat height = 44.0;
     if (@available(iOS 11.0, *))
@@ -419,7 +419,7 @@
 
 #pragma mark - CPDFAnnotationBarDelegate
 
-- (void)annotationBarClick:(CPDFAnnotationBar *)annotationBar clickAnnotationMode:(CPDFViewAnnotationMode)annotationMode forSelected:(BOOL)isSelected forButton:(UIButton *)button {
+- (void)annotationBarClick:(CPDFAnnotationToolBar *)annotationBar clickAnnotationMode:(CPDFViewAnnotationMode)annotationMode forSelected:(BOOL)isSelected forButton:(UIButton *)button {
     if(CPDFViewAnnotationModeInk == annotationMode || CPDFViewAnnotationModePencilDrawing == annotationMode) {
         CGFloat tPosY = 0;
         if(isSelected) {

+ 16 - 16
ComPDFKit_Tools/ComPDFKit_Tools.xcodeproj/project.pbxproj

@@ -84,8 +84,8 @@
 		4FECFF6A2A15FBC7008DE530 /* CPDFEditTextSampleView.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FECFF682A15FBC7008DE530 /* CPDFEditTextSampleView.h */; };
 		4FECFF6B2A15FBC7008DE530 /* CPDFEditTextSampleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4FECFF692A15FBC7008DE530 /* CPDFEditTextSampleView.m */; };
 		4FF3E1D12A064A8200C14F91 /* CPDFListView+Edit.m in Sources */ = {isa = PBXBuildFile; fileRef = 4FF3E1CF2A064A8100C14F91 /* CPDFListView+Edit.m */; };
-		4FF895942A1EF05D0045890F /* CPDFFormBar.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FF895912A1EF05D0045890F /* CPDFFormBar.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		4FF895952A1EF05D0045890F /* CPDFFormBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 4FF895922A1EF05D0045890F /* CPDFFormBar.m */; };
+		4FF895942A1EF05D0045890F /* CPDFFormToolBar.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FF895912A1EF05D0045890F /* CPDFFormToolBar.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		4FF895952A1EF05D0045890F /* CPDFFormToolBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 4FF895922A1EF05D0045890F /* CPDFFormToolBar.m */; };
 		4FF895962A1EF05D0045890F /* CPDFFormImage.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4FF895932A1EF05D0045890F /* CPDFFormImage.xcassets */; };
 		C90C6B932A1A0F7300BBE685 /* SignatureCustomPresentationController.h in Headers */ = {isa = PBXBuildFile; fileRef = C90C6B912A1A0F7300BBE685 /* SignatureCustomPresentationController.h */; };
 		C90C6B942A1A0F7300BBE685 /* SignatureCustomPresentationController.m in Sources */ = {isa = PBXBuildFile; fileRef = C90C6B922A1A0F7300BBE685 /* SignatureCustomPresentationController.m */; };
@@ -147,8 +147,8 @@
 		C9AF183029EFB23C00EC4979 /* CPDFBookmarkViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = C9AF182E29EFB23C00EC4979 /* CPDFBookmarkViewController.h */; };
 		C9AF183129EFB23C00EC4979 /* CPDFBookmarkViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C9AF182F29EFB23C00EC4979 /* CPDFBookmarkViewController.m */; };
 		C9AF183329EFC63300EC4979 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C9AF183229EFC63300EC4979 /* Images.xcassets */; };
-		C9AF183B29F2198700EC4979 /* CPDFAnnotationBar.h in Headers */ = {isa = PBXBuildFile; fileRef = C9AF183929F2198700EC4979 /* CPDFAnnotationBar.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		C9AF183C29F2198700EC4979 /* CPDFAnnotationBar.m in Sources */ = {isa = PBXBuildFile; fileRef = C9AF183A29F2198700EC4979 /* CPDFAnnotationBar.m */; };
+		C9AF183B29F2198700EC4979 /* CPDFAnnotationToolBar.h in Headers */ = {isa = PBXBuildFile; fileRef = C9AF183929F2198700EC4979 /* CPDFAnnotationToolBar.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		C9AF183C29F2198700EC4979 /* CPDFAnnotationToolBar.m in Sources */ = {isa = PBXBuildFile; fileRef = C9AF183A29F2198700EC4979 /* CPDFAnnotationToolBar.m */; };
 		C9AF183E29F223A700EC4979 /* Image.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C9AF183D29F223A700EC4979 /* Image.xcassets */; };
 		C9AF184129F22BBD00EC4979 /* CPDFAnnotationBarButton.h in Headers */ = {isa = PBXBuildFile; fileRef = C9AF183F29F22BBD00EC4979 /* CPDFAnnotationBarButton.h */; };
 		C9AF184229F22BBD00EC4979 /* CPDFAnnotationBarButton.m in Sources */ = {isa = PBXBuildFile; fileRef = C9AF184029F22BBD00EC4979 /* CPDFAnnotationBarButton.m */; };
@@ -408,8 +408,8 @@
 		4FECFF692A15FBC7008DE530 /* CPDFEditTextSampleView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFEditTextSampleView.m; sourceTree = "<group>"; };
 		4FF3E1CF2A064A8100C14F91 /* CPDFListView+Edit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "CPDFListView+Edit.m"; sourceTree = "<group>"; };
 		4FF3E1D02A064A8100C14F91 /* CPDFListView+Edit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CPDFListView+Edit.h"; sourceTree = "<group>"; };
-		4FF895912A1EF05D0045890F /* CPDFFormBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPDFFormBar.h; sourceTree = "<group>"; };
-		4FF895922A1EF05D0045890F /* CPDFFormBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPDFFormBar.m; sourceTree = "<group>"; };
+		4FF895912A1EF05D0045890F /* CPDFFormToolBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPDFFormToolBar.h; sourceTree = "<group>"; };
+		4FF895922A1EF05D0045890F /* CPDFFormToolBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPDFFormToolBar.m; sourceTree = "<group>"; };
 		4FF895932A1EF05D0045890F /* CPDFFormImage.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = CPDFFormImage.xcassets; sourceTree = "<group>"; };
 		C90C6B912A1A0F7300BBE685 /* SignatureCustomPresentationController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SignatureCustomPresentationController.h; sourceTree = "<group>"; };
 		C90C6B922A1A0F7300BBE685 /* SignatureCustomPresentationController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SignatureCustomPresentationController.m; sourceTree = "<group>"; };
@@ -470,8 +470,8 @@
 		C9AF182E29EFB23C00EC4979 /* CPDFBookmarkViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFBookmarkViewController.h; sourceTree = "<group>"; };
 		C9AF182F29EFB23C00EC4979 /* CPDFBookmarkViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFBookmarkViewController.m; sourceTree = "<group>"; };
 		C9AF183229EFC63300EC4979 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
-		C9AF183929F2198700EC4979 /* CPDFAnnotationBar.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFAnnotationBar.h; sourceTree = "<group>"; };
-		C9AF183A29F2198700EC4979 /* CPDFAnnotationBar.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFAnnotationBar.m; sourceTree = "<group>"; };
+		C9AF183929F2198700EC4979 /* CPDFAnnotationToolBar.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFAnnotationToolBar.h; sourceTree = "<group>"; };
+		C9AF183A29F2198700EC4979 /* CPDFAnnotationToolBar.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFAnnotationToolBar.m; sourceTree = "<group>"; };
 		C9AF183D29F223A700EC4979 /* Image.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Image.xcassets; sourceTree = "<group>"; };
 		C9AF183F29F22BBD00EC4979 /* CPDFAnnotationBarButton.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFAnnotationBarButton.h; sourceTree = "<group>"; };
 		C9AF184029F22BBD00EC4979 /* CPDFAnnotationBarButton.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFAnnotationBarButton.m; sourceTree = "<group>"; };
@@ -983,8 +983,8 @@
 		C9AF183829F2180A00EC4979 /* PDFAnnotationBar */ = {
 			isa = PBXGroup;
 			children = (
-				C9AF183929F2198700EC4979 /* CPDFAnnotationBar.h */,
-				C9AF183A29F2198700EC4979 /* CPDFAnnotationBar.m */,
+				C9AF183929F2198700EC4979 /* CPDFAnnotationToolBar.h */,
+				C9AF183A29F2198700EC4979 /* CPDFAnnotationToolBar.m */,
 				C9AF183F29F22BBD00EC4979 /* CPDFAnnotationBarButton.h */,
 				C9AF184029F22BBD00EC4979 /* CPDFAnnotationBarButton.m */,
 				C9AF183D29F223A700EC4979 /* Image.xcassets */,
@@ -1385,8 +1385,8 @@
 		F3603B682A47D76500243836 /* PDFFormBar */ = {
 			isa = PBXGroup;
 			children = (
-				4FF895912A1EF05D0045890F /* CPDFFormBar.h */,
-				4FF895922A1EF05D0045890F /* CPDFFormBar.m */,
+				4FF895912A1EF05D0045890F /* CPDFFormToolBar.h */,
+				4FF895922A1EF05D0045890F /* CPDFFormToolBar.m */,
 			);
 			path = PDFFormBar;
 			sourceTree = "<group>";
@@ -1568,7 +1568,7 @@
 				4FD34DD82A0B44A1005CEAB6 /* UIView+Extension.h in Headers */,
 				4FD34DD02A0B3F51005CEAB6 /* CPDFPopMenu.h in Headers */,
 				4F6C796A29FBD532008C9501 /* CPDFEditFontNameSelectView.h in Headers */,
-				4FF895942A1EF05D0045890F /* CPDFFormBar.h in Headers */,
+				4FF895942A1EF05D0045890F /* CPDFFormToolBar.h in Headers */,
 				C91BE7CD2A037A490038F2BC /* CPDFInkTopToolBar.h in Headers */,
 				C9FBA2302A10CBDA003FABEC /* CCustomizeStampTableViewCell.h in Headers */,
 				C918CEA529F8FC1800D43974 /* CPDFUnderlineViewController.h in Headers */,
@@ -1605,7 +1605,7 @@
 				4F2954642A286322003CD3AF /* CPDFFormLinkViewController.h in Headers */,
 				C9AF189729F4DA6A00EC4979 /* CPDFColorSelectView.h in Headers */,
 				F35DD19C2A06850700B57F5B /* CPDFAnnotationHeader.h in Headers */,
-				C9AF183B29F2198700EC4979 /* CPDFAnnotationBar.h in Headers */,
+				C9AF183B29F2198700EC4979 /* CPDFAnnotationToolBar.h in Headers */,
 				C918CED429FA972300D43974 /* CPDFShapeArrowViewController.h in Headers */,
 				F3603B872A47DEE900243836 /* CPDFInfoViewController.h in Headers */,
 				F377CB3E2A134D7E00C543BD /* CAnnotListHeaderInSection.h in Headers */,
@@ -1844,7 +1844,7 @@
 				4FD34DE22A0B677E005CEAB6 /* CPDFPopMenuItem.m in Sources */,
 				C91BE7D92A039D2A0038F2BC /* CPDFSignatureViewCell.m in Sources */,
 				F38F60C729EFF0C2008098F8 /* CPDFColorUtils.m in Sources */,
-				C9AF183C29F2198700EC4979 /* CPDFAnnotationBar.m in Sources */,
+				C9AF183C29F2198700EC4979 /* CPDFAnnotationToolBar.m in Sources */,
 				4FB928992A1F5ED400309993 /* CPDFFormTextFieldView.m in Sources */,
 				4F604F0D2A209FDC00B5C1A9 /* CPDFFormArrowStyleView.m in Sources */,
 				F38F5B612A0344EA00D0EEFD /* CPDFListView+Annotation.m in Sources */,
@@ -1867,7 +1867,7 @@
 				F32DA18429ED904300E19ECA /* CActivityIndicatorView.m in Sources */,
 				C9EE9CDB2A1DF32C00BDBD63 /* CPDFMediaManager.m in Sources */,
 				4F6C796B29FBD532008C9501 /* CPDFEditFontNameSelectView.m in Sources */,
-				4FF895952A1EF05D0045890F /* CPDFFormBar.m in Sources */,
+				4FF895952A1EF05D0045890F /* CPDFFormToolBar.m in Sources */,
 				F32DA18329ED904300E19ECA /* CNavigationRightView.m in Sources */,
 				C9C58E6A2A243FC900B349F4 /* CInsertBlankPageCell.m in Sources */,
 				F35DD1A12A06850700B57F5B /* CPDFSquareAnnotation+PDFListView.m in Sources */,

+ 4 - 4
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationBar/CPDFAnnotationBar.h

@@ -1,5 +1,5 @@
 //
-//  CPDFAnnotationBar.h
+//  CPDFAnnotationToolBar.h
 //  ComPDFKit_Tools
 //
 //  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
@@ -36,7 +36,7 @@ typedef NS_ENUM(NSInteger, CPDFToolbarSelectedIndex) {
 
 NS_ASSUME_NONNULL_BEGIN
 
-@class CPDFAnnotationBar;
+@class CPDFAnnotationToolBar;
 @class CPDFListView;
 @class CPDFInkTopToolBar;
 @class CPDFDrawPencilKitFuncView;
@@ -46,11 +46,11 @@ NS_ASSUME_NONNULL_BEGIN
 
 @optional
 
-- (void)annotationBarClick:(CPDFAnnotationBar *)annotationBar clickAnnotationMode:(CPDFViewAnnotationMode)annotationMode forSelected:(BOOL)isSelected forButton:(UIButton *)button;
+- (void)annotationBarClick:(CPDFAnnotationToolBar *)annotationBar clickAnnotationMode:(CPDFViewAnnotationMode)annotationMode forSelected:(BOOL)isSelected forButton:(UIButton *)button;
 
 @end
 
-@interface CPDFAnnotationBar : UIView
+@interface CPDFAnnotationToolBar : UIView
 
 @property (nonatomic, assign) NSInteger shapeStyle;
 

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 4 - 4
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationBar/CPDFAnnotationBar.m


+ 2 - 2
ComPDFKit_Tools/ComPDFKit_Tools/ComPDFKit_Tools.h

@@ -53,7 +53,7 @@
 #import <ComPDFKit_Tools/CPDFInfoViewController.h>
 
 // Annotation
-#import <ComPDFKit_Tools/CPDFAnnotationBar.h>
+#import <ComPDFKit_Tools/CPDFAnnotationToolBar.h>
 #import <ComPDFKit_Tools/CPDFAnnotationBaseViewController.h>
 #import <ComPDFKit_Tools/CPDFNoteViewController.h>
 #import <ComPDFKit_Tools/CPDFHighlightViewController.h>
@@ -76,7 +76,7 @@
 
 
 //Form
-#import <ComPDFKit_Tools/CPDFFormBar.h>
+#import <ComPDFKit_Tools/CPDFFormToolBar.h>
 #import <ComPDFKit_Tools/CPDFFormListOptionVC.h>
 
 // Page Edit

+ 4 - 4
ComPDFKit_Tools/ComPDFKit_Tools/Forms/PDFFormBar/CPDFFormBar.h

@@ -1,5 +1,5 @@
 //
-//  CPDFFormBar.h
+//  CPDFFormToolBar.h
 //  ComPDFKit_Tools
 //
 //  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
@@ -24,17 +24,17 @@ typedef NS_ENUM(NSInteger, CPDFFormToolbarSelectedIndex) {
     CPDFToolbarSign,
 };
 
-@class CPDFFormBar;
+@class CPDFFormToolBar;
 @class CPDFListView;
 @class CAnnotationManage;
 
 @protocol CPDFFormBarDelegate <NSObject>
 
 @optional
-- (void)formBarClick:(CPDFFormBar *)pdfFormBar forSelected:(BOOL)isSelected forButton:(UIButton *)button;
+- (void)formBarClick:(CPDFFormToolBar *)pdfFormBar forSelected:(BOOL)isSelected forButton:(UIButton *)button;
 @end
 
-@interface CPDFFormBar : UIView
+@interface CPDFFormToolBar : UIView
 
 @property (nonatomic, readonly) CPDFListView *pdfListView;
 

+ 4 - 4
ComPDFKit_Tools/ComPDFKit_Tools/Forms/PDFFormBar/CPDFFormBar.m

@@ -1,5 +1,5 @@
 //
-//  CPDFFormBar.m
+//  CPDFFormToolBar.m
 //  ComPDFKit_Tools
 //
 //  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
@@ -10,7 +10,7 @@
 //  This notice may not be removed from this file.
 //
 
-#import "CPDFFormBar.h"
+#import "CPDFFormToolBar.h"
 #import "CPDFColorUtils.h"
 #import "CPDFAnnotationBarButton.h"
 #import "AAPLCustomPresentationController.h"
@@ -28,7 +28,7 @@
 #import "CPDFListView+Private.h"
 #import "CPDFFormLinkViewController.h"
 
-@interface CPDFFormBar()
+@interface CPDFFormToolBar()
 
 @property (nonatomic, strong) UIScrollView *scrollView;
 
@@ -51,7 +51,7 @@
 
 @end
 
-@implementation CPDFFormBar
+@implementation CPDFFormToolBar
 
 #pragma mark - Initializers
 

+ 23 - 29
ContentEditor/ContentEditor.xcodeproj/project.pbxproj

@@ -14,12 +14,11 @@
 		4F17C07429F4FBFF00445550 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4F17C07229F4FBFF00445550 /* LaunchScreen.storyboard */; };
 		4F17C07729F4FBFF00445550 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F17C07629F4FBFF00445550 /* main.m */; };
 		4F17C07F29F4FE1700445550 /* CPDFViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F17C07D29F4FE1700445550 /* CPDFViewController.m */; };
+		F384DB162A48206E00798045 /* developer_guide_ios.pdf in Resources */ = {isa = PBXBuildFile; fileRef = F384DB152A48206E00798045 /* developer_guide_ios.pdf */; };
+		F384DB6D2A4930BD00798045 /* license_key_ios.xml in Resources */ = {isa = PBXBuildFile; fileRef = F384DB6C2A4930BD00798045 /* license_key_ios.xml */; };
+		F384DB842A49368900798045 /* XMLReader.m in Sources */ = {isa = PBXBuildFile; fileRef = F384DB832A49368900798045 /* XMLReader.m */; };
 		F3C0CBF22A431B3E00007C0A /* Form_Widgets_Test.pdf in Resources */ = {isa = PBXBuildFile; fileRef = F3C0CBE92A431B3E00007C0A /* Form_Widgets_Test.pdf */; };
 		F3C0CBF32A431B3E00007C0A /* PDF32000_2008.pdf in Resources */ = {isa = PBXBuildFile; fileRef = F3C0CBEA2A431B3E00007C0A /* PDF32000_2008.pdf */; };
-		F3C0CBF42A431B3E00007C0A /* Quick Start Guide.pdf in Resources */ = {isa = PBXBuildFile; fileRef = F3C0CBEB2A431B3E00007C0A /* Quick Start Guide.pdf */; };
-		F3C0CBF52A431B3E00007C0A /* SDKLicense.xml in Resources */ = {isa = PBXBuildFile; fileRef = F3C0CBEF2A431B3E00007C0A /* SDKLicense.xml */; };
-		F3C0CBF62A431B3E00007C0A /* XPDXMLElement.m in Sources */ = {isa = PBXBuildFile; fileRef = F3C0CBF02A431B3E00007C0A /* XPDXMLElement.m */; };
-		F3C0CBF72A431B3E00007C0A /* XMLParseManager.m in Sources */ = {isa = PBXBuildFile; fileRef = F3C0CBF12A431B3E00007C0A /* XMLParseManager.m */; };
 		F3C0CC542A4321AA00007C0A /* ComPDFKit_Tools.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F3C0CC532A4321AA00007C0A /* ComPDFKit_Tools.framework */; };
 		F3C0CC552A4321AA00007C0A /* ComPDFKit_Tools.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = F3C0CC532A4321AA00007C0A /* ComPDFKit_Tools.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		F3C0CC5B2A4321C300007C0A /* ComPDFKit.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = F3C0CC5A2A4321C300007C0A /* ComPDFKit.xcframework */; };
@@ -56,14 +55,12 @@
 		4F17C07D29F4FE1700445550 /* CPDFViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFViewController.m; sourceTree = "<group>"; };
 		4F17C07E29F4FE1700445550 /* CPDFViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFViewController.h; sourceTree = "<group>"; };
 		4F17C09929F4FFF500445550 /* compdfkit_tools.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = compdfkit_tools.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+		F384DB152A48206E00798045 /* developer_guide_ios.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = developer_guide_ios.pdf; sourceTree = "<group>"; };
+		F384DB6C2A4930BD00798045 /* license_key_ios.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = license_key_ios.xml; path = ../license_key_ios.xml; sourceTree = "<group>"; };
+		F384DB822A49368900798045 /* XMLReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLReader.h; sourceTree = "<group>"; };
+		F384DB832A49368900798045 /* XMLReader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XMLReader.m; sourceTree = "<group>"; };
 		F3C0CBE92A431B3E00007C0A /* Form_Widgets_Test.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = Form_Widgets_Test.pdf; sourceTree = "<group>"; };
 		F3C0CBEA2A431B3E00007C0A /* PDF32000_2008.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = PDF32000_2008.pdf; sourceTree = "<group>"; };
-		F3C0CBEB2A431B3E00007C0A /* Quick Start Guide.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = "Quick Start Guide.pdf"; sourceTree = "<group>"; };
-		F3C0CBED2A431B3E00007C0A /* XPDXMLElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPDXMLElement.h; sourceTree = "<group>"; };
-		F3C0CBEE2A431B3E00007C0A /* XMLParseManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLParseManager.h; sourceTree = "<group>"; };
-		F3C0CBEF2A431B3E00007C0A /* SDKLicense.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = SDKLicense.xml; sourceTree = "<group>"; };
-		F3C0CBF02A431B3E00007C0A /* XPDXMLElement.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XPDXMLElement.m; sourceTree = "<group>"; };
-		F3C0CBF12A431B3E00007C0A /* XMLParseManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XMLParseManager.m; sourceTree = "<group>"; };
 		F3C0CC532A4321AA00007C0A /* ComPDFKit_Tools.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = ComPDFKit_Tools.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 		F3C0CC5A2A4321C300007C0A /* ComPDFKit.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = ComPDFKit.xcframework; path = "/Users/dinglingui/项目/研发/UI/Annotations/../Lib/ComPDFKit.xcframework"; sourceTree = "<absolute>"; };
 /* End PBXFileReference section */
@@ -84,7 +81,8 @@
 		4F17C05829F4FBFD00445550 = {
 			isa = PBXGroup;
 			children = (
-				F3C0CBEC2A431B3E00007C0A /* SDKLicense */,
+				F384DB6C2A4930BD00798045 /* license_key_ios.xml */,
+				F384DB532A48237900798045 /* XMLParse */,
 				F3C0CBE82A431B3E00007C0A /* TestFile */,
 				4F17C06329F4FBFD00445550 /* ContentEditor */,
 				4F17C06229F4FBFD00445550 /* Products */,
@@ -129,28 +127,25 @@
 			name = Frameworks;
 			sourceTree = "<group>";
 		};
-		F3C0CBE82A431B3E00007C0A /* TestFile */ = {
+		F384DB532A48237900798045 /* XMLParse */ = {
 			isa = PBXGroup;
 			children = (
-				F3C0CBE92A431B3E00007C0A /* Form_Widgets_Test.pdf */,
-				F3C0CBEA2A431B3E00007C0A /* PDF32000_2008.pdf */,
-				F3C0CBEB2A431B3E00007C0A /* Quick Start Guide.pdf */,
+				F384DB822A49368900798045 /* XMLReader.h */,
+				F384DB832A49368900798045 /* XMLReader.m */,
 			);
-			name = TestFile;
-			path = ../TestFile;
+			name = XMLParse;
+			path = ../XMLParse;
 			sourceTree = "<group>";
 		};
-		F3C0CBEC2A431B3E00007C0A /* SDKLicense */ = {
+		F3C0CBE82A431B3E00007C0A /* TestFile */ = {
 			isa = PBXGroup;
 			children = (
-				F3C0CBEF2A431B3E00007C0A /* SDKLicense.xml */,
-				F3C0CBEE2A431B3E00007C0A /* XMLParseManager.h */,
-				F3C0CBF12A431B3E00007C0A /* XMLParseManager.m */,
-				F3C0CBED2A431B3E00007C0A /* XPDXMLElement.h */,
-				F3C0CBF02A431B3E00007C0A /* XPDXMLElement.m */,
+				F384DB152A48206E00798045 /* developer_guide_ios.pdf */,
+				F3C0CBE92A431B3E00007C0A /* Form_Widgets_Test.pdf */,
+				F3C0CBEA2A431B3E00007C0A /* PDF32000_2008.pdf */,
 			);
-			name = SDKLicense;
-			path = ../SDKLicense;
+			name = TestFile;
+			path = ../TestFile;
 			sourceTree = "<group>";
 		};
 /* End PBXGroup section */
@@ -212,10 +207,10 @@
 			isa = PBXResourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				F3C0CBF42A431B3E00007C0A /* Quick Start Guide.pdf in Resources */,
 				4F17C07429F4FBFF00445550 /* LaunchScreen.storyboard in Resources */,
 				4F17C07129F4FBFF00445550 /* Assets.xcassets in Resources */,
-				F3C0CBF52A431B3E00007C0A /* SDKLicense.xml in Resources */,
+				F384DB162A48206E00798045 /* developer_guide_ios.pdf in Resources */,
+				F384DB6D2A4930BD00798045 /* license_key_ios.xml in Resources */,
 				F3C0CBF32A431B3E00007C0A /* PDF32000_2008.pdf in Resources */,
 				F3C0CBF22A431B3E00007C0A /* Form_Widgets_Test.pdf in Resources */,
 				4F17C06F29F4FBFD00445550 /* Main.storyboard in Resources */,
@@ -229,10 +224,9 @@
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				F3C0CBF62A431B3E00007C0A /* XPDXMLElement.m in Sources */,
 				4F17C06629F4FBFD00445550 /* AppDelegate.m in Sources */,
 				4F17C07F29F4FE1700445550 /* CPDFViewController.m in Sources */,
-				F3C0CBF72A431B3E00007C0A /* XMLParseManager.m in Sources */,
+				F384DB842A49368900798045 /* XMLReader.m in Sources */,
 				4F17C07729F4FBFF00445550 /* main.m in Sources */,
 				4F17C06929F4FBFD00445550 /* SceneDelegate.m in Sources */,
 			);

+ 31 - 25
ContentEditor/ContentEditor/AppDelegate.m

@@ -16,7 +16,7 @@
 #import <ComPDFKit_Tools/ComPDFKit_Tools.h>
 
 #import "CPDFViewController.h"
-#import "XMLParseManager.h"
+#import "XMLReader.h"
 
 static AppDelegate *appDelegate = NULL;
 
@@ -24,8 +24,6 @@ static AppDelegate *appDelegate = NULL;
 
 @property (nonatomic, strong) UIWindow *window;
 
-@property (nonatomic, strong) XMLParseManager *manager;
-
 @end
 
 
@@ -33,30 +31,38 @@ static AppDelegate *appDelegate = NULL;
 
 
 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
-    // Override point for customization after application launch.
-    NSString *path = [[NSBundle mainBundle]pathForResource:@"SDKLicense" ofType:@"xml"];
-    NSURL *url = [NSURL fileURLWithPath:path];
-    _manager = [[XMLParseManager alloc]init];
-    [_manager parseXMLWithURL:url completion:^(BOOL SUC, XPDXMLElement *data,NSError *error) {
-        if (SUC) {
-            NSDictionary * attribute = data.attribute;
-            NSString * key = attribute[@"key"];
-            NSString * secret = attribute[@"secret"];
-            [CPDFKit setLicenseKey:key secret:secret];
-            
-            if (@available(iOS 13.0, *)) {
-                
-            } else {
-                UIWindow *windows = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
-                [self configWindow:windows];
-
-            }
+    
+    NSString *xmlFileString = [[NSBundle mainBundle] pathForResource:@"license_key_ios" ofType:@"xml"];
+    NSData *xmlData = [NSData dataWithContentsOfFile:xmlFileString];
+    NSError *error = nil;
+    
+    NSDictionary *result = [XMLReader dictionaryForXMLData:xmlData error:&error];
+    if (error)
+        NSLog(@"License key can not be empty.");
+    
+    if([result isKindOfClass:[NSDictionary class]]) {
+        NSDictionary *license = [result objectForKey:@"license"];
+        if([license isKindOfClass:[NSDictionary class]]) {
+            NSDictionary * keysDic = license[@"key"];
+            NSDictionary * secretDic = license[@"secret"];
             
-        }else{
-            NSLog(@"error = %@",error);
+            NSString * key = keysDic[@"text"];
+            NSString * secret = secretDic[@"text"];
+            [CPDFKit setLicenseKey:key secret:secret];
+        }  else {
+            NSLog(@"License key can not be empty.");
         }
-    }];
+    } else {
+        NSLog(@"License key can not be empty.");
+    }
+    
+    if (@available(iOS 13.0, *)) {
+        
+    } else {
+        UIWindow *windows = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
+        [self configWindow:windows];
 
+    }
     return YES;
 }
 
@@ -64,7 +70,7 @@ static AppDelegate *appDelegate = NULL;
     self.window = window;
     self.window.backgroundColor = [UIColor whiteColor];
     
-    NSString *filePath = [[NSBundle mainBundle] pathForResource:@"Quick Start Guide" ofType:@"pdf"];
+    NSString *filePath = [[NSBundle mainBundle] pathForResource:@"PDF32000_2008" ofType:@"pdf"];
     NSString *documentFolder = [NSHomeDirectory() stringByAppendingFormat:@"/%@/%@", @"Documents",@"Samples"];
 
     if (![[NSFileManager defaultManager] fileExistsAtPath:documentFolder])

+ 23 - 29
DocsEditor/DocsEditor.xcodeproj/project.pbxproj

@@ -15,13 +15,12 @@
 		C9C6EF022A20487C00E1DD81 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = C9C6EF012A20487C00E1DD81 /* main.m */; };
 		C9C6EF0A2A20492900E1DD81 /* ComPDFKit.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = C9C6EF092A20492900E1DD81 /* ComPDFKit.xcframework */; };
 		C9C6EF0B2A20492900E1DD81 /* ComPDFKit.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C9C6EF092A20492900E1DD81 /* ComPDFKit.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
-		C9C6EF162A204A3200E1DD81 /* SDKLicense.xml in Resources */ = {isa = PBXBuildFile; fileRef = C9C6EF132A204A3200E1DD81 /* SDKLicense.xml */; };
-		C9C6EF172A204A3200E1DD81 /* XPDXMLElement.m in Sources */ = {isa = PBXBuildFile; fileRef = C9C6EF142A204A3200E1DD81 /* XPDXMLElement.m */; };
-		C9C6EF182A204A3200E1DD81 /* XMLParseManager.m in Sources */ = {isa = PBXBuildFile; fileRef = C9C6EF152A204A3200E1DD81 /* XMLParseManager.m */; };
 		C9C6EF1D2A204A3E00E1DD81 /* Form_Widgets_Test.pdf in Resources */ = {isa = PBXBuildFile; fileRef = C9C6EF1A2A204A3E00E1DD81 /* Form_Widgets_Test.pdf */; };
 		C9C6EF1E2A204A3E00E1DD81 /* PDF32000_2008.pdf in Resources */ = {isa = PBXBuildFile; fileRef = C9C6EF1B2A204A3E00E1DD81 /* PDF32000_2008.pdf */; };
-		C9C6EF1F2A204A3E00E1DD81 /* Quick Start Guide.pdf in Resources */ = {isa = PBXBuildFile; fileRef = C9C6EF1C2A204A3E00E1DD81 /* Quick Start Guide.pdf */; };
 		C9C6EF222A204C9F00E1DD81 /* CPDFViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C9C6EF212A204C9F00E1DD81 /* CPDFViewController.m */; };
+		F384DB142A48206100798045 /* developer_guide_ios.pdf in Resources */ = {isa = PBXBuildFile; fileRef = F384DB132A48206100798045 /* developer_guide_ios.pdf */; };
+		F384DB6B2A4930B200798045 /* license_key_ios.xml in Resources */ = {isa = PBXBuildFile; fileRef = F384DB6A2A4930B100798045 /* license_key_ios.xml */; };
+		F384DB812A49367E00798045 /* XMLReader.m in Sources */ = {isa = PBXBuildFile; fileRef = F384DB802A49367E00798045 /* XMLReader.m */; };
 		F3C0CC512A4321A100007C0A /* ComPDFKit_Tools.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F3C0CC502A4321A100007C0A /* ComPDFKit_Tools.framework */; };
 		F3C0CC522A4321A100007C0A /* ComPDFKit_Tools.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = F3C0CC502A4321A100007C0A /* ComPDFKit_Tools.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 /* End PBXBuildFile section */
@@ -54,16 +53,14 @@
 		C9C6EF012A20487C00E1DD81 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
 		C9C6EF092A20492900E1DD81 /* ComPDFKit.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = ComPDFKit.xcframework; path = ../Lib/ComPDFKit.xcframework; sourceTree = "<group>"; };
 		C9C6EF0D2A20492E00E1DD81 /* compdfkit_tools.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = compdfkit_tools.framework; sourceTree = BUILT_PRODUCTS_DIR; };
-		C9C6EF112A204A3200E1DD81 /* XPDXMLElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPDXMLElement.h; sourceTree = "<group>"; };
-		C9C6EF122A204A3200E1DD81 /* XMLParseManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLParseManager.h; sourceTree = "<group>"; };
-		C9C6EF132A204A3200E1DD81 /* SDKLicense.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = SDKLicense.xml; sourceTree = "<group>"; };
-		C9C6EF142A204A3200E1DD81 /* XPDXMLElement.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XPDXMLElement.m; sourceTree = "<group>"; };
-		C9C6EF152A204A3200E1DD81 /* XMLParseManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XMLParseManager.m; sourceTree = "<group>"; };
 		C9C6EF1A2A204A3E00E1DD81 /* Form_Widgets_Test.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = Form_Widgets_Test.pdf; sourceTree = "<group>"; };
 		C9C6EF1B2A204A3E00E1DD81 /* PDF32000_2008.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = PDF32000_2008.pdf; sourceTree = "<group>"; };
-		C9C6EF1C2A204A3E00E1DD81 /* Quick Start Guide.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = "Quick Start Guide.pdf"; sourceTree = "<group>"; };
 		C9C6EF202A204C9F00E1DD81 /* CPDFViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFViewController.h; sourceTree = "<group>"; };
 		C9C6EF212A204C9F00E1DD81 /* CPDFViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFViewController.m; sourceTree = "<group>"; };
+		F384DB132A48206100798045 /* developer_guide_ios.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = developer_guide_ios.pdf; sourceTree = "<group>"; };
+		F384DB6A2A4930B100798045 /* license_key_ios.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = license_key_ios.xml; path = ../license_key_ios.xml; sourceTree = "<group>"; };
+		F384DB7F2A49367E00798045 /* XMLReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLReader.h; sourceTree = "<group>"; };
+		F384DB802A49367E00798045 /* XMLReader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XMLReader.m; sourceTree = "<group>"; };
 		F3C0CC502A4321A100007C0A /* ComPDFKit_Tools.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = ComPDFKit_Tools.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 /* End PBXFileReference section */
 
@@ -83,8 +80,9 @@
 		C9C6EEE32A20487900E1DD81 = {
 			isa = PBXGroup;
 			children = (
+				F384DB6A2A4930B100798045 /* license_key_ios.xml */,
+				F384DB4A2A48236900798045 /* XMLParse */,
 				C9C6EF192A204A3E00E1DD81 /* TestFile */,
-				C9C6EF102A204A3200E1DD81 /* SDKLicense */,
 				C9C6EEEE2A20487900E1DD81 /* DocsEditor */,
 				C9C6EEED2A20487900E1DD81 /* Products */,
 				C9C6EF082A20492800E1DD81 /* Frameworks */,
@@ -127,30 +125,27 @@
 			name = Frameworks;
 			sourceTree = "<group>";
 		};
-		C9C6EF102A204A3200E1DD81 /* SDKLicense */ = {
-			isa = PBXGroup;
-			children = (
-				C9C6EF132A204A3200E1DD81 /* SDKLicense.xml */,
-				C9C6EF122A204A3200E1DD81 /* XMLParseManager.h */,
-				C9C6EF152A204A3200E1DD81 /* XMLParseManager.m */,
-				C9C6EF112A204A3200E1DD81 /* XPDXMLElement.h */,
-				C9C6EF142A204A3200E1DD81 /* XPDXMLElement.m */,
-			);
-			name = SDKLicense;
-			path = ../SDKLicense;
-			sourceTree = "<group>";
-		};
 		C9C6EF192A204A3E00E1DD81 /* TestFile */ = {
 			isa = PBXGroup;
 			children = (
+				F384DB132A48206100798045 /* developer_guide_ios.pdf */,
 				C9C6EF1A2A204A3E00E1DD81 /* Form_Widgets_Test.pdf */,
 				C9C6EF1B2A204A3E00E1DD81 /* PDF32000_2008.pdf */,
-				C9C6EF1C2A204A3E00E1DD81 /* Quick Start Guide.pdf */,
 			);
 			name = TestFile;
 			path = ../TestFile;
 			sourceTree = "<group>";
 		};
+		F384DB4A2A48236900798045 /* XMLParse */ = {
+			isa = PBXGroup;
+			children = (
+				F384DB7F2A49367E00798045 /* XMLReader.h */,
+				F384DB802A49367E00798045 /* XMLReader.m */,
+			);
+			name = XMLParse;
+			path = ../XMLParse;
+			sourceTree = "<group>";
+		};
 /* End PBXGroup section */
 
 /* Begin PBXNativeTarget section */
@@ -211,11 +206,11 @@
 			files = (
 				C9C6EF1D2A204A3E00E1DD81 /* Form_Widgets_Test.pdf in Resources */,
 				C9C6EEFF2A20487C00E1DD81 /* LaunchScreen.storyboard in Resources */,
+				F384DB142A48206100798045 /* developer_guide_ios.pdf in Resources */,
+				F384DB6B2A4930B200798045 /* license_key_ios.xml in Resources */,
 				C9C6EEFC2A20487C00E1DD81 /* Assets.xcassets in Resources */,
-				C9C6EF162A204A3200E1DD81 /* SDKLicense.xml in Resources */,
 				C9C6EEFA2A20487900E1DD81 /* Main.storyboard in Resources */,
 				C9C6EF1E2A204A3E00E1DD81 /* PDF32000_2008.pdf in Resources */,
-				C9C6EF1F2A204A3E00E1DD81 /* Quick Start Guide.pdf in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -226,10 +221,9 @@
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				C9C6EF172A204A3200E1DD81 /* XPDXMLElement.m in Sources */,
 				C9C6EF222A204C9F00E1DD81 /* CPDFViewController.m in Sources */,
 				C9C6EEF12A20487900E1DD81 /* AppDelegate.m in Sources */,
-				C9C6EF182A204A3200E1DD81 /* XMLParseManager.m in Sources */,
+				F384DB812A49367E00798045 /* XMLReader.m in Sources */,
 				C9C6EF022A20487C00E1DD81 /* main.m in Sources */,
 				C9C6EEF42A20487900E1DD81 /* SceneDelegate.m in Sources */,
 			);

+ 31 - 25
DocsEditor/DocsEditor/AppDelegate.m

@@ -17,7 +17,7 @@
 #import <ComPDFKit_Tools/ComPDFKit_Tools.h>
 
 #import "CPDFViewController.h"
-#import "XMLParseManager.h"
+#import "XMLReader.h"
 
 static AppDelegate *appDelegate = NULL;
 
@@ -25,38 +25,44 @@ static AppDelegate *appDelegate = NULL;
 
 @property (nonatomic, strong) UIWindow *window;
 
-@property (nonatomic, strong) XMLParseManager *manager;
-
 @end
 
 @implementation AppDelegate
 
 
 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
-    // Override point for customization after application launch.
-    NSString *path = [[NSBundle mainBundle]pathForResource:@"SDKLicense" ofType:@"xml"];
-    NSURL *url = [NSURL fileURLWithPath:path];
-    _manager = [[XMLParseManager alloc]init];
-    [_manager parseXMLWithURL:url completion:^(BOOL SUC, XPDXMLElement *data,NSError *error) {
-        if (SUC) {
-            NSDictionary * attribute = data.attribute;
-            NSString * key = attribute[@"key"];
-            NSString * secret = attribute[@"secret"];
-            [CPDFKit setLicenseKey:key secret:secret];
-            
-            if (@available(iOS 13.0, *)) {
-                
-            } else {
-                UIWindow *windows = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
-                [self configWindow:windows];
-
-            }
+    
+    NSString *xmlFileString = [[NSBundle mainBundle] pathForResource:@"license_key_ios" ofType:@"xml"];
+    NSData *xmlData = [NSData dataWithContentsOfFile:xmlFileString];
+    NSError *error = nil;
+    
+    NSDictionary *result = [XMLReader dictionaryForXMLData:xmlData error:&error];
+    if (error)
+        NSLog(@"License key can not be empty.");
+    
+    if([result isKindOfClass:[NSDictionary class]]) {
+        NSDictionary *license = [result objectForKey:@"license"];
+        if([license isKindOfClass:[NSDictionary class]]) {
+            NSDictionary * keysDic = license[@"key"];
+            NSDictionary * secretDic = license[@"secret"];
             
-        }else{
-            NSLog(@"error = %@",error);
+            NSString * key = keysDic[@"text"];
+            NSString * secret = secretDic[@"text"];
+            [CPDFKit setLicenseKey:key secret:secret];
+        }  else {
+            NSLog(@"License key can not be empty.");
         }
-    }];
+    } else {
+        NSLog(@"License key can not be empty.");
+    }
+    
+    if (@available(iOS 13.0, *)) {
+        
+    } else {
+        UIWindow *windows = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
+        [self configWindow:windows];
 
+    }
     return YES;
 }
 
@@ -64,7 +70,7 @@ static AppDelegate *appDelegate = NULL;
     self.window = window;
     self.window.backgroundColor = [UIColor whiteColor];
     
-    NSString *filePath = [[NSBundle mainBundle] pathForResource:@"Quick Start Guide" ofType:@"pdf"];
+    NSString *filePath = [[NSBundle mainBundle] pathForResource:@"PDF32000_2008" ofType:@"pdf"];
     NSString *documentFolder = [NSHomeDirectory() stringByAppendingFormat:@"/%@/%@", @"Documents",@"Samples"];
 
     if (![[NSFileManager defaultManager] fileExistsAtPath:documentFolder])

+ 23 - 29
Forms/Forms.xcodeproj/project.pbxproj

@@ -14,12 +14,11 @@
 		4F1151662A1D989800EC433D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4F1151642A1D989800EC433D /* LaunchScreen.storyboard */; };
 		4F1151692A1D989800EC433D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F1151682A1D989800EC433D /* main.m */; };
 		4F4051C92A1EFC430034DC07 /* CPDFViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F4051C82A1EFC430034DC07 /* CPDFViewController.m */; };
+		F384DB0E2A48203800798045 /* developer_guide_ios.pdf in Resources */ = {isa = PBXBuildFile; fileRef = F384DB0D2A48203800798045 /* developer_guide_ios.pdf */; };
+		F384DB692A4930A600798045 /* license_key_ios.xml in Resources */ = {isa = PBXBuildFile; fileRef = F384DB682A4930A600798045 /* license_key_ios.xml */; };
+		F384DB7E2A49367200798045 /* XMLReader.m in Sources */ = {isa = PBXBuildFile; fileRef = F384DB7C2A49367200798045 /* XMLReader.m */; };
 		F3C0CC022A431B6000007C0A /* Form_Widgets_Test.pdf in Resources */ = {isa = PBXBuildFile; fileRef = F3C0CBF92A431B6000007C0A /* Form_Widgets_Test.pdf */; };
 		F3C0CC032A431B6000007C0A /* PDF32000_2008.pdf in Resources */ = {isa = PBXBuildFile; fileRef = F3C0CBFA2A431B6000007C0A /* PDF32000_2008.pdf */; };
-		F3C0CC042A431B6000007C0A /* Quick Start Guide.pdf in Resources */ = {isa = PBXBuildFile; fileRef = F3C0CBFB2A431B6000007C0A /* Quick Start Guide.pdf */; };
-		F3C0CC052A431B6000007C0A /* SDKLicense.xml in Resources */ = {isa = PBXBuildFile; fileRef = F3C0CBFF2A431B6000007C0A /* SDKLicense.xml */; };
-		F3C0CC062A431B6000007C0A /* XPDXMLElement.m in Sources */ = {isa = PBXBuildFile; fileRef = F3C0CC002A431B6000007C0A /* XPDXMLElement.m */; };
-		F3C0CC072A431B6000007C0A /* XMLParseManager.m in Sources */ = {isa = PBXBuildFile; fileRef = F3C0CC012A431B6000007C0A /* XMLParseManager.m */; };
 		F3C0CC4D2A43218F00007C0A /* ComPDFKit_Tools.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F3C0CC4C2A43218F00007C0A /* ComPDFKit_Tools.framework */; };
 		F3C0CC4E2A43218F00007C0A /* ComPDFKit_Tools.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = F3C0CC4C2A43218F00007C0A /* ComPDFKit_Tools.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		F3C0CC5E2A4321CF00007C0A /* ComPDFKit.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = F3C0CC5D2A4321CF00007C0A /* ComPDFKit.xcframework */; };
@@ -55,14 +54,12 @@
 		4F1151892A1D9B3000EC433D /* compdfkit_tools.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = compdfkit_tools.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 		4F4051C72A1EFC430034DC07 /* CPDFViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFViewController.h; sourceTree = "<group>"; };
 		4F4051C82A1EFC430034DC07 /* CPDFViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFViewController.m; sourceTree = "<group>"; };
+		F384DB0D2A48203800798045 /* developer_guide_ios.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = developer_guide_ios.pdf; sourceTree = "<group>"; };
+		F384DB682A4930A600798045 /* license_key_ios.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = license_key_ios.xml; path = ../license_key_ios.xml; sourceTree = "<group>"; };
+		F384DB7C2A49367200798045 /* XMLReader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XMLReader.m; sourceTree = "<group>"; };
+		F384DB7D2A49367200798045 /* XMLReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLReader.h; sourceTree = "<group>"; };
 		F3C0CBF92A431B6000007C0A /* Form_Widgets_Test.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = Form_Widgets_Test.pdf; sourceTree = "<group>"; };
 		F3C0CBFA2A431B6000007C0A /* PDF32000_2008.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = PDF32000_2008.pdf; sourceTree = "<group>"; };
-		F3C0CBFB2A431B6000007C0A /* Quick Start Guide.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = "Quick Start Guide.pdf"; sourceTree = "<group>"; };
-		F3C0CBFD2A431B6000007C0A /* XPDXMLElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPDXMLElement.h; sourceTree = "<group>"; };
-		F3C0CBFE2A431B6000007C0A /* XMLParseManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLParseManager.h; sourceTree = "<group>"; };
-		F3C0CBFF2A431B6000007C0A /* SDKLicense.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = SDKLicense.xml; sourceTree = "<group>"; };
-		F3C0CC002A431B6000007C0A /* XPDXMLElement.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XPDXMLElement.m; sourceTree = "<group>"; };
-		F3C0CC012A431B6000007C0A /* XMLParseManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XMLParseManager.m; sourceTree = "<group>"; };
 		F3C0CC4C2A43218F00007C0A /* ComPDFKit_Tools.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = ComPDFKit_Tools.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 		F3C0CC5D2A4321CF00007C0A /* ComPDFKit.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = ComPDFKit.xcframework; path = "/Users/dinglingui/项目/研发/UI/Annotations/../Lib/ComPDFKit.xcframework"; sourceTree = "<absolute>"; };
 /* End PBXFileReference section */
@@ -83,7 +80,8 @@
 		4F11514A2A1D989600EC433D = {
 			isa = PBXGroup;
 			children = (
-				F3C0CBFC2A431B6000007C0A /* SDKLicense */,
+				F384DB682A4930A600798045 /* license_key_ios.xml */,
+				F384DB412A48235800798045 /* XMLParse */,
 				F3C0CBF82A431B6000007C0A /* TestFile */,
 				4F1151552A1D989700EC433D /* Forms */,
 				4F1151542A1D989700EC433D /* Products */,
@@ -127,28 +125,25 @@
 			name = Frameworks;
 			sourceTree = "<group>";
 		};
-		F3C0CBF82A431B6000007C0A /* TestFile */ = {
+		F384DB412A48235800798045 /* XMLParse */ = {
 			isa = PBXGroup;
 			children = (
-				F3C0CBF92A431B6000007C0A /* Form_Widgets_Test.pdf */,
-				F3C0CBFA2A431B6000007C0A /* PDF32000_2008.pdf */,
-				F3C0CBFB2A431B6000007C0A /* Quick Start Guide.pdf */,
+				F384DB7D2A49367200798045 /* XMLReader.h */,
+				F384DB7C2A49367200798045 /* XMLReader.m */,
 			);
-			name = TestFile;
-			path = ../TestFile;
+			name = XMLParse;
+			path = ../XMLParse;
 			sourceTree = "<group>";
 		};
-		F3C0CBFC2A431B6000007C0A /* SDKLicense */ = {
+		F3C0CBF82A431B6000007C0A /* TestFile */ = {
 			isa = PBXGroup;
 			children = (
-				F3C0CBFF2A431B6000007C0A /* SDKLicense.xml */,
-				F3C0CBFE2A431B6000007C0A /* XMLParseManager.h */,
-				F3C0CC012A431B6000007C0A /* XMLParseManager.m */,
-				F3C0CBFD2A431B6000007C0A /* XPDXMLElement.h */,
-				F3C0CC002A431B6000007C0A /* XPDXMLElement.m */,
+				F384DB0D2A48203800798045 /* developer_guide_ios.pdf */,
+				F3C0CBF92A431B6000007C0A /* Form_Widgets_Test.pdf */,
+				F3C0CBFA2A431B6000007C0A /* PDF32000_2008.pdf */,
 			);
-			name = SDKLicense;
-			path = ../SDKLicense;
+			name = TestFile;
+			path = ../TestFile;
 			sourceTree = "<group>";
 		};
 /* End PBXGroup section */
@@ -209,10 +204,10 @@
 			isa = PBXResourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				F3C0CC042A431B6000007C0A /* Quick Start Guide.pdf in Resources */,
 				4F1151662A1D989800EC433D /* LaunchScreen.storyboard in Resources */,
 				4F1151632A1D989800EC433D /* Assets.xcassets in Resources */,
-				F3C0CC052A431B6000007C0A /* SDKLicense.xml in Resources */,
+				F384DB0E2A48203800798045 /* developer_guide_ios.pdf in Resources */,
+				F384DB692A4930A600798045 /* license_key_ios.xml in Resources */,
 				F3C0CC032A431B6000007C0A /* PDF32000_2008.pdf in Resources */,
 				F3C0CC022A431B6000007C0A /* Form_Widgets_Test.pdf in Resources */,
 				4F1151612A1D989700EC433D /* Main.storyboard in Resources */,
@@ -226,10 +221,9 @@
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				F3C0CC062A431B6000007C0A /* XPDXMLElement.m in Sources */,
 				4F4051C92A1EFC430034DC07 /* CPDFViewController.m in Sources */,
 				4F1151582A1D989700EC433D /* AppDelegate.m in Sources */,
-				F3C0CC072A431B6000007C0A /* XMLParseManager.m in Sources */,
+				F384DB7E2A49367200798045 /* XMLReader.m in Sources */,
 				4F1151692A1D989800EC433D /* main.m in Sources */,
 				4F11515B2A1D989700EC433D /* SceneDelegate.m in Sources */,
 			);

+ 30 - 24
Forms/Forms/AppDelegate.m

@@ -16,7 +16,7 @@
 #import <ComPDFKit_Tools/ComPDFKit_Tools.h>
 
 #import "CPDFViewController.h"
-#import "XMLParseManager.h"
+#import "XMLReader.h"
 
 static AppDelegate *appDelegate = NULL;
 
@@ -24,38 +24,44 @@ static AppDelegate *appDelegate = NULL;
 
 @property (nonatomic, strong) UIWindow *window;
 
-@property (nonatomic, strong) XMLParseManager *manager;
-
 @end
 
 @implementation AppDelegate
 
 
 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
-    // Override point for customization after application launch.
-    NSString *path = [[NSBundle mainBundle]pathForResource:@"SDKLicense" ofType:@"xml"];
-    NSURL *url = [NSURL fileURLWithPath:path];
-    _manager = [[XMLParseManager alloc]init];
-    [_manager parseXMLWithURL:url completion:^(BOOL SUC, XPDXMLElement *data,NSError *error) {
-        if (SUC) {
-            NSDictionary * attribute = data.attribute;
-            NSString * key = attribute[@"key"];
-            NSString * secret = attribute[@"secret"];
-            [CPDFKit setLicenseKey:key secret:secret];
-            
-            if (@available(iOS 13.0, *)) {
-                
-            } else {
-                UIWindow *windows = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
-                [self configWindow:windows];
-
-            }
+    
+    NSString *xmlFileString = [[NSBundle mainBundle] pathForResource:@"license_key_ios" ofType:@"xml"];
+    NSData *xmlData = [NSData dataWithContentsOfFile:xmlFileString];
+    NSError *error = nil;
+    
+    NSDictionary *result = [XMLReader dictionaryForXMLData:xmlData error:&error];
+    if (error)
+        NSLog(@"License key can not be empty.");
+    
+    if([result isKindOfClass:[NSDictionary class]]) {
+        NSDictionary *license = [result objectForKey:@"license"];
+        if([license isKindOfClass:[NSDictionary class]]) {
+            NSDictionary * keysDic = license[@"key"];
+            NSDictionary * secretDic = license[@"secret"];
             
-        }else{
-            NSLog(@"error = %@",error);
+            NSString * key = keysDic[@"text"];
+            NSString * secret = secretDic[@"text"];
+            [CPDFKit setLicenseKey:key secret:secret];
+        }  else {
+            NSLog(@"License key can not be empty.");
         }
-    }];
+    } else {
+        NSLog(@"License key can not be empty.");
+    }
+    
+    if (@available(iOS 13.0, *)) {
+        
+    } else {
+        UIWindow *windows = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
+        [self configWindow:windows];
 
+    }
     return YES;
 }
 

+ 3 - 3
Forms/Forms/CPDFViewController.m

@@ -18,7 +18,7 @@
 
 @interface CPDFViewController () <CPDFToolsViewControllerDelegate,CPDFFormBarDelegate,CPDFBOTAViewControllerDelegate,CPDFListViewDelegate,CPDFSignatureViewControllerDelegate>
 
-@property(nonatomic, strong) CPDFFormBar * formBar;
+@property(nonatomic, strong) CPDFFormToolBar * formBar;
 @property(nonatomic, strong) CAnnotationManage *annotationManage;
 @property(nonatomic, strong) CPDFSignatureWidgetAnnotation * signatureAnnotation;
 
@@ -42,7 +42,7 @@
 - (void)initFormBar {
     
     self.annotationManage = [[CAnnotationManage alloc] initWithPDFView:self.pdfListView];
-    self.formBar = [[CPDFFormBar alloc] initAnnotationManage:self.annotationManage];
+    self.formBar = [[CPDFFormToolBar alloc] initAnnotationManage:self.annotationManage];
     
     CGFloat height = 44.0;
     if (@available(iOS 11.0, *))
@@ -307,7 +307,7 @@
 
 #pragma mark - CPDFAnnotationBarDelegate
 
-- (void)formBarClick:(CPDFFormBar *)pdfFormBar forSelected:(BOOL)isSelected forButton:(UIButton *)button {
+- (void)formBarClick:(CPDFFormToolBar *)pdfFormBar forSelected:(BOOL)isSelected forButton:(UIButton *)button {
     NSLog(@"form bar Clicked!");
 }
 

+ 23 - 29
PDFViewer/PDFViewer.xcodeproj/project.pbxproj

@@ -14,12 +14,11 @@
 		4F6B6C4A2A173F6F0030C94E /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4F6B6C482A173F6F0030C94E /* LaunchScreen.storyboard */; };
 		4F6B6C4D2A173F6F0030C94E /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F6B6C4C2A173F6F0030C94E /* main.m */; };
 		4F6B6C8C2A174EB80030C94E /* CPDFViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F6B6C8A2A174EB70030C94E /* CPDFViewController.m */; };
+		F384DB102A48204500798045 /* developer_guide_ios.pdf in Resources */ = {isa = PBXBuildFile; fileRef = F384DB0F2A48204500798045 /* developer_guide_ios.pdf */; };
+		F384DB672A49309B00798045 /* license_key_ios.xml in Resources */ = {isa = PBXBuildFile; fileRef = F384DB662A49309B00798045 /* license_key_ios.xml */; };
+		F384DB782A49362400798045 /* XMLReader.m in Sources */ = {isa = PBXBuildFile; fileRef = F384DB762A49362400798045 /* XMLReader.m */; };
 		F3C0CC122A431B8A00007C0A /* Form_Widgets_Test.pdf in Resources */ = {isa = PBXBuildFile; fileRef = F3C0CC092A431B8A00007C0A /* Form_Widgets_Test.pdf */; };
 		F3C0CC132A431B8A00007C0A /* PDF32000_2008.pdf in Resources */ = {isa = PBXBuildFile; fileRef = F3C0CC0A2A431B8A00007C0A /* PDF32000_2008.pdf */; };
-		F3C0CC142A431B8A00007C0A /* Quick Start Guide.pdf in Resources */ = {isa = PBXBuildFile; fileRef = F3C0CC0B2A431B8A00007C0A /* Quick Start Guide.pdf */; };
-		F3C0CC152A431B8A00007C0A /* SDKLicense.xml in Resources */ = {isa = PBXBuildFile; fileRef = F3C0CC0F2A431B8A00007C0A /* SDKLicense.xml */; };
-		F3C0CC162A431B8A00007C0A /* XPDXMLElement.m in Sources */ = {isa = PBXBuildFile; fileRef = F3C0CC102A431B8A00007C0A /* XPDXMLElement.m */; };
-		F3C0CC172A431B8A00007C0A /* XMLParseManager.m in Sources */ = {isa = PBXBuildFile; fileRef = F3C0CC112A431B8A00007C0A /* XMLParseManager.m */; };
 		F3C0CC492A43218300007C0A /* ComPDFKit_Tools.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F3C0CC482A43218300007C0A /* ComPDFKit_Tools.framework */; };
 		F3C0CC4A2A43218300007C0A /* ComPDFKit_Tools.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = F3C0CC482A43218300007C0A /* ComPDFKit_Tools.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		F3C0CC612A4321D500007C0A /* ComPDFKit.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = F3C0CC602A4321D500007C0A /* ComPDFKit.xcframework */; };
@@ -55,14 +54,12 @@
 		4F6B6C842A174D7C0030C94E /* compdfkit_tools.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = compdfkit_tools.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 		4F6B6C8A2A174EB70030C94E /* CPDFViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPDFViewController.m; sourceTree = "<group>"; };
 		4F6B6C8B2A174EB70030C94E /* CPDFViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPDFViewController.h; 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>"; };
+		F384DB772A49362400798045 /* XMLReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLReader.h; sourceTree = "<group>"; };
 		F3C0CC092A431B8A00007C0A /* Form_Widgets_Test.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = Form_Widgets_Test.pdf; sourceTree = "<group>"; };
 		F3C0CC0A2A431B8A00007C0A /* PDF32000_2008.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = PDF32000_2008.pdf; sourceTree = "<group>"; };
-		F3C0CC0B2A431B8A00007C0A /* Quick Start Guide.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = "Quick Start Guide.pdf"; sourceTree = "<group>"; };
-		F3C0CC0D2A431B8A00007C0A /* XPDXMLElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPDXMLElement.h; sourceTree = "<group>"; };
-		F3C0CC0E2A431B8A00007C0A /* XMLParseManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLParseManager.h; sourceTree = "<group>"; };
-		F3C0CC0F2A431B8A00007C0A /* SDKLicense.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = SDKLicense.xml; sourceTree = "<group>"; };
-		F3C0CC102A431B8A00007C0A /* XPDXMLElement.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XPDXMLElement.m; sourceTree = "<group>"; };
-		F3C0CC112A431B8A00007C0A /* XMLParseManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XMLParseManager.m; sourceTree = "<group>"; };
 		F3C0CC482A43218300007C0A /* ComPDFKit_Tools.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = ComPDFKit_Tools.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 		F3C0CC602A4321D500007C0A /* ComPDFKit.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = ComPDFKit.xcframework; path = "/Users/dinglingui/项目/研发/UI/Annotations/../Lib/ComPDFKit.xcframework"; sourceTree = "<absolute>"; };
 /* End PBXFileReference section */
@@ -83,7 +80,8 @@
 		4F6B6C2E2A173F6D0030C94E = {
 			isa = PBXGroup;
 			children = (
-				F3C0CC0C2A431B8A00007C0A /* SDKLicense */,
+				F384DB662A49309B00798045 /* license_key_ios.xml */,
+				F384DB2E2A48232E00798045 /* XMLParse */,
 				F3C0CC082A431B8A00007C0A /* TestFile */,
 				4F6B6C392A173F6D0030C94E /* PDFViewer */,
 				4F6B6C382A173F6D0030C94E /* Products */,
@@ -127,28 +125,25 @@
 			name = Frameworks;
 			sourceTree = "<group>";
 		};
-		F3C0CC082A431B8A00007C0A /* TestFile */ = {
+		F384DB2E2A48232E00798045 /* XMLParse */ = {
 			isa = PBXGroup;
 			children = (
-				F3C0CC092A431B8A00007C0A /* Form_Widgets_Test.pdf */,
-				F3C0CC0A2A431B8A00007C0A /* PDF32000_2008.pdf */,
-				F3C0CC0B2A431B8A00007C0A /* Quick Start Guide.pdf */,
+				F384DB772A49362400798045 /* XMLReader.h */,
+				F384DB762A49362400798045 /* XMLReader.m */,
 			);
-			name = TestFile;
-			path = ../TestFile;
+			name = XMLParse;
+			path = ../XMLParse;
 			sourceTree = "<group>";
 		};
-		F3C0CC0C2A431B8A00007C0A /* SDKLicense */ = {
+		F3C0CC082A431B8A00007C0A /* TestFile */ = {
 			isa = PBXGroup;
 			children = (
-				F3C0CC0F2A431B8A00007C0A /* SDKLicense.xml */,
-				F3C0CC0E2A431B8A00007C0A /* XMLParseManager.h */,
-				F3C0CC112A431B8A00007C0A /* XMLParseManager.m */,
-				F3C0CC0D2A431B8A00007C0A /* XPDXMLElement.h */,
-				F3C0CC102A431B8A00007C0A /* XPDXMLElement.m */,
+				F384DB0F2A48204500798045 /* developer_guide_ios.pdf */,
+				F3C0CC092A431B8A00007C0A /* Form_Widgets_Test.pdf */,
+				F3C0CC0A2A431B8A00007C0A /* PDF32000_2008.pdf */,
 			);
-			name = SDKLicense;
-			path = ../SDKLicense;
+			name = TestFile;
+			path = ../TestFile;
 			sourceTree = "<group>";
 		};
 /* End PBXGroup section */
@@ -209,10 +204,10 @@
 			isa = PBXResourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				F3C0CC142A431B8A00007C0A /* Quick Start Guide.pdf in Resources */,
 				4F6B6C4A2A173F6F0030C94E /* LaunchScreen.storyboard in Resources */,
 				4F6B6C472A173F6F0030C94E /* Assets.xcassets in Resources */,
-				F3C0CC152A431B8A00007C0A /* SDKLicense.xml in Resources */,
+				F384DB102A48204500798045 /* developer_guide_ios.pdf in Resources */,
+				F384DB672A49309B00798045 /* license_key_ios.xml in Resources */,
 				F3C0CC132A431B8A00007C0A /* PDF32000_2008.pdf in Resources */,
 				F3C0CC122A431B8A00007C0A /* Form_Widgets_Test.pdf in Resources */,
 				4F6B6C452A173F6D0030C94E /* Main.storyboard in Resources */,
@@ -226,10 +221,9 @@
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				F3C0CC162A431B8A00007C0A /* XPDXMLElement.m in Sources */,
 				4F6B6C8C2A174EB80030C94E /* CPDFViewController.m in Sources */,
 				4F6B6C3C2A173F6D0030C94E /* AppDelegate.m in Sources */,
-				F3C0CC172A431B8A00007C0A /* XMLParseManager.m in Sources */,
+				F384DB782A49362400798045 /* XMLReader.m in Sources */,
 				4F6B6C4D2A173F6F0030C94E /* main.m in Sources */,
 				4F6B6C3F2A173F6D0030C94E /* SceneDelegate.m in Sources */,
 			);

+ 78 - 0
PDFViewer/PDFViewer.xcodeproj/xcshareddata/xcschemes/PDFViewer.xcscheme

@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+   LastUpgradeVersion = "1410"
+   version = "1.3">
+   <BuildAction
+      parallelizeBuildables = "YES"
+      buildImplicitDependencies = "YES">
+      <BuildActionEntries>
+         <BuildActionEntry
+            buildForTesting = "YES"
+            buildForRunning = "YES"
+            buildForProfiling = "YES"
+            buildForArchiving = "YES"
+            buildForAnalyzing = "YES">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "4F6B6C362A173F6D0030C94E"
+               BuildableName = "PDFViewer.app"
+               BlueprintName = "PDFViewer"
+               ReferencedContainer = "container:PDFViewer.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 = "Release"
+      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 = "4F6B6C362A173F6D0030C94E"
+            BuildableName = "PDFViewer.app"
+            BlueprintName = "PDFViewer"
+            ReferencedContainer = "container:PDFViewer.xcodeproj">
+         </BuildableReference>
+      </BuildableProductRunnable>
+   </LaunchAction>
+   <ProfileAction
+      buildConfiguration = "Release"
+      shouldUseLaunchSchemeArgsEnv = "YES"
+      savedToolIdentifier = ""
+      useCustomWorkingDirectory = "NO"
+      debugDocumentVersioning = "YES">
+      <BuildableProductRunnable
+         runnableDebuggingMode = "0">
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "4F6B6C362A173F6D0030C94E"
+            BuildableName = "PDFViewer.app"
+            BlueprintName = "PDFViewer"
+            ReferencedContainer = "container:PDFViewer.xcodeproj">
+         </BuildableReference>
+      </BuildableProductRunnable>
+   </ProfileAction>
+   <AnalyzeAction
+      buildConfiguration = "Debug">
+   </AnalyzeAction>
+   <ArchiveAction
+      buildConfiguration = "Release"
+      revealArchiveInOrganizer = "YES">
+   </ArchiveAction>
+</Scheme>

+ 31 - 25
PDFViewer/PDFViewer/AppDelegate.m

@@ -17,7 +17,7 @@
 #import <ComPDFKit_Tools/ComPDFKit_Tools.h>
 
 #import "CPDFViewController.h"
-#import "XMLParseManager.h"
+#import "XMLReader.h"
 
 static AppDelegate *appDelegate = NULL;
 
@@ -25,38 +25,44 @@ static AppDelegate *appDelegate = NULL;
 
 @property (nonatomic, strong) UIWindow *window;
 
-@property (nonatomic, strong) XMLParseManager *manager;
-
 @end
 
 @implementation AppDelegate
 
 
 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
-    // Override point for customization after application launch.
-    NSString *path = [[NSBundle mainBundle]pathForResource:@"SDKLicense" ofType:@"xml"];
-    NSURL *url = [NSURL fileURLWithPath:path];
-    _manager = [[XMLParseManager alloc]init];
-    [_manager parseXMLWithURL:url completion:^(BOOL SUC, XPDXMLElement *data,NSError *error) {
-        if (SUC) {
-            NSDictionary * attribute = data.attribute;
-            NSString * key = attribute[@"key"];
-            NSString * secret = attribute[@"secret"];
-            [CPDFKit setLicenseKey:key secret:secret];
-            
-            if (@available(iOS 13.0, *)) {
-                
-            } else {
-                UIWindow *windows = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
-                [self configWindow:windows];
-
-            }
+    
+    NSString *xmlFileString = [[NSBundle mainBundle] pathForResource:@"license_key_ios" ofType:@"xml"];
+    NSData *xmlData = [NSData dataWithContentsOfFile:xmlFileString];
+    NSError *error = nil;
+    
+    NSDictionary *result = [XMLReader dictionaryForXMLData:xmlData error:&error];
+    if (error)
+        NSLog(@"License key can not be empty.");
+    
+    if([result isKindOfClass:[NSDictionary class]]) {
+        NSDictionary *license = [result objectForKey:@"license"];
+        if([license isKindOfClass:[NSDictionary class]]) {
+            NSDictionary * keysDic = license[@"key"];
+            NSDictionary * secretDic = license[@"secret"];
             
-        }else{
-            NSLog(@"error = %@",error);
+            NSString * key = keysDic[@"text"];
+            NSString * secret = secretDic[@"text"];
+            [CPDFKit setLicenseKey:key secret:secret];
+        }  else {
+            NSLog(@"License key can not be empty.");
         }
-    }];
+    } else {
+        NSLog(@"License key can not be empty.");
+    }
+    
+    if (@available(iOS 13.0, *)) {
+        
+    } else {
+        UIWindow *windows = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
+        [self configWindow:windows];
 
+    }
     return YES;
 }
 
@@ -64,7 +70,7 @@ static AppDelegate *appDelegate = NULL;
     self.window = window;
     self.window.backgroundColor = [UIColor whiteColor];
     
-    NSString *filePath = [[NSBundle mainBundle] pathForResource:@"Quick Start Guide" ofType:@"pdf"];
+    NSString *filePath = [[NSBundle mainBundle] pathForResource:@"PDF32000_2008" ofType:@"pdf"];
     NSString *documentFolder = [NSHomeDirectory() stringByAppendingFormat:@"/%@/%@", @"Documents",@"Samples"];
 
     if (![[NSFileManager defaultManager] fileExistsAtPath:documentFolder])

+ 5 - 5
PDFViewer/PDFViewer/CPDFViewController.m

@@ -19,9 +19,9 @@
 
 @interface CPDFViewController () <CPDFSoundPlayBarDelegate,CPDFAnnotationBarDelegate,CPDFToolsViewControllerDelegate,CPDFNoteOpenViewControllerDelegate,CPDFBOTAViewControllerDelegate,CPDFEditToolBarDelegate,CPDFFormBarDelegate,CPDFListViewDelegate,CPDFSignatureViewControllerDelegate,CPDFPageEditViewControllerDelegate,CPDFKeyboardToolbarDelegate>
 
-@property(nonatomic, strong) CPDFAnnotationBar *annotationBar;
+@property(nonatomic, strong) CPDFAnnotationToolBar *annotationBar;
 
-@property (nonatomic, strong) CPDFFormBar *formBar;
+@property (nonatomic, strong) CPDFFormToolBar *formBar;
 
 @property(nonatomic, strong) CPDFSoundPlayBar *soundPlayBar;
 
@@ -62,7 +62,7 @@
 - (void)initAnnotationBar {
     self.annotationManage = [[CAnnotationManage alloc] initWithPDFView:self.pdfListView];
         
-    self.annotationBar = [[CPDFAnnotationBar alloc] initAnnotationManage:self.annotationManage];
+    self.annotationBar = [[CPDFAnnotationToolBar alloc] initAnnotationManage:self.annotationManage];
     
     CGFloat height = 44.0;
     if (@available(iOS 11.0, *))
@@ -85,7 +85,7 @@
 
 - (void)initWithFormTool {
     if(!self.formBar){
-        self.formBar = [[CPDFFormBar  alloc] initAnnotationManage:self.annotationManage];
+        self.formBar = [[CPDFFormToolBar  alloc] initAnnotationManage:self.annotationManage];
     }
     self.formBar.delegate = self;
     self.formBar.parentVC = self;
@@ -623,7 +623,7 @@
 
 #pragma mark - CPDFAnnotationBarDelegate
 
-- (void)annotationBarClick:(CPDFAnnotationBar *)annotationBar clickAnnotationMode:(CPDFViewAnnotationMode)annotationMode forSelected:(BOOL)isSelected forButton:(UIButton *)button {
+- (void)annotationBarClick:(CPDFAnnotationToolBar *)annotationBar clickAnnotationMode:(CPDFViewAnnotationMode)annotationMode forSelected:(BOOL)isSelected forButton:(UIButton *)button {
     if(CPDFViewAnnotationModeInk == annotationMode || CPDFViewAnnotationModePencilDrawing == annotationMode) {
         CGFloat tPosY = 0;
         if(isSelected) {

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 4
SDKLicense/SDKLicense.xml


+ 0 - 25
SDKLicense/XMLParseManager.h

@@ -1,25 +0,0 @@
-//
-//  XMLParseManager.h
-//  XMLParseDome
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <Foundation/Foundation.h>
-
-#import "XPDXMLElement.h"
-
-@interface XMLParseManager : NSObject
-
-typedef void(^ParseXMLCompletion)(BOOL SUC,XPDXMLElement *data,NSError *error);
-
-- (void)parseXMLWithURL:(NSURL *)url completion:(ParseXMLCompletion)block;
-
-@end
-
-

+ 0 - 103
SDKLicense/XMLParseManager.m

@@ -1,103 +0,0 @@
-//
-//  XMLParseManager.m
-//  XMLParseDome
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import "XMLParseManager.h"
-
-#define dispatch_main_safe_async(block) if ([NSThread isMainThread]) {\
-block();\
-}else{\
-dispatch_async(dispatch_get_main_queue(), ^{\
-    block();\
-});\
-}
-
-@interface XMLParseManager()<NSXMLParserDelegate>
-@property (nonatomic, strong) NSXMLParser *parser;
-@property(nonatomic,copy)ParseXMLCompletion block;
-
-@property (nonatomic, strong) XPDXMLElement *rootElement;
-@property (nonatomic, strong) XPDXMLElement *currentElement;
-
-@end
-@implementation XMLParseManager
--(void)parseXMLWithURL:(NSURL *)url completion:(ParseXMLCompletion)block{
-    if (url) {
-        
-        self.block=block;
-       
-        __weak typeof(self) weakSelf = self;
-        NSInputStream *fileInput=[[NSInputStream alloc]initWithURL:url];
-        
-        _parser = [[NSXMLParser alloc]initWithStream:fileInput];
-        _parser.delegate = self;
-
-            __strong typeof(weakSelf) strongSelf = weakSelf;
-            [strongSelf.parser parse];
-            if (weakSelf.parser.parserError) {
-                dispatch_main_safe_async(^{
-                    
-                    if (block) {
-                        block(NO,nil,strongSelf.parser.parserError);
-                    }
-                });
-            }
-    }
-}
--(void)parserDidStartDocument:(NSXMLParser *)parser{
-    self.rootElement=nil;
-    self.currentElement = nil;
-}
--(void)parserDidEndDocument:(NSXMLParser *)parser{
-    __weak typeof(self) weakSelf = self;
-    if (self&&self.block) {
-       
-        dispatch_main_safe_async(^{
-            __strong typeof(weakSelf) strongSelf = weakSelf;
-            strongSelf.block(YES, strongSelf.rootElement, nil);
-        });
-    }
-}
--(void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary<NSString *,NSString *> *)attributeDict{
-
-    if (!self.rootElement) {
-        self.rootElement = [[XPDXMLElement alloc]init];
-        self.currentElement = self.rootElement;
-    }else{
-        XPDXMLElement *element = [[XPDXMLElement alloc]init];
-        element.parent = self.currentElement;
-        [self.currentElement.childElement addObject:element];
-        element.name = elementName;
-        self.currentElement = element;
-    }
-    self.currentElement.name = elementName;
-    self.currentElement.attribute = attributeDict;
-}
-
-- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string
-{
-    [self.currentElement.text appendString:string];
-}
-
--(void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName{
-    self.currentElement = self.currentElement.parent;
-    
-}
-- (void)parser:(NSXMLParser *)parser validationErrorOccurred:(NSError *)validationError{
-    if (self.block) {
-        __weak typeof(self) weakSelf = self;
-        dispatch_main_safe_async(^{
-            __strong typeof(weakSelf) strongSelf = weakSelf;
-            strongSelf.block(NO, nil,validationError);
-        });
-    }
-}
-@end

+ 0 - 32
SDKLicense/XPDXMLElement.h

@@ -1,32 +0,0 @@
-//
-//  XPDXMLElement.h
-//  XMLParseDome
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <Foundation/Foundation.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@interface XPDXMLElement : NSObject
-
-@property (nonatomic, strong) NSString *name;
-
-@property (nonatomic, strong) NSMutableString *text;
-
-@property (nonatomic, strong) NSDictionary *attribute;
-
-@property (nonatomic, strong) XPDXMLElement *parent;
-
-@property (nonatomic, strong) NSMutableArray<XPDXMLElement *> *childElement;
-
--(NSDictionary *)convertToDic;
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 84
SDKLicense/XPDXMLElement.m

@@ -1,84 +0,0 @@
-//
-//  XPDXMLElement.m
-//  XMLParseDome
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import "XPDXMLElement.h"
-
-@implementation XPDXMLElement
-- (instancetype)init
-{
-    self = [super init];
-    if (self) {
-        _text=[[NSMutableString alloc]init];
-    }
-    return self;
-}
--(NSMutableArray<XPDXMLElement *> *)childElement{
-    if (!_childElement) {
-        _childElement = [[NSMutableArray alloc]init];
-    }
-    return _childElement;
-}
--(NSString *)description{
-    
-    NSDictionary *dic = [self convertToDic];
-  
-    
-    if ([NSJSONSerialization isValidJSONObject:dic]) {
-        NSError *error;
-        NSData *jsonData=[NSJSONSerialization dataWithJSONObject:dic options:NSJSONWritingPrettyPrinted error:&error];
-        if (error) {
-            return @"{}";
-        }
-        if (jsonData) {
-            @try {
-                NSString *jsonStr = [[NSString alloc]initWithData:jsonData encoding:NSUTF8StringEncoding];
-                return jsonStr;
-            } @catch (NSException *exception) {
-                
-            }
-        }
-    }
-    
-    return @"{}";
-    
-}
--(NSDictionary *)convertToDic{
-    NSMutableDictionary *dic = [[NSMutableDictionary alloc]init];
-    if (self.name) {
-        
-        dic[self.name]=self.text;
-    }
-    if (self.attribute&&self.attribute.count>0) {
-        [dic addEntriesFromDictionary:self.attribute];
-    }
-    if (self.childElement&&self.childElement.count>0) {
-        NSMutableArray *child=[[NSMutableArray alloc]init];
-        for (XPDXMLElement *element in self.childElement) {
-            NSDictionary *childDic = [element convertToDic];
-            if (element.childElement&&element.childElement.count>0) {
-                [child addObject:childDic];
-            }else{
-                [dic addEntriesFromDictionary:childDic];
-            }
-            
-            
-            
-        }
-        if (child.count>0) {
-            dic[@"child"]=child;
-        }
-        
-        
-    }
-    return dic;
-}
-@end

BIN
TestFile/Quick Start Guide.pdf


BIN
TestFile/developer_guide_ios.pdf


+ 18 - 24
Viewer/Viewer.xcodeproj/project.pbxproj

@@ -7,8 +7,6 @@
 	objects = {
 
 /* Begin PBXBuildFile section */
-		4FBCB53A29E8253D00F86483 /* XPDXMLElement.m in Sources */ = {isa = PBXBuildFile; fileRef = 4FBCB53729E8253D00F86483 /* XPDXMLElement.m */; };
-		4FBCB53B29E8253D00F86483 /* XMLParseManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 4FBCB53829E8253D00F86483 /* XMLParseManager.m */; };
 		C9413B0D29E420C700F2CBF6 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C9413B0C29E420C700F2CBF6 /* AppDelegate.m */; };
 		C9413B1029E420C700F2CBF6 /* SceneDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C9413B0F29E420C700F2CBF6 /* SceneDelegate.m */; };
 		C9413B1829E420C900F2CBF6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C9413B1729E420C900F2CBF6 /* Assets.xcassets */; };
@@ -18,11 +16,12 @@
 		F313657729E4369500EE6BBB /* ComPDFKit.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = F313657529E4369500EE6BBB /* ComPDFKit.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		F313657C29E436B800EE6BBB /* Form_Widgets_Test.pdf in Resources */ = {isa = PBXBuildFile; fileRef = F313657929E436B800EE6BBB /* Form_Widgets_Test.pdf */; };
 		F313657D29E436B800EE6BBB /* PDF32000_2008.pdf in Resources */ = {isa = PBXBuildFile; fileRef = F313657A29E436B800EE6BBB /* PDF32000_2008.pdf */; };
-		F313657E29E436B800EE6BBB /* Quick Start Guide.pdf in Resources */ = {isa = PBXBuildFile; fileRef = F313657B29E436B800EE6BBB /* Quick Start Guide.pdf */; };
 		F313658129E4378800EE6BBB /* CPDFViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F313658029E4378800EE6BBB /* CPDFViewController.m */; };
 		F35E2B4D2A43273B00170763 /* ComPDFKit_Tools.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F35E2B4C2A43273B00170763 /* ComPDFKit_Tools.framework */; };
 		F35E2B4E2A43273B00170763 /* ComPDFKit_Tools.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = F35E2B4C2A43273B00170763 /* ComPDFKit_Tools.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
-		F3F6322329E5909100D23F77 /* SDKLicense.xml in Resources */ = {isa = PBXBuildFile; fileRef = F3F6322229E5909100D23F77 /* SDKLicense.xml */; };
+		F384DB122A48205200798045 /* developer_guide_ios.pdf in Resources */ = {isa = PBXBuildFile; fileRef = F384DB112A48205200798045 /* developer_guide_ios.pdf */; };
+		F384DB652A49308D00798045 /* license_key_ios.xml in Resources */ = {isa = PBXBuildFile; fileRef = F384DB642A49308C00798045 /* license_key_ios.xml */; };
+		F384DB7B2A49366100798045 /* XMLReader.m in Sources */ = {isa = PBXBuildFile; fileRef = F384DB792A49366100798045 /* XMLReader.m */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXCopyFilesBuildPhase section */
@@ -42,10 +41,6 @@
 
 /* Begin PBXFileReference section */
 		4F0373CF2A13802200ED4DB5 /* Viewer.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Viewer.entitlements; sourceTree = "<group>"; };
-		4FBCB53629E8253D00F86483 /* XPDXMLElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPDXMLElement.h; sourceTree = "<group>"; };
-		4FBCB53729E8253D00F86483 /* XPDXMLElement.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XPDXMLElement.m; sourceTree = "<group>"; };
-		4FBCB53829E8253D00F86483 /* XMLParseManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XMLParseManager.m; sourceTree = "<group>"; };
-		4FBCB53929E8253D00F86483 /* XMLParseManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLParseManager.h; sourceTree = "<group>"; };
 		C9413B0829E420C700F2CBF6 /* Viewer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Viewer.app; sourceTree = BUILT_PRODUCTS_DIR; };
 		C9413B0B29E420C700F2CBF6 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
 		C9413B0C29E420C700F2CBF6 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
@@ -58,12 +53,14 @@
 		F313657529E4369500EE6BBB /* ComPDFKit.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = ComPDFKit.xcframework; path = ../Lib/ComPDFKit.xcframework; sourceTree = "<group>"; };
 		F313657929E436B800EE6BBB /* Form_Widgets_Test.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = Form_Widgets_Test.pdf; sourceTree = "<group>"; };
 		F313657A29E436B800EE6BBB /* PDF32000_2008.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = PDF32000_2008.pdf; sourceTree = "<group>"; };
-		F313657B29E436B800EE6BBB /* Quick Start Guide.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = "Quick Start Guide.pdf"; sourceTree = "<group>"; };
 		F313657F29E4378800EE6BBB /* CPDFViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFViewController.h; sourceTree = "<group>"; };
 		F313658029E4378800EE6BBB /* CPDFViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFViewController.m; sourceTree = "<group>"; };
 		F335EE5229E430E400ACC72A /* compdfkit_tools.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = compdfkit_tools.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 		F35E2B4C2A43273B00170763 /* ComPDFKit_Tools.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = ComPDFKit_Tools.framework; sourceTree = BUILT_PRODUCTS_DIR; };
-		F3F6322229E5909100D23F77 /* SDKLicense.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = SDKLicense.xml; sourceTree = "<group>"; };
+		F384DB112A48205200798045 /* developer_guide_ios.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = developer_guide_ios.pdf; sourceTree = "<group>"; };
+		F384DB642A49308C00798045 /* license_key_ios.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = license_key_ios.xml; path = ../license_key_ios.xml; sourceTree = "<group>"; };
+		F384DB792A49366100798045 /* XMLReader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XMLReader.m; sourceTree = "<group>"; };
+		F384DB7A2A49366100798045 /* XMLReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLReader.h; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
@@ -82,7 +79,8 @@
 		C9413AFF29E420C700F2CBF6 = {
 			isa = PBXGroup;
 			children = (
-				F3F6322129E5909100D23F77 /* SDKLicense */,
+				F384DB642A49308C00798045 /* license_key_ios.xml */,
+				F384DB252A48231200798045 /* XMLParse */,
 				F313657829E436B800EE6BBB /* TestFile */,
 				C9413B0A29E420C700F2CBF6 /* Viewer */,
 				C9413B0929E420C700F2CBF6 /* Products */,
@@ -119,9 +117,9 @@
 		F313657829E436B800EE6BBB /* TestFile */ = {
 			isa = PBXGroup;
 			children = (
+				F384DB112A48205200798045 /* developer_guide_ios.pdf */,
 				F313657929E436B800EE6BBB /* Form_Widgets_Test.pdf */,
 				F313657A29E436B800EE6BBB /* PDF32000_2008.pdf */,
-				F313657B29E436B800EE6BBB /* Quick Start Guide.pdf */,
 			);
 			name = TestFile;
 			path = ../TestFile;
@@ -137,17 +135,14 @@
 			name = Frameworks;
 			sourceTree = "<group>";
 		};
-		F3F6322129E5909100D23F77 /* SDKLicense */ = {
+		F384DB252A48231200798045 /* XMLParse */ = {
 			isa = PBXGroup;
 			children = (
-				4FBCB53929E8253D00F86483 /* XMLParseManager.h */,
-				4FBCB53829E8253D00F86483 /* XMLParseManager.m */,
-				4FBCB53629E8253D00F86483 /* XPDXMLElement.h */,
-				4FBCB53729E8253D00F86483 /* XPDXMLElement.m */,
-				F3F6322229E5909100D23F77 /* SDKLicense.xml */,
+				F384DB7A2A49366100798045 /* XMLReader.h */,
+				F384DB792A49366100798045 /* XMLReader.m */,
 			);
-			name = SDKLicense;
-			path = ../SDKLicense;
+			name = XMLParse;
+			path = ../XMLParse;
 			sourceTree = "<group>";
 		};
 /* End PBXGroup section */
@@ -208,11 +203,11 @@
 			isa = PBXResourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				F3F6322329E5909100D23F77 /* SDKLicense.xml in Resources */,
-				F313657E29E436B800EE6BBB /* Quick Start Guide.pdf in Resources */,
 				C9413B1B29E420C900F2CBF6 /* LaunchScreen.storyboard in Resources */,
 				C9413B1829E420C900F2CBF6 /* Assets.xcassets in Resources */,
 				F313657D29E436B800EE6BBB /* PDF32000_2008.pdf in Resources */,
+				F384DB652A49308D00798045 /* license_key_ios.xml in Resources */,
+				F384DB122A48205200798045 /* developer_guide_ios.pdf in Resources */,
 				F313657C29E436B800EE6BBB /* Form_Widgets_Test.pdf in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
@@ -226,9 +221,8 @@
 			files = (
 				C9413B0D29E420C700F2CBF6 /* AppDelegate.m in Sources */,
 				F313658129E4378800EE6BBB /* CPDFViewController.m in Sources */,
+				F384DB7B2A49366100798045 /* XMLReader.m in Sources */,
 				C9413B1E29E420C900F2CBF6 /* main.m in Sources */,
-				4FBCB53B29E8253D00F86483 /* XMLParseManager.m in Sources */,
-				4FBCB53A29E8253D00F86483 /* XPDXMLElement.m in Sources */,
 				C9413B1029E420C700F2CBF6 /* SceneDelegate.m in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;

+ 29 - 23
Viewer/Viewer/AppDelegate.m

@@ -16,7 +16,7 @@
 #import <compdfkit_tools/compdfkit_tools.h>
 
 #import "CPDFViewController.h"
-#import "XMLParseManager.h"
+#import "XMLReader.h"
 
 static AppDelegate *appDelegate = NULL;
 
@@ -24,8 +24,6 @@ static AppDelegate *appDelegate = NULL;
 
 @property (nonatomic, strong) UIWindow *window;
 
-@property (nonatomic, strong) XMLParseManager *manager;
-
 @end
 
 @implementation AppDelegate
@@ -33,29 +31,37 @@ static AppDelegate *appDelegate = NULL;
 
 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
     
-    NSString *path = [[NSBundle mainBundle]pathForResource:@"SDKLicense" ofType:@"xml"];
-    NSURL *url = [NSURL fileURLWithPath:path];
-    _manager=[[XMLParseManager alloc]init];
-    [_manager parseXMLWithURL:url completion:^(BOOL SUC, XPDXMLElement *data,NSError *error) {
-        if (SUC) {
-            NSDictionary * attribute = data.attribute;
-            NSString * key = attribute[@"key"];
-            NSString * secret = attribute[@"secret"];
-            [CPDFKit setLicenseKey:key secret:secret];
-            
-            if (@available(iOS 13.0, *)) {
-                
-            } else {
-                UIWindow *windows = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
-                [self configWindow:windows];
-
-            }
+    NSString *xmlFileString = [[NSBundle mainBundle] pathForResource:@"license_key_ios" ofType:@"xml"];
+    NSData *xmlData = [NSData dataWithContentsOfFile:xmlFileString];
+    NSError *error = nil;
+    
+    NSDictionary *result = [XMLReader dictionaryForXMLData:xmlData error:&error];
+    if (error)
+        NSLog(@"License key can not be empty.");
+    
+    if([result isKindOfClass:[NSDictionary class]]) {
+        NSDictionary *license = [result objectForKey:@"license"];
+        if([license isKindOfClass:[NSDictionary class]]) {
+            NSDictionary * keysDic = license[@"key"];
+            NSDictionary * secretDic = license[@"secret"];
             
-        }else{
-            NSLog(@"error = %@",error);
+            NSString * key = keysDic[@"text"];
+            NSString * secret = secretDic[@"text"];
+            [CPDFKit setLicenseKey:key secret:secret];
+        }  else {
+            NSLog(@"License key can not be empty.");
         }
-    }];
+    } else {
+        NSLog(@"License key can not be empty.");
+    }
+    
+    if (@available(iOS 13.0, *)) {
+        
+    } else {
+        UIWindow *windows = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
+        [self configWindow:windows];
 
+    }
     return YES;
 }
 

+ 25 - 0
XMLParse/XMLReader.h

@@ -0,0 +1,25 @@
+//
+//  XMLReader.h
+//
+//  Created by Troy Brant on 9/18/10.
+//  Updated by Antoine Marcadet on 9/23/11.
+//  Updated by Divan Visagie on 2012-08-26
+//
+
+#import <Foundation/Foundation.h>
+
+enum {
+    XMLReaderOptionsProcessNamespaces           = 1 << 0, // Specifies whether the receiver reports the namespace and the qualified name of an element.
+    XMLReaderOptionsReportNamespacePrefixes     = 1 << 1, // Specifies whether the receiver reports the scope of namespace declarations.
+    XMLReaderOptionsResolveExternalEntities     = 1 << 2, // Specifies whether the receiver reports declarations of external entities.
+};
+typedef NSUInteger XMLReaderOptions;
+
+@interface XMLReader : NSObject <NSXMLParserDelegate>
+
++ (NSDictionary *)dictionaryForXMLData:(NSData *)data error:(NSError **)errorPointer;
++ (NSDictionary *)dictionaryForXMLString:(NSString *)string error:(NSError **)errorPointer;
++ (NSDictionary *)dictionaryForXMLData:(NSData *)data options:(XMLReaderOptions)options error:(NSError **)errorPointer;
++ (NSDictionary *)dictionaryForXMLString:(NSString *)string options:(XMLReaderOptions)options error:(NSError **)errorPointer;
+
+@end

+ 176 - 0
XMLParse/XMLReader.m

@@ -0,0 +1,176 @@
+//
+//  XMLReader.m
+//
+//  Created by Troy Brant on 9/18/10.
+//  Updated by Antoine Marcadet on 9/23/11.
+//  Updated by Divan Visagie on 2012-08-26
+//
+
+#import "XMLReader.h"
+
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "XMLReader requires ARC support."
+#endif
+
+NSString *const kXMLReaderTextNodeKey		= @"text";
+NSString *const kXMLReaderAttributePrefix	= @"@";
+
+@interface XMLReader ()
+
+@property (nonatomic, strong) NSMutableArray *dictionaryStack;
+@property (nonatomic, strong) NSMutableString *textInProgress;
+@property (nonatomic, strong) NSError *errorPointer;
+
+@end
+
+
+@implementation XMLReader
+
+#pragma mark - Public methods
+
++ (NSDictionary *)dictionaryForXMLData:(NSData *)data error:(NSError **)error
+{
+    XMLReader *reader = [[XMLReader alloc] initWithError:error];
+    NSDictionary *rootDictionary = [reader objectWithData:data options:0];
+    return rootDictionary;
+}
+
++ (NSDictionary *)dictionaryForXMLString:(NSString *)string error:(NSError **)error
+{
+    NSData *data = [string dataUsingEncoding:NSUTF8StringEncoding];
+    return [XMLReader dictionaryForXMLData:data error:error];
+}
+
++ (NSDictionary *)dictionaryForXMLData:(NSData *)data options:(XMLReaderOptions)options error:(NSError **)error
+{
+    XMLReader *reader = [[XMLReader alloc] initWithError:error];
+    NSDictionary *rootDictionary = [reader objectWithData:data options:options];
+    return rootDictionary;
+}
+
++ (NSDictionary *)dictionaryForXMLString:(NSString *)string options:(XMLReaderOptions)options error:(NSError **)error
+{
+    NSData *data = [string dataUsingEncoding:NSUTF8StringEncoding];
+    return [XMLReader dictionaryForXMLData:data options:options error:error];
+}
+
+
+#pragma mark - Parsing
+
+- (id)initWithError:(NSError **)error
+{
+	self = [super init];
+    if (self)
+    {
+        self.errorPointer = *error;
+    }
+    return self;
+}
+
+- (NSDictionary *)objectWithData:(NSData *)data options:(XMLReaderOptions)options
+{
+    // Clear out any old data
+    self.dictionaryStack = [[NSMutableArray alloc] init];
+    self.textInProgress = [[NSMutableString alloc] init];
+    
+    // Initialize the stack with a fresh dictionary
+    [self.dictionaryStack addObject:[NSMutableDictionary dictionary]];
+    
+    // Parse the XML
+    NSXMLParser *parser = [[NSXMLParser alloc] initWithData:data];
+    
+    [parser setShouldProcessNamespaces:(options & XMLReaderOptionsProcessNamespaces)];
+    [parser setShouldReportNamespacePrefixes:(options & XMLReaderOptionsReportNamespacePrefixes)];
+    [parser setShouldResolveExternalEntities:(options & XMLReaderOptionsResolveExternalEntities)];
+    
+    parser.delegate = self;
+    BOOL success = [parser parse];
+	
+    // Return the stack's root dictionary on success
+    if (success)
+    {
+        NSDictionary *resultDict = [self.dictionaryStack objectAtIndex:0];
+        return resultDict;
+    }
+    
+    return nil;
+}
+
+
+#pragma mark -  NSXMLParserDelegate methods
+
+- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict
+{   
+    // Get the dictionary for the current level in the stack
+    NSMutableDictionary *parentDict = [self.dictionaryStack lastObject];
+
+    // Create the child dictionary for the new element, and initilaize it with the attributes
+    NSMutableDictionary *childDict = [NSMutableDictionary dictionary];
+    [childDict addEntriesFromDictionary:attributeDict];
+    
+    // If there's already an item for this key, it means we need to create an array
+    id existingValue = [parentDict objectForKey:elementName];
+    if (existingValue)
+    {
+        NSMutableArray *array = nil;
+        if ([existingValue isKindOfClass:[NSMutableArray class]])
+        {
+            // The array exists, so use it
+            array = (NSMutableArray *) existingValue;
+        }
+        else
+        {
+            // Create an array if it doesn't exist
+            array = [NSMutableArray array];
+            [array addObject:existingValue];
+
+            // Replace the child dictionary with an array of children dictionaries
+            [parentDict setObject:array forKey:elementName];
+        }
+        
+        // Add the new child dictionary to the array
+        [array addObject:childDict];
+    }
+    else
+    {
+        // No existing value, so update the dictionary
+        [parentDict setObject:childDict forKey:elementName];
+    }
+    
+    // Update the stack
+    [self.dictionaryStack addObject:childDict];
+}
+
+- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName
+{
+    // Update the parent dict with text info
+    NSMutableDictionary *dictInProgress = [self.dictionaryStack lastObject];
+    
+    // Set the text property
+    if ([self.textInProgress length] > 0)
+    {
+        // trim after concatenating
+        NSString *trimmedString = [self.textInProgress stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
+        [dictInProgress setObject:[trimmedString mutableCopy] forKey:kXMLReaderTextNodeKey];
+
+        // Reset the text
+        self.textInProgress = [[NSMutableString alloc] init];
+    }
+    
+    // Pop the current dict
+    [self.dictionaryStack removeLastObject];
+}
+
+- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string
+{
+    // Build the text value
+    [self.textInProgress appendString:string];
+}
+
+- (void)parser:(NSXMLParser *)parser parseErrorOccurred:(NSError *)parseError
+{
+    // Set the error pointer to the parser's error object
+    self.errorPointer = parseError;
+}
+
+@end

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 8 - 0
license_key_ios.xml