-1

I want to do curl on my PDF page in iOS. I have load my PDF to a web view, but I want to give effect on PDF page, so help me. I want to swipe to page turn and with swipe it curl.

NSString *path = [[NSBundle mainBundle] pathForResource:@"paper" ofType:@"pdf"];
_webView.autoresizingMask=(UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth);

NSURL *myUrl=[NSURL fileURLWithPath:path];

NSURLRequest *myRequest = [NSURLRequest requestWithURL:myUrl];
[_webView loadRequest:myRequest];

and in advance thanks to helper.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Ashit Soni
  • 226
  • 1
  • 9

1 Answers1

1

You should be able to do that through UIPageViewController-PDF (follow full instructions from the github page, though):

NSString *path = [[NSBundle mainBundle] pathForResource:@"myFile" ofType:@"pdf"];
PageViewController *page = [[PageViewController alloc] initWithPDFAtPath:path];
[self presentViewController:page animated:YES completion:NULL];

Loading PDF in UIWebview is not the right way. Use UIPageViewController to load PDF with curl animation.

Vipin Vijay
  • 393
  • 5
  • 21
  • i want to give curl effect. With this code i only load pdf in my webView – Ashit Soni Jul 14 '14 at 09:54
  • Curl animation is inbuilt feature in UIPageViewController. You can check this link http://devmonologue.com/ios/tutorials/uipageviewcontroller-tutorial/ – Vipin Vijay Jul 14 '14 at 09:58
  • 1
    I have given an above link. Please look it and study, how to use it.Specify what error you are getting. Don't get upset. – Vipin Vijay Jul 14 '14 at 10:09