I attached a file to the mail I am using this code.
[mail addAttachmentData:[myView PDFData] mimeType:@\"application/pdf\" fileName:@\"name.pdf\"];
You should read through the Drawing and Printing Guide for iOS. The printingItem
property of UIPrintInteractionController can be set to the NSData
of a PDF.
Update for added code
The value of dataFromPath should be equal to [myView PDFData] although I would recommend changing the variable name once you get it working.
NSData *dataFromPath = [myView PDFData];