Jelajahi Sumber

161222

finish pdf edit
Ray Zhang 9 tahun lalu
induk
melakukan
c0407a11e7
20 mengubah file dengan 1470 tambahan dan 170 penghapusan
  1. 14 4
      Ants Contract/AntsContract/AntsContract.xcodeproj/project.pbxproj
  2. TEMPAT SAMPAH
      Ants Contract/AntsContract/AntsContract.xcodeproj/project.xcworkspace/xcuserdata/Ray.xcuserdatad/UserInterfaceState.xcuserstate
  3. 23 0
      Ants Contract/AntsContract/AntsContract.xcodeproj/project.xcworkspace/xcuserdata/Ray.xcuserdatad/xcdebugger/Expressions.xcexplist
  4. 404 36
      Ants Contract/AntsContract/AntsContract.xcodeproj/xcuserdata/Ray.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
  5. 24 5
      Ants Contract/AntsContract/AntsContract/Base.lproj/Main.storyboard
  6. 19 0
      Ants Contract/AntsContract/AntsContract/CheckSelectorViewController.h
  7. 155 0
      Ants Contract/AntsContract/AntsContract/CheckSelectorViewController.m
  8. 4 0
      Ants Contract/AntsContract/AntsContract/DocumentPageViewController.h
  9. 3 8
      Ants Contract/AntsContract/AntsContract/DocumentPageViewController.m
  10. 519 0
      Ants Contract/AntsContract/AntsContract/GEIC - Home Improvement Contract 2016.json
  11. TEMPAT SAMPAH
      Ants Contract/AntsContract/AntsContract/GEIC - Home Improvement Contract 2016.pdf
  12. 66 3
      Ants Contract/AntsContract/AntsContract/PDFPageView.m
  13. 179 102
      Ants Contract/AntsContract/AntsContract/PageViewController.m
  14. 2 0
      Ants Contract/AntsContract/AntsContract/RootViewController.h
  15. 12 9
      Ants Contract/AntsContract/AntsContract/RootViewController.m
  16. 35 0
      Ants Contract/AntsContract/AntsContract/SUBCONTRACTORS REFERRAL LIST.json
  17. TEMPAT SAMPAH
      Ants Contract/AntsContract/AntsContract/SUBCONTRACTORS REFERRAL LIST.pdf
  18. 1 1
      Ants Contract/AntsContract/AntsContract/SignatureListViewController.h
  19. 7 2
      Ants Contract/AntsContract/AntsContract/SignatureListViewController.m
  20. 3 0
      Ants Contract/AntsContract/AntsContract/const.h

+ 14 - 4
Ants Contract/AntsContract/AntsContract.xcodeproj/project.pbxproj

@@ -19,7 +19,7 @@
 		713E83D71E03BF8C00C4F12A /* DocumentPageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 713E83D61E03BF8C00C4F12A /* DocumentPageViewController.m */; };
 		71D01AC61E0783BD006620CE /* PDFScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 71D01AC51E0783BD006620CE /* PDFScrollView.m */; };
 		71D01AC91E07AAB1006620CE /* EditControlView.m in Sources */ = {isa = PBXBuildFile; fileRef = 71D01AC81E07AAB1006620CE /* EditControlView.m */; };
-		71D01ACB1E07AE34006620CE /* testcontrol.json in Resources */ = {isa = PBXBuildFile; fileRef = 71D01ACA1E07AE34006620CE /* testcontrol.json */; };
+		71D01ACB1E07AE34006620CE /* SUBCONTRACTORS REFERRAL LIST.json in Resources */ = {isa = PBXBuildFile; fileRef = 71D01ACA1E07AE34006620CE /* SUBCONTRACTORS REFERRAL LIST.json */; };
 		71D01ACD1E07AF10006620CE /* SUBCONTRACTORS REFERRAL LIST.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 71D01ACC1E07AF10006620CE /* SUBCONTRACTORS REFERRAL LIST.pdf */; };
 		71D01AD11E07D1EA006620CE /* SignatureListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71D01AD01E07D1EA006620CE /* SignatureListViewController.m */; };
 		71D01AD41E07D699006620CE /* SignatureTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 71D01AD31E07D699006620CE /* SignatureTableViewCell.m */; };
@@ -39,6 +39,8 @@
 		71D01B231E0A2069006620CE /* ImageUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 71D01B1E1E0A2069006620CE /* ImageUtils.m */; };
 		71D01B241E0A2069006620CE /* PDFUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 71D01B201E0A2069006620CE /* PDFUtils.m */; };
 		71D01B251E0A2069006620CE /* TextUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 71D01B221E0A2069006620CE /* TextUtils.m */; };
+		71D01B271E0A2DFE006620CE /* GEIC - Home Improvement Contract 2016.json in Resources */ = {isa = PBXBuildFile; fileRef = 71D01B261E0A2DFE006620CE /* GEIC - Home Improvement Contract 2016.json */; };
+		71D01B2A1E0BB9B3006620CE /* CheckSelectorViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71D01B291E0BB9B3006620CE /* CheckSelectorViewController.m */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXFileReference section */
@@ -63,7 +65,7 @@
 		71D01AC51E0783BD006620CE /* PDFScrollView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PDFScrollView.m; sourceTree = "<group>"; };
 		71D01AC71E07AAB1006620CE /* EditControlView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EditControlView.h; sourceTree = "<group>"; };
 		71D01AC81E07AAB1006620CE /* EditControlView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EditControlView.m; sourceTree = "<group>"; };
-		71D01ACA1E07AE34006620CE /* testcontrol.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = testcontrol.json; sourceTree = "<group>"; };
+		71D01ACA1E07AE34006620CE /* SUBCONTRACTORS REFERRAL LIST.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "SUBCONTRACTORS REFERRAL LIST.json"; sourceTree = "<group>"; };
 		71D01ACC1E07AF10006620CE /* SUBCONTRACTORS REFERRAL LIST.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = "SUBCONTRACTORS REFERRAL LIST.pdf"; sourceTree = "<group>"; };
 		71D01ACE1E07B71B006620CE /* config.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = "<group>"; };
 		71D01ACF1E07D1EA006620CE /* SignatureListViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SignatureListViewController.h; sourceTree = "<group>"; };
@@ -102,6 +104,9 @@
 		71D01B201E0A2069006620CE /* PDFUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PDFUtils.m; path = "../../../RedAnt ERP Mobile/common/PDFUtils.m"; sourceTree = "<group>"; };
 		71D01B211E0A2069006620CE /* TextUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TextUtils.h; path = "../../../RedAnt ERP Mobile/common/TextUtils.h"; sourceTree = "<group>"; };
 		71D01B221E0A2069006620CE /* TextUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TextUtils.m; path = "../../../RedAnt ERP Mobile/common/TextUtils.m"; sourceTree = "<group>"; };
+		71D01B261E0A2DFE006620CE /* GEIC - Home Improvement Contract 2016.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "GEIC - Home Improvement Contract 2016.json"; sourceTree = "<group>"; };
+		71D01B281E0BB9B3006620CE /* CheckSelectorViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CheckSelectorViewController.h; sourceTree = "<group>"; };
+		71D01B291E0BB9B3006620CE /* CheckSelectorViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CheckSelectorViewController.m; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
@@ -165,8 +170,9 @@
 			isa = PBXGroup;
 			children = (
 				713E83D01E038C7400C4F12A /* GEIC - Home Improvement Contract 2016.pdf */,
+				71D01B261E0A2DFE006620CE /* GEIC - Home Improvement Contract 2016.json */,
 				71D01ACC1E07AF10006620CE /* SUBCONTRACTORS REFERRAL LIST.pdf */,
-				71D01ACA1E07AE34006620CE /* testcontrol.json */,
+				71D01ACA1E07AE34006620CE /* SUBCONTRACTORS REFERRAL LIST.json */,
 			);
 			name = "pdf resource";
 			path = AntsContract;
