用ipad email的markup签名为什么总是位置对不起的个性签名

把iPad上面的签名添加到PDF文档上
1,项目中我使用了PDFNet_iOS的framework实现了对PDF的编辑,还有添加了Wacom_Signature_SDK_iOS_v1.0.12的SDK实现了使用wacom的签名笔连接功能。
//MustInitialthePTPDFNet、[PTPDFNetInitialize:0];PTPDFDoc*doc=[[PTPDFDocalloc]initWithFilepath:PDF模板路径];[docInitSecurityHandler];//UpdateAnnotationsdataArray:为你要插入到PDF的数据[selfupdateAnnotationsWithDoc:docdataArray:dataArray];//FlattenAnnotations[docFlattenAnnotations:false];//SaveFile[docSaveToFile:PDF生成路径flags:e_ptlinearized]; updateAnnotationsWithDoc方法的实现,该方法主要是遍历PDF文档里面所有subject为IMG_开头的标记,只要是IMG_开头的都会把IMG_去掉得到的字符串,然后到dataArray里面找该字符串对应的数据(PS:我使用的是base64传过来的数据),在把该数据转码成img然后替换掉PDF上面的这个标记
-(void)updateAnnotationsWithDoc:(PTPDFDoc*)docdataArray:(NSArray*)dataArray{intpageNum=1;//GettheAnswerDictionaryNSMutableDictionary*raqAnsDict=dataANSString*isResultOverridden=[raqAnsDictobjectForKey:@"isResultOverridden"];//getallanswernumberNSMutableArray*mutablearray=[[NSMutableArrayalloc]init];mutablearray=[selfgetAllAnswerNO:raqAnsDict];PTPageIterator*for(itr=[docGetPageIterator:1];[itrHasNext];[itrNext]){PTPage*page=[itrCurrent];intnum_annots=[pageGetNumAnnots];inti=0;for(i=0;i<num_++i){PTAnnot*annot=[pageGetAnnot:i];if(![annotIsValid])switch([annotGetType]){casee_ptFreeText:{PTFreeText*txtAnnot=[[PTFreeTextalloc]initWithAnn:annot];NSString*txtAnnotSubject=[selfgetSubjectName:[txtAnnotGetSubject]];if([txtAnnotSubjecthasPrefix:@"IMG_"]){//ImageNSString*ansString=[raqAnsDictobjectForKey:[txtAnnotSubjectstringByReplacingOccurrencesOfString:@"IMG_"withString:@""]];if(ansString!=(id)[NSNullnull]&&ansString.length!=0){NSLog(@"ansStringisnotempty!!!");NSString*imgStrNew=[ansStringsubstringWithRange:NSMakeRange([ansStringrangeOfString:@","].location+1,ansString.length-[ansStringrangeOfString:@","].location-1)];NSData*data=[[NSDataalloc]initWithData:[NSDatadataFromBase64String:imgStrNew]];UIImage*ansObj=[UIImageimageWithData:data];if(ansObj!=(id)[NSNullnull]&&[ansObjisKindOfClass:[UIImageclass]]){UIImage*imgSrc=(UIImage*)ansO//CreatetempimagepathNSArray*paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES);NSString*imgFilePath=[[pathsobjectAtIndex:0]stringByAppendingPathComponent:tmpImageFileName];NSLog(@"imgFilePath%@:",imgFilePath);//Save&Loadimage:OK![UIImagePNGRepresentation(imgSrc)writeToFile:imgFilePathatomically:YES];PTImage*img=[PTImageCreate:[docGetSDFDoc]filename:imgFilePath];//BuilderPTElementBuilder*builder=[[PTElementBuilderalloc]init];PTElementWriter*writer=[[PTElementWriteralloc]init];[writerWriterBeginWithPage:pageplacement:e_ptoverlaypage_coord_sys:YEScompress:YES];PTPDFRect*boxRect=[annotGetRect];doubleboxWidth=[boxRectGetX2]-[boxRectGetX1];doubleboxHeight=[boxRectGetY2]-[boxRectGetY1];doubleimgWidth=[imgGetImageWidth];doubleimgHeight=[imgGetImageHeight];doubleimgHScale=0;doubleimgVScale=0;if((imgWidth/imgHeight)<(boxWidth/boxHeight)){//UseheightimgHScale=(boxHeight/imgHeight)*imgWimgVScale=boxH}else{//UseheightimgHScale=boxWimgVScale=(boxWidth/imgWidth)*imgH}NSLog(@"CreateCreateImage:boxWidth:%f,boxHeight:%f",boxWidth,boxHeight);NSLog(@"Image:imgWidth:%f,imgHeight:%f",imgWidth,imgHeight);NSLog(@"CreateImage:imgHScale:%f,imgVScale:%f",imgHScale,imgVScale);PTElement*element=[builderCreateImageWithCornerAndScale:imgx:[boxRectGetX1]y:[boxRectGetY1]hscale:imgHScalevscale:imgVScale];[writerWritePlacedElement:element];[writerEnd];}}}[txtAnnotSetQuaddingFormat:0];//Align0:Left1:Center[txtAnnotRefreshAppearance];}casee_ptLink:casee_ptWidget:casee_ptFileAttachment:default:}}}}
最新教程周点击榜
微信扫一扫iOS内置Email添加HTML链接签名方法
发邮件时,系统会自动在邮件的末尾加上&发自我的 iPhone&,虽然可以在【设置】-【邮件、通讯录、日历】-【签名】中进行修改,但是这样只支持普通的文本。像一些大型的公司,都会在邮件末尾加上一些联系方式、联系地址、公司网址、LOGO 之类的信息,那么如何才能让这些富文本HTML信息显示在 iPhone 的邮件末尾呢?
在 iPhone/iPad 的邮件里使用 HTML 签名
1、使用网页上的邮箱发送一封带有设计好签名的邮件给自己
2、使用 iPhone 的内置邮件 App 打开这封邮件
3、长按邮件内容,选中你需要的签名部分,选择【复制】
4、打开【设置】-【邮件、通讯录、日历】-【签名】,选择【粘贴】
5、这样再使用 iPhone 发送邮件时,就会自动加上这些富文本 HTML 签名了。
责任编辑:Grey
本栏目其它文章
红雪(Redsn0w)是一款著名的iPhone越狱工具,同时也能够越狱iPod Touch与iPad等运行iOS的设备。...
新手越狱教程ipad屏幕截图
尚无分享截图
PDF Markup 的评论&&
暂无点评,!
喜欢TA的人常去的小组
订阅PDF Markup的评论:}

我要回帖

更多关于 qq个性签名大全对不起 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信