Преглед изворни кода

eSign

修复模板打开和保存产生误差的问题
Ray Zhang пре 8 година
родитељ
комит
191417abcd

BIN
Ants Contract/AntsContract.xcworkspace/xcuserdata/Ray.xcuserdatad/UserInterfaceState.xcuserstate


+ 217 - 9
Ants Contract/AntsContract.xcworkspace/xcuserdata/Ray.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -10,7 +10,7 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "Granite Expo eSign/Granite Expo eSign/TemplateViewController.m"
-            timestampString = "528099424.912409"
+            timestampString = "528108554.979817"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "129"
@@ -26,7 +26,7 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "Granite Expo eSign/Granite Expo eSign/TemplateViewController.m"
-            timestampString = "528099424.914064"
+            timestampString = "528108554.980355"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "137"
@@ -42,7 +42,7 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "Granite Expo eSign/Granite Expo eSign/TemplateViewController.m"
-            timestampString = "528099424.915847"
+            timestampString = "528108554.980496"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "177"
@@ -58,11 +58,11 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "Granite Expo eSign/Granite Expo eSign/TemplateViewController.m"
-            timestampString = "528099424.9213"
+            timestampString = "528108554.980616"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "297"
-            endingLineNumber = "297"
+            startingLineNumber = "299"
+            endingLineNumber = "299"
             landmarkName = "-initControl"
             landmarkType = "7">
          </BreakpointContent>
@@ -74,7 +74,7 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "Granite Expo eSign/Granite Expo eSign/TemplateViewController.m"
-            timestampString = "528099424.923306"
+            timestampString = "528108554.980777"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "153"
@@ -90,7 +90,7 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "Granite Expo eSign/Granite Expo eSign/TemplateViewController.m"
-            timestampString = "528099424.925395"
+            timestampString = "528108554.980887"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "171"
@@ -106,7 +106,7 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "Granite Expo eSign/Granite Expo eSign/TemplateViewController.m"
-            timestampString = "528099424.927321"
+            timestampString = "528108554.980988"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "208"
@@ -115,5 +115,213 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "Granite Expo eSign/Granite Expo eSign/TemplateViewController.m"
+            timestampString = "528108554.981114"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "2120"
+            endingLineNumber = "2120"
+            landmarkName = "-updatePageControl:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "Granite Expo eSign/Granite Expo eSign/TemplateViewController.m"
+            timestampString = "528108554.981254"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "2124"
+            endingLineNumber = "2124"
+            landmarkName = "-updatePageControl:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "Granite Expo eSign/Granite Expo eSign/TemplateViewController.m"
+            timestampString = "528108554.981431"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "2151"
+            endingLineNumber = "2151"
+            landmarkName = "-updatePageControl:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "Granite Expo eSign/Granite Expo eSign/TemplateViewController.m"
+            timestampString = "528108554.981515"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "954"
+            endingLineNumber = "954"
+            landmarkName = "-ControlButtonClicked:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "Granite Expo eSign/Granite Expo eSign/TemplateViewController.m"
+            timestampString = "528108554.981606"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "967"
+            endingLineNumber = "967"
+            landmarkName = "-CheckButtonClicked:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "Granite Expo eSign/Granite Expo eSign/DocumentTemplateViewController.m"
+            timestampString = "528108554.981691"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1225"
+            endingLineNumber = "1225"
+            landmarkName = "-focusControlView:frame:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "Granite Expo eSign/Granite Expo eSign/TemplateViewController.m"
+            timestampString = "528108554.982112"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "2113"
+            endingLineNumber = "2113"
+            landmarkName = "-tapRecognizer:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "Granite Expo eSign/Granite Expo eSign/TemplateViewController.m"
+            timestampString = "528108554.982191"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "2127"
+            endingLineNumber = "2127"
+            landmarkName = "-updatePageControl:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "Granite Expo eSign/Granite Expo eSign/TemplateViewController.m"
+            timestampString = "528108554.982256"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "2152"
+            endingLineNumber = "2152"
+            landmarkName = "-updatePageControl:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "Granite Expo eSign/Granite Expo eSign/DocumentTemplateViewController.m"
+            timestampString = "528108554.982325"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "504"
+            endingLineNumber = "504"
+            landmarkName = "-onSaveClicked:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "Granite Expo eSign/Granite Expo eSign/TemplateViewController.m"
+            timestampString = "528108554.98243"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "2123"
+            endingLineNumber = "2123"
+            landmarkName = "-updatePageControl:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "Granite Expo eSign/Granite Expo eSign/DocumentTemplateViewController.m"
+            timestampString = "528108554.982496"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1134"
+            endingLineNumber = "1134"
+            landmarkName = "-xStepperClick:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "Granite Expo eSign/Granite Expo eSign/DocumentTemplateViewController.m"
+            timestampString = "528108554.982575"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1212"
+            endingLineNumber = "1212"
+            landmarkName = "-setX:Y:W:H:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
 </Bucket>

+ 270 - 254
Ants Contract/Granite Expo eSign/GEIC - Home Improvement Contract 2017 Desktop.json

@@ -1,5 +1,18 @@
 {
     "page_0": {
+        "control_22": {
+            "height": 11,
+            "textAlignment": "center",
+            "pos_x": 523,
+            "width": 104,
+            "size": "8",
+            "field": "doc_number",
+            "pos_y": 917,
+            "type": "Label",
+            "required": true,
+            "value": "",
+            "dirty": false
+        },
         "control_1": {
             "width": 225,
             "tv_vmargin": 0.4,
@@ -77,8 +90,19 @@
             "required": true
         },
         "count": 22,
-        "control_10": {
+        "control_21": {
+            "height": 22,
+            "pos_x": 500,
             "required": true,
+            "width": 150,
+            "value": "",
+            "pos_y": 898,
+            "dirty": false,
+            "name": "BarCode",
+            "type": "Image"
+        },
+        "control_10": {
+            "value": "",
             "dirty": false,
             "width": 170,
             "pos_y": 368,
@@ -106,11 +130,11 @@
                     }
                 }
             },
-            "pos_x": 215,
-            "value": ""
+            "required": true,
+            "pos_x": 215
         },
         "control_11": {
-            "required": true,
+            "value": "",
             "disable": true,
             "dirty": false,
             "width": 88,
@@ -135,8 +159,8 @@
                     }
                 }
             },