@@ -194,6 +200,8 @@
 				71D01AE71E092150006620CE /* PDFCreator */,
 				71D01AE11E08F5D2006620CE /* TouchImageView.h */,
 				71D01AE21E08F5D2006620CE /* TouchImageView.m */,
+				71D01B281E0BB9B3006620CE /* CheckSelectorViewController.h */,
+				71D01B291E0BB9B3006620CE /* CheckSelectorViewController.m */,
 				713E83CC1E03831C00C4F12A /* PageViewController.h */,
 				713E83CD1E03831C00C4F12A /* PageViewController.m */,
 				713E83D51E03BF8C00C4F12A /* DocumentPageViewController.h */,
@@ -308,7 +316,8 @@
 				713E83D11E038C7400C4F12A /* GEIC - Home Improvement Contract 2016.pdf in Resources */,
 				713E83C51E037C2000C4F12A /* LaunchScreen.storyboard in Resources */,
 				713E83C21E037C2000C4F12A /* Assets.xcassets in Resources */,
-				71D01ACB1E07AE34006620CE /* testcontrol.json in Resources */,
+				71D01B271E0A2DFE006620CE /* GEIC - Home Improvement Contract 2016.json in Resources */,
+				71D01ACB1E07AE34006620CE /* SUBCONTRACTORS REFERRAL LIST.json in Resources */,
 				71D01ACD1E07AF10006620CE /* SUBCONTRACTORS REFERRAL LIST.pdf in Resources */,
 				71D01ADF1E08CC81006620CE /* signature.storyboard in Resources */,
 				713E83C01E037C2000C4F12A /* Main.storyboard in Resources */,
@@ -334,6 +343,7 @@
 				71D01AF81E092304006620CE /* BasicDrawable.m in Sources */,
 				71D01AD41E07D699006620CE /* SignatureTableViewCell.m in Sources */,
 				71D01AFB1E092304006620CE /* ImageDrawable.m in Sources */,
+				71D01B2A1E0BB9B3006620CE /* CheckSelectorViewController.m in Sources */,
 				71D01ADA1E08CA53006620CE /* SignatureView.m in Sources */,
 				713E83CE1E03831C00C4F12A /* PageViewController.m in Sources */,
 				71D01AE31E08F5D2006620CE /* TouchImageView.m in Sources */,

TEMPAT SAMPAH
Ants Contract/AntsContract/AntsContract.xcodeproj/project.xcworkspace/xcuserdata/Ray.xcuserdatad/UserInterfaceState.xcuserstate


+ 23 - 0
Ants Contract/AntsContract/AntsContract.xcodeproj/project.xcworkspace/xcuserdata/Ray.xcuserdatad/xcdebugger/Expressions.xcexplist

@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<VariablesViewState
+   version = "1.0">
+   <ContextStates>
+      <ContextState
+         contextName = "-[DocumentPageViewController viewControllerAtIndex:]:DocumentPageViewController.m">
+      </ContextState>
+      <ContextState
+         contextName = "-[DocumentPageViewController addSignature:]:DocumentPageViewController.m">
+      </ContextState>
+      <ContextState
+         contextName = "-[PDFPageView MyDisplayPDFPage:index:file:]:PDFPageView.m">
+         <PersistentStrings>
+            <PersistentString
+               value = "self.frame">
+            </PersistentString>
+            <PersistentString
+               value = "self.bounds">
+            </PersistentString>
+         </PersistentStrings>
+      </ContextState>
+   </ContextStates>
+</VariablesViewState>

+ 404 - 36
Ants Contract/AntsContract/AntsContract.xcodeproj/xcuserdata/Ray.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -10,12 +10,12 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "AntsContract/RootViewController.m"
-            timestampString = "503550679.046302"
+            timestampString = "504067147.942954"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "36"
-            endingLineNumber = "36"
-            landmarkName = "-OnNewDocumentClick:"
+            startingLineNumber = "37"
+            endingLineNumber = "37"
+            landmarkName = "-OnHICClick:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -58,11 +58,11 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "AntsContract/DocumentPageViewController.m"
-            timestampString = "503918069.776987"
+            timestampString = "504067147.942954"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "290"
-            endingLineNumber = "290"
+            startingLineNumber = "285"
+            endingLineNumber = "285"
             landmarkName = "-pageViewController:spineLocationForInterfaceOrientation:"
             landmarkType = "7">
          </BreakpointContent>
@@ -90,11 +90,11 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "AntsContract/DocumentPageViewController.m"
-            timestampString = "503918069.776987"
+            timestampString = "504067147.942954"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "261"
-            endingLineNumber = "261"
+            startingLineNumber = "256"
+            endingLineNumber = "256"
             landmarkName = "-pageViewController:viewControllerBeforeViewController:"
             landmarkType = "7">
          </BreakpointContent>
@@ -106,11 +106,11 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "AntsContract/DocumentPageViewController.m"
-            timestampString = "503918069.776987"
+            timestampString = "504067147.942954"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "272"
-            endingLineNumber = "272"
+            startingLineNumber = "267"
+            endingLineNumber = "267"
             landmarkName = "-pageViewController:viewControllerAfterViewController:"
             landmarkType = "7">
          </BreakpointContent>
@@ -122,11 +122,11 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "AntsContract/PageViewController.m"
-            timestampString = "503905327.166657"
+            timestampString = "504091658.000925"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "144"
-            endingLineNumber = "144"
+            startingLineNumber = "237"
+            endingLineNumber = "237"
             landmarkName = "@implementation PageViewController"
             landmarkType = "3">
          </BreakpointContent>
@@ -138,11 +138,11 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "AntsContract/PageViewController.m"
-            timestampString = "503905327.166657"
+            timestampString = "504086488.832758"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "52"
-            endingLineNumber = "52"
+            startingLineNumber = "56"
+            endingLineNumber = "56"
             landmarkName = "@implementation PageViewController"
             landmarkType = "3">
          </BreakpointContent>
@@ -154,11 +154,11 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "AntsContract/PageViewController.m"
-            timestampString = "503905327.166657"
+            timestampString = "504086488.832758"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "64"
-            endingLineNumber = "64"
+            startingLineNumber = "68"
+            endingLineNumber = "68"
             landmarkName = "-initControl"
             landmarkType = "7">
          </BreakpointContent>
@@ -186,12 +186,12 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "AntsContract/PageViewController.m"
-            timestampString = "503905327.166657"
+            timestampString = "504086488.832758"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "103"
-            endingLineNumber = "103"
-            landmarkName = "-addButton:destView:"
+            startingLineNumber = "121"
+            endingLineNumber = "121"
+            landmarkName = "-addButton:destView:index:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -202,12 +202,12 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "AntsContract/PageViewController.m"
-            timestampString = "503905327.166657"
+            timestampString = "504086488.832758"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "102"
-            endingLineNumber = "102"
-            landmarkName = "-addButton:destView:"
+            startingLineNumber = "120"
+            endingLineNumber = "120"
+            landmarkName = "-addButton:destView:index:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -282,11 +282,11 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "AntsContract/PageViewController.m"
-            timestampString = "503905327.166657"
+            timestampString = "504091658.000925"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "266"
-            endingLineNumber = "266"
+            startingLineNumber = "324"
+            endingLineNumber = "324"
             landmarkName = "-TouchImageViewOnTouche:"
             landmarkType = "7">
          </BreakpointContent>
@@ -314,11 +314,11 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "AntsContract/PageViewController.m"
-            timestampString = "503906561.060182"
+            timestampString = "504091658.000925"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "285"
-            endingLineNumber = "285"
+            startingLineNumber = "360"
+            endingLineNumber = "360"
             landmarkName = "-TouchImageViewOnTouche:"
             landmarkType = "7">
          </BreakpointContent>
