Browse Source

PDFView(ios) - 真机测试安全区域和自适应修改

yangliuhua 2 years ago
parent
commit
e2378715fe

+ 51 - 91
PDFViewer.xcodeproj/project.pbxproj

@@ -25,7 +25,6 @@
 		C95FE77D2966F7970038BBF3 /* CPDFBatesAddViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C95FE77C2966F7970038BBF3 /* CPDFBatesAddViewController.m */; };
 		C96150D2295400B00020F445 /* CPDFDrawView.m in Sources */ = {isa = PBXBuildFile; fileRef = C96150D1295400B00020F445 /* CPDFDrawView.m */; };
 		C96150D529554F660020F445 /* CPDFClipView.m in Sources */ = {isa = PBXBuildFile; fileRef = C96150D429554F660020F445 /* CPDFClipView.m */; };
-		C96384932949E2020055CCCA /* ComPDFKit.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = C96384922949E2020055CCCA /* ComPDFKit.xcframework */; };
 		C9638496294ACC240055CCCA /* CPDFAddWaterMarkViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C9638495294ACC240055CCCA /* CPDFAddWaterMarkViewController.m */; };
 		C96D13932924793800CC92C7 /* btn_more.png in Resources */ = {isa = PBXBuildFile; fileRef = C96D13922924793800CC92C7 /* btn_more.png */; };
 		C97A78732967AC3D0012BA91 /* CPDFAddViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C97A78722967AC3D0012BA91 /* CPDFAddViewController.m */; };
@@ -34,6 +33,9 @@
 		C986D3F8296288C400EBD4DF /* CPDFBackgroundPreview.m in Sources */ = {isa = PBXBuildFile; fileRef = C986D3F7296288C400EBD4DF /* CPDFBackgroundPreview.m */; };
 		C986D3FB296288F700EBD4DF /* CPDFBackgroundView.m in Sources */ = {isa = PBXBuildFile; fileRef = C986D3FA296288F700EBD4DF /* CPDFBackgroundView.m */; };
 		C986D3FE2962A70400EBD4DF /* CPDFBackgroundSettingView.m in Sources */ = {isa = PBXBuildFile; fileRef = C986D3FD2962A70400EBD4DF /* CPDFBackgroundSettingView.m */; };
+		C9ECD0E9296BDAEF006C459B /* ComPDFKit.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = C9ECD0E7296BDAD1006C459B /* ComPDFKit.xcframework */; };
+		C9ECD0EA296BDAEF006C459B /* ComPDFKit.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C9ECD0E7296BDAD1006C459B /* ComPDFKit.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
+		C9ECD105296CFE45006C459B /* Sample in Resources */ = {isa = PBXBuildFile; fileRef = C9ECD104296CFE45006C459B /* Sample */; };
 		EC62978E29220F8300D339EE /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = EC62978D29220F8300D339EE /* AppDelegate.m */; };
 		EC62979129220F8300D339EE /* SceneDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = EC62979029220F8300D339EE /* SceneDelegate.m */; };
 		EC62979429220F8300D339EE /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = EC62979329220F8300D339EE /* ViewController.m */; };
@@ -71,6 +73,7 @@
 			dstPath = "";
 			dstSubfolderSpec = 10;
 			files = (
+				C9ECD0EA296BDAEF006C459B /* ComPDFKit.xcframework in Embed Frameworks */,
 			);
 			name = "Embed Frameworks";
 			runOnlyForDeploymentPostprocessing = 0;
@@ -78,10 +81,10 @@
 /* End PBXCopyFilesBuildPhase section */
 
 /* Begin PBXFileReference section */