-            "pos_x": 463,
-            "value": ""
+            "required": true,
+            "pos_x": 463
         },
         "control_19": {
             "width": 40,
@@ -201,6 +225,7 @@
             "size": "12",
             "pos_y": 19,
             "field": "sales_person",
+            "value": "",
             "dirty": false,
             "height": 14,
             "margin_left": "4",
@@ -466,7 +491,7 @@
             "pos_x": 122
         },
         "control_14": {
-            "pos_x": 616,
+            "name": "Customer Initial",
             "width": 30,
             "dirty": false,
             "aname": "Initial",
@@ -476,11 +501,11 @@
             "type": "Signature",
             "height": 15,
             "can_fill": "true",
-            "required": true,
-            "name": "Customer Initial"
+            "pos_x": 616,
+            "required": true
         },
         "control_15": {
-            "pos_x": 616,
+            "name": "Customer Initial",
             "width": 30,
             "dirty": false,
             "aname": "Initial",
@@ -490,11 +515,11 @@
             "type": "Signature",
             "height": 15,
             "can_fill": "true",
-            "required": true,
-            "name": "Customer Initial"
+            "pos_x": 616,
+            "required": true
         },
         "control_16": {
-            "pos_x": 616,
+            "name": "Customer Initial",
             "width": 30,
             "dirty": false,
             "aname": "Initial",
@@ -504,11 +529,11 @@
             "type": "Signature",
             "height": 15,
             "can_fill": "true",
-            "required": true,
-            "name": "Customer Initial"
+            "pos_x": 616,
+            "required": true
         },
         "control_17": {
-            "pos_x": 616,
+            "name": "Customer Initial",
             "width": 30,
             "dirty": false,
             "aname": "Initial",
@@ -518,11 +543,11 @@
             "type": "Signature",
             "height": 15,
             "can_fill": "true",
-            "required": true,
-            "name": "Customer Initial"
+            "pos_x": 616,
+            "required": true
         },
         "control_18": {
-            "pos_x": 616,
+            "name": "Customer Initial",
             "width": 30,
             "dirty": false,
             "aname": "Initial",
@@ -532,97 +557,87 @@
             "type": "Signature",
             "height": 15,
             "can_fill": "true",
-            "required": true,
-            "name": "Customer Initial"
-        },
-        "control_21": {
-            "height": 11,
-            "textAlignment": "center",
-            "pos_x": 523,
-            "width": 104,
-            "size": "8",
-            "field": "doc_number",
-            "pos_y": 917,
-            "type": "Label",
-            "required": true,
-            "value": "",
-            "dirty": false
+            "pos_x": 616,
+            "required": true
         },
         "control_20": {
-            "height": 22,
-            "pos_x": 500,
-            "name": "BarCode",
-            "width": 150,
-            "value": "",
-            "pos_y": 898,
+            "name": "Customer Initial",
+            "width": 30,
             "dirty": false,
-            "type": "Image",
+            "aname": "Initial",
+            "linewidth": 8,
+            "value": "",
+            "pos_y": 881,
+            "type": "Signature",
+            "height": 15,
+            "can_fill": "true",
+            "pos_x": 616,
             "required": true
         }
     },
     "page_1": {
         "control_1": {
-            "required": true,
-            "width": 198,
+            "name": "Decision Maker",
+            "width": 200,
             "tv_vmargin": 0.6,
             "aname": "Decision Maker",
-            "type": "TextView",
+            "type": "ignor",
             "size": "12",
-            "pos_y": 123,
+            "pos_y": 125,
             "field": "decision_maker",
             "value": "",
             "dirty": false,
-            "height": 18,
+            "height": 20,
             "margin_left": "4",
             "margin_top": "1",
-            "pos_x": 229,
-            "name": "Decision Maker"
+            "required": true,
+            "pos_x": 230
         },
         "control_3": {
-            "pos_x": 614,
-            "width": 28,
+            "name": "Customer Initial",
+            "width": 29,
             "dirty": false,
             "aname": "Initial",
             "linewidth": 8,
             "value": "",
-            "pos_y": 196,
+            "pos_y": 195,
             "type": "Signature",
-            "height": 13,
+            "height": 14,
             "can_fill": "true",
-            "required": true,
-            "name": "Customer Initial"
+            "pos_x": 616,
+            "required": true
         },
         "control_5": {
-            "pos_x": 614,
-            "width": 28,
+            "name": "Customer Initial",
+            "width": 29,
             "dirty": false,
             "aname": "Initial",
             "linewidth": 8,
             "value": "",
-            "pos_y": 260,
+            "pos_y": 258,
             "type": "Signature",
-            "height": 13,
+            "height": 14,
             "can_fill": "true",
-            "required": true,
-            "name": "Customer Initial"
+            "pos_x": 616,
+            "required": true
         },
         "control_7": {
-            "pos_x": 614,
-            "width": 28,
+            "name": "Customer Initial",
+            "width": 29,
             "dirty": false,
             "aname": "Initial",
             "linewidth": 8,
             "value": "",
-            "pos_y": 334,
+            "pos_y": 333,
             "type": "Signature",
-            "height": 13,
+            "height": 14,
             "can_fill": "true",
-            "required": true,
-            "name": "Customer Initial"
+            "pos_x": 616,
+            "required": true
         },
         "control_9": {
-            "width": 469,
-            "pos_y": 499,
+            "width": 464,
+            "pos_y": 501,
             "aname": "Joint Seams Option",
             "type": "Check",
             "field": "joint_seams",
@@ -630,7 +645,7 @@
             "single_select": true,
             "show_detail": true,
             "value": [],
-            "height": 41,
+            "height": 37,
             "dirty": false,
             "marker_size": 6,
             "cadedate": [
@@ -640,8 +655,8 @@
                            "Unpolished joint seams, which the Undersigned understands may not be smooth."
                            ],
                           [
-                           145,
-                           503
+                           147,
+                           502
                            ]
                           ],
                          [
@@ -650,7 +665,7 @@
                            "Polished joint seams, which the Undersigned understands that color dullness or shade variation may occur."
                            ],
                           [
-                           145,
+                           147,
                            515
                            ]
                           ],
