Ver código fonte

161220

Split class RAUtils, iSalesDB
Ray Zhang 9 anos atrás
pai
commit
9184c61e4e

BIN
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/Ray.xcuserdatad/UserInterfaceState.xcuserstate


+ 15 - 0
RedAnt ERP Mobile/common/ImageUtils.h

@@ -0,0 +1,15 @@
+//
+//  ImageUtils.h
+//  AntsContract
+//
+//  Created by Ray on 12/20/16.
+//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import <UIKit/UIKit.h>
+@interface ImageUtils : NSObject
++ (CGRect)scaleToSize:(CGRect )from to:(CGSize)to;
++ (CGRect)rectAlign:(CGRect )parent rect:(CGRect)rect hAlign:(NSString*)hAlign vAlign:(NSString*)vAlign;
++ (NSData*) load_cached_img:(NSString*) filename loadFrom:(NSString*) path;
+@end

+ 116 - 0
RedAnt ERP Mobile/common/ImageUtils.m

@@ -0,0 +1,116 @@
+//
+//  ImageUtils.m
+//  AntsContract
+//
+//  Created by Ray on 12/20/16.
+//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
+//
+
+#import "ImageUtils.h"
+#import "AppDelegate.h"
+
+@implementation ImageUtils
++ (CGRect)scaleToSize:(CGRect )from to:(CGSize)to
+{
+    if(from.size.width/from.size.height>to.width/to.height)
+    {
+        return CGRectMake(from.origin.x, from.origin.y, to.width, to.width*from.size.height/from.size.width);
+    }
+    else
+    {
+        return CGRectMake(from.origin.x, from.origin.y, to.height*from.size.width/from.size.height, to.height);
+    }
+    //    // 创建一个bitmap的context
+    //    // 并把它设置成为当前正在使用的context
+    //    UIGraphicsBeginImageContext(size);
+    //    // 绘制改变大小的图片
+    //    [img drawInRect:CGRectMake(0, 0, size.width, size.height)];
+    //    // 从当前context中创建一个改变大小后的图片
+    //    UIImage* scaledImage = UIGraphicsGetImageFromCurrentImageContext();
+    //    // 使当前的context出堆栈
+    //    UIGraphicsEndImageContext();
+    //    // 返回新的改变大小后的图片
+    //
+    //    //   NSData  *imageData=UIImageJPEGRepresentation(scaledImage, 1.f);
+    //    return scaledImage;
+}
+
++ (CGRect)rectAlign:(CGRect )parent rect:(CGRect)rect hAlign:(NSString*)hAlign vAlign:(NSString*)vAlign
+{
+    //    double cx=parent.origin.x+parent.size.width/2;
+    //    double cy=parent.origin.y+parent.size.height/2;
+    CGPoint centerpoint= CGPointMake(parent.origin.x+parent.size.width/2,parent.origin.y+parent.size.height/2);
+    if([hAlign.lowercaseString isEqualToString:@"center"])
+    {
+        rect=CGRectMake(centerpoint.x-rect.size.width/2, rect.origin.y, rect.size.width, rect.size.height);
+    }
+    else
+        if([hAlign.lowercaseString isEqualToString:@"left"])
+        {
+            rect=CGRectMake(parent.origin.x, rect.origin.y, rect.size.width, rect.size.height);
+        }
+        else
+            if([hAlign.lowercaseString isEqualToString:@"right"])
+            {
+                rect=CGRectMake(parent.origin.x+parent.size.width-rect.size.width, rect.origin.y, rect.size.width, rect.size.height);
+            }
+    if([vAlign.lowercaseString isEqualToString:@"middle"])
+    {
+        rect=CGRectMake(rect.origin.x, centerpoint.y-rect.size.height/2, rect.size.width, rect.size.height);
+    }
+    
+    return rect;
+    
+}
++ (NSData*) load_cached_img:(NSString*) filename loadFrom:(NSString*) path
+{
+    if(path.length==0)
+        return nil;
+    
+    path=[path stringByReplacingOccurrencesOfString:@"https://" withString:@""];
+    path=[path stringByReplacingOccurrencesOfString:@"http://" withString:@""];
+    //    path=[path stringByReplacingOccurrencesOfString:filename withString:@""];
+    
+    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+    
+    if(appDelegate.bEnable_Cache==false)
+        return nil;
+    
+    
+    NSData* data = nil;
+    
+    
+    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
+    NSString *cachefolder = [paths objectAtIndex:0];
+    NSString *img_cache = [cachefolder stringByAppendingPathComponent:@"img_cache"];
+    NSString *filePath = [img_cache stringByAppendingPathComponent:path];
+    
+    NSFileManager* fileManager = [NSFileManager defaultManager];
+    if(  [fileManager fileExistsAtPath:filePath ])
+    {
+        data = [NSData dataWithContentsOfFile: filePath];
+    }
+    
+    //    NSString* sqliteQuery = [NSString stringWithFormat:@"SELECT img FROM img_cache WHERE name = '%@'", filename];
+    //    sqlite3_stmt* statement;
+    
+    //    sqlite3 *db = [self get_db];
+    //
+    ////    if( sqlite3_prepare_v2(db, [sqliteQuery UTF8String], -1, &statement, NULL) == SQLITE_OK )
+    ////    {
+    ////        if( sqlite3_step(statement) == SQLITE_ROW )
+    ////        {
+    ////            int length = sqlite3_column_bytes(statement, 0);
+    ////            data       = [NSData dataWithBytes:sqlite3_column_blob(statement, 0) length:length];
+    ////        }
+    ////    }
+    //
+    //    // Finalize and close database.
+    //    sqlite3_finalize(statement);
+    
+    
+    // [iSalesDB close_db:db];
+    return data;
+    
+}
+@end