-		C92BA1922963F806009954EF /* CPDFDrawBackgroundView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFDrawBackgroundView.h; sourceTree = "<group>"; };
-		C92BA1932963F806009954EF /* CPDFDrawBackgroundView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFDrawBackgroundView.m; sourceTree = "<group>"; };
-		C92BA1952963F84B009954EF /* CPDFDrawImageView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFDrawImageView.h; sourceTree = "<group>"; };
-		C92BA1962963F84B009954EF /* CPDFDrawImageView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFDrawImageView.m; sourceTree = "<group>"; };
+		C92BA1922963F806009954EF /* CPDFDrawBackgroundView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CPDFDrawBackgroundView.h; path = ../CPDFDrawBackgroundView.h; sourceTree = "<group>"; };
+		C92BA1932963F806009954EF /* CPDFDrawBackgroundView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = CPDFDrawBackgroundView.m; path = ../CPDFDrawBackgroundView.m; sourceTree = "<group>"; };
+		C92BA1952963F84B009954EF /* CPDFDrawImageView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CPDFDrawImageView.h; path = ../CPDFDrawImageView.h; sourceTree = "<group>"; };
+		C92BA1962963F84B009954EF /* CPDFDrawImageView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = CPDFDrawImageView.m; path = ../CPDFDrawImageView.m; sourceTree = "<group>"; };
 		C92BA19829651CA3009954EF /* CPDFBackgroundModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFBackgroundModel.h; sourceTree = "<group>"; };
 		C92BA19929651CA3009954EF /* CPDFBackgroundModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFBackgroundModel.m; sourceTree = "<group>"; };
 		C95FE7452966F3700038BBF3 /* CPDFHeaderFooterModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFHeaderFooterModel.h; sourceTree = "<group>"; };
@@ -107,26 +110,27 @@
 		C95FE77B2966F78E0038BBF3 /* CPDFBatesAddViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFBatesAddViewController.h; sourceTree = "<group>"; };
 		C95FE77C2966F7970038BBF3 /* CPDFBatesAddViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPDFBatesAddViewController.m; sourceTree = "<group>"; };
 		C95FE7812966F7AF0038BBF3 /* CPDFAddViewControllerHeader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFAddViewControllerHeader.h; sourceTree = "<group>"; };
-		C96150D0295400B00020F445 /* CPDFDrawView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFDrawView.h; sourceTree = "<group>"; };
-		C96150D1295400B00020F445 /* CPDFDrawView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFDrawView.m; sourceTree = "<group>"; };
-		C96150D329554F660020F445 /* CPDFClipView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFClipView.h; sourceTree = "<group>"; };
-		C96150D429554F660020F445 /* CPDFClipView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFClipView.m; sourceTree = "<group>"; };
-		C96384922949E2020055CCCA /* ComPDFKit.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = ComPDFKit.xcframework; sourceTree = "<group>"; };
-		C9638494294ACC240055CCCA /* CPDFAddWaterMarkViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFAddWaterMarkViewController.h; sourceTree = "<group>"; };
-		C9638495294ACC240055CCCA /* CPDFAddWaterMarkViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFAddWaterMarkViewController.m; sourceTree = "<group>"; };
+		C96150D0295400B00020F445 /* CPDFDrawView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CPDFDrawView.h; path = ../CPDFDrawView.h; sourceTree = "<group>"; };
+		C96150D1295400B00020F445 /* CPDFDrawView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = CPDFDrawView.m; path = ../CPDFDrawView.m; sourceTree = "<group>"; };
+		C96150D329554F660020F445 /* CPDFClipView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CPDFClipView.h; path = ../CPDFClipView.h; sourceTree = "<group>"; };
+		C96150D429554F660020F445 /* CPDFClipView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = CPDFClipView.m; path = ../CPDFClipView.m; sourceTree = "<group>"; };
+		C9638494294ACC240055CCCA /* CPDFAddWaterMarkViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CPDFAddWaterMarkViewController.h; path = ../../CPDFAddWaterMarkViewController.h; sourceTree = "<group>"; };
+		C9638495294ACC240055CCCA /* CPDFAddWaterMarkViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = CPDFAddWaterMarkViewController.m; path = ../../CPDFAddWaterMarkViewController.m; sourceTree = "<group>"; };
 		C96D13922924793800CC92C7 /* btn_more.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = btn_more.png; sourceTree = "<group>"; };
 		C97A78702967AC210012BA91 /* CPDFAddViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFAddViewController.h; sourceTree = "<group>"; };
 		C97A78722967AC3D0012BA91 /* CPDFAddViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFAddViewController.m; sourceTree = "<group>"; };
 		C97E91662959B96C007F6943 /* CPDFEditView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFEditView.h; sourceTree = "<group>"; };
 		C97E91672959B96C007F6943 /* CPDFEditView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFEditView.m; sourceTree = "<group>"; };
-		C986D3F32962857900EBD4DF /* CPDFBackgroundSettingViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFBackgroundSettingViewController.h; sourceTree = "<group>"; };
-		C986D3F42962857900EBD4DF /* CPDFBackgroundSettingViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFBackgroundSettingViewController.m; sourceTree = "<group>"; };
-		C986D3F6296288C400EBD4DF /* CPDFBackgroundPreview.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFBackgroundPreview.h; sourceTree = "<group>"; };
-		C986D3F7296288C400EBD4DF /* CPDFBackgroundPreview.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFBackgroundPreview.m; sourceTree = "<group>"; };
-		C986D3F9296288F700EBD4DF /* CPDFBackgroundView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFBackgroundView.h; sourceTree = "<group>"; };
-		C986D3FA296288F700EBD4DF /* CPDFBackgroundView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFBackgroundView.m; sourceTree = "<group>"; };
-		C986D3FC2962A70400EBD4DF /* CPDFBackgroundSettingView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFBackgroundSettingView.h; sourceTree = "<group>"; };
-		C986D3FD2962A70400EBD4DF /* CPDFBackgroundSettingView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFBackgroundSettingView.m; sourceTree = "<group>"; };
+		C986D3F32962857900EBD4DF /* CPDFBackgroundSettingViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CPDFBackgroundSettingViewController.h; path = ../CPDFBackgroundSettingViewController.h; sourceTree = "<group>"; };
+		C986D3F42962857900EBD4DF /* CPDFBackgroundSettingViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = CPDFBackgroundSettingViewController.m; path = ../CPDFBackgroundSettingViewController.m; sourceTree = "<group>"; };
+		C986D3F6296288C400EBD4DF /* CPDFBackgroundPreview.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CPDFBackgroundPreview.h; path = ../CPDFBackgroundPreview.h; sourceTree = "<group>"; };
+		C986D3F7296288C400EBD4DF /* CPDFBackgroundPreview.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = CPDFBackgroundPreview.m; path = ../CPDFBackgroundPreview.m; sourceTree = "<group>"; };
+		C986D3F9296288F700EBD4DF /* CPDFBackgroundView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CPDFBackgroundView.h; path = ../CPDFBackgroundView.h; sourceTree = "<group>"; };
+		C986D3FA296288F700EBD4DF /* CPDFBackgroundView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = CPDFBackgroundView.m; path = ../CPDFBackgroundView.m; sourceTree = "<group>"; };
+		C986D3FC2962A70400EBD4DF /* CPDFBackgroundSettingView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CPDFBackgroundSettingView.h; path = ../CPDFBackgroundSettingView.h; sourceTree = "<group>"; };
+		C986D3FD2962A70400EBD4DF /* CPDFBackgroundSettingView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = CPDFBackgroundSettingView.m; path = ../CPDFBackgroundSettingView.m; sourceTree = "<group>"; };
+		C9ECD0E7296BDAD1006C459B /* ComPDFKit.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = ComPDFKit.xcframework; sourceTree = "<group>"; };
+		C9ECD104296CFE45006C459B /* Sample */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Sample; sourceTree = "<group>"; };
 		EC62978929220F8300D339EE /* PDFViewer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PDFViewer.app; sourceTree = BUILT_PRODUCTS_DIR; };
 		EC62978C29220F8300D339EE /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
 		EC62978D29220F8300D339EE /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
@@ -145,14 +149,14 @@
 		EC6297BC292239C200D339EE /* CPDFListController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFListController.m; sourceTree = "<group>"; };
 		ECC8831B2923352B00F6392E /* CPDFViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFViewController.h; sourceTree = "<group>"; };
 		ECC8831C2923352B00F6392E /* CPDFViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFViewController.m; sourceTree = "<group>"; };
-		ECD0ABE52928ED990091B6EB /* CPDFTextPreview.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPDFTextPreview.m; sourceTree = "<group>"; };
-		ECD0ABE82928ED990091B6EB /* CPDFImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPDFImageView.m; sourceTree = "<group>"; };
-		ECD0ABE92928ED990091B6EB /* CPDFTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPDFTextView.h; sourceTree = "<group>"; };
-		ECD0ABEA2928ED990091B6EB /* CPDFTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPDFTextView.m; sourceTree = "<group>"; };
-		ECD0ABEB2928ED9A0091B6EB /* CPDFImagePreview.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPDFImagePreview.h; sourceTree = "<group>"; };
-		ECD0ABEC2928ED9A0091B6EB /* CPDFImagePreview.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPDFImagePreview.m; sourceTree = "<group>"; };
-		ECD0ABED2928ED9A0091B6EB /* CPDFImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPDFImageView.h; sourceTree = "<group>"; };
-		ECD0ABEF2928ED9A0091B6EB /* CPDFTextPreview.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPDFTextPreview.h; sourceTree = "<group>"; };
+		ECD0ABE52928ED990091B6EB /* CPDFTextPreview.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPDFTextPreview.m; path = ../CPDFTextPreview.m; sourceTree = "<group>"; };
+		ECD0ABE82928ED990091B6EB /* CPDFImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPDFImageView.m; path = ../CPDFImageView.m; sourceTree = "<group>"; };
+		ECD0ABE92928ED990091B6EB /* CPDFTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPDFTextView.h; path = ../CPDFTextView.h; sourceTree = "<group>"; };
+		ECD0ABEA2928ED990091B6EB /* CPDFTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPDFTextView.m; path = ../CPDFTextView.m; sourceTree = "<group>"; };
+		ECD0ABEB2928ED9A0091B6EB /* CPDFImagePreview.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPDFImagePreview.h; path = ../CPDFImagePreview.h; sourceTree = "<group>"; };
+		ECD0ABEC2928ED9A0091B6EB /* CPDFImagePreview.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPDFImagePreview.m; path = ../CPDFImagePreview.m; sourceTree = "<group>"; };
+		ECD0ABED2928ED9A0091B6EB /* CPDFImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPDFImageView.h; path = ../CPDFImageView.h; sourceTree = "<group>"; };
+		ECD0ABEF2928ED9A0091B6EB /* CPDFTextPreview.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPDFTextPreview.h; path = ../CPDFTextPreview.h; sourceTree = "<group>"; };
 		ECD0ABF92928EECA0091B6EB /* NSArray+MASAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSArray+MASAdditions.h"; sourceTree = "<group>"; };
 		ECD0ABFA2928EECA0091B6EB /* View+MASAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "View+MASAdditions.h"; sourceTree = "<group>"; };
 		ECD0ABFB2928EECA0091B6EB /* MASConstraintMaker.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MASConstraintMaker.m; sourceTree = "<group>"; };
@@ -179,10 +183,10 @@
 		ECD0AC112928EECB0091B6EB /* MASViewAttribute.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MASViewAttribute.m; sourceTree = "<group>"; };
 		ECD0AC122928EECB0091B6EB /* View+MASShorthandAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "View+MASShorthandAdditions.h"; sourceTree = "<group>"; };
 		ECD0AC1F2928EF260091B6EB /* btn_selected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = btn_selected.png; sourceTree = "<group>"; };
-		ECD0AC212928F2A70091B6EB /* CPDFTextViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFTextViewController.h; sourceTree = "<group>"; };
-		ECD0AC222928F2A70091B6EB /* CPDFTextViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFTextViewController.m; sourceTree = "<group>"; };
-		ECD0AC242928F2E50091B6EB /* CPDFImageViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFImageViewController.h; sourceTree = "<group>"; };
-		ECD0AC252928F2E50091B6EB /* CPDFImageViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFImageViewController.m; sourceTree = "<group>"; };
+		ECD0AC212928F2A70091B6EB /* CPDFTextViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CPDFTextViewController.h; path = ../../CPDFTextViewController.h; sourceTree = "<group>"; };
+		ECD0AC222928F2A70091B6EB /* CPDFTextViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = CPDFTextViewController.m; path = ../../CPDFTextViewController.m; sourceTree = "<group>"; };
+		ECD0AC242928F2E50091B6EB /* CPDFImageViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CPDFImageViewController.h; path = ../../CPDFImageViewController.h; sourceTree = "<group>"; };
+		ECD0AC252928F2E50091B6EB /* CPDFImageViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = CPDFImageViewController.m; path = ../../CPDFImageViewController.m; sourceTree = "<group>"; };
 		ECD0AC30292B56C90091B6EB /* CPDFDataModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFDataModel.h; sourceTree = "<group>"; };
 		ECD0AC31292B56C90091B6EB /* CPDFDataModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFDataModel.m; sourceTree = "<group>"; };
 /* End PBXFileReference section */