@@ -355,5 +355,373 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "../../RedAnt ERP Mobile/common/pdfCreator/LineDrawable.m"
+            timestampString = "503981471.663479"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "41"
+            endingLineNumber = "41"
+            landmarkName = "-Draw:dataSource:ParentRect:startX:startY:flipHeight:range:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "AntsContract/PageViewController.m"
+            timestampString = "504086488.832758"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "144"
+            endingLineNumber = "144"
+            landmarkName = "-addCheck:destView:index:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "AntsContract/PageViewController.m"
+            timestampString = "504086488.832758"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "143"
+            endingLineNumber = "143"
+            landmarkName = "-addCheck:destView:index:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "AntsContract/DocumentPageViewController.m"
+            timestampString = "503998498.952692"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "186"
+            endingLineNumber = "186"
+            landmarkName = "-saveTempSignature:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "../../RedAnt ERP Mobile/common/PDFUtils.m"
+            timestampString = "503998532.974148"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "40"
+            endingLineNumber = "40"
+            landmarkName = "+saveTempSignature:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "AntsContract/PDFPageView.m"
+            timestampString = "504003458.276765"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "68"
+            endingLineNumber = "68"
+            landmarkName = "-MyDisplayPDFPage:index:file:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "AntsContract/PDFPageView.m"
+            timestampString = "504003458.276765"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "81"
+            endingLineNumber = "81"
+            landmarkName = "-MyDisplayPDFPage:index:file:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "AntsContract/PDFPageView.m"
+            timestampString = "504003458.276765"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "67"
+            endingLineNumber = "67"
+            landmarkName = "-MyDisplayPDFPage:index:file:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "AntsContract/PDFPageView.m"
+            timestampString = "504003458.276765"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "51"
+            endingLineNumber = "51"
+            landmarkName = "-MyDisplayPDFPage:index:file:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "AntsContract/PDFPageView.m"
+            timestampString = "504003593.273847"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "48"
+            endingLineNumber = "48"
+            landmarkName = "-MyDisplayPDFPage:index:file:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "AntsContract/PageViewController.m"
+            timestampString = "504086488.832758"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "95"
+            endingLineNumber = "95"
+            landmarkName = "-addTextView:destView:index:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "AntsContract/PageViewController.m"
+            timestampString = "504091658.000925"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "203"
+            endingLineNumber = "203"
+            landmarkName = "-addSignatureButton:destView:index:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "AntsContract/PageViewController.m"
+            timestampString = "504091658.000925"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "376"
+            endingLineNumber = "376"
+            landmarkName = "-TouchImageViewOnTouche:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "AntsContract/PageViewController.m"
+            timestampString = "504091658.000925"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "346"
+            endingLineNumber = "346"
+            landmarkName = "-TouchImageViewOnTouche:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "../../RedAnt ERP Mobile/common/ImageUtils.m"
+            timestampString = "504070897.060509"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "67"
+            endingLineNumber = "67"
+            landmarkName = "+load_cached_img:loadFrom:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "../../RedAnt ERP Mobile/common/PDFUtils.m"
+            timestampString = "504080341.627162"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "18"
+            endingLineNumber = "18"
+            landmarkName = "+addSignature:to:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "AntsContract/PageViewController.m"
+            timestampString = "504086488.832758"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "148"
+            endingLineNumber = "148"
+            landmarkName = "-addCheck:destView:index:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "AntsContract/PageViewController.m"
+            timestampString = "504086488.832758"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "138"
+            endingLineNumber = "138"
+            landmarkName = "-createMarker:x:y:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "AntsContract/PageViewController.m"
+            timestampString = "504091658.000925"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "289"
+            endingLineNumber = "289"
+            landmarkName = "-CheckButtonClicked:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "AntsContract/CheckSelectorViewController.m"
+            timestampString = "504090254.867288"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "103"
+            endingLineNumber = "103"
+            landmarkName = "-tableView:didSelectRowAtIndexPath:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "AntsContract/PageViewController.m"
+            timestampString = "504091658.000925"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "283"
+            endingLineNumber = "283"
+            landmarkName = "-CheckButtonClicked:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "AntsContract/PageViewController.m"
+            timestampString = "504091658.000925"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "285"
+            endingLineNumber = "285"
+            landmarkName = "-CheckButtonClicked:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "AntsContract/PageViewController.m"
+            timestampString = "504091658.000925"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "267"
+            endingLineNumber = "267"
+            landmarkName = "-CheckButtonClicked:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
 </Bucket>

+ 24 - 5
Ants Contract/AntsContract/AntsContract/Base.lproj/Main.storyboard

@@ -18,12 +18,27 @@
                         <rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
-                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="eWa-Ek-92w">
-                                <rect key="frame" x="330" y="277" width="108" height="108"/>
+                            <button opaque="NO" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="eWa-Ek-92w">
+                                <rect key="frame" x="241" y="247" width="286" height="40"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
-                                <state key="normal" title="New Contract"/>
+                                <state key="normal" title="GEIC - Home Improvement Contract 2016"/>
                                 <connections>
-                                    <action selector="OnNewDocumentClick:" destination="BYZ-38-t0r" eventType="touchUpInside" id="0iM-XN-hZ5"/>
+                                    <action selector="OnHICClick:" destination="BYZ-38-t0r" eventType="touchUpInside" id="aTl-lr-3xe"/>
+                                </connections>
+                            </button>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="Choose a document" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="9lZ-Tq-unm">
+                                <rect key="frame" x="269" y="187" width="230" height="34"/>
+                                <autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
+                                <fontDescription key="fontDescription" type="boldSystem" pointSize="24"/>
+                                <nil key="textColor"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                            <button opaque="NO" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="XbX-if-v3m">
+                                <rect key="frame" x="258" y="321" width="252" height="40"/>
+                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                <state key="normal" title="SUBCONTRACTORS REFERRAL LIST"/>
+                                <connections>
+                                    <action selector="OnSRLClick:" destination="BYZ-38-t0r" eventType="touchUpInside" id="21U-Ek-OEQ"/>
                                 </connections>
                             </button>
                         </subviews>
@@ -38,10 +53,14 @@
                         <barButtonItem key="rightBarButtonItem" title="Sign in" id="A9f-vj-ZDF"/>
                     </navigationItem>
                     <simulatedToolbarMetrics key="simulatedBottomBarMetrics"/>
+                    <connections>
+                        <outlet property="buttonHIC" destination="eWa-Ek-92w" id="Gd9-Qp-4jI"/>
+                        <outlet property="buttonSRL" destination="XbX-if-v3m" id="hqc-5R-6cD"/>
+                    </connections>
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="432" y="-62.000000000000007"/>
+            <point key="canvasLocation" x="432" y="-62"/>
         </scene>
         <!--Navigation Controller-->
         <scene sceneID="SA2-sQ-7bL">

+ 19 - 0
Ants Contract/AntsContract/AntsContract/CheckSelectorViewController.h

@@ -0,0 +1,19 @@
+//
+//  CheckSelectorViewController.h
+//  AntsContract
+//
+//  Created by Ray on 12/22/16.
+//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface CheckSelectorViewController : UIViewController
+@property (strong, nonatomic) IBOutlet UITableView *tableView;
+
+@property (strong, nonatomic) NSArray* rowData;
+@property (strong, nonatomic) NSMutableArray* checkedData;
+@property bool single_select;
+
+@property (nonatomic , copy) void (^blk_OK)(NSArray* checkedData);
+@end

+ 155 - 0
Ants Contract/AntsContract/AntsContract/CheckSelectorViewController.m

