是否可以添加文本字段和标签,并将ID添加到PDf文件中的这些字段,以便我们稍后可以通过相应的ID访问这些字段?
答案 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);