@@ -192,7 +196,7 @@
 			isa = PBXFrameworksBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				C96384932949E2020055CCCA /* ComPDFKit.xcframework in Frameworks */,
+				C9ECD0E9296BDAEF006C459B /* ComPDFKit.xcframework in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -224,7 +228,6 @@
 				C95FE76D2966F61A0038BBF3 /* CPDFHeaderFooterTextTableView.m */,
 				C95FE76F2966F6270038BBF3 /* CPDFAddView.h */,
 				C95FE7702966F62E0038BBF3 /* CPDFAddView.m */,
-				C95FE7722966F6350038BBF3 /* CPDFSettingView.h */,
 				C95FE7732966F63C0038BBF3 /* CPDFSettingView.m */,
 			);
 			path = HeaderFooterView;
@@ -233,10 +236,11 @@
 		C95FE7762966F6AF0038BBF3 /* WatermarkView */ = {
 			isa = PBXGroup;
 			children = (
-				ECD0ABED2928ED9A0091B6EB /* CPDFImageView.h */,
 				ECD0ABE82928ED990091B6EB /* CPDFImageView.m */,
+				ECD0ABED2928ED9A0091B6EB /* CPDFImageView.h */,
 				ECD0ABEB2928ED9A0091B6EB /* CPDFImagePreview.h */,
 				ECD0ABEC2928ED9A0091B6EB /* CPDFImagePreview.m */,
+				C95FE7722966F6350038BBF3 /* CPDFSettingView.h */,
 				ECD0ABEF2928ED9A0091B6EB /* CPDFTextPreview.h */,
 				ECD0ABE52928ED990091B6EB /* CPDFTextPreview.m */,
 				ECD0ABE92928ED990091B6EB /* CPDFTextView.h */,
@@ -245,6 +249,8 @@
 				C96150D1295400B00020F445 /* CPDFDrawView.m */,
 				C96150D329554F660020F445 /* CPDFClipView.h */,
 				C96150D429554F660020F445 /* CPDFClipView.m */,
+				C97E91662959B96C007F6943 /* CPDFEditView.h */,
+				C97E91672959B96C007F6943 /* CPDFEditView.m */,
 			);
 			path = WatermarkView;
 			sourceTree = "<group>";
@@ -252,8 +258,6 @@
 		C95FE7772966F70B0038BBF3 /* BackgroundView */ = {
 			isa = PBXGroup;
 			children = (
-				C97E91662959B96C007F6943 /* CPDFEditView.h */,
-				C97E91672959B96C007F6943 /* CPDFEditView.m */,
 				C986D3F6296288C400EBD4DF /* CPDFBackgroundPreview.h */,
 				C986D3F7296288C400EBD4DF /* CPDFBackgroundPreview.m */,
 				C986D3F9296288F700EBD4DF /* CPDFBackgroundView.h */,
@@ -306,8 +310,8 @@
 				ECD0AC222928F2A70091B6EB /* CPDFTextViewController.m */,
 				ECD0AC242928F2E50091B6EB /* CPDFImageViewController.h */,
 				ECD0AC252928F2E50091B6EB /* CPDFImageViewController.m */,
-				C9638495294ACC240055CCCA /* CPDFAddWaterMarkViewController.m */,
 				C9638494294ACC240055CCCA /* CPDFAddWaterMarkViewController.h */,
+				C9638495294ACC240055CCCA /* CPDFAddWaterMarkViewController.m */,
 			);
 			name = Watermark;
 			path = Background/Watermark;
@@ -316,7 +320,7 @@
 		EC62978029220F8300D339EE = {
 			isa = PBXGroup;
 			children = (
-				C96384922949E2020055CCCA /* ComPDFKit.xcframework */,
+				C9ECD0E7296BDAD1006C459B /* ComPDFKit.xcframework */,
 				EC62978B29220F8300D339EE /* PDFViewer */,
 				EC62978A29220F8300D339EE /* Products */,
 			);
@@ -333,6 +337,7 @@
 		EC62978B29220F8300D339EE /* PDFViewer */ = {
 			isa = PBXGroup;
 			children = (
+				C9ECD104296CFE45006C459B /* Sample */,
 				ECD0ABF62928EE9A0091B6EB /* Masonry */,
 				EC6297B52922393F00D339EE /* Controller */,
 				ECD0ABE42928ED5D0091B6EB /* View */,
@@ -357,18 +362,12 @@
 			children = (
 				EC6297B6292239A700D339EE /* CPDFModel.h */,
 				EC6297B7292239A700D339EE /* CPDFModel.m */,
+				C95FE7452966F3700038BBF3 /* CPDFHeaderFooterModel.h */,
+				C95FE7462966F37F0038BBF3 /* CPDFHeaderFooterModel.m */,
 				ECD0AC30292B56C90091B6EB /* CPDFDataModel.h */,
 				ECD0AC31292B56C90091B6EB /* CPDFDataModel.m */,
 				C92BA19829651CA3009954EF /* CPDFBackgroundModel.h */,
 				C92BA19929651CA3009954EF /* CPDFBackgroundModel.m */,
-				C95FE7452966F3700038BBF3 /* CPDFHeaderFooterModel.h */,
-				C95FE7462966F37F0038BBF3 /* CPDFHeaderFooterModel.m */,
-				C993B916292B5BC500D8F474 /* CPDFHeaderFooterModel.h */,
-				C993B917292B5BC500D8F474 /* CPDFHeaderFooterModel.m */,
-                    ECD0AC30292B56C90091B6EB /* CPDFDataModel.h */,
-                ECD0AC31292B56C90091B6EB /* CPDFDataModel.m */,
-                C92BA19829651CA3009954EF /* CPDFBackgroundModel.h */,
-                C92BA19929651CA3009954EF /* CPDFBackgroundModel.m */,
 			);
 			path = Model;
 			sourceTree = "<group>";
@@ -384,21 +383,6 @@
 				C97A78822967AF980012BA91 /* Watermark */,
 				C97A787E2967AEB00012BA91 /* Background */,
 				C97A786F2967AC000012BA91 /* HeaderFooter */,
-				C96D13942924DD7E00CC92C7 /* CPDFHeaderFooterAddController.h */,
-				C96D13952924DD7E00CC92C7 /* CPDFHeaderFooterAddController.m */,
-				C993B90A29271FCA00D8F474 /* CPDFBatesAddViewController.h */,
-				C993B90B29271FCA00D8F474 /* CPDFBatesAddViewController.m */,
-				C9B7639B2940B71600D25041 /* CPDFAddViewController.h */,
-				C9B7639C2940B71600D25041 /* CPDFAddViewController.m */,
-				C9B763A22941808500D25041 /* CPDFAddViewControllerHeader.h */,
-                    ECD0AC212928F2A70091B6EB /* CPDFTextViewController.h */,
-                ECD0AC222928F2A70091B6EB /* CPDFTextViewController.m */,
-                ECD0AC242928F2E50091B6EB /* CPDFImageViewController.h */,
-                ECD0AC252928F2E50091B6EB /* CPDFImageViewController.m */,
-                C9638494294ACC240055CCCA /* CPDFAddViewController.h */,
-                C9638495294ACC240055CCCA /* CPDFAddViewController.m */,
-                C986D3F32962857900EBD4DF /* CPDFBackgroundSettingViewController.h */,
-                C986D3F42962857900EBD4DF /* CPDFBackgroundSettingViewController.m */,
 			);
 			path = Controller;
 			sourceTree = "<group>";
@@ -410,33 +394,6 @@
 				C95FE7772966F70B0038BBF3 /* BackgroundView */,
 				C95FE7762966F6AF0038BBF3 /* WatermarkView */,
 				C95FE7752966F65F0038BBF3 /* HeaderFooterView */,
-				ECD0AC1E2928EF030091B6EB /* sources */,
-				ECD0ABED2928ED9A0091B6EB /* CPDFImageView.h */,
-				ECD0ABE82928ED990091B6EB /* CPDFImageView.m */,
-				ECD0ABEB2928ED9A0091B6EB /* CPDFImagePreview.h */,
-				ECD0ABEC2928ED9A0091B6EB /* CPDFImagePreview.m */,
-				ECD0ABEF2928ED9A0091B6EB /* CPDFTextPreview.h */,
-				ECD0ABE52928ED990091B6EB /* CPDFTextPreview.m */,
-				ECD0ABE92928ED990091B6EB /* CPDFTextView.h */,
-				ECD0ABEA2928ED990091B6EB /* CPDFTextView.m */,
-				C96150D0295400B00020F445 /* CPDFDrawView.h */,
-				C96150D1295400B00020F445 /* CPDFDrawView.m */,
-				C96150D329554F660020F445 /* CPDFClipView.h */,
-				C96150D429554F660020F445 /* CPDFClipView.m */,
-				C97E91662959B96C007F6943 /* CPDFEditView.h */,
-				C97E91672959B96C007F6943 /* CPDFEditView.m */,
-				C986D3F6296288C400EBD4DF /* CPDFBackgroundPreview.h */,
-				C986D3F7296288C400EBD4DF /* CPDFBackgroundPreview.m */,
-				C986D3F9296288F700EBD4DF /* CPDFBackgroundView.h */,
-				C986D3FA296288F700EBD4DF /* CPDFBackgroundView.m */,
-				C986D3FC2962A70400EBD4DF /* CPDFBackgroundSettingView.h */,
-				C986D3FD2962A70400EBD4DF /* CPDFBackgroundSettingView.m */,
-				C92BA1922963F806009954EF /* CPDFDrawBackgroundView.h */,
-				C92BA1932963F806009954EF /* CPDFDrawBackgroundView.m */,
-				C92BA1952963F84B009954EF /* CPDFDrawImageView.h */,
-				C92BA1962963F84B009954EF /* CPDFDrawImageView.m */,
-				C92BA18F2963CAB4009954EF /* UIImage+TintColor.h */,
-				C92BA1902963CAB4009954EF /* UIImage+TintColor.m */,
 			);
 			path = View;
 			sourceTree = "<group>";
@@ -530,6 +487,7 @@
 			isa = PBXResourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
+				C9ECD105296CFE45006C459B /* Sample in Resources */,
 				EC62979C29220F8400D339EE /* LaunchScreen.storyboard in Resources */,
 				C95FE74D2966F3F40038BBF3 /* btn_frontpage.png in Resources */,
 				C96D13932924793800CC92C7 /* btn_more.png in Resources */,
@@ -737,7 +695,7 @@
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CODE_SIGN_STYLE = Automatic;
-				DEVELOPMENT_TEAM = 6288D8MU8G;
+				DEVELOPMENT_TEAM = Q43DRF894U;
 				EXCLUDED_ARCHS = "";
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -749,6 +707,7 @@
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
+				MARKETING_VERSION = 1;
 				PRODUCT_BUNDLE_IDENTIFIER = com.compdfkit.pdfviewer;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				TARGETED_DEVICE_FAMILY = "1,2";
@@ -761,7 +720,7 @@
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CODE_SIGN_STYLE = Automatic;
-				DEVELOPMENT_TEAM = 6288D8MU8G;
+				DEVELOPMENT_TEAM = Q43DRF894U;
 				EXCLUDED_ARCHS = "";
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -773,6 +732,7 @@
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
+				MARKETING_VERSION = 1;
 				PRODUCT_BUNDLE_IDENTIFIER = com.compdfkit.pdfviewer;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				TARGETED_DEVICE_FAMILY = "1,2";

+ 1 - 1
PDFViewer/Controller/CPDFAddWaterMarkViewController.m

@@ -315,7 +315,7 @@
 
 - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
     [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
-    if ([UIDevice currentDevice].orientation == UIDeviceOrientationLandscapeRight) {
+    if ([UIDevice currentDevice].orientation == UIDeviceOrientationLandscapeRight || [UIDevice currentDevice].orientation == UIDeviceOrientationLandscapeLeft) {
         
         [_segmentedControl mas_remakeConstraints:^(MASConstraintMaker *make) {
             make.top.equalTo(self.view.mas_top).offset(43.6);

+ 28 - 1
PDFViewer/Controller/CPDFBackgroundSettingViewController.m

@@ -317,7 +317,7 @@
 
 - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
     [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
-    if ([UIDevice currentDevice].orientation == UIDeviceOrientationLandscapeRight) {
+    if ([UIDevice currentDevice].orientation == UIDeviceOrientationLandscapeRight || [UIDevice currentDevice].orientation == UIDeviceOrientationLandscapeLeft) {
         
         [_backgroundView mas_remakeConstraints:^(MASConstraintMaker *make) {
             make.bottom.equalTo(self.view.mas_bottom).offset(-25);
@@ -414,4 +414,31 @@
     return YES;
 }
 
+- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
+    if (_backgroudSettingView.horizontalField == textField || _backgroudSettingView.verticalField == textField) {
+        return [self validateValue:string];
+    }
+    
+    return YES;
+}
+
+- (BOOL)validateValue:(NSString *)number {
+    BOOL res = YES;
+    NSCharacterSet *numberSet = [NSCharacterSet characterSetWithCharactersInString:@"0123456789"];
+    
+    NSInteger i = 0;
+    while (i < number.length) {
+        NSString *str = [number substringWithRange:NSMakeRange(i, 1)];
+        NSRange range = [str rangeOfCharacterFromSet:numberSet];
+        
+        if (range.length == 0) {
+            res = NO;
+            break;
+        }
+        i++;
+    }
+    
+    return  res;
+}
+
 @end

+ 28 - 1
PDFViewer/Controller/CPDFImageViewController.m

@@ -56,7 +56,7 @@
 - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
     [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
     
-    if ([UIDevice currentDevice].orientation == UIDeviceOrientationLandscapeRight) {
+    if ([UIDevice currentDevice].orientation == UIDeviceOrientationLandscapeRight || [UIDevice currentDevice].orientation == UIDeviceOrientationLandscapeLeft) {
         
         [_imageView mas_remakeConstraints:^(MASConstraintMaker *make) {
             make.right.equalTo(self.view.mas_right).offset(-38);
@@ -434,4 +434,31 @@
     return YES;
 }
 
+- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
+    if (_imageView.horizontalField == textField || _imageView.verticalField == textField) {
+        return [self validateValue:string];
+    }
+    
+    return YES;
+}
+
+- (BOOL)validateValue:(NSString *)number {
+    BOOL res = YES;
+    NSCharacterSet *numberSet = [NSCharacterSet characterSetWithCharactersInString:@"0123456789"];
+    
+    NSInteger i = 0;
+    while (i < number.length) {
+        NSString *str = [number substringWithRange:NSMakeRange(i, 1)];
+        NSRange range = [str rangeOfCharacterFromSet:numberSet];
+        
+        if (range.length == 0) {
+            res = NO;
+            break;
+        }
+        i++;
+    }
+    
+    return  res;
+}
+
 @end

+ 28 - 1
PDFViewer/Controller/CPDFTextViewController.m

@@ -275,7 +275,7 @@
 - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
     [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
     
-    if ([UIDevice currentDevice].orientation == UIDeviceOrientationLandscapeRight) {
+    if ([UIDevice currentDevice].orientation == UIDeviceOrientationLandscapeRight || [UIDevice currentDevice].orientation == UIDeviceOrientationLandscapeLeft) {
         
         [_textView mas_remakeConstraints:^(MASConstraintMaker *make) {
             make.right.equalTo(self.view.mas_right).offset(-38);
@@ -394,4 +394,31 @@
     return YES;
 }
 
+- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
+    if (_textView.horizontalField == textField || _textView.verticalField == textField) {
+        return [self validateValue:string];
+    }
+    
+    return YES;
+}
+
+- (BOOL)validateValue:(NSString *)number {
+    BOOL res = YES;
+    NSCharacterSet *numberSet = [NSCharacterSet characterSetWithCharactersInString:@"0123456789"];
+    
+    NSInteger i = 0;
+    while (i < number.length) {
+        NSString *str = [number substringWithRange:NSMakeRange(i, 1)];
+        NSRange range = [str rangeOfCharacterFromSet:numberSet];
+        
+        if (range.length == 0) {
+            res = NO;
+            break;
+        }
+        i++;
+    }
+    
+    return  res;
+}
+
 @end

+ 10 - 10
PDFViewer/Controller/HeaderFooter/CPDFBatesAddViewController.m

@@ -52,15 +52,15 @@
             make.top.equalTo(self.view.mas_top).offset(15);
             make.left.equalTo(self.view.mas_left).offset(self.view.frame.size.width / 2);
             make.width.mas_equalTo(393);
-            make.height.mas_equalTo(self.view.frame.size.height - 20);
+            make.bottom.equalTo(self.view.mas_bottom).offset(- 34);
         }];
         
     } else {
         [self.batesAddView mas_makeConstraints:^(MASConstraintMaker *make) {
-            make.top.equalTo(self.headView.mas_bottom).offset(60);
+            make.top.equalTo(self.headView.mas_bottom).offset(26);
             make.left.equalTo(self.view.mas_left);
             make.width.mas_equalTo(self.view.frame.size.width);
-            make.height.mas_equalTo(self.view.frame.size.height);
+            make.bottom.equalTo(self.view).offset(-34);
         }];
     }
     
@@ -243,10 +243,10 @@
 
 - (void)viewDown {
     [self.batesAddView mas_remakeConstraints:^(MASConstraintMaker *make) {
-        make.top.equalTo(self.headView.mas_bottom).offset(60);
+        make.top.equalTo(self.headView.mas_bottom).offset(26);
         make.left.equalTo(self.view.mas_left);
         make.width.mas_equalTo(self.view.frame.size.width);
-        make.height.mas_equalTo(self.view.frame.size.height);
+        make.bottom.equalTo(self.view.mas_bottom).offset(-34);
     }];
     
     [UIView animateWithDuration:0.3 delay:0 options:UIViewAnimationOptionCurveEaseIn animations:^ {
@@ -259,7 +259,7 @@
 
 // When orientation
 - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
-    if ([UIDevice currentDevice].orientation == UIDeviceOrientationLandscapeRight) {
+    if ([UIDevice currentDevice].orientation == UIDeviceOrientationLandscapeRight || [UIDevice currentDevice].orientation == UIDeviceOrientationLandscapeLeft) {
         [self.headView mas_remakeConstraints:^(MASConstraintMaker *make) {
             make.top.equalTo(self.view.mas_top).offset((393 / 2) - (self.image.size.height / 18));
             make.left.equalTo(self.view.mas_left).offset((393 / 2) - (self.image.size.width / 18));
@@ -271,7 +271,7 @@
             make.top.equalTo(self.view.mas_top).offset(15);
             make.left.equalTo(self.view.mas_left).offset(self.view.frame.size.width / 2 + 200);
             make.width.mas_equalTo(393);
-            make.height.mas_equalTo(self.view.frame.size.height - 20);
+            make.bottom.equalTo(self.view.mas_bottom).offset(- 34);
         }];
         
     } else if ([UIDevice currentDevice].orientation == UIDeviceOrientationPortrait) {
@@ -283,10 +283,10 @@
         }];
         
         [self.batesAddView mas_remakeConstraints:^(MASConstraintMaker *make) {
-            make.top.equalTo(self.headView.mas_bottom).offset(60);
+            make.top.equalTo(self.headView.mas_bottom).offset(26);
             make.left.equalTo(self.view.mas_left);
-            make.width.mas_equalTo(self.view.frame.size.width);
-            make.height.mas_equalTo(self.view.frame.size.height);
+            make.right.equalTo(self.view.mas_right);
+            make.bottom.equalTo(self.view.mas_bottom).offset(-34);
         }];
     }
 }

+ 10 - 10
PDFViewer/Controller/HeaderFooter/CPDFHeaderFooterAddController.m

@@ -46,14 +46,14 @@
             make.top.equalTo(self.view.mas_top).offset(15);
             make.left.equalTo(self.view.mas_left).offset(self.view.frame.size.width / 2);
             make.width.mas_equalTo(393);
-            make.height.mas_equalTo(self.view.frame.size.height - 20);
+            make.bottom.equalTo(self.view.mas_bottom).offset(- 34);
         }];
     } else {
         [self.headerFooterview mas_makeConstraints:^(MASConstraintMaker *make) {
-            make.top.equalTo(self.headView.mas_bottom).offset(60);
+            make.top.equalTo(self.headView.mas_bottom).offset(26);
             make.left.equalTo(self.view.mas_left);
             make.width.mas_equalTo(self.view.frame.size.width);
-            make.height.mas_equalTo(self.view.frame.size.height);
+            make.bottom.equalTo(self.view).offset(-34);
         }];
     }
     
@@ -226,10 +226,10 @@
         
     } else {
         [self.headerFooterview mas_remakeConstraints:^(MASConstraintMaker *make) {
-            make.top.equalTo(self.headView.mas_bottom).offset(60);
+            make.top.equalTo(self.headView.mas_bottom).offset(26);
             make.left.equalTo(self.view.mas_left);
             make.width.mas_equalTo(self.view.frame.size.width);
-            make.height.mas_equalTo(self.view.frame.size.height);
+            make.bottom.equalTo(self.view.mas_bottom).offset(-34);
         }];
         
         [UIView animateWithDuration:0.3 delay:0 options:UIViewAnimationOptionCurveEaseIn animations:^ {
@@ -242,12 +242,12 @@
 
 // When orientation
 - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
-    if ([UIDevice currentDevice].orientation == UIDeviceOrientationLandscapeRight) {
+    if ([UIDevice currentDevice].orientation == UIDeviceOrientationLandscapeRight || [UIDevice currentDevice].orientation == UIDeviceOrientationLandscapeLeft) {
         [self.headView mas_remakeConstraints:^(MASConstraintMaker *make) {
             make.top.equalTo(self.view.mas_top).offset((393 / 2) - (self.image.size.height / 18));
             make.left.equalTo(self.view.mas_left).offset((393 / 2) - (self.image.size.width / 18));
             make.width.mas_equalTo(self.image.size.width / 9);
-            make.height.mas_equalTo(self.image.size.height / 9);
+            make.bottom.equalTo(self.view.mas_bottom).offset(- 34);
         }];
         
         [self.headerFooterview mas_remakeConstraints:^(MASConstraintMaker *make) {
@@ -265,10 +265,10 @@
         }];
         
         [self.headerFooterview mas_remakeConstraints:^(MASConstraintMaker *make) {
-            make.top.equalTo(self.headView.mas_bottom).offset(60);
+            make.top.equalTo(self.headView.mas_bottom).offset(26);
             make.left.equalTo(self.view.mas_left);
-            make.width.mas_equalTo(self.view.frame.size.width);
-            make.height.mas_equalTo(self.view.frame.size.height);
+            make.right.equalTo(self.view.mas_right);
+            make.bottom.equalTo(self.view.mas_bottom).offset(-34);
         }];
     }
 }

BIN
PDFViewer/Sample/3.pdf


+ 20 - 3
PDFViewer/SceneDelegate.m

@@ -26,10 +26,27 @@
     [self.window setBackgroundColor:[UIColor whiteColor]];
     [self.window makeKeyAndVisible];
     
-    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
-    [paths objectAtIndex:0];
+    NSFileManager *fileManager = [NSFileManager defaultManager];
+    
+    NSURL *sampleURL = [NSBundle.mainBundle.resourceURL URLByAppendingPathComponent:@"Sample"];
+    
+    NSString *docsFolder = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES).firstObject;
+    
+    NSArray *fileNames = [NSArray arrayWithObjects:@"3.pdf", nil];
+
+    for (int i = 0; i < fileNames.count; i++) {
+        NSURL *tBFilePath = [sampleURL URLByAppendingPathComponent:[fileNames objectAtIndex:i]];
+        NSURL *tDFilePath = [NSURL fileURLWithPath:[docsFolder stringByAppendingPathComponent:[fileNames objectAtIndex:i]]];
+        
+        if (![fileManager fileExistsAtPath:tDFilePath.path]) {
+            if ([fileManager fileExistsAtPath:tBFilePath.path]) {
+                [fileManager copyItemAtURL:tBFilePath toURL:tDFilePath error:nil];
+            }
+        }
+    }
+    
      CPDFModel *model = [[CPDFModel alloc] init];
-    model.filePath = [paths objectAtIndex:0];
+    model.filePath = docsFolder;
     NSLog(@"%@",model.filePath);
     
     CPDFListController *pdfController = [[CPDFListController alloc] initWithModel:model];

+ 1 - 1
PDFViewer/View/CPDFDrawView.m

@@ -68,7 +68,7 @@
     for (NSInteger i = 0; i < x; i++) {
         for (NSInteger j = 0; j < y; j++) {
             
-            [self.dataModel.text drawInRect:CGRectMake((a + i * width) - self.center.x, b + j * height - self.center.y, width - _horizontal / 2.5, height - _vertical / 2.5) withAttributes:dic];
+            [self.dataModel.text drawInRect:CGRectMake((a + i * width) - self.center.x, b + j * height - self.center.y, width - _horizontal / 2.6, height - _vertical / 2.5) withAttributes:dic];
         }
     }
     

+ 4 - 4
PDFViewer/View/CPDFTextPreview.m

@@ -56,10 +56,10 @@ BOOL gTextPreviewIsFirstLayout = YES;
     [_rotationBtn setBackgroundImage:[UIImage imageNamed:@"btn_selected"] forState:UIControlStateNormal];
     
     [_rotationBtn mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.top.equalTo(_watermarkLabel.mas_bottom).offset(-10);
-        make.width.equalTo(@20);
-        make.height.equalTo(@20);
-        make.left.equalTo(_watermarkLabel.mas_right).offset(-10);
+        make.top.equalTo(_watermarkLabel.mas_bottom).offset(-15);
+        make.width.equalTo(@30);
+        make.height.equalTo(@30);
+        make.left.equalTo(_watermarkLabel.mas_right).offset(-15);
     }];
 }
 

+ 6 - 6
PDFViewer/View/HeaderFooterView/CPDFAddView.m

@@ -50,14 +50,14 @@
     [_localLabel mas_makeConstraints:^(MASConstraintMaker *make) {
         make.top.equalTo(self.mas_top).offset(offsetx);
         make.left.equalTo(self.mas_left).offset(offsetx);
-        make.width.mas_equalTo(130);
+        make.width.mas_equalTo(150);
         make.height.mas_equalTo(22);
     }];
     
     [_localSegment mas_makeConstraints:^(MASConstraintMaker *make) {
         make.top.equalTo(_localLabel.mas_bottom).offset(offsetx);
         make.left.equalTo(self.mas_left).offset(4 * offsetx);
-        make.width.mas_equalTo(364);
+        make.right.equalTo(self.mas_right).offset(-4 *offsetx);
         make.height.mas_equalTo(44);
     }];
     
@@ -72,7 +72,7 @@
     [_aligbmentSegment mas_makeConstraints:^(MASConstraintMaker *make) {
         make.top.equalTo(_alignmentLabel.mas_bottom).offset(offsetx);
         make.left.equalTo(self.mas_left).offset(4 * offsetx);
-        make.width.mas_equalTo(364);
+        make.right.equalTo(self.mas_right).offset(-4 *offsetx);
         make.height.mas_equalTo(44);
     }];
     
@@ -87,15 +87,15 @@
     [_colerImage mas_makeConstraints:^(MASConstraintMaker *make) {
         make.top.equalTo(_colorLabel.mas_bottom).offset(offsetx);
         make.left.equalTo(self.mas_left).offset(4 * offsetx);
-        make.width.mas_equalTo(364);
+        make.right.equalTo(self.mas_right).offset(-4 *offsetx);
         make.height.mas_equalTo(44);
     }];
     
     [_colorSlider mas_makeConstraints:^(MASConstraintMaker *make) {
         make.top.equalTo(_colerImage.mas_bottom).offset(offsetx);
         make.left.equalTo(self.mas_left).offset(4 * offsetx);
-        make.width.mas_equalTo(364);
-        make.height.mas_equalTo(44);
+        make.right.equalTo(self.mas_right).offset(-4 *offsetx);
+        make.height.mas_equalTo(34);
     }];
 }
 

+ 9 - 7
PDFViewer/View/HeaderFooterView/CPDFBatesAddView.m

@@ -49,13 +49,13 @@
     [_pageIndexLabel mas_makeConstraints:^(MASConstraintMaker *make) {
         make.top.equalTo(self.colorSlider.mas_bottom).offset(offsetx);
         make.left.equalTo(self.mas_left).offset(offsetx);
-        make.height.mas_equalTo(44);
+        make.height.mas_equalTo(34);
         make.width.mas_equalTo(73);
     }];
     [_pageIndexNumberText mas_makeConstraints:^(MASConstraintMaker *make) {
         make.top.equalTo(self.colorSlider.mas_bottom).offset(offsetx);
         make.left.equalTo(_pageIndexLabel.mas_right).offset(offsetx);
-        make.height.mas_equalTo(44);
+        make.height.mas_equalTo(34);
         make.width.mas_equalTo(93);
     }];
     
@@ -63,13 +63,13 @@
     [_fontNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
         make.top.equalTo(self.colorSlider.mas_bottom).offset(offsetx);
         make.left.equalTo(_pageIndexNumberText.mas_right).offset(offsetx + 20);
-        make.height.mas_equalTo(44);
+        make.height.mas_equalTo(34);
         make.width.mas_equalTo(73);
     }];
     [_fontNameText mas_makeConstraints:^(MASConstraintMaker *make) {
         make.top.equalTo(self.colorSlider.mas_bottom).offset(offsetx);
         make.left.equalTo(_fontNameLabel.mas_right).offset(offsetx);
-        make.height.mas_equalTo(44);
+        make.height.mas_equalTo(34);
         make.width.mas_equalTo(93);
     }];
     
@@ -77,7 +77,7 @@
     [_pageNumberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
         make.top.equalTo(_pageIndexLabel.mas_bottom).offset(offsetx);
         make.left.equalTo(self.mas_left).offset(offsetx);
-        make.height.mas_equalTo(44);
+        make.height.mas_equalTo(34);
         make.width.mas_equalTo(73);
     }];
     [_pageNumberText mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -114,7 +114,7 @@
     
     // Font index
     [_pageIndexLabel setText:@"Start Page"];
-    _pageIndexLabel.font = [UIFont boldSystemFontOfSize:14];
+    _pageIndexLabel.font = [UIFont boldSystemFontOfSize:12];
     
     _pageIndexNumberText.delegate = self;
     _pageIndexNumberText.borderStyle = UITextBorderStyleRoundedRect;
@@ -122,10 +122,12 @@
     
     // Font Name
     [_fontNameLabel setText:@"Font Name"];
-    _fontNameLabel.font = [UIFont boldSystemFontOfSize:14];
+    _fontNameLabel.font = [UIFont boldSystemFontOfSize:12];
     
     _fontNameText.inputView = [[UIView alloc] initWithFrame:CGRectZero];
     _fontNameText.inputAccessoryView = [[UIView alloc] initWithFrame:CGRectZero];
+    _fontNameText.adjustsFontSizeToFitWidth = YES;
+    _fontNameText.minimumFontSize = 6;
     _fontNameText.borderStyle = UITextBorderStyleRoundedRect;
     _fontNameText.tintColor = [UIColor clearColor];
     _fontNameText.placeholder = @"Helvetica";

+ 7 - 6
PDFViewer/View/HeaderFooterView/CPDFHeaderFooterAddView.m

@@ -49,14 +49,14 @@
     [_pageNumberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
         make.top.equalTo(self.colorSlider.mas_bottom).offset(offsetx);
         make.left.equalTo(self.mas_left).offset(offsetx);
-        make.height.mas_equalTo(44);
+        make.height.mas_equalTo(34);
         make.width.mas_equalTo(73);
     }];
     
     [_pageNumberText mas_makeConstraints:^(MASConstraintMaker *make) {
         make.top.equalTo(self.colorSlider.mas_bottom).offset(offsetx);
         make.left.equalTo(_pageNumberLabel.mas_right).offset(offsetx);
-        make.height.mas_equalTo(44);
+        make.height.mas_equalTo(34);
         make.width.mas_equalTo(93);
     }];
     
@@ -64,14 +64,14 @@
     [_fontSizeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
         make.top.equalTo(self.colorSlider.mas_bottom).offset(offsetx);
         make.left.equalTo(_pageNumberText.mas_right).offset(offsetx + 20);
-        make.height.mas_equalTo(44);
+        make.height.mas_equalTo(34);
         make.width.mas_equalTo(73);
     }];
     
     [_fontSizeText mas_makeConstraints:^(MASConstraintMaker *make) {
         make.top.equalTo(self.colorSlider.mas_bottom).offset(offsetx);
         make.left.equalTo(_fontSizeLabel.mas_right).offset(offsetx);
-        make.height.mas_equalTo(44);
+        make.height.mas_equalTo(34);
         make.width.mas_equalTo(93);
     }];
     
@@ -79,7 +79,7 @@
     [_pageIndexLabel mas_makeConstraints:^(MASConstraintMaker *make) {
         make.top.equalTo(_pageNumberLabel.mas_bottom).offset(offsetx);
         make.left.equalTo(self.mas_left).offset(offsetx);
-        make.height.mas_equalTo(44);
+        make.height.mas_equalTo(34);
         make.width.mas_equalTo(73);
     }];
     
@@ -122,6 +122,7 @@
     _pageNumberText.inputView = [[UIView alloc] initWithFrame:CGRectZero];
     _pageNumberText.inputAccessoryView = [[UIView alloc] initWithFrame:CGRectZero];
     _pageNumberText.delegate = self;
+    _pageNumberText.adjustsFontSizeToFitWidth = YES;
     _pageNumberText.tintColor = [UIColor clearColor];
     _pageNumberText.borderStyle = UITextBorderStyleRoundedRect;
     _pageNumberText.placeholder = @"text";
@@ -139,7 +140,7 @@
     
     // Page index
     [_pageIndexLabel setText:@"Page Start"];
-    _pageIndexLabel.font = [UIFont boldSystemFontOfSize:14];
+    _pageIndexLabel.font = [UIFont boldSystemFontOfSize:12];
     
     _pageIndexNumberText.keyboardType = UIKeyboardTypeNumbersAndPunctuation;
     _pageIndexNumberText.clearsOnBeginEditing = YES;