Browse Source

PDFView(ios) - sdk演示demo前一版

yangliuhua 2 years ago
parent
commit
383fd7dee0
73 changed files with 360 additions and 408 deletions
  1. 103 143
      PDFViewer.xcodeproj/project.pbxproj
  2. 1 1
      PDFViewer/View/PDFClipView.h
  3. 2 2
      PDFViewer/View/PDFClipView.m
  4. 1 1
      PDFViewer/View/PDFDrawView.h
  5. 2 2
      PDFViewer/View/PDFDrawView.m
  6. 1 1
      PDFViewer/View/WatermarkView/PDFEditView.h
  7. 2 2
      PDFViewer/View/WatermarkView/PDFEditView.m
  8. 1 1
      PDFViewer/View/PDFImagePreview.h
  9. 4 4
      PDFViewer/View/PDFImagePreview.m
  10. 1 1
      PDFViewer/View/PDFImageView.h
  11. 2 2
      PDFViewer/View/PDFImageView.m
  12. 1 1
      PDFViewer/View/PDFTextPreview.h
  13. 4 4
      PDFViewer/View/PDFTextPreview.m
  14. 1 1
      PDFViewer/View/PDFTextView.h
  15. 2 2
      PDFViewer/View/PDFTextView.m
  16. 0 0
      PDFViewer/Controller/Background/PDFWatermark/PDFWatermarkViewController.m
  17. 0 0
      PDFViewer/Controller/Images/add_newpage01.png
  18. 0 0
      PDFViewer/Controller/Images/btn_frontpage.png
  19. 0 0
      PDFViewer/Controller/Images/btn_selected.png
  20. 0 0
      PDFViewer/Controller/Images/pageedit_delete.png
  21. 0 0
      PDFViewer/Controller/Images/text_color_bar.png
  22. 4 4
      PDFViewer/Controller/PDFAddWaterMarkViewController.h
  23. 15 15
      PDFViewer/Controller/PDFAddWaterMarkViewController.m
  24. 0 0
      PDFViewer/Controller/PDFBackground/CPDFBackgroundSettingViewController.h
  25. 0 0
      PDFViewer/Controller/PDFBackground/CPDFBackgroundSettingViewController.m
  26. 0 0
      PDFViewer/Controller/PDFBackground/PDFBackgroundModel.h
  27. 0 0
      PDFViewer/Controller/PDFBackground/PDFBackgroundModel.m
  28. 0 0
      PDFViewer/Controller/PDFBackground/PDFBackgroundPreview.h
  29. 1 1
      PDFViewer/View/PDFBackgroundPreview.m
  30. 0 0
      PDFViewer/Controller/PDFBackground/PDFBackgroundSettingView.h
  31. 0 0
      PDFViewer/Controller/PDFBackground/PDFBackgroundSettingView.m
  32. 0 0
      PDFViewer/Controller/PDFBackground/PDFBackgroundView.h
  33. 0 0
      PDFViewer/Controller/PDFBackground/PDFBackgroundView.m
  34. 0 0
      PDFViewer/Controller/PDFBackground/PDFDrawBackgroundView.h
  35. 0 0
      PDFViewer/Controller/PDFBackground/PDFDrawBackgroundView.m
  36. 0 0
      PDFViewer/Controller/PDFBackground/PDFDrawImageView.h
  37. 0 0
      PDFViewer/Controller/PDFBackground/PDFDrawImageView.m
  38. 0 0
      PDFViewer/Controller/PDFBackground/PDFWatermark/CPDFAddWaterMarkViewController.h
  39. 0 0
      PDFViewer/Controller/PDFBackground/PDFWatermark/CPDFAddWaterMarkViewController.m
  40. 0 0
      PDFViewer/Controller/PDFBackground/PDFWatermark/CPDFImageViewController.h
  41. 0 0
      PDFViewer/Controller/PDFBackground/PDFWatermark/CPDFImageViewController.m
  42. 0 0
      PDFViewer/Controller/PDFBackground/PDFWatermark/CPDFTextViewController.h
  43. 0 0
      PDFViewer/Controller/PDFBackground/PDFWatermark/CPDFTextViewController.m
  44. 0 0
      PDFViewer/Controller/PDFBackground/PDFWatermark/PDFWatermarkControllerHeader.h
  45. 0 0
      PDFViewer/Controller/PDFBackground/PDFWatermark/PDFWatermarkViewController.h
  46. 21 21
      PDFViewer/Controller/PDFBackgroundSettingViewController.m
  47. 0 0
      PDFViewer/Controller/PDFHeaderFooter/PDFAddView.h
  48. 0 0
      PDFViewer/Controller/PDFHeaderFooter/PDFAddView.m
  49. 4 4
      PDFViewer/Controller/HeaderFooter/PDFAddViewController.h
  50. 22 22
      PDFViewer/Controller/HeaderFooter/PDFAddViewController.m
  51. 0 0
      PDFViewer/Controller/PDFHeaderFooter/PDFAddViewControllerHeader.h
  52. 0 0
      PDFViewer/Controller/PDFHeaderFooter/PDFBatesAddView.h
  53. 0 0
      PDFViewer/Controller/PDFHeaderFooter/PDFBatesAddView.m
  54. 0 1
      PDFViewer/Controller/HeaderFooter/PDFBatesAddViewController.h
  55. 0 0
      PDFViewer/Controller/PDFHeaderFooter/PDFBatesAddViewController.m
  56. 0 0
      PDFViewer/Controller/PDFHeaderFooter/PDFHeadView.h
  57. 4 4
      PDFViewer/View/HeaderFooterView/PDFHeadView.m
  58. 0 0
      PDFViewer/Controller/PDFHeaderFooter/PDFHeaderFooterAddController.h
  59. 0 0
      PDFViewer/Controller/PDFHeaderFooter/PDFHeaderFooterAddController.m
  60. 0 0
      PDFViewer/Controller/PDFHeaderFooter/PDFHeaderFooterAddView.h
  61. 0 0
      PDFViewer/Controller/PDFHeaderFooter/PDFHeaderFooterAddView.m
  62. 1 1
      PDFViewer/View/HeaderFooterView/PDFSettingView.h
  63. 2 2
      PDFViewer/View/HeaderFooterView/PDFSettingView.m
  64. 0 0
      PDFViewer/Controller/PDFHeaderFooter/PDFHeaderFooterTextTableView.h
  65. 0 0
      PDFViewer/Controller/PDFHeaderFooter/PDFHeaderFooterTextTableView.m
  66. 5 5
      PDFViewer/Controller/PDFImageViewController.h
  67. 23 23
      PDFViewer/Controller/PDFImageViewController.m
  68. 1 1
      PDFViewer/View/PDFPreView.h
  69. 3 3
      PDFViewer/View/PDFPreView.m
  70. 0 22
      PDFViewer/Controller/PDFTextViewController.h
  71. 22 0
      PDFViewer/Controller/PDFTextWatermarkController.h
  72. 24 24
      PDFViewer/Controller/PDFTextViewController.m
  73. 80 87
      PDFViewer/Controller/PDFViewController.m

+ 103 - 143
PDFViewer.xcodeproj/project.pbxproj

@@ -20,24 +20,24 @@
 		C95FE76B2966F60D0038BBF3 /* PDFBatesAddView.m in Sources */ = {isa = PBXBuildFile; fileRef = C95FE76A2966F60D0038BBF3 /* PDFBatesAddView.m */; };
 		C95FE76E2966F61A0038BBF3 /* PDFHeaderFooterTextTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = C95FE76D2966F61A0038BBF3 /* PDFHeaderFooterTextTableView.m */; };
 		C95FE7712966F62E0038BBF3 /* PDFAddView.m in Sources */ = {isa = PBXBuildFile; fileRef = C95FE7702966F62E0038BBF3 /* PDFAddView.m */; };
-		C95FE7742966F63C0038BBF3 /* PDFSettingView.m in Sources */ = {isa = PBXBuildFile; fileRef = C95FE7732966F63C0038BBF3 /* PDFSettingView.m */; };
+		C95FE7742966F63C0038BBF3 /* PDFHeaderFooterSettingView.m in Sources */ = {isa = PBXBuildFile; fileRef = C95FE7732966F63C0038BBF3 /* PDFHeaderFooterSettingView.m */; };
 		C95FE77A2966F7870038BBF3 /* PDFHeaderFooterAddController.m in Sources */ = {isa = PBXBuildFile; fileRef = C95FE7792966F7870038BBF3 /* PDFHeaderFooterAddController.m */; };
 		C95FE77D2966F7970038BBF3 /* PDFBatesAddViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C95FE77C2966F7970038BBF3 /* PDFBatesAddViewController.m */; };
-		C96150D2295400B00020F445 /* PDFDrawView.m in Sources */ = {isa = PBXBuildFile; fileRef = C96150D1295400B00020F445 /* PDFDrawView.m */; };
-		C96150D529554F660020F445 /* PDFClipView.m in Sources */ = {isa = PBXBuildFile; fileRef = C96150D429554F660020F445 /* PDFClipView.m */; };
+		C96150D2295400B00020F445 /* PDFWatermarkDrawView.m in Sources */ = {isa = PBXBuildFile; fileRef = C96150D1295400B00020F445 /* PDFWatermarkDrawView.m */; };
+		C96150D529554F660020F445 /* PDFWatermarkClipView.m in Sources */ = {isa = PBXBuildFile; fileRef = C96150D429554F660020F445 /* PDFWatermarkClipView.m */; };
 		C9638496294ACC240055CCCA /* PDFAddWaterMarkViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C9638495294ACC240055CCCA /* PDFAddWaterMarkViewController.m */; };
 		C96D13932924793800CC92C7 /* btn_more.png in Resources */ = {isa = PBXBuildFile; fileRef = C96D13922924793800CC92C7 /* btn_more.png */; };
 		C97A78732967AC3D0012BA91 /* PDFAddViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C97A78722967AC3D0012BA91 /* PDFAddViewController.m */; };
-		C97E91682959B96C007F6943 /* PDFEditView.m in Sources */ = {isa = PBXBuildFile; fileRef = C97E91672959B96C007F6943 /* PDFEditView.m */; };
+		C97E91682959B96C007F6943 /* PDFWatermarkEditView.m in Sources */ = {isa = PBXBuildFile; fileRef = C97E91672959B96C007F6943 /* PDFWatermarkEditView.m */; };
 		C986D3F52962857900EBD4DF /* PDFBackgroundSettingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C986D3F42962857900EBD4DF /* PDFBackgroundSettingViewController.m */; };
 		C986D3F8296288C400EBD4DF /* PDFBackgroundPreview.m in Sources */ = {isa = PBXBuildFile; fileRef = C986D3F7296288C400EBD4DF /* PDFBackgroundPreview.m */; };
 		C986D3FB296288F700EBD4DF /* PDFBackgroundView.m in Sources */ = {isa = PBXBuildFile; fileRef = C986D3FA296288F700EBD4DF /* PDFBackgroundView.m */; };
 		C986D3FE2962A70400EBD4DF /* PDFBackgroundSettingView.m in Sources */ = {isa = PBXBuildFile; fileRef = C986D3FD2962A70400EBD4DF /* PDFBackgroundSettingView.m */; };
+		C9B62CB82976A3F700DE39A9 /* PDFWatermarkViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C9B62CB72976A3F700DE39A9 /* PDFWatermarkViewController.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 */; };
 		C9ECD1C1296FDB77006C459B /* PDFPreView.m in Sources */ = {isa = PBXBuildFile; fileRef = C9ECD1C0296FDB77006C459B /* PDFPreView.m */; };
-		C9ECD1C42970023B006C459B /* PDFWatermarkViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C9ECD1C32970023B006C459B /* PDFWatermarkViewController.m */; };
 		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 */; };
@@ -48,10 +48,10 @@
 		EC6297B8292239A700D339EE /* PDFModel.m in Sources */ = {isa = PBXBuildFile; fileRef = EC6297B7292239A700D339EE /* PDFModel.m */; };
 		EC6297BD292239C200D339EE /* PDFListController.m in Sources */ = {isa = PBXBuildFile; fileRef = EC6297BC292239C200D339EE /* PDFListController.m */; };
 		ECC8831D2923352B00F6392E /* PDFViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = ECC8831C2923352B00F6392E /* PDFViewController.m */; };
-		ECD0ABF02928ED9A0091B6EB /* PDFTextPreview.m in Sources */ = {isa = PBXBuildFile; fileRef = ECD0ABE52928ED990091B6EB /* PDFTextPreview.m */; };
-		ECD0ABF32928ED9A0091B6EB /* PDFImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = ECD0ABE82928ED990091B6EB /* PDFImageView.m */; };
-		ECD0ABF42928ED9A0091B6EB /* PDFTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = ECD0ABEA2928ED990091B6EB /* PDFTextView.m */; };
-		ECD0ABF52928ED9A0091B6EB /* PDFImagePreview.m in Sources */ = {isa = PBXBuildFile; fileRef = ECD0ABEC2928ED9A0091B6EB /* PDFImagePreview.m */; };
+		ECD0ABF02928ED9A0091B6EB /* PDFWatermarkTextPreview.m in Sources */ = {isa = PBXBuildFile; fileRef = ECD0ABE52928ED990091B6EB /* PDFWatermarkTextPreview.m */; };
+		ECD0ABF32928ED9A0091B6EB /* PDFWatermarkImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = ECD0ABE82928ED990091B6EB /* PDFWatermarkImageView.m */; };
+		ECD0ABF42928ED9A0091B6EB /* PDFWatermarkTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = ECD0ABEA2928ED990091B6EB /* PDFWatermarkTextView.m */; };
+		ECD0ABF52928ED9A0091B6EB /* PDFWatermarkImagePreview.m in Sources */ = {isa = PBXBuildFile; fileRef = ECD0ABEC2928ED9A0091B6EB /* PDFWatermarkImagePreview.m */; };
 		ECD0AC132928EECB0091B6EB /* MASConstraintMaker.m in Sources */ = {isa = PBXBuildFile; fileRef = ECD0ABFB2928EECA0091B6EB /* MASConstraintMaker.m */; };
 		ECD0AC142928EECB0091B6EB /* NSLayoutConstraint+MASDebugAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = ECD0ABFE2928EECA0091B6EB /* NSLayoutConstraint+MASDebugAdditions.m */; };
 		ECD0AC152928EECB0091B6EB /* MASLayoutConstraint.m in Sources */ = {isa = PBXBuildFile; fileRef = ECD0ABFF2928EECA0091B6EB /* MASLayoutConstraint.m */; };