+ 18 - 0
RedAnt ERP Mobile/common/PDFUtils.h

@@ -0,0 +1,18 @@
+//
+//  PDFUtils.h
+//  AntsContract
+//
+//  Created by Ray on 12/20/16.
+//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import <UIKit/UIKit.h>
+@interface PDFUtils : NSObject
++(void) addSignature :(UIImage*) img to:(NSMutableDictionary*)signatureData;
++(NSString *) saveTempSignature:(NSData *) image;
++(CGPDFDocumentRef)OpenPDF:(NSString*) file;
+
+//+ (CGRect)scaleToSize:(CGRect )from to:(CGSize)to;
++(void)SavePDF:(NSMutableDictionary*) controlTemplate source:(CGPDFDocumentRef )document;
+@end

+ 221 - 0
RedAnt ERP Mobile/common/PDFUtils.m

@@ -0,0 +1,221 @@
+//
+//  PDFUtils.m
+//  AntsContract
+//
+//  Created by Ray on 12/20/16.
+//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
+//
+
+#import "PDFUtils.h"
+#import "PDFPage.h"
+#import "LineDrawable.h"
+
+@implementation PDFUtils
++(void) addSignature :(UIImage*) img to:(NSMutableDictionary*)signatureData
+{
+    
+    
+    if(true)
+    {
+        NSString* newfile=[self saveTempSignature:UIImagePNGRepresentation(img)];
+        
+        int newidx = [signatureData[@"count"] intValue];
+        
+        // [@"file"]= newfile;
+        
+        NSMutableDictionary* item = [[NSMutableDictionary alloc] init];
+        item[@"file"]=newfile;
+        signatureData[[NSString stringWithFormat:@"item_%d",newidx]] = item;
+        signatureData[@"count"]=[NSNumber numberWithInt:newidx+1];
+        
+        
+        
+    }
+    
+    
+    
+}
++(NSString *) saveTempSignature:(NSData *) image
+{
+    NSString* tempDir = NSTemporaryDirectory();
+    
+    NSString *saveFileName=[NSString stringWithFormat:@"%@.png",[[NSUUID UUID ] UUIDString] ] ;
+    
+    NSString *newFilePath=[tempDir stringByAppendingPathComponent:saveFileName];
+    
+    
+    bool bsuccess=[image writeToFile:newFilePath atomically:YES];
+    if(bsuccess)
+    {
+        
+        return newFilePath;
+    }
+    else
+    {
+        return nil;
+    }
+    
+}
+
++(CGPDFDocumentRef)OpenPDF:(NSString*) file
+{
+    //获取路径
+    /*
+     NSArray *paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);//坐标
+     
+     NSString *saveDirectory=[paths objectAtIndex:0];
+     
+     NSString *saveFileName=@"myPDF.pdf";
+     
+     NSString *newFilePath=[saveDirectory stringByAppendingPathComponent:saveFileName];
+     */
+    
+    NSString *default_path = [[NSBundle mainBundle] pathForResource:file ofType:nil];
+    const char *filename=[default_path UTF8String];
+    
+    NSLog(@"%@",default_path);
+    
+    //关联上下文的对象
+    
+    //   CGContextRef pdfContext;
+    
+    CFStringRef path;
+    
+    CFURLRef url;
+    
+    path=CFStringCreateWithCString(NULL, filename, kCFStringEncodingUTF8);
+    
+    url=CFURLCreateWithFileSystemPath(NULL, path, kCFURLPOSIXPathStyle, 0);
+    
+    CGPDFDocumentRef document;
+    document = CGPDFDocumentCreateWithURL (url);
+    CFRelease(url);
+    size_t totalpage = CGPDFDocumentGetNumberOfPages (document);
+    
+    if (totalpage == 0) {
+        printf("[%s] needs at least one page!\n", [@"myPDF.pdf" UTF8String] );
+        return NULL;
+    } else {
+        printf("[%ld] pages loaded in this PDF!\n", totalpage);
+        
+        
+        /*8
+         for (NSInteger pageNumber = 1; pageNumber <= count; pageNumber++)
+         {
+         CGPDFPageRef pageRef = CGPDFDocumentGetPage(document, pageNumber);
+         
+         CGPDFDictionaryRef pageDictionaryFromPage = CGPDFPageGetDictionary(pageRef);
+         
+         if (pageDictionaryFromPage == pageDictionaryFromDestArray) // Found it
+         {
+         targetPageNumber = pageNumber; break;
+         }
+         
+         
+         }*/
+    }
+    
+    //    CGPDFPageRef page= CGPDFDocumentGetPage(document, 0);
+    //    CGContextDrawPDFPage(<#CGContextRef  _Nullable c#>, <#CGPDFPageRef  _Nullable page#>)
+    
+    return document;
+    
+    
+    
+}
+
+
++(void)SavePDF:(NSMutableDictionary*) controlTemplate source:(CGPDFDocumentRef )document
+{
+    
+    //获取路径
+    
+    NSArray *paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);//坐标
+    
+    NSString *saveDirectory=[paths objectAtIndex:0];
+    
+    NSString *saveFileName=[NSString stringWithFormat:@"%@.pdf",[[NSUUID UUID ] UUIDString] ] ;;
+    
+    NSString *newFilePath=[saveDirectory stringByAppendingPathComponent:saveFileName];
+    
+    const char *filename=[newFilePath UTF8String];
+    
+    NSLog(@"%@",newFilePath);
+    //设置页面大小 Letter纸
+    
+    //CGPDFDocumentGetMediaBox(document,1);
+    CGPDFDictionaryRef pdf_dict= CGPDFDocumentGetInfo(document);
+    
+    
+
+    
+    
+    //关联上下文的对象
+    
+    
+    
+    CFStringRef path;
+    
+    CFURLRef url;
+    
+    path=CFStringCreateWithCString(NULL, filename, kCFStringEncodingUTF8);
+    
+    url=CFURLCreateWithFileSystemPath(NULL, path, kCFURLPOSIXPathStyle, 0);
+    
+    CFBridgingRelease(path);
+    // CGPDFCONTEXTCREATE
+    
+  
+    
+    size_t page_count=CGPDFDocumentGetNumberOfPages(document);
+    for(int i=1;i<=page_count;i++)
+    {
+       // NSMutableDictionary* page=pages[[ NSString stringWithFormat:@"page_%d",i ] ];
+        CGPDFPageRef page= CGPDFDocumentGetPage (document , 1);
+        
+        CGRect papersize=CGPDFPageGetBoxRect(page, kCGPDFMediaBox);
+        CGContextRef pdfContext;
+        pdfContext=CGPDFContextCreateWithURL(url, &papersize, nil);
+        
+        
+        CGContextBeginPage(pdfContext, &papersize);
+        
+        PDFPage* pdfPage = [[PDFPage alloc] init:nil size:papersize];
+        
+        [pdfPage DirectDraw:pdfContext page:page];
+        
+        
+        
+        NSMutableDictionary* tline1= [LineDrawable createlineTemplate:1 from:CGPointMake(20, 20) to:CGPointMake(500,500)];
+        LineDrawable* line1=nil;
+        line1= [[LineDrawable alloc] init:tline1];
+                NSRange range = NSMakeRange(0,9999);
+        [line1 Draw:pdfContext dataSource:nil ParentRect:papersize startX:0 startY:0 flipHeight:0 range:range];
+        
+         CGContextEndPage(pdfContext);
+         CGContextRelease(pdfContext);
+       // [pdfPage Draw:pdfContext dataSource:nil];
+//        [self drawPage:pdfContext template:page size:papersize dataSource:data];
+    }
+    
+    CFBridgingRelease(url);
+//    //开始画pdf
+//    
+//    //    NSString *temtext=[[NSString alloc]init];
+//    //
+//    //    const char *text=(char *)[temtext UTF8String];
+//    //
+//    //    int  width;
+//    //
+//    //    int height;
+//    //
+//    
+//    //    [self newpage:pdfContext size:papersize];
+//    
+//    
+//    
+//    CGContextRelease(pdfContext);
+    
+}
+
+@end

