In my project i saved the PDF file from NSData & displayed in WebView it working fine, i checked with Simulator & find in app folder the file is successfully downloaded without any corruption.
Here my problem is how can i view the file in real device(iPhone & iPad too) & share the files. like android file manager..
there is no option to view & share(Mail , Whatsapp etc..) the files?
my code below
NSError *errr;
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0]; // Get documents folder
NSString *dataPath = [documentsDirectory stringByAppendingPathComponent:@"/Folder"];
if (![[NSFileManager defaultManager] fileExistsAtPath:dataPath])
{
[[NSFileManager defaultManager] createDirectoryAtPath:dataPath withIntermediateDirectories:NO attributes:nil error:&errr]; //Create folder
[data writeToFile:[NSString stringWithFormat:@"%@/%@", dataPath, @"Report.pdf"] atomically:YES];
}
[self.webView loadData:data MIMEType:@"application/pdf" textEncodingName:@"utf-8" baseURL:nil];
Help me..