@@ -0,0 +1,155 @@
+//
+//  CheckSelectorViewController.m
+//  AntsContract
+//
+//  Created by Ray on 12/22/16.
+//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
+//
+
+#import "CheckSelectorViewController.h"
+
+@interface CheckSelectorViewController ()
+
+@end
+
+@implementation CheckSelectorViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view.
+}
+
+- (void)didReceiveMemoryWarning {
+    [super didReceiveMemoryWarning];
+    // Dispose of any resources that can be recreated.
+}
+- (IBAction)OnOKClick:(id)sender {
+    [self dismissViewControllerAnimated:false completion:^{
+        if(self.blk_OK)
+            self.blk_OK(self.checkedData);
+    }];
+}
+- (IBAction)OnCancelClick:(id)sender {
+    
+    [self dismissViewControllerAnimated:false completion:nil];
+}
+
+/*
+#pragma mark - Navigation
+
+// In a storyboard-based application, you will often want to do a little preparation before navigation
+- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
+    // Get the new view controller using [segue destinationViewController].
+    // Pass the selected object to the new view controller.
+}
+*/
+
+#pragma mark - Table view data source
+- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath;
+{
+
+    return 44;
+    
+    
+}
+
+
+
+- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
+    
+    return @"";//[NSString stringWithFormat:@"Signature%ld",(long)section];
+    
+}
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
+{
+    return 1;
+}
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
+{
+    
+    return self.rowData.count;
+    
+}
+
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
+{
+    
+    
+
+    NSString *CellIdentifier = @"CheckItemCell";
+    UITableViewCell * cell= [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
+    
+    NSArray *item_arr = self.rowData[indexPath.row];
+    
+    cell.textLabel.text = item_arr[0];
+
+    return cell;
+}
+- (UITableViewCellAccessoryType)tableView:(UITableView*)tableView accessoryTypeForRowWithIndexPath:(NSIndexPath*)indexPath
+{
+    if([self.checkedData containsObject:[NSNumber numberWithLong:indexPath.row]])
+    {
+        return UITableViewCellAccessoryCheckmark;
+    }
+    else
+    {
+        return UITableViewCellAccessoryNone;
+    }
+}
+#pragma mark tableview delegate
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
+{
+        UITableViewCell* cell = [tableView cellForRowAtIndexPath:indexPath];
+    if(self.single_select)
+    {
+        [self.checkedData removeAllObjects];
+        if(cell.accessoryType==UITableViewCellAccessoryNone)
+            [self.checkedData addObject:[NSNumber numberWithLong:indexPath.row] ];
+        
+    }
+    else
+    {
+        if([self.checkedData containsObject:[NSNumber numberWithLong:indexPath.row]])
+        {
+            [self.checkedData removeObject:[NSNumber numberWithLong:indexPath.row]];
+            
+        }
+        else
+        {
+            [self.checkedData addObject:[NSNumber numberWithLong:indexPath.row] ];
+        }
+        
+    }
+    
+
+   // cell.accessoryType=UITableViewCellAccessoryCheckmark;
+    
+    [tableView reloadData];
+    
+    
+
+//    if(self.blk_Select)
+//    {
+//        
+//        //        SignatureTableViewCell * cell= [tableView cellForRowAtIndexPath:indexPath];
+//        
+//        NSDictionary * item_json = self.signatureData[[NSString stringWithFormat:@"item_%ld",(long)indexPath.section]];
+//        
+//        //        UIImage* img = [UIImage imageWithContentsOfFile:item_json[@"file"]];
+//        
+//        
+//        self.blk_Select(item_json[@"file"]);
+//        
+//    }
+//    
+//    [self dismissViewControllerAnimated:false completion:nil];
+    
+ 
+    
+    
+}
+
+
+
+@end

+ 4 - 0
Ants Contract/AntsContract/AntsContract/DocumentPageViewController.h

@@ -15,4 +15,8 @@
 @property size_t total_page;
 @property CGPDFDocumentRef document;
 @property (strong, nonatomic) NSMutableDictionary* signatureData;
+
+
+@property (strong, nonatomic) NSString* pdfName;
+@property (strong, nonatomic) NSString* templateName;
 @end

+ 3 - 8
Ants Contract/AntsContract/AntsContract/DocumentPageViewController.m

@@ -29,9 +29,9 @@
     self.signatureData= [[NSMutableDictionary alloc] init];
     
     
-    self.document = [PDFUtils OpenPDF:@"SUBCONTRACTORS REFERRAL LIST.pdf"];
+    self.document = [PDFUtils OpenPDF:self.pdfName];
     self.total_page = CGPDFDocumentGetNumberOfPages (self.document);
-    self.controlTemplate = [self loadControl];
+    self.controlTemplate = [PDFUtils loadControl:self.templateName];
     
     
     PageViewController* startingViewController=[self viewControllerAtIndex:0];
@@ -246,12 +246,7 @@
 {
     return viewController.pageIndex;//[self.pagePDF indexOfObject:viewController.pdfview];
 }
--(NSMutableDictionary*) loadControl{
-    NSString *path = [[NSBundle mainBundle] pathForResource:@"testcontrol.json" ofType:nil];
-    NSData *data = [NSData dataWithContentsOfFile:path];
-    NSMutableDictionary *ret = [[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil] mutableCopy];
-    return ret;
-}
+
 
 #pragma mark - Page View Controller Data Source
 

+ 519 - 0
Ants Contract/AntsContract/AntsContract/GEIC - Home Improvement Contract 2016.json

@@ -0,0 +1,519 @@
+{
+    "count": 4,
+    "signature_name":["Customer Initial","Decision Maker","Agent Of Contractor","Homeowner","Homeowner Print Name","Date"],
+    "page_0": {
+        "count": 15,
+        "control_0": {
+            "type": "Check",
+            "pos_x": 122,
+            "pos_y": 132,
+            "width": 522,
+            "height": 80,
+            "field": "team",
+            "title": "team button",
+            "single_select": true,
+            "marker_size": 8,
+            "cadedate": [
+                         [
+                          "T&C",
+                          [
+                           127,
+                           143
+                           ]
+                          ],
+                         [
+                          "W",
+                          [
+                           236,
+                           143
+                           ]
+                          ],
+                         [
+                          "X",
+                          [
+                           336,
+                           143
+                           ]
+                          ],
+                         [
+                          "F",
+                          [
+                           428,
+                           143
+                           ]
+                          ],
+                         [
+                          "GE",
+                          [
+                           533,
+                           143
+                           ]
+                          ]
+                         ],
+            "value": []
+        },
+        "control_1": {
+            "type": "TextView",
+            "pos_x": 222,
+            "pos_y": 253,
+            "width": 183,
+            "height": 30,
+            "field": "customer_name",
+            "value": ""
+        },
+        "control_2": {
+            "type": "TextView",
+            "pos_x": 488,
+            "pos_y": 253,
+            "width": 156,
+            "height": 30,
+            "field": "job_date",
+            "value": ""
+        },
+        "control_3": {
+            "type": "TextView",
+            "pos_x": 222,
+            "pos_y": 285,
+            "width": 423,
+            "height": 30,
+            "field": "job_addr",
+            "value": ""
+        },
+        "control_4": {
+            "type": "TextView",
+            "pos_x": 222,
+            "pos_y": 317,
+            "width": 183,
+            "height": 30,
+            "field": "tel",
+            "value": ""
+        },
+        "control_5": {
+            "type": "TextView",
+            "pos_x": 488,
+            "pos_y": 317,
+            "width": 156,
+            "height": 30,
+            "field": "today_date",
+            "value": ""
+        },
+        "control_6": {
+            "type": "TextView",
+            "pos_x": 222,
+            "pos_y": 349,
+            "width": 183,
+            "height": 30,
+            "field": "contract_price",
+            "value": ""
+        },
+        "control_7": {
+            "type": "TextView",
+            "pos_x": 488,
+            "pos_y": 349,
+            "width": 156,
+            "height": 30,
+            "field": "labor_deposit",
+            "value": ""
+        },
+        "control_8": {
+            "type": "TextView",
+            "pos_x": 222,
+            "pos_y": 382,
+            "width": 183,
+            "height": 40,
+            "field": "balance",
+            "value": ""
+        },
+        "control_9": {
+            "type": "Check",
+            "pos_x": 122,
+            "pos_y": 538,
+            "width": 522,
+            "height": 70,
+            "field": "service",
+            "title": "service button",
+            "single_select": false,
+            "marker_size": 6,
+            "cadedate": [
+                         [
+                          "T&C",
+                          [
+                           133,
+                           545
+                           ]
+                          ],
+                         [
+                          "W",
+                          [
+                           133,
+                           557
+                           ]
+                          ],
+                         [
+                          "X",
+                          [
+                           133,
+                           569
+                           ]
+                          ],
+                         [
+                          "F",
+                          [
+                           133,
+                           581
+                           ]
+                          ],
+                         [
+                          "GE",
+                          [
+                           133,
+                           593
+                           ]
+                          ]
+                         ],
+            "value": []
+        },
+        "control_10": {
+            "type": "Signature",
+            "pos_x": 615,
+            "pos_y": 693,
+            "width": 30,
+            "height": 15,
+            "name": "Customer Initial",
+            "value": ""
+        },
+        "control_11": {
+            "type": "Signature",
+            "pos_x": 615,
+            "pos_y": 730,
+            "width": 30,
+            "height": 15,
+            "name": "Customer Initial",
+            "value": ""
+        },
+        "control_12": {
+            "type": "Signature",
+            "pos_x": 615,
+            "pos_y": 779,
+            "width": 30,
+            "height": 15,
+            "name": "Customer Initial",
+            "value": ""
+        },
+        "control_13": {
+            "type": "Signature",
+            "pos_x": 615,
+            "pos_y": 795,
+            "width": 30,
+            "height": 15,
+            "name": "Customer Initial",
+            "value": ""
+        },
+        "control_14": {
+            "type": "Signature",
+            "pos_x": 615,
+            "pos_y": 844,
+            "width": 30,
+            "height": 15,
+            "name": "Customer Initial",
+            "value": ""
+        }
+    },
+    "page_1": {
+        "count": 17,
+        "control_0": {
+            "type": "Signature",
+            "pos_x": 615,
+            "pos_y": 79,
+            "width": 30,
+            "height": 15,
+            "name": "Customer Initial",
+            "value": ""
+        },
+        "control_1": {
+            "type": "Signature",
+            "pos_x": 230,
+            "pos_y": 87,
+            "width": 200,
+            "height": 20,
+            "name": "Decision Maker",
+            "value": ""
+        },
+        "control_2": {
+            "type": "Signature",
+            "pos_x": 615,
+            "pos_y": 148,
+            "width": 30,
+            "height": 15,
+            "name": "Customer Initial",
+            "value": ""
+        },
+        "control_3": {
+            "type": "Signature",
+            "pos_x": 615,
+            "pos_y": 168,
+            "width": 30,
+            "height": 15,
+            "name": "Customer Initial",
+            "value": ""
+        },
+        "control_4": {
+            "type": "Signature",
+            "pos_x": 615,
+            "pos_y": 195,
+            "width": 30,
+            "height": 15,
+            "name": "Customer Initial",
+            "value": ""
+        },
+        "control_5": {
+            "type": "Signature",
+            "pos_x": 615,
+            "pos_y": 232,
+            "width": 30,
+            "height": 15,
+            "name": "Customer Initial",
+            "value": ""
+        },
+        "control_6": {
+            "type": "Signature",
+            "pos_x": 615,
+            "pos_y": 280,
+            "width": 30,
+            "height": 15,
+            "name": "Customer Initial",
+            "value": ""
+        },
+        "control_7": {
+            "type": "Signature",
+            "pos_x": 615,
+            "pos_y": 307,
+            "width": 30,
+            "height": 15,
+            "name": "Customer Initial",
+            "value": ""
+        },
+        "control_8": {
+            "type": "Signature",
+            "pos_x": 615,
+            "pos_y": 333,
+            "width": 30,
+            "height": 15,
+            "name": "Customer Initial",
+            "value": ""
+        },
+        "control_9": {
+            "type": "Signature",
+            "pos_x": 615,
+            "pos_y": 370,
+            "width": 30,
+            "height": 15,
+            "name": "Customer Initial",
+            "value": ""
+        },
+        "control_10": {
+            "type": "Signature",
+            "pos_x": 615,
+            "pos_y": 408,
+            "width": 30,
+            "height": 15,
+            "name": "Customer Initial",
+            "value": ""
+        },
+        "control_11": {
+            "type": "Signature",
+            "pos_x": 615,
+            "pos_y": 434,
+            "width": 30,
+            "height": 15,
+            "name": "Customer Initial",
+            "value": ""
+        },
+        "control_12": {
+            "type": "Signature",
+            "pos_x": 615,
+            "pos_y": 493,
+            "width": 30,
+            "height": 15,
+            "name": "Customer Initial",
+            "value": ""
+        },
+        "control_13": {
+            "type": "Signature",
+            "pos_x": 615,
+            "pos_y": 531,
+            "width": 30,
+            "height": 15,
+            "name": "Customer Initial",
+            "value": ""
+        },
+        "control_14": {
+            "type": "Signature",
+            "pos_x": 615,
+            "pos_y": 590,
+            "width": 30,
+            "height": 15,
+            "name": "Customer Initial",
+            "value": ""
+        },
+        "control_15": {
+            "type": "Signature",
+            "pos_x": 615,
+            "pos_y": 606,
+            "width": 30,
+            "height": 15,
+            "name": "Customer Initial",
+            "value": ""
+        },
+        "control_16": {
+            "type": "Signature",
+            "pos_x": 615,
+            "pos_y": 623,
+            "width": 30,
+            "height": 15,
+            "name": "Customer Initial",
+            "value": ""
+        }
+    },
+    "page_2": {
+        "count": 8,
+        "control_0": {
+            "type": "Signature",
+            "pos_x": 143,
+            "pos_y": 746,
+            "width": 200,
+            "height": 45,
+            "name": "Agent Of Contractor",
+            "value": ""
+        },
+        "control_1": {
+            "type": "Signature",
+            "pos_x": 385,
+            "pos_y": 746,
+            "width": 240,
+            "height": 45,
+            "name": "Homeowner",
+            "value": ""
+        },
+        "control_2": {
+            "type": "TextView",
+            "pos_x": 194,
+            "pos_y": 803,
+            "width": 160,
+            "height": 14,
+            "field": "installer_name",
+            "value": ""
+        },
+        "control_3": {
+            "type": "TextView",
+            "pos_x": 472,
+            "pos_y": 803,
+            "width": 165,
+            "height": 14,
+            "field": "customer_name",
+            "value": ""
+        },
+        "control_4": {
+            "type": "TextView",
+            "pos_x": 194,
+            "pos_y": 818,
+            "width": 160,
+            "height": 14,
+            "field": "signor_name",
+            "value": ""
+        },
+        "control_5": {
+            "type": "TextView",
+            "pos_x": 472,
+            "pos_y": 818,
+            "width": 165,
+            "height": 14,
+            "field": "owner_name",
+            "value": ""
+        },
+        "control_6": {
+            "type": "TextView",
+            "pos_x": 472,
+            "pos_y": 834,
+            "width": 165,
+            "height": 14,
+            "field": "tel1",
+            "value": ""
+        }
+    },
+    "page_3": {
+        "count": 8,
+        "control_0": {
+            "type": "Signature",
+            "pos_x": 615,
+            "pos_y": 644,
+            "width": 30,
+            "height": 15,
+            "name": "Customer Initial",
+            "value": ""
+        },
+        "control_1": {
+            "type": "Signature",
+            "pos_x": 615,
+            "pos_y": 660,
+            "width": 30,
+            "height": 15,
+            "name": "Customer Initial",
+            "value": ""
+        },
+        "control_2": {
+            "type": "Signature",
+            "pos_x": 615,
+            "pos_y": 687,
+            "width": 30,
+            "height": 15,
+            "name": "Customer Initial",
+            "value": ""
+        },
+        "control_3": {
+            "type": "Signature",
+            "pos_x": 615,
+            "pos_y": 724,
+            "width": 30,
+            "height": 15,
+            "name": "Customer Initial",
+            "value": ""
+        },
+        "control_4": {
+            "type": "Signature",
+            "pos_x": 615,
+            "pos_y": 762,
+            "width": 30,
+            "height": 15,
+            "name": "Customer Initial",
+            "value": ""
+        },
+        "control_5": {
+            "type": "Signature",
+            "pos_x": 132,
+            "pos_y": 808,
+            "width": 185,
+            "height": 24,
+            "name": "Homeowner",
+            "value": ""
+        },
+        "control_6": {
+            "type": "Signature",
+            "pos_x": 352,
+            "pos_y": 808,
+            "width": 183,
+            "height": 24,
+            "name": "Homeowner Print Name",
+            "value": ""
+        },
+        "control_7": {
+            "type": "Signature",
+            "pos_x": 566,
+            "pos_y": 808,
+            "width": 60,
+            "height": 24,
+            "name": "Date",
+            "value": ""
+        }
+    }
+}

TEMPAT SAMPAH
Ants Contract/AntsContract/AntsContract/GEIC - Home Improvement Contract 2016.pdf


+ 66 - 3
Ants Contract/AntsContract/AntsContract/PDFPageView.m

@@ -32,14 +32,77 @@
 
 -(void) MyDisplayPDFPage:(CGContextRef) myContext index:(size_t)pageNumber file:(NSString*) filename//(,  , const char *filename)
 {
+    
+    
+    {
+    CGPDFPageRef page = self.pageRef;
+
+    CGContextSaveGState (myContext);
+    
+                CGRect mediabox= CGPDFPageGetBoxRect(page, kCGPDFMediaBox);
+        
+//                CGContextTranslateCTM(myContext, 0, mediabox.size.height);
+//                CGContextScaleCTM(myContext, 1, -1);
+
+        CGAffineTransform pdfTransform = CGPDFPageGetDrawingTransform(page, kCGPDFMediaBox, self.frame, 0, true);
+        CGContextConcatCTM(myContext, pdfTransform);
+        
+        CGContextScaleCTM(myContext, 1, -1);
+        CGContextTranslateCTM(myContext, 0, -self.frame.size.height/pdfTransform.a);
+        
+
+    CGContextDrawPDFPage (myContext, page);
+    CGContextRestoreGState (myContext);
+    }
+    
+    
+    
+    
+    
+//    CGPDFPageRef page = self.pageRef;
+//
+//    CGContextSaveGState (myContext);
+//    
+//    CGRect mediabox= CGPDFPageGetBoxRect(page, kCGPDFMediaBox);
+//    
+//    CGContextTranslateCTM(myContext, 0, mediabox.size.height);
+//    // Reverse the Y axis to grow from bottom to top.
+//    CGContextScaleCTM(myContext, 1, -1);
+//    
+//    CGContextDrawPDFPage (myContext, page);
+//    CGContextRestoreGState (myContext);
+//    return ;
+    
+//    {
+//        
+//        // CGPDFDocumentRef document;
+//        CGPDFPageRef page = self.pageRef;
+//
+//        CGContextSaveGState (myContext);
+//        
+//        
+//        CGRect mediabox= CGPDFPageGetBoxRect(page, kCGPDFMediaBox);
+//        
+//        CGContextTranslateCTM(myContext, 0, mediabox.size.height);
+//        CGContextScaleCTM(myContext, 1, -1);
+//        
+//        CGContextDrawPDFPage (myContext, page);
+//        CGContextRestoreGState (myContext);
+//    }
+    
+    
+    
+    
+    
+ /*
    // CGPDFDocumentRef document;
     CGPDFPageRef page = self.pageRef;
  //   document = [self OpenPDF:filename];                                   // 1 创建PDFDocument对象
   //  page = CGPDFDocumentGetPage (document, pageNumber);           // 2 获取指定页的PDF文档
     
     
-    CGAffineTransform m;
-    m = CGPDFPageGetDrawingTransform (page, kCGPDFCropBox, self.bounds, -180, true);
+//    CGAffineTransform m;
+//    m = CGPDFPageGetDrawingTransform (page, kCGPDFMediaBox, self.bounds, -180, true);
     CGContextSaveGState (myContext);
     
     CGContextTranslateCTM(myContext, 80, self.frame.size.height);
@@ -49,7 +112,7 @@
   //  CGContextClipToRect (myContext,CGPDFPageGetBoxRect (page, kCGPDFCropBox));
     CGContextDrawPDFPage (myContext, page);
     CGContextRestoreGState (myContext);
-    
+    */
     
   //  CGContextDrawPDFPage (myContext, page);                                       // 3 将PDF绘制到图形上下文中
 //    CGPDFDocumentRelease (document);

+ 179 - 102
Ants Contract/AntsContract/AntsContract/PageViewController.m

@@ -9,10 +9,14 @@
 #import "PageViewController.h"
 
 #import "config.h"
+#import "const.h"
 
 #import "SignatureListViewController.h"
 #import "SignatureViewController.h"
 #import "PDFUtils.h"
+#import "ImageUtils.h"
+#import "CheckSelectorViewController.h"
+
 
 //#import "TouchImageView.h"
 @interface PageViewController ()
@@ -63,26 +67,40 @@
         NSMutableDictionary * control =self.controlTemplate [[NSString stringWithFormat:@"control_%d",i] ];
         if([control[@"type"] isEqualToString:@"TextView"])
         {
-            [self addTextView:control destView:self.editControlView];
+            [self addTextView:control destView:self.editControlView index:i];
         }
         else if([control[@"type"] isEqualToString:@"Button"])
         {
-            [self addButton:control destView:self.editControlView];
+            [self addButton:control destView:self.editControlView index:i];
+            
+        }
+        else if([control[@"type"] isEqualToString:@"Check"])
+        {
+            [self addCheck:control destView:self.editControlView index:i];
             
         }
         else if([control[@"type"] isEqualToString:@"Signature"])
         {
-            [self addSignatureButton:control destView:self.editControlView];
+            [self addSignatureButton:control destView:self.editControlView index:i];
             
         }
     }
     
 }
 #pragma mark add controls