+ 17 - 0
RedAnt ERP Mobile/common/TextUtils.h

@@ -0,0 +1,17 @@
+//
+//  TextUtils.h
+//  AntsContract
+//
+//  Created by Ray on 12/20/16.
+//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import <UIKit/UIKit.h>
+#import "const.h"
+
+@interface TextUtils : NSObject
++(NSArray*) expression_varable:(NSString*)content regex:(NSString*) pattern;
++(NSTextCheckingResult*) expression_findfistMatch:(NSString*)content regex:(NSString*) pattern;
++ (CGRect)rectVAlign:(CGRect )parent rect:(CGRect)rect vAlign:(NSString*)vAlign;
+@end

+ 61 - 0
RedAnt ERP Mobile/common/TextUtils.m

@@ -0,0 +1,61 @@
+//
+//  TextUtils.m
+//  AntsContract
+//
+//  Created by Ray on 12/20/16.
+//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
+//
+
+#import "TextUtils.h"
+
+@implementation TextUtils
++(NSArray*) expression_varable:(NSString*)content regex:(NSString*) pattern
+{
+    
+    if(content==nil)
+        return nil;
+    
+    
+    NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:pattern options:nil error:nil];
+    
+    NSArray *matches = [regex matchesInString:content options:nil range:NSMakeRange(0, content.length)];
+    
+    if (matches) {
+        for (NSTextCheckingResult *match in matches) {
+            for (int i = 0; i < match.numberOfRanges; ++i) {
+                DebugLog(@"-> %@", [content substringWithRange:[match rangeAtIndex:i]]);
+            }
+        }
+    }
+    return matches;
+}
++(NSTextCheckingResult*) expression_findfistMatch:(NSString*)content regex:(NSString*) pattern
+{
+    NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:pattern options:nil error:nil];
+    
+    NSTextCheckingResult *match = [regex firstMatchInString:content options:nil range:NSMakeRange(0, content.length)];
+    return match;
+    //    if (matches) {
+    //        for (NSTextCheckingResult *match in matches) {
+    //            for (int i = 0; i < match.numberOfRanges; ++i) {
+    //                DebugLog(@"-> %@", [content substringWithRange:[match rangeAtIndex:i]]);
+    //            }
+    //        }
+    //    }
+    //    return matches;
+}
++ (CGRect)rectVAlign:(CGRect )parent rect:(CGRect)rect vAlign:(NSString*)vAlign
+{
+    //    double cx=parent.origin.x+parent.size.width/2;
+    //    double cy=parent.origin.y+parent.size.height/2;
+    CGPoint centerpoint= CGPointMake(parent.origin.x+parent.size.width/2,parent.origin.y+parent.size.height/2);
+    
+    if([vAlign.lowercaseString isEqualToString:@"middle"])
+    {
+        rect=CGRectMake(rect.origin.x, centerpoint.y-rect.size.height/2, rect.size.width, rect.size.height);
+    }
+    
+    return rect;
+    
+}
+@end

