
http://www.iphonedevsdk.com/forum/iphone-sdk-development/21451-save-contents-uiwebview-pdf-file.html
此链接中的最后一篇文章提供了将UIWebVIEw保存为图像的代码,您应该能够将该图像转换为pdf.我没有把它归功于代码,因为我没有写它,只是连接你两个:)
这是简单的代码:
CGSize sixzevID=CGSizeMake(1024,1100);UIGraphicsBeginImageContext(sixzevID);[webvIEw.layer renderInContext:UIGraphicsGetCurrentContext()];UIImage *vIEwImage = UIGraphicsGetimageFromCurrentimageContext();UIGraphicsEndImageContext();NSData *imageData = UIImagePNGRepresentation(vIEwImage);NSArray *paths = NSSearchPathForDirectorIEsInDomains(NSdocumentDirectory,NSUserDomainMask,YES);Nsstring *documentsDirectory = [paths objectAtIndex:0]; Nsstring *pathFloder = [[Nsstring alloc] initWithString:[Nsstring stringWithFormat:@"%@",@"new.png"]];Nsstring *defaultDBPath = [documentsDirectory stringByAppendingPathComponent:pathFloder];[imageData writetofile:defaultDBPath atomically:YES];
很有可能你必须调整它,但希望这有助于你朝着正确的方向前进.
@H_403_2@ 总结以上是内存溢出为你收集整理的iphone – ios将网页保存为pdf全部内容,希望文章能够帮你解决iphone – ios将网页保存为pdf所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)