@@ -63,8 +63,8 @@
 		ECD0AC1C2928EECB0091B6EB /* View+MASAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = ECD0AC0D2928EECA0091B6EB /* View+MASAdditions.m */; };
 		ECD0AC1D2928EECB0091B6EB /* MASViewAttribute.m in Sources */ = {isa = PBXBuildFile; fileRef = ECD0AC112928EECB0091B6EB /* MASViewAttribute.m */; };
 		ECD0AC202928EF260091B6EB /* btn_selected.png in Resources */ = {isa = PBXBuildFile; fileRef = ECD0AC1F2928EF260091B6EB /* btn_selected.png */; };
-		ECD0AC232928F2A70091B6EB /* PDFTextViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = ECD0AC222928F2A70091B6EB /* PDFTextViewController.m */; };
-		ECD0AC262928F2E50091B6EB /* PDFImageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = ECD0AC252928F2E50091B6EB /* PDFImageViewController.m */; };
+		ECD0AC232928F2A70091B6EB /* PDFTextWatermarkController.m in Sources */ = {isa = PBXBuildFile; fileRef = ECD0AC222928F2A70091B6EB /* PDFTextWatermarkController.m */; };
+		ECD0AC262928F2E50091B6EB /* PDFImageWatermarkController.m in Sources */ = {isa = PBXBuildFile; fileRef = ECD0AC252928F2E50091B6EB /* PDFImageWatermarkController.m */; };
 		ECD0AC32292B56C90091B6EB /* PDFDataModel.m in Sources */ = {isa = PBXBuildFile; fileRef = ECD0AC31292B56C90091B6EB /* PDFDataModel.m */; };
 /* End PBXBuildFile section */
 
@@ -83,12 +83,14 @@
 /* End PBXCopyFilesBuildPhase section */
 
 /* Begin PBXFileReference section */
-		C92BA1922963F806009954EF /* PDFDrawBackgroundView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PDFDrawBackgroundView.h; path = ../PDFDrawBackgroundView.h; sourceTree = "<group>"; };
-		C92BA1932963F806009954EF /* PDFDrawBackgroundView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = PDFDrawBackgroundView.m; path = ../PDFDrawBackgroundView.m; sourceTree = "<group>"; };
-		C92BA1952963F84B009954EF /* PDFDrawImageView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PDFDrawImageView.h; path = ../PDFDrawImageView.h; sourceTree = "<group>"; };
-		C92BA1962963F84B009954EF /* PDFDrawImageView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = PDFDrawImageView.m; path = ../PDFDrawImageView.m; sourceTree = "<group>"; };
+		C92BA1922963F806009954EF /* PDFDrawBackgroundView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PDFDrawBackgroundView.h; sourceTree = "<group>"; };
+		C92BA1932963F806009954EF /* PDFDrawBackgroundView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PDFDrawBackgroundView.m; sourceTree = "<group>"; };
+		C92BA1952963F84B009954EF /* PDFDrawImageView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PDFDrawImageView.h; sourceTree = "<group>"; };
+		C92BA1962963F84B009954EF /* PDFDrawImageView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PDFDrawImageView.m; sourceTree = "<group>"; };
 		C92BA19829651CA3009954EF /* PDFBackgroundModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PDFBackgroundModel.h; sourceTree = "<group>"; };
 		C92BA19929651CA3009954EF /* PDFBackgroundModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PDFBackgroundModel.m; sourceTree = "<group>"; };
+		C92E895C2975452E00CB43C1 /* PDFWatermarkViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PDFWatermarkViewController.h; path = PDFViewer/Controller/PDFBackground/PDFWatermark/PDFWatermarkViewController.h; sourceTree = SOURCE_ROOT; };
+		C92E895D2975454600CB43C1 /* PDFWatermarkControllerHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PDFWatermarkControllerHeader.h; path = PDFViewer/Controller/PDFBackground/PDFWatermark/PDFWatermarkControllerHeader.h; sourceTree = SOURCE_ROOT; };
 		C95FE7452966F3700038BBF3 /* PDFHeaderFooterModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PDFHeaderFooterModel.h; sourceTree = "<group>"; };
 		C95FE7462966F37F0038BBF3 /* PDFHeaderFooterModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PDFHeaderFooterModel.m; sourceTree = "<group>"; };
 		C95FE7492966F3F40038BBF3 /* btn_frontpage.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = btn_frontpage.png; sourceTree = "<group>"; };
@@ -105,39 +107,37 @@
 		C95FE76D2966F61A0038BBF3 /* PDFHeaderFooterTextTableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PDFHeaderFooterTextTableView.m; sourceTree = "<group>"; };
 		C95FE76F2966F6270038BBF3 /* PDFAddView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PDFAddView.h; sourceTree = "<group>"; };
 		C95FE7702966F62E0038BBF3 /* PDFAddView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PDFAddView.m; sourceTree = "<group>"; };
-		C95FE7722966F6350038BBF3 /* PDFSettingView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PDFSettingView.h; sourceTree = "<group>"; };
-		C95FE7732966F63C0038BBF3 /* PDFSettingView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PDFSettingView.m; sourceTree = "<group>"; };
+		C95FE7722966F6350038BBF3 /* PDFHeaderFooterSettingView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PDFHeaderFooterSettingView.h; sourceTree = "<group>"; };
+		C95FE7732966F63C0038BBF3 /* PDFHeaderFooterSettingView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PDFHeaderFooterSettingView.m; sourceTree = "<group>"; };
 		C95FE7782966F7810038BBF3 /* PDFHeaderFooterAddController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PDFHeaderFooterAddController.h; sourceTree = "<group>"; };
 		C95FE7792966F7870038BBF3 /* PDFHeaderFooterAddController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PDFHeaderFooterAddController.m; sourceTree = "<group>"; };
 		C95FE77B2966F78E0038BBF3 /* PDFBatesAddViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PDFBatesAddViewController.h; sourceTree = "<group>"; };
 		C95FE77C2966F7970038BBF3 /* PDFBatesAddViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PDFBatesAddViewController.m; sourceTree = "<group>"; };
 		C95FE7812966F7AF0038BBF3 /* PDFAddViewControllerHeader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PDFAddViewControllerHeader.h; sourceTree = "<group>"; };
-		C96150D0295400B00020F445 /* PDFDrawView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PDFDrawView.h; path = ../PDFDrawView.h; sourceTree = "<group>"; };
-		C96150D1295400B00020F445 /* PDFDrawView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = PDFDrawView.m; path = ../PDFDrawView.m; sourceTree = "<group>"; };
-		C96150D329554F660020F445 /* PDFClipView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PDFClipView.h; path = ../PDFClipView.h; sourceTree = "<group>"; };
-		C96150D429554F660020F445 /* PDFClipView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = PDFClipView.m; path = ../PDFClipView.m; sourceTree = "<group>"; };
+		C96150D0295400B00020F445 /* PDFWatermarkDrawView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PDFWatermarkDrawView.h; sourceTree = "<group>"; };
+		C96150D1295400B00020F445 /* PDFWatermarkDrawView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PDFWatermarkDrawView.m; sourceTree = "<group>"; };
+		C96150D329554F660020F445 /* PDFWatermarkClipView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PDFWatermarkClipView.h; sourceTree = "<group>"; };
+		C96150D429554F660020F445 /* PDFWatermarkClipView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PDFWatermarkClipView.m; sourceTree = "<group>"; };
 		C9638494294ACC240055CCCA /* PDFAddWaterMarkViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PDFAddWaterMarkViewController.h; path = ../../PDFAddWaterMarkViewController.h; sourceTree = "<group>"; };
 		C9638495294ACC240055CCCA /* PDFAddWaterMarkViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = PDFAddWaterMarkViewController.m; path = ../../PDFAddWaterMarkViewController.m; sourceTree = "<group>"; };
 		C96D13922924793800CC92C7 /* btn_more.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = btn_more.png; sourceTree = "<group>"; };
 		C97A78702967AC210012BA91 /* PDFAddViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PDFAddViewController.h; sourceTree = "<group>"; };
 		C97A78722967AC3D0012BA91 /* PDFAddViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PDFAddViewController.m; sourceTree = "<group>"; };
-		C97E91662959B96C007F6943 /* PDFEditView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PDFEditView.h; sourceTree = "<group>"; };
-		C97E91672959B96C007F6943 /* PDFEditView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PDFEditView.m; sourceTree = "<group>"; };
+		C97E91662959B96C007F6943 /* PDFWatermarkEditView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PDFWatermarkEditView.h; sourceTree = "<group>"; };
+		C97E91672959B96C007F6943 /* PDFWatermarkEditView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PDFWatermarkEditView.m; sourceTree = "<group>"; };
 		C986D3F32962857900EBD4DF /* PDFBackgroundSettingViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PDFBackgroundSettingViewController.h; path = ../PDFBackgroundSettingViewController.h; sourceTree = "<group>"; };
 		C986D3F42962857900EBD4DF /* PDFBackgroundSettingViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = PDFBackgroundSettingViewController.m; path = ../PDFBackgroundSettingViewController.m; sourceTree = "<group>"; };
-		C986D3F6296288C400EBD4DF /* PDFBackgroundPreview.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PDFBackgroundPreview.h; path = ../PDFBackgroundPreview.h; sourceTree = "<group>"; };
-		C986D3F7296288C400EBD4DF /* PDFBackgroundPreview.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = PDFBackgroundPreview.m; path = ../PDFBackgroundPreview.m; sourceTree = "<group>"; };
-		C986D3F9296288F700EBD4DF /* PDFBackgroundView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PDFBackgroundView.h; path = ../PDFBackgroundView.h; sourceTree = "<group>"; };
-		C986D3FA296288F700EBD4DF /* PDFBackgroundView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = PDFBackgroundView.m; path = ../PDFBackgroundView.m; sourceTree = "<group>"; };
-		C986D3FC2962A70400EBD4DF /* PDFBackgroundSettingView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PDFBackgroundSettingView.h; path = ../PDFBackgroundSettingView.h; sourceTree = "<group>"; };
-		C986D3FD2962A70400EBD4DF /* PDFBackgroundSettingView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = PDFBackgroundSettingView.m; path = ../PDFBackgroundSettingView.m; sourceTree = "<group>"; };
+		C986D3F6296288C400EBD4DF /* PDFBackgroundPreview.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PDFBackgroundPreview.h; sourceTree = "<group>"; };
+		C986D3F7296288C400EBD4DF /* PDFBackgroundPreview.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PDFBackgroundPreview.m; sourceTree = "<group>"; };
+		C986D3F9296288F700EBD4DF /* PDFBackgroundView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PDFBackgroundView.h; sourceTree = "<group>"; };
+		C986D3FA296288F700EBD4DF /* PDFBackgroundView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PDFBackgroundView.m; sourceTree = "<group>"; };
+		C986D3FC2962A70400EBD4DF /* PDFBackgroundSettingView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PDFBackgroundSettingView.h; sourceTree = "<group>"; };
+		C986D3FD2962A70400EBD4DF /* PDFBackgroundSettingView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PDFBackgroundSettingView.m; sourceTree = "<group>"; };
+		C9B62CB72976A3F700DE39A9 /* PDFWatermarkViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PDFWatermarkViewController.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>"; };
 		C9ECD1BF296FDB77006C459B /* PDFPreView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PDFPreView.h; sourceTree = "<group>"; };
 		C9ECD1C0296FDB77006C459B /* PDFPreView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PDFPreView.m; sourceTree = "<group>"; };
-		C9ECD1C22970023B006C459B /* PDFWatermarkViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PDFWatermarkViewController.h; sourceTree = "<group>"; };
-		C9ECD1C32970023B006C459B /* PDFWatermarkViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PDFWatermarkViewController.m; sourceTree = "<group>"; };
-		C9ECD1C5297003AF006C459B /* PDFWatermarkControllerHeader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PDFWatermarkControllerHeader.h; 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>"; };
@@ -156,14 +156,14 @@
 		EC6297BC292239C200D339EE /* PDFListController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PDFListController.m; sourceTree = "<group>"; };
 		ECC8831B2923352B00F6392E /* PDFViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PDFViewController.h; sourceTree = "<group>"; };
 		ECC8831C2923352B00F6392E /* PDFViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PDFViewController.m; sourceTree = "<group>"; };
-		ECD0ABE52928ED990091B6EB /* PDFTextPreview.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PDFTextPreview.m; path = ../PDFTextPreview.m; sourceTree = "<group>"; };
-		ECD0ABE82928ED990091B6EB /* PDFImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PDFImageView.m; path = ../PDFImageView.m; sourceTree = "<group>"; };
-		ECD0ABE92928ED990091B6EB /* PDFTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PDFTextView.h; path = ../PDFTextView.h; sourceTree = "<group>"; };
-		ECD0ABEA2928ED990091B6EB /* PDFTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PDFTextView.m; path = ../PDFTextView.m; sourceTree = "<group>"; };
-		ECD0ABEB2928ED9A0091B6EB /* PDFImagePreview.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PDFImagePreview.h; path = ../PDFImagePreview.h; sourceTree = "<group>"; };
-		ECD0ABEC2928ED9A0091B6EB /* PDFImagePreview.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PDFImagePreview.m; path = ../PDFImagePreview.m; sourceTree = "<group>"; };
-		ECD0ABED2928ED9A0091B6EB /* PDFImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PDFImageView.h; path = ../PDFImageView.h; sourceTree = "<group>"; };
-		ECD0ABEF2928ED9A0091B6EB /* PDFTextPreview.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PDFTextPreview.h; path = ../PDFTextPreview.h; sourceTree = "<group>"; };
+		ECD0ABE52928ED990091B6EB /* PDFWatermarkTextPreview.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PDFWatermarkTextPreview.m; sourceTree = "<group>"; };
+		ECD0ABE82928ED990091B6EB /* PDFWatermarkImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PDFWatermarkImageView.m; sourceTree = "<group>"; };
+		ECD0ABE92928ED990091B6EB /* PDFWatermarkTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PDFWatermarkTextView.h; sourceTree = "<group>"; };
+		ECD0ABEA2928ED990091B6EB /* PDFWatermarkTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PDFWatermarkTextView.m; sourceTree = "<group>"; };
+		ECD0ABEB2928ED9A0091B6EB /* PDFWatermarkImagePreview.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PDFWatermarkImagePreview.h; sourceTree = "<group>"; };
+		ECD0ABEC2928ED9A0091B6EB /* PDFWatermarkImagePreview.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PDFWatermarkImagePreview.m; sourceTree = "<group>"; };
+		ECD0ABED2928ED9A0091B6EB /* PDFWatermarkImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PDFWatermarkImageView.h; sourceTree = "<group>"; };
+		ECD0ABEF2928ED9A0091B6EB /* PDFWatermarkTextPreview.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PDFWatermarkTextPreview.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>"; };
@@ -190,10 +190,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 /* PDFTextViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PDFTextViewController.h; path = ../../PDFTextViewController.h; sourceTree = "<group>"; };
-		ECD0AC222928F2A70091B6EB /* PDFTextViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = PDFTextViewController.m; path = ../../PDFTextViewController.m; sourceTree = "<group>"; };
-		ECD0AC242928F2E50091B6EB /* PDFImageViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PDFImageViewController.h; path = ../../PDFImageViewController.h; sourceTree = "<group>"; };
-		ECD0AC252928F2E50091B6EB /* PDFImageViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = PDFImageViewController.m; path = ../../PDFImageViewController.m; sourceTree = "<group>"; };
+		ECD0AC212928F2A70091B6EB /* PDFTextWatermarkController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PDFTextWatermarkController.h; path = ../../PDFTextWatermarkController.h; sourceTree = "<group>"; };
+		ECD0AC222928F2A70091B6EB /* PDFTextWatermarkController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = PDFTextWatermarkController.m; path = ../../PDFTextWatermarkController.m; sourceTree = "<group>"; };
+		ECD0AC242928F2E50091B6EB /* PDFImageWatermarkController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PDFImageWatermarkController.h; path = ../../PDFImageWatermarkController.h; sourceTree = "<group>"; };
+		ECD0AC252928F2E50091B6EB /* PDFImageWatermarkController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = PDFImageWatermarkController.m; path = ../../PDFImageWatermarkController.m; sourceTree = "<group>"; };
 		ECD0AC30292B56C90091B6EB /* PDFDataModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PDFDataModel.h; sourceTree = "<group>"; };
 		ECD0AC31292B56C90091B6EB /* PDFDataModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PDFDataModel.m; sourceTree = "<group>"; };
 /* End PBXFileReference section */