+ 5 - 5
RedAnt ERP Mobile/common/pdfCreator/ImageDrawable.m

@@ -7,8 +7,8 @@
 //
 //
 
 
 #import "ImageDrawable.h"
 #import "ImageDrawable.h"
-#import "RAUtils.h"
-#import "iSalesDB.h"
+#import "ImageUtils.h"
+//#import "iSalesDB.h"
 
 
 @implementation ImageDrawable
 @implementation ImageDrawable
 
 
@@ -59,7 +59,7 @@
         }
         }
         else
         else
         {
         {
-            NSData* img_data=[iSalesDB load_cached_img:file_name loadFrom:url];
+            NSData* img_data=[ImageUtils load_cached_img:file_name loadFrom:url];
             if([self.drawableTemplate[@"source_path_type"] isEqualToString:@"local"])
             if([self.drawableTemplate[@"source_path_type"] isEqualToString:@"local"])
             {
             {
                 img_data= [NSData dataWithContentsOfFile: file_name];
                 img_data= [NSData dataWithContentsOfFile: file_name];
@@ -88,10 +88,10 @@
     
     
     
     
     
     
-    CGRect scalerect = [RAUtils scaleToSize:CGRectMake(0, 0, image.size.width, image.size.height) to:parentrect.size];
+    CGRect scalerect = [ImageUtils scaleToSize:CGRectMake(0, 0, image.size.width, image.size.height) to:parentrect.size];
     
     
     
     
-    CGRect rect=[RAUtils rectAlign:parentrect rect:scalerect hAlign:self.hAlign vAlign:self.vAlign];
+    CGRect rect=[ImageUtils rectAlign:parentrect rect:scalerect hAlign:self.hAlign vAlign:self.vAlign];
                         
                         
     //image=[RAUtils scaleToSize:image size:parentrect.size];
     //image=[RAUtils scaleToSize:image size:parentrect.size];
 
 

+ 1 - 1
RedAnt ERP Mobile/common/pdfCreator/PDFDrawable.m

@@ -9,7 +9,7 @@
 #import "PDFDrawable.h"
 #import "PDFDrawable.h"
 #import "LineDrawable.h"
 #import "LineDrawable.h"
 #import "config.h"
 #import "config.h"
-#import "RAUtils.h"
+//#import "RAUtils.h"
 
 
 
 
 @implementation PDFDrawable
 @implementation PDFDrawable

+ 1 - 1
RedAnt ERP Mobile/common/pdfCreator/PDFPage.h

@@ -32,5 +32,5 @@
 @property (nonatomic,strong) NSMutableDictionary* data;
 @property (nonatomic,strong) NSMutableDictionary* data;
 
 
 @property int pagecount;
 @property int pagecount;
-
+-(void) DirectDraw:(CGContextRef) context page:(CGPDFPageRef)page;
 @end
 @end

+ 17 - 0
RedAnt ERP Mobile/common/pdfCreator/PDFPage.m

@@ -119,6 +119,23 @@
     }
     }
     
     
     return self.pagecount;
     return self.pagecount;
+}
+-(void) DirectDraw:(CGContextRef) context page:(CGPDFPageRef)page
+{
+    
+    
+    
+//    CGAffineTransform m;
+//    m = CGPDFPageGetDrawingTransform (page, kCGPDFCropBox, self.rect, -180, true);
+    CGContextSaveGState (context);
+    
+//    CGContextTranslateCTM(myContext, 80, self.frame.size.height);
+//    CGContextScaleCTM(myContext, 1, -1);
+    
+    CGContextDrawPDFPage (context, page);
+    CGContextRestoreGState (context);
+    
+    
 }
 }
 -(void) Draw:(CGContextRef) context dataSource:(NSMutableDictionary*)data
 -(void) Draw:(CGContextRef) context dataSource:(NSMutableDictionary*)data
 {
 {

+ 18 - 0
RedAnt ERP Mobile/iSales-NPD.xcodeproj/project.pbxproj

@@ -188,6 +188,9 @@
 		71BF06FE1D2F3CBA00981938 /* OfflineSettingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71BF06FD1D2F3CBA00981938 /* OfflineSettingViewController.m */; };
 		71BF06FE1D2F3CBA00981938 /* OfflineSettingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71BF06FD1D2F3CBA00981938 /* OfflineSettingViewController.m */; };
 		71BF07081D2F3D2800981938 /* SyncControlPanelViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71BF07071D2F3D2800981938 /* SyncControlPanelViewController.m */; };
 		71BF07081D2F3D2800981938 /* SyncControlPanelViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71BF07071D2F3D2800981938 /* SyncControlPanelViewController.m */; };
 		71D01ADD1E08CB1C006620CE /* signature.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 71D01ADC1E08CB1C006620CE /* signature.storyboard */; };
 		71D01ADD1E08CB1C006620CE /* signature.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 71D01ADC1E08CB1C006620CE /* signature.storyboard */; };