@@ -660,216 +675,216 @@
                            "The Decision Maker will determine on-site with the assistance of the Contractor."
                            ],
                           [
-                           145,
-                           526
+                           147,
+                           527
                            ]
                           ]
                          ],
-            "required": true,
-            "pos_x": 142
+            "pos_x": 146,
+            "required": true
         },
         "count": 22,
         "control_21": {
-            "pos_x": 615,
-            "width": 28,
+            "name": "Customer Initial",
+            "width": 29,
             "dirty": false,
             "aname": "Initial",
             "linewidth": 8,
             "value": "",
-            "pos_y": 92,
+            "pos_y": 90,
             "type": "Signature",
-            "height": 13,
+            "height": 14,
             "can_fill": "true",
-            "required": true,
-            "name": "Customer Initial"
+            "pos_x": 616,
+            "required": true
         },
         "control_20": {
-            "pos_x": 614,
-            "width": 28,
+            "name": "Customer Initial",
+            "width": 29,
             "dirty": false,
             "aname": "Initial",
             "linewidth": 8,
             "value": "",
-            "pos_y": 398,
+            "pos_y": 397,
             "type": "Signature",
-            "height": 13,
+            "height": 14,
             "can_fill": "true",
-            "required": true,
-            "name": "Customer Initial"
+            "pos_x": 616,
+            "required": true
         },
         "control_10": {
-            "pos_x": 614,
-            "width": 28,
+            "name": "Customer Initial",
+            "width": 29,
             "dirty": false,
             "aname": "Initial",
             "linewidth": 8,
             "value": "",
-            "pos_y": 436,
+            "pos_y": 434,
             "type": "Signature",
-            "height": 13,
+            "height": 14,
             "can_fill": "true",
-            "required": true,
-            "name": "Customer Initial"
+            "pos_x": 616,
+            "required": true
         },
         "control_0": {
-            "pos_x": 614,
-            "width": 28,
+            "name": "Customer Initial",
+            "width": 29,
             "dirty": false,
             "aname": "Initial",
             "linewidth": 8,
             "value": "",
-            "pos_y": 129,
+            "pos_y": 127,
             "type": "Signature",
-            "height": 13,
+            "height": 14,
             "can_fill": "true",
-            "required": true,
-            "name": "Customer Initial"
+            "pos_x": 616,
+            "required": true
         },
         "control_2": {
-            "pos_x": 614,
-            "width": 28,
+            "name": "Customer Initial",
+            "width": 29,
             "dirty": false,
             "aname": "Initial",
             "linewidth": 8,
             "value": "",
-            "pos_y": 176,
+            "pos_y": 175,
             "type": "Signature",
-            "height": 13,
+            "height": 14,
             "can_fill": "true",
-            "required": true,
-            "name": "Customer Initial"
+            "pos_x": 616,
+            "required": true
         },
         "control_4": {
-            "pos_x": 614,
-            "width": 28,
+            "name": "Customer Initial",
+            "width": 29,
             "dirty": false,
             "aname": "Initial",
             "linewidth": 8,
             "value": "",
-            "pos_y": 222,
+            "pos_y": 221,
             "type": "Signature",
-            "height": 13,
+            "height": 14,
             "can_fill": "true",
-            "required": true,
-            "name": "Customer Initial"
+            "pos_x": 616,
+            "required": true
         },
         "control_6": {
-            "pos_x": 614,
-            "width": 28,
+            "name": "Customer Initial",
+            "width": 29,
             "dirty": false,
             "aname": "Initial",
             "linewidth": 8,
             "value": "",
-            "pos_y": 308,
+            "pos_y": 307,
             "type": "Signature",
-            "height": 13,
+            "height": 14,
             "can_fill": "true",
-            "required": true,
-            "name": "Customer Initial"
+            "pos_x": 616,
+            "required": true
         },
         "control_8": {
-            "pos_x": 614,
-            "width": 28,
+            "name": "Customer Initial",
+            "width": 29,
             "dirty": false,
             "aname": "Initial",
             "linewidth": 8,
             "value": "",
-            "pos_y": 361,
+            "pos_y": 360,
             "type": "Signature",
-            "height": 13,
+            "height": 14,
             "can_fill": "true",
-            "required": true,
-            "name": "Customer Initial"
+            "pos_x": 616,
+            "required": true
         },
         "control_11": {
-            "pos_x": 614,
-            "width": 28,
+            "name": "Customer Initial",
+            "width": 29,
             "dirty": false,
             "aname": "Initial",
             "linewidth": 8,
             "value": "",
-            "pos_y": 462,
+            "pos_y": 461,
             "type": "Signature",
-            "height": 13,
+            "height": 14,
             "can_fill": "true",
-            "required": true,
-            "name": "Customer Initial"
+            "pos_x": 616,
+            "required": true
         },
         "control_12": {
-            "pos_x": 614,
-            "width": 28,
+            "name": "Customer Initial",
+            "width": 29,
             "dirty": false,
             "aname": "Initial",
             "linewidth": 8,
             "value": "",
-            "pos_y": 523,
+            "pos_y": 522,
             "type": "Signature",
-            "height": 13,
+            "height": 14,
             "can_fill": "true",
-            "required": true,
-            "name": "Customer Initial"
+            "pos_x": 616,
+            "required": true
         },
         "control_13": {
-            "pos_x": 614,
-            "width": 28,
+            "name": "Customer Initial",
+            "width": 29,
             "dirty": false,
             "aname": "Initial",
             "linewidth": 8,
             "value": "",
             "pos_y": 560,
             "type": "Signature",
-            "height": 13,
+            "height": 14,
             "can_fill": "true",
-            "required": true,
-            "name": "Customer Initial"
+            "pos_x": 616,
+            "required": true
         },
         "control_14": {
-            "pos_x": 614,
-            "width": 28,
+            "name": "Customer Initial",
+            "width": 29,
             "dirty": false,
             "aname": "Initial",
             "linewidth": 8,
             "value": "",
-            "pos_y": 620,
+            "pos_y": 619,
             "type": "Signature",
-            "height": 13,
+            "height": 14,
             "can_fill": "true",
-            "required": true,
-            "name": "Customer Initial"
+            "pos_x": 616,
+            "required": true
         },
         "control_15": {
-            "pos_x": 614,
-            "width": 28,
+            "name": "Customer Initial",
+            "width": 29,
             "dirty": false,
             "aname": "Initial",
             "linewidth": 8,
             "value": "",
-            "pos_y": 637,
+            "pos_y": 636,
             "type": "Signature",
-            "height": 13,
+            "height": 14,
             "can_fill": "true",
-            "required": true,
-            "name": "Customer Initial"
+            "pos_x": 616,
+            "required": true
         },
         "control_16": {
-            "pos_x": 614,
-            "width": 28,
+            "name": "Customer Initial",
+            "width": 29,
             "dirty": false,
             "aname": "Initial",
             "linewidth": 8,
             "value": "",
-            "pos_y": 653,
+            "pos_y": 652,
             "type": "Signature",
-            "height": 13,
+            "height": 14,
             "can_fill": "true",
-            "required": true,
-            "name": "Customer Initial"
+            "pos_x": 616,
+            "required": true
         },
         "control_19": {
-            "height": 9,
+            "height": 11,
             "textAlignment": "center",
-            "pos_x": 522,
-            "width": 102,
+            "pos_x": 523,
+            "width": 104,
             "size": "8",
             "field": "doc_number",
             "pos_y": 917,
@@ -881,13 +896,13 @@
         "control_18": {
             "height": 22,
             "pos_x": 500,
-            "name": "BarCode",
+            "required": true,
             "width": 150,
             "value": "",
             "pos_y": 898,
             "dirty": false,
-            "type": "Image",
-            "required": true
+            "name": "BarCode",
+            "type": "Image"
         }
     },
     "signature_name": [
@@ -900,10 +915,10 @@
                        ],
     "page_2": {
         "control_9": {
-            "height": 10,
+            "height": 11,
             "textAlignment": "center",
-            "pos_x": 522,
-            "width": 103,
+            "pos_x": 523,
+            "width": 104,
             "size": "8",
             "field": "doc_number",
             "pos_y": 917,
@@ -914,60 +929,60 @@
         },
         "control_5": {
             "textAlignment": "center",
-            "width": 165,
+            "width": 164,
             "tv_vmargin": 0.3,
             "aname": "Homeowner Name",
             "type": "TextView",
             "size": "10",
-            "pos_y": 823,
+            "pos_y": 824,
             "field": "owner_name",
             "value": "",
             "dirty": false,
             "height": 13,
             "margin_top": "2",
             "required": true,
-            "pos_x": 473
+            "pos_x": 474
         },
         "control_3": {
             "textAlignment": "center",
-            "width": 165,
+            "width": 164,
             "tv_vmargin": 0.3,
             "aname": "Print Name",
             "type": "TextView",
             "size": "10",
-            "pos_y": 808,
+            "pos_y": 809,
             "field": "customer_name_1",
             "value": "",
             "dirty": false,
             "height": 13,
             "margin_top": "2",
             "required": true,
-            "pos_x": 473
+            "pos_x": 474
         },
         "control_1": {
-            "height": 24,
+            "height": 23,
             "pos_x": 405,
-            "name": "Homeowner",
+            "required": true,
             "linewidth": 8,
             "aname": "Homeowner Signature",
             "width": 145,
             "value": "",
             "pos_y": 762,
             "dirty": false,
-            "type": "Signature",
-            "required": true
+            "name": "Homeowner",
+            "type": "Signature"
         },
         "count": 10,
         "control_8": {
             "height": 22,
             "pos_x": 500,
-            "name": "BarCode",
+            "required": true,
             "width": 150,
             "value": "",
             "pos_y": 898,
             "dirty": false,
-            "type": "Image",
-            "required": true
+            "name": "BarCode",
+            "type": "Image"
         },
         "control_6": {
             "textAlignment": "center",
@@ -977,15 +992,15 @@
             "type": "TextView",
             "size": "10",
             "pos_y": 839,
-            "width": 165,
+            "width": 164,
             "field": "tel1",
             "format": "us_tel",
-            "height": 13,
+            "height": 14,
             "value": "",
             "dirty": false,
             "margin_top": "2",
             "required": true,
-            "pos_x": 473
+            "pos_x": 474
         },
         "control_4": {
             "height": 14,
@@ -1000,13 +1015,14 @@
         },
         "control_2": {
             "textAlignment": "center",
-            "width": 159,
+            "width": 160,
             "tv_vmargin": 0.3,
             "aname": "Agent Name",
             "type": "TextView",
             "size": "10",
-            "pos_y": 808,
+            "pos_y": 809,
             "field": "agent_name",
+            "value": "",
             "dirty": false,
             "height": 13,
             "margin_top": "2",
@@ -1016,7 +1032,7 @@
         "control_0": {
             "required_validation": true,
             "validation_code": "1111",
-            "required": true,
+            "name": "Agent Of Contractor",
             "width": 145,
             "pos_y": 762,
             "aname": "Agent Signature",
@@ -1024,17 +1040,17 @@
             "type": "Signature",
             "value": "",
             "dirty": false,
-            "height": 24,
-            "pos_x": 163,
-            "name": "Agent Of Contractor"
+            "height": 23,
+            "required": true,
+            "pos_x": 163
         }
     },
     "page_3": {
         "control_9": {
-            "height": 10,
+            "height": 11,
             "textAlignment": "center",
-            "pos_x": 522,
-            "width": 103,
+            "pos_x": 523,
+            "width": 104,
             "size": "8",
             "field": "doc_number",
             "pos_y": 917,
@@ -1045,21 +1061,21 @@
         },
         "control_7": {
             "disable": true,
-            "width": 66,
+            "width": 62,
             "pos_y": 261,
             "aname": "Demolition Date",
             "type": "DatePicker",
             "field": "demolition_date",
             "value": "NA",
             "dirty": false,
-            "height": 24,
+            "height": 23,
             "margin_left": "4",
             "margin_top": "1",
             "required": true,
-            "pos_x": 560
+            "pos_x": 564
         },
         "control_5": {
-            "pos_x": 149,
+            "name": "Homeowner",
             "disable": true,
             "width": 145,
             "dirty": false,
@@ -1068,12 +1084,12 @@
             "pos_y": 261,
             "type": "Signature",
             "value": "",
-            "height": 24,
-            "required": true,
-            "name": "Homeowner"
+            "height": 23,
+            "pos_x": 150,
+            "required": true
         },
         "control_3": {
-            "required": true,
+            "name": "Customer Initial",
             "disable": true,
             "width": 29,
             "pos_y": 176,
@@ -1084,11 +1100,11 @@
             "dirty": false,
             "height": 14,
             "can_fill": "true",
-            "pos_x": 616,
-            "name": "Customer Initial"
+            "required": true,
+            "pos_x": 616
         },
         "control_1": {
-            "required": true,
+            "name": "Customer Initial",
             "disable": true,
             "width": 29,
             "pos_y": 112,
@@ -1099,38 +1115,38 @@
             "dirty": false,
             "height": 14,
             "can_fill": "true",
-            "pos_x": 616,
-            "name": "Customer Initial"
+            "required": true,
+            "pos_x": 616
         },
         "count": 10,
         "control_8": {
             "height": 22,
             "pos_x": 500,
-            "name": "BarCode",
+            "required": true,
             "width": 150,
             "value": "",
             "pos_y": 898,
             "dirty": false,
-            "type": "Image",
-            "required": true
+            "name": "BarCode",
+            "type": "Image"
         },
         "control_6": {
             "disable": true,
-            "width": 195,
+            "width": 194,
             "pos_y": 261,
             "aname": "Demolition Print name",
             "type": "TextView",
             "field": "demolition_printname",
             "value": "NA",
             "dirty": false,
-            "height": 24,
+            "height": 23,
             "margin_left": "4",
             "margin_top": "1",
             "required": true,
-            "pos_x": 344
+            "pos_x": 345
         },
         "control_4": {
-            "required": true,
+            "name": "Customer Initial",
             "disable": true,
             "width": 29,
             "pos_y": 214,
@@ -1141,11 +1157,11 @@
             "dirty": false,
             "height": 14,
             "can_fill": "true",
-            "pos_x": 616,
-            "name": "Customer Initial"
+            "required": true,
+            "pos_x": 616
         },
         "control_2": {
-            "required": true,
+            "name": "Customer Initial",
             "disable": true,
             "width": 29,
             "pos_y": 139,
@@ -1156,11 +1172,11 @@
             "dirty": false,
             "height": 14,
             "can_fill": "true",
-            "pos_x": 616,
-            "name": "Customer Initial"
+            "required": true,
+            "pos_x": 616
         },
         "control_0": {
-            "required": true,
+            "name": "Customer Initial",
             "disable": true,
             "width": 29,
             "pos_y": 95,
@@ -1171,77 +1187,77 @@
             "dirty": false,
             "height": 14,
             "can_fill": "true",
-            "pos_x": 616,
-            "name": "Customer Initial"
+            "required": true,
+            "pos_x": 616
         }
     },
     "count": 5,
     "page_4": {
         "control_4": {
-            "height": 22,
-            "pos_x": 500,
-            "name": "BarCode",
-            "width": 150,
+            "height": 11,
+            "textAlignment": "center",
+            "pos_x": 523,
+            "width": 104,
+            "size": "8",
+            "field": "doc_number",
+            "pos_y": 917,
+            "type": "Label",
+            "required": true,
             "value": "",
-            "pos_y": 898,
-            "dirty": false,
-            "type": "Image",
-            "required": true
+            "dirty": false
         },
         "control_1": {
-            "pos_x": 318,
+            "name": "Homeowner Print Name",
             "dirty": false,
-            "width": 147,
+            "width": 148,
             "aname": "Handwrite Print Name",
             "linewidth": 5,
             "field": "homeowner_printname",
-            "pos_y": 500,
+            "pos_y": 501,
             "type": "TextView",
             "value": "",
-            "height": 24,
-            "required": true,
-            "name": "Homeowner Print Name"
+            "height": 23,
+            "pos_x": 318,
+            "required": true
         },
         "count": 5,
         "control_2": {
-            "pos_x": 526,
+            "name": "Date",
             "dirty": false,
             "width": 70,
             "aname": "Handwrite date",
             "linewidth": 5,
             "field": "subcontractors_date",
-            "pos_y": 500,
+            "pos_y": 501,
             "type": "DatePicker",
             "value": "",
-            "height": 24,
-            "required": true,
-            "name": "Date"
+            "height": 23,
+            "pos_x": 528,
+            "required": true
         },
         "control_3": {
-            "height": 10,
-            "textAlignment": "center",
-            "pos_x": 522,
-            "width": 103,
-            "size": "8",
-            "field": "doc_number",
-            "pos_y": 917,
-            "type": "Label",
+            "height": 22,
+            "pos_x": 500,
             "required": true,
+            "width": 150,
             "value": "",
-            "dirty": false
+            "pos_y": 898,
+            "dirty": false,
+            "name": "BarCode",
+            "type": "Image"
         },
         "control_0": {
-            "height": 24,
+            "height": 23,
             "pos_x": 126,
-            "name": "Homeowner",
+            "required": true,
             "linewidth": 8,
             "aname": "Homeowner Signature",
             "width": 145,
             "value": "",
-            "pos_y": 500,
+            "pos_y": 501,
             "dirty": false,
-            "type": "Signature",
-            "required": true
+            "name": "Homeowner",
+            "type": "Signature"
         }
     }
 }