@@ -210,21 +210,29 @@
 /* End PBXFrameworksBuildPhase section */
 
 /* Begin PBXGroup section */
-		C95FE7482966F3F40038BBF3 /* Image */ = {
+		C96D13912924791E00CC92C7 /* Images */ = {
 			isa = PBXGroup;
 			children = (
 				C95FE7492966F3F40038BBF3 /* btn_frontpage.png */,
+				C96D13922924793800CC92C7 /* btn_more.png */,
 				C95FE74A2966F3F40038BBF3 /* pageedit_delete.png */,
 				C95FE74B2966F3F40038BBF3 /* text_color_bar.png */,
 				C95FE74C2966F3F40038BBF3 /* add_newpage01.png */,
 				ECD0AC1F2928EF260091B6EB /* btn_selected.png */,
 			);
-			path = Image;
+			path = Images;
 			sourceTree = "<group>";
 		};
-		C95FE7752966F65F0038BBF3 /* HeaderFooterView */ = {
+		C97A786F2967AC000012BA91 /* PDFHeaderFooter */ = {
 			isa = PBXGroup;
 			children = (
+				C95FE7782966F7810038BBF3 /* PDFHeaderFooterAddController.h */,
+				C97A78702967AC210012BA91 /* PDFAddViewController.h */,
+				C95FE77C2966F7970038BBF3 /* PDFBatesAddViewController.m */,
+				C97A78722967AC3D0012BA91 /* PDFAddViewController.m */,
+				C95FE7792966F7870038BBF3 /* PDFHeaderFooterAddController.m */,
+				C95FE77B2966F78E0038BBF3 /* PDFBatesAddViewController.h */,
+				C95FE7812966F7AF0038BBF3 /* PDFAddViewControllerHeader.h */,
 				C95FE7632966F4ED0038BBF3 /* PDFHeadView.h */,
 				C95FE7642966F5E30038BBF3 /* PDFHeadView.m */,
 				C95FE7662966F5FA0038BBF3 /* PDFHeaderFooterAddView.h */,
@@ -235,36 +243,17 @@
 				C95FE76D2966F61A0038BBF3 /* PDFHeaderFooterTextTableView.m */,
 				C95FE76F2966F6270038BBF3 /* PDFAddView.h */,
 				C95FE7702966F62E0038BBF3 /* PDFAddView.m */,
-				C95FE7722966F6350038BBF3 /* PDFSettingView.h */,
-				C95FE7732966F63C0038BBF3 /* PDFSettingView.m */,
-			);
-			path = HeaderFooterView;
-			sourceTree = "<group>";
-		};
-		C95FE7762966F6AF0038BBF3 /* WatermarkView */ = {
-			isa = PBXGroup;
-			children = (
-				ECD0ABE82928ED990091B6EB /* PDFImageView.m */,
-				ECD0ABED2928ED9A0091B6EB /* PDFImageView.h */,
-				ECD0ABEB2928ED9A0091B6EB /* PDFImagePreview.h */,
-				ECD0ABEC2928ED9A0091B6EB /* PDFImagePreview.m */,
-				ECD0ABEF2928ED9A0091B6EB /* PDFTextPreview.h */,
-				ECD0ABE52928ED990091B6EB /* PDFTextPreview.m */,
-				ECD0ABE92928ED990091B6EB /* PDFTextView.h */,
-				ECD0ABEA2928ED990091B6EB /* PDFTextView.m */,
-				C96150D0295400B00020F445 /* PDFDrawView.h */,
-				C96150D1295400B00020F445 /* PDFDrawView.m */,
-				C96150D329554F660020F445 /* PDFClipView.h */,
-				C96150D429554F660020F445 /* PDFClipView.m */,
-				C97E91662959B96C007F6943 /* PDFEditView.h */,
-				C97E91672959B96C007F6943 /* PDFEditView.m */,
+				C95FE7722966F6350038BBF3 /* PDFHeaderFooterSettingView.h */,
+				C95FE7732966F63C0038BBF3 /* PDFHeaderFooterSettingView.m */,
 			);
-			path = WatermarkView;
+			path = PDFHeaderFooter;
 			sourceTree = "<group>";
 		};
-		C95FE7772966F70B0038BBF3 /* BackgroundView */ = {
+		C97A787E2967AEB00012BA91 /* PDFBackground */ = {
 			isa = PBXGroup;
 			children = (
+				C986D3F32962857900EBD4DF /* PDFBackgroundSettingViewController.h */,
+				C986D3F42962857900EBD4DF /* PDFBackgroundSettingViewController.m */,
 				C986D3F6296288C400EBD4DF /* PDFBackgroundPreview.h */,
 				C986D3F7296288C400EBD4DF /* PDFBackgroundPreview.m */,
 				C986D3F9296288F700EBD4DF /* PDFBackgroundView.h */,
@@ -275,56 +264,41 @@
 				C92BA1932963F806009954EF /* PDFDrawBackgroundView.m */,
 				C92BA1952963F84B009954EF /* PDFDrawImageView.h */,
 				C92BA1962963F84B009954EF /* PDFDrawImageView.m */,
+				C92BA19829651CA3009954EF /* PDFBackgroundModel.h */,
+				C92BA19929651CA3009954EF /* PDFBackgroundModel.m */,
 			);
-			path = BackgroundView;
-			sourceTree = "<group>";
-		};
-		C96D13912924791E00CC92C7 /* Images */ = {
-			isa = PBXGroup;
-			children = (
-				C96D13922924793800CC92C7 /* btn_more.png */,
-			);
-			path = Images;
-			sourceTree = "<group>";
-		};
-		C97A786F2967AC000012BA91 /* HeaderFooter */ = {
-			isa = PBXGroup;
-			children = (
-				C95FE7782966F7810038BBF3 /* PDFHeaderFooterAddController.h */,
-				C97A78702967AC210012BA91 /* PDFAddViewController.h */,
-				C95FE77C2966F7970038BBF3 /* PDFBatesAddViewController.m */,
-				C97A78722967AC3D0012BA91 /* PDFAddViewController.m */,
-				C95FE7792966F7870038BBF3 /* PDFHeaderFooterAddController.m */,
-				C95FE77B2966F78E0038BBF3 /* PDFBatesAddViewController.h */,
-				C95FE7812966F7AF0038BBF3 /* PDFAddViewControllerHeader.h */,
-			);
-			path = HeaderFooter;
-			sourceTree = "<group>";
-		};
-		C97A787E2967AEB00012BA91 /* Background */ = {
-			isa = PBXGroup;
-			children = (
-				C986D3F32962857900EBD4DF /* PDFBackgroundSettingViewController.h */,
-				C986D3F42962857900EBD4DF /* PDFBackgroundSettingViewController.m */,
-			);
-			path = Background;
+			path = PDFBackground;
 			sourceTree = "<group>";
 		};
-		C97A78822967AF980012BA91 /* Watermark */ = {
+		C97A78822967AF980012BA91 /* PDFWatermark */ = {
 			isa = PBXGroup;
 			children = (
-				ECD0AC212928F2A70091B6EB /* PDFTextViewController.h */,
-				ECD0AC222928F2A70091B6EB /* PDFTextViewController.m */,
-				ECD0AC242928F2E50091B6EB /* PDFImageViewController.h */,
-				ECD0AC252928F2E50091B6EB /* PDFImageViewController.m */,
+				C92E895D2975454600CB43C1 /* PDFWatermarkControllerHeader.h */,
+				C92E895C2975452E00CB43C1 /* PDFWatermarkViewController.h */,
+				C9B62CB72976A3F700DE39A9 /* PDFWatermarkViewController.m */,
+				ECD0AC212928F2A70091B6EB /* PDFTextWatermarkController.h */,
+				ECD0AC222928F2A70091B6EB /* PDFTextWatermarkController.m */,
+				ECD0AC242928F2E50091B6EB /* PDFImageWatermarkController.h */,
+				ECD0AC252928F2E50091B6EB /* PDFImageWatermarkController.m */,
 				C9638494294ACC240055CCCA /* PDFAddWaterMarkViewController.h */,
 				C9638495294ACC240055CCCA /* PDFAddWaterMarkViewController.m */,
-				C9ECD1C22970023B006C459B /* PDFWatermarkViewController.h */,
-				C9ECD1C32970023B006C459B /* PDFWatermarkViewController.m */,
-				C9ECD1C5297003AF006C459B /* PDFWatermarkControllerHeader.h */,
+				ECD0ABE82928ED990091B6EB /* PDFWatermarkImageView.m */,
+				ECD0ABED2928ED9A0091B6EB /* PDFWatermarkImageView.h */,
+				ECD0ABEB2928ED9A0091B6EB /* PDFWatermarkImagePreview.h */,
+				ECD0ABEC2928ED9A0091B6EB /* PDFWatermarkImagePreview.m */,
+				ECD0ABEF2928ED9A0091B6EB /* PDFWatermarkTextPreview.h */,
+				ECD0ABE52928ED990091B6EB /* PDFWatermarkTextPreview.m */,
+				ECD0ABE92928ED990091B6EB /* PDFWatermarkTextView.h */,
+				ECD0ABEA2928ED990091B6EB /* PDFWatermarkTextView.m */,
+				C96150D0295400B00020F445 /* PDFWatermarkDrawView.h */,
+				C96150D1295400B00020F445 /* PDFWatermarkDrawView.m */,
+				C96150D329554F660020F445 /* PDFWatermarkClipView.h */,
+				C96150D429554F660020F445 /* PDFWatermarkClipView.m */,
+				C97E91662959B96C007F6943 /* PDFWatermarkEditView.h */,
+				C97E91672959B96C007F6943 /* PDFWatermarkEditView.m */,
 			);
-			name = Watermark;
-			path = Background/Watermark;
+			name = PDFWatermark;
+			path = Background/PDFWatermark;
 			sourceTree = "<group>";
 		};
 		EC62978029220F8300D339EE = {
@@ -350,7 +324,6 @@
 				C9ECD104296CFE45006C459B /* Sample */,
 				ECD0ABF62928EE9A0091B6EB /* Masonry */,
 				EC6297B52922393F00D339EE /* Controller */,
-				ECD0ABE42928ED5D0091B6EB /* View */,
 				EC6297AD29222D3100D339EE /* Model */,
 				EC62978D29220F8300D339EE /* AppDelegate.m */,
 				EC62978C29220F8300D339EE /* AppDelegate.h */,
@@ -376,8 +349,6 @@
 				C95FE7462966F37F0038BBF3 /* PDFHeaderFooterModel.m */,
 				ECD0AC30292B56C90091B6EB /* PDFDataModel.h */,
 				ECD0AC31292B56C90091B6EB /* PDFDataModel.m */,
-				C92BA19829651CA3009954EF /* PDFBackgroundModel.h */,
-				C92BA19929651CA3009954EF /* PDFBackgroundModel.m */,
 			);
 			path = Model;
 			sourceTree = "<group>";
@@ -390,24 +361,13 @@
 				EC6297BC292239C200D339EE /* PDFListController.m */,
 				ECC8831B2923352B00F6392E /* PDFViewController.h */,
 				ECC8831C2923352B00F6392E /* PDFViewController.m */,
-				C97A78822967AF980012BA91 /* Watermark */,
-				C97A787E2967AEB00012BA91 /* Background */,
-				C97A786F2967AC000012BA91 /* HeaderFooter */,
-			);
-			path = Controller;
-			sourceTree = "<group>";
-		};
-		ECD0ABE42928ED5D0091B6EB /* View */ = {
-			isa = PBXGroup;
-			children = (
-				C95FE7482966F3F40038BBF3 /* Image */,
-				C95FE7772966F70B0038BBF3 /* BackgroundView */,
-				C95FE7762966F6AF0038BBF3 /* WatermarkView */,
-				C95FE7752966F65F0038BBF3 /* HeaderFooterView */,
 				C9ECD1BF296FDB77006C459B /* PDFPreView.h */,
 				C9ECD1C0296FDB77006C459B /* PDFPreView.m */,
+				C97A78822967AF980012BA91 /* PDFWatermark */,
+				C97A787E2967AEB00012BA91 /* PDFBackground */,
+				C97A786F2967AC000012BA91 /* PDFHeaderFooter */,
 			);
-			path = View;
+			path = Controller;
 			sourceTree = "<group>";
 		};
 		ECD0ABF62928EE9A0091B6EB /* Masonry */ = {
@@ -519,20 +479,20 @@
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				C9ECD1C42970023B006C459B /* PDFWatermarkViewController.m in Sources */,
 				ECC8831D2923352B00F6392E /* PDFViewController.m in Sources */,
 				C95FE7652966F5E30038BBF3 /* PDFHeadView.m in Sources */,
 				EC62979429220F8300D339EE /* ViewController.m in Sources */,
 				ECD0AC172928EECB0091B6EB /* MASConstraint.m in Sources */,
-				C97E91682959B96C007F6943 /* PDFEditView.m in Sources */,
-				C96150D2295400B00020F445 /* PDFDrawView.m in Sources */,
+				C97E91682959B96C007F6943 /* PDFWatermarkEditView.m in Sources */,
+				C96150D2295400B00020F445 /* PDFWatermarkDrawView.m in Sources */,
 				C95FE77D2966F7970038BBF3 /* PDFBatesAddViewController.m in Sources */,
 				EC6297B8292239A700D339EE /* PDFModel.m in Sources */,
-				ECD0AC232928F2A70091B6EB /* PDFTextViewController.m in Sources */,
-				ECD0AC262928F2E50091B6EB /* PDFImageViewController.m in Sources */,
+				ECD0AC232928F2A70091B6EB /* PDFTextWatermarkController.m in Sources */,
+				ECD0AC262928F2E50091B6EB /* PDFImageWatermarkController.m in Sources */,
 				C95FE7472966F37F0038BBF3 /* PDFHeaderFooterModel.m in Sources */,
-				ECD0ABF02928ED9A0091B6EB /* PDFTextPreview.m in Sources */,
+				ECD0ABF02928ED9A0091B6EB /* PDFWatermarkTextPreview.m in Sources */,
 				C97A78732967AC3D0012BA91 /* PDFAddViewController.m in Sources */,
+				C9B62CB82976A3F700DE39A9 /* PDFWatermarkViewController.m in Sources */,
 				C9ECD1C1296FDB77006C459B /* PDFPreView.m in Sources */,
 				C9638496294ACC240055CCCA /* PDFAddWaterMarkViewController.m in Sources */,
 				ECD0AC1D2928EECB0091B6EB /* MASViewAttribute.m in Sources */,
@@ -541,10 +501,10 @@
 				C986D3FE2962A70400EBD4DF /* PDFBackgroundSettingView.m in Sources */,
 				ECD0AC1C2928EECB0091B6EB /* View+MASAdditions.m in Sources */,
 				C95FE7712966F62E0038BBF3 /* PDFAddView.m in Sources */,
-				C96150D529554F660020F445 /* PDFClipView.m in Sources */,
+				C96150D529554F660020F445 /* PDFWatermarkClipView.m in Sources */,
 				ECD0AC152928EECB0091B6EB /* MASLayoutConstraint.m in Sources */,
 				EC62978E29220F8300D339EE /* AppDelegate.m in Sources */,
-				C95FE7742966F63C0038BBF3 /* PDFSettingView.m in Sources */,
+				C95FE7742966F63C0038BBF3 /* PDFHeaderFooterSettingView.m in Sources */,
 				EC62979F29220F8400D339EE /* main.m in Sources */,
 				EC6297BD292239C200D339EE /* PDFListController.m in Sources */,
 				C92BA1942963F806009954EF /* PDFDrawBackgroundView.m in Sources */,
@@ -560,10 +520,10 @@
 				ECD0AC192928EECB0091B6EB /* MASViewConstraint.m in Sources */,
 				EC62979129220F8300D339EE /* SceneDelegate.m in Sources */,
 				C92BA1972963F84B009954EF /* PDFDrawImageView.m in Sources */,
-				ECD0ABF52928ED9A0091B6EB /* PDFImagePreview.m in Sources */,
+				ECD0ABF52928ED9A0091B6EB /* PDFWatermarkImagePreview.m in Sources */,
 				ECD0AC32292B56C90091B6EB /* PDFDataModel.m in Sources */,
-				ECD0ABF42928ED9A0091B6EB /* PDFTextView.m in Sources */,
-				ECD0ABF32928ED9A0091B6EB /* PDFImageView.m in Sources */,
+				ECD0ABF42928ED9A0091B6EB /* PDFWatermarkTextView.m in Sources */,
+				ECD0ABF32928ED9A0091B6EB /* PDFWatermarkImageView.m in Sources */,
 				C95FE7682966F6000038BBF3 /* PDFHeaderFooterAddView.m in Sources */,
 				C986D3F8296288C400EBD4DF /* PDFBackgroundPreview.m in Sources */,
 			);

+ 1 - 1
PDFViewer/View/PDFClipView.h

@@ -9,7 +9,7 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
-@interface PDFClipView : UIView
+@interface PDFWatermarkClipView : UIView
 
 @property (nonatomic,assign) CGRect documentRect;
 

+ 2 - 2
PDFViewer/View/PDFClipView.m

@@ -5,9 +5,9 @@
 //  Created by kdanmobile_2 on 2022/12/23.
 //
 
-#import "PDFClipView.h"
+#import "PDFWatermarkClipView.h"
 
-@implementation PDFClipView
+@implementation PDFWatermarkClipView
 
 - (instancetype)initWithFrame:(CGRect)frame {
     self = [super initWithFrame:frame];

+ 1 - 1
PDFViewer/View/PDFDrawView.h

@@ -10,7 +10,7 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
-@interface PDFDrawView : UIView
+@interface PDFWatermarkDrawView : UIView
 
 @property (nonatomic,strong) PDFDataModel *dataModel;
 @property (nonatomic,assign) CGRect waterLabelRect;

+ 2 - 2
PDFViewer/View/PDFDrawView.m

@@ -5,9 +5,9 @@
 //  Created by kdanmobile_2 on 2022/12/22.
 //
 
-#import "PDFDrawView.h"
+#import "PDFWatermarkDrawView.h"
 
-@implementation PDFDrawView
+@implementation PDFWatermarkDrawView
 
 - (instancetype)initWithFrame:(CGRect)frame {
     self = [super initWithFrame:frame];

+ 1 - 1
PDFViewer/View/WatermarkView/PDFEditView.h

@@ -9,7 +9,7 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
-@interface PDFEditView : UIView
+@interface PDFWatermarkEditView : UIView
  
 @property (nonatomic,strong) UITableView *editTableView;
 

+ 2 - 2
PDFViewer/View/WatermarkView/PDFEditView.m

@@ -5,9 +5,9 @@
 //  Created by kdanmobile_2 on 2022/12/26.
 //
 
-#import "PDFEditView.h"
+#import "PDFWatermarkEditView.h"
 
-@implementation PDFEditView
+@implementation PDFWatermarkEditView
 
 - (instancetype)initWithFrame:(CGRect)frame {
     self = [super initWithFrame:frame];

+ 1 - 1
PDFViewer/View/PDFImagePreview.h

@@ -10,7 +10,7 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
-@interface PDFImagePreview : PDFPreView
+@interface PDFWatermarkImagePreview : PDFPreView
 
 @property (nonatomic,strong) UIButton *rotationBtn;
 @property (nonatomic,assign) CGRect watermarkFrame;

+ 4 - 4
PDFViewer/View/PDFImagePreview.m

@@ -5,19 +5,19 @@
 //  Created by kdan on 2022/11/18.
 //
 
-#import "PDFImagePreview.h"
+#import "PDFWatermarkImagePreview.h"
 #import "Masonry.h"
 
 BOOL gImagePreviewIsFirstLayout = YES;
 
-@implementation PDFImagePreview
+@implementation PDFWatermarkImagePreview
 
 - (instancetype)initWithFrame:(CGRect)frame
 {
     if (self = [super initWithFrame:frame]) {
         _rotationBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        
-        [self.documentView addSubview:self.preImageView];
+        [self.documentImageView addSubview:self.preImageView];
         [self.preImageView addSubview:_rotationBtn];
     }
     return self;
@@ -34,7 +34,7 @@ BOOL gImagePreviewIsFirstLayout = YES;
     self.preImageView.contentMode = UIViewContentModeScaleAspectFit;
     
     CGRect frame = self.preImageView.frame;
-    frame.origin = CGPointMake(self.documentView.bounds.size.width / 2 - self.preImageView.frame.size.width / 2, self.documentView.bounds.size.height / 2 - self.preImageView.frame.size.height / 2);
+    frame.origin = CGPointMake(self.documentImageView.bounds.size.width / 2 - self.preImageView.frame.size.width / 2, self.documentImageView.bounds.size.height / 2 - self.preImageView.frame.size.height / 2);
     _watermarkFrame = frame;
     
     self.preImageView.frame = _watermarkFrame;

+ 1 - 1
PDFViewer/View/PDFImageView.h

@@ -9,7 +9,7 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
-@interface PDFImageView : UIView
+@interface PDFWatermarkImageView : UIView
 
 @property (nonatomic,strong) UIButton *selectBtn;
 @property (nonatomic,strong) UISlider *imageScaleSlider;

+ 2 - 2
PDFViewer/View/PDFImageView.m

@@ -5,10 +5,10 @@
 //  Created by kdan on 2022/11/16.
 //
 
-#import "PDFImageView.h"
+#import "PDFWatermarkImageView.h"
 #import "Masonry.h"
 
-@implementation PDFImageView
+@implementation PDFWatermarkImageView
 
 - (instancetype)initWithFrame:(CGRect)frame {
     

+ 1 - 1
PDFViewer/View/PDFTextPreview.h

@@ -10,7 +10,7 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
-@interface PDFTextPreview : PDFPreView
+@interface PDFWatermarkTextPreview : PDFPreView
 
 @property (nonatomic,strong) UIButton *rotationBtn;
 

+ 4 - 4
PDFViewer/View/PDFTextPreview.m

@@ -5,12 +5,12 @@
 //  Created by kdan on 2022/11/18.
 //
 
-#import "PDFTextPreview.h"
+#import "PDFWatermarkTextPreview.h"
 #import "Masonry.h"
 
 BOOL gTextPreviewIsFirstLayout = YES;
 
-@implementation PDFTextPreview
+@implementation PDFWatermarkTextPreview
 
 - (instancetype)initWithFrame:(CGRect)frame
 {
@@ -18,7 +18,7 @@ BOOL gTextPreviewIsFirstLayout = YES;
         
         _rotationBtn = [UIButton buttonWithType:UIButtonTypeCustom];
         
-        [self.documentView addSubview:self.preLabel];
+        [self.documentImageView addSubview:self.preLabel];
         [self.preLabel addSubview:_rotationBtn];
         
         self.backgroundColor = [UIColor systemGray5Color];
@@ -45,7 +45,7 @@ BOOL gTextPreviewIsFirstLayout = YES;
      */
 
     CGRect frame = self.preLabel.frame;
-    frame.origin = CGPointMake(self.documentView.bounds.size.width / 2 - self.preLabel.frame.size.width / 2, self.documentView.bounds.size.height / 2 - self.preLabel.frame.size.height / 2);
+    frame.origin = CGPointMake(self.documentImageView.bounds.size.width / 2 - self.preLabel.frame.size.width / 2, self.documentImageView.bounds.size.height / 2 - self.preLabel.frame.size.height / 2);
     self.preLabel.frame = frame;
 
     _rotationBtn.layer.cornerRadius = 10;

+ 1 - 1
PDFViewer/View/PDFTextView.h

@@ -9,7 +9,7 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
-@interface PDFTextView : UIView
+@interface PDFWatermarkTextView : UIView
 
 @property (nonatomic,strong) UIButton *colorBtn;
 @property (nonatomic,strong) UILabel *colorLabel;

+ 2 - 2
PDFViewer/View/PDFTextView.m

@@ -5,13 +5,13 @@
 //  Created by kdan on 2022/11/16.
 //
 
-#import "PDFTextView.h"
+#import "PDFWatermarkTextView.h"
 #import "Masonry.h"
 
 #define KBUTTON_WIDTH 28
 #define KBUTTON_HEIGHT 28
 
-@implementation PDFTextView
+@implementation PDFWatermarkTextView
 
 - (instancetype)initWithFrame:(CGRect)frame {
     

PDFViewer/Controller/Background/Watermark/PDFWatermarkViewController.m → PDFViewer/Controller/Background/PDFWatermark/PDFWatermarkViewController.m


PDFViewer/View/Image/add_newpage01.png → PDFViewer/Controller/Images/add_newpage01.png


PDFViewer/View/Image/btn_frontpage.png → PDFViewer/Controller/Images/btn_frontpage.png


PDFViewer/View/Image/btn_selected.png → PDFViewer/Controller/Images/btn_selected.png


PDFViewer/View/Image/pageedit_delete.png → PDFViewer/Controller/Images/pageedit_delete.png


PDFViewer/View/Image/text_color_bar.png → PDFViewer/Controller/Images/text_color_bar.png


+ 4 - 4
PDFViewer/Controller/PDFAddWaterMarkViewController.h

@@ -7,8 +7,8 @@
 
 #import <UIKit/UIKit.h>
 #import <ComPDFKit/ComPDFKit.h>
-#import "PDFTextViewController.h"
-#import "PDFImageViewController.h"
+#import "PDFTextWatermarkController.h"
+#import "PDFImageWatermarkController.h"
 #import "PDFDataModel.h"
 
 NS_ASSUME_NONNULL_BEGIN
@@ -24,8 +24,8 @@ NS_ASSUME_NONNULL_BEGIN
 @interface PDFAddWaterMarkViewController : UIViewController
 
 @property (nonatomic,strong) id<WaterMarkModelDataDelegate> delegate;
-@property (nonatomic,strong) PDFTextViewController *textViewController;
-@property (nonatomic,strong) PDFImageViewController *imageViewController;
+@property (nonatomic,strong) PDFTextWatermarkController *textViewController;
+@property (nonatomic,strong) PDFImageWatermarkController *imageViewController;
 
 - (instancetype)initWithDocument:(CPDFDocument *)document;
 

+ 15 - 15
PDFViewer/Controller/PDFAddWaterMarkViewController.m

@@ -9,12 +9,12 @@
 #import <ComPDFKit/ComPDFKit.h>
 #import <ComPDFKit/CPDFWatermark.h>
 #import "PDFViewController.h"
-#import "PDFTextView.h"
-#import "PDFTextPreview.h"
-#import "PDFImageView.h"
-#import "PDFImagePreview.h"
+#import "PDFWatermarkTextView.h"
+#import "PDFWatermarkTextPreview.h"
+#import "PDFWatermarkImageView.h"
+#import "PDFWatermarkImagePreview.h"
 #import "PDFDataModel.h"
-#import "PDFEditView.h"
+#import "PDFWatermarkEditView.h"
 #import "Masonry.h"
 
 @interface PDFAddWaterMarkViewController () <UITableViewDelegate,UITableViewDataSource>
@@ -22,7 +22,7 @@
 @property (nonatomic,assign) CGSize imageSize;
 @property (nonatomic,strong) UIImage *image;
 @property (nonatomic,strong) PDFDataModel *dataModel;
-@property (nonatomic,strong) PDFEditView *editView;
+@property (nonatomic,strong) PDFWatermarkEditView *editView;
 @property (nonatomic,strong) NSMutableArray *dataArray;
 @property (nonatomic,strong) CPDFDocument *document;
 @property (nonatomic,strong) UISegmentedControl *segmentedControl;
@@ -73,8 +73,8 @@
     
     [_segmentedControl setBackgroundColor:[UIColor whiteColor]];
     
-    _textViewController = [[PDFTextViewController alloc] init];
-    _imageViewController = [[PDFImageViewController alloc] init];
+    _textViewController = [[PDFTextWatermarkController alloc] init];
+    _imageViewController = [[PDFImageWatermarkController alloc] init];
     
     [self addChildViewController:_textViewController];
     [self addChildViewController:_imageViewController];
@@ -83,14 +83,14 @@
     [self.view addSubview:_textViewController.view];
     [self.view addSubview:_imageViewController.view];
     
-    _editView = [[PDFEditView alloc] init];
+    _editView = [[PDFWatermarkEditView alloc] init];
     _editView.editTableView.dataSource = self;
     _editView.editTableView.delegate = self;
     
     [self.view addSubview:_editView];
     
-    _textViewController.textPreview.documentView.image = self.image;
-    _imageViewController.imagePreview.documentView.image = self.image;
+    _textViewController.textPreview.documentImageView.image = self.image;
+    _imageViewController.imagePreview.documentImageView.image = self.image;
     _imageViewController.view.hidden = YES;
 }
 
@@ -284,13 +284,13 @@
         make.bottom.equalTo(self.view.mas_bottom).offset(-34);
     }];
     
-    [_textViewController.textPreview.documentView mas_remakeConstraints:^(MASConstraintMaker *make) {
+    [_textViewController.textPreview.documentImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
         make.centerX.equalTo(_textViewController.textPreview.mas_centerX);
         make.centerY.equalTo(_textViewController.textPreview.mas_centerY);
         make.width.equalTo(@(_imageSize.width / 10));
         make.height.equalTo(@(_imageSize.height / 10));
     }];
-    [_imageViewController.imagePreview.documentView mas_remakeConstraints:^(MASConstraintMaker *make) {
+    [_imageViewController.imagePreview.documentImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
         make.centerX.equalTo(_imageViewController.imagePreview.mas_centerX);
         make.centerY.equalTo(_imageViewController.imagePreview.mas_centerY);
         make.width.equalTo(@(_imageSize.width / 10));
@@ -315,13 +315,13 @@
         make.width.equalTo(_segmentedControl.mas_width);
         make.bottom.equalTo(self.view).offset(-34);
     }];
-    [_textViewController.textPreview.documentView mas_remakeConstraints:^(MASConstraintMaker *make) {
+    [_textViewController.textPreview.documentImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
         make.centerX.equalTo(_textViewController.textPreview.mas_centerX);
         make.centerY.equalTo(_textViewController.textPreview.mas_centerY);
         make.width.equalTo(@(_imageSize.width / 8));
         make.height.equalTo(@(_imageSize.height / 8));
     }];
-    [_imageViewController.imagePreview.documentView mas_remakeConstraints:^(MASConstraintMaker *make) {
+    [_imageViewController.imagePreview.documentImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
         make.centerX.equalTo(_imageViewController.imagePreview.mas_centerX);
         make.centerY.equalTo(_imageViewController.imagePreview.mas_centerY);
         make.width.equalTo(@(_imageSize.width / 8));

PDFViewer/Controller/Background/CPDFBackgroundSettingViewController.h → PDFViewer/Controller/PDFBackground/CPDFBackgroundSettingViewController.h


PDFViewer/Controller/Background/CPDFBackgroundSettingViewController.m → PDFViewer/Controller/PDFBackground/CPDFBackgroundSettingViewController.m


PDFViewer/Model/PDFBackgroundModel.h → PDFViewer/Controller/PDFBackground/PDFBackgroundModel.h


PDFViewer/Model/PDFBackgroundModel.m → PDFViewer/Controller/PDFBackground/PDFBackgroundModel.m


PDFViewer/View/PDFBackgroundPreview.h → PDFViewer/Controller/PDFBackground/PDFBackgroundPreview.h


+ 1 - 1
PDFViewer/View/PDFBackgroundPreview.m

@@ -32,7 +32,7 @@
     self.preImageView.contentMode = UIViewContentModeScaleAspectFit;
     
     CGRect frame = self.preImageView.frame;
-    frame.origin = CGPointMake(self.documentView.bounds.size.width / 2 - self.preImageView.frame.size.width / 2, self.documentView.bounds.size.height / 2 - self.preImageView.frame.size.height / 2);
+    frame.origin = CGPointMake(self.documentImageView.bounds.size.width / 2 - self.preImageView.frame.size.width / 2, self.documentImageView.bounds.size.height / 2 - self.preImageView.frame.size.height / 2);
     
     self.preImageView.frame = frame;
 }

PDFViewer/View/PDFBackgroundSettingView.h → PDFViewer/Controller/PDFBackground/PDFBackgroundSettingView.h


PDFViewer/View/PDFBackgroundSettingView.m → PDFViewer/Controller/PDFBackground/PDFBackgroundSettingView.m


PDFViewer/View/PDFBackgroundView.h → PDFViewer/Controller/PDFBackground/PDFBackgroundView.h


PDFViewer/View/PDFBackgroundView.m → PDFViewer/Controller/PDFBackground/PDFBackgroundView.m


PDFViewer/View/PDFDrawBackgroundView.h → PDFViewer/Controller/PDFBackground/PDFDrawBackgroundView.h


PDFViewer/View/PDFDrawBackgroundView.m → PDFViewer/Controller/PDFBackground/PDFDrawBackgroundView.m


PDFViewer/View/PDFDrawImageView.h → PDFViewer/Controller/PDFBackground/PDFDrawImageView.h


PDFViewer/View/PDFDrawImageView.m → PDFViewer/Controller/PDFBackground/PDFDrawImageView.m


PDFViewer/Controller/Background/Watermark/CPDFAddWaterMarkViewController.h → PDFViewer/Controller/PDFBackground/PDFWatermark/CPDFAddWaterMarkViewController.h


PDFViewer/Controller/Background/Watermark/CPDFAddWaterMarkViewController.m → PDFViewer/Controller/PDFBackground/PDFWatermark/CPDFAddWaterMarkViewController.m


PDFViewer/Controller/Background/Watermark/CPDFImageViewController.h → PDFViewer/Controller/PDFBackground/PDFWatermark/CPDFImageViewController.h


PDFViewer/Controller/Background/Watermark/CPDFImageViewController.m → PDFViewer/Controller/PDFBackground/PDFWatermark/CPDFImageViewController.m


PDFViewer/Controller/Background/Watermark/CPDFTextViewController.h → PDFViewer/Controller/PDFBackground/PDFWatermark/CPDFTextViewController.h


PDFViewer/Controller/Background/Watermark/CPDFTextViewController.m → PDFViewer/Controller/PDFBackground/PDFWatermark/CPDFTextViewController.m


PDFViewer/Controller/Background/Watermark/PDFWatermarkControllerHeader.h → PDFViewer/Controller/PDFBackground/PDFWatermark/PDFWatermarkControllerHeader.h


PDFViewer/Controller/Background/Watermark/PDFWatermarkViewController.h → PDFViewer/Controller/PDFBackground/PDFWatermark/PDFWatermarkViewController.h


+ 21 - 21
PDFViewer/Controller/PDFBackgroundSettingViewController.m

@@ -70,7 +70,7 @@
     _backgroundPreView = [[PDFBackgroundPreview alloc] init];
     [self.view addSubview:_backgroundPreView];
     
-    _backgroundPreView.documentView.image = self.image;
+    _backgroundPreView.documentImageView.image = self.image;
     
     _drawBackgroundView = [[PDFDrawBackgroundView alloc] init];
     _drawBackgroundView.dataModel = self.dataModel;
@@ -289,7 +289,7 @@
         make.bottom.equalTo(self.backgroundView.mas_top);
     }];
     
-    [_backgroundPreView.documentView mas_remakeConstraints:^(MASConstraintMaker *make) {
+    [_backgroundPreView.documentImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
         make.top.equalTo(self.view.mas_top).offset(43.6);
         make.bottom.equalTo(self.backgroundPreView.mas_bottom);
         make.centerX.equalTo(self.backgroundPreView.mas_centerX);
@@ -297,16 +297,16 @@
     }];
     
     [_drawBackgroundView mas_remakeConstraints:^(MASConstraintMaker *make) {
-        make.top.equalTo(self.backgroundPreView.documentView.mas_top);
-        make.bottom.equalTo(self.backgroundPreView.documentView.mas_bottom);
-        make.left.equalTo(self.backgroundPreView.documentView.mas_left);
-        make.right.equalTo(self.backgroundPreView.documentView.mas_right);
+        make.top.equalTo(self.backgroundPreView.documentImageView.mas_top);
+        make.bottom.equalTo(self.backgroundPreView.documentImageView.mas_bottom);
+        make.left.equalTo(self.backgroundPreView.documentImageView.mas_left);
+        make.right.equalTo(self.backgroundPreView.documentImageView.mas_right);
     }];
     [_drawImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
-        make.top.equalTo(self.backgroundPreView.documentView.mas_top);
-        make.bottom.equalTo(self.backgroundPreView.documentView.mas_bottom);
-        make.left.equalTo(self.backgroundPreView.documentView.mas_left);
-        make.right.equalTo(self.backgroundPreView.documentView.mas_right);
+        make.top.equalTo(self.backgroundPreView.documentImageView.mas_top);
+        make.bottom.equalTo(self.backgroundPreView.documentImageView.mas_bottom);
+        make.left.equalTo(self.backgroundPreView.documentImageView.mas_left);
+        make.right.equalTo(self.backgroundPreView.documentImageView.mas_right);
     }];
 }
 
@@ -325,7 +325,7 @@
         make.bottom.equalTo(self.backgroundView.mas_top);
     }];
     
-    [_backgroundPreView.documentView mas_remakeConstraints:^(MASConstraintMaker *make) {
+    [_backgroundPreView.documentImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
         make.left.equalTo(self.backgroundPreView.mas_left);
         make.top.equalTo(self.backgroundPreView.mas_top).offset(40);
         make.bottom.equalTo(self.backgroundPreView.mas_bottom).offset(-40);
@@ -333,16 +333,16 @@
     }];
     
     [_drawBackgroundView mas_remakeConstraints:^(MASConstraintMaker *make) {
-        make.top.equalTo(self.backgroundPreView.documentView.mas_top);
-        make.bottom.equalTo(self.backgroundPreView.documentView.mas_bottom);
-        make.left.equalTo(self.backgroundPreView.documentView.mas_left);
-        make.right.equalTo(self.backgroundPreView.documentView.mas_right);
+        make.top.equalTo(self.backgroundPreView.documentImageView.mas_top);
+        make.bottom.equalTo(self.backgroundPreView.documentImageView.mas_bottom);
+        make.left.equalTo(self.backgroundPreView.documentImageView.mas_left);
+        make.right.equalTo(self.backgroundPreView.documentImageView.mas_right);
     }];
     [_drawImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
-        make.top.equalTo(self.backgroundPreView.documentView.mas_top);
-        make.bottom.equalTo(self.backgroundPreView.documentView.mas_bottom);
-        make.left.equalTo(self.backgroundPreView.documentView.mas_left);
-        make.right.equalTo(self.backgroundPreView.documentView.mas_right);
+        make.top.equalTo(self.backgroundPreView.documentImageView.mas_top);
+        make.bottom.equalTo(self.backgroundPreView.documentImageView.mas_bottom);
+        make.left.equalTo(self.backgroundPreView.documentImageView.mas_left);
+        make.right.equalTo(self.backgroundPreView.documentImageView.mas_right);
     }];
 }
 
@@ -351,8 +351,8 @@
 - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary<UIImagePickerControllerInfoKey,id> *)info {
     UIImage *image = info[UIImagePickerControllerOriginalImage];
     CGSize size;
-    size.width = self.backgroundPreView.documentView.frame.size.width;
-    size.height = self.backgroundPreView.documentView.frame.size.height;
+    size.width = self.backgroundPreView.documentImageView.frame.size.width;
+    size.height = self.backgroundPreView.documentImageView.frame.size.height;
     _dataModel.image = [self imageWithImageSimple:image scaledToSize:_imageSize];
     [_backgroundPreView.preImageView sizeToFit];
     

PDFViewer/View/HeaderFooterView/PDFAddView.h → PDFViewer/Controller/PDFHeaderFooter/PDFAddView.h


PDFViewer/View/HeaderFooterView/PDFAddView.m → PDFViewer/Controller/PDFHeaderFooter/PDFAddView.m


+ 4 - 4
PDFViewer/Controller/HeaderFooter/PDFAddViewController.h

@@ -14,14 +14,14 @@ NS_ASSUME_NONNULL_BEGIN
 #define kFormat @"^[ ]+$"
 
 typedef NS_ENUM(NSInteger, PDFHeaderFooterLocation) {
-    PDFHeader = 0,
+    PDFHeaderFooterLocationHeader = 0,
     PDFFooter,
 };
 
 typedef NS_ENUM(NSInteger, PDFHeaderFooerAligment) {
-    PDFLeft = 0,
-    PDFCenter,
-    PDFRinght,
+    PDFHeaderFooerAligmentLeft = 0,
+    PDFHeaderFooerAligmentLeftCenter,
+    PDFHeaderFooerAligmentLeftRinght,
 };
 
 typedef struct PDFHeaderFooterPosition {

+ 22 - 22
PDFViewer/Controller/HeaderFooter/PDFAddViewController.m

@@ -64,7 +64,7 @@
 
 - (void)initHeadView {
     _headView = [[PDFHeadView alloc] init];
-    _headView.documentView.image = self.image;
+    _headView.documentImageView.image = self.image;
     [_headView setImage:self.image];
     [self.view addSubview:_headView];
 
@@ -186,7 +186,7 @@
 // Select headerfooter
 - (void)changeLocation:(UISegmentedControl *)sender {
     if (sender.selectedSegmentIndex == 0) {
-        _position.location = PDFHeader;
+        _position.location = PDFHeaderFooterLocationHeader;
     } else {
         _position.location = PDFFooter;
     }
@@ -196,11 +196,11 @@
 // Select aligment
 - (void)changeAligbment:(UISegmentedControl *)sender {
     if (sender.selectedSegmentIndex == 0) {
-        _position.aligment = PDFLeft;
+        _position.aligment = PDFHeaderFooerAligmentLeft;
     } else if (sender.selectedSegmentIndex == 1) {
-        _position.aligment = PDFCenter;
+        _position.aligment = PDFHeaderFooerAligmentLeftCenter;
     } else {
-        _position.aligment = PDFRinght;
+        _position.aligment = PDFHeaderFooerAligmentLeftRinght;
     }
     [self showPages];
 }
@@ -212,27 +212,27 @@
     }
     
     switch (self.position.location) {
-        case PDFHeader:
-            if (self.position.aligment == PDFLeft) {
+        case PDFHeaderFooterLocationHeader:
+            if (self.position.aligment == PDFHeaderFooerAligmentLeft) {
                 [_headView.preLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
-                    make.top.equalTo(self.headView.documentView.mas_top).offset(0.5);
-                    make.left.equalTo(self.headView.documentView.mas_left).offset(0.5);
+                    make.top.equalTo(self.headView.documentImageView.mas_top).offset(0.5);
+                    make.left.equalTo(self.headView.documentImageView.mas_left).offset(0.5);
                     make.height.mas_equalTo(10);
                     make.width.mas_equalTo(20);
                 }];
                 self.modelData.fontPosition = 0;
-            } else if (self.position.aligment == PDFCenter) {
+            } else if (self.position.aligment == PDFHeaderFooerAligmentLeftCenter) {
                 [_headView.preLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
-                    make.top.equalTo(self.headView.documentView.mas_top).offset(0.5);
-                    make.left.equalTo(self.headView.documentView.mas_left).offset(self.image.size.width / 18);
+                    make.top.equalTo(self.headView.documentImageView.mas_top).offset(0.5);
+                    make.left.equalTo(self.headView.documentImageView.mas_left).offset(self.image.size.width / 18);
                     make.height.mas_equalTo(10);
                     make.width.mas_equalTo(20);
                 }];
                 self.modelData.fontPosition = 1;
             } else {
                 [_headView.preLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
-                    make.top.equalTo(self.headView.documentView.mas_top).offset(0.5);
-                    make.left.equalTo(self.headView.documentView.mas_left).offset(self.image.size.width / 9 - 12);
+                    make.top.equalTo(self.headView.documentImageView.mas_top).offset(0.5);
+                    make.left.equalTo(self.headView.documentImageView.mas_left).offset(self.image.size.width / 9 - 12);
                     make.height.mas_equalTo(10);
                     make.width.mas_equalTo(20);
                 }];
@@ -241,26 +241,26 @@
             break;
             
         case PDFFooter:
-            if (self.position.aligment == PDFLeft) {
+            if (self.position.aligment == PDFHeaderFooerAligmentLeft) {
                 [_headView.preLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
-                    make.top.equalTo(self.headView.documentView.mas_top).offset(self.image.size.height / 9 - 12);
-                    make.left.equalTo(self.headView.documentView.mas_left).offset(0.5);
+                    make.top.equalTo(self.headView.documentImageView.mas_top).offset(self.image.size.height / 9 - 12);
+                    make.left.equalTo(self.headView.documentImageView.mas_left).offset(0.5);
                     make.height.mas_equalTo(10);
                     make.width.mas_equalTo(20);
                 }];
                 self.modelData.fontPosition = 3;
-            } else if (self.position.aligment == PDFCenter) {
+            } else if (self.position.aligment == PDFHeaderFooerAligmentLeftCenter) {
                 [_headView.preLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
-                    make.top.equalTo(self.headView.documentView.mas_top).offset(self.image.size.height / 9 - 12);
-                    make.left.equalTo(self.headView.documentView.mas_left).offset(self.image.size.width / 18);
+                    make.top.equalTo(self.headView.documentImageView.mas_top).offset(self.image.size.height / 9 - 12);
+                    make.left.equalTo(self.headView.documentImageView.mas_left).offset(self.image.size.width / 18);
                     make.height.mas_equalTo(10);
                     make.width.mas_equalTo(20);
                 }];
                 self.modelData.fontPosition = 4;
             } else {
                 [_headView.preLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
-                    make.top.equalTo(self.headView.documentView.mas_top).offset(self.image.size.height / 9 - 12);
-                    make.left.equalTo(self.headView.documentView.mas_left).offset(self.image.size.width / 9 - 12);
+                    make.top.equalTo(self.headView.documentImageView.mas_top).offset(self.image.size.height / 9 - 12);
+                    make.left.equalTo(self.headView.documentImageView.mas_left).offset(self.image.size.width / 9 - 12);
                     make.height.mas_equalTo(10);
                     make.width.mas_equalTo(20);
                 }];

PDFViewer/Controller/HeaderFooter/PDFAddViewControllerHeader.h → PDFViewer/Controller/PDFHeaderFooter/PDFAddViewControllerHeader.h


PDFViewer/View/HeaderFooterView/PDFBatesAddView.h → PDFViewer/Controller/PDFHeaderFooter/PDFBatesAddView.h


PDFViewer/View/HeaderFooterView/PDFBatesAddView.m → PDFViewer/Controller/PDFHeaderFooter/PDFBatesAddView.m


+ 0 - 1
PDFViewer/Controller/HeaderFooter/PDFBatesAddViewController.h

@@ -8,7 +8,6 @@
 #import <UIKit/UIKit.h>
 #import "PDFBatesAddView.h"
 #import "PDFHeaderFooterAddController.h"
-#import "PDFAddWaterMarkViewController.h"
 
 NS_ASSUME_NONNULL_BEGIN
 

PDFViewer/Controller/HeaderFooter/PDFBatesAddViewController.m → PDFViewer/Controller/PDFHeaderFooter/PDFBatesAddViewController.m


PDFViewer/View/HeaderFooterView/PDFHeadView.h → PDFViewer/Controller/PDFHeaderFooter/PDFHeadView.h


+ 4 - 4
PDFViewer/View/HeaderFooterView/PDFHeadView.m

@@ -16,7 +16,7 @@
         self.preLabel = [[UILabel alloc] init];
         [self.preLabel setText:@"1"];
         self.preLabel.font = [UIFont systemFontOfSize:6];
-        [self.documentView addSubview:self.preLabel];
+        [self.documentImageView addSubview:self.preLabel];
     }
     return self;
 }
@@ -24,7 +24,7 @@
 - (void)drawRect:(CGRect)rect {
     [super drawRect:rect];
     
-    [self.documentView mas_makeConstraints:^(MASConstraintMaker *make) {
+    [self.documentImageView mas_makeConstraints:^(MASConstraintMaker *make) {
         make.top.equalTo(self.mas_top);
         make.left.equalTo(self.mas_left);
         make.width.mas_equalTo(self.image.size.width / 9);
@@ -32,8 +32,8 @@
     }];
     
     [self.preLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
-        make.top.equalTo(self.documentView.mas_top).offset(0.5);
-        make.left.equalTo(self.documentView.mas_left).offset(0.5);
+        make.top.equalTo(self.documentImageView.mas_top).offset(0.5);
+        make.left.equalTo(self.documentImageView.mas_left).offset(0.5);
         make.height.mas_equalTo(10);
         make.width.mas_equalTo(20);
     }];

PDFViewer/Controller/HeaderFooter/PDFHeaderFooterAddController.h → PDFViewer/Controller/PDFHeaderFooter/PDFHeaderFooterAddController.h


PDFViewer/Controller/HeaderFooter/PDFHeaderFooterAddController.m → PDFViewer/Controller/PDFHeaderFooter/PDFHeaderFooterAddController.m


PDFViewer/View/HeaderFooterView/PDFHeaderFooterAddView.h → PDFViewer/Controller/PDFHeaderFooter/PDFHeaderFooterAddView.h


PDFViewer/View/HeaderFooterView/PDFHeaderFooterAddView.m → PDFViewer/Controller/PDFHeaderFooter/PDFHeaderFooterAddView.m


+ 1 - 1
PDFViewer/View/HeaderFooterView/PDFSettingView.h

@@ -10,7 +10,7 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
-@interface PDFSettingView : UIView
+@interface PDFHeaderFooterSettingView : UIView
 
 @property (nonatomic,strong) UILabel *settinigLabel;
 @property (nonatomic,strong) UIButton *addButton;

+ 2 - 2
PDFViewer/View/HeaderFooterView/PDFSettingView.m

@@ -5,9 +5,9 @@
 //  Created by kdanmobile_2 on 2022/12/13.
 //
 
-#import "PDFSettingView.h"
+#import "PDFHeaderFooterSettingView.h"
 
-@implementation PDFSettingView
+@implementation PDFHeaderFooterSettingView
 
 - (instancetype)initWithFrame:(CGRect)frame {
     self = [super initWithFrame:frame];

PDFViewer/View/HeaderFooterView/PDFHeaderFooterTextTableView.h → PDFViewer/Controller/PDFHeaderFooter/PDFHeaderFooterTextTableView.h


PDFViewer/View/HeaderFooterView/PDFHeaderFooterTextTableView.m → PDFViewer/Controller/PDFHeaderFooter/PDFHeaderFooterTextTableView.m


+ 5 - 5
PDFViewer/Controller/PDFImageViewController.h

@@ -6,16 +6,16 @@
 //
 
 #import <UIKit/UIKit.h>
-#import "PDFImageView.h"
-#import "PDFImagePreview.h"
+#import "PDFWatermarkImageView.h"
+#import "PDFWatermarkImagePreview.h"
 #import "PDFWatermarkViewController.h"
 
 NS_ASSUME_NONNULL_BEGIN
 
-@interface PDFImageViewController : PDFWatermarkViewController
+@interface PDFImageWatermarkController : PDFWatermarkViewController
 
-@property (nonatomic,strong) PDFImagePreview *imagePreview;
-@property (nonatomic,strong) PDFImageView *imageView;
+@property (nonatomic,strong) PDFWatermarkImagePreview *imagePreview;
+@property (nonatomic,strong) PDFWatermarkImageView *imageView;
 
 - (UIImage *)imageWithImageSimple:(UIImage *)image scaledToSize:(CGSize)newSize;
 

+ 23 - 23
PDFViewer/Controller/PDFImageViewController.m

@@ -5,21 +5,21 @@
 //  Created by kdan on 2022/11/19.
 //
 
-#import "PDFImageViewController.h"
-#import "PDFImageView.h"
-#import "PDFImagePreview.h"
+#import "PDFImageWatermarkController.h"
+#import "PDFWatermarkImageView.h"
+#import "PDFWatermarkImagePreview.h"
 #import "PDFDataModel.h"
-#import "PDFDrawView.h"
-#import "PDFClipView.h"
+#import "PDFWatermarkDrawView.h"
+#import "PDFWatermarkClipView.h"
 #import "PDFWatermarkControllerHeader.h"
 #import "Masonry.h"
 
-@interface PDFImageViewController () <UIImagePickerControllerDelegate,UINavigationControllerDelegate,UITextFieldDelegate>
+@interface PDFImageWatermarkController () <UIImagePickerControllerDelegate,UINavigationControllerDelegate,UITextFieldDelegate>
 
 @property (nonatomic,assign) CGRect watermarkFrame;
 
-@property (nonatomic,strong) PDFDrawView *drawView;
-@property (nonatomic,strong) PDFClipView *cliView;
+@property (nonatomic,strong) PDFWatermarkDrawView *drawView;
+@property (nonatomic,strong) PDFWatermarkClipView *cliView;
 @property (nonatomic,assign) CGAffineTransform transform1;
 @property (nonatomic,assign) CGAffineTransform transform2;
 @property (nonatomic,assign) CGRect normalWatermarkRect;
@@ -27,15 +27,15 @@
 
 @end
 
-@implementation PDFImageViewController
+@implementation PDFImageWatermarkController
 
 #pragma mark - UIViewController Methods
 
 - (void)viewDidLoad {
     [super viewDidLoad];
     // Do any additional setup after loading the view.
-    _imagePreview = [[PDFImagePreview alloc] init];
-    _imageView = [[PDFImageView alloc] init];
+    _imagePreview = [[PDFWatermarkImagePreview alloc] init];
+    _imageView = [[PDFWatermarkImageView alloc] init];
     
     _imageView.verticalField.delegate = self;
     _imageView.horizontalField.delegate = self;
@@ -180,7 +180,7 @@
 #pragma mark - Gesture
 
 - (void)createGestureRecognizer {
-    [_imagePreview.documentView setUserInteractionEnabled:YES];
+    [_imagePreview.documentImageView setUserInteractionEnabled:YES];
     [_imagePreview.preImageView setMultipleTouchEnabled:YES];
     [_imagePreview.preImageView setUserInteractionEnabled:YES];
     [_imagePreview.rotationBtn setUserInteractionEnabled:YES];
@@ -207,10 +207,10 @@
 }
 
 - (void)panWatermarkView:(UIPanGestureRecognizer *)recognizer {
-    CGPoint point = [recognizer translationInView:_imagePreview.documentView];
-    CGRect documentFrame = _imagePreview.documentView.frame;
-    documentFrame.origin.x -= _imagePreview.documentView.frame.origin.x;
-    documentFrame.origin.y -= _imagePreview.documentView.frame.origin.y;
+    CGPoint point = [recognizer translationInView:_imagePreview.documentImageView];
+    CGRect documentFrame = _imagePreview.documentImageView.frame;
+    documentFrame.origin.x -= _imagePreview.documentImageView.frame.origin.x;
+    documentFrame.origin.y -= _imagePreview.documentImageView.frame.origin.y;
     
     [_imagePreview.preImageView setCenter:CGPointMake(_imagePreview.preImageView.center.x + point.x, _imagePreview.preImageView.center.y + point.y)];
     [_imagePreview.rotationBtn setCenter:CGPointMake(_imagePreview.rotationBtn.center.x + point.x, _imagePreview.rotationBtn.center.y + point.y)];
@@ -220,12 +220,12 @@
         [_imagePreview.rotationBtn setCenter:CGPointMake(_imagePreview.rotationBtn.center.x - point.x, _imagePreview.rotationBtn.center.y - point.y)];
     }
     
-    self.dataModel.tx = _imagePreview.preImageView.center.x - (_imagePreview.documentView.center.x - _imagePreview.documentView.frame.origin.x);
-    self.dataModel.ty = _imagePreview.documentView.center.y - _imagePreview.documentView.frame.origin.y - _imagePreview.preImageView.center.y;
+    self.dataModel.tx = _imagePreview.preImageView.center.x - (_imagePreview.documentImageView.center.x - _imagePreview.documentImageView.frame.origin.x);
+    self.dataModel.ty = _imagePreview.documentImageView.center.y - _imagePreview.documentImageView.frame.origin.y - _imagePreview.preImageView.center.y;
     
     _shadowWaterLabel.center = _imagePreview.preImageView.center;
     
-    [recognizer setTranslation:CGPointZero inView:_imagePreview.documentView];
+    [recognizer setTranslation:CGPointZero inView:_imagePreview.documentImageView];
     
     _normalWatermarkRect = _shadowWaterLabel.frame;
 }
@@ -290,17 +290,17 @@
         _imageView.verticalField.enabled = YES;
         _imageView.imageScaleSlider.enabled = NO;
         
-        _drawView = [[PDFDrawView alloc] initWithFrame:self.imagePreview.bounds];
+        _drawView = [[PDFWatermarkDrawView alloc] initWithFrame:self.imagePreview.bounds];
         
         [_drawView setDataModel:self.dataModel];
         [_drawView setWaterLabelRect:self.normalWatermarkRect];
-        [_drawView setDocumentViewRect:self.imagePreview.documentView.frame];
+        [_drawView setDocumentViewRect:self.imagePreview.documentImageView.frame];
         
         [self.view addSubview:_drawView];
         [self.imagePreview bringSubviewToFront:_drawView];
         
-        _cliView = [[PDFClipView alloc] initWithFrame:self.imagePreview.bounds];
-        [_cliView setDocumentRect:self.imagePreview.documentView.frame];
+        _cliView = [[PDFWatermarkClipView alloc] initWithFrame:self.imagePreview.bounds];
+        [_cliView setDocumentRect:self.imagePreview.documentImageView.frame];
         [self.view addSubview:_cliView];
         [self.drawView bringSubviewToFront:_cliView];
         

+ 1 - 1
PDFViewer/View/PDFPreView.h

@@ -11,7 +11,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 @interface PDFPreView : UIView
 
-@property (nonatomic,strong) UIImageView *documentView;
+@property (nonatomic,strong) UIImageView *documentImageView;
 @property (nonatomic,strong) UILabel *preLabel;
 @property (nonatomic,strong) UIImageView *preImageView;
 

+ 3 - 3
PDFViewer/View/PDFPreView.m

@@ -12,9 +12,9 @@
 - (instancetype)initWithFrame:(CGRect)frame {
     
     if (self = [super initWithFrame:frame]) {
-        _documentView = [[UIImageView alloc] init];
+        _documentImageView = [[UIImageView alloc] init];
         
-        CALayer *layer = [_documentView layer];
+        CALayer *layer = [_documentImageView layer];
         layer.borderColor = [[UIColor blackColor] CGColor];
         layer.borderWidth = 0.2f;
         
@@ -22,7 +22,7 @@
         
         _preImageView = [[UIImageView alloc] init];
         
-        [self addSubview:_documentView];
+        [self addSubview:_documentImageView];
     }
     
     return self;

+ 0 - 22
PDFViewer/Controller/PDFTextViewController.h

@@ -1,22 +0,0 @@
-//
-//  CPDFTextViewController.h
-//  PDFViewer
-//
-//  Created by kdan on 2022/11/19.
-//
-
-#import <UIKit/UIKit.h>
-#import "PDFTextView.h"
-#import "PDFTextPreview.h"
-#import "PDFWatermarkViewController.h"
-
-NS_ASSUME_NONNULL_BEGIN
-
-@interface PDFTextViewController : PDFWatermarkViewController
-
-@property (nonatomic,strong) PDFTextPreview *textPreview;
-@property (nonatomic,strong) PDFTextView *textView;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 22 - 0
PDFViewer/Controller/PDFTextWatermarkController.h

@@ -0,0 +1,22 @@
+//
+//  CPDFTextViewController.h
+//  PDFViewer
+//
+//  Created by kdan on 2022/11/19.
+//
+
+#import <UIKit/UIKit.h>
+#import "PDFWatermarkTextView.h"
+#import "PDFWatermarkTextPreview.h"
+#import "PDFWatermarkViewController.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface PDFTextWatermarkController : PDFWatermarkViewController
+
+@property (nonatomic,strong) PDFWatermarkTextPreview *textPreview;
+@property (nonatomic,strong) PDFWatermarkTextView *textView;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 24 - 24
PDFViewer/Controller/PDFTextViewController.m

@@ -5,25 +5,25 @@
 //  Created by kdan on 2022/11/19.
 //
 
-#import "PDFTextViewController.h"
-#import "PDFTextView.h"
+#import "PDFTextWatermarkController.h"
+#import "PDFWatermarkTextView.h"
 #import "PDFDataModel.h"
-#import "PDFDrawView.h"
-#import "PDFClipView.h"
+#import "PDFWatermarkDrawView.h"
+#import "PDFWatermarkClipView.h"
 #import "Masonry.h"
 #import "PDFWatermarkControllerHeader.h"
 
-@interface PDFTextViewController () <UITextFieldDelegate>
+@interface PDFTextWatermarkController () <UITextFieldDelegate>
 
 @property (nonatomic,strong) UIAlertController *alertController;
-@property (nonatomic,strong) PDFDrawView *drawView;
-@property (nonatomic,strong) PDFClipView *cliView;
+@property (nonatomic,strong) PDFWatermarkDrawView *drawView;
+@property (nonatomic,strong) PDFWatermarkClipView *cliView;
 @property (nonatomic,assign) CGRect normalWatermarkRect;
 @property (nonatomic,strong) UILabel *shadowWaterLabel;
 
 @end
 
-@implementation PDFTextViewController
+@implementation PDFTextWatermarkController
 
 #pragma mark - UIViewController Methods
 
@@ -31,8 +31,8 @@
     [super viewDidLoad];
     // Do any additional setup after loading the view.
     
-    _textPreview = [[PDFTextPreview alloc] init];
-    _textView = [[PDFTextView alloc] init];
+    _textPreview = [[PDFWatermarkTextPreview alloc] init];
+    _textView = [[PDFWatermarkTextView alloc] init];
     
     _textView.verticalField.delegate = self;
     _textView.horizontalField.delegate = self;
@@ -93,7 +93,7 @@
         [_textView.colorArray[i] addTarget:self action:@selector(onColorBtnClicked:) forControlEvents:UIControlEventTouchDown];
     }
     
-    __block PDFTextViewController *strongBlock = self;
+    __block PDFTextWatermarkController *strongBlock = self;
     [_alertController addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {
         
     }];
@@ -153,17 +153,17 @@
         _textView.verticalField.enabled = YES;
         _textView.textScaleSlider.enabled = NO;
         
-        self.drawView = [[PDFDrawView alloc] initWithFrame:self.textPreview.bounds];
+        self.drawView = [[PDFWatermarkDrawView alloc] initWithFrame:self.textPreview.bounds];
         
         [self.drawView setDataModel:self.dataModel];
         [self.drawView setWaterLabelRect:self.normalWatermarkRect];
-        [self.drawView setDocumentViewRect:self.textPreview.documentView.frame];
+        [self.drawView setDocumentViewRect:self.textPreview.documentImageView.frame];
         
         [self.view addSubview:self.drawView];
         [self.textPreview bringSubviewToFront:self.drawView];
         
-        self.cliView = [[PDFClipView alloc] initWithFrame:self.textPreview.bounds];
-        [self.cliView setDocumentRect:self.textPreview.documentView.frame];
+        self.cliView = [[PDFWatermarkClipView alloc] initWithFrame:self.textPreview.bounds];
+        [self.cliView setDocumentRect:self.textPreview.documentImageView.frame];
         [self.view addSubview:self.cliView];
         [self.drawView bringSubviewToFront:self.cliView];
         
@@ -194,7 +194,7 @@
 #pragma mark - Gesture
 
 - (void)createGestureRecognizer {
-    [_textPreview.documentView setUserInteractionEnabled:YES];
+    [_textPreview.documentImageView setUserInteractionEnabled:YES];
     [_textPreview.preLabel setUserInteractionEnabled:YES];
     [_textPreview.rotationBtn setUserInteractionEnabled:YES];
       
@@ -215,10 +215,10 @@
 }
 
 - (void)panWatermarkLabel:(UIPanGestureRecognizer *)recognizer {
-    CGPoint point = [recognizer translationInView:_textPreview.documentView];
-    CGRect documentFrame = _textPreview.documentView.frame;
-    documentFrame.origin.x -= _textPreview.documentView.frame.origin.x;
-    documentFrame.origin.y -= _textPreview.documentView.frame.origin.y;
+    CGPoint point = [recognizer translationInView:_textPreview.documentImageView];
+    CGRect documentFrame = _textPreview.documentImageView.frame;
+    documentFrame.origin.x -= _textPreview.documentImageView.frame.origin.x;
+    documentFrame.origin.y -= _textPreview.documentImageView.frame.origin.y;
     
     [_textPreview.preLabel setCenter:CGPointMake(_textPreview.preLabel.center.x + point.x, _textPreview.preLabel.center.y + point.y)];
     [_textPreview.rotationBtn setCenter:CGPointMake(_textPreview.rotationBtn.center.x + point.x, _textPreview.rotationBtn.center.y + point.y)];
@@ -228,9 +228,9 @@
         [_textPreview.rotationBtn setCenter:CGPointMake(_textPreview.rotationBtn.center.x - point.x, _textPreview.rotationBtn.center.y - point.y)];
     }
     
-    self.dataModel.tx = _textPreview.preLabel.center.x - (_textPreview.documentView.center.x - _textPreview.documentView.frame.origin.x);
-    self.dataModel.ty = _textPreview.documentView.center.y - _textPreview.documentView.frame.origin.y - _textPreview.preLabel.center.y;
-    [recognizer setTranslation:CGPointZero inView:_textPreview.documentView];
+    self.dataModel.tx = _textPreview.preLabel.center.x - (_textPreview.documentImageView.center.x - _textPreview.documentImageView.frame.origin.x);
+    self.dataModel.ty = _textPreview.documentImageView.center.y - _textPreview.documentImageView.frame.origin.y - _textPreview.preLabel.center.y;
+    [recognizer setTranslation:CGPointZero inView:_textPreview.documentImageView];
     self.shadowWaterLabel.center = _textPreview.preLabel.center;
     
     self.normalWatermarkRect = self.shadowWaterLabel.frame;
@@ -325,7 +325,7 @@
 - (void)clipText:(CGContextRef)context {
     CGContextSetFillColorWithColor(context, [UIColor systemGray5Color].CGColor);
     CGContextFillRect(context, self.textPreview.bounds);
-    CGContextClearRect(context, self.textPreview.documentView.frame);
+    CGContextClearRect(context, self.textPreview.documentImageView.frame);
 }
 
 #pragma mark - UITextFieldDelegate

+ 80 - 87
PDFViewer/Controller/PDFViewController.m

@@ -10,8 +10,8 @@
 #import <ComPDFKit/CPDFWatermark.h>
 #import <ComPDFKit/CPDFHeaderFooter.h>
 #import "PDFViewController.h"
-#import "PDFTextPreview.h"
-#import "PDFImagePreview.h"
+#import "PDFWatermarkTextPreview.h"
+#import "PDFWatermarkImagePreview.h"
 #import "PDFDataModel.h"
 #import "PDFBackgroundModel.h"
 #import "Masonry.h"
@@ -19,7 +19,7 @@
 #import "PDFBackgroundSettingViewController.h"
 #import "PDFHeaderFooterAddController.h"
 #import "PDFBatesAddViewController.h"
-#import "PDFSettingView.h"
+#import "PDFHeaderFooterSettingView.h"
 
 @interface PDFViewController () <UIActionSheetDelegate,WaterMarkModelDataDelegate,BackgroundDataModelDelegate,PDFModelDataDelegate>
 
@@ -27,8 +27,8 @@
 @property (nonatomic,strong) CPDFDocument *pdfDocument;
 @property (nonatomic,strong) PDFAddWaterMarkViewController *addWaterMarkViewController;
 @property (nonatomic,strong) UIImage *image;
-@property (nonatomic,strong) PDFSettingView *headerFooterSetting;
-@property (nonatomic,strong) PDFSettingView *batesSetting;
+@property (nonatomic,strong) PDFHeaderFooterSettingView *headerFooterSetting;
+@property (nonatomic,strong) PDFHeaderFooterSettingView *batesSetting;
 
 @end
 
@@ -66,10 +66,10 @@
     CGSize imageSize = [_pdfView.document pageSizeAtIndex:0];
     _image = [pdfPage thumbnailOfSize:imageSize];
     
-    _headerFooterSetting = [[PDFSettingView alloc] init];
+    _headerFooterSetting = [[PDFHeaderFooterSettingView alloc] init];
     [_headerFooterSetting setText];
     
-    _batesSetting = [[PDFSettingView alloc] init];
+    _batesSetting = [[PDFHeaderFooterSettingView alloc] init];
     [_batesSetting setText];
 }
 
@@ -77,7 +77,7 @@
 
 - (void)PDFViewPerformOnClickedOkbtn {
     UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
-    UIAlertAction *addWatermarkAction = [UIAlertAction actionWithTitle:@"Add Watermark" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+    UIAlertAction *addWatermarkAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Add Watermark",nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
         self.addWaterMarkViewController = [[PDFAddWaterMarkViewController alloc] initWithDocument:self.pdfDocument];
         self.addWaterMarkViewController.delegate = self;
         
@@ -85,16 +85,16 @@
         }];
     
     // Setting headerfooter action
-    UIAlertAction *settingHeaderFooter = [UIAlertAction actionWithTitle:@"Setting Headerfooter" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+    UIAlertAction *settingHeaderFooter = [UIAlertAction actionWithTitle:NSLocalizedString(@"Setting Headerfooter", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
         [self PDFViewPerformSettingHeaderFooter];
        }];
     
     // Seeting bates action
-    UIAlertAction *settingBatesAction = [UIAlertAction actionWithTitle:@"Setting Bates" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+    UIAlertAction *settingBatesAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Setting Bates",nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
         [self PDFViewPerformSettingBates];
        }];
     
-    UIAlertAction *addBackgroundAction = [UIAlertAction actionWithTitle:@"Add Background" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+    UIAlertAction *addBackgroundAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Add Background", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
         PDFBackgroundSettingViewController * addBackgroundViewController = [[PDFBackgroundSettingViewController alloc] initWithDocument:self.pdfDocument];
         addBackgroundViewController.delegate = self;
         
@@ -102,9 +102,7 @@
         
         }];
     
-    UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
-            
-        }];
+    UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil) style:UIAlertActionStyleCancel handler:nil];
     
     [alertController addAction:addWatermarkAction];
     [alertController addAction:settingHeaderFooter];
@@ -195,15 +193,13 @@
 
 // Detele headerfootr action
 - (void)PDFViewPerformDeleteHeaderFooterAction {
-    UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Delete Page Number" message:@"Are you sure delete all pages number" preferredStyle:UIAlertControllerStyleAlert];
+    UIAlertController *alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"Delete Page Number", nil) message:NSLocalizedString(@"Are you sure delete all pages number", nil) preferredStyle:UIAlertControllerStyleAlert];
     
