Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 493
Kautham Krishna Avatar asked Feb 17 '16 07:02

Kautham Krishna


1 Answers

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];
like image 171
Siba Prasad Hota Avatar answered Nov 10 '22 00:11

Siba Prasad Hota