Kautham Murugan Kautham Murugan - 1 year ago 69
Objective-C Question

Can we load the terms and conditions as a PDF in a UIWebview for IOS apps?

I am adding terms and conditions to my app in a UIWebview. What i really want to know is can i show it as a page by page pdf document or should i use any other method? Will App store accept the pdf format?


Yes, this can be done using UIWebview and surely will get accepted by Apple.

If you are trying to display a PDF file from a web URL , use the below code.

NSURL *targetURL = [NSURL URLWithString:@"http://yourdomain.com/file_toopen.pdf"];
NSURLRequest *request = [NSURLRequest requestWithURL:targetURL];
[webView loadRequest:request];

Or if you have a PDF file bundled with in your application, use below code.

NSString *path = [[NSBundle mainBundle] pathForResource:@"filetoopen" ofType:@"pdf"];
NSURL *targetURL = [NSURL fileURLWithPath:path];
NSURLRequest *request = [NSURLRequest requestWithURL:targetURL];
[webView loadRequest:request];