-    UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+    UIAlertAction *okAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
         [self PDFViewPerformDeleteHeaderFooter];
         }];
     
-    UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
-        NSLog(@"Cancel Action");
-        }];
+    UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel",nil) style:UIAlertActionStyleCancel handler:nil];
     
     [alertController addAction:okAction];
     [alertController addAction:cancelAction];
@@ -213,16 +209,14 @@
 
 // Delete bates action
 - (void)PDFViewPerformDeleteBatesAction {
-    UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Delete Bates" message:@"Are you sure delete all Bates" preferredStyle:UIAlertControllerStyleAlert];
+    UIAlertController *alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"Delete Bates", nil) message:NSLocalizedString(@"Are you sure delete all Bates",nil) preferredStyle:UIAlertControllerStyleAlert];
     
-    UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+    UIAlertAction *okAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
         
         [self PDFViewPerformDeleteBates];
         }];
     
-    UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
-        NSLog(@"Cancel Action");
-        }];
+    UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil) style:UIAlertActionStyleCancel handler:nil];
     
     [alertController addAction:okAction];
     [alertController addAction:cancelAction];
@@ -265,15 +259,7 @@
     [headerFooter setTextColor:modelData.fontColor atIndex:modelData.fontPosition];
     [headerFooter update];
 
-    NSURL *url = [NSURL fileURLWithPath:self.path];
-    [self.pdfDocument writeToURL:url];
-    
-    _pdfDocument = [[CPDFDocument alloc] initWithURL:url];
-    _pdfView = [[CPDFView alloc] initWithFrame:self.view.bounds];
-    _pdfView.document = _pdfDocument;
-    _pdfView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-
-   [self.view addSubview:_pdfView];
+    [self pdfViewUpdate];
 }
 
 // Get bates' model to setting page bates's add functional property
