如何在iPhone中添加PDF格式的文本字段?

时间:2012-12-27 12:37:54

标签: iphone ios pdf

是否可以添加文本字段和标签,并将ID添加到PDf文件中的这些字段,以便我们稍后可以通过相应的ID访问这些字段?

1 个答案:

答案 0 :(得分:0)

是这样的:

 CGContextBeginPage(yourPDFContextRef,nil);

 //Draw view into PDF
 UIView *aPageNote=[[UIView alloc]initWithFrame:CGRectMake(0,0, 612, 892)]; //provide height and width of pdf page
 aPageNote.backgroundColor=[UIColor whiteColor];

 //turn PDF upsidedown
 CGAffineTransform aCgAffTrans = CGAffineTransformIdentity;
 aCgAffTrans = CGAffineTransformMakeTranslation(0,892);
 aCgAffTrans = CGAffineTransformScale(aCgAffTrans, 1.0, -1.0);
 CGContextConcatCTM(yourPDFContextRef, aCgAffTrans);

 //add UI Control here to UIVIEW
 UIImageView *aImgViewSign = [[UIImageView alloc] initWithFrame:frame];
            aImgViewSign.image = [imageArray objectAtIndex:index];
 [aPageNote addSubview:aImgViewSign];    
 [aPageNote.layer renderInContext:yourPDFContextRef];
 [aPageNote release]; 
 CGContextEndPage (yourPDFContextRef);