Snippet

  1. - (void) displayLocalPdfInWebView
  2. {
  3.         CGRect rect = [[UIScreen mainScreen] bounds];
  4.         CGSize screenSize = rect.size;
  5.        
  6.         UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0,0,screenSize.width,screenSize.height)];
  7.         webView.autoresizesSubviews = YES;
  8.         webView.autoresizingMask=(UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth);
  9.        
  10.         NSString *urlAddress = [[NSBundle mainBundle] pathForResource:@"JaapSahib-Gurmukhi" ofType:@"pdf"];
  11.        
  12.         NSURL *url = [NSURL fileURLWithPath:urlAddress];
  13.         NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url];
  14.        
  15.         [webView loadRequest:urlRequest];
  16.        
  17.         [window addSubview:webView];
  18.         [webView release];
  19.        
  20. }