@@ -291,15 +277,60 @@
     [bates setTextColor:modelBatesData.fontColor atIndex:modelBatesData.fontPosition];
     [bates update];
     
-    NSURL *url = [NSURL fileURLWithPath:self.path];
-    [self.pdfDocument writeToURL:url];
-    
+    [self pdfViewUpdate];
+}
+
+#pragma mark - PDF View Update
+
+- (void)pdfViewUpdate {
+    [self.pdfView.document writeToURL:self.pdfView.document.documentURL];
+    [self loadDocumentWithFilePath:self.pdfView.document.documentURL.path completion:nil];
+}
+
+- (void)pdfViewDelete {
+    NSURL *url = [NSURL fileURLWithPath:_path];
+    [_pdfView.document writeToURL:url];
+
     _pdfDocument = [[CPDFDocument alloc] initWithURL:url];
     _pdfView = [[CPDFView alloc] initWithFrame:self.view.bounds];
     _pdfView.document = _pdfDocument;
     _pdfView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-    
-   [self.view addSubview:_pdfView];
+    [self.view addSubview:_pdfView];
+}
+
+- (void)loadDocumentWithFilePath:(NSString *)filePath completion:(void (^)(BOOL result))completion {
+    self.title = [[filePath lastPathComponent] stringByDeletingPathExtension];
+    
+    self.pdfView.document = nil;
+
+    [self.navigationController.view setUserInteractionEnabled:NO];
+    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+        NSURL *url = [NSURL fileURLWithPath:self.path];
+        CPDFDocument *document = [[CPDFDocument alloc] initWithURL:url];
+        dispatch_async(dispatch_get_main_queue(), ^{
+            [self.navigationController.view setUserInteractionEnabled:YES];
+            if (document.error && document.error.code != CPDFDocumentPasswordError) {
+                UIAlertAction *okAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+                    [self.navigationController popViewControllerAnimated:YES];
+                }];
+                UIAlertController *alert = [UIAlertController alertControllerWithTitle:@""
+                                                                               message:NSLocalizedString(@"Sorry PDF Reader Can't open this pdf file!", nil)
+                                                                        preferredStyle:UIAlertControllerStyleAlert];
+                [alert addAction:okAction];
+                [self presentViewController:alert animated:YES completion:nil];
+                
+                if (completion) {
+                    completion(NO);
+                }
+            } else {
+                self.pdfView.document = document;
+                
+                if (completion) {
+                    completion(YES);
+                }
+            }
+        });
+    });
 }
 
 #pragma mark - Delete Methods