--(void) addTextView:(NSMutableDictionary*) template destView:(UIView*)destView
+-(void) addTextView:(NSMutableDictionary*) template destView:(UIView*)destView index:(int) index
 {
     UITextView* tv = [[UITextView alloc] initWithFrame:CGRectMake([template[@"pos_x"] floatValue], [template[@"pos_y"] floatValue], [template[@"width"] floatValue], [template[@"height"] floatValue])];
-    [tv setFont:[UIFont boldSystemFontOfSize:20.0f]];
+    float fontsize = [template[@"size"] floatValue];
+    if(fontsize==0)
+        fontsize=10;
+    [tv setFont:[UIFont systemFontOfSize:fontsize]];
+    
+    tv.text =template[@"value"];
+    
+    tv.tag = index+ CONTROL_BASE;
+    
+    
     //    tv.place
     //    [btn setTitle:template[@"title"] forState:UIControlStateNormal];
     //    ref addTarget:self action:@selector(manually_refresh) forControlEvents:UIControlEventValueChanged
@@ -98,10 +116,12 @@
     }
     [destView addSubview:tv];
 }
--(void) addButton:(NSMutableDictionary*) template destView:(UIView*)destView
+-(void) addButton:(NSMutableDictionary*) template destView:(UIView*)destView index:(int) index
 {
     UIButton* btn = [[UIButton alloc] initWithFrame:CGRectMake([template[@"pos_x"] floatValue], [template[@"pos_y"] floatValue], [template[@"width"] floatValue], [template[@"height"] floatValue])];
     [btn setTitle:template[@"title"] forState:UIControlStateNormal];
+    
+        btn.tag = index+ CONTROL_BASE;
     //    ref addTarget:self action:@selector(manually_refresh) forControlEvents:UIControlEventValueChanged
     
     [btn addTarget:self action:@selector(ControlButtonClicked:) forControlEvents:UIControlEventTouchUpInside];
@@ -113,7 +133,64 @@
     }
     [destView addSubview:btn];
 }
