是否可以在 PDf 文件中添加文本字段和标签并将 id 添加到这些字段,以便我们以后可以通过它们对应的 id 访问这些字段?
问问题
124 次
1 回答
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);
于 2012-12-27T13:00:47.110 回答