@@ -309,14 +340,7 @@
     CPDFHeaderFooter *headerFooter = [self.pdfDocument headerFooter];
     [headerFooter clear];
     
-    NSURL *url = [NSURL fileURLWithPath:self.path];
-    [self.pdfDocument writeToURL:url];
-    _pdfDocument = [[CPDFDocument alloc] initWithURL:url];
-    _pdfView = [[CPDFView alloc] initWithFrame:self.view.bounds];
-    _pdfView.document = _pdfDocument;
-    _pdfView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-    
-   [self.view addSubview:_pdfView];
+    [self pdfViewDelete];
 }
 
 // Get bates' model to setting page bates's delete functional property
@@ -324,14 +348,7 @@
     CPDFBates *bates = [self.pdfDocument bates];
     [bates clear];
     
-    NSURL *url = [NSURL fileURLWithPath:self.path];
-    [self.pdfDocument writeToURL:url];
-    _pdfDocument = [[CPDFDocument alloc] initWithURL:url];
-    _pdfView = [[CPDFView alloc] initWithFrame:self.view.bounds];
-    _pdfView.document = _pdfDocument;
-    _pdfView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-    
-   [self.view addSubview:_pdfView];
+    [self pdfViewDelete];
 }
 
 #pragma mark - WaterMarkModelDataDelegate
