I am having an Issue. I am attaching PDF Document to MFMailComposer. The issue is if i attach a PDF Document which contains only one page then When i am presenting the MFMailComposer, the attached PDF is opening and displaying. But, if i attach a PDF with more than one Page then it is displaying as icon.
If the pdf has one page or more number of pages i need to display as icon.
Could anyone please check it out !!!!
It should work in iPad
If it is the default functionality then please link with apple documents.
Sample Code :
MFMailComposeViewController *objMFMailComposeViewController = [[MFMailComposeViewController alloc] init];
if([MFMailComposeViewController canSendMail])
{
[objMFMailComposeViewController setMailComposeDelegate:self];
[objMFMailComposeViewController setSubject:[NSString stringWithFormat:@"Generated Reports for %@",lbl_details.text]];
NSString *path = [[NSBundle mainBundle] pathForResource:@"Material Details" ofType:@"pdf"];
NSData *myData = [NSData dataWithContentsOfFile:path];
[objMFMailComposeViewController addAttachmentData:myData mimeType:@"application/pdf" fileName:@"Material Details.pdf"];
[objMFMailComposeViewController setMessageBody:@"" isHTML:NO];
[self presentModalViewController:objMFMailComposeViewController animated:YES];
}
its is default functionality as you can try it by Email a Image from photo gallery. it shows image preview