+		71D01B1A1E0A2055006620CE /* ImageUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 71D01B151E0A2055006620CE /* ImageUtils.m */; };
+		71D01B1B1E0A2055006620CE /* PDFUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 71D01B171E0A2055006620CE /* PDFUtils.m */; };
+		71D01B1C1E0A2055006620CE /* TextUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 71D01B191E0A2055006620CE /* TextUtils.m */; };
 		71D0344F1C9BF3C400E0F7AD /* PortfolioEditQTYViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71D0344E1C9BF3C400E0F7AD /* PortfolioEditQTYViewController.m */; };
 		71D0344F1C9BF3C400E0F7AD /* PortfolioEditQTYViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71D0344E1C9BF3C400E0F7AD /* PortfolioEditQTYViewController.m */; };
 		71D30A211CFBEDC6006F9477 /* default_appearance.json in Resources */ = {isa = PBXBuildFile; fileRef = 71D30A201CFBEDC6006F9477 /* default_appearance.json */; };
 		71D30A211CFBEDC6006F9477 /* default_appearance.json in Resources */ = {isa = PBXBuildFile; fileRef = 71D30A201CFBEDC6006F9477 /* default_appearance.json */; };
 		71D30A2D1CFC0EF8006F9477 /* DefaultImageButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 71D30A2C1CFC0EF8006F9477 /* DefaultImageButton.m */; };
 		71D30A2D1CFC0EF8006F9477 /* DefaultImageButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 71D30A2C1CFC0EF8006F9477 /* DefaultImageButton.m */; };