@@ -348,8 +365,8 @@
     
     textWatermark.isTilePage = dataModel.isTile;
     
-    textWatermark.tx = dataModel.tx * (_image.size.width / 3) / self.addWaterMarkViewController.textViewController.textPreview.documentView.frame.size.width;
-    textWatermark.ty = dataModel.ty * (_image.size.height / 3) / self.addWaterMarkViewController.textViewController.textPreview.documentView.frame.size.height;
+    textWatermark.tx = dataModel.tx * (_image.size.width / 3) / self.addWaterMarkViewController.textViewController.textPreview.documentImageView.frame.size.width;
+    textWatermark.ty = dataModel.ty * (_image.size.height / 3) / self.addWaterMarkViewController.textViewController.textPreview.documentImageView.frame.size.height;
     
     textWatermark.rotation = dataModel.watermarkRotation;
     
@@ -363,9 +380,7 @@
     }
     
     [_pdfView.document addWatermark:textWatermark];
-    [_pdfView layoutDocumentView];
-    NSURL *url = [NSURL fileURLWithPath:_path];
-    [_pdfView.document writeToURL:url];
+    [self pdfViewUpdate];
 }
 
 - (void)PDFViewPerformChangeImageWatermark:(PDFDataModel *)dataModel {
@@ -379,8 +394,8 @@
     
     imageWatermark.isTilePage = dataModel.isTile;
     
-    imageWatermark.tx = dataModel.tx * (_image.size.width / 3) / self.addWaterMarkViewController.imageViewController.imagePreview.documentView.frame.size.width;
-    imageWatermark.ty = dataModel.ty * (_image.size.height / 3) / self.addWaterMarkViewController.imageViewController.imagePreview.documentView.frame.size.height;
+    imageWatermark.tx = dataModel.tx * (_image.size.width / 3) / self.addWaterMarkViewController.imageViewController.imagePreview.documentImageView.frame.size.width;
+    imageWatermark.ty = dataModel.ty * (_image.size.height / 3) / self.addWaterMarkViewController.imageViewController.imagePreview.documentImageView.frame.size.height;
     
     imageWatermark.rotation = dataModel.watermarkRotation;
     
@@ -394,21 +409,13 @@
     }
     
     [_pdfView.document addWatermark:imageWatermark];