--(void) addSignatureButton:(NSMutableDictionary*) template destView:(UIView*)destView
+-(UIView*) createMarker:(int)size x:(int)x y:(int)y
+{
+    UIView* v=[[UIView alloc] initWithFrame:CGRectMake(x, y, size, size)];
+    return v;
+    
+}
+-(void) addCheck:(NSMutableDictionary*) template destView:(UIView*)destView index:(int) index
+{
+    UIButton* btn = [[UIButton alloc] initWithFrame:CGRectMake([template[@"pos_x"] floatValue], [template[@"pos_y"] floatValue], [template[@"width"] floatValue], [template[@"height"] floatValue])];
+    
+    //    ref addTarget:self action:@selector(manually_refresh) forControlEvents:UIControlEventValueChanged
+        btn.tag = index+ CONTROL_BASE;
+    [btn addTarget:self action:@selector(CheckButtonClicked:) forControlEvents:UIControlEventTouchUpInside];
+    UIColor* marker_bg=[UIColor clearColor];
+    if(DEBUG_PDFSIG)
+    {
+       // btn.backgroundColor = [UIColor lightGrayColor];
+
+        [btn setTitle:template[@"title"] forState:UIControlStateNormal];
+        marker_bg = [UIColor redColor];
+        
+        // [btn setBackgroundImage:[UIColor grayColor] forState:UIControlStateNormal];
+    }
+    [destView addSubview:btn];
+    NSArray* cadedate = template[@"cadedate"];
+    
+    NSArray* checkedData = self.controlTemplate [[NSString stringWithFormat:@"control_%d",index] ][@"value"];
+
+
+    
+    
+    for(int i=0;i<cadedate.count;i++)
+    {
+        NSArray* item = cadedate[i];
+        
+        UIView* marker=[self createMarker:[template[@"marker_size"] intValue] x:[item[1][0] intValue] y:[item[1][1] intValue]];
+        
+        marker.backgroundColor = marker_bg;
+        marker.tag = CHECK_BASE+index*1000+i;
+        
+        
+        if([checkedData containsObject:[NSNumber numberWithLong:i]])
+        {
+            
+            marker.backgroundColor= [UIColor blackColor];
+            
+        }
+        else
+        {
+            marker.backgroundColor= marker_bg;
+        }
+        
+        [destView addSubview:marker];
+        
+    }
+    
+}
+-(void) addSignatureButton:(NSMutableDictionary*) template destView:(UIView*)destView index:(int) index
 {
     TouchImageView* btn = [[TouchImageView alloc] initWithFrame:CGRectMake([template[@"pos_x"] floatValue], [template[@"pos_y"] floatValue], [template[@"width"] floatValue], [template[@"height"] floatValue])];
     
@@ -121,7 +198,23 @@
     btn.delegate = self;
     btn.layer.borderColor = [UIColor clearColor].CGColor;
     btn.layer.borderWidth = 0;
+        btn.tag = index+ CONTROL_BASE;
+    
+    NSString* file =template[@"value"];
+    
+    NSData* img_data=[ImageUtils load_img:file];
+    
+    if(img_data!=nil)
+    {
+        
+        UIImage* image=[UIImage imageWithData:img_data];
+        btn.image = image;
+        
+    }
     
+
+
+
     if(DEBUG_PDFSIG)
     {
         btn.backgroundColor = [UIColor lightGrayColor];
@@ -152,101 +245,66 @@
     NSLog(@"button clicked;");
     //    [self.view addSubview:self.sortItemController.view];
 }
-//- (void)SignatureButtonClicked:(UIButton *)sender {
-//    //    DebugLog(@"cart sort button clicked");
-//
-//    NSLog(@"signature button clicked;");
-//
-//
-//    {
-//
-//        //    CGRect cellrect_screen = [RAUtils relativeFrameForScreenWithView:trigger];
-//        //
-//        //
-//        //    CGRect rect1=[self.view convertRect:cellrect_screen fromView:[[[UIApplication sharedApplication] delegate] window]];
-//        //
-//        //    DebugLog(@"convert1 %@",NSStringFromCGRect(rect1));
-//        SignatureListViewController *signatureVC = [ [UIStoryboard storyboardWithName:@"signature" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"SignatureListViewController"];
-//        signatureVC.title=@"Signatures";
-//        signatureVC.signatureData = self.signatureData;
-//
-//
-//        signatureVC.blk_Add = ^()
-//        {
-//
-//            __block UIImage* signimg=nil;
-//            SignatureViewController * vc =[ [UIStoryboard storyboardWithName:@"signature" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"SignatureViewController"];
-//
-//            vc.onReturnImg = ^(UIImage* img)
-//            {
-//
-//
-//                signimg = img;
-//
-////                if(signimg!=nil)
-////                    [self addSignature:signimg];
-//
-//
-//            };
-//            //    orderinfoVC.url_type = URL_REMOTE;
-//            //    orderinfoVC.request_url=URL_CARTDELIVERY;
-//            //
-//            //    orderinfoVC.params = params;
-//            //
-//            //    orderinfoVC.delegate=self;
-//            //
-//            //    if(checked.count==count)
-//            //    {
-//            //    orderinfoVC.have_tail = true
-//            //    }
-//
-//            [self.navigationController pushViewController:vc animated:true];
-//
-//
-//
-//        };
-//
-//        UINavigationController * navi = [[UINavigationController alloc] initWithRootViewController:signatureVC];
-//        navi.modalPresentationStyle=UIModalPresentationPopover;
-//
-//        UIPopoverPresentationController* popPc = navi.popoverPresentationController;
-//        popPc.permittedArrowDirections = UIPopoverArrowDirectionAny;
-//        popPc.sourceView = sender;
-//        popPc.delegate = nil;
-//
-//
-//
-//        [self presentViewController:navi animated:true completion:nil];
-//
-//        ////    menu.selector = self.selector;
-//        ////
-//        ////    menu.selectordelegate = self;
-//        //
-//        //    // 1.创建一个UIPopover
-//        //    UIPopoverController *popover = [[UIPopoverController alloc] initWithContentViewController:[[UINavigationController alloc] initWithRootViewController:menu]];
-//        //
-//        //
-//        //
-//        //    UIPopoverPresentationController
-//        //    // 2.设置尺寸
-//        //    //    popover.popoverContentSize = CGSizeMake(320, 44 * 5);
-//        //
-//        //    // 3.从哪里显示出来 --> 指向item
-//        //
-//        //    [popover presentPopoverFromRect:self.view.frame   inView:self.view permittedArrowDirections:0 animated:YES];
-//        //    //  [popover presentPopoverFromBarButtonItem:item permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
-//        //
-//        ////    self.popover = popover;
-//        //    popover pop
-//        //
-//        // [self performSegueWithIdentifier:@"selector_popover" sender:self];
-//
-//    }
-//    //    [self.view addSubview:self.sortItemController.view];
-//}
+- (void)CheckButtonClicked:(UIButton *)sender {
+    //    DebugLog(@"cart sort button clicked");
+    
+    NSLog(@"check clicked;");
+    
+    long index = sender.tag - CONTROL_BASE;
+    
+
+    bool single_select = [self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"single_select"] boolValue];
+    
+    NSArray* rowData = self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"cadedate"];
+    NSArray* checkedData = self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"value"];
+    CheckSelectorViewController *checkVC = [ [UIStoryboard storyboardWithName:@"signature" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"CheckSelectorViewController"];
+    
+    checkVC.blk_OK = ^(NSArray* checkedData){
+        for(int i=0;i<rowData.count;i++)
+        {
+            long tag=CHECK_BASE+index*1000+i;
+           // UIView* v= sender;
+            if([checkedData containsObject:[NSNumber numberWithLong:i]])
+            {
+               // [checkedData removeObject:[NSNumber numberWithLong:indexPath.row]];
+                
+                [sender.superview viewWithTag:tag].backgroundColor= [UIColor blackColor];
+                
+            }
+            else
+            {
+               // [self.checkedData addObject:[NSNumber numberWithLong:indexPath.row] ];
+                [sender.superview viewWithTag:tag].backgroundColor= [UIColor clearColor];
+            }
+            self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"value"]=checkedData;
+            
+        }
+    };
+    checkVC.rowData = rowData;
+    checkVC.checkedData = [checkedData mutableCopy];
+    checkVC.single_select = single_select;
+    
+    checkVC.title=@"abcdefg";
+    checkVC.modalPresentationStyle = UIModalTransitionStyleCrossDissolve;
+    [self presentViewController:checkVC animated:YES completion:nil];
+    
+}
+
 #pragma mark TextViewDelegate
 - (void)textViewDidEndEditing:(UITextView *)textView
 {
+    
+    long index = textView.tag - CONTROL_BASE;
+    
+    NSString* text =textView.text;
+    if(text==nil)
+        text=@"";
+    self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"value"] = text;
+    
+//    int count = [self.controlTemplate[@"count"] intValue];
+//    for(int i=0;i<count;i++)
+//    {
+//        NSMutableDictionary * control =;
     //[self update_newprice];
 }
 /*
@@ -280,9 +338,26 @@
         
 //        signatureVC.imageView = touchImageView;
         
-        signatureVC.blk_Select =^(UIImage* img)
+        signatureVC.blk_Select =^(NSString* file)
         {
-            touchImageView.image = img;
+            
+            
+            
+//            NSString* file_name=[file lastPathComponent];
+            
+            NSData* img_data=[ImageUtils load_img:file];
+            
+            if(img_data!=nil)
+            {
+                
+                UIImage* image=[UIImage imageWithData:img_data];
+                touchImageView.image = image;
+                
+                long index = touchImageView.tag - CONTROL_BASE;
+                self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"value"] = file;
+                
+            }
+
         };
         signatureVC.blk_Add = ^()
         {
@@ -298,7 +373,9 @@
                 
                 if(signimg!=nil)
                 {
-                    [PDFUtils addSignature:signimg to:self.signatureData];
+                    NSString* file=[PDFUtils addSignature:signimg to:self.signatureData];
+                        long index = touchImageView.tag - CONTROL_BASE;
+                        self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"value"] = file;
                     touchImageView.image = signimg;
                 }
                 

+ 2 - 0
Ants Contract/AntsContract/AntsContract/RootViewController.h

@@ -9,7 +9,9 @@
 #import <UIKit/UIKit.h>
 
 @interface RootViewController : UIViewController
+@property (strong, nonatomic) IBOutlet UIButton *buttonHIC;
 
+@property (strong, nonatomic) IBOutlet UIButton *buttonSRL;
 
 @end
 

+ 12 - 9
Ants Contract/AntsContract/AntsContract/RootViewController.m

@@ -26,7 +26,7 @@
     // Dispose of any resources that can be recreated.
 }
 
-- (IBAction)OnNewDocumentClick:(id)sender {
+- (IBAction)OnHICClick:(id)sender {
     
     
     
@@ -34,15 +34,18 @@
     
     DocumentPageViewController* dvc = [self.storyboard instantiateViewControllerWithIdentifier:@"DocumentPageViewController" ];
     
-   // dvc.pageIndex=0;
-    //            dvc
-/*
-    dvc.product_id=product_id;
-    dvc.category_id=nil;
-    dvc.ispush=true;
- 
+    dvc.templateName = @"GEIC - Home Improvement Contract 2016.json";
+    dvc.pdfName = @"GEIC - Home Improvement Contract 2016.pdf";
+
+    [self.navigationController pushViewController:dvc animated:true];
+}
+- (IBAction)OnSRLClick:(id)sender {
+    
+    DocumentPageViewController* dvc = [self.storyboard instantiateViewControllerWithIdentifier:@"DocumentPageViewController" ];
+
+    dvc.templateName = @"SUBCONTRACTORS REFERRAL LIST.json";
+    dvc.pdfName = @"SUBCONTRACTORS REFERRAL LIST.pdf";
     
-    [dvc reload];*/
     [self.navigationController pushViewController:dvc animated:true];
 }
 