@@ -567,6 +570,12 @@
 		71BF07061D2F3D2800981938 /* SyncControlPanelViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SyncControlPanelViewController.h; path = common/Functions/offline/SyncControlPanelViewController.h; sourceTree = SOURCE_ROOT; };
 		71BF07061D2F3D2800981938 /* SyncControlPanelViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SyncControlPanelViewController.h; path = common/Functions/offline/SyncControlPanelViewController.h; sourceTree = SOURCE_ROOT; };
 		71BF07071D2F3D2800981938 /* SyncControlPanelViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SyncControlPanelViewController.m; path = common/Functions/offline/SyncControlPanelViewController.m; sourceTree = SOURCE_ROOT; };
 		71BF07071D2F3D2800981938 /* SyncControlPanelViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SyncControlPanelViewController.m; path = common/Functions/offline/SyncControlPanelViewController.m; sourceTree = SOURCE_ROOT; };
 		71D01ADC1E08CB1C006620CE /* signature.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = signature.storyboard; path = common/Functions/signature/signature.storyboard; sourceTree = SOURCE_ROOT; };
 		71D01ADC1E08CB1C006620CE /* signature.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = signature.storyboard; path = common/Functions/signature/signature.storyboard; sourceTree = SOURCE_ROOT; };
+		71D01B141E0A2055006620CE /* ImageUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ImageUtils.h; path = common/ImageUtils.h; sourceTree = SOURCE_ROOT; };
+		71D01B151E0A2055006620CE /* ImageUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ImageUtils.m; path = common/ImageUtils.m; sourceTree = SOURCE_ROOT; };
+		71D01B161E0A2055006620CE /* PDFUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PDFUtils.h; path = common/PDFUtils.h; sourceTree = SOURCE_ROOT; };
+		71D01B171E0A2055006620CE /* PDFUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PDFUtils.m; path = common/PDFUtils.m; sourceTree = SOURCE_ROOT; };
+		71D01B181E0A2055006620CE /* TextUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TextUtils.h; path = common/TextUtils.h; sourceTree = SOURCE_ROOT; };
+		71D01B191E0A2055006620CE /* TextUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TextUtils.m; path = common/TextUtils.m; sourceTree = SOURCE_ROOT; };
 		71D0344D1C9BF3C400E0F7AD /* PortfolioEditQTYViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PortfolioEditQTYViewController.h; path = common/Functions/portfolio/PortfolioEditQTYViewController.h; sourceTree = SOURCE_ROOT; };
 		71D0344D1C9BF3C400E0F7AD /* PortfolioEditQTYViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PortfolioEditQTYViewController.h; path = common/Functions/portfolio/PortfolioEditQTYViewController.h; sourceTree = SOURCE_ROOT; };
 		71D0344E1C9BF3C400E0F7AD /* PortfolioEditQTYViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PortfolioEditQTYViewController.m; path = common/Functions/portfolio/PortfolioEditQTYViewController.m; sourceTree = SOURCE_ROOT; };
 		71D0344E1C9BF3C400E0F7AD /* PortfolioEditQTYViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PortfolioEditQTYViewController.m; path = common/Functions/portfolio/PortfolioEditQTYViewController.m; sourceTree = SOURCE_ROOT; };
 		71D30A201CFBEDC6006F9477 /* default_appearance.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = default_appearance.json; sourceTree = "<group>"; };
 		71D30A201CFBEDC6006F9477 /* default_appearance.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = default_appearance.json; sourceTree = "<group>"; };
@@ -1039,6 +1048,12 @@
 				71DF742D1C5756C600F2789C /* const.h */,
 				71DF742D1C5756C600F2789C /* const.h */,
 				71DF742E1C57572600F2789C /* RAUtils.h */,
 				71DF742E1C57572600F2789C /* RAUtils.h */,
 				71DF742F1C57572600F2789C /* RAUtils.m */,
 				71DF742F1C57572600F2789C /* RAUtils.m */,
