web content转image
来源:互联网 发布:干支纪日法简便算法 编辑:程序博客网 时间:2024/05/22 03:07
The last post in this link provides code to save a UIWebView as an image, and you should be able to convert that image into a PDF. I don't take credit for the code as I did not write it, just connecting you two :)
Here is the code for simplicity:
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];
利用原先的连续image转到pdf的代码,即可实现把网页 存为pdf的方式。
- web content转image
- stretching image-based content
- convert div content into image
- Web Content Mining
- Web Content Mining
- Web Content Mining
- Web Content Mining
- Web Content Mining
- Web Content Mining
- Web Content Mining
- Web Content Mining
- Web Content Mining
- Web Content Mining
- Web Content Mining
- WEB Content-Type
- WEB Content-Type
- About Content-based Image Retrieval -- Part.1
- About Content-based Image Retrieval -- Part.2
- QiuQiu出诊子
- android——创建数据库
- yii上传图片、yii上传文件、yii控件activeFileField使用
- 如何讲课
- CMakeLists.txt中连接字符串
- web content转image
- hdu 1076 An Easy Task
- 苹果创始人伍兹给年轻人的建议
- XML——从简单开始
- 数据库表的连接(Left join , Right Join, Inner Join)用法详解 - XIAWAYUYADANG的专栏 - CSDN博客
- C语言自制文件分割器(简单)
- Codeforces Beta Round #40 (Div. 2) A题
- hadoop面试-1
- project euler 解题