1

I am quite new to iOS development. I am not able to create thumbnails from PDF file.

I have two UIViews in ViewController. First View has a horizontal tableView that shows name of PDF books while on selecting those books from first UIView, second UIView show thumbnails of all pages.

I am correctly implementing first UIView but is not able to show thumbnails in second UiView.I have gone through this link but was not able to create thumbnails. Please help.

Community
  • 1
  • 1
user1288005
  • 890
  • 2
  • 16
  • 36

1 Answers1

0

I have faced same problem but i solved it in this menner

Just need to use UIWebView inside UIView. UIWebView can open PDF file. so take a UIWebView load request on webView with url of your pdf. But make sure to set two properties like this UserInteractionEnabled:NO and ScalesPageToFit:YES

I have explained this in this code.............

UIView * view1 = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 50, 50)] autorelease];
UIWebView * webView1 = [[[UIWebView alloc] initWithFrame:view1.bounds] autorelease];
[webView1 setUserInteractionEnabled:NO];
[webView1 setScalesPageToFit:YES];
[webView1 loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"Your PDF URL"]]];
[view1 addSubview:webView1];
[self.view addSubview:view1];

Hope this will help you............

Nirav Gadhiya
  • 6,342
  • 2
  • 37
  • 76