+				71D01B141E0A2055006620CE /* ImageUtils.h */,
+				71D01B151E0A2055006620CE /* ImageUtils.m */,
+				71D01B161E0A2055006620CE /* PDFUtils.h */,
+				71D01B171E0A2055006620CE /* PDFUtils.m */,
+				71D01B181E0A2055006620CE /* TextUtils.h */,
+				71D01B191E0A2055006620CE /* TextUtils.m */,
 				71FFBBE51C60894900D91DC2 /* iSalesDB.h */,
 				71FFBBE51C60894900D91DC2 /* iSalesDB.h */,
 				71FFBBE61C60894900D91DC2 /* iSalesDB.m */,
 				71FFBBE61C60894900D91DC2 /* iSalesDB.m */,
 				71FFBBE71C60894900D91DC2 /* iSalesNetwork.h */,
 				71FFBBE71C60894900D91DC2 /* iSalesNetwork.h */,
@@ -1691,6 +1706,7 @@
 				71BBA2421CEAEF0700C91DED /* unzip.c in Sources */,
 				71BBA2421CEAEF0700C91DED /* unzip.c in Sources */,
 				7162A5AA1C58735900AB630E /* PDFListTableViewCell.m in Sources */,
 				7162A5AA1C58735900AB630E /* PDFListTableViewCell.m in Sources */,
 				7162A5AC1C58735900AB630E /* PortfolioViewController.m in Sources */,
 				7162A5AC1C58735900AB630E /* PortfolioViewController.m in Sources */,
