开发者

iphone : How to convert webpage(UIWebView) to pdf

开发者 https://www.devze.com 2022-12-26 20:34 出处:网络
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).

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

精彩评论

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

关注公众号