if you have a PDF file bundled with your application (in this example, named "document.pdf"):
UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(10, 10, 200, 200)]; NSString *path = [[NSBundle mainBundle] pathForResource:@"document" ofType:@"pdf"]; NSURL *targetURL = [NSURL fileURLWithPath:path]; NSURLRequest *request = [NSURLRequest requestWithURL:targetURL]; [webView loadRequest:request]; [self.view addSubview:webView]; [webView release];
More information can be found here: Technical QA1630: Using UIWebView to display selected document types.
Prateek prem
source share