+				71D01B1C1E0A2055006620CE /* TextUtils.m in Sources */,
 				71DF748C1C57608F00F2789C /* StrikethroughLabel.m in Sources */,
 				71DF748C1C57608F00F2789C /* StrikethroughLabel.m in Sources */,
 				7162A5981C58733400AB630E /* CreateOrderViewController.m in Sources */,
 				7162A5981C58733400AB630E /* CreateOrderViewController.m in Sources */,
 				7162A5021C586F5B00AB630E /* AddressEditorViewController.m in Sources */,
 				7162A5021C586F5B00AB630E /* AddressEditorViewController.m in Sources */,
@@ -1707,6 +1723,7 @@
 				71BF06FB1D2F3CAC00981938 /* OLDataProvider.m in Sources */,
 				71BF06FB1D2F3CAC00981938 /* OLDataProvider.m in Sources */,
 				7162A59B1C58733400AB630E /* OrderDetailModelCell.m in Sources */,
 				7162A59B1C58733400AB630E /* OrderDetailModelCell.m in Sources */,
 				7162A5E91C5899F700AB630E /* MainViewController.m in Sources */,
 				7162A5E91C5899F700AB630E /* MainViewController.m in Sources */,
+				71D01B1B1E0A2055006620CE /* PDFUtils.m in Sources */,
 				7141DD4F1C57459B00F7DF59 /* mask.c in Sources */,
 				7141DD4F1C57459B00F7DF59 /* mask.c in Sources */,
 				7162A54E1C58722200AB630E /* CreditCardEditorViewController.m in Sources */,
 				7162A54E1C58722200AB630E /* CreditCardEditorViewController.m in Sources */,
 				7162A5C31C5873BB00AB630E /* ItemSearchFilterViewController.m in Sources */,
 				7162A5C31C5873BB00AB630E /* ItemSearchFilterViewController.m in Sources */,
@@ -1738,6 +1755,7 @@
 				71DF746A1C575E7900F2789C /* SRMonthPicker.m in Sources */,
 				71DF746A1C575E7900F2789C /* SRMonthPicker.m in Sources */,
 				714B1F401C7BF74100539193 /* OrderDetailSignatureCell.m in Sources */,
 				714B1F401C7BF74100539193 /* OrderDetailSignatureCell.m in Sources */,
 				71DF745D1C575E7900F2789C /* CommonEditorCellEnum.m in Sources */,
 				71DF745D1C575E7900F2789C /* CommonEditorCellEnum.m in Sources */,
+				71D01B1A1E0A2055006620CE /* ImageUtils.m in Sources */,
 				7141DD521C57459B00F7DF59 /* qrinput.c in Sources */,
 				7141DD521C57459B00F7DF59 /* qrinput.c in Sources */,
 				7162A5601C58724700AB630E /* CustomerEditViewController.m in Sources */,
 				7162A5601C58724700AB630E /* CustomerEditViewController.m in Sources */,
 				718B91831C75638100265FFF /* TouchImageView.m in Sources */,
 				718B91831C75638100265FFF /* TouchImageView.m in Sources */,