我需要创建一个UIImage
底部带有签名 ( ) 的多页 PDF。我还想创建一条线,以便签名可以在一条线上。这是我到目前为止的代码:
- (IBAction)saveAsPDF:(id)sender
{
NSMutableData *pdfData = [NSMutableData data];
UIGraphicsBeginPDFContextToData(pdfData, CGRectMake(0, 0, 612, 792), nil);
UIGraphicsBeginPDFPage();
[nameTextField.text drawInRect:CGRectMake(50, 40, 512, 30) withFont:[UIFont systemFontOfSize:16] lineBreakMode:NSLineBreakByWordWrapping alignment:NSTextAlignmentCenter];
[TextView.text drawInRect:CGRectMake(50, 90, 512, 672) withFont:[UIFont systemFontOfSize:12]];
[SignatureImageView.image drawInRect:CGRectMake(30, 500, 190, 71)];
UIGraphicsEndPDFContext();
NSArray* documentDirectories = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask,YES);
NSString* documentDirectory = [documentDirectories objectAtIndex:0];
NSString* documentNameWithExtention = [NSString stringWithFormat:@"%@.pdf", nameTextField.text];
NSString* documentDirectoryFilename = [documentDirectory stringByAppendingPathComponent:documentNameWithExtention];
[pdfData writeToFile:documentDirectoryFilename atomically:YES];
}
所以,我需要知道如何使它成为多页,我需要知道如何在正文的末尾添加签名。
任何帮助,将不胜感激。