开发者

iphone : How to convert webpage(UIWebView) to pdf

i want to convert my webpage(displayed in UIWebView) contents in pdf file.

which can be stored at perticular directory (document dir/any user defined dir).

So later on it can be viewable to user either internet connection not available.

is there any possibilities to perform this functionality.

how can i do this...

T开发者_StackOverflow社区hanking you in advance...


An image might be your best option. See Take snapshot of view / WebView programmatically

To get the image, you'll want to use:

UIGraphicsBeginImageContext(self.bounds.size);

[theView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();

UIGraphicsEndImageContext();

Then, to save to the Photos Library:

UIImageWriteToSavedPhotosAlbum(viewImage,nil,NULL,NULL);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