+ 4 - 174
Ants Contract/Granite Expo eSign/Granite Expo eSign/DocumentTemplateViewController.m

@@ -712,179 +712,6 @@
     
     
     
-    
-    
-    
-    //  return;
-    
-    //    {
-    //
-    //
-    //        UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait..." title:@"Saving"];
-    //
-    //
-    ////        self.uploadProgress.progress = 0;
-    //
-    //        AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
-    //
-    //
-    //        {
-    //
-    //            //    UIAlertView * waitalert = [[UIAlertView alloc] initWithTitle:@"wait" message:@"uploading" delegate:nil cancelButtonTitle:nil otherButtonTitles:nil, nil];
-    //            //    [waitalert show];
-    //
-    ////            NSData *imageData = UIImagePNGRepresentation(self.imgview.image);
-    //
-    //            AFHTTPRequestSerializer* serializer=[AFHTTPRequestSerializer serializer] ;
-    //
-    //
-    //
-    //            NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
-    //
-    ////            if(appDelegate.user!=nil)
-    ////                [params setValue:appDelegate.user forKey:@"user"];
-    ////            //    if(appDelegate.contact_id!=nil)
-    ////            //        [params setValue:appDelegate.contact_id forKey:@"contactId"];
-    ////            if(appDelegate.password!=nil)
-    ////                [params setValue:appDelegate.password forKey:@"password"];
-    //
-    //
-    //            [params setValue:[AESCrypt AES128Encrypt:appDelegate.user  key:@"usai2010"] forKey:@"user"];
-    //            [params setValue:[AESCrypt AES128Encrypt:appDelegate.password  key:@"usai2010"] forKey:@"password"];
-    //
-    //            [params setValue:@"deviceMain" forKey:@"_operate"];
-    //
-    //
-    //            UIDevice * dev = [UIDevice currentDevice];
-    //            NSUUID* uuid =dev.identifierForVendor;
-    //#if TARGET_IPHONE_SIMULATOR//模拟器
-    //            [params setValue:@"simulator_uuid" forKey:@"deviceid"];
-    //#elif TARGET_OS_IPHONE//真机
-    //            [params setValue:uuid.UUIDString forKey:@"deviceid"];
-    //#endif
-    //
-    //
-    //
-    //            NSMutableString *body=[[NSMutableString alloc]init];
-    //            //参数的集合的所有key的集合
-    //            NSArray *keys= [params allKeys];
-    //            DebugLog(@"================parms==================");
-    //            //遍历keys
-    //            for(int i=0;i<[keys count];i++)
-    //            {
-    //                //得到当前key
-    //                NSString *key=[keys objectAtIndex:i];
-    //                //如果key不是pic,说明value是字符类型,比如name:Boris
-    //                if(![key isEqualToString:@"pic"])
-    //                {
-    ////                    //添加分界线,换行
-    ////                    [body appendFormat:@"%@\r\n",MPboundary];
-    //                    //添加字段名称,换2行
-    //                    [body appendFormat:@"Content-Disposition: form-data; name=\"%@\"\r\n\r\n",key];
-    //                    //添加字段的值
-    //                    [body appendFormat:@"%@\r\n",[params objectForKey:key]];
-    //                    DebugLog(@"parameter: key=%@   value=%@",key,[params objectForKey:key]);
-    //                }
-    //            }
-    //            DebugLog(@"================parms==================");
-    //
-    //            NSData* data = [NSData dataWithContentsOfFile: zipfile];
-    //
-    //            NSMutableURLRequest *request = [serializer multipartFormRequestWithMethod:@"POST" URLString:URL_UPLOAD_PDF parameters:params constructingBodyWithBlock:^(id<AFMultipartFormData> formData) {
-    //                [formData appendPartWithFileData:data name:@"upfile" fileName:[zipfile lastPathComponent] mimeType:@"application/zip"];
-    //            } error:nil];
-    //
-    //
-    //            //        NSMutableURLRequest *request = [[AFHTTPRequestSerializer serializer] multipartFormRequestWithMethod:@"POST" URLString:WEBSERVICE_URL parameters:nil constructingBodyWithBlock:^(id<AFMultipartFormData> formData) {
-    //            //            [formData appendPartWithFileData:imageData name:@"upfile" fileName:@"test" mimeType:@"image/png"];
-    //            //        } error:nil];
-    //            //
-    //            AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]];
-    //
-    //
-    //
-    //            //manager.responseSerializer.acceptableContentTypes = [self.operationManager.responseSerializer.acceptableContentTypes setByAddingObject:@"text/html"];
-    //
-    //            //manager.responseSerializer.acceptableContentTypes = [NSSet setWithObject:@"text/html"];
-    //
-    //            //
-    //            NSProgress *progress = nil;
-    //
-    //            NSURLSessionUploadTask *uploadTask = [manager uploadTaskWithStreamedRequest:request progress:&progress completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) {
-    //
-    //                //        [progress removeObserver:self forKeyPath:@"fractionCompleted"];
-    //
-    //
-    //                 [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
-    //
-    //                if (error) {
-    //
-    //                    NSString* err_msg = [error localizedDescription];
-    //                    DebugLog(@"%@",err_msg);// [self.view updateWithMessage:[NSString stringWithFormat:@"Error : %@!", error.debugDescription]];
-    //
-    //
-    //                    NSMutableString *str = [[NSMutableString alloc] initWithData:responseObject encoding:NSUTF8StringEncoding];
-    //
-    //                    DebugLog(@"data string: %@",str);
-    //                    [RAUtils message_alert:@"Can not connect to server please try again." title:@"Save document" controller:weakSelf] ;
-    //
-    //                } else {
-    //                    DebugLog(@"response ");
-    //
-    //
-    //
-    //                    NSData *data = [NSJSONSerialization dataWithJSONObject:(NSDictionary*)responseObject options:kNilOptions error:nil];
-    //
-    //                    // 再将NSData转为字符串
-    //                    NSString *jsonStr = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
-    //
-    //                    //            NSMutableString *str = [[NSMutableString alloc] initWithData:responseObject encoding:NSUTF8StringEncoding];
-    //
-    //                    DebugLog(@"data string: %@",jsonStr);
-    //
-    //                    NSDictionary* json = responseObject;
-    //
-    //
-    //
-    //
-    //                    if([[json valueForKey:@"result"] intValue]==2)
-    //                    {
-    //
-    //                        [weakSelf.navigationController popToRootViewControllerAnimated:false];
-    ////
-    ////
-    //                        if(weakSelf.OnSave)
-    //                            weakSelf.OnSave(pdffile);
-    //
-    //
-    //                    }
-    //                    else
-    //                    {
-    //                        [RAUtils message_alert:[json valueForKey:@"err_msg"] title:@"Save document" controller:self] ;
-    //                    }
-    //
-    //
-    //                }
-    //                //  [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
-    //            }];
-    //
-    //
-    //
-    //
-    //          //  [self.uploadProgress setProgressWithUploadProgressOfTask:uploadTask animated:true];
-    //            //
-    //
-    //
-    //
-    //
-    //
-    //
-    //            [uploadTask resume];
-    //
-    //        }
-    //    }
-    
-    //  [PDFUtils savep
 }
 
 
