I created an app that generates a PDF and saves it to the NSDocumentDirectory. I want to make it very easy for the user to locate the file and display it or print it using their iPhone. How do I find this file and view it easily?
Here is the code I used to create the PDF:
//USE PDFGENERATOR TO CREATE A PDF FILE
PDFViewController* pdf = [[PDFViewController alloc] init];
NSString *header = lblTitle.text;
NSLog(@"fullQuote=%@", header);
NSString *body = [NSString stringWithFormat:@"%@ \n\n - LRH \n %@", lblExcerpt.text, lblDesc2.text];
NSLog(@"fullQuote=%@", body);
pageSize = CGSizeMake(612, 792);
NSString *fileName = [NSString stringWithFormat:@"%@.pdf", lblTitle.text];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *pdfFileName = [documentsDirectory stringByAppendingPathComponent:fileName];
[pdf generatePdf :pdfFileName:header:body:nil];