-    [_pdfView layoutDocumentView];
-    NSURL *url = [NSURL fileURLWithPath:_path];
-    [_pdfView.document writeContentToURL:url];
+    [self pdfViewUpdate];
 }
 
 - (void)PDFViewPerformDeleteWatermark:(CPDFWatermark *)waterMark {
     [self.pdfDocument removeWatermark:waterMark];
-    NSURL *url = [NSURL fileURLWithPath:_path];
-    [_pdfView.document writeToURL:url];
     
-    _pdfDocument = [[CPDFDocument alloc] initWithURL:url];
-    _pdfView = [[CPDFView alloc] initWithFrame:self.view.bounds];
-    _pdfView.document = _pdfDocument;
-    _pdfView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-    [self.view addSubview:_pdfView];
+    [self pdfViewDelete];
 }
 
 #pragma mark - BackgroundDataModelDelegate
@@ -429,14 +436,7 @@
     
     [pageBackground update];
     
-    NSURL *url = [NSURL fileURLWithPath:_path];
-    [_pdfView.document writeToURL:url];
-    
-    _pdfDocument = [[CPDFDocument alloc] initWithURL:url];
-    _pdfView = [[CPDFView alloc] initWithFrame:self.view.bounds];
-    _pdfView.document = _pdfDocument;
-    _pdfView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-    [self.view addSubview:_pdfView];
+    [self pdfViewUpdate];
 }
 
 - (void)PDFViewPerformDeleteBackground {
@@ -444,14 +444,7 @@
     
     [pageBackground clear];
     
-    NSURL *url = [NSURL fileURLWithPath:_path];
-    [_pdfView.document writeToURL:url];
-    
-    _pdfDocument = [[CPDFDocument alloc] initWithURL:url];
-    _pdfView = [[CPDFView alloc] initWithFrame:self.view.bounds];
-    _pdfView.document = _pdfDocument;
-    _pdfView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-    [self.view addSubview:_pdfView];
+    [self pdfViewDelete];
 }
 
 @end