@@ -1367,10 +1194,13 @@
 }
 
 - (void)savePageControl {
+    
+    if(!self.focusView)
+        return;
     if (self.currentPageViewController) {
         
         TemplateViewController *vc = self.currentPageViewController;
-        NSDictionary *page = [vc updatePageControl];
+        NSDictionary *page = [vc updatePageControl:self.focusView];
         self.controlTemplate[[NSString stringWithFormat:@"page_%lu",(unsigned long)vc.pageIndex]] = page;
     }
 }

+ 1 - 1
Ants Contract/Granite Expo eSign/Granite Expo eSign/TemplateViewController.h

@@ -46,6 +46,6 @@
 @property (nonatomic,weak) id<TemplateUpdateControlFrame> controlUpdateDelegate;
 
 
-- (NSDictionary *)updatePageControl;
+- (NSDictionary *)updatePageControl:(UIView*) control ;
 
 @end

+ 151 - 73
Ants Contract/Granite Expo eSign/Granite Expo eSign/TemplateViewController.m

@@ -283,6 +283,8 @@ typedef enum {
 
 -(CGRect) scaleControl:(CGRect) frame from:(CGSize)fwindowsize to:(CGSize)twindowsize
 {
+    if(CGSizeEqualToSize(fwindowsize, twindowsize))
+        return frame;
     CGRect pdfsize=CGPDFPageGetBoxRect(self.pageRef, kCGPDFMediaBox);
     frame=[PDFUtils WindowRect2PDFRect:frame pdf_rect:pdfsize window_size:fwindowsize];
     
@@ -2112,68 +2114,66 @@ typedef enum {
     }
 }
 
-- (NSDictionary *)updatePageControl {
+- (NSDictionary *)updatePageControl:(UIView*) control {
     
-    int count = [self.page_controlTemplate[@"count"] intValue];
-    for(int i=0;i<count;i++)
+//    int count = [self.page_controlTemplate[@"count"] intValue];
+    
+    
+    
+    long index = control.tag - CONTROL_BASE;
+    NSMutableDictionary * json = [self.page_controlTemplate [[NSString stringWithFormat:@"control_%ld",index]] mutableCopy];
+
+    int k =-1;
+    if(json==nil)
     {
-        NSMutableDictionary * control = [self.page_controlTemplate [[NSString stringWithFormat:@"control_%d",i]] mutableCopy];
-        if (control == nil) {
-            continue;
-        }
-        
-        int tag = i + CONTROL_BASE;
-        UIView *v = [self.editControlView viewWithTag:tag];
-        if (v == nil) {
-            continue;
-        }
-        
+        index = (control.tag- CHECK_BASE)/1000;
+        k=(control.tag- CHECK_BASE)%1000;
+        json = [self.page_controlTemplate [[NSString stringWithFormat:@"control_%ld",index]] mutableCopy];
+    }
+    else
+    {
+        CGRect frame = [self scaleControl:control.frame from:self.editControlView.bounds.size to:CGSizeMake(768, 960)];
+        int x = frame.origin.x+0.5;
+        int y = frame.origin.y+0.5;
+        int w = frame.size.width+0.5;
+        int h = frame.size.height+0.5;
+        [json setValue:@(x) forKey:@"pos_x"];
+        [json setValue:@(y) forKey:@"pos_y"];
+        [json setValue:@(w) forKey:@"width"];
+        [json setValue:@(h) forKey:@"height"];
+    }
+    
+    
+    
 
-        CGRect frame = [self scaleControl:v.frame from:self.editControlView.bounds.size to:CGSizeMake(768, 960)];
-        
-        int x = frame.origin.x;
-        int y = frame.origin.y;
-        int w = frame.size.width;
-        int h = frame.size.height;
-        
-        [control setValue:@(x) forKey:@"pos_x"];
-        [control setValue:@(y) forKey:@"pos_y"];
-        [control setValue:@(w) forKey:@"width"];
-        [control setValue:@(h) forKey:@"height"];
-        
-        
-        if([control[@"type"] isEqualToString:@"TextView"])
-        {
-            
-        }
-        else if([control[@"type"] isEqualToString:@"Button"])
+    
+    
+    if([json[@"type"] isEqualToString:@"Check"]&& k>=0)
+    {
+        NSMutableArray* cadedate = [json[@"cadedate"] mutableCopy];
+        //for(int k = 0; k < cadedate.count; k++)
         {
             
-            
-        }
-        else if([control[@"type"] isEqualToString:@"Check"])
-        {
-           NSMutableArray* cadedate = [control[@"cadedate"] mutableCopy];
-            for(int k = 0; k < cadedate.count; k++)
+            NSMutableArray* item = [cadedate[k] mutableCopy];
+            NSMutableArray* checkmarker = [item[1] mutableCopy];
+            if(checkmarker.count==0)
             {
-                
-                NSMutableArray* item = [cadedate[k] mutableCopy];
-                NSMutableArray* checkmarker = [item[1] mutableCopy];
-                if(checkmarker.count==0)
+               // continue;
+            }
+            else
+            {
+                UIView *marker = [self.editControlView viewWithTag:CHECK_BASE + index * 1000 + k];
+                if (marker == nil) {
+//                    continue;
+                }
+                else
                 {
-                    continue;
-                } else {
-                    UIView *marker = [self.editControlView viewWithTag:CHECK_BASE + i * 1000 + k];
-                    if (marker == nil) {
-                        continue;
-                    }
-                    
                     CGRect marker_frame = [self scaleControl:marker.frame from:self.editControlView.bounds.size to:CGSizeMake(768, 960)];
                     
                     int marker_x = marker_frame.origin.x;
                     int marker_y = marker_frame.origin.y;
-                    int marker_w = marker_frame.size.width;
-                    int marker_h = marker_frame.size.height;
+                    //                int marker_w = marker_frame.size.width;
+                    //                int marker_h = marker_frame.size.height;
                     
                     [checkmarker replaceObjectAtIndex:0 withObject:@(marker_x)];
                     [checkmarker replaceObjectAtIndex:1 withObject:@(marker_y)];
@@ -2182,34 +2182,112 @@ typedef enum {
                     
                     [cadedate replaceObjectAtIndex:k withObject:item];
                 }
-                
-                
+
             }
-            [control setObject:cadedate forKey:@"cadedate"];
-            
-        }
-        else if([control[@"type"] isEqualToString:@"Signature"])
-        {
-            
-            
-        }
-        else if([control[@"type"] isEqualToString:@"Image"])
-        {
-            
-            
-        }
-        else if([control[@"type"] isEqualToString:@"Label"])
-        {
-            
             
-        }
-        else if([control[@"type"] isEqualToString:@"DatePicker"])
-        {
             
         }
+        [json setObject:cadedate forKey:@"cadedate"];
         
-        [self.page_controlTemplate setObject:control forKey:[NSString stringWithFormat:@"control_%d",i]];
     }
+    [self.page_controlTemplate setObject:json forKey:[NSString stringWithFormat:@"control_%ld",index]];
+
+    
+//    for(int i=0;i<count;i++)
+//    {
+//        NSMutableDictionary * control = [self.page_controlTemplate [[NSString stringWithFormat:@"control_%d",i]] mutableCopy];
+//        if (control == nil) {
+//            continue;
+//        }
+//
+//        int tag = i + CONTROL_BASE;
+//        UIView *v = [self.editControlView viewWithTag:tag];
+//        if (v == nil) {
+//            continue;
+//        }
+//
+//
+//        CGRect frame = [self scaleControl:v.frame from:self.editControlView.bounds.size to:CGSizeMake(768, 960)];
+//
+//        int x = frame.origin.x;
+//        int y = frame.origin.y;
+//        int w = frame.size.width;
+//        int h = frame.size.height;
+//
+//        [control setValue:@(x) forKey:@"pos_x"];
+//        [control setValue:@(y) forKey:@"pos_y"];
+//        [control setValue:@(w) forKey:@"width"];
+//        [control setValue:@(h) forKey:@"height"];
+//
+//
+//        if([control[@"type"] isEqualToString:@"TextView"])
+//        {
+//
+//        }
+//        else if([control[@"type"] isEqualToString:@"Button"])
+//        {
+//
+//
+//        }
+//        else if([control[@"type"] isEqualToString:@"Check"])
+//        {
+//           NSMutableArray* cadedate = [control[@"cadedate"] mutableCopy];
+//            for(int k = 0; k < cadedate.count; k++)
+//            {
+//
+//                NSMutableArray* item = [cadedate[k] mutableCopy];
+//                NSMutableArray* checkmarker = [item[1] mutableCopy];
+//                if(checkmarker.count==0)
+//                {
+//                    continue;
+//                } else {
+//                    UIView *marker = [self.editControlView viewWithTag:CHECK_BASE + i * 1000 + k];
+//                    if (marker == nil) {
+//                        continue;
+//                    }
+//
+//                    CGRect marker_frame = [self scaleControl:marker.frame from:self.editControlView.bounds.size to:CGSizeMake(768, 960)];
+//
+//                    int marker_x = marker_frame.origin.x;
+//                    int marker_y = marker_frame.origin.y;
+//                    int marker_w = marker_frame.size.width;
+//                    int marker_h = marker_frame.size.height;
+//
+//                    [checkmarker replaceObjectAtIndex:0 withObject:@(marker_x)];
+//                    [checkmarker replaceObjectAtIndex:1 withObject:@(marker_y)];
+//
+//                    [item replaceObjectAtIndex:1 withObject:checkmarker];
+//
+//                    [cadedate replaceObjectAtIndex:k withObject:item];
+//                }
+//
+//
+//            }
+//            [control setObject:cadedate forKey:@"cadedate"];
+//
+//        }
+//        else if([control[@"type"] isEqualToString:@"Signature"])
+//        {
+//
+//
+//        }
+//        else if([control[@"type"] isEqualToString:@"Image"])
+//        {
+//
+//
+//        }
+//        else if([control[@"type"] isEqualToString:@"Label"])
+//        {
+//
+//
+//        }
+//        else if([control[@"type"] isEqualToString:@"DatePicker"])
+//        {
+//
+//        }
+//
+//        [self.page_controlTemplate setObject:control forKey:[NSString stringWithFormat:@"control_%d",i]];
+//    }
 
     
     return self.page_controlTemplate;