【问题标题】:How to Add textfield in PDF in iPhone?如何在 iPhone 的 PDF 中添加文本字段?
【发布时间】:2012-12-27 12:37:54
【问题描述】:

是否可以在 PDf 文件中添加 textfield 和 labels 并添加 id 到这些字段,以便我们以后可以通过它们对应的 id 访问这些字段?

【问题讨论】:

    标签: iphone ios pdf


    【解决方案1】:

    是这样的:

     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);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-03-08
      • 2013-06-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多