Code:
- (void)viewDidLoad {
NSString*path=[[NSBundle mainBundle]pathForResource:@"sample2" ofType:@"pdf"];
//Create a URL object.
NSURL *url = [NSURL fileURLWithPath:path];
//URL Requst Object
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
//Load the request in the UIWebView.
[webView loadRequest:requestObj];
UIGraphicsBeginImageContext(webView.bounds.size);
[webView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage*someImage=UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
self.myImageView.image=someImage;
}
I created a view-based application, where in the view the screen is split between a webView object and a imageView object in the IB. The pdf shows up fine in the webView, but nothing appears in the imageView. Any ideas? Thanks.