+ 35 - 0
Ants Contract/AntsContract/AntsContract/SUBCONTRACTORS REFERRAL LIST.json

@@ -0,0 +1,35 @@
+{
+    "count": 1,
+    "signature_name":["Homeowner","Homeowner Print Name","Date"],
+    "page_0": {
+        "count": 3,
+        "control_0": {
+            "type": "Signature",
+            "pos_x": 132,
+            "pos_y": 507,
+            "width": 146,
+            "height": 40,
+            "field": "Homeowner",
+            "value": ""
+        },
+        "control_1": {
+            "type": "Signature",
+            "pos_x": 330,
+            "pos_y": 507,
+            "width": 148,
+            "height": 40,
+            "field": "Homeowner Print Name",
+            "value": ""
+        },
+        "control_2": {
+            "type": "Signature",
+            "pos_x": 550,
+            "pos_y": 507,
+            "width": 75,
+            "height": 40,
+            "field": "Date",
+            "value": ""
+        }
+
+    }
+}

TEMPAT SAMPAH
Ants Contract/AntsContract/AntsContract/SUBCONTRACTORS REFERRAL LIST.pdf


+ 1 - 1
Ants Contract/AntsContract/AntsContract/SignatureListViewController.h

@@ -16,5 +16,5 @@
 
 //@property (strong, nonatomic)  UIImageView *imageView;
 @property (nonatomic , copy) void (^blk_Add)();
-@property (nonatomic , copy) void (^blk_Select)(UIImage* image);
+@property (nonatomic , copy) void (^blk_Select)(NSString* file);
 @end

+ 7 - 2
Ants Contract/AntsContract/AntsContract/SignatureListViewController.m

@@ -331,9 +331,14 @@
     if(self.blk_Select)
     {
         
-        SignatureTableViewCell * cell= [tableView cellForRowAtIndexPath:indexPath];
+//        SignatureTableViewCell * cell= [tableView cellForRowAtIndexPath:indexPath];
         
-        self.blk_Select(cell.signatureImageView.image);
+        NSDictionary * item_json = self.signatureData[[NSString stringWithFormat:@"item_%ld",(long)indexPath.section]];
+        
+//        UIImage* img = [UIImage imageWithContentsOfFile:item_json[@"file"]];
+        
+        
+        self.blk_Select(item_json[@"file"]);
 
     }
     

+ 3 - 0
Ants Contract/AntsContract/AntsContract/const.h

@@ -9,6 +9,9 @@
 #ifndef const_h
 #define const_h
 
+
+#define CONTROL_BASE 19871
+#define CHECK_BASE 29871
 #define DEBUGLOG 1
 #ifdef DEBUGLOG
 #ifdef DEBUG