Explorar el Código

20170118

eSign 1.2 testversion
Ray Zhang hace 9 años
padre
commit
ccb3a10196

+ 6 - 4
RedAnt ERP Mobile/common/Functions/signature/signature.storyboard

@@ -1,10 +1,9 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="15G1212" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="16A323" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
     <device id="ipad9_7" orientation="portrait">
         <adaptation id="fullscreen"/>
     </device>
     <dependencies>
-        <deployment identifier="iOS"/>
         <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -68,7 +67,10 @@
                                                 <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="npR-Us-Ywj">
                                                     <rect key="frame" x="303" y="8" width="65" height="30"/>
                                                     <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
-                                                    <state key="normal" title="Fill"/>
+                                                    <color key="backgroundColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                                    <state key="normal" title="Fill">
+                                                        <color key="titleColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
+                                                    </state>
                                                     <connections>
                                                         <action selector="onFillClick:" destination="xQW-5p-fJu" eventType="touchUpInside" id="Gy2-jQ-W8F"/>
                                                     </connections>

+ 1 - 1
RedAnt ERP Mobile/common/PDFUtils.h

@@ -14,7 +14,7 @@
 +(CGPDFDocumentRef)OpenPDF:(NSString*) file;
 
 //+ (CGRect)scaleToSize:(CGRect )from to:(CGSize)to;
-+(NSString*)SavePDF:(NSMutableDictionary*) controlTemplate source:(CGPDFDocumentRef )document window_rect:(CGRect)window_rect;
++(NSString*)SavePDF:(NSMutableDictionary*) controlTemplate source:(CGPDFDocumentRef )document window_rect:(CGRect)window_rect name:(NSString*)name;
 +(NSMutableDictionary*) loadControl:(NSString*)templateName;
 
 @end

+ 6 - 3
RedAnt ERP Mobile/common/PDFUtils.m

@@ -177,7 +177,7 @@
 }
 
 
-+(NSString*)SavePDF:(NSMutableDictionary*) controlTemplate source:(CGPDFDocumentRef )document window_rect:(CGRect)window_rect
++(NSString*)SavePDF:(NSMutableDictionary*) controlTemplate source:(CGPDFDocumentRef )document window_rect:(CGRect)window_rect name:(NSString*)name
 {
     
     //获取路径
@@ -185,8 +185,9 @@
     NSArray *paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);//坐标
     
     NSString *saveDirectory=[paths objectAtIndex:0];
-    
-    NSString *saveFileName=[NSString stringWithFormat:@"%@.pdf",[[NSUUID UUID ] UUIDString] ] ;;
+    if(name==nil)
+        name=[[NSUUID UUID ] UUIDString];
+    NSString *saveFileName=[NSString stringWithFormat:@"%@.pdf",name ] ;
     
     NSString *newFilePath=[saveDirectory stringByAppendingPathComponent:saveFileName];
     
@@ -322,11 +323,13 @@
                 if(textAlignment.length==0)
                     textAlignment = @"Left";
                 double margin_left = [control[@"margin_left"] doubleValue];
+                double margin_top = [control[@"margin_top"] doubleValue];
                 
                 
                 control_drawable=[[TextDrawable alloc] init:[self WindowRect2PDFRect:control_rect pdf_rect:papersize window_size:window_rect.size] source_type:@"const" source:value textAlignment:textAlignment vAlign:@"middle" size:size];
                 
                 [control_drawable setMargin_left:margin_left];
+                [control_drawable setMargin_top:margin_top];
             }
             else if([control_type isEqualToString:@"Check"])
             {